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.6819217472818379 \cdot 10^{190}:\\
\;\;\;\;\frac{x \cdot y}{z} + \frac{x \cdot \left(-t\right)}{1 - z}\\
\mathbf{elif}\;\frac{y}{z} - \frac{t}{1 - z} \le -2.57561547149504369 \cdot 10^{-171}:\\
\;\;\;\;x \cdot \left(\frac{y}{z} - \frac{1}{\frac{1 - z}{t}}\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(x \cdot y, \frac{1}{z}, x \cdot \left(-\frac{t}{1 - z}\right)\right)\\
\end{array}double f(double x, double y, double z, double t) {
double r655772 = x;
double r655773 = y;
double r655774 = z;
double r655775 = r655773 / r655774;
double r655776 = t;
double r655777 = 1.0;
double r655778 = r655777 - r655774;
double r655779 = r655776 / r655778;
double r655780 = r655775 - r655779;
double r655781 = r655772 * r655780;
return r655781;
}
double f(double x, double y, double z, double t) {
double r655782 = y;
double r655783 = z;
double r655784 = r655782 / r655783;
double r655785 = t;
double r655786 = 1.0;
double r655787 = r655786 - r655783;
double r655788 = r655785 / r655787;
double r655789 = r655784 - r655788;
double r655790 = -4.681921747281838e+190;
bool r655791 = r655789 <= r655790;
double r655792 = x;
double r655793 = r655792 * r655782;
double r655794 = r655793 / r655783;
double r655795 = -r655785;
double r655796 = r655792 * r655795;
double r655797 = r655796 / r655787;
double r655798 = r655794 + r655797;
double r655799 = -2.5756154714950437e-171;
bool r655800 = r655789 <= r655799;
double r655801 = 1.0;
double r655802 = r655787 / r655785;
double r655803 = r655801 / r655802;
double r655804 = r655784 - r655803;
double r655805 = r655792 * r655804;
double r655806 = r655801 / r655783;
double r655807 = -r655788;
double r655808 = r655792 * r655807;
double r655809 = fma(r655793, r655806, r655808);
double r655810 = r655800 ? r655805 : r655809;
double r655811 = r655791 ? r655798 : r655810;
return r655811;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
| Original | 4.6 |
|---|---|
| Target | 4.4 |
| Herbie | 2.8 |
if (- (/ y z) (/ t (- 1.0 z))) < -4.681921747281838e+190Initial program 18.4
rmApplied div-inv18.4
Applied fma-neg18.4
rmApplied fma-udef18.4
Applied distribute-lft-in18.4
Simplified0.8
rmApplied distribute-neg-frac0.8
Applied associate-*r/1.2
if -4.681921747281838e+190 < (- (/ y z) (/ t (- 1.0 z))) < -2.5756154714950437e-171Initial program 0.2
rmApplied clear-num0.3
if -2.5756154714950437e-171 < (- (/ y z) (/ t (- 1.0 z))) Initial program 4.7
rmApplied div-inv4.7
Applied fma-neg4.7
rmApplied fma-udef4.7
Applied distribute-lft-in4.7
Simplified4.4
rmApplied div-inv4.4
Applied fma-def4.4
Final simplification2.8
herbie shell --seed 2020034 +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)))))