(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
(let* ((t_1 (- (+ a 0.8333333333333334) (/ 0.6666666666666666 t))))
(if (<= t -4.598639463012585e-77)
(/ x (fma y (pow (exp 2.0) (fma t_1 (- c b) (* (/ z t) (sqrt a)))) x))
(if (<= t 5.914976321355086e-279)
(/
x
(fma
y
(pow
(exp 2.0)
(/
(fma
0.6666666666666666
b
(fma z (sqrt a) (* c -0.6666666666666666)))
t))
x))
(/ x (fma y (pow (exp 2.0) (fma t_1 (- c b) (* z (pow t -0.5)))) x))))))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 t_1 = (a + 0.8333333333333334) - (0.6666666666666666 / t);
double tmp;
if (t <= -4.598639463012585e-77) {
tmp = x / fma(y, pow(exp(2.0), fma(t_1, (c - b), ((z / t) * sqrt(a)))), x);
} else if (t <= 5.914976321355086e-279) {
tmp = x / fma(y, pow(exp(2.0), (fma(0.6666666666666666, b, fma(z, sqrt(a), (c * -0.6666666666666666))) / t)), x);
} else {
tmp = x / fma(y, pow(exp(2.0), fma(t_1, (c - b), (z * pow(t, -0.5)))), x);
}
return tmp;
}
function code(x, y, z, t, a, b, c) return Float64(x / Float64(x + Float64(y * exp(Float64(2.0 * Float64(Float64(Float64(z * sqrt(Float64(t + a))) / t) - Float64(Float64(b - c) * Float64(Float64(a + Float64(5.0 / 6.0)) - Float64(2.0 / Float64(t * 3.0)))))))))) end
function code(x, y, z, t, a, b, c) t_1 = Float64(Float64(a + 0.8333333333333334) - Float64(0.6666666666666666 / t)) tmp = 0.0 if (t <= -4.598639463012585e-77) tmp = Float64(x / fma(y, (exp(2.0) ^ fma(t_1, Float64(c - b), Float64(Float64(z / t) * sqrt(a)))), x)); elseif (t <= 5.914976321355086e-279) tmp = Float64(x / fma(y, (exp(2.0) ^ Float64(fma(0.6666666666666666, b, fma(z, sqrt(a), Float64(c * -0.6666666666666666))) / t)), x)); else tmp = Float64(x / fma(y, (exp(2.0) ^ fma(t_1, Float64(c - b), Float64(z * (t ^ -0.5)))), x)); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_] := N[(x / N[(x + N[(y * N[Exp[N[(2.0 * N[(N[(N[(z * N[Sqrt[N[(t + a), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision] - N[(N[(b - c), $MachinePrecision] * N[(N[(a + N[(5.0 / 6.0), $MachinePrecision]), $MachinePrecision] - N[(2.0 / N[(t * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(N[(a + 0.8333333333333334), $MachinePrecision] - N[(0.6666666666666666 / t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -4.598639463012585e-77], N[(x / N[(y * N[Power[N[Exp[2.0], $MachinePrecision], N[(t$95$1 * N[(c - b), $MachinePrecision] + N[(N[(z / t), $MachinePrecision] * N[Sqrt[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] + x), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 5.914976321355086e-279], N[(x / N[(y * N[Power[N[Exp[2.0], $MachinePrecision], N[(N[(0.6666666666666666 * b + N[(z * N[Sqrt[a], $MachinePrecision] + N[(c * -0.6666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]], $MachinePrecision] + x), $MachinePrecision]), $MachinePrecision], N[(x / N[(y * N[Power[N[Exp[2.0], $MachinePrecision], N[(t$95$1 * N[(c - b), $MachinePrecision] + N[(z * N[Power[t, -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] + x), $MachinePrecision]), $MachinePrecision]]]]
\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}
t_1 := \left(a + 0.8333333333333334\right) - \frac{0.6666666666666666}{t}\\
\mathbf{if}\;t \leq -4.598639463012585 \cdot 10^{-77}:\\
\;\;\;\;\frac{x}{\mathsf{fma}\left(y, {\left(e^{2}\right)}^{\left(\mathsf{fma}\left(t_1, c - b, \frac{z}{t} \cdot \sqrt{a}\right)\right)}, x\right)}\\
\mathbf{elif}\;t \leq 5.914976321355086 \cdot 10^{-279}:\\
\;\;\;\;\frac{x}{\mathsf{fma}\left(y, {\left(e^{2}\right)}^{\left(\frac{\mathsf{fma}\left(0.6666666666666666, b, \mathsf{fma}\left(z, \sqrt{a}, c \cdot -0.6666666666666666\right)\right)}{t}\right)}, x\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\mathsf{fma}\left(y, {\left(e^{2}\right)}^{\left(\mathsf{fma}\left(t_1, c - b, z \cdot {t}^{-0.5}\right)\right)}, x\right)}\\
\end{array}




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
| Original | 4.0 |
|---|---|
| Target | 3.1 |
| Herbie | 1.0 |
if t < -4.5986394630125848e-77Initial program 2.7
Simplified2.3
Taylor expanded in t around 0 0.9
Simplified0.9
if -4.5986394630125848e-77 < t < 5.91497632135508614e-279Initial program 8.4
Simplified4.2
Taylor expanded in t around 0 1.1
Simplified1.1
if 5.91497632135508614e-279 < t Initial program 3.1
Simplified2.4
Taylor expanded in a around 0 1.0
Applied inv-pow_binary641.0
Applied sqrt-pow1_binary641.0
Simplified1.0
Final simplification1.0
herbie shell --seed 2022130
(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)))))))))))