\frac{x \cdot e^{\left(y \cdot \log z + \left(t - 1\right) \cdot \log a\right) - b}}{y}\begin{array}{l}
\mathbf{if}\;x \leq 1.6373611271993253 \cdot 10^{-203} \lor \neg \left(x \leq 3.7081369141019746 \cdot 10^{-81}\right):\\
\;\;\;\;\frac{1}{\frac{y}{x \cdot {e}^{\left(y \cdot \log z + \left(\left(t - 1\right) \cdot \log a - b\right)\right)}}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y} \cdot {z}^{y}}{{a}^{1} \cdot e^{b - t \cdot \log a}}\\
\end{array}double code(double x, double y, double z, double t, double a, double b) {
return (((double) (x * ((double) exp(((double) (((double) (((double) (y * ((double) log(z)))) + ((double) (((double) (t - 1.0)) * ((double) log(a)))))) - b)))))) / y);
}
double code(double x, double y, double z, double t, double a, double b) {
double VAR;
if (((x <= 1.6373611271993253e-203) || !(x <= 3.7081369141019746e-81))) {
VAR = (1.0 / (y / ((double) (x * ((double) pow(((double) M_E), ((double) (((double) (y * ((double) log(z)))) + ((double) (((double) (((double) (t - 1.0)) * ((double) log(a)))) - b))))))))));
} else {
VAR = (((double) ((x / y) * ((double) pow(z, y)))) / ((double) (((double) pow(a, 1.0)) * ((double) exp(((double) (b - ((double) (t * ((double) log(a)))))))))));
}
return VAR;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t




Bits error versus a




Bits error versus b
Results
| Original | 2.0 |
|---|---|
| Target | 11.1 |
| Herbie | 2.9 |
if x < 1.63736112719932534e-203 or 3.70813691410197456e-81 < x Initial program Error: 1.8 bits
rmApplied *-un-lft-identityError: 1.8 bits
Applied exp-prodError: 1.9 bits
SimplifiedError: 1.9 bits
rmApplied clear-numError: 1.9 bits
SimplifiedError: 1.9 bits
if 1.63736112719932534e-203 < x < 3.70813691410197456e-81Initial program Error: 4.1 bits
rmApplied *-un-lft-identityError: 4.1 bits
Applied exp-prodError: 4.1 bits
SimplifiedError: 4.1 bits
rmApplied clear-numError: 4.1 bits
SimplifiedError: 4.1 bits
Taylor expanded around inf Error: 4.1 bits
SimplifiedError: 14.5 bits
rmApplied exp-negError: 14.5 bits
Applied associate-*l/Error: 14.5 bits
Applied pow-negError: 14.5 bits
Applied frac-timesError: 14.5 bits
Applied associate-*r/Error: 14.5 bits
Applied associate-/r/Error: 11.4 bits
Applied associate-/r*Error: 11.4 bits
SimplifiedError: 11.4 bits
Final simplificationError: 2.9 bits
herbie shell --seed 2020200
(FPCore (x y z t a b)
:name "Numeric.SpecFunctions:incompleteBetaWorker from math-functions-0.1.5.2, A"
:precision binary64
:herbie-target
(if (< t -0.8845848504127471) (/ (* x (/ (pow a (- t 1.0)) y)) (- (+ b 1.0) (* y (log z)))) (if (< t 852031.2288374073) (/ (* (/ x y) (pow a (- t 1.0))) (exp (- b (* (log z) y)))) (/ (* x (/ (pow a (- t 1.0)) y)) (- (+ b 1.0) (* y (log z))))))
(/ (* x (exp (- (+ (* y (log z)) (* (- t 1.0) (log a))) b))) y))