Average Error: 39.6 → 0.4
Time: 6.8s
Precision: 64
Internal Precision: 1344
\[\frac{e^{x} - 1}{x}\]
\[\begin{array}{l} \mathbf{if}\;x \le -0.00014389998385058397:\\ \;\;\;\;\frac{e^{x + x} - 1}{x \cdot \left(e^{x} + 1\right)}\\ \mathbf{else}:\\ \;\;\;\;\left(x \cdot \frac{1}{2} + \frac{1}{6} \cdot {x}^{2}\right) + 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 x < -0.00014389998385058397

    1. Initial program 0.1

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

      \[\leadsto \frac{\color{blue}{\frac{e^{x} \cdot e^{x} - 1 \cdot 1}{e^{x} + 1}}}{x}\]
    4. Applied associate-/l/0.1

      \[\leadsto \color{blue}{\frac{e^{x} \cdot e^{x} - 1 \cdot 1}{x \cdot \left(e^{x} + 1\right)}}\]
    5. Simplified0.1

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

    if -0.00014389998385058397 < x

    1. Initial program 59.9

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \le -0.00014389998385058397:\\ \;\;\;\;\frac{e^{x + x} - 1}{x \cdot \left(e^{x} + 1\right)}\\ \mathbf{else}:\\ \;\;\;\;\left(x \cdot \frac{1}{2} + \frac{1}{6} \cdot {x}^{2}\right) + 1\\ \end{array}\]

Runtime

Time bar (total: 6.8s)Debug log

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