\left(\left(x \cdot 3\right) \cdot x\right) \cdot y
\left(\left(y \cdot 3\right) \cdot x\right) \cdot x
double f(double x, double y) {
double r757639 = x;
double r757640 = 3.0;
double r757641 = r757639 * r757640;
double r757642 = r757641 * r757639;
double r757643 = y;
double r757644 = r757642 * r757643;
return r757644;
}
double f(double x, double y) {
double r757645 = y;
double r757646 = 3.0;
double r757647 = r757645 * r757646;
double r757648 = x;
double r757649 = r757647 * r757648;
double r757650 = r757649 * r757648;
return r757650;
}




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
rmApplied associate-*l*0.2
rmApplied pow10.2
Applied pow10.2
Applied pow-prod-down0.2
Applied pow10.2
Applied pow-prod-down0.2
Simplified0.3
Taylor expanded around 0 0.2
Simplified0.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))