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

    \[\leadsto {\left(2 \cdot \pi\right)}^{\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{k}} \]
  9. Applied unpow-prod-up_binary640.5

    \[\leadsto {\left(2 \cdot \pi\right)}^{\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{k}} \]
  10. Simplified0.5

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

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

Reproduce

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