
(FPCore (x)
:precision binary64
(let* ((t_0 (* (* (fabs x) (fabs x)) (fabs x)))
(t_1 (* (* t_0 (fabs x)) (fabs x))))
(fabs
(*
(/ 1.0 (sqrt PI))
(+
(+ (+ (* 2.0 (fabs x)) (* (/ 2.0 3.0) t_0)) (* (/ 1.0 5.0) t_1))
(* (/ 1.0 21.0) (* (* t_1 (fabs x)) (fabs x))))))))
double code(double x) {
double t_0 = (fabs(x) * fabs(x)) * fabs(x);
double t_1 = (t_0 * fabs(x)) * fabs(x);
return fabs(((1.0 / sqrt(((double) M_PI))) * ((((2.0 * fabs(x)) + ((2.0 / 3.0) * t_0)) + ((1.0 / 5.0) * t_1)) + ((1.0 / 21.0) * ((t_1 * fabs(x)) * fabs(x))))));
}
public static double code(double x) {
double t_0 = (Math.abs(x) * Math.abs(x)) * Math.abs(x);
double t_1 = (t_0 * Math.abs(x)) * Math.abs(x);
return Math.abs(((1.0 / Math.sqrt(Math.PI)) * ((((2.0 * Math.abs(x)) + ((2.0 / 3.0) * t_0)) + ((1.0 / 5.0) * t_1)) + ((1.0 / 21.0) * ((t_1 * Math.abs(x)) * Math.abs(x))))));
}
def code(x): t_0 = (math.fabs(x) * math.fabs(x)) * math.fabs(x) t_1 = (t_0 * math.fabs(x)) * math.fabs(x) return math.fabs(((1.0 / math.sqrt(math.pi)) * ((((2.0 * math.fabs(x)) + ((2.0 / 3.0) * t_0)) + ((1.0 / 5.0) * t_1)) + ((1.0 / 21.0) * ((t_1 * math.fabs(x)) * math.fabs(x))))))
function code(x) t_0 = Float64(Float64(abs(x) * abs(x)) * abs(x)) t_1 = Float64(Float64(t_0 * abs(x)) * abs(x)) return abs(Float64(Float64(1.0 / sqrt(pi)) * Float64(Float64(Float64(Float64(2.0 * abs(x)) + Float64(Float64(2.0 / 3.0) * t_0)) + Float64(Float64(1.0 / 5.0) * t_1)) + Float64(Float64(1.0 / 21.0) * Float64(Float64(t_1 * abs(x)) * abs(x)))))) end
function tmp = code(x) t_0 = (abs(x) * abs(x)) * abs(x); t_1 = (t_0 * abs(x)) * abs(x); tmp = abs(((1.0 / sqrt(pi)) * ((((2.0 * abs(x)) + ((2.0 / 3.0) * t_0)) + ((1.0 / 5.0) * t_1)) + ((1.0 / 21.0) * ((t_1 * abs(x)) * abs(x)))))); end
code[x_] := Block[{t$95$0 = N[(N[(N[Abs[x], $MachinePrecision] * N[Abs[x], $MachinePrecision]), $MachinePrecision] * N[Abs[x], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(t$95$0 * N[Abs[x], $MachinePrecision]), $MachinePrecision] * N[Abs[x], $MachinePrecision]), $MachinePrecision]}, N[Abs[N[(N[(1.0 / N[Sqrt[Pi], $MachinePrecision]), $MachinePrecision] * N[(N[(N[(N[(2.0 * N[Abs[x], $MachinePrecision]), $MachinePrecision] + N[(N[(2.0 / 3.0), $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 / 5.0), $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 / 21.0), $MachinePrecision] * N[(N[(t$95$1 * N[Abs[x], $MachinePrecision]), $MachinePrecision] * N[Abs[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(\left|x\right| \cdot \left|x\right|\right) \cdot \left|x\right|\\
t_1 := \left(t\_0 \cdot \left|x\right|\right) \cdot \left|x\right|\\
\left|\frac{1}{\sqrt{\pi}} \cdot \left(\left(\left(2 \cdot \left|x\right| + \frac{2}{3} \cdot t\_0\right) + \frac{1}{5} \cdot t\_1\right) + \frac{1}{21} \cdot \left(\left(t\_1 \cdot \left|x\right|\right) \cdot \left|x\right|\right)\right)\right|
\end{array}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 15 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x)
:precision binary64
(let* ((t_0 (* (* (fabs x) (fabs x)) (fabs x)))
(t_1 (* (* t_0 (fabs x)) (fabs x))))
(fabs
(*
(/ 1.0 (sqrt PI))
(+
(+ (+ (* 2.0 (fabs x)) (* (/ 2.0 3.0) t_0)) (* (/ 1.0 5.0) t_1))
(* (/ 1.0 21.0) (* (* t_1 (fabs x)) (fabs x))))))))
double code(double x) {
double t_0 = (fabs(x) * fabs(x)) * fabs(x);
double t_1 = (t_0 * fabs(x)) * fabs(x);
return fabs(((1.0 / sqrt(((double) M_PI))) * ((((2.0 * fabs(x)) + ((2.0 / 3.0) * t_0)) + ((1.0 / 5.0) * t_1)) + ((1.0 / 21.0) * ((t_1 * fabs(x)) * fabs(x))))));
}
public static double code(double x) {
double t_0 = (Math.abs(x) * Math.abs(x)) * Math.abs(x);
double t_1 = (t_0 * Math.abs(x)) * Math.abs(x);
return Math.abs(((1.0 / Math.sqrt(Math.PI)) * ((((2.0 * Math.abs(x)) + ((2.0 / 3.0) * t_0)) + ((1.0 / 5.0) * t_1)) + ((1.0 / 21.0) * ((t_1 * Math.abs(x)) * Math.abs(x))))));
}
def code(x): t_0 = (math.fabs(x) * math.fabs(x)) * math.fabs(x) t_1 = (t_0 * math.fabs(x)) * math.fabs(x) return math.fabs(((1.0 / math.sqrt(math.pi)) * ((((2.0 * math.fabs(x)) + ((2.0 / 3.0) * t_0)) + ((1.0 / 5.0) * t_1)) + ((1.0 / 21.0) * ((t_1 * math.fabs(x)) * math.fabs(x))))))
function code(x) t_0 = Float64(Float64(abs(x) * abs(x)) * abs(x)) t_1 = Float64(Float64(t_0 * abs(x)) * abs(x)) return abs(Float64(Float64(1.0 / sqrt(pi)) * Float64(Float64(Float64(Float64(2.0 * abs(x)) + Float64(Float64(2.0 / 3.0) * t_0)) + Float64(Float64(1.0 / 5.0) * t_1)) + Float64(Float64(1.0 / 21.0) * Float64(Float64(t_1 * abs(x)) * abs(x)))))) end
function tmp = code(x) t_0 = (abs(x) * abs(x)) * abs(x); t_1 = (t_0 * abs(x)) * abs(x); tmp = abs(((1.0 / sqrt(pi)) * ((((2.0 * abs(x)) + ((2.0 / 3.0) * t_0)) + ((1.0 / 5.0) * t_1)) + ((1.0 / 21.0) * ((t_1 * abs(x)) * abs(x)))))); end
code[x_] := Block[{t$95$0 = N[(N[(N[Abs[x], $MachinePrecision] * N[Abs[x], $MachinePrecision]), $MachinePrecision] * N[Abs[x], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(t$95$0 * N[Abs[x], $MachinePrecision]), $MachinePrecision] * N[Abs[x], $MachinePrecision]), $MachinePrecision]}, N[Abs[N[(N[(1.0 / N[Sqrt[Pi], $MachinePrecision]), $MachinePrecision] * N[(N[(N[(N[(2.0 * N[Abs[x], $MachinePrecision]), $MachinePrecision] + N[(N[(2.0 / 3.0), $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 / 5.0), $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 / 21.0), $MachinePrecision] * N[(N[(t$95$1 * N[Abs[x], $MachinePrecision]), $MachinePrecision] * N[Abs[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(\left|x\right| \cdot \left|x\right|\right) \cdot \left|x\right|\\
t_1 := \left(t\_0 \cdot \left|x\right|\right) \cdot \left|x\right|\\
\left|\frac{1}{\sqrt{\pi}} \cdot \left(\left(\left(2 \cdot \left|x\right| + \frac{2}{3} \cdot t\_0\right) + \frac{1}{5} \cdot t\_1\right) + \frac{1}{21} \cdot \left(\left(t\_1 \cdot \left|x\right|\right) \cdot \left|x\right|\right)\right)\right|
\end{array}
\end{array}
(FPCore (x)
:precision binary64
(fabs
(*
(* (pow PI -0.5) (fabs x))
(+
2.0
(*
(* x x)
(+
0.6666666666666666
(* (* x (+ 0.2 (* x (* x 0.047619047619047616)))) x)))))))
double code(double x) {
return fabs(((pow(((double) M_PI), -0.5) * fabs(x)) * (2.0 + ((x * x) * (0.6666666666666666 + ((x * (0.2 + (x * (x * 0.047619047619047616)))) * x))))));
}
public static double code(double x) {
return Math.abs(((Math.pow(Math.PI, -0.5) * Math.abs(x)) * (2.0 + ((x * x) * (0.6666666666666666 + ((x * (0.2 + (x * (x * 0.047619047619047616)))) * x))))));
}
def code(x): return math.fabs(((math.pow(math.pi, -0.5) * math.fabs(x)) * (2.0 + ((x * x) * (0.6666666666666666 + ((x * (0.2 + (x * (x * 0.047619047619047616)))) * x))))))
function code(x) return abs(Float64(Float64((pi ^ -0.5) * abs(x)) * Float64(2.0 + Float64(Float64(x * x) * Float64(0.6666666666666666 + Float64(Float64(x * Float64(0.2 + Float64(x * Float64(x * 0.047619047619047616)))) * x)))))) end
function tmp = code(x) tmp = abs((((pi ^ -0.5) * abs(x)) * (2.0 + ((x * x) * (0.6666666666666666 + ((x * (0.2 + (x * (x * 0.047619047619047616)))) * x)))))); end
code[x_] := N[Abs[N[(N[(N[Power[Pi, -0.5], $MachinePrecision] * N[Abs[x], $MachinePrecision]), $MachinePrecision] * N[(2.0 + N[(N[(x * x), $MachinePrecision] * N[(0.6666666666666666 + N[(N[(x * N[(0.2 + N[(x * N[(x * 0.047619047619047616), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\left|\left({\pi}^{-0.5} \cdot \left|x\right|\right) \cdot \left(2 + \left(x \cdot x\right) \cdot \left(0.6666666666666666 + \left(x \cdot \left(0.2 + x \cdot \left(x \cdot 0.047619047619047616\right)\right)\right) \cdot x\right)\right)\right|
\end{array}
Initial program 99.5%
Simplified0
Applied egg-rr0
Applied egg-rr0
(FPCore (x)
:precision binary64
(if (<= (fabs x) 0.04)
(fabs
(*
(* (pow PI -0.5) (fabs x))
(+ 2.0 (* (* x x) (+ 0.6666666666666666 (* (* x x) 0.2))))))
(*
(/ (* x 0.047619047619047616) (fabs (/ (sqrt PI) x)))
(* (* x (* x (* x x))) x))))
double code(double x) {
double tmp;
if (fabs(x) <= 0.04) {
tmp = fabs(((pow(((double) M_PI), -0.5) * fabs(x)) * (2.0 + ((x * x) * (0.6666666666666666 + ((x * x) * 0.2))))));
} else {
tmp = ((x * 0.047619047619047616) / fabs((sqrt(((double) M_PI)) / x))) * ((x * (x * (x * x))) * x);
}
return tmp;
}
public static double code(double x) {
double tmp;
if (Math.abs(x) <= 0.04) {
tmp = Math.abs(((Math.pow(Math.PI, -0.5) * Math.abs(x)) * (2.0 + ((x * x) * (0.6666666666666666 + ((x * x) * 0.2))))));
} else {
tmp = ((x * 0.047619047619047616) / Math.abs((Math.sqrt(Math.PI) / x))) * ((x * (x * (x * x))) * x);
}
return tmp;
}
def code(x): tmp = 0 if math.fabs(x) <= 0.04: tmp = math.fabs(((math.pow(math.pi, -0.5) * math.fabs(x)) * (2.0 + ((x * x) * (0.6666666666666666 + ((x * x) * 0.2)))))) else: tmp = ((x * 0.047619047619047616) / math.fabs((math.sqrt(math.pi) / x))) * ((x * (x * (x * x))) * x) return tmp
function code(x) tmp = 0.0 if (abs(x) <= 0.04) tmp = abs(Float64(Float64((pi ^ -0.5) * abs(x)) * Float64(2.0 + Float64(Float64(x * x) * Float64(0.6666666666666666 + Float64(Float64(x * x) * 0.2)))))); else tmp = Float64(Float64(Float64(x * 0.047619047619047616) / abs(Float64(sqrt(pi) / x))) * Float64(Float64(x * Float64(x * Float64(x * x))) * x)); end return tmp end
function tmp_2 = code(x) tmp = 0.0; if (abs(x) <= 0.04) tmp = abs((((pi ^ -0.5) * abs(x)) * (2.0 + ((x * x) * (0.6666666666666666 + ((x * x) * 0.2)))))); else tmp = ((x * 0.047619047619047616) / abs((sqrt(pi) / x))) * ((x * (x * (x * x))) * x); end tmp_2 = tmp; end
code[x_] := If[LessEqual[N[Abs[x], $MachinePrecision], 0.04], N[Abs[N[(N[(N[Power[Pi, -0.5], $MachinePrecision] * N[Abs[x], $MachinePrecision]), $MachinePrecision] * N[(2.0 + N[(N[(x * x), $MachinePrecision] * N[(0.6666666666666666 + N[(N[(x * x), $MachinePrecision] * 0.2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(N[(N[(x * 0.047619047619047616), $MachinePrecision] / N[Abs[N[(N[Sqrt[Pi], $MachinePrecision] / x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(N[(x * N[(x * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\left|x\right| \leq 0.04:\\
\;\;\;\;\left|\left({\pi}^{-0.5} \cdot \left|x\right|\right) \cdot \left(2 + \left(x \cdot x\right) \cdot \left(0.6666666666666666 + \left(x \cdot x\right) \cdot 0.2\right)\right)\right|\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot 0.047619047619047616}{\left|\frac{\sqrt{\pi}}{x}\right|} \cdot \left(\left(x \cdot \left(x \cdot \left(x \cdot x\right)\right)\right) \cdot x\right)\\
\end{array}
\end{array}
if (fabs.f64 x) < 0.0400000000000000008Initial program 99.9%
Simplified0
Applied egg-rr0
Taylor expanded in x around 0 0
Simplified0
if 0.0400000000000000008 < (fabs.f64 x) Initial program 98.8%
Simplified0
Taylor expanded in x around inf 0
Simplified0
Applied egg-rr0
Applied egg-rr0
Applied egg-rr0
(FPCore (x)
:precision binary64
(if (<= (fabs x) 0.04)
(fabs
(*
(fabs x)
(/ 1.0 (* (sqrt PI) (+ 0.5 (* x (* x -0.16666666666666666)))))))
(*
(/ (* x 0.047619047619047616) (fabs (/ (sqrt PI) x)))
(* (* x (* x (* x x))) x))))
double code(double x) {
double tmp;
if (fabs(x) <= 0.04) {
tmp = fabs((fabs(x) * (1.0 / (sqrt(((double) M_PI)) * (0.5 + (x * (x * -0.16666666666666666)))))));
} else {
tmp = ((x * 0.047619047619047616) / fabs((sqrt(((double) M_PI)) / x))) * ((x * (x * (x * x))) * x);
}
return tmp;
}
public static double code(double x) {
double tmp;
if (Math.abs(x) <= 0.04) {
tmp = Math.abs((Math.abs(x) * (1.0 / (Math.sqrt(Math.PI) * (0.5 + (x * (x * -0.16666666666666666)))))));
} else {
tmp = ((x * 0.047619047619047616) / Math.abs((Math.sqrt(Math.PI) / x))) * ((x * (x * (x * x))) * x);
}
return tmp;
}
def code(x): tmp = 0 if math.fabs(x) <= 0.04: tmp = math.fabs((math.fabs(x) * (1.0 / (math.sqrt(math.pi) * (0.5 + (x * (x * -0.16666666666666666))))))) else: tmp = ((x * 0.047619047619047616) / math.fabs((math.sqrt(math.pi) / x))) * ((x * (x * (x * x))) * x) return tmp
function code(x) tmp = 0.0 if (abs(x) <= 0.04) tmp = abs(Float64(abs(x) * Float64(1.0 / Float64(sqrt(pi) * Float64(0.5 + Float64(x * Float64(x * -0.16666666666666666))))))); else tmp = Float64(Float64(Float64(x * 0.047619047619047616) / abs(Float64(sqrt(pi) / x))) * Float64(Float64(x * Float64(x * Float64(x * x))) * x)); end return tmp end
function tmp_2 = code(x) tmp = 0.0; if (abs(x) <= 0.04) tmp = abs((abs(x) * (1.0 / (sqrt(pi) * (0.5 + (x * (x * -0.16666666666666666))))))); else tmp = ((x * 0.047619047619047616) / abs((sqrt(pi) / x))) * ((x * (x * (x * x))) * x); end tmp_2 = tmp; end
code[x_] := If[LessEqual[N[Abs[x], $MachinePrecision], 0.04], N[Abs[N[(N[Abs[x], $MachinePrecision] * N[(1.0 / N[(N[Sqrt[Pi], $MachinePrecision] * N[(0.5 + N[(x * N[(x * -0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(N[(N[(x * 0.047619047619047616), $MachinePrecision] / N[Abs[N[(N[Sqrt[Pi], $MachinePrecision] / x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(N[(x * N[(x * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\left|x\right| \leq 0.04:\\
\;\;\;\;\left|\left|x\right| \cdot \frac{1}{\sqrt{\pi} \cdot \left(0.5 + x \cdot \left(x \cdot -0.16666666666666666\right)\right)}\right|\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot 0.047619047619047616}{\left|\frac{\sqrt{\pi}}{x}\right|} \cdot \left(\left(x \cdot \left(x \cdot \left(x \cdot x\right)\right)\right) \cdot x\right)\\
\end{array}
\end{array}
if (fabs.f64 x) < 0.0400000000000000008Initial program 99.9%
Simplified0
Taylor expanded in x around 0 0
Simplified0
Applied egg-rr0
Taylor expanded in x around 0 0
Simplified0
if 0.0400000000000000008 < (fabs.f64 x) Initial program 98.8%
Simplified0
Taylor expanded in x around inf 0
Simplified0
Applied egg-rr0
Applied egg-rr0
Applied egg-rr0
(FPCore (x)
:precision binary64
(fabs
(*
(* (pow PI -0.5) (fabs x))
(+
2.0
(*
(* x x)
(+
0.6666666666666666
(* (* x x) (+ 0.2 (* x (* x 0.047619047619047616))))))))))
double code(double x) {
return fabs(((pow(((double) M_PI), -0.5) * fabs(x)) * (2.0 + ((x * x) * (0.6666666666666666 + ((x * x) * (0.2 + (x * (x * 0.047619047619047616)))))))));
}
public static double code(double x) {
return Math.abs(((Math.pow(Math.PI, -0.5) * Math.abs(x)) * (2.0 + ((x * x) * (0.6666666666666666 + ((x * x) * (0.2 + (x * (x * 0.047619047619047616)))))))));
}
def code(x): return math.fabs(((math.pow(math.pi, -0.5) * math.fabs(x)) * (2.0 + ((x * x) * (0.6666666666666666 + ((x * x) * (0.2 + (x * (x * 0.047619047619047616)))))))))
function code(x) return abs(Float64(Float64((pi ^ -0.5) * abs(x)) * Float64(2.0 + Float64(Float64(x * x) * Float64(0.6666666666666666 + Float64(Float64(x * x) * Float64(0.2 + Float64(x * Float64(x * 0.047619047619047616))))))))) end
function tmp = code(x) tmp = abs((((pi ^ -0.5) * abs(x)) * (2.0 + ((x * x) * (0.6666666666666666 + ((x * x) * (0.2 + (x * (x * 0.047619047619047616))))))))); end
code[x_] := N[Abs[N[(N[(N[Power[Pi, -0.5], $MachinePrecision] * N[Abs[x], $MachinePrecision]), $MachinePrecision] * N[(2.0 + N[(N[(x * x), $MachinePrecision] * N[(0.6666666666666666 + N[(N[(x * x), $MachinePrecision] * N[(0.2 + N[(x * N[(x * 0.047619047619047616), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\left|\left({\pi}^{-0.5} \cdot \left|x\right|\right) \cdot \left(2 + \left(x \cdot x\right) \cdot \left(0.6666666666666666 + \left(x \cdot x\right) \cdot \left(0.2 + x \cdot \left(x \cdot 0.047619047619047616\right)\right)\right)\right)\right|
\end{array}
Initial program 99.5%
Simplified0
Applied egg-rr0
(FPCore (x)
:precision binary64
(*
(fabs x)
(fabs
(/
(+
2.0
(*
(* x x)
(+
0.6666666666666666
(* (* x x) (+ 0.2 (* 0.047619047619047616 (* x x)))))))
(sqrt PI)))))
double code(double x) {
return fabs(x) * fabs(((2.0 + ((x * x) * (0.6666666666666666 + ((x * x) * (0.2 + (0.047619047619047616 * (x * x))))))) / sqrt(((double) M_PI))));
}
public static double code(double x) {
return Math.abs(x) * Math.abs(((2.0 + ((x * x) * (0.6666666666666666 + ((x * x) * (0.2 + (0.047619047619047616 * (x * x))))))) / Math.sqrt(Math.PI)));
}
def code(x): return math.fabs(x) * math.fabs(((2.0 + ((x * x) * (0.6666666666666666 + ((x * x) * (0.2 + (0.047619047619047616 * (x * x))))))) / math.sqrt(math.pi)))
function code(x) return Float64(abs(x) * abs(Float64(Float64(2.0 + Float64(Float64(x * x) * Float64(0.6666666666666666 + Float64(Float64(x * x) * Float64(0.2 + Float64(0.047619047619047616 * Float64(x * x))))))) / sqrt(pi)))) end
function tmp = code(x) tmp = abs(x) * abs(((2.0 + ((x * x) * (0.6666666666666666 + ((x * x) * (0.2 + (0.047619047619047616 * (x * x))))))) / sqrt(pi))); end
code[x_] := N[(N[Abs[x], $MachinePrecision] * N[Abs[N[(N[(2.0 + N[(N[(x * x), $MachinePrecision] * N[(0.6666666666666666 + N[(N[(x * x), $MachinePrecision] * N[(0.2 + N[(0.047619047619047616 * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sqrt[Pi], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left|x\right| \cdot \left|\frac{2 + \left(x \cdot x\right) \cdot \left(0.6666666666666666 + \left(x \cdot x\right) \cdot \left(0.2 + 0.047619047619047616 \cdot \left(x \cdot x\right)\right)\right)}{\sqrt{\pi}}\right|
\end{array}
Initial program 99.5%
Simplified0
Applied egg-rr0
(FPCore (x)
:precision binary64
(fabs
(*
(/ (fabs x) (sqrt PI))
(+
2.0
(*
(* x x)
(+
0.6666666666666666
(* (* x (+ 0.2 (* x (* x 0.047619047619047616)))) x)))))))
double code(double x) {
return fabs(((fabs(x) / sqrt(((double) M_PI))) * (2.0 + ((x * x) * (0.6666666666666666 + ((x * (0.2 + (x * (x * 0.047619047619047616)))) * x))))));
}
public static double code(double x) {
return Math.abs(((Math.abs(x) / Math.sqrt(Math.PI)) * (2.0 + ((x * x) * (0.6666666666666666 + ((x * (0.2 + (x * (x * 0.047619047619047616)))) * x))))));
}
def code(x): return math.fabs(((math.fabs(x) / math.sqrt(math.pi)) * (2.0 + ((x * x) * (0.6666666666666666 + ((x * (0.2 + (x * (x * 0.047619047619047616)))) * x))))))
function code(x) return abs(Float64(Float64(abs(x) / sqrt(pi)) * Float64(2.0 + Float64(Float64(x * x) * Float64(0.6666666666666666 + Float64(Float64(x * Float64(0.2 + Float64(x * Float64(x * 0.047619047619047616)))) * x)))))) end
function tmp = code(x) tmp = abs(((abs(x) / sqrt(pi)) * (2.0 + ((x * x) * (0.6666666666666666 + ((x * (0.2 + (x * (x * 0.047619047619047616)))) * x)))))); end
code[x_] := N[Abs[N[(N[(N[Abs[x], $MachinePrecision] / N[Sqrt[Pi], $MachinePrecision]), $MachinePrecision] * N[(2.0 + N[(N[(x * x), $MachinePrecision] * N[(0.6666666666666666 + N[(N[(x * N[(0.2 + N[(x * N[(x * 0.047619047619047616), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\left|\frac{\left|x\right|}{\sqrt{\pi}} \cdot \left(2 + \left(x \cdot x\right) \cdot \left(0.6666666666666666 + \left(x \cdot \left(0.2 + x \cdot \left(x \cdot 0.047619047619047616\right)\right)\right) \cdot x\right)\right)\right|
\end{array}
Initial program 99.5%
Simplified0
Applied egg-rr0
Applied egg-rr0
Applied egg-rr0
(FPCore (x)
:precision binary64
(fabs
(*
(/ (fabs x) (sqrt PI))
(+
2.0
(*
(* x x)
(+
0.6666666666666666
(* (* x x) (+ 0.2 (* x (* x 0.047619047619047616))))))))))
double code(double x) {
return fabs(((fabs(x) / sqrt(((double) M_PI))) * (2.0 + ((x * x) * (0.6666666666666666 + ((x * x) * (0.2 + (x * (x * 0.047619047619047616)))))))));
}
public static double code(double x) {
return Math.abs(((Math.abs(x) / Math.sqrt(Math.PI)) * (2.0 + ((x * x) * (0.6666666666666666 + ((x * x) * (0.2 + (x * (x * 0.047619047619047616)))))))));
}
def code(x): return math.fabs(((math.fabs(x) / math.sqrt(math.pi)) * (2.0 + ((x * x) * (0.6666666666666666 + ((x * x) * (0.2 + (x * (x * 0.047619047619047616)))))))))
function code(x) return abs(Float64(Float64(abs(x) / sqrt(pi)) * Float64(2.0 + Float64(Float64(x * x) * Float64(0.6666666666666666 + Float64(Float64(x * x) * Float64(0.2 + Float64(x * Float64(x * 0.047619047619047616))))))))) end
function tmp = code(x) tmp = abs(((abs(x) / sqrt(pi)) * (2.0 + ((x * x) * (0.6666666666666666 + ((x * x) * (0.2 + (x * (x * 0.047619047619047616))))))))); end
code[x_] := N[Abs[N[(N[(N[Abs[x], $MachinePrecision] / N[Sqrt[Pi], $MachinePrecision]), $MachinePrecision] * N[(2.0 + N[(N[(x * x), $MachinePrecision] * N[(0.6666666666666666 + N[(N[(x * x), $MachinePrecision] * N[(0.2 + N[(x * N[(x * 0.047619047619047616), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\left|\frac{\left|x\right|}{\sqrt{\pi}} \cdot \left(2 + \left(x \cdot x\right) \cdot \left(0.6666666666666666 + \left(x \cdot x\right) \cdot \left(0.2 + x \cdot \left(x \cdot 0.047619047619047616\right)\right)\right)\right)\right|
\end{array}
Initial program 99.5%
Simplified0
(FPCore (x)
:precision binary64
(if (<= (fabs x) 0.04)
(fabs (* (/ (+ 2.0 (* x (* x 0.6666666666666666))) (sqrt PI)) x))
(*
(/ (* x 0.047619047619047616) (fabs (/ (sqrt PI) x)))
(* (* x (* x (* x x))) x))))
double code(double x) {
double tmp;
if (fabs(x) <= 0.04) {
tmp = fabs((((2.0 + (x * (x * 0.6666666666666666))) / sqrt(((double) M_PI))) * x));
} else {
tmp = ((x * 0.047619047619047616) / fabs((sqrt(((double) M_PI)) / x))) * ((x * (x * (x * x))) * x);
}
return tmp;
}
public static double code(double x) {
double tmp;
if (Math.abs(x) <= 0.04) {
tmp = Math.abs((((2.0 + (x * (x * 0.6666666666666666))) / Math.sqrt(Math.PI)) * x));
} else {
tmp = ((x * 0.047619047619047616) / Math.abs((Math.sqrt(Math.PI) / x))) * ((x * (x * (x * x))) * x);
}
return tmp;
}
def code(x): tmp = 0 if math.fabs(x) <= 0.04: tmp = math.fabs((((2.0 + (x * (x * 0.6666666666666666))) / math.sqrt(math.pi)) * x)) else: tmp = ((x * 0.047619047619047616) / math.fabs((math.sqrt(math.pi) / x))) * ((x * (x * (x * x))) * x) return tmp
function code(x) tmp = 0.0 if (abs(x) <= 0.04) tmp = abs(Float64(Float64(Float64(2.0 + Float64(x * Float64(x * 0.6666666666666666))) / sqrt(pi)) * x)); else tmp = Float64(Float64(Float64(x * 0.047619047619047616) / abs(Float64(sqrt(pi) / x))) * Float64(Float64(x * Float64(x * Float64(x * x))) * x)); end return tmp end
function tmp_2 = code(x) tmp = 0.0; if (abs(x) <= 0.04) tmp = abs((((2.0 + (x * (x * 0.6666666666666666))) / sqrt(pi)) * x)); else tmp = ((x * 0.047619047619047616) / abs((sqrt(pi) / x))) * ((x * (x * (x * x))) * x); end tmp_2 = tmp; end
code[x_] := If[LessEqual[N[Abs[x], $MachinePrecision], 0.04], N[Abs[N[(N[(N[(2.0 + N[(x * N[(x * 0.6666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sqrt[Pi], $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision]], $MachinePrecision], N[(N[(N[(x * 0.047619047619047616), $MachinePrecision] / N[Abs[N[(N[Sqrt[Pi], $MachinePrecision] / x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(N[(x * N[(x * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\left|x\right| \leq 0.04:\\
\;\;\;\;\left|\frac{2 + x \cdot \left(x \cdot 0.6666666666666666\right)}{\sqrt{\pi}} \cdot x\right|\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot 0.047619047619047616}{\left|\frac{\sqrt{\pi}}{x}\right|} \cdot \left(\left(x \cdot \left(x \cdot \left(x \cdot x\right)\right)\right) \cdot x\right)\\
\end{array}
\end{array}
if (fabs.f64 x) < 0.0400000000000000008Initial program 99.9%
Simplified0
Taylor expanded in x around 0 0
Simplified0
Applied egg-rr0
if 0.0400000000000000008 < (fabs.f64 x) Initial program 98.8%
Simplified0
Taylor expanded in x around inf 0
Simplified0
Applied egg-rr0
Applied egg-rr0
Applied egg-rr0
(FPCore (x)
:precision binary64
(if (<= (fabs x) 0.04)
(fabs (* (/ (+ 2.0 (* x (* x 0.6666666666666666))) (sqrt PI)) x))
(*
(* (* x (* 0.047619047619047616 (* x (fabs x)))) x)
(/ (* x (* x x)) (sqrt PI)))))
double code(double x) {
double tmp;
if (fabs(x) <= 0.04) {
tmp = fabs((((2.0 + (x * (x * 0.6666666666666666))) / sqrt(((double) M_PI))) * x));
} else {
tmp = ((x * (0.047619047619047616 * (x * fabs(x)))) * x) * ((x * (x * x)) / sqrt(((double) M_PI)));
}
return tmp;
}
public static double code(double x) {
double tmp;
if (Math.abs(x) <= 0.04) {
tmp = Math.abs((((2.0 + (x * (x * 0.6666666666666666))) / Math.sqrt(Math.PI)) * x));
} else {
tmp = ((x * (0.047619047619047616 * (x * Math.abs(x)))) * x) * ((x * (x * x)) / Math.sqrt(Math.PI));
}
return tmp;
}
def code(x): tmp = 0 if math.fabs(x) <= 0.04: tmp = math.fabs((((2.0 + (x * (x * 0.6666666666666666))) / math.sqrt(math.pi)) * x)) else: tmp = ((x * (0.047619047619047616 * (x * math.fabs(x)))) * x) * ((x * (x * x)) / math.sqrt(math.pi)) return tmp
function code(x) tmp = 0.0 if (abs(x) <= 0.04) tmp = abs(Float64(Float64(Float64(2.0 + Float64(x * Float64(x * 0.6666666666666666))) / sqrt(pi)) * x)); else tmp = Float64(Float64(Float64(x * Float64(0.047619047619047616 * Float64(x * abs(x)))) * x) * Float64(Float64(x * Float64(x * x)) / sqrt(pi))); end return tmp end
function tmp_2 = code(x) tmp = 0.0; if (abs(x) <= 0.04) tmp = abs((((2.0 + (x * (x * 0.6666666666666666))) / sqrt(pi)) * x)); else tmp = ((x * (0.047619047619047616 * (x * abs(x)))) * x) * ((x * (x * x)) / sqrt(pi)); end tmp_2 = tmp; end
code[x_] := If[LessEqual[N[Abs[x], $MachinePrecision], 0.04], N[Abs[N[(N[(N[(2.0 + N[(x * N[(x * 0.6666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sqrt[Pi], $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision]], $MachinePrecision], N[(N[(N[(x * N[(0.047619047619047616 * N[(x * N[Abs[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision] * N[(N[(x * N[(x * x), $MachinePrecision]), $MachinePrecision] / N[Sqrt[Pi], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\left|x\right| \leq 0.04:\\
\;\;\;\;\left|\frac{2 + x \cdot \left(x \cdot 0.6666666666666666\right)}{\sqrt{\pi}} \cdot x\right|\\
\mathbf{else}:\\
\;\;\;\;\left(\left(x \cdot \left(0.047619047619047616 \cdot \left(x \cdot \left|x\right|\right)\right)\right) \cdot x\right) \cdot \frac{x \cdot \left(x \cdot x\right)}{\sqrt{\pi}}\\
\end{array}
\end{array}
if (fabs.f64 x) < 0.0400000000000000008Initial program 99.9%
Simplified0
Taylor expanded in x around 0 0
Simplified0
Applied egg-rr0
if 0.0400000000000000008 < (fabs.f64 x) Initial program 98.8%
Simplified0
Taylor expanded in x around inf 0
Simplified0
Applied egg-rr0
Applied egg-rr0
(FPCore (x)
:precision binary64
(if (<= (fabs x) 0.04)
(fabs (* (/ (+ 2.0 (* x (* x 0.6666666666666666))) (sqrt PI)) x))
(*
x
(/
(* 0.047619047619047616 (* x (fabs x)))
(/ (sqrt PI) (* x (* x (* x x))))))))
double code(double x) {
double tmp;
if (fabs(x) <= 0.04) {
tmp = fabs((((2.0 + (x * (x * 0.6666666666666666))) / sqrt(((double) M_PI))) * x));
} else {
tmp = x * ((0.047619047619047616 * (x * fabs(x))) / (sqrt(((double) M_PI)) / (x * (x * (x * x)))));
}
return tmp;
}
public static double code(double x) {
double tmp;
if (Math.abs(x) <= 0.04) {
tmp = Math.abs((((2.0 + (x * (x * 0.6666666666666666))) / Math.sqrt(Math.PI)) * x));
} else {
tmp = x * ((0.047619047619047616 * (x * Math.abs(x))) / (Math.sqrt(Math.PI) / (x * (x * (x * x)))));
}
return tmp;
}
def code(x): tmp = 0 if math.fabs(x) <= 0.04: tmp = math.fabs((((2.0 + (x * (x * 0.6666666666666666))) / math.sqrt(math.pi)) * x)) else: tmp = x * ((0.047619047619047616 * (x * math.fabs(x))) / (math.sqrt(math.pi) / (x * (x * (x * x))))) return tmp
function code(x) tmp = 0.0 if (abs(x) <= 0.04) tmp = abs(Float64(Float64(Float64(2.0 + Float64(x * Float64(x * 0.6666666666666666))) / sqrt(pi)) * x)); else tmp = Float64(x * Float64(Float64(0.047619047619047616 * Float64(x * abs(x))) / Float64(sqrt(pi) / Float64(x * Float64(x * Float64(x * x)))))); end return tmp end
function tmp_2 = code(x) tmp = 0.0; if (abs(x) <= 0.04) tmp = abs((((2.0 + (x * (x * 0.6666666666666666))) / sqrt(pi)) * x)); else tmp = x * ((0.047619047619047616 * (x * abs(x))) / (sqrt(pi) / (x * (x * (x * x))))); end tmp_2 = tmp; end
code[x_] := If[LessEqual[N[Abs[x], $MachinePrecision], 0.04], N[Abs[N[(N[(N[(2.0 + N[(x * N[(x * 0.6666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sqrt[Pi], $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision]], $MachinePrecision], N[(x * N[(N[(0.047619047619047616 * N[(x * N[Abs[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[Sqrt[Pi], $MachinePrecision] / N[(x * N[(x * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\left|x\right| \leq 0.04:\\
\;\;\;\;\left|\frac{2 + x \cdot \left(x \cdot 0.6666666666666666\right)}{\sqrt{\pi}} \cdot x\right|\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{0.047619047619047616 \cdot \left(x \cdot \left|x\right|\right)}{\frac{\sqrt{\pi}}{x \cdot \left(x \cdot \left(x \cdot x\right)\right)}}\\
\end{array}
\end{array}
if (fabs.f64 x) < 0.0400000000000000008Initial program 99.9%
Simplified0
Taylor expanded in x around 0 0
Simplified0
Applied egg-rr0
if 0.0400000000000000008 < (fabs.f64 x) Initial program 98.8%
Simplified0
Taylor expanded in x around inf 0
Simplified0
Applied egg-rr0
Applied egg-rr0
(FPCore (x)
:precision binary64
(fabs
(*
(* (pow PI -0.5) (fabs x))
(+
2.0
(*
(* x x)
(+ 0.6666666666666666 (* 0.047619047619047616 (* x (* x (* x x))))))))))
double code(double x) {
return fabs(((pow(((double) M_PI), -0.5) * fabs(x)) * (2.0 + ((x * x) * (0.6666666666666666 + (0.047619047619047616 * (x * (x * (x * x)))))))));
}
public static double code(double x) {
return Math.abs(((Math.pow(Math.PI, -0.5) * Math.abs(x)) * (2.0 + ((x * x) * (0.6666666666666666 + (0.047619047619047616 * (x * (x * (x * x)))))))));
}
def code(x): return math.fabs(((math.pow(math.pi, -0.5) * math.fabs(x)) * (2.0 + ((x * x) * (0.6666666666666666 + (0.047619047619047616 * (x * (x * (x * x)))))))))
function code(x) return abs(Float64(Float64((pi ^ -0.5) * abs(x)) * Float64(2.0 + Float64(Float64(x * x) * Float64(0.6666666666666666 + Float64(0.047619047619047616 * Float64(x * Float64(x * Float64(x * x))))))))) end
function tmp = code(x) tmp = abs((((pi ^ -0.5) * abs(x)) * (2.0 + ((x * x) * (0.6666666666666666 + (0.047619047619047616 * (x * (x * (x * x))))))))); end
code[x_] := N[Abs[N[(N[(N[Power[Pi, -0.5], $MachinePrecision] * N[Abs[x], $MachinePrecision]), $MachinePrecision] * N[(2.0 + N[(N[(x * x), $MachinePrecision] * N[(0.6666666666666666 + N[(0.047619047619047616 * N[(x * N[(x * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\left|\left({\pi}^{-0.5} \cdot \left|x\right|\right) \cdot \left(2 + \left(x \cdot x\right) \cdot \left(0.6666666666666666 + 0.047619047619047616 \cdot \left(x \cdot \left(x \cdot \left(x \cdot x\right)\right)\right)\right)\right)\right|
\end{array}
Initial program 99.5%
Simplified0
Applied egg-rr0
Taylor expanded in x around inf 0
Simplified0
(FPCore (x)
:precision binary64
(*
(fabs x)
(fabs
(/
(+ 2.0 (* 0.047619047619047616 (* (* x x) (* x (* x (* x x))))))
(sqrt PI)))))
double code(double x) {
return fabs(x) * fabs(((2.0 + (0.047619047619047616 * ((x * x) * (x * (x * (x * x)))))) / sqrt(((double) M_PI))));
}
public static double code(double x) {
return Math.abs(x) * Math.abs(((2.0 + (0.047619047619047616 * ((x * x) * (x * (x * (x * x)))))) / Math.sqrt(Math.PI)));
}
def code(x): return math.fabs(x) * math.fabs(((2.0 + (0.047619047619047616 * ((x * x) * (x * (x * (x * x)))))) / math.sqrt(math.pi)))
function code(x) return Float64(abs(x) * abs(Float64(Float64(2.0 + Float64(0.047619047619047616 * Float64(Float64(x * x) * Float64(x * Float64(x * Float64(x * x)))))) / sqrt(pi)))) end
function tmp = code(x) tmp = abs(x) * abs(((2.0 + (0.047619047619047616 * ((x * x) * (x * (x * (x * x)))))) / sqrt(pi))); end
code[x_] := N[(N[Abs[x], $MachinePrecision] * N[Abs[N[(N[(2.0 + N[(0.047619047619047616 * N[(N[(x * x), $MachinePrecision] * N[(x * N[(x * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sqrt[Pi], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left|x\right| \cdot \left|\frac{2 + 0.047619047619047616 \cdot \left(\left(x \cdot x\right) \cdot \left(x \cdot \left(x \cdot \left(x \cdot x\right)\right)\right)\right)}{\sqrt{\pi}}\right|
\end{array}
Initial program 99.5%
Simplified0
Taylor expanded in x around inf 0
Simplified0
Applied egg-rr0
(FPCore (x)
:precision binary64
(let* ((t_0 (* x (* x x))))
(fabs
(* (/ (fabs x) (sqrt PI)) (+ 2.0 (* 0.047619047619047616 (* t_0 t_0)))))))
double code(double x) {
double t_0 = x * (x * x);
return fabs(((fabs(x) / sqrt(((double) M_PI))) * (2.0 + (0.047619047619047616 * (t_0 * t_0)))));
}
public static double code(double x) {
double t_0 = x * (x * x);
return Math.abs(((Math.abs(x) / Math.sqrt(Math.PI)) * (2.0 + (0.047619047619047616 * (t_0 * t_0)))));
}
def code(x): t_0 = x * (x * x) return math.fabs(((math.fabs(x) / math.sqrt(math.pi)) * (2.0 + (0.047619047619047616 * (t_0 * t_0)))))
function code(x) t_0 = Float64(x * Float64(x * x)) return abs(Float64(Float64(abs(x) / sqrt(pi)) * Float64(2.0 + Float64(0.047619047619047616 * Float64(t_0 * t_0))))) end
function tmp = code(x) t_0 = x * (x * x); tmp = abs(((abs(x) / sqrt(pi)) * (2.0 + (0.047619047619047616 * (t_0 * t_0))))); end
code[x_] := Block[{t$95$0 = N[(x * N[(x * x), $MachinePrecision]), $MachinePrecision]}, N[Abs[N[(N[(N[Abs[x], $MachinePrecision] / N[Sqrt[Pi], $MachinePrecision]), $MachinePrecision] * N[(2.0 + N[(0.047619047619047616 * N[(t$95$0 * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x \cdot \left(x \cdot x\right)\\
\left|\frac{\left|x\right|}{\sqrt{\pi}} \cdot \left(2 + 0.047619047619047616 \cdot \left(t\_0 \cdot t\_0\right)\right)\right|
\end{array}
\end{array}
Initial program 99.5%
Simplified0
Taylor expanded in x around inf 0
Simplified0
(FPCore (x) :precision binary64 (fabs (* (/ (+ 2.0 (* x (* x 0.6666666666666666))) (sqrt PI)) x)))
double code(double x) {
return fabs((((2.0 + (x * (x * 0.6666666666666666))) / sqrt(((double) M_PI))) * x));
}
public static double code(double x) {
return Math.abs((((2.0 + (x * (x * 0.6666666666666666))) / Math.sqrt(Math.PI)) * x));
}
def code(x): return math.fabs((((2.0 + (x * (x * 0.6666666666666666))) / math.sqrt(math.pi)) * x))
function code(x) return abs(Float64(Float64(Float64(2.0 + Float64(x * Float64(x * 0.6666666666666666))) / sqrt(pi)) * x)) end
function tmp = code(x) tmp = abs((((2.0 + (x * (x * 0.6666666666666666))) / sqrt(pi)) * x)); end
code[x_] := N[Abs[N[(N[(N[(2.0 + N[(x * N[(x * 0.6666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sqrt[Pi], $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\left|\frac{2 + x \cdot \left(x \cdot 0.6666666666666666\right)}{\sqrt{\pi}} \cdot x\right|
\end{array}
Initial program 99.5%
Simplified0
Taylor expanded in x around 0 0
Simplified0
Applied egg-rr0
(FPCore (x) :precision binary64 (* (/ 2.0 (sqrt PI)) (fabs x)))
double code(double x) {
return (2.0 / sqrt(((double) M_PI))) * fabs(x);
}
public static double code(double x) {
return (2.0 / Math.sqrt(Math.PI)) * Math.abs(x);
}
def code(x): return (2.0 / math.sqrt(math.pi)) * math.fabs(x)
function code(x) return Float64(Float64(2.0 / sqrt(pi)) * abs(x)) end
function tmp = code(x) tmp = (2.0 / sqrt(pi)) * abs(x); end
code[x_] := N[(N[(2.0 / N[Sqrt[Pi], $MachinePrecision]), $MachinePrecision] * N[Abs[x], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{2}{\sqrt{\pi}} \cdot \left|x\right|
\end{array}
Initial program 99.5%
Simplified0
Taylor expanded in x around 0 0
Simplified0
Applied egg-rr0
herbie shell --seed 2024110
(FPCore (x)
:name "Jmat.Real.erfi, branch x less than or equal to 0.5"
:precision binary64
:pre (<= x 0.5)
(fabs (* (/ 1.0 (sqrt PI)) (+ (+ (+ (* 2.0 (fabs x)) (* (/ 2.0 3.0) (* (* (fabs x) (fabs x)) (fabs x)))) (* (/ 1.0 5.0) (* (* (* (* (fabs x) (fabs x)) (fabs x)) (fabs x)) (fabs x)))) (* (/ 1.0 21.0) (* (* (* (* (* (* (fabs x) (fabs x)) (fabs x)) (fabs x)) (fabs x)) (fabs x)) (fabs x)))))))