Average Error: 0.5 → 0.4
Time: 5.1s
Precision: binary64
\[\frac{1}{\sqrt{k}} \cdot {\left(\left(2 \cdot \pi\right) \cdot n\right)}^{\left(\frac{1 - k}{2}\right)} \]
\[\frac{\sqrt{\left(2 \cdot n\right) \cdot \pi} \cdot \left(-{k}^{-0.5}\right)}{-\sqrt{{\left(2 \cdot \left(n \cdot \pi\right)\right)}^{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
 (/
  (* (sqrt (* (* 2.0 n) PI)) (- (pow k -0.5)))
  (- (sqrt (pow (* 2.0 (* n PI)) 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 (sqrt(((2.0 * n) * ((double) M_PI))) * -pow(k, -0.5)) / -sqrt(pow((2.0 * (n * ((double) M_PI))), 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.sqrt(((2.0 * n) * Math.PI)) * -Math.pow(k, -0.5)) / -Math.sqrt(Math.pow((2.0 * (n * Math.PI)), 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.sqrt(((2.0 * n) * math.pi)) * -math.pow(k, -0.5)) / -math.sqrt(math.pow((2.0 * (n * math.pi)), 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(Float64(sqrt(Float64(Float64(2.0 * n) * pi)) * Float64(-(k ^ -0.5))) / Float64(-sqrt((Float64(2.0 * Float64(n * pi)) ^ 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 = (sqrt(((2.0 * n) * pi)) * -(k ^ -0.5)) / -sqrt(((2.0 * (n * pi)) ^ 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[(N[Sqrt[N[(N[(2.0 * n), $MachinePrecision] * Pi), $MachinePrecision]], $MachinePrecision] * (-N[Power[k, -0.5], $MachinePrecision])), $MachinePrecision] / (-N[Sqrt[N[Power[N[(2.0 * N[(n * Pi), $MachinePrecision]), $MachinePrecision], k], $MachinePrecision]], $MachinePrecision])), $MachinePrecision]
\frac{1}{\sqrt{k}} \cdot {\left(\left(2 \cdot \pi\right) \cdot n\right)}^{\left(\frac{1 - k}{2}\right)}
\frac{\sqrt{\left(2 \cdot n\right) \cdot \pi} \cdot \left(-{k}^{-0.5}\right)}{-\sqrt{{\left(2 \cdot \left(n \cdot \pi\right)\right)}^{k}}}

Error

Bits error versus k

Bits error versus n

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 \frac{1}{\sqrt{k}} \cdot \color{blue}{\frac{\sqrt{2 \cdot \left(\pi \cdot n\right)}}{{\left(2 \cdot \left(\pi \cdot n\right)\right)}^{\left(\frac{k}{2}\right)}}} \]
  3. Applied egg-rr0.4

    \[\leadsto \color{blue}{\frac{\left(-\sqrt{\left(2 \cdot n\right) \cdot \pi}\right) \cdot {k}^{-0.5}}{-{\left(\left(2 \cdot n\right) \cdot \pi\right)}^{\left(k \cdot 0.5\right)}}} \]
  4. Taylor expanded in n around 0 0.4

    \[\leadsto \frac{\left(-\sqrt{\left(2 \cdot n\right) \cdot \pi}\right) \cdot {k}^{-0.5}}{-\color{blue}{e^{0.5 \cdot \left(k \cdot \left(\log n + \log \left(2 \cdot \pi\right)\right)\right)}}} \]
  5. Simplified0.4

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

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

Reproduce

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