\left(\left(x \cdot 3\right) \cdot x\right) \cdot y
x \cdot \left(\left(3 \cdot x\right) \cdot y\right)
double f(double x, double y) {
double r743922 = x;
double r743923 = 3.0;
double r743924 = r743922 * r743923;
double r743925 = r743924 * r743922;
double r743926 = y;
double r743927 = r743925 * r743926;
return r743927;
}
double f(double x, double y) {
double r743928 = x;
double r743929 = 3.0;
double r743930 = r743929 * r743928;
double r743931 = y;
double r743932 = r743930 * r743931;
double r743933 = r743928 * r743932;
return r743933;
}




Bits error versus x




Bits error versus y
Results
| Original | 10.7 |
|---|---|
| Target | 0.3 |
| Herbie | 0.2 |
Initial program 10.7
rmApplied associate-*l*0.3
rmApplied associate-*l*0.2
rmApplied associate-*r*0.2
Final simplification0.2
herbie shell --seed 2020081 +o rules:numerics
(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))