Average Error: 0.5 → 0.4
Time: 9.4s
Precision: binary64
Cost: 32832
\[\frac{1}{\sqrt{k}} \cdot {\left(\left(2 \cdot \pi\right) \cdot n\right)}^{\left(\frac{1 - k}{2}\right)} \]
\[{k}^{-0.5} \cdot \sqrt{{\left(2 \cdot \pi\right)}^{\left(1 - k\right)} \cdot \frac{n}{{n}^{k}}} \]
(FPCore (k n)
 :precision binary64
 (* (/ 1.0 (sqrt k)) (pow (* (* 2.0 PI) n) (/ (- 1.0 k) 2.0))))
(FPCore (k n)
 :precision binary64
 (* (pow k -0.5) (sqrt (* (pow (* 2.0 PI) (- 1.0 k)) (/ n (pow n k))))))
double code(double k, double n) {
	return (1.0 / sqrt(k)) * pow(((2.0 * ((double) M_PI)) * n), ((1.0 - k) / 2.0));
}
double code(double k, double n) {
	return pow(k, -0.5) * sqrt((pow((2.0 * ((double) M_PI)), (1.0 - k)) * (n / pow(n, k))));
}
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));
}
public static double code(double k, double n) {
	return Math.pow(k, -0.5) * Math.sqrt((Math.pow((2.0 * Math.PI), (1.0 - k)) * (n / Math.pow(n, k))));
}
def code(k, n):
	return (1.0 / math.sqrt(k)) * math.pow(((2.0 * math.pi) * n), ((1.0 - k) / 2.0))
def code(k, n):
	return math.pow(k, -0.5) * math.sqrt((math.pow((2.0 * math.pi), (1.0 - k)) * (n / math.pow(n, k))))
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 code(k, n)
	return Float64((k ^ -0.5) * sqrt(Float64((Float64(2.0 * pi) ^ Float64(1.0 - k)) * Float64(n / (n ^ k)))))
end
function tmp = code(k, n)
	tmp = (1.0 / sqrt(k)) * (((2.0 * pi) * n) ^ ((1.0 - k) / 2.0));
