Average Error: 29.9 → 0.5
Time: 5.4s
Precision: 64
\[\left(e^{x} - 2\right) + e^{-x}\]
\[\left({x}^{2} + \frac{1}{360} \cdot {x}^{6}\right) + \frac{1}{12} \cdot {x}^{4}\]
\left(e^{x} - 2\right) + e^{-x}
\left({x}^{2} + \frac{1}{360} \cdot {x}^{6}\right) + \frac{1}{12} \cdot {x}^{4}
double f(double x) {
        double r64991 = x;
        double r64992 = exp(r64991);
        double r64993 = 2.0;
        double r64994 = r64992 - r64993;
        double r64995 = -r64991;
        double r64996 = exp(r64995);
        double r64997 = r64994 + r64996;
        return r64997;
}

double f(double x) {
        double r64998 = x;
        double r64999 = 2.0;
        double r65000 = pow(r64998, r64999);
        double r65001 = 0.002777777777777778;
        double r65002 = 6.0;
        double r65003 = pow(r64998, r65002);
        double r65004 = r65001 * r65003;
        double r65005 = r65000 + r65004;
        double r65006 = 0.08333333333333333;
        double r65007 = 4.0;
        double r65008 = pow(r64998, r65007);
        double r65009 = r65006 * r65008;
        double r65010 = r65005 + r65009;
        return r65010;
}

Error

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

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

    \[\leadsto \color{blue}{{x}^{2} + \left(\frac{1}{360} \cdot {x}^{6} + \frac{1}{12} \cdot {x}^{4}\right)}\]
  3. Using strategy rm
  4. Applied associate-+r+0.5

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

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

Reproduce

herbie shell --seed 2020089 
(FPCore (x)
  :name "exp2 (problem 3.3.7)"
  :precision binary64

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

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