\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 r816943 = x;
double r816944 = 3.0;
double r816945 = r816943 * r816944;
double r816946 = r816945 * r816943;
double r816947 = y;
double r816948 = r816946 * r816947;
return r816948;
}
double f(double x, double y) {
double r816949 = x;
double r816950 = 3.0;
double r816951 = y;
double r816952 = r816950 * r816951;
double r816953 = r816949 * r816952;
double r816954 = r816949 * r816953;
return r816954;
}




Bits error versus x




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