\left(\left(x \cdot 3\right) \cdot x\right) \cdot y
3 \cdot \left(\left(x \cdot y\right) \cdot x\right)
double f(double x, double y) {
double r462184 = x;
double r462185 = 3.0;
double r462186 = r462184 * r462185;
double r462187 = r462186 * r462184;
double r462188 = y;
double r462189 = r462187 * r462188;
return r462189;
}
double f(double x, double y) {
double r462190 = 3.0;
double r462191 = x;
double r462192 = y;
double r462193 = r462191 * r462192;
double r462194 = r462193 * r462191;
double r462195 = r462190 * r462194;
return r462195;
}




Bits error versus x




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