\frac{\left(x \cdot y\right) \cdot z}{\sqrt{z \cdot z - t \cdot a}}
\begin{array}{l}
\mathbf{if}\;z \leq -6.319986650356017 \cdot 10^{+152}:\\
\;\;\;\;-y \cdot x\\
\mathbf{else}:\\
\;\;\;\;\begin{array}{l}
t_1 := \sqrt{z \cdot z - t \cdot a}\\
\mathbf{if}\;z \leq -6.326499446197611 \cdot 10^{-175}:\\
\;\;\;\;\frac{y \cdot x}{\frac{t_1}{z}}\\
\mathbf{elif}\;z \leq 1.910506055102422 \cdot 10^{-188}:\\
\;\;\;\;\frac{y \cdot \left(z \cdot x\right)}{\sqrt{-t}} \cdot \sqrt{\frac{1}{a}}\\
\mathbf{elif}\;z \leq 1.1966322469631946 \cdot 10^{+31}:\\
\;\;\;\;\left(y \cdot x\right) \cdot \frac{z}{t_1}\\
\mathbf{else}:\\
\;\;\;\;y \cdot x\\
\end{array}\\
\end{array}
(FPCore (x y z t a) :precision binary64 (/ (* (* x y) z) (sqrt (- (* z z) (* t a)))))
(FPCore (x y z t a)
:precision binary64
(if (<= z -6.319986650356017e+152)
(- (* y x))
(let* ((t_1 (sqrt (- (* z z) (* t a)))))
(if (<= z -6.326499446197611e-175)
(/ (* y x) (/ t_1 z))
(if (<= z 1.910506055102422e-188)
(* (/ (* y (* z x)) (sqrt (- t))) (sqrt (/ 1.0 a)))
(if (<= z 1.1966322469631946e+31) (* (* y x) (/ z t_1)) (* y x)))))))double code(double x, double y, double z, double t, double a) {
return ((x * y) * z) / sqrt((z * z) - (t * a));
}
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -6.319986650356017e+152) {
tmp = -(y * x);
} else {
double t_1 = sqrt((z * z) - (t * a));
double tmp_1;
if (z <= -6.326499446197611e-175) {
tmp_1 = (y * x) / (t_1 / z);
} else if (z <= 1.910506055102422e-188) {
tmp_1 = ((y * (z * x)) / sqrt(-t)) * sqrt(1.0 / a);
} else if (z <= 1.1966322469631946e+31) {
tmp_1 = (y * x) * (z / t_1);
} else {
tmp_1 = y * x;
}
tmp = tmp_1;
}
return tmp;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t




Bits error versus a
Results
| Original | 24.3 |
|---|---|
| Target | 7.3 |
| Herbie | 5.5 |
if z < -6.31998665035601711e152Initial program 53.0
Taylor expanded in z around -inf 1.6
if -6.31998665035601711e152 < z < -6.32649944619761107e-175Initial program 8.9
Applied associate-/l*_binary644.8
if -6.32649944619761107e-175 < z < 1.91050605510242187e-188Initial program 18.4
Applied associate-/l*_binary6419.3
Simplified16.0
Applied *-un-lft-identity_binary6416.0
Applied *-un-lft-identity_binary6416.0
Applied times-frac_binary6416.0
Applied times-frac_binary6416.2
Simplified16.2
Applied distribute-rgt-neg-in_binary6416.2
Applied sqrt-prod_binary6412.6
Taylor expanded in z around 0 12.5
if 1.91050605510242187e-188 < z < 1.19663224696319464e31Initial program 8.1
Applied *-un-lft-identity_binary648.1
Applied sqrt-prod_binary648.1
Applied times-frac_binary646.8
if 1.19663224696319464e31 < z Initial program 34.9
Taylor expanded in z around inf 3.8
Final simplification5.5
herbie shell --seed 2021307
(FPCore (x y z t a)
:name "Statistics.Math.RootFinding:ridders from math-functions-0.1.5.2"
:precision binary64
:herbie-target
(if (< z -3.1921305903852764e+46) (- (* y x)) (if (< z 5.976268120920894e+90) (/ (* x z) (/ (sqrt (- (* z z) (* a t))) y)) (* y x)))
(/ (* (* x y) z) (sqrt (- (* z z) (* t a)))))