Average Error: 29.9 → 0.2
Time: 13.8s
Precision: 64
Internal Precision: 1344
\[\frac{1}{1 - e^{-x}}\]
\[\begin{array}{l} \mathbf{if}\;1 - e^{-x} \le -8.018372053930194 \cdot 10^{+88}:\\ \;\;\;\;\frac{-1}{e^{-x} - 1}\\ \mathbf{if}\;1 - e^{-x} \le 1.5478441742811143 \cdot 10^{-06}:\\ \;\;\;\;\frac{1}{x} + \left(\frac{1}{2} + \frac{1}{12} \cdot x\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{-1}{e^{-x} - 1}\\ \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 (- 1 (exp (- x))) < -8.018372053930194e+88 or 1.5478441742811143e-06 < (- 1 (exp (- x)))

    1. Initial program 0.1

      \[\frac{1}{1 - e^{-x}}\]
    2. Using strategy rm
    3. Applied frac-2neg0.1

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

      \[\leadsto \frac{-1}{\color{blue}{e^{-x} - 1}}\]

    if -8.018372053930194e+88 < (- 1 (exp (- x))) < 1.5478441742811143e-06

    1. Initial program 60.3

      \[\frac{1}{1 - e^{-x}}\]
    2. Taylor expanded around 0 0.3

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

Runtime

Time bar (total: 13.8s)Debug log

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