Average Error: 59.4 → 0.1
Time: 4.6s
Precision: 64
Internal precision: 1408
\[e^{x} - 1\]
\[x + \left(x \cdot x\right) \cdot \left(\frac{1}{2} + \frac{1}{6} \cdot x\right)\]

Error

Bits error versus x

Target

Original59.4
Comparison0.1
Herbie0.1
\[ x \cdot \left(\left(1 + \frac{x}{2}\right) + \frac{{x}^2}{6}\right) \]

Derivation

  1. Initial program 59.4

    \[e^{x} - 1\]
  2. Applied taylor 0.1

    \[\leadsto \frac{1}{2} \cdot {x}^{2} + \left(\frac{1}{6} \cdot {x}^{3} + x\right)\]
  3. Taylor expanded around 0 0.1

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

    \[\leadsto \color{blue}{x + \left(x \cdot x\right) \cdot \left(\frac{1}{2} + \frac{1}{6} \cdot x\right)}\]
  5. Removed slow pow expressions

Runtime

Time bar (total: 4.6s) Debug logProfile

Please include this information when filing a bug report:

herbie shell --seed '#(1067901057 3396600083 3715501224 3126139233 3908045574 1593683916)'
(FPCore (x)
  :name "expm1 (example 3.7)"
  :pre (< -0.00017 x)

  :target
  (* x (+ (+ 1 (/ x 2)) (/ (sqr x) 6)))

  (- (exp x) 1))