Average Error: 29.1 → 0.7
Time: 7.2s
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 r135207 = x;
        double r135208 = exp(r135207);
        double r135209 = 2.0;
        double r135210 = r135208 - r135209;
        double r135211 = -r135207;
        double r135212 = exp(r135211);
        double r135213 = r135210 + r135212;
        return r135213;
}

double f(double x) {
        double r135214 = x;
        double r135215 = 2.0;
        double r135216 = pow(r135214, r135215);
        double r135217 = 0.002777777777777778;
        double r135218 = 6.0;
        double r135219 = pow(r135214, r135218);
        double r135220 = r135217 * r135219;
        double r135221 = r135216 + r135220;
        double r135222 = 0.08333333333333333;
        double r135223 = 4.0;
        double r135224 = pow(r135214, r135223);
        double r135225 = r135222 * r135224;
        double r135226 = r135221 + r135225;
        return r135226;
}

Error

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

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

Derivation

  1. Initial program 29.1

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

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

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

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

Reproduce

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

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

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