Average Error: 58.8 → 0.3
Time: 20.3s
Precision: 64
Internal Precision: 1344
\[e^{x} - 1\]
\[e^{\frac{1}{2} \cdot x} \cdot \left(e^{{x}^{2} \cdot \frac{1}{24}} \cdot x\right)\]

Error

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

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

Derivation

  1. Initial program 58.8

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

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

    \[\leadsto \color{blue}{x + \left(x \cdot \frac{1}{6} + \frac{1}{2}\right) \cdot \left(x \cdot x\right)}\]
  4. Using strategy rm
  5. Applied add-exp-log34.9

    \[\leadsto \color{blue}{e^{\log \left(x + \left(x \cdot \frac{1}{6} + \frac{1}{2}\right) \cdot \left(x \cdot x\right)\right)}}\]
  6. Taylor expanded around 0 34.9

    \[\leadsto e^{\color{blue}{\frac{1}{2} \cdot x + \left(\frac{1}{24} \cdot {x}^{2} + \log x\right)}}\]
  7. Using strategy rm
  8. Applied add-log-exp34.9

    \[\leadsto e^{\frac{1}{2} \cdot x + \left(\color{blue}{\log \left(e^{\frac{1}{24} \cdot {x}^{2}}\right)} + \log x\right)}\]
  9. Applied sum-log34.9

    \[\leadsto e^{\frac{1}{2} \cdot x + \color{blue}{\log \left(e^{\frac{1}{24} \cdot {x}^{2}} \cdot x\right)}}\]
  10. Applied add-log-exp34.9

    \[\leadsto e^{\color{blue}{\log \left(e^{\frac{1}{2} \cdot x}\right)} + \log \left(e^{\frac{1}{24} \cdot {x}^{2}} \cdot x\right)}\]
  11. Applied sum-log34.9

    \[\leadsto e^{\color{blue}{\log \left(e^{\frac{1}{2} \cdot x} \cdot \left(e^{\frac{1}{24} \cdot {x}^{2}} \cdot x\right)\right)}}\]
  12. Applied rem-exp-log0.3

    \[\leadsto \color{blue}{e^{\frac{1}{2} \cdot x} \cdot \left(e^{\frac{1}{24} \cdot {x}^{2}} \cdot x\right)}\]
  13. Final simplification0.3

    \[\leadsto e^{\frac{1}{2} \cdot x} \cdot \left(e^{{x}^{2} \cdot \frac{1}{24}} \cdot x\right)\]

Runtime

Time bar (total: 20.3s)Debug logProfile

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

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

  (- (exp x) 1))