\frac{x \cdot x}{y \cdot y} + \frac{z \cdot z}{t \cdot t}\begin{array}{l}
\mathbf{if}\;z \cdot z \leq 5.6706044911068 \cdot 10^{+264}:\\
\;\;\;\;\frac{x}{y} \cdot \frac{x}{y} + \frac{z \cdot \frac{z}{t}}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y} \cdot \frac{x}{y} + z \cdot \frac{1}{t \cdot \frac{t}{z}}\\
\end{array}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) {
double VAR;
if ((((double) (z * z)) <= 5.6706044911068e+264)) {
VAR = ((double) (((double) ((x / y) * (x / y))) + (((double) (z * (z / t))) / t)));
} else {
VAR = ((double) (((double) ((x / y) * (x / y))) + ((double) (z * (1.0 / ((double) (t * (t / z))))))));
}
return VAR;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
Results
| Original | 33.4 |
|---|---|
| Target | 0.4 |
| Herbie | 2.2 |
if (* z z) < 5.6706044911067997e264Initial program 28.8
Simplified22.7
rmApplied add-sqr-sqrt43.1
Applied times-frac39.1
Applied add-sqr-sqrt39.1
Applied unswap-sqr37.2
Simplified37.1
Simplified10.8
rmApplied *-un-lft-identity10.8
Applied times-frac4.1
rmApplied associate-*r/4.1
Applied associate-*r/1.7
Simplified1.7
if 5.6706044911067997e264 < (* z z) Initial program 58.5
Simplified32.1
rmApplied add-sqr-sqrt47.9
Applied times-frac45.3
Applied add-sqr-sqrt45.3
Applied unswap-sqr43.9
Simplified43.9
Simplified24.1
rmApplied clear-num24.1
Simplified5.2
Final simplification2.2
herbie shell --seed 2020199
(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))))