
(FPCore (x)
:precision binary64
(let* ((t_0 (/ 1.0 (+ 1.0 (* 0.3275911 (fabs x))))))
(-
1.0
(*
(*
t_0
(+
0.254829592
(*
t_0
(+
-0.284496736
(*
t_0
(+ 1.421413741 (* t_0 (+ -1.453152027 (* t_0 1.061405429)))))))))
(exp (- (* (fabs x) (fabs x))))))))
double code(double x) {
double t_0 = 1.0 / (1.0 + (0.3275911 * fabs(x)));
return 1.0 - ((t_0 * (0.254829592 + (t_0 * (-0.284496736 + (t_0 * (1.421413741 + (t_0 * (-1.453152027 + (t_0 * 1.061405429))))))))) * exp(-(fabs(x) * fabs(x))));
}
real(8) function code(x)
real(8), intent (in) :: x
real(8) :: t_0
t_0 = 1.0d0 / (1.0d0 + (0.3275911d0 * abs(x)))
code = 1.0d0 - ((t_0 * (0.254829592d0 + (t_0 * ((-0.284496736d0) + (t_0 * (1.421413741d0 + (t_0 * ((-1.453152027d0) + (t_0 * 1.061405429d0))))))))) * exp(-(abs(x) * abs(x))))
end function
public static double code(double x) {
double t_0 = 1.0 / (1.0 + (0.3275911 * Math.abs(x)));
return 1.0 - ((t_0 * (0.254829592 + (t_0 * (-0.284496736 + (t_0 * (1.421413741 + (t_0 * (-1.453152027 + (t_0 * 1.061405429))))))))) * Math.exp(-(Math.abs(x) * Math.abs(x))));
}
def code(x): t_0 = 1.0 / (1.0 + (0.3275911 * math.fabs(x))) return 1.0 - ((t_0 * (0.254829592 + (t_0 * (-0.284496736 + (t_0 * (1.421413741 + (t_0 * (-1.453152027 + (t_0 * 1.061405429))))))))) * math.exp(-(math.fabs(x) * math.fabs(x))))
function code(x) t_0 = Float64(1.0 / Float64(1.0 + Float64(0.3275911 * abs(x)))) return Float64(1.0 - Float64(Float64(t_0 * Float64(0.254829592 + Float64(t_0 * Float64(-0.284496736 + Float64(t_0 * Float64(1.421413741 + Float64(t_0 * Float64(-1.453152027 + Float64(t_0 * 1.061405429))))))))) * exp(Float64(-Float64(abs(x) * abs(x)))))) end
function tmp = code(x) t_0 = 1.0 / (1.0 + (0.3275911 * abs(x))); tmp = 1.0 - ((t_0 * (0.254829592 + (t_0 * (-0.284496736 + (t_0 * (1.421413741 + (t_0 * (-1.453152027 + (t_0 * 1.061405429))))))))) * exp(-(abs(x) * abs(x)))); end
code[x_] := Block[{t$95$0 = N[(1.0 / N[(1.0 + N[(0.3275911 * N[Abs[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, N[(1.0 - N[(N[(t$95$0 * N[(0.254829592 + N[(t$95$0 * N[(-0.284496736 + N[(t$95$0 * N[(1.421413741 + N[(t$95$0 * N[(-1.453152027 + N[(t$95$0 * 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]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{1}{1 + 0.3275911 \cdot \left|x\right|}\\
1 - \left(t_0 \cdot \left(0.254829592 + t_0 \cdot \left(-0.284496736 + t_0 \cdot \left(1.421413741 + t_0 \cdot \left(-1.453152027 + t_0 \cdot 1.061405429\right)\right)\right)\right)\right) \cdot e^{-\left|x\right| \cdot \left|x\right|}
\end{array}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 16 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x)
:precision binary64
(let* ((t_0 (/ 1.0 (+ 1.0 (* 0.3275911 (fabs x))))))
(-
1.0
(*
(*
t_0
(+
0.254829592
(*
t_0
(+
-0.284496736
(*
t_0
(+ 1.421413741 (* t_0 (+ -1.453152027 (* t_0 1.061405429)))))))))
(exp (- (* (fabs x) (fabs x))))))))
double code(double x) {
double t_0 = 1.0 / (1.0 + (0.3275911 * fabs(x)));
return 1.0 - ((t_0 * (0.254829592 + (t_0 * (-0.284496736 + (t_0 * (1.421413741 + (t_0 * (-1.453152027 + (t_0 * 1.061405429))))))))) * exp(-(fabs(x) * fabs(x))));
}
real(8) function code(x)
real(8), intent (in) :: x
real(8) :: t_0
t_0 = 1.0d0 / (1.0d0 + (0.3275911d0 * abs(x)))
code = 1.0d0 - ((t_0 * (0.254829592d0 + (t_0 * ((-0.284496736d0) + (t_0 * (1.421413741d0 + (t_0 * ((-1.453152027d0) + (t_0 * 1.061405429d0))))))))) * exp(-(abs(x) * abs(x))))
end function
public static double code(double x) {
double t_0 = 1.0 / (1.0 + (0.3275911 * Math.abs(x)));
return 1.0 - ((t_0 * (0.254829592 + (t_0 * (-0.284496736 + (t_0 * (1.421413741 + (t_0 * (-1.453152027 + (t_0 * 1.061405429))))))))) * Math.exp(-(Math.abs(x) * Math.abs(x))));
}
def code(x): t_0 = 1.0 / (1.0 + (0.3275911 * math.fabs(x))) return 1.0 - ((t_0 * (0.254829592 + (t_0 * (-0.284496736 + (t_0 * (1.421413741 + (t_0 * (-1.453152027 + (t_0 * 1.061405429))))))))) * math.exp(-(math.fabs(x) * math.fabs(x))))
function code(x) t_0 = Float64(1.0 / Float64(1.0 + Float64(0.3275911 * abs(x)))) return Float64(1.0 - Float64(Float64(t_0 * Float64(0.254829592 + Float64(t_0 * Float64(-0.284496736 + Float64(t_0 * Float64(1.421413741 + Float64(t_0 * Float64(-1.453152027 + Float64(t_0 * 1.061405429))))))))) * exp(Float64(-Float64(abs(x) * abs(x)))))) end
function tmp = code(x) t_0 = 1.0 / (1.0 + (0.3275911 * abs(x))); tmp = 1.0 - ((t_0 * (0.254829592 + (t_0 * (-0.284496736 + (t_0 * (1.421413741 + (t_0 * (-1.453152027 + (t_0 * 1.061405429))))))))) * exp(-(abs(x) * abs(x)))); end
code[x_] := Block[{t$95$0 = N[(1.0 / N[(1.0 + N[(0.3275911 * N[Abs[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, N[(1.0 - N[(N[(t$95$0 * N[(0.254829592 + N[(t$95$0 * N[(-0.284496736 + N[(t$95$0 * N[(1.421413741 + N[(t$95$0 * N[(-1.453152027 + N[(t$95$0 * 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]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{1}{1 + 0.3275911 \cdot \left|x\right|}\\
1 - \left(t_0 \cdot \left(0.254829592 + t_0 \cdot \left(-0.284496736 + t_0 \cdot \left(1.421413741 + t_0 \cdot \left(-1.453152027 + t_0 \cdot 1.061405429\right)\right)\right)\right)\right) \cdot e^{-\left|x\right| \cdot \left|x\right|}
\end{array}
\end{array}
(FPCore (x)
:precision binary64
(let* ((t_0 (fma 0.3275911 (fabs x) 1.0)))
(if (<= (fabs x) 5e-12)
(/
(+
(fma (pow x 3.0) -0.7506356576441799 (* x (* x -1.2734922589667106)))
(fma x 2.256772713883663 1.999999999e-9))
(+
1.0
(/
(+
0.254829592
(/
(+
-0.284496736
(/
(+
1.421413741
(/
(+ -1.453152027 (/ 1.061405429 (fma x 0.3275911 1.0)))
(fma x 0.3275911 1.0)))
(fma x 0.3275911 1.0)))
(fma x 0.3275911 1.0)))
(* (fma x 0.3275911 1.0) (exp (* x x))))))
(-
1.0
(/
(+
0.254829592
(expm1
(log1p
(/
(+
-0.284496736
(/
(+ 1.421413741 (/ (+ -1.453152027 (/ 1.061405429 t_0)) t_0))
t_0))
t_0))))
(* t_0 (pow (exp x) x)))))))
double code(double x) {
double t_0 = fma(0.3275911, fabs(x), 1.0);
double tmp;
if (fabs(x) <= 5e-12) {
tmp = (fma(pow(x, 3.0), -0.7506356576441799, (x * (x * -1.2734922589667106))) + fma(x, 2.256772713883663, 1.999999999e-9)) / (1.0 + ((0.254829592 + ((-0.284496736 + ((1.421413741 + ((-1.453152027 + (1.061405429 / fma(x, 0.3275911, 1.0))) / fma(x, 0.3275911, 1.0))) / fma(x, 0.3275911, 1.0))) / fma(x, 0.3275911, 1.0))) / (fma(x, 0.3275911, 1.0) * exp((x * x)))));
} else {
tmp = 1.0 - ((0.254829592 + expm1(log1p(((-0.284496736 + ((1.421413741 + ((-1.453152027 + (1.061405429 / t_0)) / t_0)) / t_0)) / t_0)))) / (t_0 * pow(exp(x), x)));
}
return tmp;
}
function code(x) t_0 = fma(0.3275911, abs(x), 1.0) tmp = 0.0 if (abs(x) <= 5e-12) tmp = Float64(Float64(fma((x ^ 3.0), -0.7506356576441799, Float64(x * Float64(x * -1.2734922589667106))) + fma(x, 2.256772713883663, 1.999999999e-9)) / Float64(1.0 + Float64(Float64(0.254829592 + Float64(Float64(-0.284496736 + Float64(Float64(1.421413741 + Float64(Float64(-1.453152027 + Float64(1.061405429 / fma(x, 0.3275911, 1.0))) / fma(x, 0.3275911, 1.0))) / fma(x, 0.3275911, 1.0))) / fma(x, 0.3275911, 1.0))) / Float64(fma(x, 0.3275911, 1.0) * exp(Float64(x * x)))))); else tmp = Float64(1.0 - Float64(Float64(0.254829592 + expm1(log1p(Float64(Float64(-0.284496736 + Float64(Float64(1.421413741 + Float64(Float64(-1.453152027 + Float64(1.061405429 / t_0)) / t_0)) / t_0)) / t_0)))) / Float64(t_0 * (exp(x) ^ x)))); end return tmp end
code[x_] := Block[{t$95$0 = N[(0.3275911 * N[Abs[x], $MachinePrecision] + 1.0), $MachinePrecision]}, If[LessEqual[N[Abs[x], $MachinePrecision], 5e-12], N[(N[(N[(N[Power[x, 3.0], $MachinePrecision] * -0.7506356576441799 + N[(x * N[(x * -1.2734922589667106), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x * 2.256772713883663 + 1.999999999e-9), $MachinePrecision]), $MachinePrecision] / N[(1.0 + N[(N[(0.254829592 + N[(N[(-0.284496736 + N[(N[(1.421413741 + N[(N[(-1.453152027 + N[(1.061405429 / N[(x * 0.3275911 + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x * 0.3275911 + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x * 0.3275911 + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x * 0.3275911 + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[(x * 0.3275911 + 1.0), $MachinePrecision] * N[Exp[N[(x * x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 - N[(N[(0.254829592 + N[(Exp[N[Log[1 + N[(N[(-0.284496736 + N[(N[(1.421413741 + N[(N[(-1.453152027 + N[(1.061405429 / t$95$0), $MachinePrecision]), $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision] / t$95$0), $MachinePrecision]], $MachinePrecision]] - 1), $MachinePrecision]), $MachinePrecision] / N[(t$95$0 * N[Power[N[Exp[x], $MachinePrecision], x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \mathsf{fma}\left(0.3275911, \left|x\right|, 1\right)\\
\mathbf{if}\;\left|x\right| \leq 5 \cdot 10^{-12}:\\
\;\;\;\;\frac{\mathsf{fma}\left({x}^{3}, -0.7506356576441799, x \cdot \left(x \cdot -1.2734922589667106\right)\right) + \mathsf{fma}\left(x, 2.256772713883663, 1.999999999 \cdot 10^{-9}\right)}{1 + \frac{0.254829592 + \frac{-0.284496736 + \frac{1.421413741 + \frac{-1.453152027 + \frac{1.061405429}{\mathsf{fma}\left(x, 0.3275911, 1\right)}}{\mathsf{fma}\left(x, 0.3275911, 1\right)}}{\mathsf{fma}\left(x, 0.3275911, 1\right)}}{\mathsf{fma}\left(x, 0.3275911, 1\right)}}{\mathsf{fma}\left(x, 0.3275911, 1\right) \cdot e^{x \cdot x}}}\\
\mathbf{else}:\\
\;\;\;\;1 - \frac{0.254829592 + \mathsf{expm1}\left(\mathsf{log1p}\left(\frac{-0.284496736 + \frac{1.421413741 + \frac{-1.453152027 + \frac{1.061405429}{t_0}}{t_0}}{t_0}}{t_0}\right)\right)}{t_0 \cdot {\left(e^{x}\right)}^{x}}\\
\end{array}
\end{array}
if (fabs.f64 x) < 4.9999999999999997e-12Initial program 57.7%
Applied egg-rr57.7%
Simplified57.7%
Taylor expanded in x around 0 99.6%
+-commutative99.6%
associate-+r+99.6%
associate-+l+99.6%
*-commutative99.6%
fma-def99.6%
*-commutative99.6%
unpow299.6%
associate-*l*99.6%
*-commutative99.6%
fma-def99.6%
Simplified99.6%
if 4.9999999999999997e-12 < (fabs.f64 x) Initial program 99.1%
Simplified99.1%
expm1-log1p-u99.1%
Applied egg-rr99.1%
Final simplification99.4%
(FPCore (x)
:precision binary64
(let* ((t_0 (fma 0.3275911 (fabs x) 1.0)))
(if (<= (fabs x) 5e-12)
(/
(+
(fma (pow x 3.0) -0.7506356576441799 (* x (* x -1.2734922589667106)))
(fma x 2.256772713883663 1.999999999e-9))
(+
1.0
(/
(+
0.254829592
(/
(+
-0.284496736
(/
(+
1.421413741
(/
(+ -1.453152027 (/ 1.061405429 (fma x 0.3275911 1.0)))
(fma x 0.3275911 1.0)))
(fma x 0.3275911 1.0)))
(fma x 0.3275911 1.0)))
(* (fma x 0.3275911 1.0) (exp (* x x))))))
(exp
(log
(+
1.0
(*
(exp (* x (- x)))
(/
(-
(/
(-
(/
(-
(/
(+
1.453152027
(* 1.061405429 (/ -1.0 (+ 1.0 (* (fabs x) 0.3275911)))))
t_0)
1.421413741)
t_0)
-0.284496736)
t_0)
0.254829592)
t_0))))))))
double code(double x) {
double t_0 = fma(0.3275911, fabs(x), 1.0);
double tmp;
if (fabs(x) <= 5e-12) {
tmp = (fma(pow(x, 3.0), -0.7506356576441799, (x * (x * -1.2734922589667106))) + fma(x, 2.256772713883663, 1.999999999e-9)) / (1.0 + ((0.254829592 + ((-0.284496736 + ((1.421413741 + ((-1.453152027 + (1.061405429 / fma(x, 0.3275911, 1.0))) / fma(x, 0.3275911, 1.0))) / fma(x, 0.3275911, 1.0))) / fma(x, 0.3275911, 1.0))) / (fma(x, 0.3275911, 1.0) * exp((x * x)))));
} else {
tmp = exp(log((1.0 + (exp((x * -x)) * ((((((((1.453152027 + (1.061405429 * (-1.0 / (1.0 + (fabs(x) * 0.3275911))))) / t_0) - 1.421413741) / t_0) - -0.284496736) / t_0) - 0.254829592) / t_0)))));
}
return tmp;
}
function code(x) t_0 = fma(0.3275911, abs(x), 1.0) tmp = 0.0 if (abs(x) <= 5e-12) tmp = Float64(Float64(fma((x ^ 3.0), -0.7506356576441799, Float64(x * Float64(x * -1.2734922589667106))) + fma(x, 2.256772713883663, 1.999999999e-9)) / Float64(1.0 + Float64(Float64(0.254829592 + Float64(Float64(-0.284496736 + Float64(Float64(1.421413741 + Float64(Float64(-1.453152027 + Float64(1.061405429 / fma(x, 0.3275911, 1.0))) / fma(x, 0.3275911, 1.0))) / fma(x, 0.3275911, 1.0))) / fma(x, 0.3275911, 1.0))) / Float64(fma(x, 0.3275911, 1.0) * exp(Float64(x * x)))))); else tmp = exp(log(Float64(1.0 + Float64(exp(Float64(x * Float64(-x))) * Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(1.453152027 + Float64(1.061405429 * Float64(-1.0 / Float64(1.0 + Float64(abs(x) * 0.3275911))))) / t_0) - 1.421413741) / t_0) - -0.284496736) / t_0) - 0.254829592) / t_0))))); end return tmp end
code[x_] := Block[{t$95$0 = N[(0.3275911 * N[Abs[x], $MachinePrecision] + 1.0), $MachinePrecision]}, If[LessEqual[N[Abs[x], $MachinePrecision], 5e-12], N[(N[(N[(N[Power[x, 3.0], $MachinePrecision] * -0.7506356576441799 + N[(x * N[(x * -1.2734922589667106), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x * 2.256772713883663 + 1.999999999e-9), $MachinePrecision]), $MachinePrecision] / N[(1.0 + N[(N[(0.254829592 + N[(N[(-0.284496736 + N[(N[(1.421413741 + N[(N[(-1.453152027 + N[(1.061405429 / N[(x * 0.3275911 + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x * 0.3275911 + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x * 0.3275911 + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x * 0.3275911 + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[(x * 0.3275911 + 1.0), $MachinePrecision] * N[Exp[N[(x * x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Exp[N[Log[N[(1.0 + N[(N[Exp[N[(x * (-x)), $MachinePrecision]], $MachinePrecision] * N[(N[(N[(N[(N[(N[(N[(N[(1.453152027 + N[(1.061405429 * N[(-1.0 / N[(1.0 + N[(N[Abs[x], $MachinePrecision] * 0.3275911), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$0), $MachinePrecision] - 1.421413741), $MachinePrecision] / t$95$0), $MachinePrecision] - -0.284496736), $MachinePrecision] / t$95$0), $MachinePrecision] - 0.254829592), $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \mathsf{fma}\left(0.3275911, \left|x\right|, 1\right)\\
\mathbf{if}\;\left|x\right| \leq 5 \cdot 10^{-12}:\\
\;\;\;\;\frac{\mathsf{fma}\left({x}^{3}, -0.7506356576441799, x \cdot \left(x \cdot -1.2734922589667106\right)\right) + \mathsf{fma}\left(x, 2.256772713883663, 1.999999999 \cdot 10^{-9}\right)}{1 + \frac{0.254829592 + \frac{-0.284496736 + \frac{1.421413741 + \frac{-1.453152027 + \frac{1.061405429}{\mathsf{fma}\left(x, 0.3275911, 1\right)}}{\mathsf{fma}\left(x, 0.3275911, 1\right)}}{\mathsf{fma}\left(x, 0.3275911, 1\right)}}{\mathsf{fma}\left(x, 0.3275911, 1\right)}}{\mathsf{fma}\left(x, 0.3275911, 1\right) \cdot e^{x \cdot x}}}\\
\mathbf{else}:\\
\;\;\;\;e^{\log \left(1 + e^{x \cdot \left(-x\right)} \cdot \frac{\frac{\frac{\frac{1.453152027 + 1.061405429 \cdot \frac{-1}{1 + \left|x\right| \cdot 0.3275911}}{t_0} - 1.421413741}{t_0} - -0.284496736}{t_0} - 0.254829592}{t_0}\right)}\\
\end{array}
\end{array}
if (fabs.f64 x) < 4.9999999999999997e-12Initial program 57.7%
Applied egg-rr57.7%
Simplified57.7%
Taylor expanded in x around 0 99.6%
+-commutative99.6%
associate-+r+99.6%
associate-+l+99.6%
*-commutative99.6%
fma-def99.6%
*-commutative99.6%
unpow299.6%
associate-*l*99.6%
*-commutative99.6%
fma-def99.6%
Simplified99.6%
if 4.9999999999999997e-12 < (fabs.f64 x) Initial program 99.1%
Applied egg-rr99.1%
Taylor expanded in x around inf 99.1%
Final simplification99.3%
(FPCore (x)
:precision binary64
(let* ((t_0 (+ 1.0 (* (fabs x) 0.3275911))))
(if (<= (fabs x) 5e-12)
(/
(+
(fma (pow x 3.0) -0.7506356576441799 (* x (* x -1.2734922589667106)))
(fma x 2.256772713883663 1.999999999e-9))
(+
1.0
(/
(+
0.254829592
(/
(+
-0.284496736
(/
(+
1.421413741
(/
(+ -1.453152027 (/ 1.061405429 (fma x 0.3275911 1.0)))
(fma x 0.3275911 1.0)))
(fma x 0.3275911 1.0)))
(fma x 0.3275911 1.0)))
(* (fma x 0.3275911 1.0) (exp (* x x))))))
(-
1.0
(/
(+
0.254829592
(/
(+
(+ (* 1.061405429 (/ 1.0 (pow t_0 3.0))) (* 1.421413741 (/ 1.0 t_0)))
(- (* 1.453152027 (/ -1.0 (pow t_0 2.0))) 0.284496736))
t_0))
(* (fma 0.3275911 (fabs x) 1.0) (pow (exp x) x)))))))
double code(double x) {
double t_0 = 1.0 + (fabs(x) * 0.3275911);
double tmp;
if (fabs(x) <= 5e-12) {
tmp = (fma(pow(x, 3.0), -0.7506356576441799, (x * (x * -1.2734922589667106))) + fma(x, 2.256772713883663, 1.999999999e-9)) / (1.0 + ((0.254829592 + ((-0.284496736 + ((1.421413741 + ((-1.453152027 + (1.061405429 / fma(x, 0.3275911, 1.0))) / fma(x, 0.3275911, 1.0))) / fma(x, 0.3275911, 1.0))) / fma(x, 0.3275911, 1.0))) / (fma(x, 0.3275911, 1.0) * exp((x * x)))));
} else {
tmp = 1.0 - ((0.254829592 + ((((1.061405429 * (1.0 / pow(t_0, 3.0))) + (1.421413741 * (1.0 / t_0))) + ((1.453152027 * (-1.0 / pow(t_0, 2.0))) - 0.284496736)) / t_0)) / (fma(0.3275911, fabs(x), 1.0) * pow(exp(x), x)));
}
return tmp;
}
function code(x) t_0 = Float64(1.0 + Float64(abs(x) * 0.3275911)) tmp = 0.0 if (abs(x) <= 5e-12) tmp = Float64(Float64(fma((x ^ 3.0), -0.7506356576441799, Float64(x * Float64(x * -1.2734922589667106))) + fma(x, 2.256772713883663, 1.999999999e-9)) / Float64(1.0 + Float64(Float64(0.254829592 + Float64(Float64(-0.284496736 + Float64(Float64(1.421413741 + Float64(Float64(-1.453152027 + Float64(1.061405429 / fma(x, 0.3275911, 1.0))) / fma(x, 0.3275911, 1.0))) / fma(x, 0.3275911, 1.0))) / fma(x, 0.3275911, 1.0))) / Float64(fma(x, 0.3275911, 1.0) * exp(Float64(x * x)))))); else tmp = Float64(1.0 - Float64(Float64(0.254829592 + Float64(Float64(Float64(Float64(1.061405429 * Float64(1.0 / (t_0 ^ 3.0))) + Float64(1.421413741 * Float64(1.0 / t_0))) + Float64(Float64(1.453152027 * Float64(-1.0 / (t_0 ^ 2.0))) - 0.284496736)) / t_0)) / Float64(fma(0.3275911, abs(x), 1.0) * (exp(x) ^ x)))); end return tmp end
code[x_] := Block[{t$95$0 = N[(1.0 + N[(N[Abs[x], $MachinePrecision] * 0.3275911), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[Abs[x], $MachinePrecision], 5e-12], N[(N[(N[(N[Power[x, 3.0], $MachinePrecision] * -0.7506356576441799 + N[(x * N[(x * -1.2734922589667106), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x * 2.256772713883663 + 1.999999999e-9), $MachinePrecision]), $MachinePrecision] / N[(1.0 + N[(N[(0.254829592 + N[(N[(-0.284496736 + N[(N[(1.421413741 + N[(N[(-1.453152027 + N[(1.061405429 / N[(x * 0.3275911 + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x * 0.3275911 + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x * 0.3275911 + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x * 0.3275911 + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[(x * 0.3275911 + 1.0), $MachinePrecision] * N[Exp[N[(x * x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 - N[(N[(0.254829592 + N[(N[(N[(N[(1.061405429 * N[(1.0 / N[Power[t$95$0, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.421413741 * N[(1.0 / t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(1.453152027 * N[(-1.0 / N[Power[t$95$0, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 0.284496736), $MachinePrecision]), $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision] / N[(N[(0.3275911 * N[Abs[x], $MachinePrecision] + 1.0), $MachinePrecision] * N[Power[N[Exp[x], $MachinePrecision], x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 1 + \left|x\right| \cdot 0.3275911\\
\mathbf{if}\;\left|x\right| \leq 5 \cdot 10^{-12}:\\
\;\;\;\;\frac{\mathsf{fma}\left({x}^{3}, -0.7506356576441799, x \cdot \left(x \cdot -1.2734922589667106\right)\right) + \mathsf{fma}\left(x, 2.256772713883663, 1.999999999 \cdot 10^{-9}\right)}{1 + \frac{0.254829592 + \frac{-0.284496736 + \frac{1.421413741 + \frac{-1.453152027 + \frac{1.061405429}{\mathsf{fma}\left(x, 0.3275911, 1\right)}}{\mathsf{fma}\left(x, 0.3275911, 1\right)}}{\mathsf{fma}\left(x, 0.3275911, 1\right)}}{\mathsf{fma}\left(x, 0.3275911, 1\right)}}{\mathsf{fma}\left(x, 0.3275911, 1\right) \cdot e^{x \cdot x}}}\\
\mathbf{else}:\\
\;\;\;\;1 - \frac{0.254829592 + \frac{\left(1.061405429 \cdot \frac{1}{{t_0}^{3}} + 1.421413741 \cdot \frac{1}{t_0}\right) + \left(1.453152027 \cdot \frac{-1}{{t_0}^{2}} - 0.284496736\right)}{t_0}}{\mathsf{fma}\left(0.3275911, \left|x\right|, 1\right) \cdot {\left(e^{x}\right)}^{x}}\\
\end{array}
\end{array}
if (fabs.f64 x) < 4.9999999999999997e-12Initial program 57.7%
Applied egg-rr57.7%
Simplified57.7%
Taylor expanded in x around 0 99.6%
+-commutative99.6%
associate-+r+99.6%
associate-+l+99.6%
*-commutative99.6%
fma-def99.6%
*-commutative99.6%
unpow299.6%
associate-*l*99.6%
*-commutative99.6%
fma-def99.6%
Simplified99.6%
if 4.9999999999999997e-12 < (fabs.f64 x) Initial program 99.1%
Simplified99.1%
Taylor expanded in x around inf 99.1%
Final simplification99.3%
(FPCore (x)
:precision binary64
(let* ((t_0 (+ 1.0 (* (fabs x) 0.3275911))) (t_1 (/ 1.0 t_0)))
(if (<= (fabs x) 5e-12)
(/
(+
(fma (pow x 3.0) -0.7506356576441799 (* x (* x -1.2734922589667106)))
(fma x 2.256772713883663 1.999999999e-9))
(+
1.0
(/
(+
0.254829592
(/
(+
-0.284496736
(/
(+
1.421413741
(/
(+ -1.453152027 (/ 1.061405429 (fma x 0.3275911 1.0)))
(fma x 0.3275911 1.0)))
(fma x 0.3275911 1.0)))
(fma x 0.3275911 1.0)))
(* (fma x 0.3275911 1.0) (exp (* x x))))))
(+
1.0
(*
(exp (* x (- x)))
(*
t_1
(-
(*
t_1
(-
(*
t_1
(-
(* t_1 (- (* 1.061405429 (/ -1.0 t_0)) -1.453152027))
1.421413741))
-0.284496736))
0.254829592)))))))
double code(double x) {
double t_0 = 1.0 + (fabs(x) * 0.3275911);
double t_1 = 1.0 / t_0;
double tmp;
if (fabs(x) <= 5e-12) {
tmp = (fma(pow(x, 3.0), -0.7506356576441799, (x * (x * -1.2734922589667106))) + fma(x, 2.256772713883663, 1.999999999e-9)) / (1.0 + ((0.254829592 + ((-0.284496736 + ((1.421413741 + ((-1.453152027 + (1.061405429 / fma(x, 0.3275911, 1.0))) / fma(x, 0.3275911, 1.0))) / fma(x, 0.3275911, 1.0))) / fma(x, 0.3275911, 1.0))) / (fma(x, 0.3275911, 1.0) * exp((x * x)))));
} else {
tmp = 1.0 + (exp((x * -x)) * (t_1 * ((t_1 * ((t_1 * ((t_1 * ((1.061405429 * (-1.0 / t_0)) - -1.453152027)) - 1.421413741)) - -0.284496736)) - 0.254829592)));
}
return tmp;
}
function code(x) t_0 = Float64(1.0 + Float64(abs(x) * 0.3275911)) t_1 = Float64(1.0 / t_0) tmp = 0.0 if (abs(x) <= 5e-12) tmp = Float64(Float64(fma((x ^ 3.0), -0.7506356576441799, Float64(x * Float64(x * -1.2734922589667106))) + fma(x, 2.256772713883663, 1.999999999e-9)) / Float64(1.0 + Float64(Float64(0.254829592 + Float64(Float64(-0.284496736 + Float64(Float64(1.421413741 + Float64(Float64(-1.453152027 + Float64(1.061405429 / fma(x, 0.3275911, 1.0))) / fma(x, 0.3275911, 1.0))) / fma(x, 0.3275911, 1.0))) / fma(x, 0.3275911, 1.0))) / Float64(fma(x, 0.3275911, 1.0) * exp(Float64(x * x)))))); else tmp = Float64(1.0 + Float64(exp(Float64(x * Float64(-x))) * Float64(t_1 * Float64(Float64(t_1 * Float64(Float64(t_1 * Float64(Float64(t_1 * Float64(Float64(1.061405429 * Float64(-1.0 / t_0)) - -1.453152027)) - 1.421413741)) - -0.284496736)) - 0.254829592)))); end return tmp end
code[x_] := Block[{t$95$0 = N[(1.0 + N[(N[Abs[x], $MachinePrecision] * 0.3275911), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(1.0 / t$95$0), $MachinePrecision]}, If[LessEqual[N[Abs[x], $MachinePrecision], 5e-12], N[(N[(N[(N[Power[x, 3.0], $MachinePrecision] * -0.7506356576441799 + N[(x * N[(x * -1.2734922589667106), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x * 2.256772713883663 + 1.999999999e-9), $MachinePrecision]), $MachinePrecision] / N[(1.0 + N[(N[(0.254829592 + N[(N[(-0.284496736 + N[(N[(1.421413741 + N[(N[(-1.453152027 + N[(1.061405429 / N[(x * 0.3275911 + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x * 0.3275911 + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x * 0.3275911 + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x * 0.3275911 + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[(x * 0.3275911 + 1.0), $MachinePrecision] * N[Exp[N[(x * x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(N[Exp[N[(x * (-x)), $MachinePrecision]], $MachinePrecision] * N[(t$95$1 * N[(N[(t$95$1 * N[(N[(t$95$1 * N[(N[(t$95$1 * N[(N[(1.061405429 * N[(-1.0 / t$95$0), $MachinePrecision]), $MachinePrecision] - -1.453152027), $MachinePrecision]), $MachinePrecision] - 1.421413741), $MachinePrecision]), $MachinePrecision] - -0.284496736), $MachinePrecision]), $MachinePrecision] - 0.254829592), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\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^{-12}:\\
\;\;\;\;\frac{\mathsf{fma}\left({x}^{3}, -0.7506356576441799, x \cdot \left(x \cdot -1.2734922589667106\right)\right) + \mathsf{fma}\left(x, 2.256772713883663, 1.999999999 \cdot 10^{-9}\right)}{1 + \frac{0.254829592 + \frac{-0.284496736 + \frac{1.421413741 + \frac{-1.453152027 + \frac{1.061405429}{\mathsf{fma}\left(x, 0.3275911, 1\right)}}{\mathsf{fma}\left(x, 0.3275911, 1\right)}}{\mathsf{fma}\left(x, 0.3275911, 1\right)}}{\mathsf{fma}\left(x, 0.3275911, 1\right)}}{\mathsf{fma}\left(x, 0.3275911, 1\right) \cdot e^{x \cdot x}}}\\
\mathbf{else}:\\
\;\;\;\;1 + e^{x \cdot \left(-x\right)} \cdot \left(t_1 \cdot \left(t_1 \cdot \left(t_1 \cdot \left(t_1 \cdot \left(1.061405429 \cdot \frac{-1}{t_0} - -1.453152027\right) - 1.421413741\right) - -0.284496736\right) - 0.254829592\right)\right)\\
\end{array}
\end{array}
if (fabs.f64 x) < 4.9999999999999997e-12Initial program 57.7%
Applied egg-rr57.7%
Simplified57.7%
Taylor expanded in x around 0 99.6%
+-commutative99.6%
associate-+r+99.6%
associate-+l+99.6%
*-commutative99.6%
fma-def99.6%
*-commutative99.6%
unpow299.6%
associate-*l*99.6%
*-commutative99.6%
fma-def99.6%
Simplified99.6%
if 4.9999999999999997e-12 < (fabs.f64 x) Initial program 99.1%
Final simplification99.3%
(FPCore (x)
:precision binary64
(let* ((t_0 (+ 1.0 (* (fabs x) 0.3275911))) (t_1 (/ 1.0 t_0)))
(if (<= (fabs x) 5e-12)
(/
(+
1.999999999e-9
(+
(* (pow x 3.0) -0.7506356576441799)
(+ (* -1.2734922589667106 (pow x 2.0)) (* x 2.256772713883663))))
(+
1.0
(/
(+
0.254829592
(/
(+
-0.284496736
(/ (+ 1.029667143 (* x -0.2193742730720041)) (fma x 0.3275911 1.0)))
(fma x 0.3275911 1.0)))
(* (fma x 0.3275911 1.0) (exp (* x x))))))
(+
1.0
(*
(exp (* x (- x)))
(*
t_1
(-
(*
t_1
(-
(*
t_1
(-
(* t_1 (- (* 1.061405429 (/ -1.0 t_0)) -1.453152027))
1.421413741))
-0.284496736))
0.254829592)))))))
double code(double x) {
double t_0 = 1.0 + (fabs(x) * 0.3275911);
double t_1 = 1.0 / t_0;
double tmp;
if (fabs(x) <= 5e-12) {
tmp = (1.999999999e-9 + ((pow(x, 3.0) * -0.7506356576441799) + ((-1.2734922589667106 * pow(x, 2.0)) + (x * 2.256772713883663)))) / (1.0 + ((0.254829592 + ((-0.284496736 + ((1.029667143 + (x * -0.2193742730720041)) / fma(x, 0.3275911, 1.0))) / fma(x, 0.3275911, 1.0))) / (fma(x, 0.3275911, 1.0) * exp((x * x)))));
} else {
tmp = 1.0 + (exp((x * -x)) * (t_1 * ((t_1 * ((t_1 * ((t_1 * ((1.061405429 * (-1.0 / t_0)) - -1.453152027)) - 1.421413741)) - -0.284496736)) - 0.254829592)));
}
return tmp;
}
function code(x) t_0 = Float64(1.0 + Float64(abs(x) * 0.3275911)) t_1 = Float64(1.0 / t_0) tmp = 0.0 if (abs(x) <= 5e-12) tmp = Float64(Float64(1.999999999e-9 + Float64(Float64((x ^ 3.0) * -0.7506356576441799) + Float64(Float64(-1.2734922589667106 * (x ^ 2.0)) + Float64(x * 2.256772713883663)))) / Float64(1.0 + Float64(Float64(0.254829592 + Float64(Float64(-0.284496736 + Float64(Float64(1.029667143 + Float64(x * -0.2193742730720041)) / fma(x, 0.3275911, 1.0))) / fma(x, 0.3275911, 1.0))) / Float64(fma(x, 0.3275911, 1.0) * exp(Float64(x * x)))))); else tmp = Float64(1.0 + Float64(exp(Float64(x * Float64(-x))) * Float64(t_1 * Float64(Float64(t_1 * Float64(Float64(t_1 * Float64(Float64(t_1 * Float64(Float64(1.061405429 * Float64(-1.0 / t_0)) - -1.453152027)) - 1.421413741)) - -0.284496736)) - 0.254829592)))); end return tmp end
code[x_] := Block[{t$95$0 = N[(1.0 + N[(N[Abs[x], $MachinePrecision] * 0.3275911), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(1.0 / t$95$0), $MachinePrecision]}, If[LessEqual[N[Abs[x], $MachinePrecision], 5e-12], N[(N[(1.999999999e-9 + N[(N[(N[Power[x, 3.0], $MachinePrecision] * -0.7506356576441799), $MachinePrecision] + N[(N[(-1.2734922589667106 * N[Power[x, 2.0], $MachinePrecision]), $MachinePrecision] + N[(x * 2.256772713883663), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(1.0 + N[(N[(0.254829592 + N[(N[(-0.284496736 + N[(N[(1.029667143 + N[(x * -0.2193742730720041), $MachinePrecision]), $MachinePrecision] / N[(x * 0.3275911 + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x * 0.3275911 + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[(x * 0.3275911 + 1.0), $MachinePrecision] * N[Exp[N[(x * x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(N[Exp[N[(x * (-x)), $MachinePrecision]], $MachinePrecision] * N[(t$95$1 * N[(N[(t$95$1 * N[(N[(t$95$1 * N[(N[(t$95$1 * N[(N[(1.061405429 * N[(-1.0 / t$95$0), $MachinePrecision]), $MachinePrecision] - -1.453152027), $MachinePrecision]), $MachinePrecision] - 1.421413741), $MachinePrecision]), $MachinePrecision] - -0.284496736), $MachinePrecision]), $MachinePrecision] - 0.254829592), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\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^{-12}:\\
\;\;\;\;\frac{1.999999999 \cdot 10^{-9} + \left({x}^{3} \cdot -0.7506356576441799 + \left(-1.2734922589667106 \cdot {x}^{2} + x \cdot 2.256772713883663\right)\right)}{1 + \frac{0.254829592 + \frac{-0.284496736 + \frac{1.029667143 + x \cdot -0.2193742730720041}{\mathsf{fma}\left(x, 0.3275911, 1\right)}}{\mathsf{fma}\left(x, 0.3275911, 1\right)}}{\mathsf{fma}\left(x, 0.3275911, 1\right) \cdot e^{x \cdot x}}}\\
\mathbf{else}:\\
\;\;\;\;1 + e^{x \cdot \left(-x\right)} \cdot \left(t_1 \cdot \left(t_1 \cdot \left(t_1 \cdot \left(t_1 \cdot \left(1.061405429 \cdot \frac{-1}{t_0} - -1.453152027\right) - 1.421413741\right) - -0.284496736\right) - 0.254829592\right)\right)\\
\end{array}
\end{array}
if (fabs.f64 x) < 4.9999999999999997e-12Initial program 57.7%
Applied egg-rr57.7%
Simplified57.7%
Taylor expanded in x around 0 99.6%
Taylor expanded in x around 0 99.6%
*-commutative99.6%
Simplified99.6%
if 4.9999999999999997e-12 < (fabs.f64 x) Initial program 99.1%
Final simplification99.3%
(FPCore (x)
:precision binary64
(let* ((t_0 (+ 1.0 (* (fabs x) 0.3275911))) (t_1 (/ 1.0 t_0)))
(if (<= (fabs x) 5e-12)
(/
(+
1.999999999e-9
(+
(* (pow x 3.0) -0.7506356576441799)
(+ (* -1.2734922589667106 (pow x 2.0)) (* x 2.256772713883663))))
(+
1.0
(/
(+
0.254829592
(/
(+
-0.284496736
(/ (+ 1.029667143 (* x -0.2193742730720041)) (fma x 0.3275911 1.0)))
(fma x 0.3275911 1.0)))
(* (fma x 0.3275911 1.0) (exp (* x x))))))
(+
1.0
(*
(*
(exp (* x (- x)))
(+
0.254829592
(*
t_1
(+
-0.284496736
(*
t_1
(+ 1.421413741 (* t_1 (+ -1.453152027 (/ 1.061405429 t_0)))))))))
(/ -1.0 t_0))))))
double code(double x) {
double t_0 = 1.0 + (fabs(x) * 0.3275911);
double t_1 = 1.0 / t_0;
double tmp;
if (fabs(x) <= 5e-12) {
tmp = (1.999999999e-9 + ((pow(x, 3.0) * -0.7506356576441799) + ((-1.2734922589667106 * pow(x, 2.0)) + (x * 2.256772713883663)))) / (1.0 + ((0.254829592 + ((-0.284496736 + ((1.029667143 + (x * -0.2193742730720041)) / fma(x, 0.3275911, 1.0))) / fma(x, 0.3275911, 1.0))) / (fma(x, 0.3275911, 1.0) * exp((x * x)))));
} else {
tmp = 1.0 + ((exp((x * -x)) * (0.254829592 + (t_1 * (-0.284496736 + (t_1 * (1.421413741 + (t_1 * (-1.453152027 + (1.061405429 / t_0))))))))) * (-1.0 / t_0));
}
return tmp;
}
function code(x) t_0 = Float64(1.0 + Float64(abs(x) * 0.3275911)) t_1 = Float64(1.0 / t_0) tmp = 0.0 if (abs(x) <= 5e-12) tmp = Float64(Float64(1.999999999e-9 + Float64(Float64((x ^ 3.0) * -0.7506356576441799) + Float64(Float64(-1.2734922589667106 * (x ^ 2.0)) + Float64(x * 2.256772713883663)))) / Float64(1.0 + Float64(Float64(0.254829592 + Float64(Float64(-0.284496736 + Float64(Float64(1.029667143 + Float64(x * -0.2193742730720041)) / fma(x, 0.3275911, 1.0))) / fma(x, 0.3275911, 1.0))) / Float64(fma(x, 0.3275911, 1.0) * exp(Float64(x * x)))))); else tmp = Float64(1.0 + Float64(Float64(exp(Float64(x * Float64(-x))) * Float64(0.254829592 + Float64(t_1 * Float64(-0.284496736 + Float64(t_1 * Float64(1.421413741 + Float64(t_1 * Float64(-1.453152027 + Float64(1.061405429 / t_0))))))))) * Float64(-1.0 / t_0))); end return tmp end
code[x_] := Block[{t$95$0 = N[(1.0 + N[(N[Abs[x], $MachinePrecision] * 0.3275911), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(1.0 / t$95$0), $MachinePrecision]}, If[LessEqual[N[Abs[x], $MachinePrecision], 5e-12], N[(N[(1.999999999e-9 + N[(N[(N[Power[x, 3.0], $MachinePrecision] * -0.7506356576441799), $MachinePrecision] + N[(N[(-1.2734922589667106 * N[Power[x, 2.0], $MachinePrecision]), $MachinePrecision] + N[(x * 2.256772713883663), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(1.0 + N[(N[(0.254829592 + N[(N[(-0.284496736 + N[(N[(1.029667143 + N[(x * -0.2193742730720041), $MachinePrecision]), $MachinePrecision] / N[(x * 0.3275911 + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x * 0.3275911 + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[(x * 0.3275911 + 1.0), $MachinePrecision] * N[Exp[N[(x * x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(N[(N[Exp[N[(x * (-x)), $MachinePrecision]], $MachinePrecision] * N[(0.254829592 + N[(t$95$1 * N[(-0.284496736 + N[(t$95$1 * N[(1.421413741 + N[(t$95$1 * N[(-1.453152027 + N[(1.061405429 / t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(-1.0 / t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\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^{-12}:\\
\;\;\;\;\frac{1.999999999 \cdot 10^{-9} + \left({x}^{3} \cdot -0.7506356576441799 + \left(-1.2734922589667106 \cdot {x}^{2} + x \cdot 2.256772713883663\right)\right)}{1 + \frac{0.254829592 + \frac{-0.284496736 + \frac{1.029667143 + x \cdot -0.2193742730720041}{\mathsf{fma}\left(x, 0.3275911, 1\right)}}{\mathsf{fma}\left(x, 0.3275911, 1\right)}}{\mathsf{fma}\left(x, 0.3275911, 1\right) \cdot e^{x \cdot x}}}\\
\mathbf{else}:\\
\;\;\;\;1 + \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) \cdot \frac{-1}{t_0}\\
\end{array}
\end{array}
if (fabs.f64 x) < 4.9999999999999997e-12Initial program 57.7%
Applied egg-rr57.7%
Simplified57.7%
Taylor expanded in x around 0 99.6%
Taylor expanded in x around 0 99.6%
*-commutative99.6%
Simplified99.6%
if 4.9999999999999997e-12 < (fabs.f64 x) Initial program 99.1%
associate-*l*99.1%
Simplified99.1%
Final simplification99.3%
(FPCore (x)
:precision binary64
(let* ((t_0 (+ 1.0 (* (fabs x) 0.3275911))) (t_1 (/ 1.0 t_0)))
(if (<= (fabs x) 5e-12)
(/
(+
1.999999999e-9
(+
(* (pow x 3.0) -0.7506356576441799)
(+ (* -1.2734922589667106 (pow x 2.0)) (* x 2.256772713883663))))
(+
1.0
(/
(+
0.254829592
(/
(+
-0.284496736
(/ (+ 1.029667143 (* x -0.2193742730720041)) (fma x 0.3275911 1.0)))
(fma x 0.3275911 1.0)))
(* (fma x 0.3275911 1.0) (exp (* x x))))))
(+
1.0
(*
(*
(exp (* x (- x)))
(+
0.254829592
(*
t_1
(+
-0.284496736
(*
t_1
(+
1.421413741
(*
(+ -1.453152027 (/ 1.061405429 t_0))
(/ 1.0 (+ 1.0 (* x 0.3275911))))))))))
(/ -1.0 t_0))))))
double code(double x) {
double t_0 = 1.0 + (fabs(x) * 0.3275911);
double t_1 = 1.0 / t_0;
double tmp;
if (fabs(x) <= 5e-12) {
tmp = (1.999999999e-9 + ((pow(x, 3.0) * -0.7506356576441799) + ((-1.2734922589667106 * pow(x, 2.0)) + (x * 2.256772713883663)))) / (1.0 + ((0.254829592 + ((-0.284496736 + ((1.029667143 + (x * -0.2193742730720041)) / fma(x, 0.3275911, 1.0))) / fma(x, 0.3275911, 1.0))) / (fma(x, 0.3275911, 1.0) * exp((x * x)))));
} else {
tmp = 1.0 + ((exp((x * -x)) * (0.254829592 + (t_1 * (-0.284496736 + (t_1 * (1.421413741 + ((-1.453152027 + (1.061405429 / t_0)) * (1.0 / (1.0 + (x * 0.3275911)))))))))) * (-1.0 / t_0));
}
return tmp;
}
function code(x) t_0 = Float64(1.0 + Float64(abs(x) * 0.3275911)) t_1 = Float64(1.0 / t_0) tmp = 0.0 if (abs(x) <= 5e-12) tmp = Float64(Float64(1.999999999e-9 + Float64(Float64((x ^ 3.0) * -0.7506356576441799) + Float64(Float64(-1.2734922589667106 * (x ^ 2.0)) + Float64(x * 2.256772713883663)))) / Float64(1.0 + Float64(Float64(0.254829592 + Float64(Float64(-0.284496736 + Float64(Float64(1.029667143 + Float64(x * -0.2193742730720041)) / fma(x, 0.3275911, 1.0))) / fma(x, 0.3275911, 1.0))) / Float64(fma(x, 0.3275911, 1.0) * exp(Float64(x * x)))))); else tmp = Float64(1.0 + Float64(Float64(exp(Float64(x * Float64(-x))) * Float64(0.254829592 + Float64(t_1 * Float64(-0.284496736 + Float64(t_1 * Float64(1.421413741 + Float64(Float64(-1.453152027 + Float64(1.061405429 / t_0)) * Float64(1.0 / Float64(1.0 + Float64(x * 0.3275911)))))))))) * Float64(-1.0 / t_0))); end return tmp end
code[x_] := Block[{t$95$0 = N[(1.0 + N[(N[Abs[x], $MachinePrecision] * 0.3275911), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(1.0 / t$95$0), $MachinePrecision]}, If[LessEqual[N[Abs[x], $MachinePrecision], 5e-12], N[(N[(1.999999999e-9 + N[(N[(N[Power[x, 3.0], $MachinePrecision] * -0.7506356576441799), $MachinePrecision] + N[(N[(-1.2734922589667106 * N[Power[x, 2.0], $MachinePrecision]), $MachinePrecision] + N[(x * 2.256772713883663), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(1.0 + N[(N[(0.254829592 + N[(N[(-0.284496736 + N[(N[(1.029667143 + N[(x * -0.2193742730720041), $MachinePrecision]), $MachinePrecision] / N[(x * 0.3275911 + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x * 0.3275911 + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[(x * 0.3275911 + 1.0), $MachinePrecision] * N[Exp[N[(x * x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(N[(N[Exp[N[(x * (-x)), $MachinePrecision]], $MachinePrecision] * N[(0.254829592 + N[(t$95$1 * N[(-0.284496736 + N[(t$95$1 * N[(1.421413741 + N[(N[(-1.453152027 + N[(1.061405429 / t$95$0), $MachinePrecision]), $MachinePrecision] * N[(1.0 / N[(1.0 + N[(x * 0.3275911), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(-1.0 / t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\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^{-12}:\\
\;\;\;\;\frac{1.999999999 \cdot 10^{-9} + \left({x}^{3} \cdot -0.7506356576441799 + \left(-1.2734922589667106 \cdot {x}^{2} + x \cdot 2.256772713883663\right)\right)}{1 + \frac{0.254829592 + \frac{-0.284496736 + \frac{1.029667143 + x \cdot -0.2193742730720041}{\mathsf{fma}\left(x, 0.3275911, 1\right)}}{\mathsf{fma}\left(x, 0.3275911, 1\right)}}{\mathsf{fma}\left(x, 0.3275911, 1\right) \cdot e^{x \cdot x}}}\\
\mathbf{else}:\\
\;\;\;\;1 + \left(e^{x \cdot \left(-x\right)} \cdot \left(0.254829592 + t_1 \cdot \left(-0.284496736 + t_1 \cdot \left(1.421413741 + \left(-1.453152027 + \frac{1.061405429}{t_0}\right) \cdot \frac{1}{1 + x \cdot 0.3275911}\right)\right)\right)\right) \cdot \frac{-1}{t_0}\\
\end{array}
\end{array}
if (fabs.f64 x) < 4.9999999999999997e-12Initial program 57.7%
Applied egg-rr57.7%
Simplified57.7%
Taylor expanded in x around 0 99.6%
Taylor expanded in x around 0 99.6%
*-commutative99.6%
Simplified99.6%
if 4.9999999999999997e-12 < (fabs.f64 x) Initial program 99.1%
associate-*l*99.1%
Simplified99.1%
pow199.1%
Applied egg-rr99.1%
unpow199.1%
*-commutative99.1%
unpow199.1%
sqr-pow54.5%
fabs-sqr54.5%
sqr-pow97.4%
unpow197.4%
Simplified97.4%
Final simplification98.5%
(FPCore (x)
:precision binary64
(let* ((t_0 (+ 1.0 (* (fabs x) 0.3275911))) (t_1 (/ 1.0 t_0)))
(if (<= (fabs x) 5e-12)
(/
(+ 1.999999999e-9 (* x 2.256772713883663))
(+
1.0
(/
(+
0.254829592
(/
(+
-0.284496736
(/ (+ 1.029667143 (* x -0.2193742730720041)) (fma x 0.3275911 1.0)))
(fma x 0.3275911 1.0)))
(* (fma x 0.3275911 1.0) (exp (* x x))))))
(+
1.0
(*
(*
(exp (* x (- x)))
(+
0.254829592
(*
t_1
(+
-0.284496736
(*
t_1
(+
1.421413741
(*
(+ -1.453152027 (/ 1.061405429 t_0))
(/ 1.0 (+ 1.0 (* x 0.3275911))))))))))
(/ -1.0 t_0))))))
double code(double x) {
double t_0 = 1.0 + (fabs(x) * 0.3275911);
double t_1 = 1.0 / t_0;
double tmp;
if (fabs(x) <= 5e-12) {
tmp = (1.999999999e-9 + (x * 2.256772713883663)) / (1.0 + ((0.254829592 + ((-0.284496736 + ((1.029667143 + (x * -0.2193742730720041)) / fma(x, 0.3275911, 1.0))) / fma(x, 0.3275911, 1.0))) / (fma(x, 0.3275911, 1.0) * exp((x * x)))));
} else {
tmp = 1.0 + ((exp((x * -x)) * (0.254829592 + (t_1 * (-0.284496736 + (t_1 * (1.421413741 + ((-1.453152027 + (1.061405429 / t_0)) * (1.0 / (1.0 + (x * 0.3275911)))))))))) * (-1.0 / t_0));
}
return tmp;
}
function code(x) t_0 = Float64(1.0 + Float64(abs(x) * 0.3275911)) t_1 = Float64(1.0 / t_0) tmp = 0.0 if (abs(x) <= 5e-12) tmp = Float64(Float64(1.999999999e-9 + Float64(x * 2.256772713883663)) / Float64(1.0 + Float64(Float64(0.254829592 + Float64(Float64(-0.284496736 + Float64(Float64(1.029667143 + Float64(x * -0.2193742730720041)) / fma(x, 0.3275911, 1.0))) / fma(x, 0.3275911, 1.0))) / Float64(fma(x, 0.3275911, 1.0) * exp(Float64(x * x)))))); else tmp = Float64(1.0 + Float64(Float64(exp(Float64(x * Float64(-x))) * Float64(0.254829592 + Float64(t_1 * Float64(-0.284496736 + Float64(t_1 * Float64(1.421413741 + Float64(Float64(-1.453152027 + Float64(1.061405429 / t_0)) * Float64(1.0 / Float64(1.0 + Float64(x * 0.3275911)))))))))) * Float64(-1.0 / t_0))); end return tmp end
code[x_] := Block[{t$95$0 = N[(1.0 + N[(N[Abs[x], $MachinePrecision] * 0.3275911), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(1.0 / t$95$0), $MachinePrecision]}, If[LessEqual[N[Abs[x], $MachinePrecision], 5e-12], N[(N[(1.999999999e-9 + N[(x * 2.256772713883663), $MachinePrecision]), $MachinePrecision] / N[(1.0 + N[(N[(0.254829592 + N[(N[(-0.284496736 + N[(N[(1.029667143 + N[(x * -0.2193742730720041), $MachinePrecision]), $MachinePrecision] / N[(x * 0.3275911 + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x * 0.3275911 + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[(x * 0.3275911 + 1.0), $MachinePrecision] * N[Exp[N[(x * x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(N[(N[Exp[N[(x * (-x)), $MachinePrecision]], $MachinePrecision] * N[(0.254829592 + N[(t$95$1 * N[(-0.284496736 + N[(t$95$1 * N[(1.421413741 + N[(N[(-1.453152027 + N[(1.061405429 / t$95$0), $MachinePrecision]), $MachinePrecision] * N[(1.0 / N[(1.0 + N[(x * 0.3275911), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(-1.0 / t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\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^{-12}:\\
\;\;\;\;\frac{1.999999999 \cdot 10^{-9} + x \cdot 2.256772713883663}{1 + \frac{0.254829592 + \frac{-0.284496736 + \frac{1.029667143 + x \cdot -0.2193742730720041}{\mathsf{fma}\left(x, 0.3275911, 1\right)}}{\mathsf{fma}\left(x, 0.3275911, 1\right)}}{\mathsf{fma}\left(x, 0.3275911, 1\right) \cdot e^{x \cdot x}}}\\
\mathbf{else}:\\
\;\;\;\;1 + \left(e^{x \cdot \left(-x\right)} \cdot \left(0.254829592 + t_1 \cdot \left(-0.284496736 + t_1 \cdot \left(1.421413741 + \left(-1.453152027 + \frac{1.061405429}{t_0}\right) \cdot \frac{1}{1 + x \cdot 0.3275911}\right)\right)\right)\right) \cdot \frac{-1}{t_0}\\
\end{array}
\end{array}
if (fabs.f64 x) < 4.9999999999999997e-12Initial program 57.7%
Applied egg-rr57.7%
Simplified57.7%
Taylor expanded in x around 0 99.6%
*-commutative99.6%
Simplified99.6%
Taylor expanded in x around 0 99.6%
*-commutative99.6%
Simplified99.6%
if 4.9999999999999997e-12 < (fabs.f64 x) Initial program 99.1%
associate-*l*99.1%
Simplified99.1%
pow199.1%
Applied egg-rr99.1%
unpow199.1%
*-commutative99.1%
unpow199.1%
sqr-pow54.5%
fabs-sqr54.5%
sqr-pow97.4%
unpow197.4%
Simplified97.4%
Final simplification98.4%
(FPCore (x)
:precision binary64
(let* ((t_0 (+ 1.0 (* (fabs x) 0.3275911)))
(t_1 (/ 1.0 t_0))
(t_2 (+ 1.0 (* x 0.3275911))))
(if (<= (fabs x) 5e-12)
(/
(+ 1.999999999e-9 (* x 2.256772713883663))
(+
1.0
(/
(+
0.254829592
(/
(+
-0.284496736
(/ (+ 1.029667143 (* x -0.2193742730720041)) (fma x 0.3275911 1.0)))
(fma x 0.3275911 1.0)))
(* (fma x 0.3275911 1.0) (exp (* x x))))))
(+
1.0
(*
(*
(exp (* x (- x)))
(+
0.254829592
(*
t_1
(+
-0.284496736
(*
t_1
(+
1.421413741
(* (/ 1.0 t_2) (+ -1.453152027 (/ 1.061405429 t_2)))))))))
(/ -1.0 t_0))))))
double code(double x) {
double t_0 = 1.0 + (fabs(x) * 0.3275911);
double t_1 = 1.0 / t_0;
double t_2 = 1.0 + (x * 0.3275911);
double tmp;
if (fabs(x) <= 5e-12) {
tmp = (1.999999999e-9 + (x * 2.256772713883663)) / (1.0 + ((0.254829592 + ((-0.284496736 + ((1.029667143 + (x * -0.2193742730720041)) / fma(x, 0.3275911, 1.0))) / fma(x, 0.3275911, 1.0))) / (fma(x, 0.3275911, 1.0) * exp((x * x)))));
} else {
tmp = 1.0 + ((exp((x * -x)) * (0.254829592 + (t_1 * (-0.284496736 + (t_1 * (1.421413741 + ((1.0 / t_2) * (-1.453152027 + (1.061405429 / t_2))))))))) * (-1.0 / t_0));
}
return tmp;
}
function code(x) t_0 = Float64(1.0 + Float64(abs(x) * 0.3275911)) t_1 = Float64(1.0 / t_0) t_2 = Float64(1.0 + Float64(x * 0.3275911)) tmp = 0.0 if (abs(x) <= 5e-12) tmp = Float64(Float64(1.999999999e-9 + Float64(x * 2.256772713883663)) / Float64(1.0 + Float64(Float64(0.254829592 + Float64(Float64(-0.284496736 + Float64(Float64(1.029667143 + Float64(x * -0.2193742730720041)) / fma(x, 0.3275911, 1.0))) / fma(x, 0.3275911, 1.0))) / Float64(fma(x, 0.3275911, 1.0) * exp(Float64(x * x)))))); else tmp = Float64(1.0 + Float64(Float64(exp(Float64(x * Float64(-x))) * Float64(0.254829592 + Float64(t_1 * Float64(-0.284496736 + Float64(t_1 * Float64(1.421413741 + Float64(Float64(1.0 / t_2) * Float64(-1.453152027 + Float64(1.061405429 / t_2))))))))) * Float64(-1.0 / t_0))); end return tmp end
code[x_] := Block[{t$95$0 = N[(1.0 + N[(N[Abs[x], $MachinePrecision] * 0.3275911), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(1.0 / t$95$0), $MachinePrecision]}, Block[{t$95$2 = N[(1.0 + N[(x * 0.3275911), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[Abs[x], $MachinePrecision], 5e-12], N[(N[(1.999999999e-9 + N[(x * 2.256772713883663), $MachinePrecision]), $MachinePrecision] / N[(1.0 + N[(N[(0.254829592 + N[(N[(-0.284496736 + N[(N[(1.029667143 + N[(x * -0.2193742730720041), $MachinePrecision]), $MachinePrecision] / N[(x * 0.3275911 + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x * 0.3275911 + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[(x * 0.3275911 + 1.0), $MachinePrecision] * N[Exp[N[(x * x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(N[(N[Exp[N[(x * (-x)), $MachinePrecision]], $MachinePrecision] * N[(0.254829592 + N[(t$95$1 * N[(-0.284496736 + N[(t$95$1 * N[(1.421413741 + N[(N[(1.0 / t$95$2), $MachinePrecision] * N[(-1.453152027 + N[(1.061405429 / t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(-1.0 / t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 1 + \left|x\right| \cdot 0.3275911\\
t_1 := \frac{1}{t_0}\\
t_2 := 1 + x \cdot 0.3275911\\
\mathbf{if}\;\left|x\right| \leq 5 \cdot 10^{-12}:\\
\;\;\;\;\frac{1.999999999 \cdot 10^{-9} + x \cdot 2.256772713883663}{1 + \frac{0.254829592 + \frac{-0.284496736 + \frac{1.029667143 + x \cdot -0.2193742730720041}{\mathsf{fma}\left(x, 0.3275911, 1\right)}}{\mathsf{fma}\left(x, 0.3275911, 1\right)}}{\mathsf{fma}\left(x, 0.3275911, 1\right) \cdot e^{x \cdot x}}}\\
\mathbf{else}:\\
\;\;\;\;1 + \left(e^{x \cdot \left(-x\right)} \cdot \left(0.254829592 + t_1 \cdot \left(-0.284496736 + t_1 \cdot \left(1.421413741 + \frac{1}{t_2} \cdot \left(-1.453152027 + \frac{1.061405429}{t_2}\right)\right)\right)\right)\right) \cdot \frac{-1}{t_0}\\
\end{array}
\end{array}
if (fabs.f64 x) < 4.9999999999999997e-12Initial program 57.7%
Applied egg-rr57.7%
Simplified57.7%
Taylor expanded in x around 0 99.6%
*-commutative99.6%
Simplified99.6%
Taylor expanded in x around 0 99.6%
*-commutative99.6%
Simplified99.6%
if 4.9999999999999997e-12 < (fabs.f64 x) Initial program 99.1%
associate-*l*99.1%
Simplified99.1%
pow199.1%
Applied egg-rr99.1%
unpow199.1%
*-commutative99.1%
unpow199.1%
sqr-pow54.5%
fabs-sqr54.5%
sqr-pow97.4%
unpow197.4%
Simplified97.4%
pow199.1%
Applied egg-rr97.4%
unpow199.1%
*-commutative99.1%
unpow199.1%
sqr-pow54.5%
fabs-sqr54.5%
sqr-pow97.4%
unpow197.4%
Simplified97.4%
Final simplification98.4%
(FPCore (x)
:precision binary64
(let* ((t_0 (/ 1.0 (+ 1.0 (* (fabs x) 0.3275911))))
(t_1 (+ 1.0 (* x 0.3275911))))
(if (<= (fabs x) 5e-12)
(/
(+ 1.999999999e-9 (* x 2.256772713883663))
(+
1.0
(/
(+
0.254829592
(/
(+
-0.284496736
(/ (+ 1.029667143 (* x -0.2193742730720041)) (fma x 0.3275911 1.0)))
(fma x 0.3275911 1.0)))
(* (fma x 0.3275911 1.0) (exp (* x x))))))
(+
1.0
(*
(*
(exp (* x (- x)))
(+
0.254829592
(*
t_0
(+
-0.284496736
(*
t_0
(+
1.421413741
(* (/ 1.0 t_1) (+ -1.453152027 (/ 1.061405429 t_1)))))))))
(/ -1.0 t_1))))))
double code(double x) {
double t_0 = 1.0 / (1.0 + (fabs(x) * 0.3275911));
double t_1 = 1.0 + (x * 0.3275911);
double tmp;
if (fabs(x) <= 5e-12) {
tmp = (1.999999999e-9 + (x * 2.256772713883663)) / (1.0 + ((0.254829592 + ((-0.284496736 + ((1.029667143 + (x * -0.2193742730720041)) / fma(x, 0.3275911, 1.0))) / fma(x, 0.3275911, 1.0))) / (fma(x, 0.3275911, 1.0) * exp((x * x)))));
} else {
tmp = 1.0 + ((exp((x * -x)) * (0.254829592 + (t_0 * (-0.284496736 + (t_0 * (1.421413741 + ((1.0 / t_1) * (-1.453152027 + (1.061405429 / t_1))))))))) * (-1.0 / t_1));
}
return tmp;
}
function code(x) t_0 = Float64(1.0 / Float64(1.0 + Float64(abs(x) * 0.3275911))) t_1 = Float64(1.0 + Float64(x * 0.3275911)) tmp = 0.0 if (abs(x) <= 5e-12) tmp = Float64(Float64(1.999999999e-9 + Float64(x * 2.256772713883663)) / Float64(1.0 + Float64(Float64(0.254829592 + Float64(Float64(-0.284496736 + Float64(Float64(1.029667143 + Float64(x * -0.2193742730720041)) / fma(x, 0.3275911, 1.0))) / fma(x, 0.3275911, 1.0))) / Float64(fma(x, 0.3275911, 1.0) * exp(Float64(x * x)))))); else tmp = Float64(1.0 + Float64(Float64(exp(Float64(x * Float64(-x))) * Float64(0.254829592 + Float64(t_0 * Float64(-0.284496736 + Float64(t_0 * Float64(1.421413741 + Float64(Float64(1.0 / t_1) * Float64(-1.453152027 + Float64(1.061405429 / t_1))))))))) * Float64(-1.0 / t_1))); end return tmp end
code[x_] := Block[{t$95$0 = N[(1.0 / N[(1.0 + N[(N[Abs[x], $MachinePrecision] * 0.3275911), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(1.0 + N[(x * 0.3275911), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[Abs[x], $MachinePrecision], 5e-12], N[(N[(1.999999999e-9 + N[(x * 2.256772713883663), $MachinePrecision]), $MachinePrecision] / N[(1.0 + N[(N[(0.254829592 + N[(N[(-0.284496736 + N[(N[(1.029667143 + N[(x * -0.2193742730720041), $MachinePrecision]), $MachinePrecision] / N[(x * 0.3275911 + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x * 0.3275911 + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[(x * 0.3275911 + 1.0), $MachinePrecision] * N[Exp[N[(x * x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(N[(N[Exp[N[(x * (-x)), $MachinePrecision]], $MachinePrecision] * N[(0.254829592 + N[(t$95$0 * N[(-0.284496736 + N[(t$95$0 * N[(1.421413741 + N[(N[(1.0 / t$95$1), $MachinePrecision] * N[(-1.453152027 + N[(1.061405429 / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(-1.0 / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{1}{1 + \left|x\right| \cdot 0.3275911}\\
t_1 := 1 + x \cdot 0.3275911\\
\mathbf{if}\;\left|x\right| \leq 5 \cdot 10^{-12}:\\
\;\;\;\;\frac{1.999999999 \cdot 10^{-9} + x \cdot 2.256772713883663}{1 + \frac{0.254829592 + \frac{-0.284496736 + \frac{1.029667143 + x \cdot -0.2193742730720041}{\mathsf{fma}\left(x, 0.3275911, 1\right)}}{\mathsf{fma}\left(x, 0.3275911, 1\right)}}{\mathsf{fma}\left(x, 0.3275911, 1\right) \cdot e^{x \cdot x}}}\\
\mathbf{else}:\\
\;\;\;\;1 + \left(e^{x \cdot \left(-x\right)} \cdot \left(0.254829592 + t_0 \cdot \left(-0.284496736 + t_0 \cdot \left(1.421413741 + \frac{1}{t_1} \cdot \left(-1.453152027 + \frac{1.061405429}{t_1}\right)\right)\right)\right)\right) \cdot \frac{-1}{t_1}\\
\end{array}
\end{array}
if (fabs.f64 x) < 4.9999999999999997e-12Initial program 57.7%
Applied egg-rr57.7%
Simplified57.7%
Taylor expanded in x around 0 99.6%
*-commutative99.6%
Simplified99.6%
Taylor expanded in x around 0 99.6%
*-commutative99.6%
Simplified99.6%
if 4.9999999999999997e-12 < (fabs.f64 x) Initial program 99.1%
associate-*l*99.1%
Simplified99.1%
pow199.1%
Applied egg-rr99.1%
unpow199.1%
*-commutative99.1%
unpow199.1%
sqr-pow54.5%
fabs-sqr54.5%
sqr-pow97.4%
unpow197.4%
Simplified97.4%
pow199.1%
Applied egg-rr97.4%
unpow199.1%
*-commutative99.1%
unpow199.1%
sqr-pow54.5%
fabs-sqr54.5%
sqr-pow97.4%
unpow197.4%
Simplified97.4%
pow199.1%
Applied egg-rr97.4%
unpow199.1%
*-commutative99.1%
unpow199.1%
sqr-pow54.5%
fabs-sqr54.5%
sqr-pow97.4%
unpow197.4%
Simplified97.3%
Final simplification98.4%
(FPCore (x)
:precision binary64
(let* ((t_0 (/ 1.0 (+ 1.0 (* (fabs x) 0.3275911))))
(t_1 (+ 1.0 (* x 0.3275911))))
(if (<= (fabs x) 5e-12)
(/
(+ 1.999999999e-9 (* x 2.256772713883663))
(+
1.0
(/
(+ 0.254829592 (+ 0.745170407 (* x -0.8007952583978091)))
(* (fma x 0.3275911 1.0) (exp (* x x))))))
(+
1.0
(*
(*
(exp (* x (- x)))
(+
0.254829592
(*
t_0
(+
-0.284496736
(*
t_0
(+
1.421413741
(* (/ 1.0 t_1) (+ -1.453152027 (/ 1.061405429 t_1)))))))))
(/ -1.0 t_1))))))
double code(double x) {
double t_0 = 1.0 / (1.0 + (fabs(x) * 0.3275911));
double t_1 = 1.0 + (x * 0.3275911);
double tmp;
if (fabs(x) <= 5e-12) {
tmp = (1.999999999e-9 + (x * 2.256772713883663)) / (1.0 + ((0.254829592 + (0.745170407 + (x * -0.8007952583978091))) / (fma(x, 0.3275911, 1.0) * exp((x * x)))));
} else {
tmp = 1.0 + ((exp((x * -x)) * (0.254829592 + (t_0 * (-0.284496736 + (t_0 * (1.421413741 + ((1.0 / t_1) * (-1.453152027 + (1.061405429 / t_1))))))))) * (-1.0 / t_1));
}
return tmp;
}
function code(x) t_0 = Float64(1.0 / Float64(1.0 + Float64(abs(x) * 0.3275911))) t_1 = Float64(1.0 + Float64(x * 0.3275911)) tmp = 0.0 if (abs(x) <= 5e-12) tmp = Float64(Float64(1.999999999e-9 + Float64(x * 2.256772713883663)) / Float64(1.0 + Float64(Float64(0.254829592 + Float64(0.745170407 + Float64(x * -0.8007952583978091))) / Float64(fma(x, 0.3275911, 1.0) * exp(Float64(x * x)))))); else tmp = Float64(1.0 + Float64(Float64(exp(Float64(x * Float64(-x))) * Float64(0.254829592 + Float64(t_0 * Float64(-0.284496736 + Float64(t_0 * Float64(1.421413741 + Float64(Float64(1.0 / t_1) * Float64(-1.453152027 + Float64(1.061405429 / t_1))))))))) * Float64(-1.0 / t_1))); end return tmp end
code[x_] := Block[{t$95$0 = N[(1.0 / N[(1.0 + N[(N[Abs[x], $MachinePrecision] * 0.3275911), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(1.0 + N[(x * 0.3275911), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[Abs[x], $MachinePrecision], 5e-12], N[(N[(1.999999999e-9 + N[(x * 2.256772713883663), $MachinePrecision]), $MachinePrecision] / N[(1.0 + N[(N[(0.254829592 + N[(0.745170407 + N[(x * -0.8007952583978091), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[(x * 0.3275911 + 1.0), $MachinePrecision] * N[Exp[N[(x * x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(N[(N[Exp[N[(x * (-x)), $MachinePrecision]], $MachinePrecision] * N[(0.254829592 + N[(t$95$0 * N[(-0.284496736 + N[(t$95$0 * N[(1.421413741 + N[(N[(1.0 / t$95$1), $MachinePrecision] * N[(-1.453152027 + N[(1.061405429 / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(-1.0 / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{1}{1 + \left|x\right| \cdot 0.3275911}\\
t_1 := 1 + x \cdot 0.3275911\\
\mathbf{if}\;\left|x\right| \leq 5 \cdot 10^{-12}:\\
\;\;\;\;\frac{1.999999999 \cdot 10^{-9} + x \cdot 2.256772713883663}{1 + \frac{0.254829592 + \left(0.745170407 + x \cdot -0.8007952583978091\right)}{\mathsf{fma}\left(x, 0.3275911, 1\right) \cdot e^{x \cdot x}}}\\
\mathbf{else}:\\
\;\;\;\;1 + \left(e^{x \cdot \left(-x\right)} \cdot \left(0.254829592 + t_0 \cdot \left(-0.284496736 + t_0 \cdot \left(1.421413741 + \frac{1}{t_1} \cdot \left(-1.453152027 + \frac{1.061405429}{t_1}\right)\right)\right)\right)\right) \cdot \frac{-1}{t_1}\\
\end{array}
\end{array}
if (fabs.f64 x) < 4.9999999999999997e-12Initial program 57.7%
Applied egg-rr57.7%
Simplified57.7%
Taylor expanded in x around 0 99.6%
*-commutative99.6%
Simplified99.6%
Taylor expanded in x around 0 99.6%
*-commutative99.6%
Simplified99.6%
if 4.9999999999999997e-12 < (fabs.f64 x) Initial program 99.1%
associate-*l*99.1%
Simplified99.1%
pow199.1%
Applied egg-rr99.1%
unpow199.1%
*-commutative99.1%
unpow199.1%
sqr-pow54.5%
fabs-sqr54.5%
sqr-pow97.4%
unpow197.4%
Simplified97.4%
pow199.1%
Applied egg-rr97.4%
unpow199.1%
*-commutative99.1%
unpow199.1%
sqr-pow54.5%
fabs-sqr54.5%
sqr-pow97.4%
unpow197.4%
Simplified97.4%
pow199.1%
Applied egg-rr97.4%
unpow199.1%
*-commutative99.1%
unpow199.1%
sqr-pow54.5%
fabs-sqr54.5%
sqr-pow97.4%
unpow197.4%
Simplified97.3%
Final simplification98.4%
(FPCore (x)
:precision binary64
(let* ((t_0 (exp (* x x))))
(if (<= (fabs x) 0.01)
(/
(+ 1.999999999e-9 (* x 2.256772713883663))
(+
1.0
(/
(+ 0.254829592 (+ 0.745170407 (* x -0.8007952583978091)))
(* (fma x 0.3275911 1.0) t_0))))
(- 1.0 (/ 0.254829592 (* t_0 (+ 1.0 (* (fabs x) 0.3275911))))))))
double code(double x) {
double t_0 = exp((x * x));
double tmp;
if (fabs(x) <= 0.01) {
tmp = (1.999999999e-9 + (x * 2.256772713883663)) / (1.0 + ((0.254829592 + (0.745170407 + (x * -0.8007952583978091))) / (fma(x, 0.3275911, 1.0) * t_0)));
} else {
tmp = 1.0 - (0.254829592 / (t_0 * (1.0 + (fabs(x) * 0.3275911))));
}
return tmp;
}
function code(x) t_0 = exp(Float64(x * x)) tmp = 0.0 if (abs(x) <= 0.01) tmp = Float64(Float64(1.999999999e-9 + Float64(x * 2.256772713883663)) / Float64(1.0 + Float64(Float64(0.254829592 + Float64(0.745170407 + Float64(x * -0.8007952583978091))) / Float64(fma(x, 0.3275911, 1.0) * t_0)))); else tmp = Float64(1.0 - Float64(0.254829592 / Float64(t_0 * Float64(1.0 + Float64(abs(x) * 0.3275911))))); end return tmp end
code[x_] := Block[{t$95$0 = N[Exp[N[(x * x), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[Abs[x], $MachinePrecision], 0.01], N[(N[(1.999999999e-9 + N[(x * 2.256772713883663), $MachinePrecision]), $MachinePrecision] / N[(1.0 + N[(N[(0.254829592 + N[(0.745170407 + N[(x * -0.8007952583978091), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[(x * 0.3275911 + 1.0), $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 - N[(0.254829592 / N[(t$95$0 * N[(1.0 + N[(N[Abs[x], $MachinePrecision] * 0.3275911), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := e^{x \cdot x}\\
\mathbf{if}\;\left|x\right| \leq 0.01:\\
\;\;\;\;\frac{1.999999999 \cdot 10^{-9} + x \cdot 2.256772713883663}{1 + \frac{0.254829592 + \left(0.745170407 + x \cdot -0.8007952583978091\right)}{\mathsf{fma}\left(x, 0.3275911, 1\right) \cdot t_0}}\\
\mathbf{else}:\\
\;\;\;\;1 - \frac{0.254829592}{t_0 \cdot \left(1 + \left|x\right| \cdot 0.3275911\right)}\\
\end{array}
\end{array}
if (fabs.f64 x) < 0.0100000000000000002Initial program 58.0%
Applied egg-rr58.1%
Simplified57.3%
Taylor expanded in x around 0 97.1%
*-commutative97.1%
Simplified97.1%
Taylor expanded in x around 0 97.1%
*-commutative97.1%
Simplified97.1%
if 0.0100000000000000002 < (fabs.f64 x) Initial program 100.0%
Simplified100.0%
Applied egg-rr100.0%
distribute-lft-in100.0%
fma-def100.0%
associate-*l/100.0%
Simplified98.6%
Taylor expanded in x around inf 98.8%
associate-*r/98.8%
metadata-eval98.8%
fma-def98.8%
unpow298.8%
Simplified98.8%
Taylor expanded in x around 0 98.8%
Final simplification98.0%
(FPCore (x)
:precision binary64
(let* ((t_0 (exp (* x x))))
(if (<= (fabs x) 0.01)
(/
(+ 1.999999999e-9 (* x 2.256772713883663))
(+ 1.0 (/ 0.999999999 (* (fma x 0.3275911 1.0) t_0))))
(- 1.0 (/ 0.254829592 (* t_0 (+ 1.0 (* (fabs x) 0.3275911))))))))
double code(double x) {
double t_0 = exp((x * x));
double tmp;
if (fabs(x) <= 0.01) {
tmp = (1.999999999e-9 + (x * 2.256772713883663)) / (1.0 + (0.999999999 / (fma(x, 0.3275911, 1.0) * t_0)));
} else {
tmp = 1.0 - (0.254829592 / (t_0 * (1.0 + (fabs(x) * 0.3275911))));
}
return tmp;
}
function code(x) t_0 = exp(Float64(x * x)) tmp = 0.0 if (abs(x) <= 0.01) tmp = Float64(Float64(1.999999999e-9 + Float64(x * 2.256772713883663)) / Float64(1.0 + Float64(0.999999999 / Float64(fma(x, 0.3275911, 1.0) * t_0)))); else tmp = Float64(1.0 - Float64(0.254829592 / Float64(t_0 * Float64(1.0 + Float64(abs(x) * 0.3275911))))); end return tmp end
code[x_] := Block[{t$95$0 = N[Exp[N[(x * x), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[Abs[x], $MachinePrecision], 0.01], N[(N[(1.999999999e-9 + N[(x * 2.256772713883663), $MachinePrecision]), $MachinePrecision] / N[(1.0 + N[(0.999999999 / N[(N[(x * 0.3275911 + 1.0), $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 - N[(0.254829592 / N[(t$95$0 * N[(1.0 + N[(N[Abs[x], $MachinePrecision] * 0.3275911), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := e^{x \cdot x}\\
\mathbf{if}\;\left|x\right| \leq 0.01:\\
\;\;\;\;\frac{1.999999999 \cdot 10^{-9} + x \cdot 2.256772713883663}{1 + \frac{0.999999999}{\mathsf{fma}\left(x, 0.3275911, 1\right) \cdot t_0}}\\
\mathbf{else}:\\
\;\;\;\;1 - \frac{0.254829592}{t_0 \cdot \left(1 + \left|x\right| \cdot 0.3275911\right)}\\
\end{array}
\end{array}
if (fabs.f64 x) < 0.0100000000000000002Initial program 58.0%
Applied egg-rr58.1%
Simplified57.3%
Taylor expanded in x around 0 97.1%
*-commutative97.1%
Simplified97.1%
Taylor expanded in x around 0 97.0%
if 0.0100000000000000002 < (fabs.f64 x) Initial program 100.0%
Simplified100.0%
Applied egg-rr100.0%
distribute-lft-in100.0%
fma-def100.0%
associate-*l/100.0%
Simplified98.6%
Taylor expanded in x around inf 98.8%
associate-*r/98.8%
metadata-eval98.8%
fma-def98.8%
unpow298.8%
Simplified98.8%
Taylor expanded in x around 0 98.8%
Final simplification97.9%
(FPCore (x) :precision binary64 (if (<= (fabs x) 1e-5) 1e-9 (- 1.0 (/ 0.254829592 (* (exp (* x x)) (+ 1.0 (* (fabs x) 0.3275911)))))))
double code(double x) {
double tmp;
if (fabs(x) <= 1e-5) {
tmp = 1e-9;
} else {
tmp = 1.0 - (0.254829592 / (exp((x * x)) * (1.0 + (fabs(x) * 0.3275911))));
}
return tmp;
}
real(8) function code(x)
real(8), intent (in) :: x
real(8) :: tmp
if (abs(x) <= 1d-5) then
tmp = 1d-9
else
tmp = 1.0d0 - (0.254829592d0 / (exp((x * x)) * (1.0d0 + (abs(x) * 0.3275911d0))))
end if
code = tmp
end function
public static double code(double x) {
double tmp;
if (Math.abs(x) <= 1e-5) {
tmp = 1e-9;
} else {
tmp = 1.0 - (0.254829592 / (Math.exp((x * x)) * (1.0 + (Math.abs(x) * 0.3275911))));
}
return tmp;
}
def code(x): tmp = 0 if math.fabs(x) <= 1e-5: tmp = 1e-9 else: tmp = 1.0 - (0.254829592 / (math.exp((x * x)) * (1.0 + (math.fabs(x) * 0.3275911)))) return tmp
function code(x) tmp = 0.0 if (abs(x) <= 1e-5) tmp = 1e-9; else tmp = Float64(1.0 - Float64(0.254829592 / Float64(exp(Float64(x * x)) * Float64(1.0 + Float64(abs(x) * 0.3275911))))); end return tmp end
function tmp_2 = code(x) tmp = 0.0; if (abs(x) <= 1e-5) tmp = 1e-9; else tmp = 1.0 - (0.254829592 / (exp((x * x)) * (1.0 + (abs(x) * 0.3275911)))); end tmp_2 = tmp; end
code[x_] := If[LessEqual[N[Abs[x], $MachinePrecision], 1e-5], 1e-9, N[(1.0 - N[(0.254829592 / N[(N[Exp[N[(x * x), $MachinePrecision]], $MachinePrecision] * N[(1.0 + N[(N[Abs[x], $MachinePrecision] * 0.3275911), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\left|x\right| \leq 10^{-5}:\\
\;\;\;\;10^{-9}\\
\mathbf{else}:\\
\;\;\;\;1 - \frac{0.254829592}{e^{x \cdot x} \cdot \left(1 + \left|x\right| \cdot 0.3275911\right)}\\
\end{array}
\end{array}
if (fabs.f64 x) < 1.00000000000000008e-5Initial program 57.8%
Simplified57.8%
Applied egg-rr57.8%
distribute-lft-in57.8%
fma-def57.8%
associate-*l/57.8%
Simplified57.0%
Taylor expanded in x around 0 54.1%
associate--l+53.0%
+-commutative53.0%
+-commutative53.0%
distribute-rgt-out--53.0%
+-commutative53.0%
fma-def53.0%
unpow153.0%
sqr-pow27.4%
fabs-sqr27.4%
sqr-pow52.8%
unpow152.8%
metadata-eval56.3%
Simplified56.3%
Taylor expanded in x around 0 96.4%
if 1.00000000000000008e-5 < (fabs.f64 x) Initial program 99.9%
Simplified99.9%
Applied egg-rr99.9%
distribute-lft-in99.9%
fma-def99.9%
associate-*l/99.9%
Simplified98.5%
Taylor expanded in x around inf 98.2%
associate-*r/98.2%
metadata-eval98.2%
fma-def98.2%
unpow298.2%
Simplified98.2%
Taylor expanded in x around 0 98.2%
Final simplification97.3%
(FPCore (x) :precision binary64 (if (<= (fabs x) 1e-5) 1e-9 1.0))
double code(double x) {
double tmp;
if (fabs(x) <= 1e-5) {
tmp = 1e-9;
} else {
tmp = 1.0;
}
return tmp;
}
real(8) function code(x)
real(8), intent (in) :: x
real(8) :: tmp
if (abs(x) <= 1d-5) then
tmp = 1d-9
else
tmp = 1.0d0
end if
code = tmp
end function
public static double code(double x) {
double tmp;
if (Math.abs(x) <= 1e-5) {
tmp = 1e-9;
} else {
tmp = 1.0;
}
return tmp;
}
def code(x): tmp = 0 if math.fabs(x) <= 1e-5: tmp = 1e-9 else: tmp = 1.0 return tmp
function code(x) tmp = 0.0 if (abs(x) <= 1e-5) tmp = 1e-9; else tmp = 1.0; end return tmp end
function tmp_2 = code(x) tmp = 0.0; if (abs(x) <= 1e-5) tmp = 1e-9; else tmp = 1.0; end tmp_2 = tmp; end
code[x_] := If[LessEqual[N[Abs[x], $MachinePrecision], 1e-5], 1e-9, 1.0]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\left|x\right| \leq 10^{-5}:\\
\;\;\;\;10^{-9}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if (fabs.f64 x) < 1.00000000000000008e-5Initial program 57.8%
Simplified57.8%
Applied egg-rr57.8%
distribute-lft-in57.8%
fma-def57.8%
associate-*l/57.8%
Simplified57.0%
Taylor expanded in x around 0 54.1%
associate--l+53.0%
+-commutative53.0%
+-commutative53.0%
distribute-rgt-out--53.0%
+-commutative53.0%
fma-def53.0%
unpow153.0%
sqr-pow27.4%
fabs-sqr27.4%
sqr-pow52.8%
unpow152.8%
metadata-eval56.3%
Simplified56.3%
Taylor expanded in x around 0 96.4%
if 1.00000000000000008e-5 < (fabs.f64 x) Initial program 99.9%
Simplified99.9%
Applied egg-rr99.9%
distribute-lft-in99.9%
fma-def99.9%
associate-*l/99.9%
Simplified98.5%
Taylor expanded in x around 0 95.2%
associate--l+95.2%
+-commutative95.2%
+-commutative95.2%
distribute-rgt-out--95.2%
+-commutative95.2%
fma-def95.2%
unpow195.2%
sqr-pow53.4%
fabs-sqr53.4%
sqr-pow95.0%
unpow195.0%
metadata-eval95.0%
Simplified95.0%
Taylor expanded in x around inf 98.2%
Final simplification97.3%
(FPCore (x) :precision binary64 1e-9)
double code(double x) {
return 1e-9;
}
real(8) function code(x)
real(8), intent (in) :: x
code = 1d-9
end function
public static double code(double x) {
return 1e-9;
}
def code(x): return 1e-9
function code(x) return 1e-9 end
function tmp = code(x) tmp = 1e-9; end
code[x_] := 1e-9
\begin{array}{l}
\\
10^{-9}
\end{array}
Initial program 79.5%
Simplified79.5%
Applied egg-rr79.5%
distribute-lft-in79.5%
fma-def79.5%
associate-*l/79.5%
Simplified78.4%
Taylor expanded in x around 0 75.3%
associate--l+74.8%
+-commutative74.8%
+-commutative74.8%
distribute-rgt-out--74.8%
+-commutative74.8%
fma-def74.8%
unpow174.8%
sqr-pow40.8%
fabs-sqr40.8%
sqr-pow74.6%
unpow174.6%
metadata-eval76.3%
Simplified76.3%
Taylor expanded in x around 0 52.4%
Final simplification52.4%
herbie shell --seed 2023196
(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)))))))