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

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

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

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

Reproduce

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