| Alternative 1 | |
|---|---|
| Accuracy | 99.8% |
| Cost | 41988 |
(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 (* 0.3275911 (fabs x))) (t_1 (+ 1.0 t_0)) (t_2 (/ 1.0 t_1)))
(if (<= x -2.9e-6)
(+
1.0
(*
t_2
(*
(exp (* x (- x)))
(+
-0.254829592
(*
(/ 1.0 (+ 1.0 (log (exp t_0))))
(+
0.284496736
(*
t_2
(+
-1.421413741
(* (+ -1.453152027 (/ 1.061405429 t_1)) (/ -1.0 t_1))))))))))
(if (<= x 1.05)
(+
1e-9
(+
(* -0.00011824294398844343 (pow x 2.0))
(+
(* -0.37545125292247583 (pow x 3.0))
(sqrt (* x (* x 1.2732557730789702))))))
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 t_0 = 0.3275911 * fabs(x);
double t_1 = 1.0 + t_0;
double t_2 = 1.0 / t_1;
double tmp;
if (x <= -2.9e-6) {
tmp = 1.0 + (t_2 * (exp((x * -x)) * (-0.254829592 + ((1.0 / (1.0 + log(exp(t_0)))) * (0.284496736 + (t_2 * (-1.421413741 + ((-1.453152027 + (1.061405429 / t_1)) * (-1.0 / t_1)))))))));
} else if (x <= 1.05) {
tmp = 1e-9 + ((-0.00011824294398844343 * pow(x, 2.0)) + ((-0.37545125292247583 * pow(x, 3.0)) + sqrt((x * (x * 1.2732557730789702)))));
} else {
tmp = 1.0;
}
return tmp;
}
real(8) function code(x)
real(8), intent (in) :: x
code = 1.0d0 - (((1.0d0 / (1.0d0 + (0.3275911d0 * abs(x)))) * (0.254829592d0 + ((1.0d0 / (1.0d0 + (0.3275911d0 * abs(x)))) * ((-0.284496736d0) + ((1.0d0 / (1.0d0 + (0.3275911d0 * abs(x)))) * (1.421413741d0 + ((1.0d0 / (1.0d0 + (0.3275911d0 * abs(x)))) * ((-1.453152027d0) + ((1.0d0 / (1.0d0 + (0.3275911d0 * abs(x)))) * 1.061405429d0))))))))) * exp(-(abs(x) * abs(x))))
end function
real(8) function code(x)
real(8), intent (in) :: x
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_0 = 0.3275911d0 * abs(x)
t_1 = 1.0d0 + t_0
t_2 = 1.0d0 / t_1
if (x <= (-2.9d-6)) then
tmp = 1.0d0 + (t_2 * (exp((x * -x)) * ((-0.254829592d0) + ((1.0d0 / (1.0d0 + log(exp(t_0)))) * (0.284496736d0 + (t_2 * ((-1.421413741d0) + (((-1.453152027d0) + (1.061405429d0 / t_1)) * ((-1.0d0) / t_1)))))))))
else if (x <= 1.05d0) then
tmp = 1d-9 + (((-0.00011824294398844343d0) * (x ** 2.0d0)) + (((-0.37545125292247583d0) * (x ** 3.0d0)) + sqrt((x * (x * 1.2732557730789702d0)))))
else
tmp = 1.0d0
end if
code = tmp
end function
public static double code(double x) {
return 1.0 - (((1.0 / (1.0 + (0.3275911 * Math.abs(x)))) * (0.254829592 + ((1.0 / (1.0 + (0.3275911 * Math.abs(x)))) * (-0.284496736 + ((1.0 / (1.0 + (0.3275911 * Math.abs(x)))) * (1.421413741 + ((1.0 / (1.0 + (0.3275911 * Math.abs(x)))) * (-1.453152027 + ((1.0 / (1.0 + (0.3275911 * Math.abs(x)))) * 1.061405429))))))))) * Math.exp(-(Math.abs(x) * Math.abs(x))));
}
public static double code(double x) {
double t_0 = 0.3275911 * Math.abs(x);
double t_1 = 1.0 + t_0;
double t_2 = 1.0 / t_1;
double tmp;
if (x <= -2.9e-6) {
tmp = 1.0 + (t_2 * (Math.exp((x * -x)) * (-0.254829592 + ((1.0 / (1.0 + Math.log(Math.exp(t_0)))) * (0.284496736 + (t_2 * (-1.421413741 + ((-1.453152027 + (1.061405429 / t_1)) * (-1.0 / t_1)))))))));
} else if (x <= 1.05) {
tmp = 1e-9 + ((-0.00011824294398844343 * Math.pow(x, 2.0)) + ((-0.37545125292247583 * Math.pow(x, 3.0)) + Math.sqrt((x * (x * 1.2732557730789702)))));
} else {
tmp = 1.0;
}
return tmp;
}
def code(x): return 1.0 - (((1.0 / (1.0 + (0.3275911 * math.fabs(x)))) * (0.254829592 + ((1.0 / (1.0 + (0.3275911 * math.fabs(x)))) * (-0.284496736 + ((1.0 / (1.0 + (0.3275911 * math.fabs(x)))) * (1.421413741 + ((1.0 / (1.0 + (0.3275911 * math.fabs(x)))) * (-1.453152027 + ((1.0 / (1.0 + (0.3275911 * math.fabs(x)))) * 1.061405429))))))))) * math.exp(-(math.fabs(x) * math.fabs(x))))
def code(x): t_0 = 0.3275911 * math.fabs(x) t_1 = 1.0 + t_0 t_2 = 1.0 / t_1 tmp = 0 if x <= -2.9e-6: tmp = 1.0 + (t_2 * (math.exp((x * -x)) * (-0.254829592 + ((1.0 / (1.0 + math.log(math.exp(t_0)))) * (0.284496736 + (t_2 * (-1.421413741 + ((-1.453152027 + (1.061405429 / t_1)) * (-1.0 / t_1))))))))) elif x <= 1.05: tmp = 1e-9 + ((-0.00011824294398844343 * math.pow(x, 2.0)) + ((-0.37545125292247583 * math.pow(x, 3.0)) + math.sqrt((x * (x * 1.2732557730789702))))) else: tmp = 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) t_0 = Float64(0.3275911 * abs(x)) t_1 = Float64(1.0 + t_0) t_2 = Float64(1.0 / t_1) tmp = 0.0 if (x <= -2.9e-6) tmp = Float64(1.0 + Float64(t_2 * Float64(exp(Float64(x * Float64(-x))) * Float64(-0.254829592 + Float64(Float64(1.0 / Float64(1.0 + log(exp(t_0)))) * Float64(0.284496736 + Float64(t_2 * Float64(-1.421413741 + Float64(Float64(-1.453152027 + Float64(1.061405429 / t_1)) * Float64(-1.0 / t_1)))))))))); elseif (x <= 1.05) tmp = Float64(1e-9 + Float64(Float64(-0.00011824294398844343 * (x ^ 2.0)) + Float64(Float64(-0.37545125292247583 * (x ^ 3.0)) + sqrt(Float64(x * Float64(x * 1.2732557730789702)))))); else tmp = 1.0; end return tmp end
function tmp = code(x) tmp = 1.0 - (((1.0 / (1.0 + (0.3275911 * abs(x)))) * (0.254829592 + ((1.0 / (1.0 + (0.3275911 * abs(x)))) * (-0.284496736 + ((1.0 / (1.0 + (0.3275911 * abs(x)))) * (1.421413741 + ((1.0 / (1.0 + (0.3275911 * abs(x)))) * (-1.453152027 + ((1.0 / (1.0 + (0.3275911 * abs(x)))) * 1.061405429))))))))) * exp(-(abs(x) * abs(x)))); end
function tmp_2 = code(x) t_0 = 0.3275911 * abs(x); t_1 = 1.0 + t_0; t_2 = 1.0 / t_1; tmp = 0.0; if (x <= -2.9e-6) tmp = 1.0 + (t_2 * (exp((x * -x)) * (-0.254829592 + ((1.0 / (1.0 + log(exp(t_0)))) * (0.284496736 + (t_2 * (-1.421413741 + ((-1.453152027 + (1.061405429 / t_1)) * (-1.0 / t_1))))))))); elseif (x <= 1.05) tmp = 1e-9 + ((-0.00011824294398844343 * (x ^ 2.0)) + ((-0.37545125292247583 * (x ^ 3.0)) + sqrt((x * (x * 1.2732557730789702))))); else tmp = 1.0; end tmp_2 = 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]), $MachinePrecision]}, Block[{t$95$1 = N[(1.0 + t$95$0), $MachinePrecision]}, Block[{t$95$2 = N[(1.0 / t$95$1), $MachinePrecision]}, If[LessEqual[x, -2.9e-6], N[(1.0 + N[(t$95$2 * N[(N[Exp[N[(x * (-x)), $MachinePrecision]], $MachinePrecision] * N[(-0.254829592 + N[(N[(1.0 / N[(1.0 + N[Log[N[Exp[t$95$0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(0.284496736 + N[(t$95$2 * N[(-1.421413741 + N[(N[(-1.453152027 + N[(1.061405429 / t$95$1), $MachinePrecision]), $MachinePrecision] * N[(-1.0 / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.05], N[(1e-9 + N[(N[(-0.00011824294398844343 * N[Power[x, 2.0], $MachinePrecision]), $MachinePrecision] + N[(N[(-0.37545125292247583 * N[Power[x, 3.0], $MachinePrecision]), $MachinePrecision] + N[Sqrt[N[(x * N[(x * 1.2732557730789702), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 1.0]]]]]
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 := 0.3275911 \cdot \left|x\right|\\
t_1 := 1 + t_0\\
t_2 := \frac{1}{t_1}\\
\mathbf{if}\;x \leq -2.9 \cdot 10^{-6}:\\
\;\;\;\;1 + t_2 \cdot \left(e^{x \cdot \left(-x\right)} \cdot \left(-0.254829592 + \frac{1}{1 + \log \left(e^{t_0}\right)} \cdot \left(0.284496736 + t_2 \cdot \left(-1.421413741 + \left(-1.453152027 + \frac{1.061405429}{t_1}\right) \cdot \frac{-1}{t_1}\right)\right)\right)\right)\\
\mathbf{elif}\;x \leq 1.05:\\
\;\;\;\;10^{-9} + \left(-0.00011824294398844343 \cdot {x}^{2} + \left(-0.37545125292247583 \cdot {x}^{3} + \sqrt{x \cdot \left(x \cdot 1.2732557730789702\right)}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
Results
if x < -2.9000000000000002e-6Initial 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)}
\] |
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(1.421413741 + \frac{1}{1 + 0.3275911 \cdot \left|x\right|} \cdot \left(-1.453152027 + \frac{1.061405429}{1 + 0.3275911 \cdot \left|x\right|}\right)\right)\right)\right) \cdot e^{-x \cdot x}\right)
\] |
|---|---|
add-log-exp [=>]99.7 | \[ 1 - \frac{1}{1 + 0.3275911 \cdot \left|x\right|} \cdot \left(\left(0.254829592 + \frac{1}{1 + \color{blue}{\log \left(e^{0.3275911 \cdot \left|x\right|}\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.061405429}{1 + 0.3275911 \cdot \left|x\right|}\right)\right)\right)\right) \cdot e^{-x \cdot x}\right)
\] |
if -2.9000000000000002e-6 < x < 1.05000000000000004Initial program 57.9%
Simplified57.9%
[Start]57.9 | \[ 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.9 | \[ 1 - \color{blue}{\frac{1 \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)}{1 + 0.3275911 \cdot \left|x\right|}} \cdot e^{-\left|x\right| \cdot \left|x\right|}
\] |
*-lft-identity [=>]57.9 | \[ 1 - \frac{\color{blue}{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)}}{1 + 0.3275911 \cdot \left|x\right|} \cdot e^{-\left|x\right| \cdot \left|x\right|}
\] |
Applied egg-rr57.4%
[Start]57.9 | \[ 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}}
\] |
|---|---|
sub-neg [=>]57.9 | \[ \color{blue}{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)}
\] |
Simplified57.4%
[Start]57.4 | \[ 1 + \left(-\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}}\right)
\] |
|---|---|
distribute-neg-frac [=>]57.4 | \[ 1 + \color{blue}{\frac{-\left(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)}\right)}{\mathsf{fma}\left(0.3275911, x, 1\right) \cdot {\left(e^{x}\right)}^{x}}}
\] |
neg-sub0 [=>]57.4 | \[ 1 + \frac{\color{blue}{0 - \left(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)}\right)}}{\mathsf{fma}\left(0.3275911, x, 1\right) \cdot {\left(e^{x}\right)}^{x}}
\] |
associate--r+ [=>]57.4 | \[ 1 + \frac{\color{blue}{\left(0 - 0.254829592\right) - \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}}
\] |
metadata-eval [=>]57.4 | \[ 1 + \frac{\color{blue}{-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}}
\] |
*-commutative [=>]57.4 | \[ 1 + \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)}}{\color{blue}{{\left(e^{x}\right)}^{x} \cdot \mathsf{fma}\left(0.3275911, x, 1\right)}}
\] |
exp-prod [<=]57.4 | \[ 1 + \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)}}{\color{blue}{e^{x \cdot x}} \cdot \mathsf{fma}\left(0.3275911, x, 1\right)}
\] |
Taylor expanded in x around 0 98.2%
Applied egg-rr99.7%
[Start]98.2 | \[ 10^{-9} + \left(-0.00011824294398844343 \cdot {x}^{2} + \left(-0.37545125292247583 \cdot {x}^{3} + 1.128386358070218 \cdot x\right)\right)
\] |
|---|---|
add-sqr-sqrt [=>]50.4 | \[ 10^{-9} + \left(-0.00011824294398844343 \cdot {x}^{2} + \left(-0.37545125292247583 \cdot {x}^{3} + \color{blue}{\sqrt{1.128386358070218 \cdot x} \cdot \sqrt{1.128386358070218 \cdot x}}\right)\right)
\] |
sqrt-unprod [=>]99.7 | \[ 10^{-9} + \left(-0.00011824294398844343 \cdot {x}^{2} + \left(-0.37545125292247583 \cdot {x}^{3} + \color{blue}{\sqrt{\left(1.128386358070218 \cdot x\right) \cdot \left(1.128386358070218 \cdot x\right)}}\right)\right)
\] |
swap-sqr [=>]99.7 | \[ 10^{-9} + \left(-0.00011824294398844343 \cdot {x}^{2} + \left(-0.37545125292247583 \cdot {x}^{3} + \sqrt{\color{blue}{\left(1.128386358070218 \cdot 1.128386358070218\right) \cdot \left(x \cdot x\right)}}\right)\right)
\] |
metadata-eval [=>]99.7 | \[ 10^{-9} + \left(-0.00011824294398844343 \cdot {x}^{2} + \left(-0.37545125292247583 \cdot {x}^{3} + \sqrt{\color{blue}{1.2732557730789702} \cdot \left(x \cdot x\right)}\right)\right)
\] |
Simplified99.7%
[Start]99.7 | \[ 10^{-9} + \left(-0.00011824294398844343 \cdot {x}^{2} + \left(-0.37545125292247583 \cdot {x}^{3} + \sqrt{1.2732557730789702 \cdot \left(x \cdot x\right)}\right)\right)
\] |
|---|---|
*-commutative [=>]99.7 | \[ 10^{-9} + \left(-0.00011824294398844343 \cdot {x}^{2} + \left(-0.37545125292247583 \cdot {x}^{3} + \sqrt{\color{blue}{\left(x \cdot x\right) \cdot 1.2732557730789702}}\right)\right)
\] |
associate-*l* [=>]99.7 | \[ 10^{-9} + \left(-0.00011824294398844343 \cdot {x}^{2} + \left(-0.37545125292247583 \cdot {x}^{3} + \sqrt{\color{blue}{x \cdot \left(x \cdot 1.2732557730789702\right)}}\right)\right)
\] |
if 1.05000000000000004 < x Initial program 100.0%
Simplified100.0%
[Start]100.0 | \[ 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/ [=>]100.0 | \[ 1 - \color{blue}{\frac{1 \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)}{1 + 0.3275911 \cdot \left|x\right|}} \cdot e^{-\left|x\right| \cdot \left|x\right|}
\] |
*-lft-identity [=>]100.0 | \[ 1 - \frac{\color{blue}{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)}}{1 + 0.3275911 \cdot \left|x\right|} \cdot e^{-\left|x\right| \cdot \left|x\right|}
\] |
Applied egg-rr100.0%
[Start]100.0 | \[ 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}}
\] |
|---|---|
sub-neg [=>]100.0 | \[ \color{blue}{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)}
\] |
Simplified100.0%
[Start]100.0 | \[ 1 + \left(-\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}}\right)
\] |
|---|---|
distribute-neg-frac [=>]100.0 | \[ 1 + \color{blue}{\frac{-\left(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)}\right)}{\mathsf{fma}\left(0.3275911, x, 1\right) \cdot {\left(e^{x}\right)}^{x}}}
\] |
neg-sub0 [=>]100.0 | \[ 1 + \frac{\color{blue}{0 - \left(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)}\right)}}{\mathsf{fma}\left(0.3275911, x, 1\right) \cdot {\left(e^{x}\right)}^{x}}
\] |
associate--r+ [=>]100.0 | \[ 1 + \frac{\color{blue}{\left(0 - 0.254829592\right) - \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}}
\] |
metadata-eval [=>]100.0 | \[ 1 + \frac{\color{blue}{-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}}
\] |
*-commutative [=>]100.0 | \[ 1 + \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)}}{\color{blue}{{\left(e^{x}\right)}^{x} \cdot \mathsf{fma}\left(0.3275911, x, 1\right)}}
\] |
exp-prod [<=]100.0 | \[ 1 + \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)}}{\color{blue}{e^{x \cdot x}} \cdot \mathsf{fma}\left(0.3275911, x, 1\right)}
\] |
Taylor expanded in x around inf 99.9%
Final simplification99.8%
| Alternative 1 | |
|---|---|
| Accuracy | 99.8% |
| Cost | 41988 |
| Alternative 2 | |
|---|---|
| Accuracy | 99.8% |
| Cost | 41540 |
| Alternative 3 | |
|---|---|
| Accuracy | 99.8% |
| Cost | 41412 |
| Alternative 4 | |
|---|---|
| Accuracy | 99.4% |
| Cost | 26820 |
| Alternative 5 | |
|---|---|
| Accuracy | 99.4% |
| Cost | 7112 |
| Alternative 6 | |
|---|---|
| Accuracy | 98.6% |
| Cost | 840 |
| Alternative 7 | |
|---|---|
| Accuracy | 98.5% |
| Cost | 584 |
| Alternative 8 | |
|---|---|
| Accuracy | 97.8% |
| Cost | 328 |
| Alternative 9 | |
|---|---|
| Accuracy | 52.4% |
| Cost | 64 |
herbie shell --seed 2023137
(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)))))))