Average Error: 58.5 → 0.5
Time: 23.0s
Precision: 64
Internal Precision: 1344
\[e^{x} - 1\]
\[\left(x \cdot x\right) \cdot \left(\frac{1}{6} \cdot x + \frac{1}{2}\right) + x\]

Error

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original58.5
Target0.6
Herbie0.5
\[x \cdot \left(\left(1 + \frac{x}{2}\right) + \frac{x \cdot x}{6}\right)\]

Derivation

  1. Initial program 58.5

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

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

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

Runtime

Time bar (total: 23.0s)Debug logProfile

herbie shell --seed 2020178 
(FPCore (x)
  :name "expm1 (example 3.7)"
  :pre (< -0.00017 x)

  :herbie-target
  (* x (+ (+ 1 (/ x 2)) (/ (* x x) 6)))

  (- (exp x) 1))