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{\sqrt{\left(2 \cdot \pi\right) \cdot n}}{\sqrt{\frac{k}{{\left(\frac{0.5}{\pi \cdot n}\right)}^{k}}}} \]
\frac{1}{\sqrt{k}} \cdot {\left(\left(2 \cdot \pi\right) \cdot n\right)}^{\left(\frac{1 - k}{2}\right)}
\frac{\sqrt{\left(2 \cdot \pi\right) \cdot n}}{\sqrt{\frac{k}{{\left(\frac{0.5}{\pi \cdot n}\right)}^{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
 (/ (sqrt (* (* 2.0 PI) n)) (sqrt (/ k (pow (/ 0.5 (* PI n)) 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 sqrt((2.0 * ((double) M_PI)) * n) / sqrt(k / pow((0.5 / (((double) M_PI) * n)), 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.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 egg0.4

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

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

    \[\leadsto \frac{\sqrt{\left(2 \cdot \pi\right) \cdot n}}{\color{blue}{\sqrt{\frac{k}{{\left({\left(\left(2 \cdot \pi\right) \cdot n\right)}^{k}\right)}^{-1}}}}} \]
  6. Taylor expanded in n around 0 0.4

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

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

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

Reproduce

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