Average Error: 29.3 → 0.6
Time: 10.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 r103976 = x;
        double r103977 = exp(r103976);
        double r103978 = 2.0;
        double r103979 = r103977 - r103978;
        double r103980 = -r103976;
        double r103981 = exp(r103980);
        double r103982 = r103979 + r103981;
        return r103982;
}

double f(double x) {
        double r103983 = x;
        double r103984 = 2.0;
        double r103985 = pow(r103983, r103984);
        double r103986 = 0.002777777777777778;
        double r103987 = 6.0;
        double r103988 = pow(r103983, r103987);
        double r103989 = r103986 * r103988;
        double r103990 = r103985 + r103989;
        double r103991 = 0.08333333333333333;
        double r103992 = 4.0;
        double r103993 = pow(r103983, r103992);
        double r103994 = r103991 * r103993;
        double r103995 = r103990 + r103994;
        return r103995;
}

Error

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

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

Derivation

  1. Initial program 29.3

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

    \[\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.6

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

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

Reproduce

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

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

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