x \cdot \left(\frac{y}{z} - \frac{t}{1 - z}\right)\begin{array}{l}
\mathbf{if}\;\frac{y}{z} - \frac{t}{1 - z} = -inf.0 \lor \neg \left(\frac{y}{z} - \frac{t}{1 - z} \le 5.91880007899829161 \cdot 10^{179}\right):\\
\;\;\;\;\left(y \cdot x\right) \cdot \frac{1}{z} - \frac{t}{1 - z} \cdot x\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\frac{z}{y}} - \frac{t}{1 - z} \cdot x\\
\end{array}double code(double x, double y, double z, double t) {
return ((double) (x * ((double) (((double) (y / z)) - ((double) (t / ((double) (1.0 - z))))))));
}
double code(double x, double y, double z, double t) {
double VAR;
if (((((double) (((double) (y / z)) - ((double) (t / ((double) (1.0 - z)))))) <= -inf.0) || !(((double) (((double) (y / z)) - ((double) (t / ((double) (1.0 - z)))))) <= 5.918800078998292e+179))) {
VAR = ((double) (((double) (((double) (y * x)) * ((double) (1.0 / z)))) - ((double) (((double) (t / ((double) (1.0 - z)))) * x))));
} else {
VAR = ((double) (((double) (x / ((double) (z / y)))) - ((double) (((double) (t / ((double) (1.0 - z)))) * x))));
}
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 | 1.6 |
if (- (/ y z) (/ t (- 1.0 z))) < -inf.0 or 5.91880007899829161e179 < (- (/ y z) (/ t (- 1.0 z))) Initial program 25.2
rmApplied sub-neg25.2
Applied distribute-lft-in25.2
Simplified25.2
rmApplied div-inv25.2
Applied associate-*r*1.2
if -inf.0 < (- (/ y z) (/ t (- 1.0 z))) < 5.91880007899829161e179Initial program 1.5
rmApplied sub-neg1.5
Applied distribute-lft-in1.5
Simplified1.5
rmApplied *-un-lft-identity1.5
Applied add-cube-cbrt2.0
Applied times-frac2.0
Applied associate-*r*4.7
Simplified4.7
rmApplied add-cube-cbrt4.8
Applied add-cube-cbrt4.8
Applied cbrt-prod4.8
Applied times-frac4.8
Applied associate-*r*4.7
Simplified2.2
Taylor expanded around 0 6.4
Simplified1.6
Final simplification1.6
herbie shell --seed 2020184
(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) (neg (/ (* t x) (- 1.0 z)))) (* x (- (/ y z) (* t (/ 1.0 (- 1.0 z)))))))
(* x (- (/ y z) (/ t (- 1.0 z)))))