Average Error: 30.2 → 0.7
Time: 1.1m
Precision: 64
Internal Precision: 1344
\[\left(e^{x} - 2\right) + e^{-x}\]
\[(x \cdot x + \left((\frac{1}{360} \cdot \left({x}^{6}\right) + \left(\frac{1}{12} \cdot {x}^{4}\right))_*\right))_*\]

Error

Bits error versus x

Target

Original30.2
Target0.1
Herbie0.7
\[4 \cdot {\left(\sinh \left(\frac{x}{2}\right)\right)}^{2}\]

Derivation

  1. Initial program 30.2

    \[\left(e^{x} - 2\right) + e^{-x}\]
  2. Taylor expanded around 0 0.7

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

    \[\leadsto \color{blue}{(x \cdot x + \left((\frac{1}{360} \cdot \left({x}^{6}\right) + \left(\frac{1}{12} \cdot {x}^{4}\right))_*\right))_*}\]
  4. Final simplification0.7

    \[\leadsto (x \cdot x + \left((\frac{1}{360} \cdot \left({x}^{6}\right) + \left(\frac{1}{12} \cdot {x}^{4}\right))_*\right))_*\]

Runtime

Time bar (total: 1.1m)Debug logProfile

herbie shell --seed 2018214 +o rules:numerics
(FPCore (x)
  :name "exp2 (problem 3.3.7)"

  :herbie-target
  (* 4 (pow (sinh (/ x 2)) 2))

  (+ (- (exp x) 2) (exp (- x))))