\frac{x \cdot x}{y \cdot y} + \frac{z \cdot z}{t \cdot t}\begin{array}{l}
\mathbf{if}\;t \leq -1.342217695911771 \cdot 10^{+154}:\\
\;\;\;\;\frac{x}{y} \cdot \frac{x}{y} + \frac{1}{t} \cdot \left(z \cdot \frac{z}{t}\right)\\
\mathbf{elif}\;t \leq -4.396223194186806 \cdot 10^{-140}:\\
\;\;\;\;\frac{x}{y} \cdot \frac{x}{y} + z \cdot \frac{z}{t \cdot t}\\
\mathbf{elif}\;t \leq 3.849433641532173 \cdot 10^{-306}:\\
\;\;\;\;\frac{x}{y} \cdot \frac{x}{y} + \frac{1}{t} \cdot \left(z \cdot \frac{z}{t}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y} \cdot \frac{x}{y} + \frac{\frac{z}{t}}{\sqrt{t}} \cdot \frac{z}{\sqrt{t}}\\
\end{array}(FPCore (x y z t) :precision binary64 (+ (/ (* x x) (* y y)) (/ (* z z) (* t t))))
(FPCore (x y z t)
:precision binary64
(if (<= t -1.342217695911771e+154)
(+ (* (/ x y) (/ x y)) (* (/ 1.0 t) (* z (/ z t))))
(if (<= t -4.396223194186806e-140)
(+ (* (/ x y) (/ x y)) (* z (/ z (* t t))))
(if (<= t 3.849433641532173e-306)
(+ (* (/ x y) (/ x y)) (* (/ 1.0 t) (* z (/ z t))))
(+ (* (/ x y) (/ x y)) (* (/ (/ z t) (sqrt t)) (/ z (sqrt 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) {
double tmp;
if ((t <= -1.342217695911771e+154)) {
tmp = ((double) (((double) ((x / y) * (x / y))) + ((double) ((1.0 / t) * ((double) (z * (z / t)))))));
} else {
double tmp_1;
if ((t <= -4.396223194186806e-140)) {
tmp_1 = ((double) (((double) ((x / y) * (x / y))) + ((double) (z * (z / ((double) (t * t)))))));
} else {
double tmp_2;
if ((t <= 3.849433641532173e-306)) {
tmp_2 = ((double) (((double) ((x / y) * (x / y))) + ((double) ((1.0 / t) * ((double) (z * (z / t)))))));
} else {
tmp_2 = ((double) (((double) ((x / y) * (x / y))) + ((double) (((z / t) / ((double) sqrt(t))) * (z / ((double) sqrt(t)))))));
}
tmp_1 = tmp_2;
}
tmp = tmp_1;
}
return tmp;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
Results
| Original | 33.7 |
|---|---|
| Target | 0.4 |
| Herbie | 1.3 |
if t < -1.34221769591177092e154 or -4.39622319418680645e-140 < t < 3.84943364153217298e-306Initial program 42.9
rmApplied times-frac_binary6430.5
rmApplied times-frac_binary640.4
rmApplied add-sqr-sqrt_binary6463.8
Applied *-un-lft-identity_binary6463.8
Applied times-frac_binary6463.8
Applied add-sqr-sqrt_binary6463.8
Applied *-un-lft-identity_binary6463.8
Applied times-frac_binary6463.8
Applied swap-sqr_binary6463.8
Simplified63.8
Simplified3.9
if -1.34221769591177092e154 < t < -4.39622319418680645e-140Initial program 25.2
rmApplied times-frac_binary647.4
rmApplied times-frac_binary640.5
rmApplied *-un-lft-identity_binary640.5
Applied add-sqr-sqrt_binary6433.0
Applied times-frac_binary6433.0
Applied *-un-lft-identity_binary6433.0
Applied add-sqr-sqrt_binary6433.1
Applied times-frac_binary6433.1
Applied swap-sqr_binary6433.1
Simplified33.0
Simplified0.4
if 3.84943364153217298e-306 < t Initial program 33.3
rmApplied times-frac_binary6418.9
rmApplied times-frac_binary640.4
rmApplied add-sqr-sqrt_binary640.5
Applied *-un-lft-identity_binary640.5
Applied times-frac_binary640.5
Applied associate-*r*_binary640.5
Simplified0.5
Final simplification1.3
herbie shell --seed 2020205
(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))))