double code(double x, double y, double z, double t) {
return ((double) (((double) (((double) (x * x)) / ((double) (y * y)))) + ((double) (((double) (z * z)) / ((double) (t * t))))));
}
double code(double x, double y, double z, double t) {
double VAR;
if (((((double) (t * t)) <= 1.4629005988533672e+55) || !(((double) (t * t)) <= 7.1815022956415805e+289))) {
VAR = ((double) (((double) (((double) (1.0 / ((double) (((double) cbrt(y)) * ((double) cbrt(y)))))) * ((double) (((double) (x / y)) * ((double) (x / ((double) cbrt(y)))))))) + ((double) (((double) (z / t)) * ((double) (z / t))))));
} else {
VAR = ((double) (((double) (((double) (z / t)) * ((double) (z / t)))) + ((double) (x * ((double) (((double) (x / y)) * ((double) (1.0 / y))))))));
}
return VAR;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
Results
| Original | 33.9 |
|---|---|
| Target | 0.4 |
| Herbie | 3.2 |
if (* t t) < 1.4629005988533672e55 or 7.1815022956415805e289 < (* t t) Initial program 35.9
Simplified28.2
rmApplied add-sqr-sqrt45.8
Applied times-frac40.5
Applied add-sqr-sqrt40.5
Applied unswap-sqr38.3
Simplified38.3
Simplified13.2
rmApplied add-sqr-sqrt38.5
Applied times-frac33.9
Applied add-sqr-sqrt33.9
Applied unswap-sqr32.2
Simplified32.1
Simplified0.4
rmApplied add-cube-cbrt0.8
Applied *-un-lft-identity0.8
Applied times-frac0.8
Applied associate-*l*2.9
Simplified2.9
if 1.4629005988533672e55 < (* t t) < 7.1815022956415805e289Initial program 27.6
Simplified13.6
rmApplied add-sqr-sqrt38.7
Applied times-frac38.7
Applied add-sqr-sqrt38.8
Applied unswap-sqr38.8
Simplified38.7
Simplified13.7
rmApplied *-un-lft-identity13.7
Applied times-frac4.4
Final simplification3.2
herbie shell --seed 2020180
(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))))