\left(x \cdot x\right) \cdot \left(3 - x \cdot 2\right)
x \cdot \left(3 \cdot x\right) + x \cdot \left(\left(-x \cdot 2\right) \cdot x\right)
double f(double x) {
double r773642 = x;
double r773643 = r773642 * r773642;
double r773644 = 3.0;
double r773645 = 2.0;
double r773646 = r773642 * r773645;
double r773647 = r773644 - r773646;
double r773648 = r773643 * r773647;
return r773648;
}
double f(double x) {
double r773649 = x;
double r773650 = 3.0;
double r773651 = r773650 * r773649;
double r773652 = r773649 * r773651;
double r773653 = 2.0;
double r773654 = r773649 * r773653;
double r773655 = -r773654;
double r773656 = r773655 * r773649;
double r773657 = r773649 * r773656;
double r773658 = r773652 + r773657;
return r773658;
}




Bits error versus x
Results
| Original | 0.2 |
|---|---|
| Target | 0.2 |
| Herbie | 0.2 |
Initial program 0.2
rmApplied associate-*l*0.2
rmApplied sub-neg0.2
Applied distribute-rgt-in0.2
Applied distribute-lft-in0.2
Final simplification0.2
herbie shell --seed 2019209
(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))))