Average Error: 30.4 → 0.0
Time: 10.1s
Precision: 64
Internal Precision: 2368
\[\frac{1}{1 - e^{-x}} - \frac{1}{x}\]
\[\begin{array}{l} \mathbf{if}\;x \le -0.02053941282272766 \lor \neg \left(x \le 0.013681879616774329\right):\\ \;\;\;\;\frac{1}{1 - e^{-x}} - \frac{1}{x}\\ \mathbf{else}:\\ \;\;\;\;\left(x \cdot \frac{1}{12} + \frac{1}{2}\right) - {x}^{3} \cdot \frac{1}{720}\\ \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 x < -0.02053941282272766 or 0.013681879616774329 < x

    1. Initial program 0.0

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

      \[\leadsto \color{blue}{\frac{1}{1 - e^{-1 \cdot x}}} - \frac{1}{x}\]
    3. Simplified0.0

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

    if -0.02053941282272766 < x < 0.013681879616774329

    1. Initial program 61.2

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

      \[\leadsto \color{blue}{\left(\frac{1}{12} \cdot x + \frac{1}{2}\right) - \frac{1}{720} \cdot {x}^{3}}\]
  3. Recombined 2 regimes into one program.
  4. Final simplification0.0

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \le -0.02053941282272766 \lor \neg \left(x \le 0.013681879616774329\right):\\ \;\;\;\;\frac{1}{1 - e^{-x}} - \frac{1}{x}\\ \mathbf{else}:\\ \;\;\;\;\left(x \cdot \frac{1}{12} + \frac{1}{2}\right) - {x}^{3} \cdot \frac{1}{720}\\ \end{array}\]

Runtime

Time bar (total: 10.1s)Debug log

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