| Alternative 1 | |
|---|---|
| Error | 1.7 |
| Cost | 33408 |
\[\frac{x}{\mathsf{fma}\left(y, {\left(e^{2}\right)}^{\left(\mathsf{fma}\left(0.8333333333333334 + \left(a + \frac{-0.6666666666666666}{t}\right), c - b, \sqrt{a + t} \cdot \frac{z}{t}\right)\right)}, x\right)}
\]
(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 (sqrt (+ a t))))
(if (<=
(+
(/ (* t_1 z) t)
(* (- b c) (+ (/ 2.0 (* t 3.0)) (- -0.8333333333333334 a))))
INFINITY)
(/
x
(fma
y
(pow
(exp 2.0)
(+
(* t_1 (/ z t))
(* (- c b) (+ a (+ 0.8333333333333334 (/ -0.6666666666666666 t))))))
x))
(/
x
(+
x
(*
y
(exp
(*
2.0
(/ (+ (* z (sqrt a)) (* (- c b) -0.6666666666666666)) t)))))))))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 = sqrt((a + t));
double tmp;
if ((((t_1 * z) / t) + ((b - c) * ((2.0 / (t * 3.0)) + (-0.8333333333333334 - a)))) <= ((double) INFINITY)) {
tmp = x / fma(y, pow(exp(2.0), ((t_1 * (z / t)) + ((c - b) * (a + (0.8333333333333334 + (-0.6666666666666666 / t)))))), x);
} else {
tmp = x / (x + (y * exp((2.0 * (((z * sqrt(a)) + ((c - b) * -0.6666666666666666)) / t)))));
}
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 = sqrt(Float64(a + t)) tmp = 0.0 if (Float64(Float64(Float64(t_1 * z) / t) + Float64(Float64(b - c) * Float64(Float64(2.0 / Float64(t * 3.0)) + Float64(-0.8333333333333334 - a)))) <= Inf) tmp = Float64(x / fma(y, (exp(2.0) ^ Float64(Float64(t_1 * Float64(z / t)) + Float64(Float64(c - b) * Float64(a + Float64(0.8333333333333334 + Float64(-0.6666666666666666 / t)))))), x)); else tmp = Float64(x / Float64(x + Float64(y * exp(Float64(2.0 * Float64(Float64(Float64(z * sqrt(a)) + Float64(Float64(c - b) * -0.6666666666666666)) / t)))))); 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[Sqrt[N[(a + t), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[(N[(N[(t$95$1 * z), $MachinePrecision] / t), $MachinePrecision] + N[(N[(b - c), $MachinePrecision] * N[(N[(2.0 / N[(t * 3.0), $MachinePrecision]), $MachinePrecision] + N[(-0.8333333333333334 - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], Infinity], N[(x / N[(y * N[Power[N[Exp[2.0], $MachinePrecision], N[(N[(t$95$1 * N[(z / t), $MachinePrecision]), $MachinePrecision] + N[(N[(c - b), $MachinePrecision] * N[(a + N[(0.8333333333333334 + N[(-0.6666666666666666 / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] + x), $MachinePrecision]), $MachinePrecision], N[(x / N[(x + N[(y * N[Exp[N[(2.0 * N[(N[(N[(z * N[Sqrt[a], $MachinePrecision]), $MachinePrecision] + N[(N[(c - b), $MachinePrecision] * -0.6666666666666666), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $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 := \sqrt{a + t}\\
\mathbf{if}\;\frac{t_1 \cdot z}{t} + \left(b - c\right) \cdot \left(\frac{2}{t \cdot 3} + \left(-0.8333333333333334 - a\right)\right) \leq \infty:\\
\;\;\;\;\frac{x}{\mathsf{fma}\left(y, {\left(e^{2}\right)}^{\left(t_1 \cdot \frac{z}{t} + \left(c - b\right) \cdot \left(a + \left(0.8333333333333334 + \frac{-0.6666666666666666}{t}\right)\right)\right)}, x\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{x + y \cdot e^{2 \cdot \frac{z \cdot \sqrt{a} + \left(c - b\right) \cdot -0.6666666666666666}{t}}}\\
\end{array}
| Original | 3.6 |
|---|---|
| Target | 2.6 |
| Herbie | 1.3 |
if (-.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))))) < +inf.0Initial program 0.6
Simplified0.4
if +inf.0 < (-.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 64.0
Taylor expanded in t around 0 19.6
Final simplification1.3
| Alternative 1 | |
|---|---|
| Error | 1.7 |
| Cost | 33408 |
| Alternative 2 | |
|---|---|
| Error | 1.5 |
| Cost | 22468 |
| Alternative 3 | |
|---|---|
| Error | 7.1 |
| Cost | 14536 |
| Alternative 4 | |
|---|---|
| Error | 9.4 |
| Cost | 14148 |
| Alternative 5 | |
|---|---|
| Error | 13.7 |
| Cost | 14024 |
| Alternative 6 | |
|---|---|
| Error | 13.3 |
| Cost | 13896 |
| Alternative 7 | |
|---|---|
| Error | 13.8 |
| Cost | 8208 |
| Alternative 8 | |
|---|---|
| Error | 13.5 |
| Cost | 8208 |
| Alternative 9 | |
|---|---|
| Error | 13.9 |
| Cost | 7888 |
| Alternative 10 | |
|---|---|
| Error | 18.1 |
| Cost | 7632 |
| Alternative 11 | |
|---|---|
| Error | 17.9 |
| Cost | 7628 |
| Alternative 12 | |
|---|---|
| Error | 19.8 |
| Cost | 7368 |
| Alternative 13 | |
|---|---|
| Error | 18.4 |
| Cost | 7368 |
| Alternative 14 | |
|---|---|
| Error | 32.8 |
| Cost | 7236 |
| Alternative 15 | |
|---|---|
| Error | 32.0 |
| Cost | 2268 |
| Alternative 16 | |
|---|---|
| Error | 32.2 |
| Cost | 2148 |
| Alternative 17 | |
|---|---|
| Error | 32.3 |
| Cost | 2020 |
| Alternative 18 | |
|---|---|
| Error | 32.3 |
| Cost | 2020 |
| Alternative 19 | |
|---|---|
| Error | 32.2 |
| Cost | 2020 |
| Alternative 20 | |
|---|---|
| Error | 31.0 |
| Cost | 1632 |
| Alternative 21 | |
|---|---|
| Error | 31.3 |
| Cost | 1500 |
| Alternative 22 | |
|---|---|
| Error | 31.9 |
| Cost | 1500 |
| Alternative 23 | |
|---|---|
| Error | 32.2 |
| Cost | 980 |
| Alternative 24 | |
|---|---|
| Error | 32.9 |
| Cost | 848 |
| Alternative 25 | |
|---|---|
| Error | 32.9 |
| Cost | 848 |
| Alternative 26 | |
|---|---|
| Error | 31.4 |
| Cost | 64 |
herbie shell --seed 2022325
(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)))))))))))