Average Error: 29.7 → 0.7
Time: 5.1s
Precision: 64
\[\left(e^{x} - 2\right) + e^{-x}\]
\[\sqrt{{x}^{2} + \left(\frac{1}{360} \cdot {x}^{6} + \frac{1}{12} \cdot {x}^{4}\right)} \cdot \sqrt{{x}^{2} + \left(\frac{1}{360} \cdot {x}^{6} + \frac{1}{12} \cdot {x}^{4}\right)}\]
\left(e^{x} - 2\right) + e^{-x}
\sqrt{{x}^{2} + \left(\frac{1}{360} \cdot {x}^{6} + \frac{1}{12} \cdot {x}^{4}\right)} \cdot \sqrt{{x}^{2} + \left(\frac{1}{360} \cdot {x}^{6} + \frac{1}{12} \cdot {x}^{4}\right)}
double f(double x) {
        double r146088 = x;
        double r146089 = exp(r146088);
        double r146090 = 2.0;
        double r146091 = r146089 - r146090;
        double r146092 = -r146088;
        double r146093 = exp(r146092);
        double r146094 = r146091 + r146093;
        return r146094;
}

double f(double x) {
        double r146095 = x;
        double r146096 = 2.0;
        double r146097 = pow(r146095, r146096);
        double r146098 = 0.002777777777777778;
        double r146099 = 6.0;
        double r146100 = pow(r146095, r146099);
        double r146101 = r146098 * r146100;
        double r146102 = 0.08333333333333333;
        double r146103 = 4.0;
        double r146104 = pow(r146095, r146103);
        double r146105 = r146102 * r146104;
        double r146106 = r146101 + r146105;
        double r146107 = r146097 + r146106;
        double r146108 = sqrt(r146107);
        double r146109 = r146108 * r146108;
        return r146109;
}

Error

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

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

Derivation

  1. Initial program 29.7

    \[\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 add-sqr-sqrt0.7

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

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

Reproduce

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

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

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