\left(x \cdot x\right) \cdot \left(3 - x \cdot 2\right)
\left(x \cdot 3\right) \cdot x + \left(-\left(\left(x \cdot x\right) \cdot 2\right) \cdot x\right)
double f(double x) {
double r454306 = x;
double r454307 = r454306 * r454306;
double r454308 = 3.0;
double r454309 = 2.0;
double r454310 = r454306 * r454309;
double r454311 = r454308 - r454310;
double r454312 = r454307 * r454311;
return r454312;
}
double f(double x) {
double r454313 = x;
double r454314 = 3.0;
double r454315 = r454313 * r454314;
double r454316 = r454315 * r454313;
double r454317 = r454313 * r454313;
double r454318 = 2.0;
double r454319 = r454317 * r454318;
double r454320 = r454319 * r454313;
double r454321 = -r454320;
double r454322 = r454316 + r454321;
return r454322;
}




Bits error versus x
Results
| Original | 0.2 |
|---|---|
| Target | 0.2 |
| Herbie | 0.2 |
Initial program 0.2
rmApplied sub-neg0.2
Applied distribute-lft-in0.2
Simplified0.2
Simplified0.1
rmApplied unpow30.2
Applied associate-*r*0.2
Simplified0.2
Final simplification0.2
herbie shell --seed 2019306 +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))))