\[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}
\mathbf{if}\;\left|x\right| \leq 5 \cdot 10^{-8}:\\
\;\;\;\;10^{-9} + \sqrt{x \cdot \left(x \cdot 1.2732557730789702\right)}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{{\left(e^{x}\right)}^{\left(-x\right)}}{\mathsf{fma}\left(0.3275911, \left|x\right|, 1\right)}, -0.254829592 + \frac{1}{\frac{\mathsf{fma}\left(0.3275911, x, 1\right)}{0.284496736 + \frac{-1.421413741 + \frac{1.453152027 + \frac{-1.061405429}{\mathsf{fma}\left(0.3275911, x, 1\right)}}{\mathsf{fma}\left(0.3275911, x, 1\right)}}{\mathsf{fma}\left(0.3275911, x, 1\right)}}}, 1\right)\\
\end{array}
\]
(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
(if (<= (fabs x) 5e-8)
(+ 1e-9 (sqrt (* x (* x 1.2732557730789702))))
(fma
(/ (pow (exp x) (- x)) (fma 0.3275911 (fabs x) 1.0))
(+
-0.254829592
(/
1.0
(/
(fma 0.3275911 x 1.0)
(+
0.284496736
(/
(+
-1.421413741
(/
(+ 1.453152027 (/ -1.061405429 (fma 0.3275911 x 1.0)))
(fma 0.3275911 x 1.0)))
(fma 0.3275911 x 1.0))))))
1.0)))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 tmp;
if (fabs(x) <= 5e-8) {
tmp = 1e-9 + sqrt((x * (x * 1.2732557730789702)));
} else {
tmp = fma((pow(exp(x), -x) / fma(0.3275911, fabs(x), 1.0)), (-0.254829592 + (1.0 / (fma(0.3275911, x, 1.0) / (0.284496736 + ((-1.421413741 + ((1.453152027 + (-1.061405429 / fma(0.3275911, x, 1.0))) / fma(0.3275911, x, 1.0))) / fma(0.3275911, x, 1.0)))))), 1.0);
}
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)
tmp = 0.0
if (abs(x) <= 5e-8)
tmp = Float64(1e-9 + sqrt(Float64(x * Float64(x * 1.2732557730789702))));
else
tmp = fma(Float64((exp(x) ^ Float64(-x)) / fma(0.3275911, abs(x), 1.0)), Float64(-0.254829592 + Float64(1.0 / Float64(fma(0.3275911, x, 1.0) / Float64(0.284496736 + Float64(Float64(-1.421413741 + Float64(Float64(1.453152027 + Float64(-1.061405429 / fma(0.3275911, x, 1.0))) / fma(0.3275911, x, 1.0))) / fma(0.3275911, x, 1.0)))))), 1.0);
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_] := If[LessEqual[N[Abs[x], $MachinePrecision], 5e-8], N[(1e-9 + N[Sqrt[N[(x * N[(x * 1.2732557730789702), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[(N[Power[N[Exp[x], $MachinePrecision], (-x)], $MachinePrecision] / N[(0.3275911 * N[Abs[x], $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision] * N[(-0.254829592 + N[(1.0 / N[(N[(0.3275911 * x + 1.0), $MachinePrecision] / N[(0.284496736 + N[(N[(-1.421413741 + N[(N[(1.453152027 + N[(-1.061405429 / N[(0.3275911 * x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(0.3275911 * x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(0.3275911 * x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 1.0), $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}
\mathbf{if}\;\left|x\right| \leq 5 \cdot 10^{-8}:\\
\;\;\;\;10^{-9} + \sqrt{x \cdot \left(x \cdot 1.2732557730789702\right)}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{{\left(e^{x}\right)}^{\left(-x\right)}}{\mathsf{fma}\left(0.3275911, \left|x\right|, 1\right)}, -0.254829592 + \frac{1}{\frac{\mathsf{fma}\left(0.3275911, x, 1\right)}{0.284496736 + \frac{-1.421413741 + \frac{1.453152027 + \frac{-1.061405429}{\mathsf{fma}\left(0.3275911, x, 1\right)}}{\mathsf{fma}\left(0.3275911, x, 1\right)}}{\mathsf{fma}\left(0.3275911, x, 1\right)}}}, 1\right)\\
\end{array}
Alternatives
| Alternative 1 |
|---|
| Error | 0.2 |
|---|
| Cost | 61892 |
|---|
\[\begin{array}{l}
t_0 := 1 + \left|x\right| \cdot 0.3275911\\
t_1 := \frac{1}{t_0}\\
\mathbf{if}\;\left|x\right| \leq 5 \cdot 10^{-8}:\\
\;\;\;\;10^{-9} + \sqrt{x \cdot \left(x \cdot 1.2732557730789702\right)}\\
\mathbf{else}:\\
\;\;\;\;1 + t_1 \cdot \left(e^{x \cdot \left(-x\right)} \cdot \left(-0.254829592 + t_1 \cdot \left(0.284496736 + t_1 \cdot \left(-1.421413741 + t_1 \cdot \frac{2.111650813574209 - 1.126581484710674 \cdot {t_0}^{-2}}{\frac{1.061405429}{t_0} + 1.453152027}\right)\right)\right)\right)\\
\end{array}
\]
| Alternative 2 |
|---|
| Error | 0.2 |
|---|
| Cost | 61316 |
|---|
\[\begin{array}{l}
t_0 := 1 + \left|x\right| \cdot 0.3275911\\
\mathbf{if}\;\left|x\right| \leq 5 \cdot 10^{-8}:\\
\;\;\;\;10^{-9} + \sqrt{x \cdot \left(x \cdot 1.2732557730789702\right)}\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{\frac{-0.254829592 + \frac{0.284496736 + \frac{-1.421413741 + \frac{\frac{2.111650813574209 - 1.126581484710674 \cdot {t_0}^{-2}}{\frac{1.061405429}{t_0} + 1.453152027}}{t_0}}{t_0}}{t_0}}{e^{x \cdot x}}}{t_0}\\
\end{array}
\]
| Alternative 3 |
|---|
| Error | 0.2 |
|---|
| Cost | 48388 |
|---|
\[\begin{array}{l}
t_0 := 1 + \left|x\right| \cdot 0.3275911\\
t_1 := \frac{1}{t_0}\\
\mathbf{if}\;\left|x\right| \leq 5 \cdot 10^{-8}:\\
\;\;\;\;10^{-9} + \sqrt{x \cdot \left(x \cdot 1.2732557730789702\right)}\\
\mathbf{else}:\\
\;\;\;\;1 + t_1 \cdot \left(e^{x \cdot \left(-x\right)} \cdot \left(-0.254829592 + t_1 \cdot \left(0.284496736 + t_1 \cdot \left(-1.421413741 + t_1 \cdot \left(1.453152027 + \frac{-1.061405429}{t_0}\right)\right)\right)\right)\right)\\
\end{array}
\]
| Alternative 4 |
|---|
| Error | 0.2 |
|---|
| Cost | 47812 |
|---|
\[\begin{array}{l}
t_0 := 1 + \left|x\right| \cdot 0.3275911\\
\mathbf{if}\;\left|x\right| \leq 5 \cdot 10^{-8}:\\
\;\;\;\;10^{-9} + \sqrt{x \cdot \left(x \cdot 1.2732557730789702\right)}\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{\frac{-0.254829592 + \frac{0.284496736 + \frac{-1.421413741 + \frac{1.453152027 + \frac{-1.061405429}{t_0}}{t_0}}{t_0}}{t_0}}{e^{x \cdot x}}}{t_0}\\
\end{array}
\]
| Alternative 5 |
|---|
| Error | 0.5 |
|---|
| Cost | 13380 |
|---|
\[\begin{array}{l}
\mathbf{if}\;\left|x\right| \leq 0.005:\\
\;\;\;\;10^{-9} + \sqrt{x \cdot \left(x \cdot 1.2732557730789702\right)}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\]
| Alternative 6 |
|---|
| Error | 1.0 |
|---|
| Cost | 584 |
|---|
\[\begin{array}{l}
\mathbf{if}\;x \leq -9 \cdot 10^{-10}:\\
\;\;\;\;1\\
\mathbf{elif}\;x \leq 0.88:\\
\;\;\;\;10^{-9} + x \cdot 1.128386358070218\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\]
| Alternative 7 |
|---|
| Error | 0.9 |
|---|
| Cost | 584 |
|---|
\[\begin{array}{l}
\mathbf{if}\;x \leq -0.88:\\
\;\;\;\;1\\
\mathbf{elif}\;x \leq 9 \cdot 10^{-10}:\\
\;\;\;\;10^{-9} + x \cdot -1.128386358070218\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\]
| Alternative 8 |
|---|
| Error | 1.4 |
|---|
| Cost | 328 |
|---|
\[\begin{array}{l}
\mathbf{if}\;x \leq -2.8 \cdot 10^{-5}:\\
\;\;\;\;1\\
\mathbf{elif}\;x \leq 2.8 \cdot 10^{-5}:\\
\;\;\;\;10^{-9}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\]
| Alternative 9 |
|---|
| Error | 29.7 |
|---|
| Cost | 64 |
|---|
\[10^{-9}
\]