\frac{x \cdot x}{y \cdot y} + \frac{z \cdot z}{t \cdot t}\frac{x}{y} \cdot \frac{x}{y} + \frac{\sqrt[3]{z}}{\sqrt[3]{t}} \cdot \left(\frac{z}{t} \cdot \left(\frac{\sqrt[3]{z}}{\sqrt[3]{t}} \cdot \frac{\sqrt[3]{z}}{\sqrt[3]{t}}\right)\right)(FPCore (x y z t) :precision binary64 (+ (/ (* x x) (* y y)) (/ (* z z) (* t t))))
(FPCore (x y z t) :precision binary64 (+ (* (/ x y) (/ x y)) (* (/ (cbrt z) (cbrt t)) (* (/ z t) (* (/ (cbrt z) (cbrt t)) (/ (cbrt z) (cbrt t)))))))
double code(double x, double y, double z, double t) {
return ((double) ((((double) (x * x)) / ((double) (y * y))) + (((double) (z * z)) / ((double) (t * t)))));
}
double code(double x, double y, double z, double t) {
return ((double) (((double) ((x / y) * (x / y))) + ((double) ((((double) cbrt(z)) / ((double) cbrt(t))) * ((double) ((z / t) * ((double) ((((double) cbrt(z)) / ((double) cbrt(t))) * (((double) cbrt(z)) / ((double) cbrt(t)))))))))));
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
Results
| Original | 34.0 |
|---|---|
| Target | 0.4 |
| Herbie | 0.9 |
Initial program 34.0
Simplified25.0
rmApplied add-sqr-sqrt44.4
Applied times-frac40.6
Applied add-sqr-sqrt40.7
Applied unswap-sqr38.9
Simplified38.8
Simplified13.3
rmApplied add-sqr-sqrt38.7
Applied times-frac34.1
Applied add-sqr-sqrt34.1
Applied unswap-sqr32.2
Simplified32.1
Simplified0.4
rmApplied add-cube-cbrt0.8
Applied add-cube-cbrt0.9
Applied times-frac0.9
Applied associate-*r*0.9
Simplified0.9
Final simplification0.9
herbie shell --seed 2020198
(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.0) (pow (/ z t) 2.0))
(+ (/ (* x x) (* y y)) (/ (* z z) (* t t))))