\frac{x \cdot x}{y \cdot y} + \frac{z \cdot z}{t \cdot t}\frac{x}{y} \cdot \frac{x}{y} + \sqrt[3]{{\left(\sqrt{\left|\frac{z}{t}\right|}\right)}^{3}} \cdot {\left(\sqrt{\left|\frac{z}{t}\right|}\right)}^{3}double code(double x, double y, double z, double t) {
return (((x * x) / (y * y)) + ((z * z) / (t * t)));
}
double code(double x, double y, double z, double t) {
return (((x / y) * (x / y)) + (cbrt(pow(sqrt(fabs((z / t))), 3.0)) * pow(sqrt(fabs((z / t))), 3.0)));
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
Results
| Original | 33.5 |
|---|---|
| Target | 0.4 |
| Herbie | 0.7 |
Initial program 33.5
rmApplied times-frac18.9
rmApplied add-sqr-sqrt18.9
Simplified18.9
Simplified0.4
rmApplied add-sqr-sqrt0.5
Applied associate-*l*0.5
Simplified0.6
rmApplied add-cbrt-cube0.7
Simplified0.7
Final simplification0.7
herbie shell --seed 2020075
(FPCore (x y z t)
:name "Graphics.Rasterific.Svg.PathConverter:arcToSegments from rasterific-svg-0.2.3.1"
:precision binary64
:herbie-target
(+ (pow (/ x y) 2) (pow (/ z t) 2))
(+ (/ (* x x) (* y y)) (/ (* z z) (* t t))))