x \cdot \left(\frac{y}{z} - \frac{t}{1 - z}\right)\begin{array}{l}
\mathbf{if}\;\frac{y}{z} - \frac{t}{1 - z} \leq -6.47911217694995 \cdot 10^{+111}:\\
\;\;\;\;y \cdot \frac{x}{z} - \frac{t}{1 - z} \cdot x\\
\mathbf{elif}\;\frac{y}{z} - \frac{t}{1 - z} \leq -2.102509075217015 \cdot 10^{-242}:\\
\;\;\;\;x \cdot \left(\frac{y}{z} - t \cdot \frac{1}{1 - z}\right)\\
\mathbf{elif}\;\frac{y}{z} - \frac{t}{1 - z} \leq 5.7450177110158 \cdot 10^{-315}:\\
\;\;\;\;\frac{x}{\sqrt[3]{z} \cdot \sqrt[3]{z}} \cdot \frac{y}{\sqrt[3]{z}} - \frac{t \cdot x}{1 - z}\\
\mathbf{elif}\;\frac{y}{z} - \frac{t}{1 - z} \leq 1.0778704636607535 \cdot 10^{+188}:\\
\;\;\;\;x \cdot \left(\frac{y}{z} - t \cdot \frac{1}{1 - z}\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{x}{z} - \frac{t}{1 - z} \cdot x\\
\end{array}(FPCore (x y z t) :precision binary64 (* x (- (/ y z) (/ t (- 1.0 z)))))
(FPCore (x y z t)
:precision binary64
(if (<= (- (/ y z) (/ t (- 1.0 z))) -6.47911217694995e+111)
(- (* y (/ x z)) (* (/ t (- 1.0 z)) x))
(if (<= (- (/ y z) (/ t (- 1.0 z))) -2.102509075217015e-242)
(* x (- (/ y z) (* t (/ 1.0 (- 1.0 z)))))
(if (<= (- (/ y z) (/ t (- 1.0 z))) 5.7450177110158e-315)
(- (* (/ x (* (cbrt z) (cbrt z))) (/ y (cbrt z))) (/ (* t x) (- 1.0 z)))
(if (<= (- (/ y z) (/ t (- 1.0 z))) 1.0778704636607535e+188)
(* x (- (/ y z) (* t (/ 1.0 (- 1.0 z)))))
(- (* y (/ x z)) (* (/ t (- 1.0 z)) x)))))))double code(double x, double y, double z, double t) {
return ((double) (x * ((double) ((y / z) - (t / ((double) (1.0 - z)))))));
}
double code(double x, double y, double z, double t) {
double tmp;
if ((((double) ((y / z) - (t / ((double) (1.0 - z))))) <= -6.47911217694995e+111)) {
tmp = ((double) (((double) (y * (x / z))) - ((double) ((t / ((double) (1.0 - z))) * x))));
} else {
double tmp_1;
if ((((double) ((y / z) - (t / ((double) (1.0 - z))))) <= -2.102509075217015e-242)) {
tmp_1 = ((double) (x * ((double) ((y / z) - ((double) (t * (1.0 / ((double) (1.0 - z)))))))));
} else {
double tmp_2;
if ((((double) ((y / z) - (t / ((double) (1.0 - z))))) <= 5.7450177110158e-315)) {
tmp_2 = ((double) (((double) ((x / ((double) (((double) cbrt(z)) * ((double) cbrt(z))))) * (y / ((double) cbrt(z))))) - (((double) (t * x)) / ((double) (1.0 - z)))));
} else {
double tmp_3;
if ((((double) ((y / z) - (t / ((double) (1.0 - z))))) <= 1.0778704636607535e+188)) {
tmp_3 = ((double) (x * ((double) ((y / z) - ((double) (t * (1.0 / ((double) (1.0 - z)))))))));
} else {
tmp_3 = ((double) (((double) (y * (x / z))) - ((double) ((t / ((double) (1.0 - z))) * x))));
}
tmp_2 = tmp_3;
}
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 | 4.7 |
|---|---|
| Target | 4.5 |
| Herbie | 0.7 |
if (-.f64 (/.f64 y z) (/.f64 t (-.f64 1.0 z))) < -6.47911217694994992e111 or 1.07787046366075349e188 < (-.f64 (/.f64 y z) (/.f64 t (-.f64 1.0 z))) Initial program 14.1
rmApplied sub-neg_binary6414.1
Applied distribute-lft-in_binary6414.1
rmApplied add-cube-cbrt_binary6414.6
Applied *-un-lft-identity_binary6414.6
Applied times-frac_binary6414.6
Applied associate-*r*_binary644.6
Simplified4.6
Taylor expanded around 0 2.0
Simplified2.0
if -6.47911217694994992e111 < (-.f64 (/.f64 y z) (/.f64 t (-.f64 1.0 z))) < -2.10250907521701493e-242 or 5.745017711e-315 < (-.f64 (/.f64 y z) (/.f64 t (-.f64 1.0 z))) < 1.07787046366075349e188Initial program 0.2
rmApplied div-inv_binary640.2
if -2.10250907521701493e-242 < (-.f64 (/.f64 y z) (/.f64 t (-.f64 1.0 z))) < 5.745017711e-315Initial program 13.8
rmApplied sub-neg_binary6413.8
Applied distribute-lft-in_binary6413.8
rmApplied add-cube-cbrt_binary6413.9
Applied *-un-lft-identity_binary6413.9
Applied times-frac_binary6413.9
Applied associate-*r*_binary647.4
Simplified7.4
rmApplied distribute-neg-frac_binary647.4
Applied associate-*r/_binary640.5
Final simplification0.7
herbie shell --seed 2020205
(FPCore (x y z t)
:name "Numeric.SpecFunctions:invIncompleteBetaWorker from math-functions-0.1.5.2, C"
:precision binary64
:herbie-target
(if (< (* x (- (/ y z) (/ t (- 1.0 z)))) -7.623226303312042e-196) (* x (- (/ y z) (* t (/ 1.0 (- 1.0 z))))) (if (< (* x (- (/ y z) (/ t (- 1.0 z)))) 1.4133944927702302e-211) (+ (/ (* y x) z) (- (/ (* t x) (- 1.0 z)))) (* x (- (/ y z) (* t (/ 1.0 (- 1.0 z)))))))
(* x (- (/ y z) (/ t (- 1.0 z)))))