Average Error: 0.5 → 0.4
Time: 8.8s
Precision: binary64
\[\frac{1}{\sqrt{k}} \cdot {\left(\left(2 \cdot \pi\right) \cdot n\right)}^{\left(\frac{1 - k}{2}\right)} \]
\[\frac{{2}^{\left(\mathsf{fma}\left(k, -0.5, 0.5\right)\right)} \cdot \left({\pi}^{\left(\mathsf{fma}\left(k, -0.5, 0.5\right)\right)} \cdot \left(\sqrt{n} \cdot {n}^{\left(k \cdot -0.5\right)}\right)\right)}{\sqrt{k}} \]
\frac{1}{\sqrt{k}} \cdot {\left(\left(2 \cdot \pi\right) \cdot n\right)}^{\left(\frac{1 - k}{2}\right)}
\frac{{2}^{\left(\mathsf{fma}\left(k, -0.5, 0.5\right)\right)} \cdot \left({\pi}^{\left(\mathsf{fma}\left(k, -0.5, 0.5\right)\right)} \cdot \left(\sqrt{n} \cdot {n}^{\left(k \cdot -0.5\right)}\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 (fma k -0.5 0.5))
   (* (pow PI (fma k -0.5 0.5)) (* (sqrt n) (pow n (* k -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, fma(k, -0.5, 0.5)) * (pow(((double) M_PI), fma(k, -0.5, 0.5)) * (sqrt(n) * pow(n, (k * -0.5))))) / 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 *-un-lft-identity_binary640.4

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

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

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

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

    \[\leadsto \color{blue}{{\left(2 \cdot \pi\right)}^{\left(\mathsf{fma}\left(k, -0.5, 0.5\right)\right)}} \cdot \frac{{n}^{\left(\mathsf{fma}\left(k, -0.5, 0.5\right)\right)}}{\sqrt{k}} \]
  8. Applied unpow-prod-down_binary640.6

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

    \[\leadsto \color{blue}{{2}^{\left(\mathsf{fma}\left(k, -0.5, 0.5\right)\right)} \cdot \left({\pi}^{\left(\mathsf{fma}\left(k, -0.5, 0.5\right)\right)} \cdot \frac{{n}^{\left(\mathsf{fma}\left(k, -0.5, 0.5\right)\right)}}{\sqrt{k}}\right)} \]
  10. Applied *-un-lft-identity_binary640.5

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

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

    \[\leadsto {2}^{\left(\mathsf{fma}\left(k, -0.5, 0.5\right)\right)} \cdot \left({\pi}^{\left(\mathsf{fma}\left(k, -0.5, 0.5\right)\right)} \cdot \frac{{n}^{\color{blue}{\left(k \cdot -0.5 + 0.5\right)}}}{\sqrt{1} \cdot \sqrt{k}}\right) \]
  13. Applied unpow-prod-up_binary640.4

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

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

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

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

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

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

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

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

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

Reproduce

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