x \cdot \left(\frac{y}{z} - \frac{t}{1 - z}\right)\begin{array}{l}
\mathbf{if}\;\frac{y}{z} - \frac{t}{1 - z} \le -4.160542626351909795163353104871194722583 \cdot 10^{218}:\\
\;\;\;\;\frac{y \cdot x}{z} + \frac{x}{\sqrt{1 - z}} \cdot \frac{-t}{\sqrt{1 - z}}\\
\mathbf{elif}\;\frac{y}{z} - \frac{t}{1 - z} \le -1.366221236771887487690780301547077348915 \cdot 10^{-172}:\\
\;\;\;\;\left(\frac{y}{z} - \frac{1}{\frac{1 - z}{t}}\right) \cdot x\\
\mathbf{elif}\;\frac{y}{z} - \frac{t}{1 - z} \le 8.675112053486182625656701995676329852873 \cdot 10^{-219}:\\
\;\;\;\;\frac{x \cdot \left(-t\right)}{1 - z} + \frac{y \cdot x}{z}\\
\mathbf{elif}\;\frac{y}{z} - \frac{t}{1 - z} \le 1.409130514825537046443418609777720419861 \cdot 10^{217}:\\
\;\;\;\;\left(\frac{y}{z} - \frac{1}{\frac{1 - z}{t}}\right) \cdot x\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{z} \cdot y + \frac{-t}{1 - z} \cdot x\\
\end{array}double f(double x, double y, double z, double t) {
double r375637 = x;
double r375638 = y;
double r375639 = z;
double r375640 = r375638 / r375639;
double r375641 = t;
double r375642 = 1.0;
double r375643 = r375642 - r375639;
double r375644 = r375641 / r375643;
double r375645 = r375640 - r375644;
double r375646 = r375637 * r375645;
return r375646;
}
double f(double x, double y, double z, double t) {
double r375647 = y;
double r375648 = z;
double r375649 = r375647 / r375648;
double r375650 = t;
double r375651 = 1.0;
double r375652 = r375651 - r375648;
double r375653 = r375650 / r375652;
double r375654 = r375649 - r375653;
double r375655 = -4.16054262635191e+218;
bool r375656 = r375654 <= r375655;
double r375657 = x;
double r375658 = r375647 * r375657;
double r375659 = r375658 / r375648;
double r375660 = sqrt(r375652);
double r375661 = r375657 / r375660;
double r375662 = -r375650;
double r375663 = r375662 / r375660;
double r375664 = r375661 * r375663;
double r375665 = r375659 + r375664;
double r375666 = -1.3662212367718875e-172;
bool r375667 = r375654 <= r375666;
double r375668 = 1.0;
double r375669 = r375652 / r375650;
double r375670 = r375668 / r375669;
double r375671 = r375649 - r375670;
double r375672 = r375671 * r375657;
double r375673 = 8.675112053486183e-219;
bool r375674 = r375654 <= r375673;
double r375675 = r375657 * r375662;
double r375676 = r375675 / r375652;
double r375677 = r375676 + r375659;
double r375678 = 1.409130514825537e+217;
bool r375679 = r375654 <= r375678;
double r375680 = r375657 / r375648;
double r375681 = r375680 * r375647;
double r375682 = r375662 / r375652;
double r375683 = r375682 * r375657;
double r375684 = r375681 + r375683;
double r375685 = r375679 ? r375672 : r375684;
double r375686 = r375674 ? r375677 : r375685;
double r375687 = r375667 ? r375672 : r375686;
double r375688 = r375656 ? r375665 : r375687;
return r375688;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
Results
| Original | 4.6 |
|---|---|
| Target | 4.3 |
| Herbie | 0.7 |
if (- (/ y z) (/ t (- 1.0 z))) < -4.16054262635191e+218Initial program 20.7
rmApplied sub-neg20.7
Applied distribute-lft-in20.7
Simplified0.4
Simplified0.4
rmApplied add-sqr-sqrt3.9
Applied *-un-lft-identity3.9
Applied times-frac3.9
Applied associate-*r*4.0
Simplified4.0
if -4.16054262635191e+218 < (- (/ y z) (/ t (- 1.0 z))) < -1.3662212367718875e-172 or 8.675112053486183e-219 < (- (/ y z) (/ t (- 1.0 z))) < 1.409130514825537e+217Initial program 0.2
rmApplied clear-num0.3
if -1.3662212367718875e-172 < (- (/ y z) (/ t (- 1.0 z))) < 8.675112053486183e-219Initial program 8.0
rmApplied sub-neg8.0
Applied distribute-lft-in8.0
Simplified4.4
Simplified4.4
rmApplied *-un-lft-identity4.4
Applied associate-*l*4.4
Simplified1.4
if 1.409130514825537e+217 < (- (/ y z) (/ t (- 1.0 z))) Initial program 23.6
rmApplied sub-neg23.6
Applied distribute-lft-in23.6
Simplified0.7
Simplified0.7
rmApplied *-un-lft-identity0.7
Applied times-frac0.4
Simplified0.4
Final simplification0.7
herbie shell --seed 2019194
(FPCore (x y z t)
:name "Numeric.SpecFunctions:invIncompleteBetaWorker from math-functions-0.1.5.2, C"
: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)))))