| Alternative 1 | |
|---|---|
| Accuracy | 99.7% |
| Cost | 55240 |
(FPCore (x)
:precision binary64
(-
1.0
(*
(*
(/ 1.0 (+ 1.0 (* 0.3275911 (fabs x))))
(+
0.254829592
(*
(/ 1.0 (+ 1.0 (* 0.3275911 (fabs x))))
(+
-0.284496736
(*
(/ 1.0 (+ 1.0 (* 0.3275911 (fabs x))))
(+
1.421413741
(*
(/ 1.0 (+ 1.0 (* 0.3275911 (fabs x))))
(+
-1.453152027
(* (/ 1.0 (+ 1.0 (* 0.3275911 (fabs x)))) 1.061405429)))))))))
(exp (- (* (fabs x) (fabs x)))))))(FPCore (x)
:precision binary64
(let* ((t_0 (fma 0.3275911 (fabs x) 1.0))
(t_1 (+ 1.0 (* 0.3275911 (fabs x))))
(t_2 (/ 1.0 t_1))
(t_3 (exp (* x (- x)))))
(if (<= x -1.2e-6)
(+
1.0
(*
(*
(+
0.254829592
(*
t_2
(+
-0.284496736
(*
t_2
(+
1.421413741
(+ (/ 1.061405429 (pow t_0 2.0)) (/ -1.453152027 t_0)))))))
t_3)
(/ -1.0 t_1)))
(if (<= x 9.6e-7)
(+ 1e-9 (sqrt (* (* x x) 1.2732557730789702)))
(-
1.0
(*
t_2
(*
t_3
(+
0.254829592
(*
t_2
(+
-0.284496736
(*
(/ 1.0 (+ 1.0 (log (+ 1.0 (expm1 (* x 0.3275911))))))
(+
(+ 1.421413741 (* 1.061405429 (/ 1.0 (pow t_1 2.0))))
(* t_2 -1.453152027)))))))))))))double code(double x) {
return 1.0 - (((1.0 / (1.0 + (0.3275911 * fabs(x)))) * (0.254829592 + ((1.0 / (1.0 + (0.3275911 * fabs(x)))) * (-0.284496736 + ((1.0 / (1.0 + (0.3275911 * fabs(x)))) * (1.421413741 + ((1.0 / (1.0 + (0.3275911 * fabs(x)))) * (-1.453152027 + ((1.0 / (1.0 + (0.3275911 * fabs(x)))) * 1.061405429))))))))) * exp(-(fabs(x) * fabs(x))));
}
double code(double x) {
double t_0 = fma(0.3275911, fabs(x), 1.0);
double t_1 = 1.0 + (0.3275911 * fabs(x));
double t_2 = 1.0 / t_1;
double t_3 = exp((x * -x));
double tmp;
if (x <= -1.2e-6) {
tmp = 1.0 + (((0.254829592 + (t_2 * (-0.284496736 + (t_2 * (1.421413741 + ((1.061405429 / pow(t_0, 2.0)) + (-1.453152027 / t_0))))))) * t_3) * (-1.0 / t_1));
} else if (x <= 9.6e-7) {
tmp = 1e-9 + sqrt(((x * x) * 1.2732557730789702));
} else {
tmp = 1.0 - (t_2 * (t_3 * (0.254829592 + (t_2 * (-0.284496736 + ((1.0 / (1.0 + log((1.0 + expm1((x * 0.3275911)))))) * ((1.421413741 + (1.061405429 * (1.0 / pow(t_1, 2.0)))) + (t_2 * -1.453152027))))))));
}
return tmp;
}
function code(x) return Float64(1.0 - Float64(Float64(Float64(1.0 / Float64(1.0 + Float64(0.3275911 * abs(x)))) * Float64(0.254829592 + Float64(Float64(1.0 / Float64(1.0 + Float64(0.3275911 * abs(x)))) * Float64(-0.284496736 + Float64(Float64(1.0 / Float64(1.0 + Float64(0.3275911 * abs(x)))) * Float64(1.421413741 + Float64(Float64(1.0 / Float64(1.0 + Float64(0.3275911 * abs(x)))) * Float64(-1.453152027 + Float64(Float64(1.0 / Float64(1.0 + Float64(0.3275911 * abs(x)))) * 1.061405429))))))))) * exp(Float64(-Float64(abs(x) * abs(x)))))) end
function code(x) t_0 = fma(0.3275911, abs(x), 1.0) t_1 = Float64(1.0 + Float64(0.3275911 * abs(x))) t_2 = Float64(1.0 / t_1) t_3 = exp(Float64(x * Float64(-x))) tmp = 0.0 if (x <= -1.2e-6) tmp = Float64(1.0 + Float64(Float64(Float64(0.254829592 + Float64(t_2 * Float64(-0.284496736 + Float64(t_2 * Float64(1.421413741 + Float64(Float64(1.061405429 / (t_0 ^ 2.0)) + Float64(-1.453152027 / t_0))))))) * t_3) * Float64(-1.0 / t_1))); elseif (x <= 9.6e-7) tmp = Float64(1e-9 + sqrt(Float64(Float64(x * x) * 1.2732557730789702))); else tmp = Float64(1.0 - Float64(t_2 * Float64(t_3 * Float64(0.254829592 + Float64(t_2 * Float64(-0.284496736 + Float64(Float64(1.0 / Float64(1.0 + log(Float64(1.0 + expm1(Float64(x * 0.3275911)))))) * Float64(Float64(1.421413741 + Float64(1.061405429 * Float64(1.0 / (t_1 ^ 2.0)))) + Float64(t_2 * -1.453152027))))))))); end return tmp end
code[x_] := N[(1.0 - N[(N[(N[(1.0 / N[(1.0 + N[(0.3275911 * N[Abs[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(0.254829592 + N[(N[(1.0 / N[(1.0 + N[(0.3275911 * N[Abs[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(-0.284496736 + N[(N[(1.0 / N[(1.0 + N[(0.3275911 * N[Abs[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.421413741 + N[(N[(1.0 / N[(1.0 + N[(0.3275911 * N[Abs[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(-1.453152027 + N[(N[(1.0 / N[(1.0 + N[(0.3275911 * N[Abs[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * 1.061405429), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Exp[(-N[(N[Abs[x], $MachinePrecision] * N[Abs[x], $MachinePrecision]), $MachinePrecision])], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
code[x_] := Block[{t$95$0 = N[(0.3275911 * N[Abs[x], $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$1 = N[(1.0 + N[(0.3275911 * N[Abs[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(1.0 / t$95$1), $MachinePrecision]}, Block[{t$95$3 = N[Exp[N[(x * (-x)), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[x, -1.2e-6], N[(1.0 + N[(N[(N[(0.254829592 + N[(t$95$2 * N[(-0.284496736 + N[(t$95$2 * N[(1.421413741 + N[(N[(1.061405429 / N[Power[t$95$0, 2.0], $MachinePrecision]), $MachinePrecision] + N[(-1.453152027 / t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$3), $MachinePrecision] * N[(-1.0 / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 9.6e-7], N[(1e-9 + N[Sqrt[N[(N[(x * x), $MachinePrecision] * 1.2732557730789702), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(1.0 - N[(t$95$2 * N[(t$95$3 * N[(0.254829592 + N[(t$95$2 * N[(-0.284496736 + N[(N[(1.0 / N[(1.0 + N[Log[N[(1.0 + N[(Exp[N[(x * 0.3275911), $MachinePrecision]] - 1), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(1.421413741 + N[(1.061405429 * N[(1.0 / N[Power[t$95$1, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$2 * -1.453152027), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
1 - \left(\frac{1}{1 + 0.3275911 \cdot \left|x\right|} \cdot \left(0.254829592 + \frac{1}{1 + 0.3275911 \cdot \left|x\right|} \cdot \left(-0.284496736 + \frac{1}{1 + 0.3275911 \cdot \left|x\right|} \cdot \left(1.421413741 + \frac{1}{1 + 0.3275911 \cdot \left|x\right|} \cdot \left(-1.453152027 + \frac{1}{1 + 0.3275911 \cdot \left|x\right|} \cdot 1.061405429\right)\right)\right)\right)\right) \cdot e^{-\left|x\right| \cdot \left|x\right|}
\begin{array}{l}
t_0 := \mathsf{fma}\left(0.3275911, \left|x\right|, 1\right)\\
t_1 := 1 + 0.3275911 \cdot \left|x\right|\\
t_2 := \frac{1}{t_1}\\
t_3 := e^{x \cdot \left(-x\right)}\\
\mathbf{if}\;x \leq -1.2 \cdot 10^{-6}:\\
\;\;\;\;1 + \left(\left(0.254829592 + t_2 \cdot \left(-0.284496736 + t_2 \cdot \left(1.421413741 + \left(\frac{1.061405429}{{t_0}^{2}} + \frac{-1.453152027}{t_0}\right)\right)\right)\right) \cdot t_3\right) \cdot \frac{-1}{t_1}\\
\mathbf{elif}\;x \leq 9.6 \cdot 10^{-7}:\\
\;\;\;\;10^{-9} + \sqrt{\left(x \cdot x\right) \cdot 1.2732557730789702}\\
\mathbf{else}:\\
\;\;\;\;1 - t_2 \cdot \left(t_3 \cdot \left(0.254829592 + t_2 \cdot \left(-0.284496736 + \frac{1}{1 + \log \left(1 + \mathsf{expm1}\left(x \cdot 0.3275911\right)\right)} \cdot \left(\left(1.421413741 + 1.061405429 \cdot \frac{1}{{t_1}^{2}}\right) + t_2 \cdot -1.453152027\right)\right)\right)\right)\\
\end{array}
if x < -1.1999999999999999e-6Initial program 99.8%
Simplified99.8%
[Start]99.8 | \[ 1 - \left(\frac{1}{1 + 0.3275911 \cdot \left|x\right|} \cdot \left(0.254829592 + \frac{1}{1 + 0.3275911 \cdot \left|x\right|} \cdot \left(-0.284496736 + \frac{1}{1 + 0.3275911 \cdot \left|x\right|} \cdot \left(1.421413741 + \frac{1}{1 + 0.3275911 \cdot \left|x\right|} \cdot \left(-1.453152027 + \frac{1}{1 + 0.3275911 \cdot \left|x\right|} \cdot 1.061405429\right)\right)\right)\right)\right) \cdot e^{-\left|x\right| \cdot \left|x\right|}
\] |
|---|---|
associate-*l* [=>]99.8 | \[ 1 - \color{blue}{\frac{1}{1 + 0.3275911 \cdot \left|x\right|} \cdot \left(\left(0.254829592 + \frac{1}{1 + 0.3275911 \cdot \left|x\right|} \cdot \left(-0.284496736 + \frac{1}{1 + 0.3275911 \cdot \left|x\right|} \cdot \left(1.421413741 + \frac{1}{1 + 0.3275911 \cdot \left|x\right|} \cdot \left(-1.453152027 + \frac{1}{1 + 0.3275911 \cdot \left|x\right|} \cdot 1.061405429\right)\right)\right)\right) \cdot e^{-\left|x\right| \cdot \left|x\right|}\right)}
\] |
Taylor expanded in x around 0 99.8%
Simplified99.8%
[Start]99.8 | \[ 1 - \frac{1}{1 + 0.3275911 \cdot \left|x\right|} \cdot \left(\left(0.254829592 + \frac{1}{1 + 0.3275911 \cdot \left|x\right|} \cdot \left(-0.284496736 + \frac{1}{1 + 0.3275911 \cdot \left|x\right|} \cdot \left(\left(1.421413741 + 1.061405429 \cdot \frac{1}{{\left(0.3275911 \cdot \left|x\right| + 1\right)}^{2}}\right) - 1.453152027 \cdot \frac{1}{0.3275911 \cdot \left|x\right| + 1}\right)\right)\right) \cdot e^{-x \cdot x}\right)
\] |
|---|---|
associate--l+ [=>]99.8 | \[ 1 - \frac{1}{1 + 0.3275911 \cdot \left|x\right|} \cdot \left(\left(0.254829592 + \frac{1}{1 + 0.3275911 \cdot \left|x\right|} \cdot \left(-0.284496736 + \frac{1}{1 + 0.3275911 \cdot \left|x\right|} \cdot \color{blue}{\left(1.421413741 + \left(1.061405429 \cdot \frac{1}{{\left(0.3275911 \cdot \left|x\right| + 1\right)}^{2}} - 1.453152027 \cdot \frac{1}{0.3275911 \cdot \left|x\right| + 1}\right)\right)}\right)\right) \cdot e^{-x \cdot x}\right)
\] |
associate-*r/ [=>]99.8 | \[ 1 - \frac{1}{1 + 0.3275911 \cdot \left|x\right|} \cdot \left(\left(0.254829592 + \frac{1}{1 + 0.3275911 \cdot \left|x\right|} \cdot \left(-0.284496736 + \frac{1}{1 + 0.3275911 \cdot \left|x\right|} \cdot \left(1.421413741 + \left(\color{blue}{\frac{1.061405429 \cdot 1}{{\left(0.3275911 \cdot \left|x\right| + 1\right)}^{2}}} - 1.453152027 \cdot \frac{1}{0.3275911 \cdot \left|x\right| + 1}\right)\right)\right)\right) \cdot e^{-x \cdot x}\right)
\] |
+-commutative [=>]99.8 | \[ 1 - \frac{1}{1 + 0.3275911 \cdot \left|x\right|} \cdot \left(\left(0.254829592 + \frac{1}{1 + 0.3275911 \cdot \left|x\right|} \cdot \left(-0.284496736 + \frac{1}{1 + 0.3275911 \cdot \left|x\right|} \cdot \left(1.421413741 + \left(\frac{1.061405429 \cdot 1}{{\color{blue}{\left(1 + 0.3275911 \cdot \left|x\right|\right)}}^{2}} - 1.453152027 \cdot \frac{1}{0.3275911 \cdot \left|x\right| + 1}\right)\right)\right)\right) \cdot e^{-x \cdot x}\right)
\] |
metadata-eval [=>]99.8 | \[ 1 - \frac{1}{1 + 0.3275911 \cdot \left|x\right|} \cdot \left(\left(0.254829592 + \frac{1}{1 + 0.3275911 \cdot \left|x\right|} \cdot \left(-0.284496736 + \frac{1}{1 + 0.3275911 \cdot \left|x\right|} \cdot \left(1.421413741 + \left(\frac{\color{blue}{1.061405429}}{{\left(1 + 0.3275911 \cdot \left|x\right|\right)}^{2}} - 1.453152027 \cdot \frac{1}{0.3275911 \cdot \left|x\right| + 1}\right)\right)\right)\right) \cdot e^{-x \cdot x}\right)
\] |
+-commutative [<=]99.8 | \[ 1 - \frac{1}{1 + 0.3275911 \cdot \left|x\right|} \cdot \left(\left(0.254829592 + \frac{1}{1 + 0.3275911 \cdot \left|x\right|} \cdot \left(-0.284496736 + \frac{1}{1 + 0.3275911 \cdot \left|x\right|} \cdot \left(1.421413741 + \left(\frac{1.061405429}{{\color{blue}{\left(0.3275911 \cdot \left|x\right| + 1\right)}}^{2}} - 1.453152027 \cdot \frac{1}{0.3275911 \cdot \left|x\right| + 1}\right)\right)\right)\right) \cdot e^{-x \cdot x}\right)
\] |
fma-def [=>]99.8 | \[ 1 - \frac{1}{1 + 0.3275911 \cdot \left|x\right|} \cdot \left(\left(0.254829592 + \frac{1}{1 + 0.3275911 \cdot \left|x\right|} \cdot \left(-0.284496736 + \frac{1}{1 + 0.3275911 \cdot \left|x\right|} \cdot \left(1.421413741 + \left(\frac{1.061405429}{{\color{blue}{\left(\mathsf{fma}\left(0.3275911, \left|x\right|, 1\right)\right)}}^{2}} - 1.453152027 \cdot \frac{1}{0.3275911 \cdot \left|x\right| + 1}\right)\right)\right)\right) \cdot e^{-x \cdot x}\right)
\] |
associate-*r/ [=>]99.8 | \[ 1 - \frac{1}{1 + 0.3275911 \cdot \left|x\right|} \cdot \left(\left(0.254829592 + \frac{1}{1 + 0.3275911 \cdot \left|x\right|} \cdot \left(-0.284496736 + \frac{1}{1 + 0.3275911 \cdot \left|x\right|} \cdot \left(1.421413741 + \left(\frac{1.061405429}{{\left(\mathsf{fma}\left(0.3275911, \left|x\right|, 1\right)\right)}^{2}} - \color{blue}{\frac{1.453152027 \cdot 1}{0.3275911 \cdot \left|x\right| + 1}}\right)\right)\right)\right) \cdot e^{-x \cdot x}\right)
\] |
metadata-eval [=>]99.8 | \[ 1 - \frac{1}{1 + 0.3275911 \cdot \left|x\right|} \cdot \left(\left(0.254829592 + \frac{1}{1 + 0.3275911 \cdot \left|x\right|} \cdot \left(-0.284496736 + \frac{1}{1 + 0.3275911 \cdot \left|x\right|} \cdot \left(1.421413741 + \left(\frac{1.061405429}{{\left(\mathsf{fma}\left(0.3275911, \left|x\right|, 1\right)\right)}^{2}} - \frac{\color{blue}{1.453152027}}{0.3275911 \cdot \left|x\right| + 1}\right)\right)\right)\right) \cdot e^{-x \cdot x}\right)
\] |
fma-def [=>]99.8 | \[ 1 - \frac{1}{1 + 0.3275911 \cdot \left|x\right|} \cdot \left(\left(0.254829592 + \frac{1}{1 + 0.3275911 \cdot \left|x\right|} \cdot \left(-0.284496736 + \frac{1}{1 + 0.3275911 \cdot \left|x\right|} \cdot \left(1.421413741 + \left(\frac{1.061405429}{{\left(\mathsf{fma}\left(0.3275911, \left|x\right|, 1\right)\right)}^{2}} - \frac{1.453152027}{\color{blue}{\mathsf{fma}\left(0.3275911, \left|x\right|, 1\right)}}\right)\right)\right)\right) \cdot e^{-x \cdot x}\right)
\] |
if -1.1999999999999999e-6 < x < 9.59999999999999914e-7Initial program 57.7%
Simplified57.7%
[Start]57.7 | \[ 1 - \left(\frac{1}{1 + 0.3275911 \cdot \left|x\right|} \cdot \left(0.254829592 + \frac{1}{1 + 0.3275911 \cdot \left|x\right|} \cdot \left(-0.284496736 + \frac{1}{1 + 0.3275911 \cdot \left|x\right|} \cdot \left(1.421413741 + \frac{1}{1 + 0.3275911 \cdot \left|x\right|} \cdot \left(-1.453152027 + \frac{1}{1 + 0.3275911 \cdot \left|x\right|} \cdot 1.061405429\right)\right)\right)\right)\right) \cdot e^{-\left|x\right| \cdot \left|x\right|}
\] |
|---|---|
associate-*l* [=>]57.7 | \[ 1 - \color{blue}{\frac{1}{1 + 0.3275911 \cdot \left|x\right|} \cdot \left(\left(0.254829592 + \frac{1}{1 + 0.3275911 \cdot \left|x\right|} \cdot \left(-0.284496736 + \frac{1}{1 + 0.3275911 \cdot \left|x\right|} \cdot \left(1.421413741 + \frac{1}{1 + 0.3275911 \cdot \left|x\right|} \cdot \left(-1.453152027 + \frac{1}{1 + 0.3275911 \cdot \left|x\right|} \cdot 1.061405429\right)\right)\right)\right) \cdot e^{-\left|x\right| \cdot \left|x\right|}\right)}
\] |
associate-*l/ [=>]57.7 | \[ 1 - \color{blue}{\frac{1 \cdot \left(\left(0.254829592 + \frac{1}{1 + 0.3275911 \cdot \left|x\right|} \cdot \left(-0.284496736 + \frac{1}{1 + 0.3275911 \cdot \left|x\right|} \cdot \left(1.421413741 + \frac{1}{1 + 0.3275911 \cdot \left|x\right|} \cdot \left(-1.453152027 + \frac{1}{1 + 0.3275911 \cdot \left|x\right|} \cdot 1.061405429\right)\right)\right)\right) \cdot e^{-\left|x\right| \cdot \left|x\right|}\right)}{1 + 0.3275911 \cdot \left|x\right|}}
\] |
Applied egg-rr54.9%
[Start]57.7 | \[ 1 - \frac{\frac{0.254829592 + \frac{-0.284496736 + \frac{1.421413741 + \frac{-1.453152027 + \frac{1.061405429}{\mathsf{fma}\left(0.3275911, \left|x\right|, 1\right)}}{\mathsf{fma}\left(0.3275911, \left|x\right|, 1\right)}}{\mathsf{fma}\left(0.3275911, \left|x\right|, 1\right)}}{\mathsf{fma}\left(0.3275911, \left|x\right|, 1\right)}}{{\left(e^{x}\right)}^{x}}}{\mathsf{fma}\left(0.3275911, \left|x\right|, 1\right)}
\] |
|---|---|
add-log-exp [=>]55.4 | \[ \color{blue}{\log \left(e^{1 - \frac{\frac{0.254829592 + \frac{-0.284496736 + \frac{1.421413741 + \frac{-1.453152027 + \frac{1.061405429}{\mathsf{fma}\left(0.3275911, \left|x\right|, 1\right)}}{\mathsf{fma}\left(0.3275911, \left|x\right|, 1\right)}}{\mathsf{fma}\left(0.3275911, \left|x\right|, 1\right)}}{\mathsf{fma}\left(0.3275911, \left|x\right|, 1\right)}}{{\left(e^{x}\right)}^{x}}}{\mathsf{fma}\left(0.3275911, \left|x\right|, 1\right)}}\right)}
\] |
associate-/l/ [=>]55.4 | \[ \log \left(e^{1 - \color{blue}{\frac{0.254829592 + \frac{-0.284496736 + \frac{1.421413741 + \frac{-1.453152027 + \frac{1.061405429}{\mathsf{fma}\left(0.3275911, \left|x\right|, 1\right)}}{\mathsf{fma}\left(0.3275911, \left|x\right|, 1\right)}}{\mathsf{fma}\left(0.3275911, \left|x\right|, 1\right)}}{\mathsf{fma}\left(0.3275911, \left|x\right|, 1\right)}}{\mathsf{fma}\left(0.3275911, \left|x\right|, 1\right) \cdot {\left(e^{x}\right)}^{x}}}}\right)
\] |
Taylor expanded in x around 0 98.3%
Applied egg-rr99.7%
[Start]98.3 | \[ 10^{-9} + 1.128386358070218 \cdot x
\] |
|---|---|
add-sqr-sqrt [=>]50.3 | \[ 10^{-9} + \color{blue}{\sqrt{1.128386358070218 \cdot x} \cdot \sqrt{1.128386358070218 \cdot x}}
\] |
sqrt-unprod [=>]99.7 | \[ 10^{-9} + \color{blue}{\sqrt{\left(1.128386358070218 \cdot x\right) \cdot \left(1.128386358070218 \cdot x\right)}}
\] |
swap-sqr [=>]99.7 | \[ 10^{-9} + \sqrt{\color{blue}{\left(1.128386358070218 \cdot 1.128386358070218\right) \cdot \left(x \cdot x\right)}}
\] |
metadata-eval [=>]99.7 | \[ 10^{-9} + \sqrt{\color{blue}{1.2732557730789702} \cdot \left(x \cdot x\right)}
\] |
if 9.59999999999999914e-7 < x Initial program 99.7%
Simplified99.7%
[Start]99.7 | \[ 1 - \left(\frac{1}{1 + 0.3275911 \cdot \left|x\right|} \cdot \left(0.254829592 + \frac{1}{1 + 0.3275911 \cdot \left|x\right|} \cdot \left(-0.284496736 + \frac{1}{1 + 0.3275911 \cdot \left|x\right|} \cdot \left(1.421413741 + \frac{1}{1 + 0.3275911 \cdot \left|x\right|} \cdot \left(-1.453152027 + \frac{1}{1 + 0.3275911 \cdot \left|x\right|} \cdot 1.061405429\right)\right)\right)\right)\right) \cdot e^{-\left|x\right| \cdot \left|x\right|}
\] |
|---|---|
associate-*l* [=>]99.7 | \[ 1 - \color{blue}{\frac{1}{1 + 0.3275911 \cdot \left|x\right|} \cdot \left(\left(0.254829592 + \frac{1}{1 + 0.3275911 \cdot \left|x\right|} \cdot \left(-0.284496736 + \frac{1}{1 + 0.3275911 \cdot \left|x\right|} \cdot \left(1.421413741 + \frac{1}{1 + 0.3275911 \cdot \left|x\right|} \cdot \left(-1.453152027 + \frac{1}{1 + 0.3275911 \cdot \left|x\right|} \cdot 1.061405429\right)\right)\right)\right) \cdot e^{-\left|x\right| \cdot \left|x\right|}\right)}
\] |
Taylor expanded in x around 0 99.7%
Applied egg-rr99.7%
[Start]99.7 | \[ 1 - \frac{1}{1 + 0.3275911 \cdot \left|x\right|} \cdot \left(\left(0.254829592 + \frac{1}{1 + 0.3275911 \cdot \left|x\right|} \cdot \left(-0.284496736 + \frac{1}{1 + 0.3275911 \cdot \left|x\right|} \cdot \left(\left(1.421413741 + 1.061405429 \cdot \frac{1}{{\left(0.3275911 \cdot \left|x\right| + 1\right)}^{2}}\right) - 1.453152027 \cdot \frac{1}{0.3275911 \cdot \left|x\right| + 1}\right)\right)\right) \cdot e^{-x \cdot x}\right)
\] |
|---|---|
log1p-expm1-u [=>]99.7 | \[ 1 - \frac{1}{1 + 0.3275911 \cdot \left|x\right|} \cdot \left(\left(0.254829592 + \frac{1}{1 + 0.3275911 \cdot \left|x\right|} \cdot \left(-0.284496736 + \frac{1}{1 + \color{blue}{\mathsf{log1p}\left(\mathsf{expm1}\left(0.3275911 \cdot \left|x\right|\right)\right)}} \cdot \left(\left(1.421413741 + 1.061405429 \cdot \frac{1}{{\left(0.3275911 \cdot \left|x\right| + 1\right)}^{2}}\right) - 1.453152027 \cdot \frac{1}{0.3275911 \cdot \left|x\right| + 1}\right)\right)\right) \cdot e^{-x \cdot x}\right)
\] |
log1p-udef [=>]99.7 | \[ 1 - \frac{1}{1 + 0.3275911 \cdot \left|x\right|} \cdot \left(\left(0.254829592 + \frac{1}{1 + 0.3275911 \cdot \left|x\right|} \cdot \left(-0.284496736 + \frac{1}{1 + \color{blue}{\log \left(1 + \mathsf{expm1}\left(0.3275911 \cdot \left|x\right|\right)\right)}} \cdot \left(\left(1.421413741 + 1.061405429 \cdot \frac{1}{{\left(0.3275911 \cdot \left|x\right| + 1\right)}^{2}}\right) - 1.453152027 \cdot \frac{1}{0.3275911 \cdot \left|x\right| + 1}\right)\right)\right) \cdot e^{-x \cdot x}\right)
\] |
add-sqr-sqrt [=>]99.7 | \[ 1 - \frac{1}{1 + 0.3275911 \cdot \left|x\right|} \cdot \left(\left(0.254829592 + \frac{1}{1 + 0.3275911 \cdot \left|x\right|} \cdot \left(-0.284496736 + \frac{1}{1 + \log \left(1 + \mathsf{expm1}\left(0.3275911 \cdot \left|\color{blue}{\sqrt{x} \cdot \sqrt{x}}\right|\right)\right)} \cdot \left(\left(1.421413741 + 1.061405429 \cdot \frac{1}{{\left(0.3275911 \cdot \left|x\right| + 1\right)}^{2}}\right) - 1.453152027 \cdot \frac{1}{0.3275911 \cdot \left|x\right| + 1}\right)\right)\right) \cdot e^{-x \cdot x}\right)
\] |
fabs-sqr [=>]99.7 | \[ 1 - \frac{1}{1 + 0.3275911 \cdot \left|x\right|} \cdot \left(\left(0.254829592 + \frac{1}{1 + 0.3275911 \cdot \left|x\right|} \cdot \left(-0.284496736 + \frac{1}{1 + \log \left(1 + \mathsf{expm1}\left(0.3275911 \cdot \color{blue}{\left(\sqrt{x} \cdot \sqrt{x}\right)}\right)\right)} \cdot \left(\left(1.421413741 + 1.061405429 \cdot \frac{1}{{\left(0.3275911 \cdot \left|x\right| + 1\right)}^{2}}\right) - 1.453152027 \cdot \frac{1}{0.3275911 \cdot \left|x\right| + 1}\right)\right)\right) \cdot e^{-x \cdot x}\right)
\] |
add-sqr-sqrt [<=]99.7 | \[ 1 - \frac{1}{1 + 0.3275911 \cdot \left|x\right|} \cdot \left(\left(0.254829592 + \frac{1}{1 + 0.3275911 \cdot \left|x\right|} \cdot \left(-0.284496736 + \frac{1}{1 + \log \left(1 + \mathsf{expm1}\left(0.3275911 \cdot \color{blue}{x}\right)\right)} \cdot \left(\left(1.421413741 + 1.061405429 \cdot \frac{1}{{\left(0.3275911 \cdot \left|x\right| + 1\right)}^{2}}\right) - 1.453152027 \cdot \frac{1}{0.3275911 \cdot \left|x\right| + 1}\right)\right)\right) \cdot e^{-x \cdot x}\right)
\] |
Final simplification99.7%
| Alternative 1 | |
|---|---|
| Accuracy | 99.7% |
| Cost | 55240 |
| Alternative 2 | |
|---|---|
| Accuracy | 99.7% |
| Cost | 48580 |
| Alternative 3 | |
|---|---|
| Accuracy | 99.7% |
| Cost | 42248 |
| Alternative 4 | |
|---|---|
| Accuracy | 99.7% |
| Cost | 41988 |
| Alternative 5 | |
|---|---|
| Accuracy | 99.6% |
| Cost | 40904 |
| Alternative 6 | |
|---|---|
| Accuracy | 99.6% |
| Cost | 29320 |
| Alternative 7 | |
|---|---|
| Accuracy | 99.4% |
| Cost | 7112 |
| Alternative 8 | |
|---|---|
| Accuracy | 98.8% |
| Cost | 1224 |
| Alternative 9 | |
|---|---|
| Accuracy | 98.6% |
| Cost | 1096 |
| Alternative 10 | |
|---|---|
| Accuracy | 98.6% |
| Cost | 584 |
| Alternative 11 | |
|---|---|
| Accuracy | 97.8% |
| Cost | 328 |
| Alternative 12 | |
|---|---|
| Accuracy | 53.2% |
| Cost | 64 |
herbie shell --seed 2023136
(FPCore (x)
:name "Jmat.Real.erf"
:precision binary64
(- 1.0 (* (* (/ 1.0 (+ 1.0 (* 0.3275911 (fabs x)))) (+ 0.254829592 (* (/ 1.0 (+ 1.0 (* 0.3275911 (fabs x)))) (+ -0.284496736 (* (/ 1.0 (+ 1.0 (* 0.3275911 (fabs x)))) (+ 1.421413741 (* (/ 1.0 (+ 1.0 (* 0.3275911 (fabs x)))) (+ -1.453152027 (* (/ 1.0 (+ 1.0 (* 0.3275911 (fabs x)))) 1.061405429))))))))) (exp (- (* (fabs x) (fabs x)))))))