\frac{1}{\sqrt{k}} \cdot {\left(\left(2 \cdot \pi\right) \cdot n\right)}^{\left(\frac{1 - k}{2}\right)}
\frac{\sqrt{\frac{1}{k}} \cdot e^{-0.5 \cdot \left(k \cdot \left(\log \left(2 \cdot \pi\right) - \log \left(\frac{1}{n}\right)\right)\right)}}{{\left(\left(2 \cdot \pi\right) \cdot n\right)}^{-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 (/ (* (sqrt (/ 1.0 k)) (exp (* -0.5 (* k (- (log (* 2.0 PI)) (log (/ 1.0 n))))))) (pow (* (* 2.0 PI) n) -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 (sqrt(1.0 / k) * exp(-0.5 * (k * (log(2.0 * ((double) M_PI)) - log(1.0 / n))))) / pow(((2.0 * ((double) M_PI)) * n), -0.5);
}



Bits error versus k



Bits error versus n
Results
Initial program 0.5
Simplified0.4
Applied fma-udef_binary640.4
Applied unpow-prod-up_binary640.4
Applied associate-/l*_binary640.5
Simplified0.5
Applied div-inv_binary640.5
Applied associate-/r*_binary640.5
Applied pow1/2_binary640.5
Applied pow-flip_binary640.5
Simplified0.5
Taylor expanded in n around inf 0.5
Final simplification0.5
herbie shell --seed 2022020
(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))))