
(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 12 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 (/ 1.0 (* (sqrt k) (pow (* PI (* 2.0 n)) (- (* k 0.5) 0.5)))))
double code(double k, double n) {
return 1.0 / (sqrt(k) * pow((((double) M_PI) * (2.0 * n)), ((k * 0.5) - 0.5)));
}
public static double code(double k, double n) {
return 1.0 / (Math.sqrt(k) * Math.pow((Math.PI * (2.0 * n)), ((k * 0.5) - 0.5)));
}
def code(k, n): return 1.0 / (math.sqrt(k) * math.pow((math.pi * (2.0 * n)), ((k * 0.5) - 0.5)))
function code(k, n) return Float64(1.0 / Float64(sqrt(k) * (Float64(pi * Float64(2.0 * n)) ^ Float64(Float64(k * 0.5) - 0.5)))) end
function tmp = code(k, n) tmp = 1.0 / (sqrt(k) * ((pi * (2.0 * n)) ^ ((k * 0.5) - 0.5))); end
code[k_, n_] := N[(1.0 / N[(N[Sqrt[k], $MachinePrecision] * N[Power[N[(Pi * N[(2.0 * n), $MachinePrecision]), $MachinePrecision], N[(N[(k * 0.5), $MachinePrecision] - 0.5), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{1}{\sqrt{k} \cdot {\left(\pi \cdot \left(2 \cdot n\right)\right)}^{\left(k \cdot 0.5 - 0.5\right)}}
\end{array}
Initial program 99.1%
Taylor expanded in k around 0 99.2%
*-commutative99.2%
associate-*r*99.2%
div-sub99.2%
metadata-eval99.2%
sqrt-div99.1%
metadata-eval99.1%
pow1/299.1%
metadata-eval99.1%
pow-pow74.5%
pow1/376.6%
div-inv76.6%
clear-num76.6%
pow1/374.5%
pow-pow99.1%
metadata-eval99.1%
pow1/299.1%
associate-*r*99.1%
*-commutative99.1%
div-inv99.1%
Applied egg-rr99.1%
div-inv99.0%
pow-flip99.4%
associate-*r*99.4%
*-commutative99.4%
*-commutative99.4%
Applied egg-rr99.4%
Final simplification99.4%
(FPCore (k n)
:precision binary64
(let* ((t_0 (* n (* PI 2.0))))
(if (<= k 2e-21)
(* (pow k -0.5) (sqrt t_0))
(sqrt (* (/ 1.0 k) (pow t_0 (- 1.0 k)))))))
double code(double k, double n) {
double t_0 = n * (((double) M_PI) * 2.0);
double tmp;
if (k <= 2e-21) {
tmp = pow(k, -0.5) * sqrt(t_0);
} else {
tmp = sqrt(((1.0 / k) * pow(t_0, (1.0 - k))));
}
return tmp;
}
public static double code(double k, double n) {
double t_0 = n * (Math.PI * 2.0);
double tmp;
if (k <= 2e-21) {
tmp = Math.pow(k, -0.5) * Math.sqrt(t_0);
} else {
tmp = Math.sqrt(((1.0 / k) * Math.pow(t_0, (1.0 - k))));
}
return tmp;
}
def code(k, n): t_0 = n * (math.pi * 2.0) tmp = 0 if k <= 2e-21: tmp = math.pow(k, -0.5) * math.sqrt(t_0) else: tmp = math.sqrt(((1.0 / k) * math.pow(t_0, (1.0 - k)))) return tmp
function code(k, n) t_0 = Float64(n * Float64(pi * 2.0)) tmp = 0.0 if (k <= 2e-21) tmp = Float64((k ^ -0.5) * sqrt(t_0)); else tmp = sqrt(Float64(Float64(1.0 / k) * (t_0 ^ Float64(1.0 - k)))); end return tmp end
function tmp_2 = code(k, n) t_0 = n * (pi * 2.0); tmp = 0.0; if (k <= 2e-21) tmp = (k ^ -0.5) * sqrt(t_0); else tmp = sqrt(((1.0 / k) * (t_0 ^ (1.0 - k)))); end tmp_2 = tmp; end
code[k_, n_] := Block[{t$95$0 = N[(n * N[(Pi * 2.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[k, 2e-21], N[(N[Power[k, -0.5], $MachinePrecision] * N[Sqrt[t$95$0], $MachinePrecision]), $MachinePrecision], N[Sqrt[N[(N[(1.0 / k), $MachinePrecision] * N[Power[t$95$0, N[(1.0 - k), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := n \cdot \left(\pi \cdot 2\right)\\
\mathbf{if}\;k \leq 2 \cdot 10^{-21}:\\
\;\;\;\;{k}^{-0.5} \cdot \sqrt{t\_0}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{1}{k} \cdot {t\_0}^{\left(1 - k\right)}}\\
\end{array}
\end{array}
if k < 1.99999999999999982e-21Initial program 99.4%
Taylor expanded in k around 0 72.4%
associate-/l*72.4%
Simplified72.4%
pow172.4%
sqrt-unprod72.7%
Applied egg-rr72.7%
unpow172.7%
associate-*l*72.7%
Simplified72.7%
Taylor expanded in n around 0 72.7%
associate-*r/72.7%
associate-*l*72.7%
*-commutative72.7%
sqrt-undiv99.5%
div-inv99.4%
associate-*r*99.4%
pow1/299.4%
pow-flip99.5%
metadata-eval99.5%
Applied egg-rr99.5%
if 1.99999999999999982e-21 < k Initial program 98.9%
associate-*l/98.9%
*-lft-identity98.9%
associate-*l*98.9%
div-sub98.9%
metadata-eval98.9%
Simplified98.9%
div-inv98.9%
metadata-eval98.9%
div-sub98.9%
sqr-pow98.9%
associate-*l*99.4%
div-inv99.4%
metadata-eval99.4%
associate-/l*99.4%
metadata-eval99.4%
Applied egg-rr99.4%
add-sqr-sqrt99.4%
sqrt-unprod98.9%
pow298.9%
Applied egg-rr98.9%
unpow298.9%
unpow1/298.9%
*-commutative98.9%
unpow1/298.9%
*-commutative98.9%
swap-sqr98.9%
pow-sqr98.9%
metadata-eval98.9%
unpow-198.9%
rem-square-sqrt98.9%
*-commutative98.9%
*-commutative98.9%
associate-*l*98.9%
Simplified98.9%
Final simplification99.2%
(FPCore (k n) :precision binary64 (* (sqrt (/ 1.0 k)) (pow (* n (* PI 2.0)) (/ (- 1.0 k) 2.0))))
double code(double k, double n) {
return sqrt((1.0 / k)) * pow((n * (((double) M_PI) * 2.0)), ((1.0 - k) / 2.0));
}
public static double code(double k, double n) {
return Math.sqrt((1.0 / k)) * Math.pow((n * (Math.PI * 2.0)), ((1.0 - k) / 2.0));
}
def code(k, n): return math.sqrt((1.0 / k)) * math.pow((n * (math.pi * 2.0)), ((1.0 - k) / 2.0))
function code(k, n) return Float64(sqrt(Float64(1.0 / k)) * (Float64(n * Float64(pi * 2.0)) ^ Float64(Float64(1.0 - k) / 2.0))) end
function tmp = code(k, n) tmp = sqrt((1.0 / k)) * ((n * (pi * 2.0)) ^ ((1.0 - k) / 2.0)); end
code[k_, n_] := N[(N[Sqrt[N[(1.0 / k), $MachinePrecision]], $MachinePrecision] * N[Power[N[(n * N[(Pi * 2.0), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 - k), $MachinePrecision] / 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\sqrt{\frac{1}{k}} \cdot {\left(n \cdot \left(\pi \cdot 2\right)\right)}^{\left(\frac{1 - k}{2}\right)}
\end{array}
Initial program 99.1%
Taylor expanded in k around 0 99.2%
Final simplification99.2%
(FPCore (k n) :precision binary64 (* (pow (* PI (* 2.0 n)) (+ 0.5 (* k -0.5))) (pow k -0.5)))
double code(double k, double n) {
return pow((((double) M_PI) * (2.0 * n)), (0.5 + (k * -0.5))) * pow(k, -0.5);
}
public static double code(double k, double n) {
return Math.pow((Math.PI * (2.0 * n)), (0.5 + (k * -0.5))) * Math.pow(k, -0.5);
}
def code(k, n): return math.pow((math.pi * (2.0 * n)), (0.5 + (k * -0.5))) * math.pow(k, -0.5)
function code(k, n) return Float64((Float64(pi * Float64(2.0 * n)) ^ Float64(0.5 + Float64(k * -0.5))) * (k ^ -0.5)) end
function tmp = code(k, n) tmp = ((pi * (2.0 * n)) ^ (0.5 + (k * -0.5))) * (k ^ -0.5); end
code[k_, n_] := N[(N[Power[N[(Pi * N[(2.0 * n), $MachinePrecision]), $MachinePrecision], N[(0.5 + N[(k * -0.5), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Power[k, -0.5], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
{\left(\pi \cdot \left(2 \cdot n\right)\right)}^{\left(0.5 + k \cdot -0.5\right)} \cdot {k}^{-0.5}
\end{array}
Initial program 99.1%
associate-*l/99.2%
*-lft-identity99.2%
associate-*l*99.2%
div-sub99.2%
metadata-eval99.2%
Simplified99.2%
pow-div99.0%
pow1/299.0%
associate-/l/99.2%
*-un-lft-identity99.2%
frac-times99.0%
pow1/299.0%
pow-flip99.0%
metadata-eval99.0%
pow1/299.0%
pow-div99.2%
div-inv99.2%
metadata-eval99.2%
Applied egg-rr99.2%
*-commutative99.2%
*-commutative99.2%
*-commutative99.2%
cancel-sign-sub-inv99.2%
metadata-eval99.2%
associate-*r*99.2%
*-commutative99.2%
Simplified99.2%
Final simplification99.2%
(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.1%
associate-*l/99.2%
*-lft-identity99.2%
associate-*l*99.2%
div-sub99.2%
metadata-eval99.2%
Simplified99.2%
(FPCore (k n) :precision binary64 (* (pow k -0.5) (sqrt (* n (* PI 2.0)))))
double code(double k, double n) {
return pow(k, -0.5) * sqrt((n * (((double) M_PI) * 2.0)));
}
public static double code(double k, double n) {
return Math.pow(k, -0.5) * Math.sqrt((n * (Math.PI * 2.0)));
}
def code(k, n): return math.pow(k, -0.5) * math.sqrt((n * (math.pi * 2.0)))
function code(k, n) return Float64((k ^ -0.5) * sqrt(Float64(n * Float64(pi * 2.0)))) end
function tmp = code(k, n) tmp = (k ^ -0.5) * sqrt((n * (pi * 2.0))); end
code[k_, n_] := N[(N[Power[k, -0.5], $MachinePrecision] * N[Sqrt[N[(n * N[(Pi * 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
{k}^{-0.5} \cdot \sqrt{n \cdot \left(\pi \cdot 2\right)}
\end{array}
Initial program 99.1%
Taylor expanded in k around 0 38.6%
associate-/l*38.6%
Simplified38.6%
pow138.6%
sqrt-unprod38.8%
Applied egg-rr38.8%
unpow138.8%
associate-*l*38.8%
Simplified38.8%
Taylor expanded in n around 0 38.8%
associate-*r/38.8%
associate-*l*38.8%
*-commutative38.8%
sqrt-undiv51.6%
div-inv51.5%
associate-*r*51.5%
pow1/251.5%
pow-flip51.6%
metadata-eval51.6%
Applied egg-rr51.6%
Final simplification51.6%
(FPCore (k n) :precision binary64 (/ (sqrt (* PI (* 2.0 n))) (sqrt k)))
double code(double k, double n) {
return sqrt((((double) M_PI) * (2.0 * n))) / sqrt(k);
}
public static double code(double k, double n) {
return Math.sqrt((Math.PI * (2.0 * n))) / Math.sqrt(k);
}
def code(k, n): return math.sqrt((math.pi * (2.0 * n))) / math.sqrt(k)
function code(k, n) return Float64(sqrt(Float64(pi * Float64(2.0 * n))) / sqrt(k)) end
function tmp = code(k, n) tmp = sqrt((pi * (2.0 * n))) / sqrt(k); end
code[k_, n_] := N[(N[Sqrt[N[(Pi * N[(2.0 * n), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[Sqrt[k], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\sqrt{\pi \cdot \left(2 \cdot n\right)}}{\sqrt{k}}
\end{array}
Initial program 99.1%
Taylor expanded in k around 0 38.6%
associate-/l*38.6%
Simplified38.6%
associate-*r/38.6%
*-commutative38.6%
Applied egg-rr38.6%
*-commutative38.6%
sqrt-unprod38.8%
metadata-eval38.8%
times-frac38.8%
*-commutative38.8%
associate-*r*38.8%
*-commutative38.8%
associate-*r*38.8%
*-un-lft-identity38.8%
sqrt-div51.6%
associate-*r*51.6%
*-commutative51.6%
*-commutative51.6%
Applied egg-rr51.6%
(FPCore (k n) :precision binary64 (* (sqrt (* 2.0 (/ PI k))) (sqrt n)))
double code(double k, double n) {
return sqrt((2.0 * (((double) M_PI) / k))) * sqrt(n);
}
public static double code(double k, double n) {
return Math.sqrt((2.0 * (Math.PI / k))) * Math.sqrt(n);
}
def code(k, n): return math.sqrt((2.0 * (math.pi / k))) * math.sqrt(n)
function code(k, n) return Float64(sqrt(Float64(2.0 * Float64(pi / k))) * sqrt(n)) end
function tmp = code(k, n) tmp = sqrt((2.0 * (pi / k))) * sqrt(n); end
code[k_, n_] := N[(N[Sqrt[N[(2.0 * N[(Pi / k), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sqrt[n], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\sqrt{2 \cdot \frac{\pi}{k}} \cdot \sqrt{n}
\end{array}
Initial program 99.1%
Taylor expanded in k around 0 38.6%
associate-/l*38.6%
Simplified38.6%
pow138.6%
sqrt-unprod38.8%
Applied egg-rr38.8%
unpow138.8%
associate-*l*38.8%
Simplified38.8%
*-commutative38.8%
sqrt-prod51.6%
*-commutative51.6%
Applied egg-rr51.6%
(FPCore (k n) :precision binary64 (pow (* (/ k n) (/ 0.5 PI)) -0.5))
double code(double k, double n) {
return pow(((k / n) * (0.5 / ((double) M_PI))), -0.5);
}
public static double code(double k, double n) {
return Math.pow(((k / n) * (0.5 / Math.PI)), -0.5);
}
def code(k, n): return math.pow(((k / n) * (0.5 / math.pi)), -0.5)
function code(k, n) return Float64(Float64(k / n) * Float64(0.5 / pi)) ^ -0.5 end
function tmp = code(k, n) tmp = ((k / n) * (0.5 / pi)) ^ -0.5; end
code[k_, n_] := N[Power[N[(N[(k / n), $MachinePrecision] * N[(0.5 / Pi), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]
\begin{array}{l}
\\
{\left(\frac{k}{n} \cdot \frac{0.5}{\pi}\right)}^{-0.5}
\end{array}
Initial program 99.1%
Taylor expanded in k around 0 38.6%
associate-/l*38.6%
Simplified38.6%
pow138.6%
sqrt-unprod38.8%
Applied egg-rr38.8%
unpow138.8%
associate-*l*38.8%
Simplified38.8%
Taylor expanded in n around 0 38.8%
clear-num38.8%
*-commutative38.8%
associate-/l/38.8%
un-div-inv38.8%
sqrt-undiv38.8%
clear-num38.8%
inv-pow38.8%
sqrt-undiv38.9%
sqrt-pow239.0%
div-inv39.0%
associate-/l/39.0%
metadata-eval39.0%
metadata-eval39.0%
Applied egg-rr39.0%
associate-*l/39.0%
*-commutative39.0%
times-frac39.0%
Simplified39.0%
(FPCore (k n) :precision binary64 (sqrt (* PI (* 2.0 (/ n k)))))
double code(double k, double n) {
return sqrt((((double) M_PI) * (2.0 * (n / k))));
}
public static double code(double k, double n) {
return Math.sqrt((Math.PI * (2.0 * (n / k))));
}
def code(k, n): return math.sqrt((math.pi * (2.0 * (n / k))))
function code(k, n) return sqrt(Float64(pi * Float64(2.0 * Float64(n / k)))) end
function tmp = code(k, n) tmp = sqrt((pi * (2.0 * (n / k)))); end
code[k_, n_] := N[Sqrt[N[(Pi * N[(2.0 * N[(n / k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\sqrt{\pi \cdot \left(2 \cdot \frac{n}{k}\right)}
\end{array}
Initial program 99.1%
Taylor expanded in k around 0 38.6%
associate-/l*38.6%
Simplified38.6%
pow138.6%
sqrt-unprod38.8%
Applied egg-rr38.8%
unpow138.8%
associate-*r/38.8%
*-commutative38.8%
associate-/l*38.8%
associate-*l*38.8%
Simplified38.8%
Final simplification38.8%
(FPCore (k n) :precision binary64 (sqrt (* n (* 2.0 (/ PI k)))))
double code(double k, double n) {
return sqrt((n * (2.0 * (((double) M_PI) / k))));
}
public static double code(double k, double n) {
return Math.sqrt((n * (2.0 * (Math.PI / k))));
}
def code(k, n): return math.sqrt((n * (2.0 * (math.pi / k))))
function code(k, n) return sqrt(Float64(n * Float64(2.0 * Float64(pi / k)))) end
function tmp = code(k, n) tmp = sqrt((n * (2.0 * (pi / k)))); end
code[k_, n_] := N[Sqrt[N[(n * N[(2.0 * N[(Pi / k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\sqrt{n \cdot \left(2 \cdot \frac{\pi}{k}\right)}
\end{array}
Initial program 99.1%
Taylor expanded in k around 0 38.6%
associate-/l*38.6%
Simplified38.6%
pow138.6%
sqrt-unprod38.8%
Applied egg-rr38.8%
unpow138.8%
associate-*l*38.8%
Simplified38.8%
Final simplification38.8%
(FPCore (k n) :precision binary64 (sqrt (* 2.0 (/ PI (/ k n)))))
double code(double k, double n) {
return sqrt((2.0 * (((double) M_PI) / (k / n))));
}
public static double code(double k, double n) {
return Math.sqrt((2.0 * (Math.PI / (k / n))));
}
def code(k, n): return math.sqrt((2.0 * (math.pi / (k / n))))
function code(k, n) return sqrt(Float64(2.0 * Float64(pi / Float64(k / n)))) end
function tmp = code(k, n) tmp = sqrt((2.0 * (pi / (k / n)))); end
code[k_, n_] := N[Sqrt[N[(2.0 * N[(Pi / N[(k / n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\sqrt{2 \cdot \frac{\pi}{\frac{k}{n}}}
\end{array}
Initial program 99.1%
Taylor expanded in k around 0 38.6%
associate-/l*38.6%
Simplified38.6%
pow138.6%
sqrt-unprod38.8%
Applied egg-rr38.8%
unpow138.8%
associate-*l*38.8%
Simplified38.8%
Taylor expanded in n around 0 38.8%
clear-num38.8%
*-commutative38.8%
associate-/l/38.8%
clear-num38.8%
div-inv38.8%
clear-num38.8%
Applied egg-rr38.8%
associate-*r/38.8%
associate-*l/38.8%
associate-/r/38.8%
Simplified38.8%
herbie shell --seed 2024112
(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))))