Average Error: 33.5 → 0.2
Time: 27.1s
Precision: 64
Internal precision: 128
\[\left(e^{x} - 2\right) + e^{-x}\]
\[{x}^2 + \left(\frac{1}{12} \cdot {x}^{4} + \frac{1}{360} \cdot {x}^{6}\right)\]

Error

Bits error versus x

Target

Original33.5
Comparison8.7
Herbie0.2
\[ 4 \cdot {\left(\sinh \left(\frac{x}{2}\right)\right)}^2 \]

Derivation

  1. Initial program 33.5

    \[\left(e^{x} - 2\right) + e^{-x}\]
  2. Applied taylor 0.2

    \[\leadsto {x}^2 + \left(\frac{1}{12} \cdot {x}^{4} + \frac{1}{360} \cdot {x}^{6}\right)\]
  3. Taylor expanded around 0 0.2

    \[\leadsto \color{blue}{{x}^2 + \left(\frac{1}{12} \cdot {x}^{4} + \frac{1}{360} \cdot {x}^{6}\right)}\]
  4. Removed slow pow expressions

Runtime

Time bar (total: 27.1s) Debug log

Please include this information when filing a bug report:

herbie --seed '#(4126801257 3433776004 2402292162 1397960733 314377878 4279731210)'
(FPCore (x)
  :name "exp2 (problem 3.3.7)"

  :target
  (* 4 (sqr (sinh (/ x 2))))

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