Average Error: 0.5 → 0.5
Time: 9.7s
Precision: binary64
\[\frac{1}{\sqrt{k}} \cdot {\left(\left(2 \cdot \pi\right) \cdot n\right)}^{\left(\frac{1 - k}{2}\right)} \]
\[{\left(\frac{\pi}{\frac{0.5}{n}}\right)}^{\left(\mathsf{fma}\left(k, -0.5, 0.5\right)\right)} \cdot {k}^{-0.5} \]
\frac{1}{\sqrt{k}} \cdot {\left(\left(2 \cdot \pi\right) \cdot n\right)}^{\left(\frac{1 - k}{2}\right)}
{\left(\frac{\pi}{\frac{0.5}{n}}\right)}^{\left(\mathsf{fma}\left(k, -0.5, 0.5\right)\right)} \cdot {k}^{-0.5}
(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 (/ 0.5 n)) (fma k -0.5 0.5)) (pow k -0.5)))
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) / (0.5 / n)), fma(k, -0.5, 0.5)) * pow(k, -0.5);
}

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

    \[\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 div-inv_binary640.5

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

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

    \[\leadsto {\left(\left(2 \cdot \pi\right) \cdot n\right)}^{\left(\mathsf{fma}\left(k, -0.5, 0.5\right)\right)} \cdot \color{blue}{{k}^{\left(-0.5\right)}} \]
  6. Simplified0.5

    \[\leadsto {\left(\left(2 \cdot \pi\right) \cdot n\right)}^{\left(\mathsf{fma}\left(k, -0.5, 0.5\right)\right)} \cdot {k}^{\color{blue}{-0.5}} \]
  7. Taylor expanded in n around -inf 64.0

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

    \[\leadsto \color{blue}{{\left(\frac{\pi \cdot -2}{\frac{-1}{n}}\right)}^{\left(\mathsf{fma}\left(k, -0.5, 0.5\right)\right)}} \cdot {k}^{-0.5} \]
  9. Applied associate-/l*_binary640.5

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

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

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

Reproduce

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