\frac{x \cdot e^{\left(y \cdot \log z + \left(t - 1\right) \cdot \log a\right) - b}}{y}
\begin{array}{l}
t_1 := e^{\left(y \cdot \log z + \left(t - 1\right) \cdot \log a\right) - b}\\
t_2 := \frac{x \cdot t_1}{y}\\
\mathbf{if}\;t_2 \leq -8.813710034410774 \cdot 10^{-97}:\\
\;\;\;\;\frac{x \cdot \left(\frac{{z}^{y}}{a \cdot e^{b}} \cdot {a}^{t}\right)}{y}\\
\mathbf{elif}\;t_2 \leq 3.8472901968920143 \cdot 10^{-149}:\\
\;\;\;\;\frac{x}{\frac{y}{t_1}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{{z}^{y}}{e^{b}}}{\frac{y}{\frac{x}{a}}}\\
\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
(let* ((t_1 (exp (- (+ (* y (log z)) (* (- t 1.0) (log a))) b)))
(t_2 (/ (* x t_1) y)))
(if (<= t_2 -8.813710034410774e-97)
(/ (* x (* (/ (pow z y) (* a (exp b))) (pow a t))) y)
(if (<= t_2 3.8472901968920143e-149)
(/ x (/ y t_1))
(/ (/ (pow z y) (exp b)) (/ y (/ x a)))))))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 t_1 = exp(((y * log(z)) + ((t - 1.0) * log(a))) - b);
double t_2 = (x * t_1) / y;
double tmp;
if (t_2 <= -8.813710034410774e-97) {
tmp = (x * ((pow(z, y) / (a * exp(b))) * pow(a, t))) / y;
} else if (t_2 <= 3.8472901968920143e-149) {
tmp = x / (y / t_1);
} else {
tmp = (pow(z, y) / exp(b)) / (y / (x / a));
}
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 | 1.7 |
|---|---|
| Target | 11.3 |
| Herbie | 0.4 |
if (/.f64 (*.f64 x (exp.f64 (-.f64 (+.f64 (*.f64 y (log.f64 z)) (*.f64 (-.f64 t 1) (log.f64 a))) b))) y) < -8.8137100344107737e-97Initial program 6.0
Applied add-exp-log_binary646.0
Simplified6.0
Taylor expanded in a around 0 6.0
Simplified0.7
if -8.8137100344107737e-97 < (/.f64 (*.f64 x (exp.f64 (-.f64 (+.f64 (*.f64 y (log.f64 z)) (*.f64 (-.f64 t 1) (log.f64 a))) b))) y) < 3.8472901968920143e-149Initial program 1.2
Applied associate-/l*_binary640.2
if 3.8472901968920143e-149 < (/.f64 (*.f64 x (exp.f64 (-.f64 (+.f64 (*.f64 y (log.f64 z)) (*.f64 (-.f64 t 1) (log.f64 a))) b))) y) Initial program 5.7
Applied add-exp-log_binary645.7
Simplified5.7
Taylor expanded in a around 0 5.7
Simplified0.7
Taylor expanded in a around inf 9.9
Simplified9.8
Taylor expanded in t around 0 11.4
Simplified2.4
Final simplification0.4
herbie shell --seed 2021313
(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))