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

Error

Bits error versus x

Target

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

Derivation

  1. Initial program 58.7

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

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

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

Runtime

Time bar (total: 50.2s)Debug logProfile

herbie shell --seed '#(1071373924 2949776965 1885069702 3247780810 90874544 2263903749)' 
(FPCore (x)
  :name "expm1 (example 3.7)"
  :pre (< -0.00017 x)

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

  (- (exp x) 1))