\left(\left(x \cdot 3\right) \cdot y\right) \cdot y
\left(y \cdot x\right) \cdot \left(y \cdot 3\right)
double f(double x, double y) {
double r399058 = x;
double r399059 = 3.0;
double r399060 = r399058 * r399059;
double r399061 = y;
double r399062 = r399060 * r399061;
double r399063 = r399062 * r399061;
return r399063;
}
double f(double x, double y) {
double r399064 = y;
double r399065 = x;
double r399066 = r399064 * r399065;
double r399067 = 3.0;
double r399068 = r399064 * r399067;
double r399069 = r399066 * r399068;
return r399069;
}




Bits error versus x




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