x \cdot \left(\frac{y}{z} - \frac{t}{1 - z}\right)\begin{array}{l}
\mathbf{if}\;z \le 5.365296890562927012540570559645221805139 \cdot 10^{-77}:\\
\;\;\;\;\frac{x \cdot y}{z} + \frac{x}{\sqrt{1 - z}} \cdot \frac{-t}{\sqrt{1 - z}}\\
\mathbf{else}:\\
\;\;\;\;\frac{-x}{\frac{1 - z}{t}} + \frac{1}{\frac{\frac{z}{y}}{x}}\\
\end{array}double f(double x, double y, double z, double t) {
double r322710 = x;
double r322711 = y;
double r322712 = z;
double r322713 = r322711 / r322712;
double r322714 = t;
double r322715 = 1.0;
double r322716 = r322715 - r322712;
double r322717 = r322714 / r322716;
double r322718 = r322713 - r322717;
double r322719 = r322710 * r322718;
return r322719;
}
double f(double x, double y, double z, double t) {
double r322720 = z;
double r322721 = 5.365296890562927e-77;
bool r322722 = r322720 <= r322721;
double r322723 = x;
double r322724 = y;
double r322725 = r322723 * r322724;
double r322726 = r322725 / r322720;
double r322727 = 1.0;
double r322728 = r322727 - r322720;
double r322729 = sqrt(r322728);
double r322730 = r322723 / r322729;
double r322731 = t;
double r322732 = -r322731;
double r322733 = r322732 / r322729;
double r322734 = r322730 * r322733;
double r322735 = r322726 + r322734;
double r322736 = -r322723;
double r322737 = r322728 / r322731;
double r322738 = r322736 / r322737;
double r322739 = 1.0;
double r322740 = r322720 / r322724;
double r322741 = r322740 / r322723;
double r322742 = r322739 / r322741;
double r322743 = r322738 + r322742;
double r322744 = r322722 ? r322735 : r322743;
return r322744;
}




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.5 |
if z < 5.365296890562927e-77Initial program 6.0
rmApplied div-inv6.1
Applied fma-neg6.1
Simplified6.1
rmApplied fma-udef6.1
Applied distribute-lft-in6.1
Simplified5.0
Simplified6.5
rmApplied add-sqr-sqrt6.6
Applied times-frac5.6
if 5.365296890562927e-77 < z Initial program 2.3
rmApplied div-inv2.3
Applied fma-neg2.3
Simplified2.3
rmApplied fma-udef2.3
Applied distribute-lft-in2.3
Simplified6.0
Simplified8.6
rmApplied distribute-rgt-neg-out8.6
Applied distribute-frac-neg8.6
Simplified6.1
rmApplied clear-num6.3
Simplified2.6
Final simplification4.5
herbie shell --seed 2019174 +o rules:numerics
(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)))))