\frac{x}{x + y \cdot e^{2 \cdot \left(\frac{z \cdot \sqrt{t + a}}{t} - \left(b - c\right) \cdot \left(\left(a + \frac{5}{6}\right) - \frac{2}{t \cdot 3}\right)\right)}}\begin{array}{l}
\mathbf{if}\;\frac{x}{x + y \cdot e^{2 \cdot \left(\frac{z \cdot \sqrt{t + a}}{t} + \left(b - c\right) \cdot \left(\frac{2}{t \cdot 3} - \left(a + \frac{5}{6}\right)\right)\right)}} \leq 8.791746298594605 \cdot 10^{-70}:\\
\;\;\;\;\frac{x}{x + y \cdot {\left(e^{2}\right)}^{\left(\frac{z}{\frac{t}{\sqrt{t + a}}} + \left(b - c\right) \cdot \left(\frac{2}{t \cdot 3} - \left(a + \frac{5}{6}\right)\right)\right)}}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}(FPCore (x y z t a b c)
:precision binary64
(/
x
(+
x
(*
y
(exp
(*
2.0
(-
(/ (* z (sqrt (+ t a))) t)
(* (- b c) (- (+ a (/ 5.0 6.0)) (/ 2.0 (* t 3.0)))))))))))(FPCore (x y z t a b c)
:precision binary64
(if (<=
(/
x
(+
x
(*
y
(exp
(*
2.0
(+
(/ (* z (sqrt (+ t a))) t)
(* (- b c) (- (/ 2.0 (* t 3.0)) (+ a (/ 5.0 6.0))))))))))
8.791746298594605e-70)
(/
x
(+
x
(*
y
(pow
(exp 2.0)
(+
(/ z (/ t (sqrt (+ t a))))
(* (- b c) (- (/ 2.0 (* t 3.0)) (+ a (/ 5.0 6.0)))))))))
1.0))double code(double x, double y, double z, double t, double a, double b, double c) {
return x / (x + (y * exp(2.0 * (((z * sqrt(t + a)) / t) - ((b - c) * ((a + (5.0 / 6.0)) - (2.0 / (t * 3.0))))))));
}
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if ((x / (x + (y * exp(2.0 * (((z * sqrt(t + a)) / t) + ((b - c) * ((2.0 / (t * 3.0)) - (a + (5.0 / 6.0))))))))) <= 8.791746298594605e-70) {
tmp = x / (x + (y * pow(exp(2.0), ((z / (t / sqrt(t + a))) + ((b - c) * ((2.0 / (t * 3.0)) - (a + (5.0 / 6.0))))))));
} else {
tmp = 1.0;
}
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




Bits error versus c
Results
| Original | 4.0 |
|---|---|
| Target | 3.0 |
| Herbie | 2.4 |
if (/.f64 x (+.f64 x (*.f64 y (exp.f64 (*.f64 2 (-.f64 (/.f64 (*.f64 z (sqrt.f64 (+.f64 t a))) t) (*.f64 (-.f64 b c) (-.f64 (+.f64 a (/.f64 5 6)) (/.f64 2 (*.f64 t 3)))))))))) < 8.7917462985946049e-70Initial program 0.8
Simplified0.6
if 8.7917462985946049e-70 < (/.f64 x (+.f64 x (*.f64 y (exp.f64 (*.f64 2 (-.f64 (/.f64 (*.f64 z (sqrt.f64 (+.f64 t a))) t) (*.f64 (-.f64 b c) (-.f64 (+.f64 a (/.f64 5 6)) (/.f64 2 (*.f64 t 3)))))))))) Initial program 6.8
Simplified5.4
Taylor expanded around inf 23.4
Simplified23.4
Taylor expanded around inf 4.0
Final simplification2.4
herbie shell --seed 2021176
(FPCore (x y z t a b c)
:name "Numeric.SpecFunctions:invIncompleteBetaWorker from math-functions-0.1.5.2, I"
:precision binary64
:herbie-target
(if (< t -2.118326644891581e-50) (/ x (+ x (* y (exp (* 2.0 (- (+ (* a c) (* 0.8333333333333334 c)) (* a b))))))) (if (< t 5.196588770651547e-123) (/ x (+ x (* y (exp (* 2.0 (/ (- (* (* z (sqrt (+ t a))) (* (* 3.0 t) (- a (/ 5.0 6.0)))) (* (- (* (+ (/ 5.0 6.0) a) (* 3.0 t)) 2.0) (* (- a (/ 5.0 6.0)) (* (- b c) t)))) (* (* (* t t) 3.0) (- a (/ 5.0 6.0))))))))) (/ x (+ x (* y (exp (* 2.0 (- (/ (* z (sqrt (+ t a))) t) (* (- b c) (- (+ a (/ 5.0 6.0)) (/ 2.0 (* t 3.0))))))))))))
(/ x (+ x (* y (exp (* 2.0 (- (/ (* z (sqrt (+ t a))) t) (* (- b c) (- (+ a (/ 5.0 6.0)) (/ 2.0 (* t 3.0)))))))))))