\left(\left(x \cdot 3\right) \cdot y\right) \cdot y
y \cdot \left(\left(x \cdot y\right) \cdot 3\right)
double f(double x, double y) {
double r937601 = x;
double r937602 = 3.0;
double r937603 = r937601 * r937602;
double r937604 = y;
double r937605 = r937603 * r937604;
double r937606 = r937605 * r937604;
return r937606;
}
double f(double x, double y) {
double r937607 = y;
double r937608 = x;
double r937609 = r937608 * r937607;
double r937610 = 3.0;
double r937611 = r937609 * r937610;
double r937612 = r937607 * r937611;
return r937612;
}




Bits error versus x




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