\left(\left(x \cdot 3\right) \cdot x\right) \cdot y
x \cdot \left(x \cdot \left(3 \cdot y\right)\right)
double f(double x, double y) {
double r680107 = x;
double r680108 = 3.0;
double r680109 = r680107 * r680108;
double r680110 = r680109 * r680107;
double r680111 = y;
double r680112 = r680110 * r680111;
return r680112;
}
double f(double x, double y) {
double r680113 = x;
double r680114 = 3.0;
double r680115 = y;
double r680116 = r680114 * r680115;
double r680117 = r680113 * r680116;
double r680118 = r680113 * r680117;
return r680118;
}




Bits error versus x




Bits error versus y
Results
| Original | 9.8 |
|---|---|
| Target | 0.2 |
| Herbie | 0.3 |
Initial program 9.8
rmApplied associate-*l*0.2
rmApplied associate-*l*0.2
rmApplied associate-*r*0.2
Simplified0.2
rmApplied associate-*l*0.3
Final simplification0.3
herbie shell --seed 2019303
(FPCore (x y)
:name "Diagrams.Segment:$catParam from diagrams-lib-1.3.0.3, A"
:precision binary64
:herbie-target
(* (* x 3) (* x y))
(* (* (* x 3) x) y))