
(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 15 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 (+ 1.0 (* 0.3275911 (fabs x))))
(t_1
(+
-0.254829592
(/
(+
-0.284496736
(/
(+ 1.421413741 (/ (+ -1.453152027 (/ 1.061405429 t_0)) t_0))
t_0))
(+ -1.0 (* (fabs x) -0.3275911)))))
(t_2 (* t_0 (exp (* x x))))
(t_3 (/ t_1 t_2)))
(/
(+ 1.0 (/ 1.0 (/ (pow t_2 3.0) (pow t_1 3.0))))
(+
1.0
(/
(/ (+ -1.0 (pow t_3 6.0)) (+ (pow t_3 4.0) (+ 1.0 (pow t_3 2.0))))
(* (/ t_2 t_1) (+ 1.0 t_3)))))))
double code(double x) {
double t_0 = 1.0 + (0.3275911 * fabs(x));
double t_1 = -0.254829592 + ((-0.284496736 + ((1.421413741 + ((-1.453152027 + (1.061405429 / t_0)) / t_0)) / t_0)) / (-1.0 + (fabs(x) * -0.3275911)));
double t_2 = t_0 * exp((x * x));
double t_3 = t_1 / t_2;
return (1.0 + (1.0 / (pow(t_2, 3.0) / pow(t_1, 3.0)))) / (1.0 + (((-1.0 + pow(t_3, 6.0)) / (pow(t_3, 4.0) + (1.0 + pow(t_3, 2.0)))) / ((t_2 / t_1) * (1.0 + t_3))));
}
real(8) function code(x)
real(8), intent (in) :: x
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
t_0 = 1.0d0 + (0.3275911d0 * abs(x))
t_1 = (-0.254829592d0) + (((-0.284496736d0) + ((1.421413741d0 + (((-1.453152027d0) + (1.061405429d0 / t_0)) / t_0)) / t_0)) / ((-1.0d0) + (abs(x) * (-0.3275911d0))))
t_2 = t_0 * exp((x * x))
t_3 = t_1 / t_2
code = (1.0d0 + (1.0d0 / ((t_2 ** 3.0d0) / (t_1 ** 3.0d0)))) / (1.0d0 + ((((-1.0d0) + (t_3 ** 6.0d0)) / ((t_3 ** 4.0d0) + (1.0d0 + (t_3 ** 2.0d0)))) / ((t_2 / t_1) * (1.0d0 + t_3))))
end function
public static double code(double x) {
double t_0 = 1.0 + (0.3275911 * Math.abs(x));
double t_1 = -0.254829592 + ((-0.284496736 + ((1.421413741 + ((-1.453152027 + (1.061405429 / t_0)) / t_0)) / t_0)) / (-1.0 + (Math.abs(x) * -0.3275911)));
double t_2 = t_0 * Math.exp((x * x));
double t_3 = t_1 / t_2;
return (1.0 + (1.0 / (Math.pow(t_2, 3.0) / Math.pow(t_1, 3.0)))) / (1.0 + (((-1.0 + Math.pow(t_3, 6.0)) / (Math.pow(t_3, 4.0) + (1.0 + Math.pow(t_3, 2.0)))) / ((t_2 / t_1) * (1.0 + t_3))));
}
def code(x): t_0 = 1.0 + (0.3275911 * math.fabs(x)) t_1 = -0.254829592 + ((-0.284496736 + ((1.421413741 + ((-1.453152027 + (1.061405429 / t_0)) / t_0)) / t_0)) / (-1.0 + (math.fabs(x) * -0.3275911))) t_2 = t_0 * math.exp((x * x)) t_3 = t_1 / t_2 return (1.0 + (1.0 / (math.pow(t_2, 3.0) / math.pow(t_1, 3.0)))) / (1.0 + (((-1.0 + math.pow(t_3, 6.0)) / (math.pow(t_3, 4.0) + (1.0 + math.pow(t_3, 2.0)))) / ((t_2 / t_1) * (1.0 + t_3))))
function code(x) t_0 = Float64(1.0 + Float64(0.3275911 * abs(x))) t_1 = Float64(-0.254829592 + Float64(Float64(-0.284496736 + Float64(Float64(1.421413741 + Float64(Float64(-1.453152027 + Float64(1.061405429 / t_0)) / t_0)) / t_0)) / Float64(-1.0 + Float64(abs(x) * -0.3275911)))) t_2 = Float64(t_0 * exp(Float64(x * x))) t_3 = Float64(t_1 / t_2) return Float64(Float64(1.0 + Float64(1.0 / Float64((t_2 ^ 3.0) / (t_1 ^ 3.0)))) / Float64(1.0 + Float64(Float64(Float64(-1.0 + (t_3 ^ 6.0)) / Float64((t_3 ^ 4.0) + Float64(1.0 + (t_3 ^ 2.0)))) / Float64(Float64(t_2 / t_1) * Float64(1.0 + t_3))))) end
function tmp = code(x) t_0 = 1.0 + (0.3275911 * abs(x)); t_1 = -0.254829592 + ((-0.284496736 + ((1.421413741 + ((-1.453152027 + (1.061405429 / t_0)) / t_0)) / t_0)) / (-1.0 + (abs(x) * -0.3275911))); t_2 = t_0 * exp((x * x)); t_3 = t_1 / t_2; tmp = (1.0 + (1.0 / ((t_2 ^ 3.0) / (t_1 ^ 3.0)))) / (1.0 + (((-1.0 + (t_3 ^ 6.0)) / ((t_3 ^ 4.0) + (1.0 + (t_3 ^ 2.0)))) / ((t_2 / t_1) * (1.0 + t_3)))); end
code[x_] := Block[{t$95$0 = N[(1.0 + N[(0.3275911 * N[Abs[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(-0.254829592 + 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] / N[(-1.0 + N[(N[Abs[x], $MachinePrecision] * -0.3275911), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t$95$0 * N[Exp[N[(x * x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(t$95$1 / t$95$2), $MachinePrecision]}, N[(N[(1.0 + N[(1.0 / N[(N[Power[t$95$2, 3.0], $MachinePrecision] / N[Power[t$95$1, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(1.0 + N[(N[(N[(-1.0 + N[Power[t$95$3, 6.0], $MachinePrecision]), $MachinePrecision] / N[(N[Power[t$95$3, 4.0], $MachinePrecision] + N[(1.0 + N[Power[t$95$3, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[(t$95$2 / t$95$1), $MachinePrecision] * N[(1.0 + t$95$3), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 1 + 0.3275911 \cdot \left|x\right|\\
t_1 := -0.254829592 + \frac{-0.284496736 + \frac{1.421413741 + \frac{-1.453152027 + \frac{1.061405429}{t\_0}}{t\_0}}{t\_0}}{-1 + \left|x\right| \cdot -0.3275911}\\
t_2 := t\_0 \cdot e^{x \cdot x}\\
t_3 := \frac{t\_1}{t\_2}\\
\frac{1 + \frac{1}{\frac{{t\_2}^{3}}{{t\_1}^{3}}}}{1 + \frac{\frac{-1 + {t\_3}^{6}}{{t\_3}^{4} + \left(1 + {t\_3}^{2}\right)}}{\frac{t\_2}{t\_1} \cdot \left(1 + t\_3\right)}}
\end{array}
\end{array}
Initial program 78.2%
Simplified78.2%
Applied egg-rr78.2%
cube-divN/A
clear-numN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
Applied egg-rr79.4%
Applied egg-rr79.4%
Applied egg-rr79.6%
Final simplification79.6%
(FPCore (x)
:precision binary64
(let* ((t_0 (* 0.3275911 (fabs x)))
(t_1 (+ 1.0 t_0))
(t_2 (* t_1 (exp (* x x))))
(t_3 (+ -1.0 (* (fabs x) -0.3275911)))
(t_4
(+
-0.254829592
(/
(+
-0.284496736
(/
(+ 1.421413741 (/ (+ -1.453152027 (/ 1.061405429 t_1)) t_1))
t_1))
t_3)))
(t_5 (/ t_4 t_2)))
(/
(+ 1.0 (/ 1.0 (/ (pow t_2 3.0) (pow t_4 3.0))))
(+
1.0
(/
(+ -1.0 (pow t_5 2.0))
(*
(+ 1.0 t_5)
(/
t_2
(+
-0.254829592
(/
(+
-0.284496736
(/
(+
1.421413741
(/
(/
(+ -3.0685496600615605 (/ 1.1957597040827899 (pow t_1 3.0)))
(+
(/ 1.126581484710674 (pow t_1 2.0))
(+ 2.111650813574209 (/ -1.5423834506201546 (- -1.0 t_0)))))
t_1))
t_1))
t_3)))))))))
double code(double x) {
double t_0 = 0.3275911 * fabs(x);
double t_1 = 1.0 + t_0;
double t_2 = t_1 * exp((x * x));
double t_3 = -1.0 + (fabs(x) * -0.3275911);
double t_4 = -0.254829592 + ((-0.284496736 + ((1.421413741 + ((-1.453152027 + (1.061405429 / t_1)) / t_1)) / t_1)) / t_3);
double t_5 = t_4 / t_2;
return (1.0 + (1.0 / (pow(t_2, 3.0) / pow(t_4, 3.0)))) / (1.0 + ((-1.0 + pow(t_5, 2.0)) / ((1.0 + t_5) * (t_2 / (-0.254829592 + ((-0.284496736 + ((1.421413741 + (((-3.0685496600615605 + (1.1957597040827899 / pow(t_1, 3.0))) / ((1.126581484710674 / pow(t_1, 2.0)) + (2.111650813574209 + (-1.5423834506201546 / (-1.0 - t_0))))) / t_1)) / t_1)) / t_3))))));
}
real(8) function code(x)
real(8), intent (in) :: x
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: t_5
t_0 = 0.3275911d0 * abs(x)
t_1 = 1.0d0 + t_0
t_2 = t_1 * exp((x * x))
t_3 = (-1.0d0) + (abs(x) * (-0.3275911d0))
t_4 = (-0.254829592d0) + (((-0.284496736d0) + ((1.421413741d0 + (((-1.453152027d0) + (1.061405429d0 / t_1)) / t_1)) / t_1)) / t_3)
t_5 = t_4 / t_2
code = (1.0d0 + (1.0d0 / ((t_2 ** 3.0d0) / (t_4 ** 3.0d0)))) / (1.0d0 + (((-1.0d0) + (t_5 ** 2.0d0)) / ((1.0d0 + t_5) * (t_2 / ((-0.254829592d0) + (((-0.284496736d0) + ((1.421413741d0 + ((((-3.0685496600615605d0) + (1.1957597040827899d0 / (t_1 ** 3.0d0))) / ((1.126581484710674d0 / (t_1 ** 2.0d0)) + (2.111650813574209d0 + ((-1.5423834506201546d0) / ((-1.0d0) - t_0))))) / t_1)) / t_1)) / t_3))))))
end function
public static double code(double x) {
double t_0 = 0.3275911 * Math.abs(x);
double t_1 = 1.0 + t_0;
double t_2 = t_1 * Math.exp((x * x));
double t_3 = -1.0 + (Math.abs(x) * -0.3275911);
double t_4 = -0.254829592 + ((-0.284496736 + ((1.421413741 + ((-1.453152027 + (1.061405429 / t_1)) / t_1)) / t_1)) / t_3);
double t_5 = t_4 / t_2;
return (1.0 + (1.0 / (Math.pow(t_2, 3.0) / Math.pow(t_4, 3.0)))) / (1.0 + ((-1.0 + Math.pow(t_5, 2.0)) / ((1.0 + t_5) * (t_2 / (-0.254829592 + ((-0.284496736 + ((1.421413741 + (((-3.0685496600615605 + (1.1957597040827899 / Math.pow(t_1, 3.0))) / ((1.126581484710674 / Math.pow(t_1, 2.0)) + (2.111650813574209 + (-1.5423834506201546 / (-1.0 - t_0))))) / t_1)) / t_1)) / t_3))))));
}
def code(x): t_0 = 0.3275911 * math.fabs(x) t_1 = 1.0 + t_0 t_2 = t_1 * math.exp((x * x)) t_3 = -1.0 + (math.fabs(x) * -0.3275911) t_4 = -0.254829592 + ((-0.284496736 + ((1.421413741 + ((-1.453152027 + (1.061405429 / t_1)) / t_1)) / t_1)) / t_3) t_5 = t_4 / t_2 return (1.0 + (1.0 / (math.pow(t_2, 3.0) / math.pow(t_4, 3.0)))) / (1.0 + ((-1.0 + math.pow(t_5, 2.0)) / ((1.0 + t_5) * (t_2 / (-0.254829592 + ((-0.284496736 + ((1.421413741 + (((-3.0685496600615605 + (1.1957597040827899 / math.pow(t_1, 3.0))) / ((1.126581484710674 / math.pow(t_1, 2.0)) + (2.111650813574209 + (-1.5423834506201546 / (-1.0 - t_0))))) / t_1)) / t_1)) / t_3))))))
function code(x) t_0 = Float64(0.3275911 * abs(x)) t_1 = Float64(1.0 + t_0) t_2 = Float64(t_1 * exp(Float64(x * x))) t_3 = Float64(-1.0 + Float64(abs(x) * -0.3275911)) t_4 = Float64(-0.254829592 + Float64(Float64(-0.284496736 + Float64(Float64(1.421413741 + Float64(Float64(-1.453152027 + Float64(1.061405429 / t_1)) / t_1)) / t_1)) / t_3)) t_5 = Float64(t_4 / t_2) return Float64(Float64(1.0 + Float64(1.0 / Float64((t_2 ^ 3.0) / (t_4 ^ 3.0)))) / Float64(1.0 + Float64(Float64(-1.0 + (t_5 ^ 2.0)) / Float64(Float64(1.0 + t_5) * Float64(t_2 / Float64(-0.254829592 + Float64(Float64(-0.284496736 + Float64(Float64(1.421413741 + Float64(Float64(Float64(-3.0685496600615605 + Float64(1.1957597040827899 / (t_1 ^ 3.0))) / Float64(Float64(1.126581484710674 / (t_1 ^ 2.0)) + Float64(2.111650813574209 + Float64(-1.5423834506201546 / Float64(-1.0 - t_0))))) / t_1)) / t_1)) / t_3))))))) end
function tmp = code(x) t_0 = 0.3275911 * abs(x); t_1 = 1.0 + t_0; t_2 = t_1 * exp((x * x)); t_3 = -1.0 + (abs(x) * -0.3275911); t_4 = -0.254829592 + ((-0.284496736 + ((1.421413741 + ((-1.453152027 + (1.061405429 / t_1)) / t_1)) / t_1)) / t_3); t_5 = t_4 / t_2; tmp = (1.0 + (1.0 / ((t_2 ^ 3.0) / (t_4 ^ 3.0)))) / (1.0 + ((-1.0 + (t_5 ^ 2.0)) / ((1.0 + t_5) * (t_2 / (-0.254829592 + ((-0.284496736 + ((1.421413741 + (((-3.0685496600615605 + (1.1957597040827899 / (t_1 ^ 3.0))) / ((1.126581484710674 / (t_1 ^ 2.0)) + (2.111650813574209 + (-1.5423834506201546 / (-1.0 - t_0))))) / t_1)) / t_1)) / t_3)))))); end
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[(t$95$1 * N[Exp[N[(x * x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(-1.0 + N[(N[Abs[x], $MachinePrecision] * -0.3275911), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(-0.254829592 + N[(N[(-0.284496736 + N[(N[(1.421413741 + N[(N[(-1.453152027 + N[(1.061405429 / t$95$1), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision] / t$95$3), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$5 = N[(t$95$4 / t$95$2), $MachinePrecision]}, N[(N[(1.0 + N[(1.0 / N[(N[Power[t$95$2, 3.0], $MachinePrecision] / N[Power[t$95$4, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(1.0 + N[(N[(-1.0 + N[Power[t$95$5, 2.0], $MachinePrecision]), $MachinePrecision] / N[(N[(1.0 + t$95$5), $MachinePrecision] * N[(t$95$2 / N[(-0.254829592 + N[(N[(-0.284496736 + N[(N[(1.421413741 + N[(N[(N[(-3.0685496600615605 + N[(1.1957597040827899 / N[Power[t$95$1, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[(1.126581484710674 / N[Power[t$95$1, 2.0], $MachinePrecision]), $MachinePrecision] + N[(2.111650813574209 + N[(-1.5423834506201546 / N[(-1.0 - t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision] / t$95$3), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 0.3275911 \cdot \left|x\right|\\
t_1 := 1 + t\_0\\
t_2 := t\_1 \cdot e^{x \cdot x}\\
t_3 := -1 + \left|x\right| \cdot -0.3275911\\
t_4 := -0.254829592 + \frac{-0.284496736 + \frac{1.421413741 + \frac{-1.453152027 + \frac{1.061405429}{t\_1}}{t\_1}}{t\_1}}{t\_3}\\
t_5 := \frac{t\_4}{t\_2}\\
\frac{1 + \frac{1}{\frac{{t\_2}^{3}}{{t\_4}^{3}}}}{1 + \frac{-1 + {t\_5}^{2}}{\left(1 + t\_5\right) \cdot \frac{t\_2}{-0.254829592 + \frac{-0.284496736 + \frac{1.421413741 + \frac{\frac{-3.0685496600615605 + \frac{1.1957597040827899}{{t\_1}^{3}}}{\frac{1.126581484710674}{{t\_1}^{2}} + \left(2.111650813574209 + \frac{-1.5423834506201546}{-1 - t\_0}\right)}}{t\_1}}{t\_1}}{t\_3}}}}
\end{array}
\end{array}
Initial program 78.2%
Simplified78.2%
Applied egg-rr78.2%
cube-divN/A
clear-numN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
Applied egg-rr79.4%
Applied egg-rr79.4%
+-commutativeN/A
flip3-+N/A
+-commutativeN/A
/-lowering-/.f64N/A
Applied egg-rr79.4%
Final simplification79.4%
(FPCore (x)
:precision binary64
(let* ((t_0 (+ 1.0 (* 0.3275911 (fabs x))))
(t_1
(+
-0.254829592
(/
(+
-0.284496736
(/
(+ 1.421413741 (/ (+ -1.453152027 (/ 1.061405429 t_0)) t_0))
t_0))
(+ -1.0 (* (fabs x) -0.3275911)))))
(t_2 (* t_0 (exp (* x x))))
(t_3 (/ t_1 t_2)))
(/
(+ 1.0 (/ 1.0 (/ (pow t_2 3.0) (pow t_1 3.0))))
(+ 1.0 (/ (+ -1.0 (pow t_3 2.0)) (* (/ t_2 t_1) (+ 1.0 t_3)))))))
double code(double x) {
double t_0 = 1.0 + (0.3275911 * fabs(x));
double t_1 = -0.254829592 + ((-0.284496736 + ((1.421413741 + ((-1.453152027 + (1.061405429 / t_0)) / t_0)) / t_0)) / (-1.0 + (fabs(x) * -0.3275911)));
double t_2 = t_0 * exp((x * x));
double t_3 = t_1 / t_2;
return (1.0 + (1.0 / (pow(t_2, 3.0) / pow(t_1, 3.0)))) / (1.0 + ((-1.0 + pow(t_3, 2.0)) / ((t_2 / t_1) * (1.0 + t_3))));
}
real(8) function code(x)
real(8), intent (in) :: x
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
t_0 = 1.0d0 + (0.3275911d0 * abs(x))
t_1 = (-0.254829592d0) + (((-0.284496736d0) + ((1.421413741d0 + (((-1.453152027d0) + (1.061405429d0 / t_0)) / t_0)) / t_0)) / ((-1.0d0) + (abs(x) * (-0.3275911d0))))
t_2 = t_0 * exp((x * x))
t_3 = t_1 / t_2
code = (1.0d0 + (1.0d0 / ((t_2 ** 3.0d0) / (t_1 ** 3.0d0)))) / (1.0d0 + (((-1.0d0) + (t_3 ** 2.0d0)) / ((t_2 / t_1) * (1.0d0 + t_3))))
end function
public static double code(double x) {
double t_0 = 1.0 + (0.3275911 * Math.abs(x));
double t_1 = -0.254829592 + ((-0.284496736 + ((1.421413741 + ((-1.453152027 + (1.061405429 / t_0)) / t_0)) / t_0)) / (-1.0 + (Math.abs(x) * -0.3275911)));
double t_2 = t_0 * Math.exp((x * x));
double t_3 = t_1 / t_2;
return (1.0 + (1.0 / (Math.pow(t_2, 3.0) / Math.pow(t_1, 3.0)))) / (1.0 + ((-1.0 + Math.pow(t_3, 2.0)) / ((t_2 / t_1) * (1.0 + t_3))));
}
def code(x): t_0 = 1.0 + (0.3275911 * math.fabs(x)) t_1 = -0.254829592 + ((-0.284496736 + ((1.421413741 + ((-1.453152027 + (1.061405429 / t_0)) / t_0)) / t_0)) / (-1.0 + (math.fabs(x) * -0.3275911))) t_2 = t_0 * math.exp((x * x)) t_3 = t_1 / t_2 return (1.0 + (1.0 / (math.pow(t_2, 3.0) / math.pow(t_1, 3.0)))) / (1.0 + ((-1.0 + math.pow(t_3, 2.0)) / ((t_2 / t_1) * (1.0 + t_3))))
function code(x) t_0 = Float64(1.0 + Float64(0.3275911 * abs(x))) t_1 = Float64(-0.254829592 + Float64(Float64(-0.284496736 + Float64(Float64(1.421413741 + Float64(Float64(-1.453152027 + Float64(1.061405429 / t_0)) / t_0)) / t_0)) / Float64(-1.0 + Float64(abs(x) * -0.3275911)))) t_2 = Float64(t_0 * exp(Float64(x * x))) t_3 = Float64(t_1 / t_2) return Float64(Float64(1.0 + Float64(1.0 / Float64((t_2 ^ 3.0) / (t_1 ^ 3.0)))) / Float64(1.0 + Float64(Float64(-1.0 + (t_3 ^ 2.0)) / Float64(Float64(t_2 / t_1) * Float64(1.0 + t_3))))) end
function tmp = code(x) t_0 = 1.0 + (0.3275911 * abs(x)); t_1 = -0.254829592 + ((-0.284496736 + ((1.421413741 + ((-1.453152027 + (1.061405429 / t_0)) / t_0)) / t_0)) / (-1.0 + (abs(x) * -0.3275911))); t_2 = t_0 * exp((x * x)); t_3 = t_1 / t_2; tmp = (1.0 + (1.0 / ((t_2 ^ 3.0) / (t_1 ^ 3.0)))) / (1.0 + ((-1.0 + (t_3 ^ 2.0)) / ((t_2 / t_1) * (1.0 + t_3)))); end
code[x_] := Block[{t$95$0 = N[(1.0 + N[(0.3275911 * N[Abs[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(-0.254829592 + 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] / N[(-1.0 + N[(N[Abs[x], $MachinePrecision] * -0.3275911), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t$95$0 * N[Exp[N[(x * x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(t$95$1 / t$95$2), $MachinePrecision]}, N[(N[(1.0 + N[(1.0 / N[(N[Power[t$95$2, 3.0], $MachinePrecision] / N[Power[t$95$1, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(1.0 + N[(N[(-1.0 + N[Power[t$95$3, 2.0], $MachinePrecision]), $MachinePrecision] / N[(N[(t$95$2 / t$95$1), $MachinePrecision] * N[(1.0 + t$95$3), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 1 + 0.3275911 \cdot \left|x\right|\\
t_1 := -0.254829592 + \frac{-0.284496736 + \frac{1.421413741 + \frac{-1.453152027 + \frac{1.061405429}{t\_0}}{t\_0}}{t\_0}}{-1 + \left|x\right| \cdot -0.3275911}\\
t_2 := t\_0 \cdot e^{x \cdot x}\\
t_3 := \frac{t\_1}{t\_2}\\
\frac{1 + \frac{1}{\frac{{t\_2}^{3}}{{t\_1}^{3}}}}{1 + \frac{-1 + {t\_3}^{2}}{\frac{t\_2}{t\_1} \cdot \left(1 + t\_3\right)}}
\end{array}
\end{array}
Initial program 78.2%
Simplified78.2%
Applied egg-rr78.2%
cube-divN/A
clear-numN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
Applied egg-rr79.4%
Applied egg-rr79.4%
Final simplification79.4%
(FPCore (x)
:precision binary64
(let* ((t_0 (+ 1.0 (* 0.3275911 (fabs x))))
(t_1
(+
-0.254829592
(/
(+
-0.284496736
(/
(+ 1.421413741 (/ (+ -1.453152027 (/ 1.061405429 t_0)) t_0))
t_0))
(+ -1.0 (* (fabs x) -0.3275911)))))
(t_2 (* t_0 (exp (* x x)))))
(/
(+ 1.0 (/ 1.0 (/ (pow t_2 3.0) (pow t_1 3.0))))
(+ 1.0 (/ (+ -1.0 (/ t_1 t_2)) (/ t_2 t_1))))))
double code(double x) {
double t_0 = 1.0 + (0.3275911 * fabs(x));
double t_1 = -0.254829592 + ((-0.284496736 + ((1.421413741 + ((-1.453152027 + (1.061405429 / t_0)) / t_0)) / t_0)) / (-1.0 + (fabs(x) * -0.3275911)));
double t_2 = t_0 * exp((x * x));
return (1.0 + (1.0 / (pow(t_2, 3.0) / pow(t_1, 3.0)))) / (1.0 + ((-1.0 + (t_1 / t_2)) / (t_2 / t_1)));
}
real(8) function code(x)
real(8), intent (in) :: x
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
t_0 = 1.0d0 + (0.3275911d0 * abs(x))
t_1 = (-0.254829592d0) + (((-0.284496736d0) + ((1.421413741d0 + (((-1.453152027d0) + (1.061405429d0 / t_0)) / t_0)) / t_0)) / ((-1.0d0) + (abs(x) * (-0.3275911d0))))
t_2 = t_0 * exp((x * x))
code = (1.0d0 + (1.0d0 / ((t_2 ** 3.0d0) / (t_1 ** 3.0d0)))) / (1.0d0 + (((-1.0d0) + (t_1 / t_2)) / (t_2 / t_1)))
end function
public static double code(double x) {
double t_0 = 1.0 + (0.3275911 * Math.abs(x));
double t_1 = -0.254829592 + ((-0.284496736 + ((1.421413741 + ((-1.453152027 + (1.061405429 / t_0)) / t_0)) / t_0)) / (-1.0 + (Math.abs(x) * -0.3275911)));
double t_2 = t_0 * Math.exp((x * x));
return (1.0 + (1.0 / (Math.pow(t_2, 3.0) / Math.pow(t_1, 3.0)))) / (1.0 + ((-1.0 + (t_1 / t_2)) / (t_2 / t_1)));
}
def code(x): t_0 = 1.0 + (0.3275911 * math.fabs(x)) t_1 = -0.254829592 + ((-0.284496736 + ((1.421413741 + ((-1.453152027 + (1.061405429 / t_0)) / t_0)) / t_0)) / (-1.0 + (math.fabs(x) * -0.3275911))) t_2 = t_0 * math.exp((x * x)) return (1.0 + (1.0 / (math.pow(t_2, 3.0) / math.pow(t_1, 3.0)))) / (1.0 + ((-1.0 + (t_1 / t_2)) / (t_2 / t_1)))
function code(x) t_0 = Float64(1.0 + Float64(0.3275911 * abs(x))) t_1 = Float64(-0.254829592 + Float64(Float64(-0.284496736 + Float64(Float64(1.421413741 + Float64(Float64(-1.453152027 + Float64(1.061405429 / t_0)) / t_0)) / t_0)) / Float64(-1.0 + Float64(abs(x) * -0.3275911)))) t_2 = Float64(t_0 * exp(Float64(x * x))) return Float64(Float64(1.0 + Float64(1.0 / Float64((t_2 ^ 3.0) / (t_1 ^ 3.0)))) / Float64(1.0 + Float64(Float64(-1.0 + Float64(t_1 / t_2)) / Float64(t_2 / t_1)))) end
function tmp = code(x) t_0 = 1.0 + (0.3275911 * abs(x)); t_1 = -0.254829592 + ((-0.284496736 + ((1.421413741 + ((-1.453152027 + (1.061405429 / t_0)) / t_0)) / t_0)) / (-1.0 + (abs(x) * -0.3275911))); t_2 = t_0 * exp((x * x)); tmp = (1.0 + (1.0 / ((t_2 ^ 3.0) / (t_1 ^ 3.0)))) / (1.0 + ((-1.0 + (t_1 / t_2)) / (t_2 / t_1))); end
code[x_] := Block[{t$95$0 = N[(1.0 + N[(0.3275911 * N[Abs[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(-0.254829592 + 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] / N[(-1.0 + N[(N[Abs[x], $MachinePrecision] * -0.3275911), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t$95$0 * N[Exp[N[(x * x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, N[(N[(1.0 + N[(1.0 / N[(N[Power[t$95$2, 3.0], $MachinePrecision] / N[Power[t$95$1, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(1.0 + N[(N[(-1.0 + N[(t$95$1 / t$95$2), $MachinePrecision]), $MachinePrecision] / N[(t$95$2 / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 1 + 0.3275911 \cdot \left|x\right|\\
t_1 := -0.254829592 + \frac{-0.284496736 + \frac{1.421413741 + \frac{-1.453152027 + \frac{1.061405429}{t\_0}}{t\_0}}{t\_0}}{-1 + \left|x\right| \cdot -0.3275911}\\
t_2 := t\_0 \cdot e^{x \cdot x}\\
\frac{1 + \frac{1}{\frac{{t\_2}^{3}}{{t\_1}^{3}}}}{1 + \frac{-1 + \frac{t\_1}{t\_2}}{\frac{t\_2}{t\_1}}}
\end{array}
\end{array}
Initial program 78.2%
Simplified78.2%
Applied egg-rr78.2%
cube-divN/A
clear-numN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
Applied egg-rr79.4%
Final simplification79.4%
(FPCore (x)
:precision binary64
(let* ((t_0 (+ 1.0 (* 0.3275911 (fabs x))))
(t_1 (* t_0 (exp (* x x))))
(t_2
(+
-0.254829592
(/
(+
-0.284496736
(/
(+ 1.421413741 (/ (+ -1.453152027 (/ 1.061405429 t_0)) t_0))
t_0))
(+ -1.0 (* (fabs x) -0.3275911))))))
(/
(+ 1.0 (/ (pow t_0 -3.0) (pow t_2 -3.0)))
(+ 1.0 (/ (+ -1.0 (/ t_2 t_1)) (/ t_1 t_2))))))
double code(double x) {
double t_0 = 1.0 + (0.3275911 * fabs(x));
double t_1 = t_0 * exp((x * x));
double t_2 = -0.254829592 + ((-0.284496736 + ((1.421413741 + ((-1.453152027 + (1.061405429 / t_0)) / t_0)) / t_0)) / (-1.0 + (fabs(x) * -0.3275911)));
return (1.0 + (pow(t_0, -3.0) / pow(t_2, -3.0))) / (1.0 + ((-1.0 + (t_2 / t_1)) / (t_1 / t_2)));
}
real(8) function code(x)
real(8), intent (in) :: x
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
t_0 = 1.0d0 + (0.3275911d0 * abs(x))
t_1 = t_0 * exp((x * x))
t_2 = (-0.254829592d0) + (((-0.284496736d0) + ((1.421413741d0 + (((-1.453152027d0) + (1.061405429d0 / t_0)) / t_0)) / t_0)) / ((-1.0d0) + (abs(x) * (-0.3275911d0))))
code = (1.0d0 + ((t_0 ** (-3.0d0)) / (t_2 ** (-3.0d0)))) / (1.0d0 + (((-1.0d0) + (t_2 / t_1)) / (t_1 / t_2)))
end function
public static double code(double x) {
double t_0 = 1.0 + (0.3275911 * Math.abs(x));
double t_1 = t_0 * Math.exp((x * x));
double t_2 = -0.254829592 + ((-0.284496736 + ((1.421413741 + ((-1.453152027 + (1.061405429 / t_0)) / t_0)) / t_0)) / (-1.0 + (Math.abs(x) * -0.3275911)));
return (1.0 + (Math.pow(t_0, -3.0) / Math.pow(t_2, -3.0))) / (1.0 + ((-1.0 + (t_2 / t_1)) / (t_1 / t_2)));
}
def code(x): t_0 = 1.0 + (0.3275911 * math.fabs(x)) t_1 = t_0 * math.exp((x * x)) t_2 = -0.254829592 + ((-0.284496736 + ((1.421413741 + ((-1.453152027 + (1.061405429 / t_0)) / t_0)) / t_0)) / (-1.0 + (math.fabs(x) * -0.3275911))) return (1.0 + (math.pow(t_0, -3.0) / math.pow(t_2, -3.0))) / (1.0 + ((-1.0 + (t_2 / t_1)) / (t_1 / t_2)))
function code(x) t_0 = Float64(1.0 + Float64(0.3275911 * abs(x))) t_1 = Float64(t_0 * exp(Float64(x * x))) t_2 = Float64(-0.254829592 + Float64(Float64(-0.284496736 + Float64(Float64(1.421413741 + Float64(Float64(-1.453152027 + Float64(1.061405429 / t_0)) / t_0)) / t_0)) / Float64(-1.0 + Float64(abs(x) * -0.3275911)))) return Float64(Float64(1.0 + Float64((t_0 ^ -3.0) / (t_2 ^ -3.0))) / Float64(1.0 + Float64(Float64(-1.0 + Float64(t_2 / t_1)) / Float64(t_1 / t_2)))) end
function tmp = code(x) t_0 = 1.0 + (0.3275911 * abs(x)); t_1 = t_0 * exp((x * x)); t_2 = -0.254829592 + ((-0.284496736 + ((1.421413741 + ((-1.453152027 + (1.061405429 / t_0)) / t_0)) / t_0)) / (-1.0 + (abs(x) * -0.3275911))); tmp = (1.0 + ((t_0 ^ -3.0) / (t_2 ^ -3.0))) / (1.0 + ((-1.0 + (t_2 / t_1)) / (t_1 / t_2))); end
code[x_] := Block[{t$95$0 = N[(1.0 + N[(0.3275911 * N[Abs[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(t$95$0 * N[Exp[N[(x * x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(-0.254829592 + 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] / N[(-1.0 + N[(N[Abs[x], $MachinePrecision] * -0.3275911), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, N[(N[(1.0 + N[(N[Power[t$95$0, -3.0], $MachinePrecision] / N[Power[t$95$2, -3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(1.0 + N[(N[(-1.0 + N[(t$95$2 / t$95$1), $MachinePrecision]), $MachinePrecision] / N[(t$95$1 / t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 1 + 0.3275911 \cdot \left|x\right|\\
t_1 := t\_0 \cdot e^{x \cdot x}\\
t_2 := -0.254829592 + \frac{-0.284496736 + \frac{1.421413741 + \frac{-1.453152027 + \frac{1.061405429}{t\_0}}{t\_0}}{t\_0}}{-1 + \left|x\right| \cdot -0.3275911}\\
\frac{1 + \frac{{t\_0}^{-3}}{{t\_2}^{-3}}}{1 + \frac{-1 + \frac{t\_2}{t\_1}}{\frac{t\_1}{t\_2}}}
\end{array}
\end{array}
Initial program 78.2%
Simplified78.2%
Applied egg-rr78.2%
Taylor expanded in x around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
fabs-lowering-fabs.f6477.7%
Simplified77.7%
Applied egg-rr78.9%
Applied egg-rr78.9%
Final simplification78.9%
(FPCore (x)
:precision binary64
(let* ((t_0 (* (fabs x) -0.3275911)) (t_1 (+ 1.0 (* 0.3275911 (fabs x)))))
(+
1.0
(/
(+
-0.254829592
(/
(+
-0.284496736
(/
(+
1.421413741
(/
(fma
(/ 1.061405429 (- 1.0 (* (* x x) 0.10731592879921)))
(+ 1.0 t_0)
-1.453152027)
t_1))
t_1))
(+ -1.0 t_0)))
(* t_1 (exp (* x x)))))))
double code(double x) {
double t_0 = fabs(x) * -0.3275911;
double t_1 = 1.0 + (0.3275911 * fabs(x));
return 1.0 + ((-0.254829592 + ((-0.284496736 + ((1.421413741 + (fma((1.061405429 / (1.0 - ((x * x) * 0.10731592879921))), (1.0 + t_0), -1.453152027) / t_1)) / t_1)) / (-1.0 + t_0))) / (t_1 * exp((x * x))));
}
function code(x) t_0 = Float64(abs(x) * -0.3275911) t_1 = Float64(1.0 + Float64(0.3275911 * abs(x))) return Float64(1.0 + Float64(Float64(-0.254829592 + Float64(Float64(-0.284496736 + Float64(Float64(1.421413741 + Float64(fma(Float64(1.061405429 / Float64(1.0 - Float64(Float64(x * x) * 0.10731592879921))), Float64(1.0 + t_0), -1.453152027) / t_1)) / t_1)) / Float64(-1.0 + t_0))) / Float64(t_1 * exp(Float64(x * x))))) end
code[x_] := Block[{t$95$0 = N[(N[Abs[x], $MachinePrecision] * -0.3275911), $MachinePrecision]}, Block[{t$95$1 = N[(1.0 + N[(0.3275911 * N[Abs[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, N[(1.0 + N[(N[(-0.254829592 + N[(N[(-0.284496736 + N[(N[(1.421413741 + N[(N[(N[(1.061405429 / N[(1.0 - N[(N[(x * x), $MachinePrecision] * 0.10731592879921), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 + t$95$0), $MachinePrecision] + -1.453152027), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision] / N[(-1.0 + t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(t$95$1 * N[Exp[N[(x * x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left|x\right| \cdot -0.3275911\\
t_1 := 1 + 0.3275911 \cdot \left|x\right|\\
1 + \frac{-0.254829592 + \frac{-0.284496736 + \frac{1.421413741 + \frac{\mathsf{fma}\left(\frac{1.061405429}{1 - \left(x \cdot x\right) \cdot 0.10731592879921}, 1 + t\_0, -1.453152027\right)}{t\_1}}{t\_1}}{-1 + t\_0}}{t\_1 \cdot e^{x \cdot x}}
\end{array}
\end{array}
Initial program 78.2%
Simplified78.2%
+-commutativeN/A
flip-+N/A
associate-/r/N/A
fma-defineN/A
fma-lowering-fma.f64N/A
Applied egg-rr78.2%
(FPCore (x)
:precision binary64
(let* ((t_0 (* 0.3275911 (fabs x))) (t_1 (+ 1.0 t_0)))
(+
1.0
(/
(+
-0.254829592
(*
(/
(+
-0.284496736
(/ (+ 1.421413741 (/ (+ -1.453152027 (/ 1.061405429 t_1)) t_1)) t_1))
(- 1.0 (* (* x x) 0.10731592879921)))
(+ t_0 -1.0)))
(* t_1 (exp (* x x)))))))
double code(double x) {
double t_0 = 0.3275911 * fabs(x);
double t_1 = 1.0 + t_0;
return 1.0 + ((-0.254829592 + (((-0.284496736 + ((1.421413741 + ((-1.453152027 + (1.061405429 / t_1)) / t_1)) / t_1)) / (1.0 - ((x * x) * 0.10731592879921))) * (t_0 + -1.0))) / (t_1 * exp((x * x))));
}
real(8) function code(x)
real(8), intent (in) :: x
real(8) :: t_0
real(8) :: t_1
t_0 = 0.3275911d0 * abs(x)
t_1 = 1.0d0 + t_0
code = 1.0d0 + (((-0.254829592d0) + ((((-0.284496736d0) + ((1.421413741d0 + (((-1.453152027d0) + (1.061405429d0 / t_1)) / t_1)) / t_1)) / (1.0d0 - ((x * x) * 0.10731592879921d0))) * (t_0 + (-1.0d0)))) / (t_1 * exp((x * x))))
end function
public static double code(double x) {
double t_0 = 0.3275911 * Math.abs(x);
double t_1 = 1.0 + t_0;
return 1.0 + ((-0.254829592 + (((-0.284496736 + ((1.421413741 + ((-1.453152027 + (1.061405429 / t_1)) / t_1)) / t_1)) / (1.0 - ((x * x) * 0.10731592879921))) * (t_0 + -1.0))) / (t_1 * Math.exp((x * x))));
}
def code(x): t_0 = 0.3275911 * math.fabs(x) t_1 = 1.0 + t_0 return 1.0 + ((-0.254829592 + (((-0.284496736 + ((1.421413741 + ((-1.453152027 + (1.061405429 / t_1)) / t_1)) / t_1)) / (1.0 - ((x * x) * 0.10731592879921))) * (t_0 + -1.0))) / (t_1 * math.exp((x * x))))
function code(x) t_0 = Float64(0.3275911 * abs(x)) t_1 = Float64(1.0 + t_0) return Float64(1.0 + Float64(Float64(-0.254829592 + Float64(Float64(Float64(-0.284496736 + Float64(Float64(1.421413741 + Float64(Float64(-1.453152027 + Float64(1.061405429 / t_1)) / t_1)) / t_1)) / Float64(1.0 - Float64(Float64(x * x) * 0.10731592879921))) * Float64(t_0 + -1.0))) / Float64(t_1 * exp(Float64(x * x))))) end
function tmp = code(x) t_0 = 0.3275911 * abs(x); t_1 = 1.0 + t_0; tmp = 1.0 + ((-0.254829592 + (((-0.284496736 + ((1.421413741 + ((-1.453152027 + (1.061405429 / t_1)) / t_1)) / t_1)) / (1.0 - ((x * x) * 0.10731592879921))) * (t_0 + -1.0))) / (t_1 * exp((x * x)))); end
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]}, N[(1.0 + N[(N[(-0.254829592 + N[(N[(N[(-0.284496736 + N[(N[(1.421413741 + N[(N[(-1.453152027 + N[(1.061405429 / t$95$1), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision] / N[(1.0 - N[(N[(x * x), $MachinePrecision] * 0.10731592879921), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(t$95$0 + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(t$95$1 * N[Exp[N[(x * x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 0.3275911 \cdot \left|x\right|\\
t_1 := 1 + t\_0\\
1 + \frac{-0.254829592 + \frac{-0.284496736 + \frac{1.421413741 + \frac{-1.453152027 + \frac{1.061405429}{t\_1}}{t\_1}}{t\_1}}{1 - \left(x \cdot x\right) \cdot 0.10731592879921} \cdot \left(t\_0 + -1\right)}{t\_1 \cdot e^{x \cdot x}}
\end{array}
\end{array}
Initial program 78.2%
Simplified78.2%
Applied egg-rr78.2%
Final simplification78.2%
(FPCore (x)
:precision binary64
(let* ((t_0 (+ 1.0 (* 0.3275911 (fabs x)))))
(+
1.0
(/
(+
-0.254829592
(/
(+
-0.284496736
(/ (+ 1.421413741 (/ (+ -1.453152027 (/ 1.061405429 t_0)) t_0)) t_0))
(+ -1.0 (* (fabs x) -0.3275911))))
(* t_0 (exp (* x x)))))))
double code(double x) {
double t_0 = 1.0 + (0.3275911 * fabs(x));
return 1.0 + ((-0.254829592 + ((-0.284496736 + ((1.421413741 + ((-1.453152027 + (1.061405429 / t_0)) / t_0)) / t_0)) / (-1.0 + (fabs(x) * -0.3275911)))) / (t_0 * exp((x * x))));
}
real(8) function code(x)
real(8), intent (in) :: x
real(8) :: t_0
t_0 = 1.0d0 + (0.3275911d0 * abs(x))
code = 1.0d0 + (((-0.254829592d0) + (((-0.284496736d0) + ((1.421413741d0 + (((-1.453152027d0) + (1.061405429d0 / t_0)) / t_0)) / t_0)) / ((-1.0d0) + (abs(x) * (-0.3275911d0))))) / (t_0 * exp((x * x))))
end function
public static double code(double x) {
double t_0 = 1.0 + (0.3275911 * Math.abs(x));
return 1.0 + ((-0.254829592 + ((-0.284496736 + ((1.421413741 + ((-1.453152027 + (1.061405429 / t_0)) / t_0)) / t_0)) / (-1.0 + (Math.abs(x) * -0.3275911)))) / (t_0 * Math.exp((x * x))));
}
def code(x): t_0 = 1.0 + (0.3275911 * math.fabs(x)) return 1.0 + ((-0.254829592 + ((-0.284496736 + ((1.421413741 + ((-1.453152027 + (1.061405429 / t_0)) / t_0)) / t_0)) / (-1.0 + (math.fabs(x) * -0.3275911)))) / (t_0 * math.exp((x * x))))
function code(x) t_0 = Float64(1.0 + Float64(0.3275911 * abs(x))) return Float64(1.0 + Float64(Float64(-0.254829592 + Float64(Float64(-0.284496736 + Float64(Float64(1.421413741 + Float64(Float64(-1.453152027 + Float64(1.061405429 / t_0)) / t_0)) / t_0)) / Float64(-1.0 + Float64(abs(x) * -0.3275911)))) / Float64(t_0 * exp(Float64(x * x))))) end
function tmp = code(x) t_0 = 1.0 + (0.3275911 * abs(x)); tmp = 1.0 + ((-0.254829592 + ((-0.284496736 + ((1.421413741 + ((-1.453152027 + (1.061405429 / t_0)) / t_0)) / t_0)) / (-1.0 + (abs(x) * -0.3275911)))) / (t_0 * exp((x * x)))); end
code[x_] := Block[{t$95$0 = N[(1.0 + N[(0.3275911 * N[Abs[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, N[(1.0 + N[(N[(-0.254829592 + 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] / N[(-1.0 + N[(N[Abs[x], $MachinePrecision] * -0.3275911), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(t$95$0 * N[Exp[N[(x * x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 1 + 0.3275911 \cdot \left|x\right|\\
1 + \frac{-0.254829592 + \frac{-0.284496736 + \frac{1.421413741 + \frac{-1.453152027 + \frac{1.061405429}{t\_0}}{t\_0}}{t\_0}}{-1 + \left|x\right| \cdot -0.3275911}}{t\_0 \cdot e^{x \cdot x}}
\end{array}
\end{array}
Initial program 78.2%
Simplified78.2%
(FPCore (x)
:precision binary64
(let* ((t_0 (* 0.3275911 (fabs x))) (t_1 (+ 1.0 t_0)))
(+
1.0
(/
(+
-0.254829592
(*
(/
(+
-0.284496736
(/ (+ 1.421413741 (/ (+ -1.453152027 (/ 1.061405429 t_1)) t_1)) t_1))
(- 1.0 (* (* x x) 0.10731592879921)))
(+ t_0 -1.0)))
t_1))))
double code(double x) {
double t_0 = 0.3275911 * fabs(x);
double t_1 = 1.0 + t_0;
return 1.0 + ((-0.254829592 + (((-0.284496736 + ((1.421413741 + ((-1.453152027 + (1.061405429 / t_1)) / t_1)) / t_1)) / (1.0 - ((x * x) * 0.10731592879921))) * (t_0 + -1.0))) / t_1);
}
real(8) function code(x)
real(8), intent (in) :: x
real(8) :: t_0
real(8) :: t_1
t_0 = 0.3275911d0 * abs(x)
t_1 = 1.0d0 + t_0
code = 1.0d0 + (((-0.254829592d0) + ((((-0.284496736d0) + ((1.421413741d0 + (((-1.453152027d0) + (1.061405429d0 / t_1)) / t_1)) / t_1)) / (1.0d0 - ((x * x) * 0.10731592879921d0))) * (t_0 + (-1.0d0)))) / t_1)
end function
public static double code(double x) {
double t_0 = 0.3275911 * Math.abs(x);
double t_1 = 1.0 + t_0;
return 1.0 + ((-0.254829592 + (((-0.284496736 + ((1.421413741 + ((-1.453152027 + (1.061405429 / t_1)) / t_1)) / t_1)) / (1.0 - ((x * x) * 0.10731592879921))) * (t_0 + -1.0))) / t_1);
}
def code(x): t_0 = 0.3275911 * math.fabs(x) t_1 = 1.0 + t_0 return 1.0 + ((-0.254829592 + (((-0.284496736 + ((1.421413741 + ((-1.453152027 + (1.061405429 / t_1)) / t_1)) / t_1)) / (1.0 - ((x * x) * 0.10731592879921))) * (t_0 + -1.0))) / t_1)
function code(x) t_0 = Float64(0.3275911 * abs(x)) t_1 = Float64(1.0 + t_0) return Float64(1.0 + Float64(Float64(-0.254829592 + Float64(Float64(Float64(-0.284496736 + Float64(Float64(1.421413741 + Float64(Float64(-1.453152027 + Float64(1.061405429 / t_1)) / t_1)) / t_1)) / Float64(1.0 - Float64(Float64(x * x) * 0.10731592879921))) * Float64(t_0 + -1.0))) / t_1)) end
function tmp = code(x) t_0 = 0.3275911 * abs(x); t_1 = 1.0 + t_0; tmp = 1.0 + ((-0.254829592 + (((-0.284496736 + ((1.421413741 + ((-1.453152027 + (1.061405429 / t_1)) / t_1)) / t_1)) / (1.0 - ((x * x) * 0.10731592879921))) * (t_0 + -1.0))) / t_1); end
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]}, N[(1.0 + N[(N[(-0.254829592 + N[(N[(N[(-0.284496736 + N[(N[(1.421413741 + N[(N[(-1.453152027 + N[(1.061405429 / t$95$1), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision] / N[(1.0 - N[(N[(x * x), $MachinePrecision] * 0.10731592879921), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(t$95$0 + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 0.3275911 \cdot \left|x\right|\\
t_1 := 1 + t\_0\\
1 + \frac{-0.254829592 + \frac{-0.284496736 + \frac{1.421413741 + \frac{-1.453152027 + \frac{1.061405429}{t\_1}}{t\_1}}{t\_1}}{1 - \left(x \cdot x\right) \cdot 0.10731592879921} \cdot \left(t\_0 + -1\right)}{t\_1}
\end{array}
\end{array}
Initial program 78.2%
Simplified78.2%
Applied egg-rr78.2%
Taylor expanded in x around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
fabs-lowering-fabs.f6477.2%
Simplified77.2%
Final simplification77.2%
(FPCore (x)
:precision binary64
(let* ((t_0 (+ 1.0 (* 0.3275911 (fabs x)))))
(+
1.0
(/
1.0
(/
t_0
(+
-0.254829592
(/
(+
-0.284496736
(/ (+ 1.421413741 (/ (+ -1.453152027 (/ 1.061405429 t_0)) t_0)) t_0))
(+ -1.0 (* (fabs x) -0.3275911)))))))))
double code(double x) {
double t_0 = 1.0 + (0.3275911 * fabs(x));
return 1.0 + (1.0 / (t_0 / (-0.254829592 + ((-0.284496736 + ((1.421413741 + ((-1.453152027 + (1.061405429 / t_0)) / t_0)) / t_0)) / (-1.0 + (fabs(x) * -0.3275911))))));
}
real(8) function code(x)
real(8), intent (in) :: x
real(8) :: t_0
t_0 = 1.0d0 + (0.3275911d0 * abs(x))
code = 1.0d0 + (1.0d0 / (t_0 / ((-0.254829592d0) + (((-0.284496736d0) + ((1.421413741d0 + (((-1.453152027d0) + (1.061405429d0 / t_0)) / t_0)) / t_0)) / ((-1.0d0) + (abs(x) * (-0.3275911d0)))))))
end function
public static double code(double x) {
double t_0 = 1.0 + (0.3275911 * Math.abs(x));
return 1.0 + (1.0 / (t_0 / (-0.254829592 + ((-0.284496736 + ((1.421413741 + ((-1.453152027 + (1.061405429 / t_0)) / t_0)) / t_0)) / (-1.0 + (Math.abs(x) * -0.3275911))))));
}
def code(x): t_0 = 1.0 + (0.3275911 * math.fabs(x)) return 1.0 + (1.0 / (t_0 / (-0.254829592 + ((-0.284496736 + ((1.421413741 + ((-1.453152027 + (1.061405429 / t_0)) / t_0)) / t_0)) / (-1.0 + (math.fabs(x) * -0.3275911))))))
function code(x) t_0 = Float64(1.0 + Float64(0.3275911 * abs(x))) return Float64(1.0 + Float64(1.0 / Float64(t_0 / Float64(-0.254829592 + Float64(Float64(-0.284496736 + Float64(Float64(1.421413741 + Float64(Float64(-1.453152027 + Float64(1.061405429 / t_0)) / t_0)) / t_0)) / Float64(-1.0 + Float64(abs(x) * -0.3275911))))))) end
function tmp = code(x) t_0 = 1.0 + (0.3275911 * abs(x)); tmp = 1.0 + (1.0 / (t_0 / (-0.254829592 + ((-0.284496736 + ((1.421413741 + ((-1.453152027 + (1.061405429 / t_0)) / t_0)) / t_0)) / (-1.0 + (abs(x) * -0.3275911)))))); end
code[x_] := Block[{t$95$0 = N[(1.0 + N[(0.3275911 * N[Abs[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, N[(1.0 + N[(1.0 / N[(t$95$0 / N[(-0.254829592 + 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] / N[(-1.0 + N[(N[Abs[x], $MachinePrecision] * -0.3275911), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 1 + 0.3275911 \cdot \left|x\right|\\
1 + \frac{1}{\frac{t\_0}{-0.254829592 + \frac{-0.284496736 + \frac{1.421413741 + \frac{-1.453152027 + \frac{1.061405429}{t\_0}}{t\_0}}{t\_0}}{-1 + \left|x\right| \cdot -0.3275911}}}
\end{array}
\end{array}
Initial program 78.2%
Simplified78.2%
clear-numN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
Applied egg-rr77.0%
Taylor expanded in x around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
fabs-lowering-fabs.f6476.0%
Simplified76.0%
(FPCore (x) :precision binary64 (+ 1.0 (/ -0.254829592 (* (+ 1.0 (* 0.3275911 (fabs x))) (exp (* x x))))))
double code(double x) {
return 1.0 + (-0.254829592 / ((1.0 + (0.3275911 * fabs(x))) * exp((x * x))));
}
real(8) function code(x)
real(8), intent (in) :: x
code = 1.0d0 + ((-0.254829592d0) / ((1.0d0 + (0.3275911d0 * abs(x))) * exp((x * x))))
end function
public static double code(double x) {
return 1.0 + (-0.254829592 / ((1.0 + (0.3275911 * Math.abs(x))) * Math.exp((x * x))));
}
def code(x): return 1.0 + (-0.254829592 / ((1.0 + (0.3275911 * math.fabs(x))) * math.exp((x * x))))
function code(x) return Float64(1.0 + Float64(-0.254829592 / Float64(Float64(1.0 + Float64(0.3275911 * abs(x))) * exp(Float64(x * x))))) end
function tmp = code(x) tmp = 1.0 + (-0.254829592 / ((1.0 + (0.3275911 * abs(x))) * exp((x * x)))); end
code[x_] := N[(1.0 + N[(-0.254829592 / N[(N[(1.0 + N[(0.3275911 * N[Abs[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Exp[N[(x * x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
1 + \frac{-0.254829592}{\left(1 + 0.3275911 \cdot \left|x\right|\right) \cdot e^{x \cdot x}}
\end{array}
Initial program 78.2%
Simplified78.2%
Applied egg-rr78.2%
Taylor expanded in x around inf
sub-negN/A
+-lowering-+.f64N/A
associate-*r/N/A
metadata-evalN/A
distribute-neg-fracN/A
metadata-evalN/A
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
fabs-lowering-fabs.f64N/A
exp-lowering-exp.f64N/A
unpow2N/A
*-lowering-*.f6453.9%
Simplified53.9%
(FPCore (x)
:precision binary64
(+
1.0
(/
-0.254829592
(*
(+ 1.0 (* 0.3275911 (fabs x)))
(+
1.0
(*
(* x x)
(+ 1.0 (* (* x x) (+ 0.5 (* (* x x) 0.16666666666666666))))))))))
double code(double x) {
return 1.0 + (-0.254829592 / ((1.0 + (0.3275911 * fabs(x))) * (1.0 + ((x * x) * (1.0 + ((x * x) * (0.5 + ((x * x) * 0.16666666666666666))))))));
}
real(8) function code(x)
real(8), intent (in) :: x
code = 1.0d0 + ((-0.254829592d0) / ((1.0d0 + (0.3275911d0 * abs(x))) * (1.0d0 + ((x * x) * (1.0d0 + ((x * x) * (0.5d0 + ((x * x) * 0.16666666666666666d0))))))))
end function
public static double code(double x) {
return 1.0 + (-0.254829592 / ((1.0 + (0.3275911 * Math.abs(x))) * (1.0 + ((x * x) * (1.0 + ((x * x) * (0.5 + ((x * x) * 0.16666666666666666))))))));
}
def code(x): return 1.0 + (-0.254829592 / ((1.0 + (0.3275911 * math.fabs(x))) * (1.0 + ((x * x) * (1.0 + ((x * x) * (0.5 + ((x * x) * 0.16666666666666666))))))))
function code(x) return Float64(1.0 + Float64(-0.254829592 / Float64(Float64(1.0 + Float64(0.3275911 * abs(x))) * Float64(1.0 + Float64(Float64(x * x) * Float64(1.0 + Float64(Float64(x * x) * Float64(0.5 + Float64(Float64(x * x) * 0.16666666666666666))))))))) end
function tmp = code(x) tmp = 1.0 + (-0.254829592 / ((1.0 + (0.3275911 * abs(x))) * (1.0 + ((x * x) * (1.0 + ((x * x) * (0.5 + ((x * x) * 0.16666666666666666)))))))); end
code[x_] := N[(1.0 + N[(-0.254829592 / N[(N[(1.0 + N[(0.3275911 * N[Abs[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 + N[(N[(x * x), $MachinePrecision] * N[(1.0 + N[(N[(x * x), $MachinePrecision] * N[(0.5 + N[(N[(x * x), $MachinePrecision] * 0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
1 + \frac{-0.254829592}{\left(1 + 0.3275911 \cdot \left|x\right|\right) \cdot \left(1 + \left(x \cdot x\right) \cdot \left(1 + \left(x \cdot x\right) \cdot \left(0.5 + \left(x \cdot x\right) \cdot 0.16666666666666666\right)\right)\right)}
\end{array}
Initial program 78.2%
Simplified78.2%
Applied egg-rr78.2%
Taylor expanded in x around inf
sub-negN/A
+-lowering-+.f64N/A
associate-*r/N/A
metadata-evalN/A
distribute-neg-fracN/A
metadata-evalN/A
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
fabs-lowering-fabs.f64N/A
exp-lowering-exp.f64N/A
unpow2N/A
*-lowering-*.f6453.9%
Simplified53.9%
Taylor expanded in x around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6453.9%
Simplified53.9%
(FPCore (x)
:precision binary64
(+
1.0
(/
-0.254829592
(*
(+ 1.0 (* 0.3275911 (fabs x)))
(+ 1.0 (* (* x x) (+ 1.0 (* (* x x) 0.5))))))))
double code(double x) {
return 1.0 + (-0.254829592 / ((1.0 + (0.3275911 * fabs(x))) * (1.0 + ((x * x) * (1.0 + ((x * x) * 0.5))))));
}
real(8) function code(x)
real(8), intent (in) :: x
code = 1.0d0 + ((-0.254829592d0) / ((1.0d0 + (0.3275911d0 * abs(x))) * (1.0d0 + ((x * x) * (1.0d0 + ((x * x) * 0.5d0))))))
end function
public static double code(double x) {
return 1.0 + (-0.254829592 / ((1.0 + (0.3275911 * Math.abs(x))) * (1.0 + ((x * x) * (1.0 + ((x * x) * 0.5))))));
}
def code(x): return 1.0 + (-0.254829592 / ((1.0 + (0.3275911 * math.fabs(x))) * (1.0 + ((x * x) * (1.0 + ((x * x) * 0.5))))))
function code(x) return Float64(1.0 + Float64(-0.254829592 / Float64(Float64(1.0 + Float64(0.3275911 * abs(x))) * Float64(1.0 + Float64(Float64(x * x) * Float64(1.0 + Float64(Float64(x * x) * 0.5))))))) end
function tmp = code(x) tmp = 1.0 + (-0.254829592 / ((1.0 + (0.3275911 * abs(x))) * (1.0 + ((x * x) * (1.0 + ((x * x) * 0.5)))))); end
code[x_] := N[(1.0 + N[(-0.254829592 / N[(N[(1.0 + N[(0.3275911 * N[Abs[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 + N[(N[(x * x), $MachinePrecision] * N[(1.0 + N[(N[(x * x), $MachinePrecision] * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
1 + \frac{-0.254829592}{\left(1 + 0.3275911 \cdot \left|x\right|\right) \cdot \left(1 + \left(x \cdot x\right) \cdot \left(1 + \left(x \cdot x\right) \cdot 0.5\right)\right)}
\end{array}
Initial program 78.2%
Simplified78.2%
Applied egg-rr78.2%
Taylor expanded in x around inf
sub-negN/A
+-lowering-+.f64N/A
associate-*r/N/A
metadata-evalN/A
distribute-neg-fracN/A
metadata-evalN/A
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
fabs-lowering-fabs.f64N/A
exp-lowering-exp.f64N/A
unpow2N/A
*-lowering-*.f6453.9%
Simplified53.9%
Taylor expanded in x around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6453.8%
Simplified53.8%
(FPCore (x) :precision binary64 (+ 1.0 (/ -0.254829592 (* (+ 1.0 (* 0.3275911 (fabs x))) (+ 1.0 (* x x))))))
double code(double x) {
return 1.0 + (-0.254829592 / ((1.0 + (0.3275911 * fabs(x))) * (1.0 + (x * x))));
}
real(8) function code(x)
real(8), intent (in) :: x
code = 1.0d0 + ((-0.254829592d0) / ((1.0d0 + (0.3275911d0 * abs(x))) * (1.0d0 + (x * x))))
end function
public static double code(double x) {
return 1.0 + (-0.254829592 / ((1.0 + (0.3275911 * Math.abs(x))) * (1.0 + (x * x))));
}
def code(x): return 1.0 + (-0.254829592 / ((1.0 + (0.3275911 * math.fabs(x))) * (1.0 + (x * x))))
function code(x) return Float64(1.0 + Float64(-0.254829592 / Float64(Float64(1.0 + Float64(0.3275911 * abs(x))) * Float64(1.0 + Float64(x * x))))) end
function tmp = code(x) tmp = 1.0 + (-0.254829592 / ((1.0 + (0.3275911 * abs(x))) * (1.0 + (x * x)))); end
code[x_] := N[(1.0 + N[(-0.254829592 / N[(N[(1.0 + N[(0.3275911 * N[Abs[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 + N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
1 + \frac{-0.254829592}{\left(1 + 0.3275911 \cdot \left|x\right|\right) \cdot \left(1 + x \cdot x\right)}
\end{array}
Initial program 78.2%
Simplified78.2%
Applied egg-rr78.2%
Taylor expanded in x around inf
sub-negN/A
+-lowering-+.f64N/A
associate-*r/N/A
metadata-evalN/A
distribute-neg-fracN/A
metadata-evalN/A
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
fabs-lowering-fabs.f64N/A
exp-lowering-exp.f64N/A
unpow2N/A
*-lowering-*.f6453.9%
Simplified53.9%
Taylor expanded in x around 0
associate-+r+N/A
distribute-rgt1-inN/A
+-commutativeN/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
fabs-lowering-fabs.f6453.7%
Simplified53.7%
Final simplification53.7%
(FPCore (x) :precision binary64 (+ 1.0 (/ -0.254829592 (+ 1.0 (* 0.3275911 (fabs x))))))
double code(double x) {
return 1.0 + (-0.254829592 / (1.0 + (0.3275911 * fabs(x))));
}
real(8) function code(x)
real(8), intent (in) :: x
code = 1.0d0 + ((-0.254829592d0) / (1.0d0 + (0.3275911d0 * abs(x))))
end function
public static double code(double x) {
return 1.0 + (-0.254829592 / (1.0 + (0.3275911 * Math.abs(x))));
}
def code(x): return 1.0 + (-0.254829592 / (1.0 + (0.3275911 * math.fabs(x))))
function code(x) return Float64(1.0 + Float64(-0.254829592 / Float64(1.0 + Float64(0.3275911 * abs(x))))) end
function tmp = code(x) tmp = 1.0 + (-0.254829592 / (1.0 + (0.3275911 * abs(x)))); end
code[x_] := N[(1.0 + N[(-0.254829592 / N[(1.0 + N[(0.3275911 * N[Abs[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
1 + \frac{-0.254829592}{1 + 0.3275911 \cdot \left|x\right|}
\end{array}
Initial program 78.2%
Simplified78.2%
Applied egg-rr78.2%
Taylor expanded in x around inf
sub-negN/A
+-lowering-+.f64N/A
associate-*r/N/A
metadata-evalN/A
distribute-neg-fracN/A
metadata-evalN/A
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
fabs-lowering-fabs.f64N/A
exp-lowering-exp.f64N/A
unpow2N/A
*-lowering-*.f6453.9%
Simplified53.9%
Taylor expanded in x around 0
sub-negN/A
+-lowering-+.f64N/A
associate-*r/N/A
metadata-evalN/A
distribute-neg-fracN/A
metadata-evalN/A
/-lowering-/.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
fabs-lowering-fabs.f6453.2%
Simplified53.2%
herbie shell --seed 2024145
(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)))))))