Average Error: 30.1 → 0.2
Time: 17.4s
Precision: 64
Internal Precision: 1344
\[\log \left(1 - e^{x}\right)\]
\[\begin{array}{l} \mathbf{if}\;\log \left(1 - e^{x}\right) \le -8.657833539492271:\\ \;\;\;\;\log \left(\left(x \cdot x\right) \cdot \left(\left(-\frac{1}{2}\right) - \frac{1}{6} \cdot x\right) - x\right)\\ \mathbf{else}:\\ \;\;\;\;\log \left(\frac{{1}^{3} - {\left(e^{x + x}\right)}^{3}}{\left(e^{x + x} \cdot \left(1 + e^{x}\right)\right) \cdot \left(e^{x + x} + 1\right) + \left(1 + e^{x}\right)}\right)\\ \end{array}\]

Error

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Split input into 2 regimes
  2. if (log (- 1 (exp x))) < -8.657833539492271

    1. Initial program 60.3

      \[\log \left(1 - e^{x}\right)\]
    2. Taylor expanded around 0 0.0

      \[\leadsto \log \color{blue}{\left(-\left(\frac{1}{6} \cdot {x}^{3} + \left(\frac{1}{2} \cdot {x}^{2} + x\right)\right)\right)}\]
    3. Applied simplify0.0

      \[\leadsto \color{blue}{\log \left(\left(x \cdot x\right) \cdot \left(\left(-\frac{1}{2}\right) - \frac{1}{6} \cdot x\right) - x\right)}\]

    if -8.657833539492271 < (log (- 1 (exp x)))

    1. Initial program 0.4

      \[\log \left(1 - e^{x}\right)\]
    2. Using strategy rm
    3. Applied flip--0.4

      \[\leadsto \log \color{blue}{\left(\frac{1 \cdot 1 - e^{x} \cdot e^{x}}{1 + e^{x}}\right)}\]
    4. Applied simplify0.4

      \[\leadsto \log \left(\frac{\color{blue}{1 - e^{x + x}}}{1 + e^{x}}\right)\]
    5. Using strategy rm
    6. Applied flip3--0.4

      \[\leadsto \log \left(\frac{\color{blue}{\frac{{1}^{3} - {\left(e^{x + x}\right)}^{3}}{1 \cdot 1 + \left(e^{x + x} \cdot e^{x + x} + 1 \cdot e^{x + x}\right)}}}{1 + e^{x}}\right)\]
    7. Applied associate-/l/0.4

      \[\leadsto \log \color{blue}{\left(\frac{{1}^{3} - {\left(e^{x + x}\right)}^{3}}{\left(1 + e^{x}\right) \cdot \left(1 \cdot 1 + \left(e^{x + x} \cdot e^{x + x} + 1 \cdot e^{x + x}\right)\right)}\right)}\]
    8. Applied simplify0.4

      \[\leadsto \log \left(\frac{{1}^{3} - {\left(e^{x + x}\right)}^{3}}{\color{blue}{\left(e^{x + x} \cdot \left(1 + e^{x}\right)\right) \cdot \left(e^{x + x} + 1\right) + \left(1 + e^{x}\right)}}\right)\]
  3. Recombined 2 regimes into one program.

Runtime

Time bar (total: 17.4s)Debug log

herbie shell --seed '#(2775764126 3555076145 3898259844 1891440260 2599947619 1948460636)' 
(FPCore (x)
  :name "log(1-exp(x))"
  (log (- 1 (exp x))))