Average Error: 0.4 → 0.5
Time: 7.5s
Precision: 64
\[\frac{1}{\sqrt{k}} \cdot {\left(\left(2 \cdot \pi\right) \cdot n\right)}^{\left(\frac{1 - k}{2}\right)}\]
\[\sqrt{\frac{1}{\sqrt{k}}} \cdot \left(\sqrt{\frac{1}{\sqrt{k}}} \cdot {\left(\left(2 \cdot \pi\right) \cdot n\right)}^{\left(\frac{1 - k}{2}\right)}\right)\]
\frac{1}{\sqrt{k}} \cdot {\left(\left(2 \cdot \pi\right) \cdot n\right)}^{\left(\frac{1 - k}{2}\right)}
\sqrt{\frac{1}{\sqrt{k}}} \cdot \left(\sqrt{\frac{1}{\sqrt{k}}} \cdot {\left(\left(2 \cdot \pi\right) \cdot n\right)}^{\left(\frac{1 - k}{2}\right)}\right)
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 / sqrt(k))) * (sqrt((1.0 / sqrt(k))) * pow(((2.0 * ((double) M_PI)) * n), ((1.0 - k) / 2.0))));
}

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

    \[\frac{1}{\sqrt{k}} \cdot {\left(\left(2 \cdot \pi\right) \cdot n\right)}^{\left(\frac{1 - k}{2}\right)}\]
  2. Using strategy rm
  3. Applied add-sqr-sqrt0.5

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

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

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

Reproduce

herbie shell --seed 2020060 
(FPCore (k n)
  :name "Migdal et al, Equation (51)"
  :precision binary64
  (* (/ 1 (sqrt k)) (pow (* (* 2 PI) n) (/ (- 1 k) 2))))