\left(\left(x \cdot 3\right) \cdot x\right) \cdot y
x \cdot \left(3 \cdot \left(x \cdot y\right)\right)
double f(double x, double y) {
double r897888 = x;
double r897889 = 3.0;
double r897890 = r897888 * r897889;
double r897891 = r897890 * r897888;
double r897892 = y;
double r897893 = r897891 * r897892;
return r897893;
}
double f(double x, double y) {
double r897894 = x;
double r897895 = 3.0;
double r897896 = y;
double r897897 = r897894 * r897896;
double r897898 = r897895 * r897897;
double r897899 = r897894 * r897898;
return r897899;
}




Bits error versus x




Bits error versus y
Results
| Original | 10.5 |
|---|---|
| Target | 0.3 |
| Herbie | 0.2 |
Initial program 10.5
rmApplied associate-*l*0.3
rmApplied associate-*l*0.2
Final simplification0.2
herbie shell --seed 2020089
(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))