| Alternative 1 | |
|---|---|
| Accuracy | 99.7% |
| Cost | 128776 |
(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 (+ 1.0 (* 0.3275911 (fabs x))))
(t_1 (/ 1.0 t_0))
(t_2
(/
(+
0.254829592
(/
(+
-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)))
(fma 0.3275911 x 1.0)))
(* (fma 0.3275911 x 1.0) (pow (exp x) x)))))
(if (<= x -8.5e-7)
(+
1.0
(*
(exp (* x (- x)))
(*
t_1
(-
(*
(+
-0.284496736
(*
t_1
(+ 1.421413741 (* t_1 (+ -1.453152027 (* t_1 1.061405429))))))
(/ -1.0 t_0))
0.254829592))))
(if (<= x 1.05e-6)
(+ 1e-9 (fabs (* x 1.128386358070218)))
(/ 1.0 (/ (+ 1.0 (+ t_2 (pow t_2 2.0))) (- 1.0 (pow t_2 3.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 t_0 = 1.0 + (0.3275911 * fabs(x));
double t_1 = 1.0 / t_0;
double t_2 = (0.254829592 + ((-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))) / fma(0.3275911, x, 1.0))) / (fma(0.3275911, x, 1.0) * pow(exp(x), x));
double tmp;
if (x <= -8.5e-7) {
tmp = 1.0 + (exp((x * -x)) * (t_1 * (((-0.284496736 + (t_1 * (1.421413741 + (t_1 * (-1.453152027 + (t_1 * 1.061405429)))))) * (-1.0 / t_0)) - 0.254829592)));
} else if (x <= 1.05e-6) {
tmp = 1e-9 + fabs((x * 1.128386358070218));
} else {
tmp = 1.0 / ((1.0 + (t_2 + pow(t_2, 2.0))) / (1.0 - pow(t_2, 3.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) t_0 = Float64(1.0 + Float64(0.3275911 * abs(x))) t_1 = Float64(1.0 / t_0) t_2 = Float64(Float64(0.254829592 + Float64(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))) / fma(0.3275911, x, 1.0))) / Float64(fma(0.3275911, x, 1.0) * (exp(x) ^ x))) tmp = 0.0 if (x <= -8.5e-7) tmp = Float64(1.0 + Float64(exp(Float64(x * Float64(-x))) * Float64(t_1 * Float64(Float64(Float64(-0.284496736 + Float64(t_1 * Float64(1.421413741 + Float64(t_1 * Float64(-1.453152027 + Float64(t_1 * 1.061405429)))))) * Float64(-1.0 / t_0)) - 0.254829592)))); elseif (x <= 1.05e-6) tmp = Float64(1e-9 + abs(Float64(x * 1.128386358070218))); else tmp = Float64(1.0 / Float64(Float64(1.0 + Float64(t_2 + (t_2 ^ 2.0))) / Float64(1.0 - (t_2 ^ 3.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_] := Block[{t$95$0 = N[(1.0 + N[(0.3275911 * N[Abs[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(1.0 / t$95$0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(0.254829592 + N[(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] / N[(0.3275911 * x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[(0.3275911 * x + 1.0), $MachinePrecision] * N[Power[N[Exp[x], $MachinePrecision], x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -8.5e-7], N[(1.0 + N[(N[Exp[N[(x * (-x)), $MachinePrecision]], $MachinePrecision] * N[(t$95$1 * N[(N[(N[(-0.284496736 + N[(t$95$1 * N[(1.421413741 + N[(t$95$1 * N[(-1.453152027 + N[(t$95$1 * 1.061405429), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(-1.0 / t$95$0), $MachinePrecision]), $MachinePrecision] - 0.254829592), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.05e-6], N[(1e-9 + N[Abs[N[(x * 1.128386358070218), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(N[(1.0 + N[(t$95$2 + N[Power[t$95$2, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(1.0 - N[Power[t$95$2, 3.0], $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 := 1 + 0.3275911 \cdot \left|x\right|\\
t_1 := \frac{1}{t_0}\\
t_2 := \frac{0.254829592 + \frac{-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)}}{\mathsf{fma}\left(0.3275911, x, 1\right)}}{\mathsf{fma}\left(0.3275911, x, 1\right) \cdot {\left(e^{x}\right)}^{x}}\\
\mathbf{if}\;x \leq -8.5 \cdot 10^{-7}:\\
\;\;\;\;1 + e^{x \cdot \left(-x\right)} \cdot \left(t_1 \cdot \left(\left(-0.284496736 + t_1 \cdot \left(1.421413741 + t_1 \cdot \left(-1.453152027 + t_1 \cdot 1.061405429\right)\right)\right) \cdot \frac{-1}{t_0} - 0.254829592\right)\right)\\
\mathbf{elif}\;x \leq 1.05 \cdot 10^{-6}:\\
\;\;\;\;10^{-9} + \left|x \cdot 1.128386358070218\right|\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\frac{1 + \left(t_2 + {t_2}^{2}\right)}{1 - {t_2}^{3}}}\\
\end{array}
if x < -8.50000000000000014e-7Initial program 99.6%
if -8.50000000000000014e-7 < x < 1.0499999999999999e-6Initial 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|}
\] |
|---|---|
exp-neg [=>]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 \color{blue}{\frac{1}{e^{\left|x\right| \cdot \left|x\right|}}}
\] |
associate-*r/ [=>]57.7 | \[ 1 - \color{blue}{\frac{\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 1}{e^{\left|x\right| \cdot \left|x\right|}}}
\] |
Applied egg-rr57.2%
[Start]57.7 | \[ 1 - \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}}
\] |
|---|---|
add-exp-log [=>]57.7 | \[ \color{blue}{e^{\log \left(1 - \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)}}
\] |
sub-neg [=>]57.7 | \[ e^{\log \color{blue}{\left(1 + \left(-\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)\right)}}
\] |
log1p-def [=>]57.7 | \[ e^{\color{blue}{\mathsf{log1p}\left(-\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)}}
\] |
distribute-neg-frac [=>]57.7 | \[ e^{\mathsf{log1p}\left(\color{blue}{\frac{-\left(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)}\right)}{\mathsf{fma}\left(0.3275911, \left|x\right|, 1\right) \cdot {\left(e^{x}\right)}^{x}}}\right)}
\] |
Simplified57.2%
[Start]57.2 | \[ e^{\mathsf{log1p}\left(\frac{\left(-\frac{-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)}}{\mathsf{fma}\left(0.3275911, x, 1\right)}\right) + -0.254829592}{\mathsf{fma}\left(0.3275911, x, 1\right) \cdot {\left(e^{x}\right)}^{x}}\right)}
\] |
|---|---|
distribute-neg-frac [=>]57.2 | \[ e^{\mathsf{log1p}\left(\frac{\color{blue}{\frac{-\left(-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)}\right)}{\mathsf{fma}\left(0.3275911, x, 1\right)}} + -0.254829592}{\mathsf{fma}\left(0.3275911, x, 1\right) \cdot {\left(e^{x}\right)}^{x}}\right)}
\] |
distribute-neg-in [=>]57.2 | \[ e^{\mathsf{log1p}\left(\frac{\frac{\color{blue}{\left(--0.284496736\right) + \left(-\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)}\right)}}{\mathsf{fma}\left(0.3275911, x, 1\right)} + -0.254829592}{\mathsf{fma}\left(0.3275911, x, 1\right) \cdot {\left(e^{x}\right)}^{x}}\right)}
\] |
metadata-eval [=>]57.2 | \[ e^{\mathsf{log1p}\left(\frac{\frac{\color{blue}{0.284496736} + \left(-\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)}\right)}{\mathsf{fma}\left(0.3275911, x, 1\right)} + -0.254829592}{\mathsf{fma}\left(0.3275911, x, 1\right) \cdot {\left(e^{x}\right)}^{x}}\right)}
\] |
unsub-neg [=>]57.2 | \[ e^{\mathsf{log1p}\left(\frac{\frac{\color{blue}{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)}}}{\mathsf{fma}\left(0.3275911, x, 1\right)} + -0.254829592}{\mathsf{fma}\left(0.3275911, x, 1\right) \cdot {\left(e^{x}\right)}^{x}}\right)}
\] |
*-commutative [=>]57.2 | \[ e^{\mathsf{log1p}\left(\frac{\frac{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)}}{\mathsf{fma}\left(0.3275911, x, 1\right)} + -0.254829592}{\color{blue}{{\left(e^{x}\right)}^{x} \cdot \mathsf{fma}\left(0.3275911, x, 1\right)}}\right)}
\] |
exp-prod [<=]57.2 | \[ e^{\mathsf{log1p}\left(\frac{\frac{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)}}{\mathsf{fma}\left(0.3275911, x, 1\right)} + -0.254829592}{\color{blue}{e^{x \cdot x}} \cdot \mathsf{fma}\left(0.3275911, x, 1\right)}\right)}
\] |
Taylor expanded in x around 0 98.4%
Simplified98.4%
[Start]98.4 | \[ 10^{-9} + 1.128386358070218 \cdot x
\] |
|---|---|
*-commutative [=>]98.4 | \[ 10^{-9} + \color{blue}{x \cdot 1.128386358070218}
\] |
Applied egg-rr97.6%
[Start]98.4 | \[ 10^{-9} + x \cdot 1.128386358070218
\] |
|---|---|
expm1-log1p-u [=>]98.4 | \[ 10^{-9} + \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(x \cdot 1.128386358070218\right)\right)}
\] |
expm1-udef [=>]97.6 | \[ 10^{-9} + \color{blue}{\left(e^{\mathsf{log1p}\left(x \cdot 1.128386358070218\right)} - 1\right)}
\] |
log1p-udef [=>]97.6 | \[ 10^{-9} + \left(e^{\color{blue}{\log \left(1 + x \cdot 1.128386358070218\right)}} - 1\right)
\] |
add-exp-log [<=]97.6 | \[ 10^{-9} + \left(\color{blue}{\left(1 + x \cdot 1.128386358070218\right)} - 1\right)
\] |
Applied egg-rr99.8%
[Start]97.6 | \[ 10^{-9} + \left(\left(1 + x \cdot 1.128386358070218\right) - 1\right)
\] |
|---|---|
pow1 [=>]97.6 | \[ 10^{-9} + \color{blue}{{\left(\left(1 + x \cdot 1.128386358070218\right) - 1\right)}^{1}}
\] |
add-exp-log [=>]97.6 | \[ 10^{-9} + {\left(\color{blue}{e^{\log \left(1 + x \cdot 1.128386358070218\right)}} - 1\right)}^{1}
\] |
log1p-udef [<=]97.6 | \[ 10^{-9} + {\left(e^{\color{blue}{\mathsf{log1p}\left(x \cdot 1.128386358070218\right)}} - 1\right)}^{1}
\] |
expm1-udef [<=]98.4 | \[ 10^{-9} + {\color{blue}{\left(\mathsf{expm1}\left(\mathsf{log1p}\left(x \cdot 1.128386358070218\right)\right)\right)}}^{1}
\] |
expm1-log1p-u [<=]98.4 | \[ 10^{-9} + {\color{blue}{\left(x \cdot 1.128386358070218\right)}}^{1}
\] |
metadata-eval [<=]98.4 | \[ 10^{-9} + {\left(x \cdot 1.128386358070218\right)}^{\color{blue}{\left(0.5 + 0.5\right)}}
\] |
pow-prod-up [<=]49.1 | \[ 10^{-9} + \color{blue}{{\left(x \cdot 1.128386358070218\right)}^{0.5} \cdot {\left(x \cdot 1.128386358070218\right)}^{0.5}}
\] |
pow-prod-down [=>]99.8 | \[ 10^{-9} + \color{blue}{{\left(\left(x \cdot 1.128386358070218\right) \cdot \left(x \cdot 1.128386358070218\right)\right)}^{0.5}}
\] |
*-commutative [=>]99.8 | \[ 10^{-9} + {\left(\color{blue}{\left(1.128386358070218 \cdot x\right)} \cdot \left(x \cdot 1.128386358070218\right)\right)}^{0.5}
\] |
*-commutative [=>]99.8 | \[ 10^{-9} + {\left(\left(1.128386358070218 \cdot x\right) \cdot \color{blue}{\left(1.128386358070218 \cdot x\right)}\right)}^{0.5}
\] |
swap-sqr [=>]99.8 | \[ 10^{-9} + {\color{blue}{\left(\left(1.128386358070218 \cdot 1.128386358070218\right) \cdot \left(x \cdot x\right)\right)}}^{0.5}
\] |
metadata-eval [=>]99.8 | \[ 10^{-9} + {\left(\color{blue}{1.2732557730789702} \cdot \left(x \cdot x\right)\right)}^{0.5}
\] |
Simplified99.8%
[Start]99.8 | \[ 10^{-9} + {\left(1.2732557730789702 \cdot \left(x \cdot x\right)\right)}^{0.5}
\] |
|---|---|
unpow1/2 [=>]99.8 | \[ 10^{-9} + \color{blue}{\sqrt{1.2732557730789702 \cdot \left(x \cdot x\right)}}
\] |
*-commutative [=>]99.8 | \[ 10^{-9} + \sqrt{\color{blue}{\left(x \cdot x\right) \cdot 1.2732557730789702}}
\] |
metadata-eval [<=]99.8 | \[ 10^{-9} + \sqrt{\left(x \cdot x\right) \cdot \color{blue}{\left(1.128386358070218 \cdot 1.128386358070218\right)}}
\] |
swap-sqr [<=]99.8 | \[ 10^{-9} + \sqrt{\color{blue}{\left(x \cdot 1.128386358070218\right) \cdot \left(x \cdot 1.128386358070218\right)}}
\] |
rem-sqrt-square [=>]99.8 | \[ 10^{-9} + \color{blue}{\left|x \cdot 1.128386358070218\right|}
\] |
*-commutative [<=]99.8 | \[ 10^{-9} + \left|\color{blue}{1.128386358070218 \cdot x}\right|
\] |
if 1.0499999999999999e-6 < x Initial program 99.6%
Simplified99.6%
[Start]99.6 | \[ 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|}
\] |
|---|---|
exp-neg [=>]99.6 | \[ 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 \color{blue}{\frac{1}{e^{\left|x\right| \cdot \left|x\right|}}}
\] |
associate-*r/ [=>]99.6 | \[ 1 - \color{blue}{\frac{\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 1}{e^{\left|x\right| \cdot \left|x\right|}}}
\] |
Applied egg-rr99.6%
[Start]99.6 | \[ 1 - \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}}
\] |
|---|---|
flip3-- [=>]99.6 | \[ \color{blue}{\frac{{1}^{3} - {\left(\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)}^{3}}{1 \cdot 1 + \left(\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}} \cdot \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}} + 1 \cdot \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)}}
\] |
Final simplification99.7%
| Alternative 1 | |
|---|---|
| Accuracy | 99.7% |
| Cost | 128776 |
| Alternative 2 | |
|---|---|
| Accuracy | 99.7% |
| Cost | 42116 |
| Alternative 3 | |
|---|---|
| Accuracy | 99.5% |
| Cost | 41992 |
| Alternative 4 | |
|---|---|
| Accuracy | 99.7% |
| Cost | 41992 |
| Alternative 5 | |
|---|---|
| Accuracy | 99.5% |
| Cost | 40904 |
| Alternative 6 | |
|---|---|
| Accuracy | 99.5% |
| Cost | 29192 |
| Alternative 7 | |
|---|---|
| Accuracy | 99.2% |
| Cost | 6984 |
| Alternative 8 | |
|---|---|
| Accuracy | 98.3% |
| Cost | 1096 |
| Alternative 9 | |
|---|---|
| Accuracy | 98.3% |
| Cost | 584 |
| Alternative 10 | |
|---|---|
| Accuracy | 97.5% |
| Cost | 328 |
| Alternative 11 | |
|---|---|
| Accuracy | 54.1% |
| Cost | 64 |
herbie shell --seed 2023151
(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)))))))