x \cdot \left(\frac{y}{z} - \frac{t}{1 - z}\right)\begin{array}{l}
\mathbf{if}\;z \le -1.1148798322517719 \cdot 10^{21}:\\
\;\;\;\;\frac{x}{\frac{z}{y}} + \left(-\frac{t}{1 - z}\right) \cdot x\\
\mathbf{elif}\;z \le 6.52761212898463406 \cdot 10^{48}:\\
\;\;\;\;\frac{x \cdot y}{z} + \frac{\left(-t\right) \cdot x}{1 - z}\\
\mathbf{elif}\;z \le 1.05604830505701976 \cdot 10^{277}:\\
\;\;\;\;\frac{x}{\frac{z}{y}} + \left(-\frac{t}{1 - z}\right) \cdot x\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot y}{z} + \left(-t\right) \cdot \frac{x}{1 - z}\\
\end{array}double f(double x, double y, double z, double t) {
double r477860 = x;
double r477861 = y;
double r477862 = z;
double r477863 = r477861 / r477862;
double r477864 = t;
double r477865 = 1.0;
double r477866 = r477865 - r477862;
double r477867 = r477864 / r477866;
double r477868 = r477863 - r477867;
double r477869 = r477860 * r477868;
return r477869;
}
double f(double x, double y, double z, double t) {
double r477870 = z;
double r477871 = -1.1148798322517719e+21;
bool r477872 = r477870 <= r477871;
double r477873 = x;
double r477874 = y;
double r477875 = r477870 / r477874;
double r477876 = r477873 / r477875;
double r477877 = t;
double r477878 = 1.0;
double r477879 = r477878 - r477870;
double r477880 = r477877 / r477879;
double r477881 = -r477880;
double r477882 = r477881 * r477873;
double r477883 = r477876 + r477882;
double r477884 = 6.527612128984634e+48;
bool r477885 = r477870 <= r477884;
double r477886 = r477873 * r477874;
double r477887 = r477886 / r477870;
double r477888 = -r477877;
double r477889 = r477888 * r477873;
double r477890 = r477889 / r477879;
double r477891 = r477887 + r477890;
double r477892 = 1.0560483050570198e+277;
bool r477893 = r477870 <= r477892;
double r477894 = r477873 / r477879;
double r477895 = r477888 * r477894;
double r477896 = r477887 + r477895;
double r477897 = r477893 ? r477883 : r477896;
double r477898 = r477885 ? r477891 : r477897;
double r477899 = r477872 ? r477883 : r477898;
return r477899;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
Results
| Original | 4.8 |
|---|---|
| Target | 4.3 |
| Herbie | 3.2 |
if z < -1.1148798322517719e+21 or 6.527612128984634e+48 < z < 1.0560483050570198e+277Initial program 2.1
rmApplied sub-neg2.1
Applied distribute-lft-in2.1
Simplified6.5
Simplified6.5
rmApplied clear-num6.6
rmApplied *-un-lft-identity6.6
Applied add-cube-cbrt6.6
Applied times-frac6.6
Simplified6.6
Simplified2.2
if -1.1148798322517719e+21 < z < 6.527612128984634e+48Initial program 7.7
rmApplied sub-neg7.7
Applied distribute-lft-in7.7
Simplified3.3
Simplified3.3
rmApplied distribute-neg-frac3.3
Applied associate-*l/3.4
if 1.0560483050570198e+277 < z Initial program 3.0
rmApplied sub-neg3.0
Applied distribute-lft-in3.0
Simplified10.2
Simplified10.2
rmApplied div-inv10.2
Applied distribute-lft-neg-in10.2
Applied associate-*l*16.0
Simplified16.0
Final simplification3.2
herbie shell --seed 2020046 +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)))))