\left(\left(x \cdot 3\right) \cdot y\right) \cdot y
\left(x \cdot y\right) \cdot \left(3 \cdot y\right)
double f(double x, double y) {
double r814322 = x;
double r814323 = 3.0;
double r814324 = r814322 * r814323;
double r814325 = y;
double r814326 = r814324 * r814325;
double r814327 = r814326 * r814325;
return r814327;
}
double f(double x, double y) {
double r814328 = x;
double r814329 = y;
double r814330 = r814328 * r814329;
double r814331 = 3.0;
double r814332 = r814331 * r814329;
double r814333 = r814330 * r814332;
return r814333;
}




Bits error versus x




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