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

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

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

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

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

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

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

Reproduce

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