\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 -5.06359644977106 \cdot 10^{-218} \lor \neg \left(x \leq 3.731887299802218 \cdot 10^{-81}\right):\\
\;\;\;\;\frac{x}{y \cdot \left(a \cdot e^{b - \left(t \cdot \log a + y \cdot \log z\right)}\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y}}{a \cdot e^{b - \left(t \cdot \log a + y \cdot \log z\right)}}\\
\end{array}(FPCore (x y z t a b) :precision binary64 (/ (* x (exp (- (+ (* y (log z)) (* (- t 1.0) (log a))) b))) y))
(FPCore (x y z t a b) :precision binary64 (if (or (<= x -5.06359644977106e-218) (not (<= x 3.731887299802218e-81))) (/ x (* y (* a (exp (- b (+ (* t (log a)) (* y (log z)))))))) (/ (/ x y) (* a (exp (- b (+ (* t (log a)) (* y (log z)))))))))
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 tmp;
if ((x <= -5.06359644977106e-218) || !(x <= 3.731887299802218e-81)) {
tmp = x / (y * (a * exp(b - ((t * log(a)) + (y * log(z))))));
} else {
tmp = (x / y) / (a * exp(b - ((t * log(a)) + (y * log(z)))));
}
return tmp;
}




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.4 |
| Herbie | 0.5 |
if x < -5.06358e-218 or 3.73191e-81 < x Initial program 1.4
Taylor expanded around inf 1.4
Simplified0.7
rmApplied un-div-inv_binary64_37860.7
Applied associate-/l/_binary64_38500.6
Simplified0.6
if -5.06358e-218 < x < 3.73191e-81Initial program 3.5
Taylor expanded around inf 3.5
Simplified2.7
rmApplied un-div-inv_binary64_37862.7
Applied associate-/l/_binary64_38503.1
Simplified3.1
rmApplied associate-/r*_binary64_38470.1
Final simplification0.5
herbie shell --seed 2020231
(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))