\frac{x \cdot e^{\left(y \cdot \log z + \left(t - 1\right) \cdot \log a\right) - b}}{y}\begin{array}{l}
\mathbf{if}\;a \le 1.1454557351735624 \cdot 10^{-9}:\\
\;\;\;\;\frac{1}{{\left({a}^{1}\right)}^{1} \cdot \frac{e^{\log \left(\frac{1}{z}\right) \cdot y + \left(\log \left(\frac{1}{a}\right) \cdot t + b\right)} \cdot y}{x}}\\
\mathbf{else}:\\
\;\;\;\;\left({\left(\frac{1}{a}\right)}^{1} \cdot \frac{\frac{1}{e^{\mathsf{fma}\left(y, \log \left(\frac{1}{z}\right), \mathsf{fma}\left(\log \left(\frac{1}{a}\right), t, b\right)\right)}}}{y}\right) \cdot x\\
\end{array}double code(double x, double y, double z, double t, double a, double b) {
return ((x * exp((((y * log(z)) + ((t - 1.0) * log(a))) - b))) / y);
}
double code(double x, double y, double z, double t, double a, double b) {
double temp;
if ((a <= 1.1454557351735624e-09)) {
temp = (1.0 / (pow(pow(a, 1.0), 1.0) * ((exp(((log((1.0 / z)) * y) + ((log((1.0 / a)) * t) + b))) * y) / x)));
} else {
temp = ((pow((1.0 / a), 1.0) * ((1.0 / exp(fma(y, log((1.0 / z)), fma(log((1.0 / a)), t, b)))) / y)) * x);
}
return temp;
}




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.8 |
| Herbie | 0.2 |
if a < 1.1454557351735624e-09Initial program 0.7
Taylor expanded around inf 0.8
Simplified2.8
rmApplied associate-*l/0.2
Simplified0.2
rmApplied clear-num0.2
Taylor expanded around inf 0.1
if 1.1454557351735624e-09 < a Initial program 3.0
Taylor expanded around inf 3.0
Simplified0.2
rmApplied *-un-lft-identity0.2
Applied div-inv0.2
Applied times-frac0.2
Simplified0.2
Final simplification0.2
herbie shell --seed 2020066 +o rules:numerics
(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)) y)) (- (+ b 1) (* y (log z)))) (if (< t 852031.2288374073) (/ (* (/ x y) (pow a (- t 1))) (exp (- b (* (log z) y)))) (/ (* x (/ (pow a (- t 1)) y)) (- (+ b 1) (* y (log z))))))
(/ (* x (exp (- (+ (* y (log z)) (* (- t 1) (log a))) b))) y))