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

Error

Bits error versus x

Target

Original29.9
Target0.0
Herbie0.7
\[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. Initial simplification29.9

    \[\leadsto \left(e^{x} - 2\right) - \frac{-1}{e^{x}}\]
  3. 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)}\]
  4. Simplified0.7

    \[\leadsto \color{blue}{(\frac{1}{12} \cdot \left({x}^{4}\right) + \left((\frac{1}{360} \cdot \left({x}^{6}\right) + \left(x \cdot x\right))_*\right))_*}\]
  5. Using strategy rm
  6. Applied add-sqr-sqrt0.7

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

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

Runtime

Time bar (total: 50.6s)Debug logProfile

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

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

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