x \cdot \left(\frac{y}{z} - \frac{t}{1 - z}\right)\begin{array}{l}
\mathbf{if}\;z \le -3.03854886497741823 \cdot 10^{-73}:\\
\;\;\;\;x \cdot \left(\frac{y}{z} - \frac{\frac{t}{\sqrt{1 - z}}}{\sqrt{1 - z}}\right)\\
\mathbf{elif}\;z \le 2.8473073316618129 \cdot 10^{-34}:\\
\;\;\;\;\left(x \cdot y\right) \cdot \frac{1}{z} + x \cdot \left(-\frac{t}{1 - z}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\sqrt{z}} \cdot \frac{y}{\sqrt{z}} + x \cdot \left(-\frac{t}{1 - z}\right)\\
\end{array}double code(double x, double y, double z, double t) {
return (x * ((y / z) - (t / (1.0 - z))));
}
double code(double x, double y, double z, double t) {
double VAR;
if ((z <= -3.038548864977418e-73)) {
VAR = (x * ((y / z) - ((t / sqrt((1.0 - z))) / sqrt((1.0 - z)))));
} else {
double VAR_1;
if ((z <= 2.847307331661813e-34)) {
VAR_1 = (((x * y) * (1.0 / z)) + (x * -(t / (1.0 - z))));
} else {
VAR_1 = (((x / sqrt(z)) * (y / sqrt(z))) + (x * -(t / (1.0 - z))));
}
VAR = VAR_1;
}
return VAR;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
Results
| Original | 4.6 |
|---|---|
| Target | 4.3 |
| Herbie | 3.2 |
if z < -3.038548864977418e-73Initial program 1.9
rmApplied add-sqr-sqrt2.0
Applied associate-/r*2.0
if -3.038548864977418e-73 < z < 2.847307331661813e-34Initial program 10.0
rmApplied sub-neg10.0
Applied distribute-lft-in10.0
rmApplied div-inv10.1
Applied associate-*r*4.7
if 2.847307331661813e-34 < z Initial program 1.9
rmApplied sub-neg1.9
Applied distribute-lft-in1.9
rmApplied add-sqr-sqrt2.1
Applied *-un-lft-identity2.1
Applied times-frac2.1
Applied associate-*r*2.8
Simplified2.8
Final simplification3.2
herbie shell --seed 2020079
(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 z)))) -7.623226303312042e-196) (* x (- (/ y z) (* t (/ 1 (- 1 z))))) (if (< (* x (- (/ y z) (/ t (- 1 z)))) 1.4133944927702302e-211) (+ (/ (* y x) z) (- (/ (* t x) (- 1 z)))) (* x (- (/ y z) (* t (/ 1 (- 1 z)))))))
(* x (- (/ y z) (/ t (- 1 z)))))