
(FPCore (x)
:precision binary64
(let* ((t_0 (/ 1.0 (fabs x)))
(t_1 (* (* t_0 t_0) t_0))
(t_2 (* (* t_1 t_0) t_0)))
(*
(* (/ 1.0 (sqrt PI)) (exp (* (fabs x) (fabs x))))
(+
(+ (+ t_0 (* (/ 1.0 2.0) t_1)) (* (/ 3.0 4.0) t_2))
(* (/ 15.0 8.0) (* (* t_2 t_0) t_0))))))
double code(double x) {
double t_0 = 1.0 / fabs(x);
double t_1 = (t_0 * t_0) * t_0;
double t_2 = (t_1 * t_0) * t_0;
return ((1.0 / sqrt(((double) M_PI))) * exp((fabs(x) * fabs(x)))) * (((t_0 + ((1.0 / 2.0) * t_1)) + ((3.0 / 4.0) * t_2)) + ((15.0 / 8.0) * ((t_2 * t_0) * t_0)));
}
public static double code(double x) {
double t_0 = 1.0 / Math.abs(x);
double t_1 = (t_0 * t_0) * t_0;
double t_2 = (t_1 * t_0) * t_0;
return ((1.0 / Math.sqrt(Math.PI)) * Math.exp((Math.abs(x) * Math.abs(x)))) * (((t_0 + ((1.0 / 2.0) * t_1)) + ((3.0 / 4.0) * t_2)) + ((15.0 / 8.0) * ((t_2 * t_0) * t_0)));
}
def code(x): t_0 = 1.0 / math.fabs(x) t_1 = (t_0 * t_0) * t_0 t_2 = (t_1 * t_0) * t_0 return ((1.0 / math.sqrt(math.pi)) * math.exp((math.fabs(x) * math.fabs(x)))) * (((t_0 + ((1.0 / 2.0) * t_1)) + ((3.0 / 4.0) * t_2)) + ((15.0 / 8.0) * ((t_2 * t_0) * t_0)))
function code(x) t_0 = Float64(1.0 / abs(x)) t_1 = Float64(Float64(t_0 * t_0) * t_0) t_2 = Float64(Float64(t_1 * t_0) * t_0) return Float64(Float64(Float64(1.0 / sqrt(pi)) * exp(Float64(abs(x) * abs(x)))) * Float64(Float64(Float64(t_0 + Float64(Float64(1.0 / 2.0) * t_1)) + Float64(Float64(3.0 / 4.0) * t_2)) + Float64(Float64(15.0 / 8.0) * Float64(Float64(t_2 * t_0) * t_0)))) end
function tmp = code(x) t_0 = 1.0 / abs(x); t_1 = (t_0 * t_0) * t_0; t_2 = (t_1 * t_0) * t_0; tmp = ((1.0 / sqrt(pi)) * exp((abs(x) * abs(x)))) * (((t_0 + ((1.0 / 2.0) * t_1)) + ((3.0 / 4.0) * t_2)) + ((15.0 / 8.0) * ((t_2 * t_0) * t_0))); end
code[x_] := Block[{t$95$0 = N[(1.0 / N[Abs[x], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(t$95$0 * t$95$0), $MachinePrecision] * t$95$0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(t$95$1 * t$95$0), $MachinePrecision] * t$95$0), $MachinePrecision]}, N[(N[(N[(1.0 / N[Sqrt[Pi], $MachinePrecision]), $MachinePrecision] * N[Exp[N[(N[Abs[x], $MachinePrecision] * N[Abs[x], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(N[(N[(t$95$0 + N[(N[(1.0 / 2.0), $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision] + N[(N[(3.0 / 4.0), $MachinePrecision] * t$95$2), $MachinePrecision]), $MachinePrecision] + N[(N[(15.0 / 8.0), $MachinePrecision] * N[(N[(t$95$2 * t$95$0), $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{1}{\left|x\right|}\\
t_1 := \left(t\_0 \cdot t\_0\right) \cdot t\_0\\
t_2 := \left(t\_1 \cdot t\_0\right) \cdot t\_0\\
\left(\frac{1}{\sqrt{\pi}} \cdot e^{\left|x\right| \cdot \left|x\right|}\right) \cdot \left(\left(\left(t\_0 + \frac{1}{2} \cdot t\_1\right) + \frac{3}{4} \cdot t\_2\right) + \frac{15}{8} \cdot \left(\left(t\_2 \cdot t\_0\right) \cdot t\_0\right)\right)
\end{array}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 20 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x)
:precision binary64
(let* ((t_0 (/ 1.0 (fabs x)))
(t_1 (* (* t_0 t_0) t_0))
(t_2 (* (* t_1 t_0) t_0)))
(*
(* (/ 1.0 (sqrt PI)) (exp (* (fabs x) (fabs x))))
(+
(+ (+ t_0 (* (/ 1.0 2.0) t_1)) (* (/ 3.0 4.0) t_2))
(* (/ 15.0 8.0) (* (* t_2 t_0) t_0))))))
double code(double x) {
double t_0 = 1.0 / fabs(x);
double t_1 = (t_0 * t_0) * t_0;
double t_2 = (t_1 * t_0) * t_0;
return ((1.0 / sqrt(((double) M_PI))) * exp((fabs(x) * fabs(x)))) * (((t_0 + ((1.0 / 2.0) * t_1)) + ((3.0 / 4.0) * t_2)) + ((15.0 / 8.0) * ((t_2 * t_0) * t_0)));
}
public static double code(double x) {
double t_0 = 1.0 / Math.abs(x);
double t_1 = (t_0 * t_0) * t_0;
double t_2 = (t_1 * t_0) * t_0;
return ((1.0 / Math.sqrt(Math.PI)) * Math.exp((Math.abs(x) * Math.abs(x)))) * (((t_0 + ((1.0 / 2.0) * t_1)) + ((3.0 / 4.0) * t_2)) + ((15.0 / 8.0) * ((t_2 * t_0) * t_0)));
}
def code(x): t_0 = 1.0 / math.fabs(x) t_1 = (t_0 * t_0) * t_0 t_2 = (t_1 * t_0) * t_0 return ((1.0 / math.sqrt(math.pi)) * math.exp((math.fabs(x) * math.fabs(x)))) * (((t_0 + ((1.0 / 2.0) * t_1)) + ((3.0 / 4.0) * t_2)) + ((15.0 / 8.0) * ((t_2 * t_0) * t_0)))
function code(x) t_0 = Float64(1.0 / abs(x)) t_1 = Float64(Float64(t_0 * t_0) * t_0) t_2 = Float64(Float64(t_1 * t_0) * t_0) return Float64(Float64(Float64(1.0 / sqrt(pi)) * exp(Float64(abs(x) * abs(x)))) * Float64(Float64(Float64(t_0 + Float64(Float64(1.0 / 2.0) * t_1)) + Float64(Float64(3.0 / 4.0) * t_2)) + Float64(Float64(15.0 / 8.0) * Float64(Float64(t_2 * t_0) * t_0)))) end
function tmp = code(x) t_0 = 1.0 / abs(x); t_1 = (t_0 * t_0) * t_0; t_2 = (t_1 * t_0) * t_0; tmp = ((1.0 / sqrt(pi)) * exp((abs(x) * abs(x)))) * (((t_0 + ((1.0 / 2.0) * t_1)) + ((3.0 / 4.0) * t_2)) + ((15.0 / 8.0) * ((t_2 * t_0) * t_0))); end
code[x_] := Block[{t$95$0 = N[(1.0 / N[Abs[x], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(t$95$0 * t$95$0), $MachinePrecision] * t$95$0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(t$95$1 * t$95$0), $MachinePrecision] * t$95$0), $MachinePrecision]}, N[(N[(N[(1.0 / N[Sqrt[Pi], $MachinePrecision]), $MachinePrecision] * N[Exp[N[(N[Abs[x], $MachinePrecision] * N[Abs[x], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(N[(N[(t$95$0 + N[(N[(1.0 / 2.0), $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision] + N[(N[(3.0 / 4.0), $MachinePrecision] * t$95$2), $MachinePrecision]), $MachinePrecision] + N[(N[(15.0 / 8.0), $MachinePrecision] * N[(N[(t$95$2 * t$95$0), $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{1}{\left|x\right|}\\
t_1 := \left(t\_0 \cdot t\_0\right) \cdot t\_0\\
t_2 := \left(t\_1 \cdot t\_0\right) \cdot t\_0\\
\left(\frac{1}{\sqrt{\pi}} \cdot e^{\left|x\right| \cdot \left|x\right|}\right) \cdot \left(\left(\left(t\_0 + \frac{1}{2} \cdot t\_1\right) + \frac{3}{4} \cdot t\_2\right) + \frac{15}{8} \cdot \left(\left(t\_2 \cdot t\_0\right) \cdot t\_0\right)\right)
\end{array}
\end{array}
(FPCore (x)
:precision binary64
(pow
(exp -1.0)
(log
(/
(/ (* (sqrt PI) x) (exp (* x x)))
(+ 1.0 (/ (+ 0.5 (/ (+ 0.75 (/ 1.875 (* x x))) (* x x))) (* x x)))))))
double code(double x) {
return pow(exp(-1.0), log((((sqrt(((double) M_PI)) * x) / exp((x * x))) / (1.0 + ((0.5 + ((0.75 + (1.875 / (x * x))) / (x * x))) / (x * x))))));
}
public static double code(double x) {
return Math.pow(Math.exp(-1.0), Math.log((((Math.sqrt(Math.PI) * x) / Math.exp((x * x))) / (1.0 + ((0.5 + ((0.75 + (1.875 / (x * x))) / (x * x))) / (x * x))))));
}
def code(x): return math.pow(math.exp(-1.0), math.log((((math.sqrt(math.pi) * x) / math.exp((x * x))) / (1.0 + ((0.5 + ((0.75 + (1.875 / (x * x))) / (x * x))) / (x * x))))))
function code(x) return exp(-1.0) ^ log(Float64(Float64(Float64(sqrt(pi) * x) / exp(Float64(x * x))) / Float64(1.0 + Float64(Float64(0.5 + Float64(Float64(0.75 + Float64(1.875 / Float64(x * x))) / Float64(x * x))) / Float64(x * x))))) end
function tmp = code(x) tmp = exp(-1.0) ^ log((((sqrt(pi) * x) / exp((x * x))) / (1.0 + ((0.5 + ((0.75 + (1.875 / (x * x))) / (x * x))) / (x * x))))); end
code[x_] := N[Power[N[Exp[-1.0], $MachinePrecision], N[Log[N[(N[(N[(N[Sqrt[Pi], $MachinePrecision] * x), $MachinePrecision] / N[Exp[N[(x * x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[(1.0 + N[(N[(0.5 + N[(N[(0.75 + N[(1.875 / N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
{\left(e^{-1}\right)}^{\log \left(\frac{\frac{\sqrt{\pi} \cdot x}{e^{x \cdot x}}}{1 + \frac{0.5 + \frac{0.75 + \frac{1.875}{x \cdot x}}{x \cdot x}}{x \cdot x}}\right)}
\end{array}
Initial program 100.0%
Simplified100.0%
*-commutativeN/A
associate-/r*N/A
associate-*r/N/A
/-lowering-/.f64N/A
Applied egg-rr100.0%
clear-numN/A
inv-powN/A
pow-to-expN/A
exp-lowering-exp.f64N/A
*-lowering-*.f64N/A
Applied egg-rr100.0%
*-commutativeN/A
exp-prodN/A
pow-lowering-pow.f64N/A
exp-lowering-exp.f64N/A
rem-exp-logN/A
log-lowering-log.f64N/A
Applied egg-rr100.0%
(FPCore (x)
:precision binary64
(exp
(log
(/
(+ 1.0 (/ (+ 0.5 (/ (+ 0.75 (/ 1.875 (* x x))) (* x x))) (* x x)))
(/ (* (sqrt PI) x) (exp (* x x)))))))
double code(double x) {
return exp(log(((1.0 + ((0.5 + ((0.75 + (1.875 / (x * x))) / (x * x))) / (x * x))) / ((sqrt(((double) M_PI)) * x) / exp((x * x))))));
}
public static double code(double x) {
return Math.exp(Math.log(((1.0 + ((0.5 + ((0.75 + (1.875 / (x * x))) / (x * x))) / (x * x))) / ((Math.sqrt(Math.PI) * x) / Math.exp((x * x))))));
}
def code(x): return math.exp(math.log(((1.0 + ((0.5 + ((0.75 + (1.875 / (x * x))) / (x * x))) / (x * x))) / ((math.sqrt(math.pi) * x) / math.exp((x * x))))))
function code(x) return exp(log(Float64(Float64(1.0 + Float64(Float64(0.5 + Float64(Float64(0.75 + Float64(1.875 / Float64(x * x))) / Float64(x * x))) / Float64(x * x))) / Float64(Float64(sqrt(pi) * x) / exp(Float64(x * x)))))) end
function tmp = code(x) tmp = exp(log(((1.0 + ((0.5 + ((0.75 + (1.875 / (x * x))) / (x * x))) / (x * x))) / ((sqrt(pi) * x) / exp((x * x)))))); end
code[x_] := N[Exp[N[Log[N[(N[(1.0 + N[(N[(0.5 + N[(N[(0.75 + N[(1.875 / N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[(N[Sqrt[Pi], $MachinePrecision] * x), $MachinePrecision] / N[Exp[N[(x * x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
e^{\log \left(\frac{1 + \frac{0.5 + \frac{0.75 + \frac{1.875}{x \cdot x}}{x \cdot x}}{x \cdot x}}{\frac{\sqrt{\pi} \cdot x}{e^{x \cdot x}}}\right)}
\end{array}
Initial program 100.0%
Simplified100.0%
*-commutativeN/A
associate-/r*N/A
associate-*r/N/A
/-lowering-/.f64N/A
Applied egg-rr100.0%
clear-numN/A
inv-powN/A
pow-to-expN/A
exp-lowering-exp.f64N/A
*-lowering-*.f64N/A
Applied egg-rr100.0%
exp-lowering-exp.f64N/A
rem-log-expN/A
exp-to-powN/A
unpow-1N/A
clear-numN/A
log-lowering-log.f64N/A
Applied egg-rr100.0%
(FPCore (x) :precision binary64 (* (exp (* x x)) (* (+ 1.0 (/ (+ 0.5 (/ (+ 0.75 (/ 1.875 (* x x))) (* x x))) (* x x))) (/ (pow PI -0.5) (fabs x)))))
double code(double x) {
return exp((x * x)) * ((1.0 + ((0.5 + ((0.75 + (1.875 / (x * x))) / (x * x))) / (x * x))) * (pow(((double) M_PI), -0.5) / fabs(x)));
}
public static double code(double x) {
return Math.exp((x * x)) * ((1.0 + ((0.5 + ((0.75 + (1.875 / (x * x))) / (x * x))) / (x * x))) * (Math.pow(Math.PI, -0.5) / Math.abs(x)));
}
def code(x): return math.exp((x * x)) * ((1.0 + ((0.5 + ((0.75 + (1.875 / (x * x))) / (x * x))) / (x * x))) * (math.pow(math.pi, -0.5) / math.fabs(x)))
function code(x) return Float64(exp(Float64(x * x)) * Float64(Float64(1.0 + Float64(Float64(0.5 + Float64(Float64(0.75 + Float64(1.875 / Float64(x * x))) / Float64(x * x))) / Float64(x * x))) * Float64((pi ^ -0.5) / abs(x)))) end
function tmp = code(x) tmp = exp((x * x)) * ((1.0 + ((0.5 + ((0.75 + (1.875 / (x * x))) / (x * x))) / (x * x))) * ((pi ^ -0.5) / abs(x))); end
code[x_] := N[(N[Exp[N[(x * x), $MachinePrecision]], $MachinePrecision] * N[(N[(1.0 + N[(N[(0.5 + N[(N[(0.75 + N[(1.875 / N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[Power[Pi, -0.5], $MachinePrecision] / N[Abs[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
e^{x \cdot x} \cdot \left(\left(1 + \frac{0.5 + \frac{0.75 + \frac{1.875}{x \cdot x}}{x \cdot x}}{x \cdot x}\right) \cdot \frac{{\pi}^{-0.5}}{\left|x\right|}\right)
\end{array}
Initial program 100.0%
Simplified100.0%
pow1/2N/A
add-sqr-sqrtN/A
sqrt-unprodN/A
pow1/2N/A
pow-powN/A
pow-lowering-pow.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
PI-lowering-PI.f64N/A
metadata-eval100.0%
Applied egg-rr100.0%
Applied egg-rr100.0%
Final simplification100.0%
(FPCore (x)
:precision binary64
(/
(/
(*
(exp (* x x))
(+ 1.0 (/ (+ 0.5 (/ (+ 0.75 (/ 1.875 (* x x))) (* x x))) (* x x))))
x)
(sqrt PI)))
double code(double x) {
return ((exp((x * x)) * (1.0 + ((0.5 + ((0.75 + (1.875 / (x * x))) / (x * x))) / (x * x)))) / x) / sqrt(((double) M_PI));
}
public static double code(double x) {
return ((Math.exp((x * x)) * (1.0 + ((0.5 + ((0.75 + (1.875 / (x * x))) / (x * x))) / (x * x)))) / x) / Math.sqrt(Math.PI);
}
def code(x): return ((math.exp((x * x)) * (1.0 + ((0.5 + ((0.75 + (1.875 / (x * x))) / (x * x))) / (x * x)))) / x) / math.sqrt(math.pi)
function code(x) return Float64(Float64(Float64(exp(Float64(x * x)) * Float64(1.0 + Float64(Float64(0.5 + Float64(Float64(0.75 + Float64(1.875 / Float64(x * x))) / Float64(x * x))) / Float64(x * x)))) / x) / sqrt(pi)) end
function tmp = code(x) tmp = ((exp((x * x)) * (1.0 + ((0.5 + ((0.75 + (1.875 / (x * x))) / (x * x))) / (x * x)))) / x) / sqrt(pi); end
code[x_] := N[(N[(N[(N[Exp[N[(x * x), $MachinePrecision]], $MachinePrecision] * N[(1.0 + N[(N[(0.5 + N[(N[(0.75 + N[(1.875 / N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision] / N[Sqrt[Pi], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\frac{e^{x \cdot x} \cdot \left(1 + \frac{0.5 + \frac{0.75 + \frac{1.875}{x \cdot x}}{x \cdot x}}{x \cdot x}\right)}{x}}{\sqrt{\pi}}
\end{array}
Initial program 100.0%
Simplified100.0%
*-commutativeN/A
associate-/r*N/A
associate-*r/N/A
/-lowering-/.f64N/A
Applied egg-rr100.0%
/-lowering-/.f64N/A
Applied egg-rr100.0%
(FPCore (x) :precision binary64 (/ (+ 1.0 (/ (+ 0.5 (/ 0.75 (* x x))) (* x x))) (* (sqrt PI) (/ x (exp (* x x))))))
double code(double x) {
return (1.0 + ((0.5 + (0.75 / (x * x))) / (x * x))) / (sqrt(((double) M_PI)) * (x / exp((x * x))));
}
public static double code(double x) {
return (1.0 + ((0.5 + (0.75 / (x * x))) / (x * x))) / (Math.sqrt(Math.PI) * (x / Math.exp((x * x))));
}
def code(x): return (1.0 + ((0.5 + (0.75 / (x * x))) / (x * x))) / (math.sqrt(math.pi) * (x / math.exp((x * x))))
function code(x) return Float64(Float64(1.0 + Float64(Float64(0.5 + Float64(0.75 / Float64(x * x))) / Float64(x * x))) / Float64(sqrt(pi) * Float64(x / exp(Float64(x * x))))) end
function tmp = code(x) tmp = (1.0 + ((0.5 + (0.75 / (x * x))) / (x * x))) / (sqrt(pi) * (x / exp((x * x)))); end
code[x_] := N[(N[(1.0 + N[(N[(0.5 + N[(0.75 / N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[Sqrt[Pi], $MachinePrecision] * N[(x / N[Exp[N[(x * x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{1 + \frac{0.5 + \frac{0.75}{x \cdot x}}{x \cdot x}}{\sqrt{\pi} \cdot \frac{x}{e^{x \cdot x}}}
\end{array}
Initial program 100.0%
Simplified100.0%
*-commutativeN/A
associate-/r*N/A
associate-*r/N/A
/-lowering-/.f64N/A
Applied egg-rr100.0%
Taylor expanded in x around inf
/-lowering-/.f64N/A
unpow2N/A
*-lowering-*.f6499.7%
Simplified99.7%
/-lowering-/.f64N/A
Applied egg-rr99.7%
associate-/l/N/A
associate-/l*N/A
frac-2negN/A
/-lowering-/.f64N/A
neg-sub0N/A
--lowering--.f64N/A
+-lowering-+.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
Applied egg-rr99.7%
Final simplification99.7%
(FPCore (x) :precision binary64 (/ (/ (+ 1.0 (/ (+ 0.5 (/ 0.75 (* x x))) (* x x))) (/ x (exp (* x x)))) (sqrt PI)))
double code(double x) {
return ((1.0 + ((0.5 + (0.75 / (x * x))) / (x * x))) / (x / exp((x * x)))) / sqrt(((double) M_PI));
}
public static double code(double x) {
return ((1.0 + ((0.5 + (0.75 / (x * x))) / (x * x))) / (x / Math.exp((x * x)))) / Math.sqrt(Math.PI);
}
def code(x): return ((1.0 + ((0.5 + (0.75 / (x * x))) / (x * x))) / (x / math.exp((x * x)))) / math.sqrt(math.pi)
function code(x) return Float64(Float64(Float64(1.0 + Float64(Float64(0.5 + Float64(0.75 / Float64(x * x))) / Float64(x * x))) / Float64(x / exp(Float64(x * x)))) / sqrt(pi)) end
function tmp = code(x) tmp = ((1.0 + ((0.5 + (0.75 / (x * x))) / (x * x))) / (x / exp((x * x)))) / sqrt(pi); end
code[x_] := N[(N[(N[(1.0 + N[(N[(0.5 + N[(0.75 / N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x / N[Exp[N[(x * x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sqrt[Pi], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\frac{1 + \frac{0.5 + \frac{0.75}{x \cdot x}}{x \cdot x}}{\frac{x}{e^{x \cdot x}}}}{\sqrt{\pi}}
\end{array}
Initial program 100.0%
Simplified100.0%
*-commutativeN/A
associate-/r*N/A
associate-*r/N/A
/-lowering-/.f64N/A
Applied egg-rr100.0%
Taylor expanded in x around inf
/-lowering-/.f64N/A
unpow2N/A
*-lowering-*.f6499.7%
Simplified99.7%
/-lowering-/.f64N/A
Applied egg-rr99.7%
(FPCore (x) :precision binary64 (/ (/ (+ 1.0 (/ 0.5 (* x x))) (/ x (exp (* x x)))) (sqrt PI)))
double code(double x) {
return ((1.0 + (0.5 / (x * x))) / (x / exp((x * x)))) / sqrt(((double) M_PI));
}
public static double code(double x) {
return ((1.0 + (0.5 / (x * x))) / (x / Math.exp((x * x)))) / Math.sqrt(Math.PI);
}
def code(x): return ((1.0 + (0.5 / (x * x))) / (x / math.exp((x * x)))) / math.sqrt(math.pi)
function code(x) return Float64(Float64(Float64(1.0 + Float64(0.5 / Float64(x * x))) / Float64(x / exp(Float64(x * x)))) / sqrt(pi)) end
function tmp = code(x) tmp = ((1.0 + (0.5 / (x * x))) / (x / exp((x * x)))) / sqrt(pi); end
code[x_] := N[(N[(N[(1.0 + N[(0.5 / N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x / N[Exp[N[(x * x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sqrt[Pi], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\frac{1 + \frac{0.5}{x \cdot x}}{\frac{x}{e^{x \cdot x}}}}{\sqrt{\pi}}
\end{array}
Initial program 100.0%
Simplified100.0%
*-commutativeN/A
associate-/r*N/A
associate-*r/N/A
/-lowering-/.f64N/A
Applied egg-rr100.0%
Taylor expanded in x around inf
/-lowering-/.f64N/A
unpow2N/A
*-lowering-*.f6499.7%
Simplified99.7%
/-lowering-/.f64N/A
Applied egg-rr99.7%
Taylor expanded in x around inf
+-lowering-+.f64N/A
associate-*r/N/A
metadata-evalN/A
/-lowering-/.f64N/A
unpow2N/A
*-lowering-*.f6499.7%
Simplified99.7%
(FPCore (x) :precision binary64 (/ (/ (exp (* x x)) x) (sqrt PI)))
double code(double x) {
return (exp((x * x)) / x) / sqrt(((double) M_PI));
}
public static double code(double x) {
return (Math.exp((x * x)) / x) / Math.sqrt(Math.PI);
}
def code(x): return (math.exp((x * x)) / x) / math.sqrt(math.pi)
function code(x) return Float64(Float64(exp(Float64(x * x)) / x) / sqrt(pi)) end
function tmp = code(x) tmp = (exp((x * x)) / x) / sqrt(pi); end
code[x_] := N[(N[(N[Exp[N[(x * x), $MachinePrecision]], $MachinePrecision] / x), $MachinePrecision] / N[Sqrt[Pi], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\frac{e^{x \cdot x}}{x}}{\sqrt{\pi}}
\end{array}
Initial program 100.0%
Simplified100.0%
*-commutativeN/A
associate-/r*N/A
associate-*r/N/A
/-lowering-/.f64N/A
Applied egg-rr100.0%
Taylor expanded in x around inf
/-lowering-/.f64N/A
exp-lowering-exp.f64N/A
unpow2N/A
*-lowering-*.f6499.7%
Simplified99.7%
(FPCore (x)
:precision binary64
(let* ((t_0 (* x (* x 0.5)))
(t_1 (+ 1.0 t_0))
(t_2 (* (* x x) t_1))
(t_3 (* (* x x) (* t_1 t_2)))
(t_4 (+ t_2 -1.0)))
(if (<= x 4e+38)
(/ (/ (/ (+ 1.0 (* t_2 t_3)) (+ 1.0 (* t_2 t_4))) x) (sqrt PI))
(if (<= x 1.35e+77)
(/ (/ (/ (+ t_3 -1.0) t_4) x) (sqrt PI))
(/ (/ (* x (* x t_0)) x) (sqrt PI))))))
double code(double x) {
double t_0 = x * (x * 0.5);
double t_1 = 1.0 + t_0;
double t_2 = (x * x) * t_1;
double t_3 = (x * x) * (t_1 * t_2);
double t_4 = t_2 + -1.0;
double tmp;
if (x <= 4e+38) {
tmp = (((1.0 + (t_2 * t_3)) / (1.0 + (t_2 * t_4))) / x) / sqrt(((double) M_PI));
} else if (x <= 1.35e+77) {
tmp = (((t_3 + -1.0) / t_4) / x) / sqrt(((double) M_PI));
} else {
tmp = ((x * (x * t_0)) / x) / sqrt(((double) M_PI));
}
return tmp;
}
public static double code(double x) {
double t_0 = x * (x * 0.5);
double t_1 = 1.0 + t_0;
double t_2 = (x * x) * t_1;
double t_3 = (x * x) * (t_1 * t_2);
double t_4 = t_2 + -1.0;
double tmp;
if (x <= 4e+38) {
tmp = (((1.0 + (t_2 * t_3)) / (1.0 + (t_2 * t_4))) / x) / Math.sqrt(Math.PI);
} else if (x <= 1.35e+77) {
tmp = (((t_3 + -1.0) / t_4) / x) / Math.sqrt(Math.PI);
} else {
tmp = ((x * (x * t_0)) / x) / Math.sqrt(Math.PI);
}
return tmp;
}
def code(x): t_0 = x * (x * 0.5) t_1 = 1.0 + t_0 t_2 = (x * x) * t_1 t_3 = (x * x) * (t_1 * t_2) t_4 = t_2 + -1.0 tmp = 0 if x <= 4e+38: tmp = (((1.0 + (t_2 * t_3)) / (1.0 + (t_2 * t_4))) / x) / math.sqrt(math.pi) elif x <= 1.35e+77: tmp = (((t_3 + -1.0) / t_4) / x) / math.sqrt(math.pi) else: tmp = ((x * (x * t_0)) / x) / math.sqrt(math.pi) return tmp
function code(x) t_0 = Float64(x * Float64(x * 0.5)) t_1 = Float64(1.0 + t_0) t_2 = Float64(Float64(x * x) * t_1) t_3 = Float64(Float64(x * x) * Float64(t_1 * t_2)) t_4 = Float64(t_2 + -1.0) tmp = 0.0 if (x <= 4e+38) tmp = Float64(Float64(Float64(Float64(1.0 + Float64(t_2 * t_3)) / Float64(1.0 + Float64(t_2 * t_4))) / x) / sqrt(pi)); elseif (x <= 1.35e+77) tmp = Float64(Float64(Float64(Float64(t_3 + -1.0) / t_4) / x) / sqrt(pi)); else tmp = Float64(Float64(Float64(x * Float64(x * t_0)) / x) / sqrt(pi)); end return tmp end
function tmp_2 = code(x) t_0 = x * (x * 0.5); t_1 = 1.0 + t_0; t_2 = (x * x) * t_1; t_3 = (x * x) * (t_1 * t_2); t_4 = t_2 + -1.0; tmp = 0.0; if (x <= 4e+38) tmp = (((1.0 + (t_2 * t_3)) / (1.0 + (t_2 * t_4))) / x) / sqrt(pi); elseif (x <= 1.35e+77) tmp = (((t_3 + -1.0) / t_4) / x) / sqrt(pi); else tmp = ((x * (x * t_0)) / x) / sqrt(pi); end tmp_2 = tmp; end
code[x_] := Block[{t$95$0 = N[(x * N[(x * 0.5), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(1.0 + t$95$0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x * x), $MachinePrecision] * t$95$1), $MachinePrecision]}, Block[{t$95$3 = N[(N[(x * x), $MachinePrecision] * N[(t$95$1 * t$95$2), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(t$95$2 + -1.0), $MachinePrecision]}, If[LessEqual[x, 4e+38], N[(N[(N[(N[(1.0 + N[(t$95$2 * t$95$3), $MachinePrecision]), $MachinePrecision] / N[(1.0 + N[(t$95$2 * t$95$4), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision] / N[Sqrt[Pi], $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.35e+77], N[(N[(N[(N[(t$95$3 + -1.0), $MachinePrecision] / t$95$4), $MachinePrecision] / x), $MachinePrecision] / N[Sqrt[Pi], $MachinePrecision]), $MachinePrecision], N[(N[(N[(x * N[(x * t$95$0), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision] / N[Sqrt[Pi], $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x \cdot \left(x \cdot 0.5\right)\\
t_1 := 1 + t\_0\\
t_2 := \left(x \cdot x\right) \cdot t\_1\\
t_3 := \left(x \cdot x\right) \cdot \left(t\_1 \cdot t\_2\right)\\
t_4 := t\_2 + -1\\
\mathbf{if}\;x \leq 4 \cdot 10^{+38}:\\
\;\;\;\;\frac{\frac{\frac{1 + t\_2 \cdot t\_3}{1 + t\_2 \cdot t\_4}}{x}}{\sqrt{\pi}}\\
\mathbf{elif}\;x \leq 1.35 \cdot 10^{+77}:\\
\;\;\;\;\frac{\frac{\frac{t\_3 + -1}{t\_4}}{x}}{\sqrt{\pi}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x \cdot \left(x \cdot t\_0\right)}{x}}{\sqrt{\pi}}\\
\end{array}
\end{array}
if x < 3.99999999999999991e38Initial program 99.9%
Simplified99.9%
*-commutativeN/A
associate-/r*N/A
associate-*r/N/A
/-lowering-/.f64N/A
Applied egg-rr99.9%
Taylor expanded in x around inf
/-lowering-/.f64N/A
exp-lowering-exp.f64N/A
unpow2N/A
*-lowering-*.f6497.6%
Simplified97.6%
Taylor expanded in x around 0
/-lowering-/.f64N/A
+-lowering-+.f64N/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f644.0%
Simplified4.0%
flip3-+N/A
/-lowering-/.f64N/A
Applied egg-rr43.0%
if 3.99999999999999991e38 < x < 1.3499999999999999e77Initial program 100.0%
Simplified100.0%
*-commutativeN/A
associate-/r*N/A
associate-*r/N/A
/-lowering-/.f64N/A
Applied egg-rr100.0%
Taylor expanded in x around inf
/-lowering-/.f64N/A
exp-lowering-exp.f64N/A
unpow2N/A
*-lowering-*.f64100.0%
Simplified100.0%
Taylor expanded in x around 0
/-lowering-/.f64N/A
+-lowering-+.f64N/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f645.0%
Simplified5.0%
+-commutativeN/A
flip-+N/A
/-lowering-/.f64N/A
Applied egg-rr100.0%
if 1.3499999999999999e77 < x Initial program 100.0%
Simplified100.0%
*-commutativeN/A
associate-/r*N/A
associate-*r/N/A
/-lowering-/.f64N/A
Applied egg-rr100.0%
Taylor expanded in x around inf
/-lowering-/.f64N/A
exp-lowering-exp.f64N/A
unpow2N/A
*-lowering-*.f64100.0%
Simplified100.0%
Taylor expanded in x around 0
/-lowering-/.f64N/A
+-lowering-+.f64N/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64100.0%
Simplified100.0%
Taylor expanded in x around inf
metadata-evalN/A
pow-sqrN/A
associate-*l*N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
associate-*r*N/A
unpow2N/A
unpow3N/A
*-lowering-*.f64N/A
unpow3N/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64100.0%
Simplified100.0%
Final simplification92.9%
(FPCore (x)
:precision binary64
(let* ((t_0 (* x (* x 0.5))) (t_1 (+ 1.0 t_0)) (t_2 (* (* x x) t_1)))
(if (<= x 1.35e+77)
(/ (/ (/ (+ (* (* x x) (* t_1 t_2)) -1.0) (+ t_2 -1.0)) x) (sqrt PI))
(/ (/ (* x (* x t_0)) x) (sqrt PI)))))
double code(double x) {
double t_0 = x * (x * 0.5);
double t_1 = 1.0 + t_0;
double t_2 = (x * x) * t_1;
double tmp;
if (x <= 1.35e+77) {
tmp = (((((x * x) * (t_1 * t_2)) + -1.0) / (t_2 + -1.0)) / x) / sqrt(((double) M_PI));
} else {
tmp = ((x * (x * t_0)) / x) / sqrt(((double) M_PI));
}
return tmp;
}
public static double code(double x) {
double t_0 = x * (x * 0.5);
double t_1 = 1.0 + t_0;
double t_2 = (x * x) * t_1;
double tmp;
if (x <= 1.35e+77) {
tmp = (((((x * x) * (t_1 * t_2)) + -1.0) / (t_2 + -1.0)) / x) / Math.sqrt(Math.PI);
} else {
tmp = ((x * (x * t_0)) / x) / Math.sqrt(Math.PI);
}
return tmp;
}
def code(x): t_0 = x * (x * 0.5) t_1 = 1.0 + t_0 t_2 = (x * x) * t_1 tmp = 0 if x <= 1.35e+77: tmp = (((((x * x) * (t_1 * t_2)) + -1.0) / (t_2 + -1.0)) / x) / math.sqrt(math.pi) else: tmp = ((x * (x * t_0)) / x) / math.sqrt(math.pi) return tmp
function code(x) t_0 = Float64(x * Float64(x * 0.5)) t_1 = Float64(1.0 + t_0) t_2 = Float64(Float64(x * x) * t_1) tmp = 0.0 if (x <= 1.35e+77) tmp = Float64(Float64(Float64(Float64(Float64(Float64(x * x) * Float64(t_1 * t_2)) + -1.0) / Float64(t_2 + -1.0)) / x) / sqrt(pi)); else tmp = Float64(Float64(Float64(x * Float64(x * t_0)) / x) / sqrt(pi)); end return tmp end
function tmp_2 = code(x) t_0 = x * (x * 0.5); t_1 = 1.0 + t_0; t_2 = (x * x) * t_1; tmp = 0.0; if (x <= 1.35e+77) tmp = (((((x * x) * (t_1 * t_2)) + -1.0) / (t_2 + -1.0)) / x) / sqrt(pi); else tmp = ((x * (x * t_0)) / x) / sqrt(pi); end tmp_2 = tmp; end
code[x_] := Block[{t$95$0 = N[(x * N[(x * 0.5), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(1.0 + t$95$0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x * x), $MachinePrecision] * t$95$1), $MachinePrecision]}, If[LessEqual[x, 1.35e+77], N[(N[(N[(N[(N[(N[(x * x), $MachinePrecision] * N[(t$95$1 * t$95$2), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision] / N[(t$95$2 + -1.0), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision] / N[Sqrt[Pi], $MachinePrecision]), $MachinePrecision], N[(N[(N[(x * N[(x * t$95$0), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision] / N[Sqrt[Pi], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x \cdot \left(x \cdot 0.5\right)\\
t_1 := 1 + t\_0\\
t_2 := \left(x \cdot x\right) \cdot t\_1\\
\mathbf{if}\;x \leq 1.35 \cdot 10^{+77}:\\
\;\;\;\;\frac{\frac{\frac{\left(x \cdot x\right) \cdot \left(t\_1 \cdot t\_2\right) + -1}{t\_2 + -1}}{x}}{\sqrt{\pi}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x \cdot \left(x \cdot t\_0\right)}{x}}{\sqrt{\pi}}\\
\end{array}
\end{array}
if x < 1.3499999999999999e77Initial program 100.0%
Simplified99.9%
*-commutativeN/A
associate-/r*N/A
associate-*r/N/A
/-lowering-/.f64N/A
Applied egg-rr99.9%
Taylor expanded in x around inf
/-lowering-/.f64N/A
exp-lowering-exp.f64N/A
unpow2N/A
*-lowering-*.f6498.8%
Simplified98.8%
Taylor expanded in x around 0
/-lowering-/.f64N/A
+-lowering-+.f64N/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f644.5%
Simplified4.5%
+-commutativeN/A
flip-+N/A
/-lowering-/.f64N/A
Applied egg-rr51.2%
if 1.3499999999999999e77 < x Initial program 100.0%
Simplified100.0%
*-commutativeN/A
associate-/r*N/A
associate-*r/N/A
/-lowering-/.f64N/A
Applied egg-rr100.0%
Taylor expanded in x around inf
/-lowering-/.f64N/A
exp-lowering-exp.f64N/A
unpow2N/A
*-lowering-*.f64100.0%
Simplified100.0%
Taylor expanded in x around 0
/-lowering-/.f64N/A
+-lowering-+.f64N/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64100.0%
Simplified100.0%
Taylor expanded in x around inf
metadata-evalN/A
pow-sqrN/A
associate-*l*N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
associate-*r*N/A
unpow2N/A
unpow3N/A
*-lowering-*.f64N/A
unpow3N/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64100.0%
Simplified100.0%
Final simplification88.0%
(FPCore (x)
:precision binary64
(*
(/
(+
1.0
(* x (* x (+ 1.0 (* (* x x) (+ 0.5 (* x (* x 0.16666666666666666))))))))
x)
(/
(+ 1.0 (/ (+ 0.5 (/ (+ 0.75 (/ 1.875 (* x x))) (* x x))) (* x x)))
(sqrt PI))))
double code(double x) {
return ((1.0 + (x * (x * (1.0 + ((x * x) * (0.5 + (x * (x * 0.16666666666666666)))))))) / x) * ((1.0 + ((0.5 + ((0.75 + (1.875 / (x * x))) / (x * x))) / (x * x))) / sqrt(((double) M_PI)));
}
public static double code(double x) {
return ((1.0 + (x * (x * (1.0 + ((x * x) * (0.5 + (x * (x * 0.16666666666666666)))))))) / x) * ((1.0 + ((0.5 + ((0.75 + (1.875 / (x * x))) / (x * x))) / (x * x))) / Math.sqrt(Math.PI));
}
def code(x): return ((1.0 + (x * (x * (1.0 + ((x * x) * (0.5 + (x * (x * 0.16666666666666666)))))))) / x) * ((1.0 + ((0.5 + ((0.75 + (1.875 / (x * x))) / (x * x))) / (x * x))) / math.sqrt(math.pi))
function code(x) return Float64(Float64(Float64(1.0 + Float64(x * Float64(x * Float64(1.0 + Float64(Float64(x * x) * Float64(0.5 + Float64(x * Float64(x * 0.16666666666666666)))))))) / x) * Float64(Float64(1.0 + Float64(Float64(0.5 + Float64(Float64(0.75 + Float64(1.875 / Float64(x * x))) / Float64(x * x))) / Float64(x * x))) / sqrt(pi))) end
function tmp = code(x) tmp = ((1.0 + (x * (x * (1.0 + ((x * x) * (0.5 + (x * (x * 0.16666666666666666)))))))) / x) * ((1.0 + ((0.5 + ((0.75 + (1.875 / (x * x))) / (x * x))) / (x * x))) / sqrt(pi)); end
code[x_] := N[(N[(N[(1.0 + N[(x * N[(x * N[(1.0 + N[(N[(x * x), $MachinePrecision] * N[(0.5 + N[(x * N[(x * 0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision] * N[(N[(1.0 + N[(N[(0.5 + N[(N[(0.75 + N[(1.875 / N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sqrt[Pi], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{1 + x \cdot \left(x \cdot \left(1 + \left(x \cdot x\right) \cdot \left(0.5 + x \cdot \left(x \cdot 0.16666666666666666\right)\right)\right)\right)}{x} \cdot \frac{1 + \frac{0.5 + \frac{0.75 + \frac{1.875}{x \cdot x}}{x \cdot x}}{x \cdot x}}{\sqrt{\pi}}
\end{array}
Initial program 100.0%
Simplified100.0%
*-commutativeN/A
associate-/r*N/A
associate-*r/N/A
/-lowering-/.f64N/A
Applied egg-rr100.0%
Taylor expanded in x around 0
/-lowering-/.f64N/A
Simplified82.9%
*-commutativeN/A
associate-/l*N/A
*-lowering-*.f64N/A
Applied egg-rr82.9%
(FPCore (x)
:precision binary64
(/
(*
(+ 1.0 (/ (+ 0.5 (/ 0.75 (* x x))) (* x x)))
(/
(+
1.0
(* (* x x) (+ 1.0 (* x (* x (+ 0.5 (* (* x x) 0.16666666666666666)))))))
x))
(sqrt PI)))
double code(double x) {
return ((1.0 + ((0.5 + (0.75 / (x * x))) / (x * x))) * ((1.0 + ((x * x) * (1.0 + (x * (x * (0.5 + ((x * x) * 0.16666666666666666))))))) / x)) / sqrt(((double) M_PI));
}
public static double code(double x) {
return ((1.0 + ((0.5 + (0.75 / (x * x))) / (x * x))) * ((1.0 + ((x * x) * (1.0 + (x * (x * (0.5 + ((x * x) * 0.16666666666666666))))))) / x)) / Math.sqrt(Math.PI);
}
def code(x): return ((1.0 + ((0.5 + (0.75 / (x * x))) / (x * x))) * ((1.0 + ((x * x) * (1.0 + (x * (x * (0.5 + ((x * x) * 0.16666666666666666))))))) / x)) / math.sqrt(math.pi)
function code(x) return Float64(Float64(Float64(1.0 + Float64(Float64(0.5 + Float64(0.75 / Float64(x * x))) / Float64(x * x))) * Float64(Float64(1.0 + Float64(Float64(x * x) * Float64(1.0 + Float64(x * Float64(x * Float64(0.5 + Float64(Float64(x * x) * 0.16666666666666666))))))) / x)) / sqrt(pi)) end
function tmp = code(x) tmp = ((1.0 + ((0.5 + (0.75 / (x * x))) / (x * x))) * ((1.0 + ((x * x) * (1.0 + (x * (x * (0.5 + ((x * x) * 0.16666666666666666))))))) / x)) / sqrt(pi); end
code[x_] := N[(N[(N[(1.0 + N[(N[(0.5 + N[(0.75 / N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(1.0 + N[(N[(x * x), $MachinePrecision] * N[(1.0 + N[(x * N[(x * N[(0.5 + N[(N[(x * x), $MachinePrecision] * 0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision] / N[Sqrt[Pi], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\left(1 + \frac{0.5 + \frac{0.75}{x \cdot x}}{x \cdot x}\right) \cdot \frac{1 + \left(x \cdot x\right) \cdot \left(1 + x \cdot \left(x \cdot \left(0.5 + \left(x \cdot x\right) \cdot 0.16666666666666666\right)\right)\right)}{x}}{\sqrt{\pi}}
\end{array}
Initial program 100.0%
Simplified100.0%
*-commutativeN/A
associate-/r*N/A
associate-*r/N/A
/-lowering-/.f64N/A
Applied egg-rr100.0%
Taylor expanded in x around inf
/-lowering-/.f64N/A
unpow2N/A
*-lowering-*.f6499.7%
Simplified99.7%
Taylor expanded in x around 0
/-lowering-/.f64N/A
Simplified82.9%
(FPCore (x)
:precision binary64
(/
(*
(+ 1.0 (/ 0.5 (* x x)))
(/
(+
1.0
(* (* x x) (+ 1.0 (* x (* x (+ 0.5 (* (* x x) 0.16666666666666666)))))))
x))
(sqrt PI)))
double code(double x) {
return ((1.0 + (0.5 / (x * x))) * ((1.0 + ((x * x) * (1.0 + (x * (x * (0.5 + ((x * x) * 0.16666666666666666))))))) / x)) / sqrt(((double) M_PI));
}
public static double code(double x) {
return ((1.0 + (0.5 / (x * x))) * ((1.0 + ((x * x) * (1.0 + (x * (x * (0.5 + ((x * x) * 0.16666666666666666))))))) / x)) / Math.sqrt(Math.PI);
}
def code(x): return ((1.0 + (0.5 / (x * x))) * ((1.0 + ((x * x) * (1.0 + (x * (x * (0.5 + ((x * x) * 0.16666666666666666))))))) / x)) / math.sqrt(math.pi)
function code(x) return Float64(Float64(Float64(1.0 + Float64(0.5 / Float64(x * x))) * Float64(Float64(1.0 + Float64(Float64(x * x) * Float64(1.0 + Float64(x * Float64(x * Float64(0.5 + Float64(Float64(x * x) * 0.16666666666666666))))))) / x)) / sqrt(pi)) end
function tmp = code(x) tmp = ((1.0 + (0.5 / (x * x))) * ((1.0 + ((x * x) * (1.0 + (x * (x * (0.5 + ((x * x) * 0.16666666666666666))))))) / x)) / sqrt(pi); end
code[x_] := N[(N[(N[(1.0 + N[(0.5 / N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(1.0 + N[(N[(x * x), $MachinePrecision] * N[(1.0 + N[(x * N[(x * N[(0.5 + N[(N[(x * x), $MachinePrecision] * 0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision] / N[Sqrt[Pi], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\left(1 + \frac{0.5}{x \cdot x}\right) \cdot \frac{1 + \left(x \cdot x\right) \cdot \left(1 + x \cdot \left(x \cdot \left(0.5 + \left(x \cdot x\right) \cdot 0.16666666666666666\right)\right)\right)}{x}}{\sqrt{\pi}}
\end{array}
Initial program 100.0%
Simplified100.0%
*-commutativeN/A
associate-/r*N/A
associate-*r/N/A
/-lowering-/.f64N/A
Applied egg-rr100.0%
Taylor expanded in x around 0
/-lowering-/.f64N/A
Simplified82.9%
Taylor expanded in x around inf
+-lowering-+.f64N/A
associate-*r/N/A
metadata-evalN/A
/-lowering-/.f64N/A
unpow2N/A
*-lowering-*.f6482.9%
Simplified82.9%
(FPCore (x)
:precision binary64
(/
(/
(+
1.0
(* (* x x) (+ 1.0 (* x (* x (+ 0.5 (* (* x x) 0.16666666666666666)))))))
x)
(sqrt PI)))
double code(double x) {
return ((1.0 + ((x * x) * (1.0 + (x * (x * (0.5 + ((x * x) * 0.16666666666666666))))))) / x) / sqrt(((double) M_PI));
}
public static double code(double x) {
return ((1.0 + ((x * x) * (1.0 + (x * (x * (0.5 + ((x * x) * 0.16666666666666666))))))) / x) / Math.sqrt(Math.PI);
}
def code(x): return ((1.0 + ((x * x) * (1.0 + (x * (x * (0.5 + ((x * x) * 0.16666666666666666))))))) / x) / math.sqrt(math.pi)
function code(x) return Float64(Float64(Float64(1.0 + Float64(Float64(x * x) * Float64(1.0 + Float64(x * Float64(x * Float64(0.5 + Float64(Float64(x * x) * 0.16666666666666666))))))) / x) / sqrt(pi)) end
function tmp = code(x) tmp = ((1.0 + ((x * x) * (1.0 + (x * (x * (0.5 + ((x * x) * 0.16666666666666666))))))) / x) / sqrt(pi); end
code[x_] := N[(N[(N[(1.0 + N[(N[(x * x), $MachinePrecision] * N[(1.0 + N[(x * N[(x * N[(0.5 + N[(N[(x * x), $MachinePrecision] * 0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision] / N[Sqrt[Pi], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\frac{1 + \left(x \cdot x\right) \cdot \left(1 + x \cdot \left(x \cdot \left(0.5 + \left(x \cdot x\right) \cdot 0.16666666666666666\right)\right)\right)}{x}}{\sqrt{\pi}}
\end{array}
Initial program 100.0%
Simplified100.0%
*-commutativeN/A
associate-/r*N/A
associate-*r/N/A
/-lowering-/.f64N/A
Applied egg-rr100.0%
Taylor expanded in x around inf
/-lowering-/.f64N/A
exp-lowering-exp.f64N/A
unpow2N/A
*-lowering-*.f6499.7%
Simplified99.7%
Taylor expanded in x around 0
/-lowering-/.f64N/A
Simplified82.9%
(FPCore (x) :precision binary64 (/ (+ 1.0 (* (* x x) (+ 1.0 (* x (* x 0.5))))) (* (sqrt PI) x)))
double code(double x) {
return (1.0 + ((x * x) * (1.0 + (x * (x * 0.5))))) / (sqrt(((double) M_PI)) * x);
}
public static double code(double x) {
return (1.0 + ((x * x) * (1.0 + (x * (x * 0.5))))) / (Math.sqrt(Math.PI) * x);
}
def code(x): return (1.0 + ((x * x) * (1.0 + (x * (x * 0.5))))) / (math.sqrt(math.pi) * x)
function code(x) return Float64(Float64(1.0 + Float64(Float64(x * x) * Float64(1.0 + Float64(x * Float64(x * 0.5))))) / Float64(sqrt(pi) * x)) end
function tmp = code(x) tmp = (1.0 + ((x * x) * (1.0 + (x * (x * 0.5))))) / (sqrt(pi) * x); end
code[x_] := N[(N[(1.0 + N[(N[(x * x), $MachinePrecision] * N[(1.0 + N[(x * N[(x * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[Sqrt[Pi], $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{1 + \left(x \cdot x\right) \cdot \left(1 + x \cdot \left(x \cdot 0.5\right)\right)}{\sqrt{\pi} \cdot x}
\end{array}
Initial program 100.0%
Simplified100.0%
*-commutativeN/A
associate-/r*N/A
associate-*r/N/A
/-lowering-/.f64N/A
Applied egg-rr100.0%
Taylor expanded in x around inf
/-lowering-/.f64N/A
exp-lowering-exp.f64N/A
unpow2N/A
*-lowering-*.f6499.7%
Simplified99.7%
Taylor expanded in x around 0
/-lowering-/.f64N/A
+-lowering-+.f64N/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6476.5%
Simplified76.5%
associate-/l/N/A
/-lowering-/.f64N/A
+-lowering-+.f64N/A
associate-*r*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
PI-lowering-PI.f6476.5%
Applied egg-rr76.5%
(FPCore (x) :precision binary64 (/ (/ (* x (* x (* x (* x 0.5)))) x) (sqrt PI)))
double code(double x) {
return ((x * (x * (x * (x * 0.5)))) / x) / sqrt(((double) M_PI));
}
public static double code(double x) {
return ((x * (x * (x * (x * 0.5)))) / x) / Math.sqrt(Math.PI);
}
def code(x): return ((x * (x * (x * (x * 0.5)))) / x) / math.sqrt(math.pi)
function code(x) return Float64(Float64(Float64(x * Float64(x * Float64(x * Float64(x * 0.5)))) / x) / sqrt(pi)) end
function tmp = code(x) tmp = ((x * (x * (x * (x * 0.5)))) / x) / sqrt(pi); end
code[x_] := N[(N[(N[(x * N[(x * N[(x * N[(x * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision] / N[Sqrt[Pi], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\frac{x \cdot \left(x \cdot \left(x \cdot \left(x \cdot 0.5\right)\right)\right)}{x}}{\sqrt{\pi}}
\end{array}
Initial program 100.0%
Simplified100.0%
*-commutativeN/A
associate-/r*N/A
associate-*r/N/A
/-lowering-/.f64N/A
Applied egg-rr100.0%
Taylor expanded in x around inf
/-lowering-/.f64N/A
exp-lowering-exp.f64N/A
unpow2N/A
*-lowering-*.f6499.7%
Simplified99.7%
Taylor expanded in x around 0
/-lowering-/.f64N/A
+-lowering-+.f64N/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6476.5%
Simplified76.5%
Taylor expanded in x around inf
metadata-evalN/A
pow-sqrN/A
associate-*l*N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
associate-*r*N/A
unpow2N/A
unpow3N/A
*-lowering-*.f64N/A
unpow3N/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6476.5%
Simplified76.5%
(FPCore (x) :precision binary64 (/ (+ (* x (* (* x x) 0.5)) (* x 1.25)) (sqrt PI)))
double code(double x) {
return ((x * ((x * x) * 0.5)) + (x * 1.25)) / sqrt(((double) M_PI));
}
public static double code(double x) {
return ((x * ((x * x) * 0.5)) + (x * 1.25)) / Math.sqrt(Math.PI);
}
def code(x): return ((x * ((x * x) * 0.5)) + (x * 1.25)) / math.sqrt(math.pi)
function code(x) return Float64(Float64(Float64(x * Float64(Float64(x * x) * 0.5)) + Float64(x * 1.25)) / sqrt(pi)) end
function tmp = code(x) tmp = ((x * ((x * x) * 0.5)) + (x * 1.25)) / sqrt(pi); end
code[x_] := N[(N[(N[(x * N[(N[(x * x), $MachinePrecision] * 0.5), $MachinePrecision]), $MachinePrecision] + N[(x * 1.25), $MachinePrecision]), $MachinePrecision] / N[Sqrt[Pi], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x \cdot \left(\left(x \cdot x\right) \cdot 0.5\right) + x \cdot 1.25}{\sqrt{\pi}}
\end{array}
Initial program 100.0%
Simplified100.0%
*-commutativeN/A
associate-/r*N/A
associate-*r/N/A
/-lowering-/.f64N/A
Applied egg-rr100.0%
Taylor expanded in x around 0
/-lowering-/.f64N/A
+-lowering-+.f64N/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6476.5%
Simplified76.5%
Taylor expanded in x around inf
distribute-lft-inN/A
*-commutativeN/A
+-lowering-+.f64N/A
unpow3N/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
*-commutativeN/A
associate-*r*N/A
cube-multN/A
unpow2N/A
associate-*l*N/A
rgt-mult-inverseN/A
*-rgt-identityN/A
*-lowering-*.f6467.9%
Simplified67.9%
(FPCore (x) :precision binary64 (/ (* x (+ 1.0 (* x (* x 0.5)))) (sqrt PI)))
double code(double x) {
return (x * (1.0 + (x * (x * 0.5)))) / sqrt(((double) M_PI));
}
public static double code(double x) {
return (x * (1.0 + (x * (x * 0.5)))) / Math.sqrt(Math.PI);
}
def code(x): return (x * (1.0 + (x * (x * 0.5)))) / math.sqrt(math.pi)
function code(x) return Float64(Float64(x * Float64(1.0 + Float64(x * Float64(x * 0.5)))) / sqrt(pi)) end
function tmp = code(x) tmp = (x * (1.0 + (x * (x * 0.5)))) / sqrt(pi); end
code[x_] := N[(N[(x * N[(1.0 + N[(x * N[(x * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sqrt[Pi], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x \cdot \left(1 + x \cdot \left(x \cdot 0.5\right)\right)}{\sqrt{\pi}}
\end{array}
Initial program 100.0%
Simplified100.0%
*-commutativeN/A
associate-/r*N/A
associate-*r/N/A
/-lowering-/.f64N/A
Applied egg-rr100.0%
Taylor expanded in x around inf
/-lowering-/.f64N/A
exp-lowering-exp.f64N/A
unpow2N/A
*-lowering-*.f6499.7%
Simplified99.7%
Taylor expanded in x around 0
/-lowering-/.f64N/A
+-lowering-+.f64N/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6476.5%
Simplified76.5%
Taylor expanded in x around inf
cube-multN/A
unpow2N/A
associate-*l*N/A
distribute-lft-inN/A
*-commutativeN/A
rgt-mult-inverseN/A
+-commutativeN/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6467.9%
Simplified67.9%
(FPCore (x) :precision binary64 (/ (* x (* (* x x) 0.5)) (sqrt PI)))
double code(double x) {
return (x * ((x * x) * 0.5)) / sqrt(((double) M_PI));
}
public static double code(double x) {
return (x * ((x * x) * 0.5)) / Math.sqrt(Math.PI);
}
def code(x): return (x * ((x * x) * 0.5)) / math.sqrt(math.pi)
function code(x) return Float64(Float64(x * Float64(Float64(x * x) * 0.5)) / sqrt(pi)) end
function tmp = code(x) tmp = (x * ((x * x) * 0.5)) / sqrt(pi); end
code[x_] := N[(N[(x * N[(N[(x * x), $MachinePrecision] * 0.5), $MachinePrecision]), $MachinePrecision] / N[Sqrt[Pi], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x \cdot \left(\left(x \cdot x\right) \cdot 0.5\right)}{\sqrt{\pi}}
\end{array}
Initial program 100.0%
Simplified100.0%
*-commutativeN/A
associate-/r*N/A
associate-*r/N/A
/-lowering-/.f64N/A
Applied egg-rr100.0%
Taylor expanded in x around 0
/-lowering-/.f64N/A
+-lowering-+.f64N/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6476.5%
Simplified76.5%
Taylor expanded in x around inf
unpow3N/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6467.9%
Simplified67.9%
(FPCore (x) :precision binary64 (/ (pow PI -0.5) x))
double code(double x) {
return pow(((double) M_PI), -0.5) / x;
}
public static double code(double x) {
return Math.pow(Math.PI, -0.5) / x;
}
def code(x): return math.pow(math.pi, -0.5) / x
function code(x) return Float64((pi ^ -0.5) / x) end
function tmp = code(x) tmp = (pi ^ -0.5) / x; end
code[x_] := N[(N[Power[Pi, -0.5], $MachinePrecision] / x), $MachinePrecision]
\begin{array}{l}
\\
\frac{{\pi}^{-0.5}}{x}
\end{array}
Initial program 100.0%
Simplified100.0%
*-commutativeN/A
associate-/r*N/A
associate-*r/N/A
/-lowering-/.f64N/A
Applied egg-rr100.0%
Taylor expanded in x around 0
/-lowering-/.f642.3%
Simplified2.3%
Taylor expanded in x around inf
/-lowering-/.f642.3%
Simplified2.3%
associate-/l/N/A
associate-/r*N/A
/-lowering-/.f64N/A
pow1/2N/A
pow-flipN/A
pow-lowering-pow.f64N/A
PI-lowering-PI.f64N/A
metadata-eval2.3%
Applied egg-rr2.3%
herbie shell --seed 2024163
(FPCore (x)
:name "Jmat.Real.erfi, branch x greater than or equal to 5"
:precision binary64
:pre (>= x 0.5)
(* (* (/ 1.0 (sqrt PI)) (exp (* (fabs x) (fabs x)))) (+ (+ (+ (/ 1.0 (fabs x)) (* (/ 1.0 2.0) (* (* (/ 1.0 (fabs x)) (/ 1.0 (fabs x))) (/ 1.0 (fabs x))))) (* (/ 3.0 4.0) (* (* (* (* (/ 1.0 (fabs x)) (/ 1.0 (fabs x))) (/ 1.0 (fabs x))) (/ 1.0 (fabs x))) (/ 1.0 (fabs x))))) (* (/ 15.0 8.0) (* (* (* (* (* (* (/ 1.0 (fabs x)) (/ 1.0 (fabs x))) (/ 1.0 (fabs x))) (/ 1.0 (fabs x))) (/ 1.0 (fabs x))) (/ 1.0 (fabs x))) (/ 1.0 (fabs x)))))))