\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 r863512 = x;
double r863513 = r863512 * r863512;
double r863514 = 3.0;
double r863515 = 2.0;
double r863516 = r863512 * r863515;
double r863517 = r863514 - r863516;
double r863518 = r863513 * r863517;
return r863518;
}
double f(double x) {
double r863519 = x;
double r863520 = r863519 * r863519;
double r863521 = 3.0;
double r863522 = 2.0;
double r863523 = 3.0;
double r863524 = pow(r863519, r863523);
double r863525 = r863522 * r863524;
double r863526 = -r863525;
double r863527 = fma(r863520, r863521, r863526);
return r863527;
}




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 2020027 +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))))