x \cdot \left(\frac{y}{z} - \frac{t}{1 - z}\right)\begin{array}{l}
\mathbf{if}\;\frac{y}{z} - \frac{t}{1 - z} \leq -7.579993657727699 \cdot 10^{+274}:\\
\;\;\;\;\frac{1}{\frac{z}{y \cdot x}} - \frac{t}{1 - z} \cdot x\\
\mathbf{elif}\;\frac{y}{z} - \frac{t}{1 - z} \leq -5.53040647017809 \cdot 10^{-168}:\\
\;\;\;\;x \cdot \left(\frac{y}{z} + \frac{-1}{\frac{1 - z}{t}}\right)\\
\mathbf{elif}\;\frac{y}{z} - \frac{t}{1 - z} \leq 4.2385761353250375 \cdot 10^{-236}:\\
\;\;\;\;\frac{y}{z} \cdot x - \frac{t \cdot x}{1 - z}\\
\mathbf{elif}\;\frac{y}{z} - \frac{t}{1 - z} \leq 8.063107108367971 \cdot 10^{+142}:\\
\;\;\;\;x \cdot \left(\frac{y}{z} + \frac{-1}{\frac{1 - z}{t}}\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))) -7.579993657727699e+274)
(- (/ 1.0 (/ z (* y x))) (* (/ t (- 1.0 z)) x))
(if (<= (- (/ y z) (/ t (- 1.0 z))) -5.53040647017809e-168)
(* x (+ (/ y z) (/ -1.0 (/ (- 1.0 z) t))))
(if (<= (- (/ y z) (/ t (- 1.0 z))) 4.2385761353250375e-236)
(- (* (/ y z) x) (/ (* t x) (- 1.0 z)))
(if (<= (- (/ y z) (/ t (- 1.0 z))) 8.063107108367971e+142)
(* x (+ (/ y z) (/ -1.0 (/ (- 1.0 z) t))))
(- (* 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))))) <= -7.579993657727699e+274)) {
tmp = ((double) ((1.0 / (z / ((double) (y * x)))) - ((double) ((t / ((double) (1.0 - z))) * x))));
} else {
double tmp_1;
if ((((double) ((y / z) - (t / ((double) (1.0 - z))))) <= -5.53040647017809e-168)) {
tmp_1 = ((double) (x * ((double) ((y / z) + (-1.0 / (((double) (1.0 - z)) / t))))));
} else {
double tmp_2;
if ((((double) ((y / z) - (t / ((double) (1.0 - z))))) <= 4.2385761353250375e-236)) {
tmp_2 = ((double) (((double) ((y / z) * x)) - (((double) (t * x)) / ((double) (1.0 - z)))));
} else {
double tmp_3;
if ((((double) ((y / z) - (t / ((double) (1.0 - z))))) <= 8.063107108367971e+142)) {
tmp_3 = ((double) (x * ((double) ((y / z) + (-1.0 / (((double) (1.0 - z)) / t))))));
} 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.3 |
| Herbie | 1.1 |
if (- (/ y z) (/ t (- 1.0 z))) < -7.5799936577276988e274Initial program Error: 38.3 bits
rmApplied sub-negError: 38.3 bits
Applied distribute-lft-inError: 38.3 bits
SimplifiedError: 38.3 bits
rmApplied associate-*r/Error: 0.4 bits
rmApplied clear-numError: 0.4 bits
if -7.5799936577276988e274 < (- (/ y z) (/ t (- 1.0 z))) < -5.53040647017808971e-168 or 4.23857613532503754e-236 < (- (/ y z) (/ t (- 1.0 z))) < 8.06310710836797102e142Initial program Error: 0.2 bits
rmApplied clear-numError: 0.3 bits
if -5.53040647017808971e-168 < (- (/ y z) (/ t (- 1.0 z))) < 4.23857613532503754e-236Initial program Error: 8.2 bits
rmApplied sub-negError: 8.2 bits
Applied distribute-lft-inError: 8.2 bits
SimplifiedError: 8.2 bits
rmApplied associate-*r/Error: 4.4 bits
if 8.06310710836797102e142 < (- (/ y z) (/ t (- 1.0 z))) Initial program Error: 13.2 bits
rmApplied sub-negError: 13.2 bits
Applied distribute-lft-inError: 13.2 bits
SimplifiedError: 13.2 bits
rmApplied associate-*r/Error: 1.4 bits
Taylor expanded around 0 Error: 1.4 bits
SimplifiedError: 1.8 bits
Final simplificationError: 1.1 bits
herbie shell --seed 2020203
(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)))))