\left(x \cdot x\right) \cdot \left(3 - x \cdot 2\right)
\mathsf{fma}\left(3, {x}^{2}, \left(-{x}^{3}\right) \cdot 2\right)double f(double x) {
double r594670 = x;
double r594671 = r594670 * r594670;
double r594672 = 3.0;
double r594673 = 2.0;
double r594674 = r594670 * r594673;
double r594675 = r594672 - r594674;
double r594676 = r594671 * r594675;
return r594676;
}
double f(double x) {
double r594677 = 3.0;
double r594678 = x;
double r594679 = 2.0;
double r594680 = pow(r594678, r594679);
double r594681 = 3.0;
double r594682 = pow(r594678, r594681);
double r594683 = -r594682;
double r594684 = 2.0;
double r594685 = r594683 * r594684;
double r594686 = fma(r594677, r594680, r594685);
return r594686;
}




Bits error versus x
| Original | 0.2 |
|---|---|
| Target | 0.2 |
| Herbie | 0.1 |
Initial program 0.2
Taylor expanded around 0 0.1
rmApplied fma-neg0.1
Simplified0.1
Final simplification0.1
herbie shell --seed 2019212 +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))))