\left(x \cdot x\right) \cdot \left(3 - x \cdot 2\right)
\mathsf{fma}\left(x \cdot x, 3, -2 \cdot {x}^{3}\right)double f(double x) {
double r799380 = x;
double r799381 = r799380 * r799380;
double r799382 = 3.0;
double r799383 = 2.0;
double r799384 = r799380 * r799383;
double r799385 = r799382 - r799384;
double r799386 = r799381 * r799385;
return r799386;
}
double f(double x) {
double r799387 = x;
double r799388 = r799387 * r799387;
double r799389 = 3.0;
double r799390 = 2.0;
double r799391 = 3.0;
double r799392 = pow(r799387, r799391);
double r799393 = r799390 * r799392;
double r799394 = -r799393;
double r799395 = fma(r799388, r799389, r799394);
return r799395;
}




Bits error versus x
| Original | 0.2 |
|---|---|
| Target | 0.2 |
| Herbie | 0.1 |
Initial program 0.2
rmApplied sub-neg0.2
Applied distribute-lft-in0.2
Simplified0.1
rmApplied fma-def0.1
Final simplification0.1
herbie shell --seed 2020100 +o rules:numerics
(FPCore (x)
:name "Data.Spline.Key:interpolateKeys from smoothie-0.4.0.2"
:precision binary64
:herbie-target
(* x (* x (- 3 (* x 2))))
(* (* x x) (- 3 (* x 2))))