
(FPCore (k n) :precision binary64 (* (/ 1.0 (sqrt k)) (pow (* (* 2.0 PI) n) (/ (- 1.0 k) 2.0))))
double code(double k, double n) {
return (1.0 / sqrt(k)) * pow(((2.0 * ((double) M_PI)) * n), ((1.0 - k) / 2.0));
}
public static double code(double k, double n) {
return (1.0 / Math.sqrt(k)) * Math.pow(((2.0 * Math.PI) * n), ((1.0 - k) / 2.0));
}
def code(k, n): return (1.0 / math.sqrt(k)) * math.pow(((2.0 * math.pi) * n), ((1.0 - k) / 2.0))
function code(k, n) return Float64(Float64(1.0 / sqrt(k)) * (Float64(Float64(2.0 * pi) * n) ^ Float64(Float64(1.0 - k) / 2.0))) end
function tmp = code(k, n) tmp = (1.0 / sqrt(k)) * (((2.0 * pi) * n) ^ ((1.0 - k) / 2.0)); end
code[k_, n_] := N[(N[(1.0 / N[Sqrt[k], $MachinePrecision]), $MachinePrecision] * N[Power[N[(N[(2.0 * Pi), $MachinePrecision] * n), $MachinePrecision], N[(N[(1.0 - k), $MachinePrecision] / 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{1}{\sqrt{k}} \cdot {\left(\left(2 \cdot \pi\right) \cdot n\right)}^{\left(\frac{1 - k}{2}\right)}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 15 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (k n) :precision binary64 (* (/ 1.0 (sqrt k)) (pow (* (* 2.0 PI) n) (/ (- 1.0 k) 2.0))))
double code(double k, double n) {
return (1.0 / sqrt(k)) * pow(((2.0 * ((double) M_PI)) * n), ((1.0 - k) / 2.0));
}
public static double code(double k, double n) {
return (1.0 / Math.sqrt(k)) * Math.pow(((2.0 * Math.PI) * n), ((1.0 - k) / 2.0));
}
def code(k, n): return (1.0 / math.sqrt(k)) * math.pow(((2.0 * math.pi) * n), ((1.0 - k) / 2.0))
function code(k, n) return Float64(Float64(1.0 / sqrt(k)) * (Float64(Float64(2.0 * pi) * n) ^ Float64(Float64(1.0 - k) / 2.0))) end
function tmp = code(k, n) tmp = (1.0 / sqrt(k)) * (((2.0 * pi) * n) ^ ((1.0 - k) / 2.0)); end
code[k_, n_] := N[(N[(1.0 / N[Sqrt[k], $MachinePrecision]), $MachinePrecision] * N[Power[N[(N[(2.0 * Pi), $MachinePrecision] * n), $MachinePrecision], N[(N[(1.0 - k), $MachinePrecision] / 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{1}{\sqrt{k}} \cdot {\left(\left(2 \cdot \pi\right) \cdot n\right)}^{\left(\frac{1 - k}{2}\right)}
\end{array}
(FPCore (k n) :precision binary64 (let* ((t_0 (* 2.0 (* PI n)))) (/ (/ (sqrt t_0) (pow t_0 (/ k 2.0))) (sqrt k))))
double code(double k, double n) {
double t_0 = 2.0 * (((double) M_PI) * n);
return (sqrt(t_0) / pow(t_0, (k / 2.0))) / sqrt(k);
}
public static double code(double k, double n) {
double t_0 = 2.0 * (Math.PI * n);
return (Math.sqrt(t_0) / Math.pow(t_0, (k / 2.0))) / Math.sqrt(k);
}
def code(k, n): t_0 = 2.0 * (math.pi * n) return (math.sqrt(t_0) / math.pow(t_0, (k / 2.0))) / math.sqrt(k)
function code(k, n) t_0 = Float64(2.0 * Float64(pi * n)) return Float64(Float64(sqrt(t_0) / (t_0 ^ Float64(k / 2.0))) / sqrt(k)) end
function tmp = code(k, n) t_0 = 2.0 * (pi * n); tmp = (sqrt(t_0) / (t_0 ^ (k / 2.0))) / sqrt(k); end
code[k_, n_] := Block[{t$95$0 = N[(2.0 * N[(Pi * n), $MachinePrecision]), $MachinePrecision]}, N[(N[(N[Sqrt[t$95$0], $MachinePrecision] / N[Power[t$95$0, N[(k / 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[Sqrt[k], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 2 \cdot \left(\pi \cdot n\right)\\
\frac{\frac{\sqrt{t\_0}}{{t\_0}^{\left(\frac{k}{2}\right)}}}{\sqrt{k}}
\end{array}
\end{array}
Initial program 99.4%
associate-*l/N/A
*-lft-identityN/A
/-lowering-/.f64N/A
pow-lowering-pow.f64N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
div-subN/A
--lowering--.f64N/A
metadata-evalN/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f6499.5%
Simplified99.5%
pow-subN/A
/-lowering-/.f64N/A
unpow1/2N/A
sqrt-lowering-sqrt.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
pow-lowering-pow.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
/-lowering-/.f6499.7%
Applied egg-rr99.7%
(FPCore (k n) :precision binary64 (let* ((t_0 (* 2.0 (* PI n)))) (/ (sqrt t_0) (pow (* k (pow t_0 k)) 0.5))))
double code(double k, double n) {
double t_0 = 2.0 * (((double) M_PI) * n);
return sqrt(t_0) / pow((k * pow(t_0, k)), 0.5);
}
public static double code(double k, double n) {
double t_0 = 2.0 * (Math.PI * n);
return Math.sqrt(t_0) / Math.pow((k * Math.pow(t_0, k)), 0.5);
}
def code(k, n): t_0 = 2.0 * (math.pi * n) return math.sqrt(t_0) / math.pow((k * math.pow(t_0, k)), 0.5)
function code(k, n) t_0 = Float64(2.0 * Float64(pi * n)) return Float64(sqrt(t_0) / (Float64(k * (t_0 ^ k)) ^ 0.5)) end
function tmp = code(k, n) t_0 = 2.0 * (pi * n); tmp = sqrt(t_0) / ((k * (t_0 ^ k)) ^ 0.5); end
code[k_, n_] := Block[{t$95$0 = N[(2.0 * N[(Pi * n), $MachinePrecision]), $MachinePrecision]}, N[(N[Sqrt[t$95$0], $MachinePrecision] / N[Power[N[(k * N[Power[t$95$0, k], $MachinePrecision]), $MachinePrecision], 0.5], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 2 \cdot \left(\pi \cdot n\right)\\
\frac{\sqrt{t\_0}}{{\left(k \cdot {t\_0}^{k}\right)}^{0.5}}
\end{array}
\end{array}
Initial program 99.4%
associate-*r*N/A
div-subN/A
metadata-evalN/A
*-commutativeN/A
pow-subN/A
frac-timesN/A
*-rgt-identityN/A
/-lowering-/.f64N/A
unpow1/2N/A
sqrt-lowering-sqrt.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
Applied egg-rr99.7%
Final simplification99.7%
(FPCore (k n) :precision binary64 (if (<= k 3.2e+157) (* (sqrt (* 2.0 n)) (pow (/ PI k) 0.5)) (pow (/ (* 4.0 (* (* PI n) (* PI n))) (* k k)) 0.25)))
double code(double k, double n) {
double tmp;
if (k <= 3.2e+157) {
tmp = sqrt((2.0 * n)) * pow((((double) M_PI) / k), 0.5);
} else {
tmp = pow(((4.0 * ((((double) M_PI) * n) * (((double) M_PI) * n))) / (k * k)), 0.25);
}
return tmp;
}
public static double code(double k, double n) {
double tmp;
if (k <= 3.2e+157) {
tmp = Math.sqrt((2.0 * n)) * Math.pow((Math.PI / k), 0.5);
} else {
tmp = Math.pow(((4.0 * ((Math.PI * n) * (Math.PI * n))) / (k * k)), 0.25);
}
return tmp;
}
def code(k, n): tmp = 0 if k <= 3.2e+157: tmp = math.sqrt((2.0 * n)) * math.pow((math.pi / k), 0.5) else: tmp = math.pow(((4.0 * ((math.pi * n) * (math.pi * n))) / (k * k)), 0.25) return tmp
function code(k, n) tmp = 0.0 if (k <= 3.2e+157) tmp = Float64(sqrt(Float64(2.0 * n)) * (Float64(pi / k) ^ 0.5)); else tmp = Float64(Float64(4.0 * Float64(Float64(pi * n) * Float64(pi * n))) / Float64(k * k)) ^ 0.25; end return tmp end
function tmp_2 = code(k, n) tmp = 0.0; if (k <= 3.2e+157) tmp = sqrt((2.0 * n)) * ((pi / k) ^ 0.5); else tmp = ((4.0 * ((pi * n) * (pi * n))) / (k * k)) ^ 0.25; end tmp_2 = tmp; end
code[k_, n_] := If[LessEqual[k, 3.2e+157], N[(N[Sqrt[N[(2.0 * n), $MachinePrecision]], $MachinePrecision] * N[Power[N[(Pi / k), $MachinePrecision], 0.5], $MachinePrecision]), $MachinePrecision], N[Power[N[(N[(4.0 * N[(N[(Pi * n), $MachinePrecision] * N[(Pi * n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(k * k), $MachinePrecision]), $MachinePrecision], 0.25], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;k \leq 3.2 \cdot 10^{+157}:\\
\;\;\;\;\sqrt{2 \cdot n} \cdot {\left(\frac{\pi}{k}\right)}^{0.5}\\
\mathbf{else}:\\
\;\;\;\;{\left(\frac{4 \cdot \left(\left(\pi \cdot n\right) \cdot \left(\pi \cdot n\right)\right)}{k \cdot k}\right)}^{0.25}\\
\end{array}
\end{array}
if k < 3.1999999999999999e157Initial program 99.3%
Taylor expanded in k around 0
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
sqrt-lowering-sqrt.f6452.4%
Simplified52.4%
sqrt-unprodN/A
sqrt-lowering-sqrt.f64N/A
associate-*l/N/A
*-commutativeN/A
*-commutativeN/A
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
PI-lowering-PI.f6452.6%
Applied egg-rr52.6%
*-commutativeN/A
*-commutativeN/A
associate-*l*N/A
associate-*r/N/A
associate-*l/N/A
*-commutativeN/A
associate-*r*N/A
sqrt-prodN/A
pow1/2N/A
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
*-lowering-*.f64N/A
pow-lowering-pow.f64N/A
/-lowering-/.f64N/A
PI-lowering-PI.f6467.4%
Applied egg-rr67.4%
if 3.1999999999999999e157 < k Initial program 100.0%
Taylor expanded in k around 0
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
sqrt-lowering-sqrt.f642.6%
Simplified2.6%
sqrt-unprodN/A
sqrt-lowering-sqrt.f64N/A
associate-*l/N/A
*-commutativeN/A
*-commutativeN/A
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
PI-lowering-PI.f642.6%
Applied egg-rr2.6%
associate-*r*N/A
associate-/l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
/-lowering-/.f642.6%
Applied egg-rr2.6%
pow1/2N/A
associate-*r/N/A
associate-*r*N/A
metadata-evalN/A
metadata-evalN/A
pow-sqrN/A
pow-prod-downN/A
pow-lowering-pow.f64N/A
Applied egg-rr30.8%
Final simplification58.8%
(FPCore (k n) :precision binary64 (/ (pow k -0.5) (pow (* 2.0 (* PI n)) (+ (/ k 2.0) -0.5))))
double code(double k, double n) {
return pow(k, -0.5) / pow((2.0 * (((double) M_PI) * n)), ((k / 2.0) + -0.5));
}
public static double code(double k, double n) {
return Math.pow(k, -0.5) / Math.pow((2.0 * (Math.PI * n)), ((k / 2.0) + -0.5));
}
def code(k, n): return math.pow(k, -0.5) / math.pow((2.0 * (math.pi * n)), ((k / 2.0) + -0.5))
function code(k, n) return Float64((k ^ -0.5) / (Float64(2.0 * Float64(pi * n)) ^ Float64(Float64(k / 2.0) + -0.5))) end
function tmp = code(k, n) tmp = (k ^ -0.5) / ((2.0 * (pi * n)) ^ ((k / 2.0) + -0.5)); end
code[k_, n_] := N[(N[Power[k, -0.5], $MachinePrecision] / N[Power[N[(2.0 * N[(Pi * n), $MachinePrecision]), $MachinePrecision], N[(N[(k / 2.0), $MachinePrecision] + -0.5), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{{k}^{-0.5}}{{\left(2 \cdot \left(\pi \cdot n\right)\right)}^{\left(\frac{k}{2} + -0.5\right)}}
\end{array}
Initial program 99.4%
associate-*r*N/A
div-subN/A
metadata-evalN/A
pow-subN/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
inv-powN/A
pow1/2N/A
pow-powN/A
pow-lowering-pow.f64N/A
metadata-evalN/A
clear-numN/A
pow-subN/A
Applied egg-rr99.5%
(FPCore (k n) :precision binary64 (* (pow k -0.5) (pow (* 2.0 (* PI n)) (+ 0.5 (/ k -2.0)))))
double code(double k, double n) {
return pow(k, -0.5) * pow((2.0 * (((double) M_PI) * n)), (0.5 + (k / -2.0)));
}
public static double code(double k, double n) {
return Math.pow(k, -0.5) * Math.pow((2.0 * (Math.PI * n)), (0.5 + (k / -2.0)));
}
def code(k, n): return math.pow(k, -0.5) * math.pow((2.0 * (math.pi * n)), (0.5 + (k / -2.0)))
function code(k, n) return Float64((k ^ -0.5) * (Float64(2.0 * Float64(pi * n)) ^ Float64(0.5 + Float64(k / -2.0)))) end
function tmp = code(k, n) tmp = (k ^ -0.5) * ((2.0 * (pi * n)) ^ (0.5 + (k / -2.0))); end
code[k_, n_] := N[(N[Power[k, -0.5], $MachinePrecision] * N[Power[N[(2.0 * N[(Pi * n), $MachinePrecision]), $MachinePrecision], N[(0.5 + N[(k / -2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
{k}^{-0.5} \cdot {\left(2 \cdot \left(\pi \cdot n\right)\right)}^{\left(0.5 + \frac{k}{-2}\right)}
\end{array}
Initial program 99.4%
*-commutativeN/A
associate-*r*N/A
div-subN/A
metadata-evalN/A
*-lowering-*.f64N/A
Applied egg-rr99.5%
Final simplification99.5%
(FPCore (k n) :precision binary64 (if (<= k 3.2e+157) (* (sqrt n) (sqrt (* 2.0 (/ PI k)))) (pow (/ (* 4.0 (* (* PI n) (* PI n))) (* k k)) 0.25)))
double code(double k, double n) {
double tmp;
if (k <= 3.2e+157) {
tmp = sqrt(n) * sqrt((2.0 * (((double) M_PI) / k)));
} else {
tmp = pow(((4.0 * ((((double) M_PI) * n) * (((double) M_PI) * n))) / (k * k)), 0.25);
}
return tmp;
}
public static double code(double k, double n) {
double tmp;
if (k <= 3.2e+157) {
tmp = Math.sqrt(n) * Math.sqrt((2.0 * (Math.PI / k)));
} else {
tmp = Math.pow(((4.0 * ((Math.PI * n) * (Math.PI * n))) / (k * k)), 0.25);
}
return tmp;
}
def code(k, n): tmp = 0 if k <= 3.2e+157: tmp = math.sqrt(n) * math.sqrt((2.0 * (math.pi / k))) else: tmp = math.pow(((4.0 * ((math.pi * n) * (math.pi * n))) / (k * k)), 0.25) return tmp
function code(k, n) tmp = 0.0 if (k <= 3.2e+157) tmp = Float64(sqrt(n) * sqrt(Float64(2.0 * Float64(pi / k)))); else tmp = Float64(Float64(4.0 * Float64(Float64(pi * n) * Float64(pi * n))) / Float64(k * k)) ^ 0.25; end return tmp end
function tmp_2 = code(k, n) tmp = 0.0; if (k <= 3.2e+157) tmp = sqrt(n) * sqrt((2.0 * (pi / k))); else tmp = ((4.0 * ((pi * n) * (pi * n))) / (k * k)) ^ 0.25; end tmp_2 = tmp; end
code[k_, n_] := If[LessEqual[k, 3.2e+157], N[(N[Sqrt[n], $MachinePrecision] * N[Sqrt[N[(2.0 * N[(Pi / k), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[Power[N[(N[(4.0 * N[(N[(Pi * n), $MachinePrecision] * N[(Pi * n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(k * k), $MachinePrecision]), $MachinePrecision], 0.25], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;k \leq 3.2 \cdot 10^{+157}:\\
\;\;\;\;\sqrt{n} \cdot \sqrt{2 \cdot \frac{\pi}{k}}\\
\mathbf{else}:\\
\;\;\;\;{\left(\frac{4 \cdot \left(\left(\pi \cdot n\right) \cdot \left(\pi \cdot n\right)\right)}{k \cdot k}\right)}^{0.25}\\
\end{array}
\end{array}
if k < 3.1999999999999999e157Initial program 99.3%
Taylor expanded in k around 0
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
sqrt-lowering-sqrt.f6452.4%
Simplified52.4%
sqrt-unprodN/A
associate-/l*N/A
associate-*l*N/A
sqrt-prodN/A
pow1/2N/A
*-lowering-*.f64N/A
pow1/2N/A
sqrt-lowering-sqrt.f64N/A
sqrt-lowering-sqrt.f64N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
PI-lowering-PI.f6467.3%
Applied egg-rr67.3%
if 3.1999999999999999e157 < k Initial program 100.0%
Taylor expanded in k around 0
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
sqrt-lowering-sqrt.f642.6%
Simplified2.6%
sqrt-unprodN/A
sqrt-lowering-sqrt.f64N/A
associate-*l/N/A
*-commutativeN/A
*-commutativeN/A
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
PI-lowering-PI.f642.6%
Applied egg-rr2.6%
associate-*r*N/A
associate-/l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
/-lowering-/.f642.6%
Applied egg-rr2.6%
pow1/2N/A
associate-*r/N/A
associate-*r*N/A
metadata-evalN/A
metadata-evalN/A
pow-sqrN/A
pow-prod-downN/A
pow-lowering-pow.f64N/A
Applied egg-rr30.8%
Final simplification58.8%
(FPCore (k n) :precision binary64 (if (<= k 3.2e+157) (* (sqrt n) (sqrt (* PI (/ 2.0 k)))) (pow (/ (* 4.0 (* (* PI n) (* PI n))) (* k k)) 0.25)))
double code(double k, double n) {
double tmp;
if (k <= 3.2e+157) {
tmp = sqrt(n) * sqrt((((double) M_PI) * (2.0 / k)));
} else {
tmp = pow(((4.0 * ((((double) M_PI) * n) * (((double) M_PI) * n))) / (k * k)), 0.25);
}
return tmp;
}
public static double code(double k, double n) {
double tmp;
if (k <= 3.2e+157) {
tmp = Math.sqrt(n) * Math.sqrt((Math.PI * (2.0 / k)));
} else {
tmp = Math.pow(((4.0 * ((Math.PI * n) * (Math.PI * n))) / (k * k)), 0.25);
}
return tmp;
}
def code(k, n): tmp = 0 if k <= 3.2e+157: tmp = math.sqrt(n) * math.sqrt((math.pi * (2.0 / k))) else: tmp = math.pow(((4.0 * ((math.pi * n) * (math.pi * n))) / (k * k)), 0.25) return tmp
function code(k, n) tmp = 0.0 if (k <= 3.2e+157) tmp = Float64(sqrt(n) * sqrt(Float64(pi * Float64(2.0 / k)))); else tmp = Float64(Float64(4.0 * Float64(Float64(pi * n) * Float64(pi * n))) / Float64(k * k)) ^ 0.25; end return tmp end
function tmp_2 = code(k, n) tmp = 0.0; if (k <= 3.2e+157) tmp = sqrt(n) * sqrt((pi * (2.0 / k))); else tmp = ((4.0 * ((pi * n) * (pi * n))) / (k * k)) ^ 0.25; end tmp_2 = tmp; end
code[k_, n_] := If[LessEqual[k, 3.2e+157], N[(N[Sqrt[n], $MachinePrecision] * N[Sqrt[N[(Pi * N[(2.0 / k), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[Power[N[(N[(4.0 * N[(N[(Pi * n), $MachinePrecision] * N[(Pi * n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(k * k), $MachinePrecision]), $MachinePrecision], 0.25], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;k \leq 3.2 \cdot 10^{+157}:\\
\;\;\;\;\sqrt{n} \cdot \sqrt{\pi \cdot \frac{2}{k}}\\
\mathbf{else}:\\
\;\;\;\;{\left(\frac{4 \cdot \left(\left(\pi \cdot n\right) \cdot \left(\pi \cdot n\right)\right)}{k \cdot k}\right)}^{0.25}\\
\end{array}
\end{array}
if k < 3.1999999999999999e157Initial program 99.3%
Taylor expanded in k around 0
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
sqrt-lowering-sqrt.f6452.4%
Simplified52.4%
sqrt-unprodN/A
associate-/l*N/A
associate-*l*N/A
sqrt-prodN/A
pow1/2N/A
*-lowering-*.f64N/A
pow1/2N/A
sqrt-lowering-sqrt.f64N/A
sqrt-lowering-sqrt.f64N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
PI-lowering-PI.f6467.3%
Applied egg-rr67.3%
associate-*l/N/A
associate-/l*N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
/-lowering-/.f6467.3%
Applied egg-rr67.3%
if 3.1999999999999999e157 < k Initial program 100.0%
Taylor expanded in k around 0
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
sqrt-lowering-sqrt.f642.6%
Simplified2.6%
sqrt-unprodN/A
sqrt-lowering-sqrt.f64N/A
associate-*l/N/A
*-commutativeN/A
*-commutativeN/A
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
PI-lowering-PI.f642.6%
Applied egg-rr2.6%
associate-*r*N/A
associate-/l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
/-lowering-/.f642.6%
Applied egg-rr2.6%
pow1/2N/A
associate-*r/N/A
associate-*r*N/A
metadata-evalN/A
metadata-evalN/A
pow-sqrN/A
pow-prod-downN/A
pow-lowering-pow.f64N/A
Applied egg-rr30.8%
(FPCore (k n) :precision binary64 (/ (pow (* 2.0 (* PI n)) (- 0.5 (/ k 2.0))) (sqrt k)))
double code(double k, double n) {
return pow((2.0 * (((double) M_PI) * n)), (0.5 - (k / 2.0))) / sqrt(k);
}
public static double code(double k, double n) {
return Math.pow((2.0 * (Math.PI * n)), (0.5 - (k / 2.0))) / Math.sqrt(k);
}
def code(k, n): return math.pow((2.0 * (math.pi * n)), (0.5 - (k / 2.0))) / math.sqrt(k)
function code(k, n) return Float64((Float64(2.0 * Float64(pi * n)) ^ Float64(0.5 - Float64(k / 2.0))) / sqrt(k)) end
function tmp = code(k, n) tmp = ((2.0 * (pi * n)) ^ (0.5 - (k / 2.0))) / sqrt(k); end
code[k_, n_] := N[(N[Power[N[(2.0 * N[(Pi * n), $MachinePrecision]), $MachinePrecision], N[(0.5 - N[(k / 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[Sqrt[k], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{{\left(2 \cdot \left(\pi \cdot n\right)\right)}^{\left(0.5 - \frac{k}{2}\right)}}{\sqrt{k}}
\end{array}
Initial program 99.4%
associate-*l/N/A
*-lft-identityN/A
/-lowering-/.f64N/A
pow-lowering-pow.f64N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
div-subN/A
--lowering--.f64N/A
metadata-evalN/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f6499.5%
Simplified99.5%
(FPCore (k n) :precision binary64 (if (<= k 1.55e+151) (pow (/ k (* 2.0 (* PI n))) -0.5) (pow (/ (* 4.0 (* (* PI n) (* PI n))) (* k k)) 0.25)))
double code(double k, double n) {
double tmp;
if (k <= 1.55e+151) {
tmp = pow((k / (2.0 * (((double) M_PI) * n))), -0.5);
} else {
tmp = pow(((4.0 * ((((double) M_PI) * n) * (((double) M_PI) * n))) / (k * k)), 0.25);
}
return tmp;
}
public static double code(double k, double n) {
double tmp;
if (k <= 1.55e+151) {
tmp = Math.pow((k / (2.0 * (Math.PI * n))), -0.5);
} else {
tmp = Math.pow(((4.0 * ((Math.PI * n) * (Math.PI * n))) / (k * k)), 0.25);
}
return tmp;
}
def code(k, n): tmp = 0 if k <= 1.55e+151: tmp = math.pow((k / (2.0 * (math.pi * n))), -0.5) else: tmp = math.pow(((4.0 * ((math.pi * n) * (math.pi * n))) / (k * k)), 0.25) return tmp
function code(k, n) tmp = 0.0 if (k <= 1.55e+151) tmp = Float64(k / Float64(2.0 * Float64(pi * n))) ^ -0.5; else tmp = Float64(Float64(4.0 * Float64(Float64(pi * n) * Float64(pi * n))) / Float64(k * k)) ^ 0.25; end return tmp end
function tmp_2 = code(k, n) tmp = 0.0; if (k <= 1.55e+151) tmp = (k / (2.0 * (pi * n))) ^ -0.5; else tmp = ((4.0 * ((pi * n) * (pi * n))) / (k * k)) ^ 0.25; end tmp_2 = tmp; end
code[k_, n_] := If[LessEqual[k, 1.55e+151], N[Power[N[(k / N[(2.0 * N[(Pi * n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision], N[Power[N[(N[(4.0 * N[(N[(Pi * n), $MachinePrecision] * N[(Pi * n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(k * k), $MachinePrecision]), $MachinePrecision], 0.25], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;k \leq 1.55 \cdot 10^{+151}:\\
\;\;\;\;{\left(\frac{k}{2 \cdot \left(\pi \cdot n\right)}\right)}^{-0.5}\\
\mathbf{else}:\\
\;\;\;\;{\left(\frac{4 \cdot \left(\left(\pi \cdot n\right) \cdot \left(\pi \cdot n\right)\right)}{k \cdot k}\right)}^{0.25}\\
\end{array}
\end{array}
if k < 1.5500000000000001e151Initial program 99.3%
Taylor expanded in k around 0
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
sqrt-lowering-sqrt.f6452.9%
Simplified52.9%
*-commutativeN/A
sqrt-divN/A
associate-/l*N/A
clear-numN/A
inv-powN/A
*-commutativeN/A
sqrt-prodN/A
sqrt-undivN/A
sqrt-pow2N/A
metadata-evalN/A
metadata-evalN/A
pow-lowering-pow.f64N/A
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
metadata-eval54.7%
Applied egg-rr54.7%
if 1.5500000000000001e151 < k Initial program 100.0%
Taylor expanded in k around 0
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
sqrt-lowering-sqrt.f642.6%
Simplified2.6%
sqrt-unprodN/A
sqrt-lowering-sqrt.f64N/A
associate-*l/N/A
*-commutativeN/A
*-commutativeN/A
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
PI-lowering-PI.f642.6%
Applied egg-rr2.6%
associate-*r*N/A
associate-/l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
/-lowering-/.f642.6%
Applied egg-rr2.6%
pow1/2N/A
associate-*r/N/A
associate-*r*N/A
metadata-evalN/A
metadata-evalN/A
pow-sqrN/A
pow-prod-downN/A
pow-lowering-pow.f64N/A
Applied egg-rr29.9%
(FPCore (k n) :precision binary64 (pow (/ k (* 2.0 (* PI n))) -0.5))
double code(double k, double n) {
return pow((k / (2.0 * (((double) M_PI) * n))), -0.5);
}
public static double code(double k, double n) {
return Math.pow((k / (2.0 * (Math.PI * n))), -0.5);
}
def code(k, n): return math.pow((k / (2.0 * (math.pi * n))), -0.5)
function code(k, n) return Float64(k / Float64(2.0 * Float64(pi * n))) ^ -0.5 end
function tmp = code(k, n) tmp = (k / (2.0 * (pi * n))) ^ -0.5; end
code[k_, n_] := N[Power[N[(k / N[(2.0 * N[(Pi * n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]
\begin{array}{l}
\\
{\left(\frac{k}{2 \cdot \left(\pi \cdot n\right)}\right)}^{-0.5}
\end{array}
Initial program 99.4%
Taylor expanded in k around 0
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
sqrt-lowering-sqrt.f6440.8%
Simplified40.8%
*-commutativeN/A
sqrt-divN/A
associate-/l*N/A
clear-numN/A
inv-powN/A
*-commutativeN/A
sqrt-prodN/A
sqrt-undivN/A
sqrt-pow2N/A
metadata-evalN/A
metadata-evalN/A
pow-lowering-pow.f64N/A
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
metadata-eval42.1%
Applied egg-rr42.1%
(FPCore (k n) :precision binary64 (sqrt (/ (* 2.0 (* PI n)) k)))
double code(double k, double n) {
return sqrt(((2.0 * (((double) M_PI) * n)) / k));
}
public static double code(double k, double n) {
return Math.sqrt(((2.0 * (Math.PI * n)) / k));
}
def code(k, n): return math.sqrt(((2.0 * (math.pi * n)) / k))
function code(k, n) return sqrt(Float64(Float64(2.0 * Float64(pi * n)) / k)) end
function tmp = code(k, n) tmp = sqrt(((2.0 * (pi * n)) / k)); end
code[k_, n_] := N[Sqrt[N[(N[(2.0 * N[(Pi * n), $MachinePrecision]), $MachinePrecision] / k), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\sqrt{\frac{2 \cdot \left(\pi \cdot n\right)}{k}}
\end{array}
Initial program 99.4%
Taylor expanded in k around 0
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
sqrt-lowering-sqrt.f6440.8%
Simplified40.8%
sqrt-unprodN/A
sqrt-lowering-sqrt.f64N/A
associate-*l/N/A
*-commutativeN/A
*-commutativeN/A
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
PI-lowering-PI.f6440.9%
Applied egg-rr40.9%
(FPCore (k n) :precision binary64 (sqrt (/ 2.0 (/ k (* PI n)))))
double code(double k, double n) {
return sqrt((2.0 / (k / (((double) M_PI) * n))));
}
public static double code(double k, double n) {
return Math.sqrt((2.0 / (k / (Math.PI * n))));
}
def code(k, n): return math.sqrt((2.0 / (k / (math.pi * n))))
function code(k, n) return sqrt(Float64(2.0 / Float64(k / Float64(pi * n)))) end
function tmp = code(k, n) tmp = sqrt((2.0 / (k / (pi * n)))); end
code[k_, n_] := N[Sqrt[N[(2.0 / N[(k / N[(Pi * n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\sqrt{\frac{2}{\frac{k}{\pi \cdot n}}}
\end{array}
Initial program 99.4%
Taylor expanded in k around 0
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
sqrt-lowering-sqrt.f6440.8%
Simplified40.8%
sqrt-unprodN/A
sqrt-lowering-sqrt.f64N/A
associate-*l/N/A
*-commutativeN/A
*-commutativeN/A
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
PI-lowering-PI.f6440.9%
Applied egg-rr40.9%
associate-/l*N/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f6440.9%
Applied egg-rr40.9%
(FPCore (k n) :precision binary64 (sqrt (* (* 2.0 n) (/ PI k))))
double code(double k, double n) {
return sqrt(((2.0 * n) * (((double) M_PI) / k)));
}
public static double code(double k, double n) {
return Math.sqrt(((2.0 * n) * (Math.PI / k)));
}
def code(k, n): return math.sqrt(((2.0 * n) * (math.pi / k)))
function code(k, n) return sqrt(Float64(Float64(2.0 * n) * Float64(pi / k))) end
function tmp = code(k, n) tmp = sqrt(((2.0 * n) * (pi / k))); end
code[k_, n_] := N[Sqrt[N[(N[(2.0 * n), $MachinePrecision] * N[(Pi / k), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\sqrt{\left(2 \cdot n\right) \cdot \frac{\pi}{k}}
\end{array}
Initial program 99.4%
Taylor expanded in k around 0
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
sqrt-lowering-sqrt.f6440.8%
Simplified40.8%
sqrt-unprodN/A
sqrt-lowering-sqrt.f64N/A
associate-*l/N/A
*-commutativeN/A
*-commutativeN/A
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
PI-lowering-PI.f6440.9%
Applied egg-rr40.9%
*-commutativeN/A
*-commutativeN/A
associate-*l*N/A
associate-*r/N/A
associate-*l/N/A
*-commutativeN/A
associate-*r*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
PI-lowering-PI.f6440.9%
Applied egg-rr40.9%
Final simplification40.9%
(FPCore (k n) :precision binary64 (sqrt (* (* 2.0 PI) (/ n k))))
double code(double k, double n) {
return sqrt(((2.0 * ((double) M_PI)) * (n / k)));
}
public static double code(double k, double n) {
return Math.sqrt(((2.0 * Math.PI) * (n / k)));
}
def code(k, n): return math.sqrt(((2.0 * math.pi) * (n / k)))
function code(k, n) return sqrt(Float64(Float64(2.0 * pi) * Float64(n / k))) end
function tmp = code(k, n) tmp = sqrt(((2.0 * pi) * (n / k))); end
code[k_, n_] := N[Sqrt[N[(N[(2.0 * Pi), $MachinePrecision] * N[(n / k), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\sqrt{\left(2 \cdot \pi\right) \cdot \frac{n}{k}}
\end{array}
Initial program 99.4%
Taylor expanded in k around 0
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
sqrt-lowering-sqrt.f6440.8%
Simplified40.8%
sqrt-unprodN/A
sqrt-lowering-sqrt.f64N/A
associate-*l/N/A
*-commutativeN/A
*-commutativeN/A
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
PI-lowering-PI.f6440.9%
Applied egg-rr40.9%
associate-*r*N/A
associate-/l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
/-lowering-/.f6440.9%
Applied egg-rr40.9%
(FPCore (k n) :precision binary64 (sqrt (* PI (* n (/ 2.0 k)))))
double code(double k, double n) {
return sqrt((((double) M_PI) * (n * (2.0 / k))));
}
public static double code(double k, double n) {
return Math.sqrt((Math.PI * (n * (2.0 / k))));
}
def code(k, n): return math.sqrt((math.pi * (n * (2.0 / k))))
function code(k, n) return sqrt(Float64(pi * Float64(n * Float64(2.0 / k)))) end
function tmp = code(k, n) tmp = sqrt((pi * (n * (2.0 / k)))); end
code[k_, n_] := N[Sqrt[N[(Pi * N[(n * N[(2.0 / k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\sqrt{\pi \cdot \left(n \cdot \frac{2}{k}\right)}
\end{array}
Initial program 99.4%
Taylor expanded in k around 0
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
sqrt-lowering-sqrt.f6440.8%
Simplified40.8%
sqrt-unprodN/A
sqrt-lowering-sqrt.f64N/A
associate-*l/N/A
*-commutativeN/A
*-commutativeN/A
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
PI-lowering-PI.f6440.9%
Applied egg-rr40.9%
associate-*r*N/A
associate-/l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
/-lowering-/.f6440.9%
Applied egg-rr40.9%
associate-*r/N/A
associate-*r*N/A
*-commutativeN/A
associate-/l*N/A
associate-*l*N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
*-lowering-*.f64N/A
/-lowering-/.f6440.8%
Applied egg-rr40.8%
herbie shell --seed 2024141
(FPCore (k n)
:name "Migdal et al, Equation (51)"
:precision binary64
(* (/ 1.0 (sqrt k)) (pow (* (* 2.0 PI) n) (/ (- 1.0 k) 2.0))))