x \cdot \left(\frac{y}{z} - \frac{t}{1 - z}\right)\begin{array}{l}
\mathbf{if}\;x \le -4.05799137819263262 \cdot 10^{189}:\\
\;\;\;\;\frac{y}{\frac{z}{x}} + x \cdot \left(-\frac{t}{1 - z}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x \cdot y\right) \cdot \frac{1}{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 ((x <= -4.0579913781926326e+189)) {
VAR = ((y / (z / x)) + (x * -(t / (1.0 - z))));
} else {
VAR = (((x * y) * (1.0 / z)) + (x * -(t / (1.0 - z))));
}
return VAR;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
Results
| Original | 4.7 |
|---|---|
| Target | 4.4 |
| Herbie | 4.7 |
if x < -4.0579913781926326e+189Initial program 4.4
rmApplied clear-num4.7
rmApplied div-inv4.7
Applied fma-neg4.7
Simplified4.4
rmApplied fma-udef4.4
Applied distribute-lft-in4.4
Simplified17.6
rmApplied *-commutative17.6
Applied associate-/l*9.8
if -4.0579913781926326e+189 < x Initial program 4.7
rmApplied clear-num4.8
rmApplied div-inv4.9
Applied fma-neg4.8
Simplified4.7
rmApplied fma-udef4.7
Applied distribute-lft-in4.7
Simplified4.3
rmApplied div-inv4.4
Final simplification4.7
herbie shell --seed 2020071 +o rules:numerics
(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)))))