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

Error

Bits error versus x

Target

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

Derivation

  1. Initial program 29.7

    \[\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. Using strategy rm
  4. Applied add-log-exp0.8

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

Runtime

Time bar (total: 33.7s)Debug logProfile

herbie shell --seed '#(1070355188 2193211668 3977393919 3454156579 3755371326 1656365382)' 
(FPCore (x)
  :name "exp2 (problem 3.3.7)"

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

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