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

Error

Bits error versus k

Bits error versus n

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.4

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

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

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

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

Reproduce

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