Average Error: 29.9 → 0.6
Time: 40.9s
Precision: 64
Internal Precision: 1408
\[\left(e^{x} - 2\right) + e^{-x}\]
\[{x}^{6} \cdot \frac{1}{360} + \left(\frac{1}{12} \cdot {x}^{4} + x \cdot x\right)\]

Error

Bits error versus x

Target

Original29.9
Target0.0
Herbie0.6
\[4 \cdot {\left(\sinh \left(\frac{x}{2}\right)\right)}^{2}\]

Derivation

  1. Initial program 29.9

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

    \[\leadsto \color{blue}{{x}^{2} + \left(\frac{1}{12} \cdot {x}^{4} + \frac{1}{360} \cdot {x}^{6}\right)}\]
  3. Taylor expanded around -inf 62.8

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

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

Runtime

Time bar (total: 40.9s)Debug logProfile

herbie shell --seed '#(1070609872 3456127585 2380521889 2328837196 1765472538 734540918)' 
(FPCore (x)
  :name "exp2 (problem 3.3.7)"

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

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