\frac{x \cdot x}{y \cdot y} + \frac{z \cdot z}{t \cdot t}\begin{array}{l}
\mathbf{if}\;z \le -6.28037951004661684 \cdot 10^{164}:\\
\;\;\;\;x \cdot \frac{\frac{x}{y}}{y} + \frac{z}{t} \cdot \frac{z}{t}\\
\mathbf{elif}\;z \le 6.24132298638735279 \cdot 10^{95}:\\
\;\;\;\;\frac{x}{y} \cdot \frac{x}{y} + \left(z \cdot \frac{z}{t}\right) \cdot \frac{1}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot \frac{x}{y}}{y} + \frac{z}{t} \cdot \frac{z}{t}\\
\end{array}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 ((z <= -6.280379510046617e+164)) {
VAR = ((double) (((double) (x * ((double) (((double) (x / y)) / y)))) + ((double) (((double) (z / t)) * ((double) (z / t))))));
} else {
double VAR_1;
if ((z <= 6.241322986387353e+95)) {
VAR_1 = ((double) (((double) (((double) (x / y)) * ((double) (x / y)))) + ((double) (((double) (z * ((double) (z / t)))) * ((double) (1.0 / t))))));
} else {
VAR_1 = ((double) (((double) (((double) (x * ((double) (x / y)))) / y)) + ((double) (((double) (z / t)) * ((double) (z / t))))));
}
VAR = VAR_1;
}
return VAR;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
Results
| Original | 33.2 |
|---|---|
| Target | 0.4 |
| Herbie | 2.1 |
if z < -6.28037951004661684e164Initial program 64.0
rmApplied times-frac64.0
rmApplied times-frac0.5
rmApplied *-un-lft-identity0.5
Applied add-sqr-sqrt31.8
Applied times-frac31.7
Applied *-un-lft-identity31.7
Applied add-sqr-sqrt31.8
Applied times-frac31.8
Applied swap-sqr32.7
Simplified32.7
Simplified3.0
if -6.28037951004661684e164 < z < 6.24132298638735279e95Initial program 29.0
rmApplied times-frac13.0
rmApplied times-frac0.4
rmApplied div-inv0.4
Applied associate-*r*1.9
Simplified1.9
if 6.24132298638735279e95 < z Initial program 51.3
rmApplied times-frac44.7
rmApplied times-frac0.5
rmApplied associate-*r/3.7
Simplified3.7
Final simplification2.1
herbie shell --seed 2020161
(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))))