\left(e^{x} - 2\right) + e^{-x}\mathsf{fma}\left(\left(\log \left(e^{\left(\left(x \cdot x\right) \cdot \left(x \cdot x\right)\right) \cdot \frac{1}{360}}\right)\right), \left(x \cdot x\right), \left(\mathsf{fma}\left(\left(\left(x \cdot x\right) \cdot \left(x \cdot x\right)\right), \frac{1}{12}, \left(x \cdot x\right)\right)\right)\right)double f(double x) {
double r6813345 = x;
double r6813346 = exp(r6813345);
double r6813347 = 2.0;
double r6813348 = r6813346 - r6813347;
double r6813349 = -r6813345;
double r6813350 = exp(r6813349);
double r6813351 = r6813348 + r6813350;
return r6813351;
}
double f(double x) {
double r6813352 = x;
double r6813353 = r6813352 * r6813352;
double r6813354 = r6813353 * r6813353;
double r6813355 = 0.002777777777777778;
double r6813356 = r6813354 * r6813355;
double r6813357 = exp(r6813356);
double r6813358 = log(r6813357);
double r6813359 = 0.08333333333333333;
double r6813360 = fma(r6813354, r6813359, r6813353);
double r6813361 = fma(r6813358, r6813353, r6813360);
return r6813361;
}




Bits error versus x
| Original | 29.3 |
|---|---|
| Target | 0.0 |
| Herbie | 0.6 |
Initial program 29.3
Simplified29.3
Taylor expanded around 0 0.6
Simplified0.6
rmApplied add-log-exp0.6
Final simplification0.6
herbie shell --seed 2019121 +o rules:numerics
(FPCore (x)
:name "exp2 (problem 3.3.7)"
:herbie-target
(* 4 (pow (sinh (/ x 2)) 2))
(+ (- (exp x) 2) (exp (- x))))