\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 r921282 = x;
double r921283 = r921282 * r921282;
double r921284 = 3.0;
double r921285 = 2.0;
double r921286 = r921282 * r921285;
double r921287 = r921284 - r921286;
double r921288 = r921283 * r921287;
return r921288;
}
double f(double x) {
double r921289 = x;
double r921290 = r921289 * r921289;
double r921291 = 3.0;
double r921292 = 2.0;
double r921293 = 3.0;
double r921294 = pow(r921289, r921293);
double r921295 = r921292 * r921294;
double r921296 = -r921295;
double r921297 = fma(r921290, r921291, r921296);
return r921297;
}




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