end
function tmp = code(k, n)
	tmp = (k ^ -0.5) * sqrt((((2.0 * pi) ^ (1.0 - k)) * (n / (n ^ k))));
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]
code[k_, n_] := N[(N[Power[k, -0.5], $MachinePrecision] * N[Sqrt[N[(N[Power[N[(2.0 * Pi), $MachinePrecision], N[(1.0 - k), $MachinePrecision]], $MachinePrecision] * N[(n / N[Power[n, k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\frac{1}{\sqrt{k}} \cdot {\left(\left(2 \cdot \pi\right) \cdot n\right)}^{\left(\frac{1 - k}{2}\right)}
{k}^{-0.5} \cdot \sqrt{{\left(2 \cdot \pi\right)}^{\left(1 - k\right)} \cdot \frac{n}{{n}^{k}}}

Error

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 0.5

    \[\frac{1}{\sqrt{k}} \cdot {\left(\left(2 \cdot \pi\right) \cdot n\right)}^{\left(\frac{1 - k}{2}\right)} \]
  2. Applied egg-rr0.5

    \[\leadsto \color{blue}{\frac{1}{\frac{\sqrt{k}}{\sqrt{{\left(2 \cdot \left(\pi \cdot n\right)\right)}^{\left(1 - k\right)}}}}} \]
  3. Applied egg-rr0.4

    \[\leadsto \frac{1}{\frac{\sqrt{k}}{\sqrt{\color{blue}{\frac{n \cdot \left(2 \cdot \pi\right)}{{\left(n \cdot \left(2 \cdot \pi\right)\right)}^{k}}}}}} \]
  4. Applied egg-rr0.4

    \[\leadsto \color{blue}{{k}^{-0.5} \cdot \sqrt{{\left(n \cdot \left(2 \cdot \pi\right)\right)}^{\left(1 - k\right)}}} \]
  5. Applied egg-rr0.4

    \[\leadsto {k}^{-0.5} \cdot \sqrt{\color{blue}{{\left(2 \cdot \pi\right)}^{\left(1 - k\right)} \cdot \frac{n}{{n}^{k}}}} \]
  6. Final simplification0.4

    \[\leadsto {k}^{-0.5} \cdot \sqrt{{\left(2 \cdot \pi\right)}^{\left(1 - k\right)} \cdot \frac{n}{{n}^{k}}} \]

Alternatives

Alternative 1
Error0.4
Cost26240
\[{k}^{-0.5} \cdot \sqrt{{\left(\left(2 \cdot \pi\right) \cdot n\right)}^{\left(1 - k\right)}} \]
Alternative 2
Error0.5
Cost20032
\[\sqrt{\frac{1}{k}} \cdot {\left(\left(2 \cdot \pi\right) \cdot n\right)}^{\left(\frac{1 - k}{2}\right)} \]
Alternative 3
Error0.4
Cost19972
\[\begin{array}{l} \mathbf{if}\;k \leq 1.3230474388299305 \cdot 10^{-17}:\\ \;\;\;\;{k}^{-0.5} \cdot \sqrt{2 \cdot \left(\pi \cdot n\right)}\\ \mathbf{else}:\\ \;\;\;\;{\left(k \cdot {\left(\left(2 \cdot \pi\right) \cdot n\right)}^{\left(k + -1\right)}\right)}^{-0.5}\\ \end{array} \]
Alternative 4
Error0.4
Cost19968
\[{k}^{-0.5} \cdot {\left(\left(2 \cdot \pi\right) \cdot n\right)}^{\left(\frac{1 - k}{2}\right)} \]
Alternative 5
Error0.5
Cost19908
\[\begin{array}{l} t_0 := 2 \cdot \left(\pi \cdot n\right)\\ \mathbf{if}\;k \leq 1.3230474388299305 \cdot 10^{-17}:\\ \;\;\;\;{k}^{-0.5} \cdot \sqrt{t_0}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\frac{{t_0}^{\left(1 - k\right)}}{k}}\\ \end{array} \]
Alternative 6
Error0.4
Cost19904
\[\frac{{\left(\pi \cdot \left(2 \cdot n\right)\right)}^{\left(0.5 + k \cdot -0.5\right)}}{\sqrt{k}} \]
Alternative 7
Error2.5
Cost19780
\[\begin{array}{l} \mathbf{if}\;k \leq 1.3230474388299305 \cdot 10^{-17}:\\ \;\;\;\;{k}^{-0.5} \cdot \sqrt{2 \cdot \left(\pi \cdot n\right)}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{2 \cdot \left(n \cdot \left(\left(1 + \frac{\pi}{k}\right) + -1\right)\right)}\\ \end{array} \]
Alternative 8
Error2.5
Cost19716
\[\begin{array}{l} \mathbf{if}\;k \leq 1.3230474388299305 \cdot 10^{-17}:\\ \;\;\;\;\sqrt{2 \cdot \frac{\pi}{k}} \cdot \sqrt{n}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{2 \cdot \left(n \cdot \left(\left(1 + \frac{\pi}{k}\right) + -1\right)\right)}\\ \end{array} \]
Alternative 9
Error2.4
Cost19716
\[\begin{array}{l} \mathbf{if}\;k \leq 1.6644590962652856 \cdot 10^{-13}:\\ \;\;\;\;\frac{\sqrt{\left(2 \cdot \pi\right) \cdot n}}{\sqrt{k}}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{2 \cdot \left(n \cdot \left(\left(1 + \frac{\pi}{k}\right) + -1\right)\right)}\\ \end{array} \]
Alternative 10
Error13.1
Cost13440
\[\sqrt{2 \cdot \left(n \cdot \left(\left(1 + \frac{\pi}{k}\right) + -1\right)\right)} \]
Alternative 11
Error31.7
Cost13248
\[{\left(0.5 \cdot \frac{\frac{k}{n}}{\pi}\right)}^{-0.5} \]
Alternative 12
Error32.3
Cost13184
\[\sqrt{2 \cdot \frac{n}{\frac{k}{\pi}}} \]
Alternative 13
Error32.3
Cost13184
\[\sqrt{2 \cdot \left(n \cdot \frac{\pi}{k}\right)} \]

Error

Reproduce

herbie shell --seed 2022241 
(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))))