Migdal et al, Equation (51)

Percentage Accurate: 99.5% → 98.7%
Time: 12.4s
Alternatives: 9
Speedup: 1.0×

Specification

?
\[\begin{array}{l} \\ \frac{1}{\sqrt{k}} \cdot {\left(\left(2 \cdot \pi\right) \cdot n\right)}^{\left(\frac{1 - k}{2}\right)} \end{array} \]
(FPCore (k n)
 :precision binary64
 (* (/ 1.0 (sqrt k)) (pow (* (* 2.0 PI) n) (/ (- 1.0 k) 2.0))))
double code(double k, double n) {
	return (1.0 / sqrt(k)) * pow(((2.0 * ((double) M_PI)) * n), ((1.0 - k) / 2.0));
}
public static double code(double k, double n) {
	return (1.0 / Math.sqrt(k)) * Math.pow(((2.0 * Math.PI) * n), ((1.0 - k) / 2.0));
}
def code(k, n):
	return (1.0 / math.sqrt(k)) * math.pow(((2.0 * math.pi) * n), ((1.0 - k) / 2.0))
function code(k, n)
	return Float64(Float64(1.0 / sqrt(k)) * (Float64(Float64(2.0 * pi) * n) ^ Float64(Float64(1.0 - k) / 2.0)))
end
function tmp = code(k, n)
	tmp = (1.0 / sqrt(k)) * (((2.0 * pi) * n) ^ ((1.0 - k) / 2.0));
end
code[k_, n_] := N[(N[(1.0 / N[Sqrt[k], $MachinePrecision]), $MachinePrecision] * N[Power[N[(N[(2.0 * Pi), $MachinePrecision] * n), $MachinePrecision], N[(N[(1.0 - k), $MachinePrecision] / 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\frac{1}{\sqrt{k}} \cdot {\left(\left(2 \cdot \pi\right) \cdot n\right)}^{\left(\frac{1 - k}{2}\right)}
\end{array}

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

The average percentage accuracy by input value. Horizontal axis shows value of an input variable; the variable is choosen in the title. Vertical axis is accuracy; higher is better. Red represent the original program, while blue represents Herbie's suggestion. These can be toggled with buttons below the plot. The line is an average while dots represent individual samples.

Accuracy vs Speed?

Herbie found 9 alternatives:

AlternativeAccuracySpeedup
The accuracy (vertical axis) and speed (horizontal axis) of each alternatives. Up and to the right is better. The red square shows the initial program, and each blue circle shows an alternative.The line shows the best available speed-accuracy tradeoffs.

Initial Program: 99.5% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \frac{1}{\sqrt{k}} \cdot {\left(\left(2 \cdot \pi\right) \cdot n\right)}^{\left(\frac{1 - k}{2}\right)} \end{array} \]
(FPCore (k n)
 :precision binary64
 (* (/ 1.0 (sqrt k)) (pow (* (* 2.0 PI) n) (/ (- 1.0 k) 2.0))))
double code(double k, double n) {
	return (1.0 / sqrt(k)) * pow(((2.0 * ((double) M_PI)) * n), ((1.0 - k) / 2.0));
}
public static double code(double k, double n) {
	return (1.0 / Math.sqrt(k)) * Math.pow(((2.0 * Math.PI) * n), ((1.0 - k) / 2.0));
}
def code(k, n):
	return (1.0 / math.sqrt(k)) * math.pow(((2.0 * math.pi) * n), ((1.0 - k) / 2.0))
function code(k, n)
	return Float64(Float64(1.0 / sqrt(k)) * (Float64(Float64(2.0 * pi) * n) ^ Float64(Float64(1.0 - k) / 2.0)))
end
function tmp = code(k, n)
	tmp = (1.0 / sqrt(k)) * (((2.0 * pi) * n) ^ ((1.0 - k) / 2.0));
end
code[k_, n_] := N[(N[(1.0 / N[Sqrt[k], $MachinePrecision]), $MachinePrecision] * N[Power[N[(N[(2.0 * Pi), $MachinePrecision] * n), $MachinePrecision], N[(N[(1.0 - k), $MachinePrecision] / 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\frac{1}{\sqrt{k}} \cdot {\left(\left(2 \cdot \pi\right) \cdot n\right)}^{\left(\frac{1 - k}{2}\right)}
\end{array}

Alternative 1: 98.7% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;k \leq 6.8 \cdot 10^{-94}:\\ \;\;\;\;\frac{\sqrt{2 \cdot n}}{\sqrt{\frac{k}{\pi}}}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\frac{{\left(2 \cdot \left(\pi \cdot n\right)\right)}^{\left(1 - k\right)}}{k}}\\ \end{array} \end{array} \]
(FPCore (k n)
 :precision binary64
 (if (<= k 6.8e-94)
   (/ (sqrt (* 2.0 n)) (sqrt (/ k PI)))
   (sqrt (/ (pow (* 2.0 (* PI n)) (- 1.0 k)) k))))
double code(double k, double n) {
	double tmp;
	if (k <= 6.8e-94) {
		tmp = sqrt((2.0 * n)) / sqrt((k / ((double) M_PI)));
	} else {
		tmp = sqrt((pow((2.0 * (((double) M_PI) * n)), (1.0 - k)) / k));
	}
	return tmp;
}
public static double code(double k, double n) {
	double tmp;
	if (k <= 6.8e-94) {
		tmp = Math.sqrt((2.0 * n)) / Math.sqrt((k / Math.PI));
	} else {
		tmp = Math.sqrt((Math.pow((2.0 * (Math.PI * n)), (1.0 - k)) / k));
	}
	return tmp;
}
def code(k, n):
	tmp = 0
	if k <= 6.8e-94:
		tmp = math.sqrt((2.0 * n)) / math.sqrt((k / math.pi))
	else:
		tmp = math.sqrt((math.pow((2.0 * (math.pi * n)), (1.0 - k)) / k))
	return tmp
function code(k, n)
	tmp = 0.0
	if (k <= 6.8e-94)
		tmp = Float64(sqrt(Float64(2.0 * n)) / sqrt(Float64(k / pi)));
	else
		tmp = sqrt(Float64((Float64(2.0 * Float64(pi * n)) ^ Float64(1.0 - k)) / k));
	end
	return tmp
end
function tmp_2 = code(k, n)
	tmp = 0.0;
	if (k <= 6.8e-94)
		tmp = sqrt((2.0 * n)) / sqrt((k / pi));
	else
		tmp = sqrt((((2.0 * (pi * n)) ^ (1.0 - k)) / k));
	end
	tmp_2 = tmp;
end
code[k_, n_] := If[LessEqual[k, 6.8e-94], N[(N[Sqrt[N[(2.0 * n), $MachinePrecision]], $MachinePrecision] / N[Sqrt[N[(k / Pi), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[Sqrt[N[(N[Power[N[(2.0 * N[(Pi * n), $MachinePrecision]), $MachinePrecision], N[(1.0 - k), $MachinePrecision]], $MachinePrecision] / k), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;k \leq 6.8 \cdot 10^{-94}:\\
\;\;\;\;\frac{\sqrt{2 \cdot n}}{\sqrt{\frac{k}{\pi}}}\\

\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{{\left(2 \cdot \left(\pi \cdot n\right)\right)}^{\left(1 - k\right)}}{k}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if k < 6.7999999999999996e-94

    1. Initial program 99.3%

      \[\frac{1}{\sqrt{k}} \cdot {\left(\left(2 \cdot \pi\right) \cdot n\right)}^{\left(\frac{1 - k}{2}\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in k around 0 61.3%

      \[\leadsto \color{blue}{\sqrt{\frac{n \cdot \pi}{k}} \cdot \sqrt{2}} \]
    4. Step-by-step derivation
      1. *-commutative61.3%

        \[\leadsto \color{blue}{\sqrt{2} \cdot \sqrt{\frac{n \cdot \pi}{k}}} \]
      2. associate-/l*61.3%

        \[\leadsto \sqrt{2} \cdot \sqrt{\color{blue}{n \cdot \frac{\pi}{k}}} \]
    5. Simplified61.3%

      \[\leadsto \color{blue}{\sqrt{2} \cdot \sqrt{n \cdot \frac{\pi}{k}}} \]
    6. Step-by-step derivation
      1. pow161.3%

        \[\leadsto \color{blue}{{\left(\sqrt{2} \cdot \sqrt{n \cdot \frac{\pi}{k}}\right)}^{1}} \]
      2. sqrt-unprod61.4%

        \[\leadsto {\color{blue}{\left(\sqrt{2 \cdot \left(n \cdot \frac{\pi}{k}\right)}\right)}}^{1} \]
      3. *-commutative61.4%

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

        \[\leadsto {\left(\sqrt{\color{blue}{\left(2 \cdot \frac{\pi}{k}\right) \cdot n}}\right)}^{1} \]
    7. Applied egg-rr61.4%

      \[\leadsto \color{blue}{{\left(\sqrt{\left(2 \cdot \frac{\pi}{k}\right) \cdot n}\right)}^{1}} \]
    8. Step-by-step derivation
      1. unpow161.4%

        \[\leadsto \color{blue}{\sqrt{\left(2 \cdot \frac{\pi}{k}\right) \cdot n}} \]
      2. associate-*l*61.4%

        \[\leadsto \sqrt{\color{blue}{2 \cdot \left(\frac{\pi}{k} \cdot n\right)}} \]
      3. associate-*l/61.4%

        \[\leadsto \sqrt{2 \cdot \color{blue}{\frac{\pi \cdot n}{k}}} \]
      4. associate-/l*61.5%

        \[\leadsto \sqrt{2 \cdot \color{blue}{\left(\pi \cdot \frac{n}{k}\right)}} \]
    9. Simplified61.5%

      \[\leadsto \color{blue}{\sqrt{2 \cdot \left(\pi \cdot \frac{n}{k}\right)}} \]
    10. Step-by-step derivation
      1. associate-*r/61.4%

        \[\leadsto \sqrt{2 \cdot \color{blue}{\frac{\pi \cdot n}{k}}} \]
      2. *-commutative61.4%

        \[\leadsto \sqrt{2 \cdot \frac{\color{blue}{n \cdot \pi}}{k}} \]
      3. associate-/l*61.4%

        \[\leadsto \sqrt{2 \cdot \color{blue}{\left(n \cdot \frac{\pi}{k}\right)}} \]
      4. clear-num61.4%

        \[\leadsto \sqrt{2 \cdot \left(n \cdot \color{blue}{\frac{1}{\frac{k}{\pi}}}\right)} \]
      5. un-div-inv61.4%

        \[\leadsto \sqrt{2 \cdot \color{blue}{\frac{n}{\frac{k}{\pi}}}} \]
    11. Applied egg-rr61.4%

      \[\leadsto \sqrt{2 \cdot \color{blue}{\frac{n}{\frac{k}{\pi}}}} \]
    12. Step-by-step derivation
      1. associate-*r/61.4%

        \[\leadsto \sqrt{\color{blue}{\frac{2 \cdot n}{\frac{k}{\pi}}}} \]
      2. sqrt-div99.5%

        \[\leadsto \color{blue}{\frac{\sqrt{2 \cdot n}}{\sqrt{\frac{k}{\pi}}}} \]
      3. *-commutative99.5%

        \[\leadsto \frac{\sqrt{\color{blue}{n \cdot 2}}}{\sqrt{\frac{k}{\pi}}} \]
    13. Applied egg-rr99.5%

      \[\leadsto \color{blue}{\frac{\sqrt{n \cdot 2}}{\sqrt{\frac{k}{\pi}}}} \]

    if 6.7999999999999996e-94 < k

    1. Initial program 99.6%

      \[\frac{1}{\sqrt{k}} \cdot {\left(\left(2 \cdot \pi\right) \cdot n\right)}^{\left(\frac{1 - k}{2}\right)} \]
    2. Add Preprocessing
    3. Applied egg-rr99.7%

      \[\leadsto \color{blue}{\sqrt{\frac{{\left(2 \cdot \left(\pi \cdot n\right)\right)}^{\left(2 \cdot \left(0.5 + k \cdot -0.5\right)\right)}}{k}}} \]
    4. Step-by-step derivation
      1. distribute-rgt-in99.7%

        \[\leadsto \sqrt{\frac{{\left(2 \cdot \left(\pi \cdot n\right)\right)}^{\color{blue}{\left(0.5 \cdot 2 + \left(k \cdot -0.5\right) \cdot 2\right)}}}{k}} \]
      2. metadata-eval99.7%

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

        \[\leadsto \sqrt{\frac{{\left(2 \cdot \left(\pi \cdot n\right)\right)}^{\left(1 + \color{blue}{k \cdot \left(-0.5 \cdot 2\right)}\right)}}{k}} \]
      4. metadata-eval99.7%

        \[\leadsto \sqrt{\frac{{\left(2 \cdot \left(\pi \cdot n\right)\right)}^{\left(1 + k \cdot \color{blue}{-1}\right)}}{k}} \]
      5. *-commutative99.7%

        \[\leadsto \sqrt{\frac{{\left(2 \cdot \left(\pi \cdot n\right)\right)}^{\left(1 + \color{blue}{-1 \cdot k}\right)}}{k}} \]
      6. neg-mul-199.7%

        \[\leadsto \sqrt{\frac{{\left(2 \cdot \left(\pi \cdot n\right)\right)}^{\left(1 + \color{blue}{\left(-k\right)}\right)}}{k}} \]
      7. sub-neg99.7%

        \[\leadsto \sqrt{\frac{{\left(2 \cdot \left(\pi \cdot n\right)\right)}^{\color{blue}{\left(1 - k\right)}}}{k}} \]
      8. *-commutative99.7%

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

      \[\leadsto \color{blue}{\sqrt{\frac{{\left(2 \cdot \left(n \cdot \pi\right)\right)}^{\left(1 - k\right)}}{k}}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification99.6%

    \[\leadsto \begin{array}{l} \mathbf{if}\;k \leq 6.8 \cdot 10^{-94}:\\ \;\;\;\;\frac{\sqrt{2 \cdot n}}{\sqrt{\frac{k}{\pi}}}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\frac{{\left(2 \cdot \left(\pi \cdot n\right)\right)}^{\left(1 - k\right)}}{k}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 2: 57.4% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;k \leq 4.2 \cdot 10^{+16}:\\ \;\;\;\;\frac{\sqrt{2 \cdot n}}{\sqrt{\frac{k}{\pi}}}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{-1 + \mathsf{fma}\left(\pi, 2 \cdot \frac{n}{k}, 1\right)}\\ \end{array} \end{array} \]
(FPCore (k n)
 :precision binary64
 (if (<= k 4.2e+16)
   (/ (sqrt (* 2.0 n)) (sqrt (/ k PI)))
   (sqrt (+ -1.0 (fma PI (* 2.0 (/ n k)) 1.0)))))
double code(double k, double n) {
	double tmp;
	if (k <= 4.2e+16) {
		tmp = sqrt((2.0 * n)) / sqrt((k / ((double) M_PI)));
	} else {
		tmp = sqrt((-1.0 + fma(((double) M_PI), (2.0 * (n / k)), 1.0)));
	}
	return tmp;
}
function code(k, n)
	tmp = 0.0
	if (k <= 4.2e+16)
		tmp = Float64(sqrt(Float64(2.0 * n)) / sqrt(Float64(k / pi)));
	else
		tmp = sqrt(Float64(-1.0 + fma(pi, Float64(2.0 * Float64(n / k)), 1.0)));
	end
	return tmp
end
code[k_, n_] := If[LessEqual[k, 4.2e+16], N[(N[Sqrt[N[(2.0 * n), $MachinePrecision]], $MachinePrecision] / N[Sqrt[N[(k / Pi), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[Sqrt[N[(-1.0 + N[(Pi * N[(2.0 * N[(n / k), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;k \leq 4.2 \cdot 10^{+16}:\\
\;\;\;\;\frac{\sqrt{2 \cdot n}}{\sqrt{\frac{k}{\pi}}}\\

\mathbf{else}:\\
\;\;\;\;\sqrt{-1 + \mathsf{fma}\left(\pi, 2 \cdot \frac{n}{k}, 1\right)}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if k < 4.2e16

    1. Initial program 98.9%

      \[\frac{1}{\sqrt{k}} \cdot {\left(\left(2 \cdot \pi\right) \cdot n\right)}^{\left(\frac{1 - k}{2}\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in k around 0 67.9%

      \[\leadsto \color{blue}{\sqrt{\frac{n \cdot \pi}{k}} \cdot \sqrt{2}} \]
    4. Step-by-step derivation
      1. *-commutative67.9%

        \[\leadsto \color{blue}{\sqrt{2} \cdot \sqrt{\frac{n \cdot \pi}{k}}} \]
      2. associate-/l*67.8%

        \[\leadsto \sqrt{2} \cdot \sqrt{\color{blue}{n \cdot \frac{\pi}{k}}} \]
    5. Simplified67.8%

      \[\leadsto \color{blue}{\sqrt{2} \cdot \sqrt{n \cdot \frac{\pi}{k}}} \]
    6. Step-by-step derivation
      1. pow167.8%

        \[\leadsto \color{blue}{{\left(\sqrt{2} \cdot \sqrt{n \cdot \frac{\pi}{k}}\right)}^{1}} \]
      2. sqrt-unprod68.0%

        \[\leadsto {\color{blue}{\left(\sqrt{2 \cdot \left(n \cdot \frac{\pi}{k}\right)}\right)}}^{1} \]
      3. *-commutative68.0%

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

        \[\leadsto {\left(\sqrt{\color{blue}{\left(2 \cdot \frac{\pi}{k}\right) \cdot n}}\right)}^{1} \]
    7. Applied egg-rr68.0%

      \[\leadsto \color{blue}{{\left(\sqrt{\left(2 \cdot \frac{\pi}{k}\right) \cdot n}\right)}^{1}} \]
    8. Step-by-step derivation
      1. unpow168.0%

        \[\leadsto \color{blue}{\sqrt{\left(2 \cdot \frac{\pi}{k}\right) \cdot n}} \]
      2. associate-*l*68.0%

        \[\leadsto \sqrt{\color{blue}{2 \cdot \left(\frac{\pi}{k} \cdot n\right)}} \]
      3. associate-*l/68.0%

        \[\leadsto \sqrt{2 \cdot \color{blue}{\frac{\pi \cdot n}{k}}} \]
      4. associate-/l*68.0%

        \[\leadsto \sqrt{2 \cdot \color{blue}{\left(\pi \cdot \frac{n}{k}\right)}} \]
    9. Simplified68.0%

      \[\leadsto \color{blue}{\sqrt{2 \cdot \left(\pi \cdot \frac{n}{k}\right)}} \]
    10. Step-by-step derivation
      1. associate-*r/68.0%

        \[\leadsto \sqrt{2 \cdot \color{blue}{\frac{\pi \cdot n}{k}}} \]
      2. *-commutative68.0%

        \[\leadsto \sqrt{2 \cdot \frac{\color{blue}{n \cdot \pi}}{k}} \]
      3. associate-/l*68.0%

        \[\leadsto \sqrt{2 \cdot \color{blue}{\left(n \cdot \frac{\pi}{k}\right)}} \]
      4. clear-num68.0%

        \[\leadsto \sqrt{2 \cdot \left(n \cdot \color{blue}{\frac{1}{\frac{k}{\pi}}}\right)} \]
      5. un-div-inv68.0%

        \[\leadsto \sqrt{2 \cdot \color{blue}{\frac{n}{\frac{k}{\pi}}}} \]
    11. Applied egg-rr68.0%

      \[\leadsto \sqrt{2 \cdot \color{blue}{\frac{n}{\frac{k}{\pi}}}} \]
    12. Step-by-step derivation
      1. associate-*r/68.0%

        \[\leadsto \sqrt{\color{blue}{\frac{2 \cdot n}{\frac{k}{\pi}}}} \]
      2. sqrt-div91.6%

        \[\leadsto \color{blue}{\frac{\sqrt{2 \cdot n}}{\sqrt{\frac{k}{\pi}}}} \]
      3. *-commutative91.6%

        \[\leadsto \frac{\sqrt{\color{blue}{n \cdot 2}}}{\sqrt{\frac{k}{\pi}}} \]
    13. Applied egg-rr91.6%

      \[\leadsto \color{blue}{\frac{\sqrt{n \cdot 2}}{\sqrt{\frac{k}{\pi}}}} \]

    if 4.2e16 < k

    1. Initial program 100.0%

      \[\frac{1}{\sqrt{k}} \cdot {\left(\left(2 \cdot \pi\right) \cdot n\right)}^{\left(\frac{1 - k}{2}\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in k around 0 1.9%

      \[\leadsto \color{blue}{\sqrt{\frac{n \cdot \pi}{k}} \cdot \sqrt{2}} \]
    4. Step-by-step derivation
      1. *-commutative1.9%

        \[\leadsto \color{blue}{\sqrt{2} \cdot \sqrt{\frac{n \cdot \pi}{k}}} \]
      2. associate-/l*1.9%

        \[\leadsto \sqrt{2} \cdot \sqrt{\color{blue}{n \cdot \frac{\pi}{k}}} \]
    5. Simplified1.9%

      \[\leadsto \color{blue}{\sqrt{2} \cdot \sqrt{n \cdot \frac{\pi}{k}}} \]
    6. Step-by-step derivation
      1. pow11.9%

        \[\leadsto \color{blue}{{\left(\sqrt{2} \cdot \sqrt{n \cdot \frac{\pi}{k}}\right)}^{1}} \]
      2. sqrt-unprod1.9%

        \[\leadsto {\color{blue}{\left(\sqrt{2 \cdot \left(n \cdot \frac{\pi}{k}\right)}\right)}}^{1} \]
      3. *-commutative1.9%

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

        \[\leadsto {\left(\sqrt{\color{blue}{\left(2 \cdot \frac{\pi}{k}\right) \cdot n}}\right)}^{1} \]
    7. Applied egg-rr1.9%

      \[\leadsto \color{blue}{{\left(\sqrt{\left(2 \cdot \frac{\pi}{k}\right) \cdot n}\right)}^{1}} \]
    8. Step-by-step derivation
      1. unpow11.9%

        \[\leadsto \color{blue}{\sqrt{\left(2 \cdot \frac{\pi}{k}\right) \cdot n}} \]
      2. associate-*l*1.9%

        \[\leadsto \sqrt{\color{blue}{2 \cdot \left(\frac{\pi}{k} \cdot n\right)}} \]
      3. associate-*l/1.9%

        \[\leadsto \sqrt{2 \cdot \color{blue}{\frac{\pi \cdot n}{k}}} \]
      4. associate-/l*1.9%

        \[\leadsto \sqrt{2 \cdot \color{blue}{\left(\pi \cdot \frac{n}{k}\right)}} \]
    9. Simplified1.9%

      \[\leadsto \color{blue}{\sqrt{2 \cdot \left(\pi \cdot \frac{n}{k}\right)}} \]
    10. Step-by-step derivation
      1. associate-*r/1.9%

        \[\leadsto \sqrt{2 \cdot \color{blue}{\frac{\pi \cdot n}{k}}} \]
      2. *-commutative1.9%

        \[\leadsto \sqrt{2 \cdot \frac{\color{blue}{n \cdot \pi}}{k}} \]
      3. associate-/l*1.9%

        \[\leadsto \sqrt{2 \cdot \color{blue}{\left(n \cdot \frac{\pi}{k}\right)}} \]
      4. clear-num1.9%

        \[\leadsto \sqrt{2 \cdot \left(n \cdot \color{blue}{\frac{1}{\frac{k}{\pi}}}\right)} \]
      5. un-div-inv1.9%

        \[\leadsto \sqrt{2 \cdot \color{blue}{\frac{n}{\frac{k}{\pi}}}} \]
    11. Applied egg-rr1.9%

      \[\leadsto \sqrt{2 \cdot \color{blue}{\frac{n}{\frac{k}{\pi}}}} \]
    12. Step-by-step derivation
      1. associate-/r/1.9%

        \[\leadsto \sqrt{2 \cdot \color{blue}{\left(\frac{n}{k} \cdot \pi\right)}} \]
      2. clear-num1.9%

        \[\leadsto \sqrt{2 \cdot \left(\color{blue}{\frac{1}{\frac{k}{n}}} \cdot \pi\right)} \]
      3. associate-*l/1.9%

        \[\leadsto \sqrt{2 \cdot \color{blue}{\frac{1 \cdot \pi}{\frac{k}{n}}}} \]
      4. *-un-lft-identity1.9%

        \[\leadsto \sqrt{2 \cdot \frac{\color{blue}{\pi}}{\frac{k}{n}}} \]
      5. expm1-log1p-u1.9%

        \[\leadsto \sqrt{\color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(2 \cdot \frac{\pi}{\frac{k}{n}}\right)\right)}} \]
      6. associate-/l*1.9%

        \[\leadsto \sqrt{\mathsf{expm1}\left(\mathsf{log1p}\left(\color{blue}{\frac{2 \cdot \pi}{\frac{k}{n}}}\right)\right)} \]
      7. expm1-undefine34.9%

        \[\leadsto \sqrt{\color{blue}{e^{\mathsf{log1p}\left(\frac{2 \cdot \pi}{\frac{k}{n}}\right)} - 1}} \]
      8. associate-/r/34.9%

        \[\leadsto \sqrt{e^{\mathsf{log1p}\left(\color{blue}{\frac{2 \cdot \pi}{k} \cdot n}\right)} - 1} \]
      9. *-commutative34.9%

        \[\leadsto \sqrt{e^{\mathsf{log1p}\left(\color{blue}{n \cdot \frac{2 \cdot \pi}{k}}\right)} - 1} \]
      10. *-commutative34.9%

        \[\leadsto \sqrt{e^{\mathsf{log1p}\left(n \cdot \frac{\color{blue}{\pi \cdot 2}}{k}\right)} - 1} \]
      11. associate-/l*34.9%

        \[\leadsto \sqrt{e^{\mathsf{log1p}\left(n \cdot \color{blue}{\left(\pi \cdot \frac{2}{k}\right)}\right)} - 1} \]
    13. Applied egg-rr34.9%

      \[\leadsto \sqrt{\color{blue}{e^{\mathsf{log1p}\left(n \cdot \left(\pi \cdot \frac{2}{k}\right)\right)} - 1}} \]
    14. Step-by-step derivation
      1. sub-neg34.9%

        \[\leadsto \sqrt{\color{blue}{e^{\mathsf{log1p}\left(n \cdot \left(\pi \cdot \frac{2}{k}\right)\right)} + \left(-1\right)}} \]
      2. metadata-eval34.9%

        \[\leadsto \sqrt{e^{\mathsf{log1p}\left(n \cdot \left(\pi \cdot \frac{2}{k}\right)\right)} + \color{blue}{-1}} \]
      3. +-commutative34.9%

        \[\leadsto \sqrt{\color{blue}{-1 + e^{\mathsf{log1p}\left(n \cdot \left(\pi \cdot \frac{2}{k}\right)\right)}}} \]
      4. log1p-undefine34.9%

        \[\leadsto \sqrt{-1 + e^{\color{blue}{\log \left(1 + n \cdot \left(\pi \cdot \frac{2}{k}\right)\right)}}} \]
      5. rem-exp-log34.9%

        \[\leadsto \sqrt{-1 + \color{blue}{\left(1 + n \cdot \left(\pi \cdot \frac{2}{k}\right)\right)}} \]
      6. +-commutative34.9%

        \[\leadsto \sqrt{-1 + \color{blue}{\left(n \cdot \left(\pi \cdot \frac{2}{k}\right) + 1\right)}} \]
      7. *-commutative34.9%

        \[\leadsto \sqrt{-1 + \left(\color{blue}{\left(\pi \cdot \frac{2}{k}\right) \cdot n} + 1\right)} \]
      8. associate-*l*34.9%

        \[\leadsto \sqrt{-1 + \left(\color{blue}{\pi \cdot \left(\frac{2}{k} \cdot n\right)} + 1\right)} \]
      9. associate-*l/34.9%

        \[\leadsto \sqrt{-1 + \left(\pi \cdot \color{blue}{\frac{2 \cdot n}{k}} + 1\right)} \]
      10. *-commutative34.9%

        \[\leadsto \sqrt{-1 + \left(\pi \cdot \frac{\color{blue}{n \cdot 2}}{k} + 1\right)} \]
      11. fma-define34.9%

        \[\leadsto \sqrt{-1 + \color{blue}{\mathsf{fma}\left(\pi, \frac{n \cdot 2}{k}, 1\right)}} \]
      12. *-commutative34.9%

        \[\leadsto \sqrt{-1 + \mathsf{fma}\left(\pi, \frac{\color{blue}{2 \cdot n}}{k}, 1\right)} \]
      13. associate-*r/34.9%

        \[\leadsto \sqrt{-1 + \mathsf{fma}\left(\pi, \color{blue}{2 \cdot \frac{n}{k}}, 1\right)} \]
    15. Simplified34.9%

      \[\leadsto \sqrt{\color{blue}{-1 + \mathsf{fma}\left(\pi, 2 \cdot \frac{n}{k}, 1\right)}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification60.1%

    \[\leadsto \begin{array}{l} \mathbf{if}\;k \leq 4.2 \cdot 10^{+16}:\\ \;\;\;\;\frac{\sqrt{2 \cdot n}}{\sqrt{\frac{k}{\pi}}}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{-1 + \mathsf{fma}\left(\pi, 2 \cdot \frac{n}{k}, 1\right)}\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 99.5% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \frac{{\left(2 \cdot \left(\pi \cdot n\right)\right)}^{\left(0.5 - \frac{k}{2}\right)}}{\sqrt{k}} \end{array} \]
(FPCore (k n)
 :precision binary64
 (/ (pow (* 2.0 (* PI n)) (- 0.5 (/ k 2.0))) (sqrt k)))
double code(double k, double n) {
	return pow((2.0 * (((double) M_PI) * n)), (0.5 - (k / 2.0))) / sqrt(k);
}
public static double code(double k, double n) {
	return Math.pow((2.0 * (Math.PI * n)), (0.5 - (k / 2.0))) / Math.sqrt(k);
}
def code(k, n):
	return math.pow((2.0 * (math.pi * n)), (0.5 - (k / 2.0))) / math.sqrt(k)
function code(k, n)
	return Float64((Float64(2.0 * Float64(pi * n)) ^ Float64(0.5 - Float64(k / 2.0))) / sqrt(k))
end
function tmp = code(k, n)
	tmp = ((2.0 * (pi * n)) ^ (0.5 - (k / 2.0))) / sqrt(k);
end
code[k_, n_] := N[(N[Power[N[(2.0 * N[(Pi * n), $MachinePrecision]), $MachinePrecision], N[(0.5 - N[(k / 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[Sqrt[k], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\frac{{\left(2 \cdot \left(\pi \cdot n\right)\right)}^{\left(0.5 - \frac{k}{2}\right)}}{\sqrt{k}}
\end{array}
Derivation
  1. Initial program 99.5%

    \[\frac{1}{\sqrt{k}} \cdot {\left(\left(2 \cdot \pi\right) \cdot n\right)}^{\left(\frac{1 - k}{2}\right)} \]
  2. Step-by-step derivation
    1. associate-*l/99.6%

      \[\leadsto \color{blue}{\frac{1 \cdot {\left(\left(2 \cdot \pi\right) \cdot n\right)}^{\left(\frac{1 - k}{2}\right)}}{\sqrt{k}}} \]
    2. *-lft-identity99.6%

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

      \[\leadsto \frac{{\color{blue}{\left(2 \cdot \left(\pi \cdot n\right)\right)}}^{\left(\frac{1 - k}{2}\right)}}{\sqrt{k}} \]
    4. div-sub99.6%

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

      \[\leadsto \frac{{\left(2 \cdot \left(\pi \cdot n\right)\right)}^{\left(\color{blue}{0.5} - \frac{k}{2}\right)}}{\sqrt{k}} \]
  3. Simplified99.6%

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

Alternative 4: 40.2% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \frac{\sqrt{2 \cdot n}}{\sqrt{\frac{k}{\pi}}} \end{array} \]
(FPCore (k n) :precision binary64 (/ (sqrt (* 2.0 n)) (sqrt (/ k PI))))
double code(double k, double n) {
	return sqrt((2.0 * n)) / sqrt((k / ((double) M_PI)));
}
public static double code(double k, double n) {
	return Math.sqrt((2.0 * n)) / Math.sqrt((k / Math.PI));
}
def code(k, n):
	return math.sqrt((2.0 * n)) / math.sqrt((k / math.pi))
function code(k, n)
	return Float64(sqrt(Float64(2.0 * n)) / sqrt(Float64(k / pi)))
end
function tmp = code(k, n)
	tmp = sqrt((2.0 * n)) / sqrt((k / pi));
end
code[k_, n_] := N[(N[Sqrt[N[(2.0 * n), $MachinePrecision]], $MachinePrecision] / N[Sqrt[N[(k / Pi), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\frac{\sqrt{2 \cdot n}}{\sqrt{\frac{k}{\pi}}}
\end{array}
Derivation
  1. Initial program 99.5%

    \[\frac{1}{\sqrt{k}} \cdot {\left(\left(2 \cdot \pi\right) \cdot n\right)}^{\left(\frac{1 - k}{2}\right)} \]
  2. Add Preprocessing
  3. Taylor expanded in k around 0 31.3%

    \[\leadsto \color{blue}{\sqrt{\frac{n \cdot \pi}{k}} \cdot \sqrt{2}} \]
  4. Step-by-step derivation
    1. *-commutative31.3%

      \[\leadsto \color{blue}{\sqrt{2} \cdot \sqrt{\frac{n \cdot \pi}{k}}} \]
    2. associate-/l*31.3%

      \[\leadsto \sqrt{2} \cdot \sqrt{\color{blue}{n \cdot \frac{\pi}{k}}} \]
  5. Simplified31.3%

    \[\leadsto \color{blue}{\sqrt{2} \cdot \sqrt{n \cdot \frac{\pi}{k}}} \]
  6. Step-by-step derivation
    1. pow131.3%

      \[\leadsto \color{blue}{{\left(\sqrt{2} \cdot \sqrt{n \cdot \frac{\pi}{k}}\right)}^{1}} \]
    2. sqrt-unprod31.4%

      \[\leadsto {\color{blue}{\left(\sqrt{2 \cdot \left(n \cdot \frac{\pi}{k}\right)}\right)}}^{1} \]
    3. *-commutative31.4%

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

      \[\leadsto {\left(\sqrt{\color{blue}{\left(2 \cdot \frac{\pi}{k}\right) \cdot n}}\right)}^{1} \]
  7. Applied egg-rr31.4%

    \[\leadsto \color{blue}{{\left(\sqrt{\left(2 \cdot \frac{\pi}{k}\right) \cdot n}\right)}^{1}} \]
  8. Step-by-step derivation
    1. unpow131.4%

      \[\leadsto \color{blue}{\sqrt{\left(2 \cdot \frac{\pi}{k}\right) \cdot n}} \]
    2. associate-*l*31.4%

      \[\leadsto \sqrt{\color{blue}{2 \cdot \left(\frac{\pi}{k} \cdot n\right)}} \]
    3. associate-*l/31.4%

      \[\leadsto \sqrt{2 \cdot \color{blue}{\frac{\pi \cdot n}{k}}} \]
    4. associate-/l*31.4%

      \[\leadsto \sqrt{2 \cdot \color{blue}{\left(\pi \cdot \frac{n}{k}\right)}} \]
  9. Simplified31.4%

    \[\leadsto \color{blue}{\sqrt{2 \cdot \left(\pi \cdot \frac{n}{k}\right)}} \]
  10. Step-by-step derivation
    1. associate-*r/31.4%

      \[\leadsto \sqrt{2 \cdot \color{blue}{\frac{\pi \cdot n}{k}}} \]
    2. *-commutative31.4%

      \[\leadsto \sqrt{2 \cdot \frac{\color{blue}{n \cdot \pi}}{k}} \]
    3. associate-/l*31.4%

      \[\leadsto \sqrt{2 \cdot \color{blue}{\left(n \cdot \frac{\pi}{k}\right)}} \]
    4. clear-num31.3%

      \[\leadsto \sqrt{2 \cdot \left(n \cdot \color{blue}{\frac{1}{\frac{k}{\pi}}}\right)} \]
    5. un-div-inv31.4%

      \[\leadsto \sqrt{2 \cdot \color{blue}{\frac{n}{\frac{k}{\pi}}}} \]
  11. Applied egg-rr31.4%

    \[\leadsto \sqrt{2 \cdot \color{blue}{\frac{n}{\frac{k}{\pi}}}} \]
  12. Step-by-step derivation
    1. associate-*r/31.4%

      \[\leadsto \sqrt{\color{blue}{\frac{2 \cdot n}{\frac{k}{\pi}}}} \]
    2. sqrt-div41.9%

      \[\leadsto \color{blue}{\frac{\sqrt{2 \cdot n}}{\sqrt{\frac{k}{\pi}}}} \]
    3. *-commutative41.9%

      \[\leadsto \frac{\sqrt{\color{blue}{n \cdot 2}}}{\sqrt{\frac{k}{\pi}}} \]
  13. Applied egg-rr41.9%

    \[\leadsto \color{blue}{\frac{\sqrt{n \cdot 2}}{\sqrt{\frac{k}{\pi}}}} \]
  14. Final simplification41.9%

    \[\leadsto \frac{\sqrt{2 \cdot n}}{\sqrt{\frac{k}{\pi}}} \]
  15. Add Preprocessing

Alternative 5: 40.1% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \sqrt{2 \cdot \frac{\pi}{k}} \cdot \sqrt{n} \end{array} \]
(FPCore (k n) :precision binary64 (* (sqrt (* 2.0 (/ PI k))) (sqrt n)))
double code(double k, double n) {
	return sqrt((2.0 * (((double) M_PI) / k))) * sqrt(n);
}
public static double code(double k, double n) {
	return Math.sqrt((2.0 * (Math.PI / k))) * Math.sqrt(n);
}
def code(k, n):
	return math.sqrt((2.0 * (math.pi / k))) * math.sqrt(n)
function code(k, n)
	return Float64(sqrt(Float64(2.0 * Float64(pi / k))) * sqrt(n))
end
function tmp = code(k, n)
	tmp = sqrt((2.0 * (pi / k))) * sqrt(n);
end
code[k_, n_] := N[(N[Sqrt[N[(2.0 * N[(Pi / k), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sqrt[n], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\sqrt{2 \cdot \frac{\pi}{k}} \cdot \sqrt{n}
\end{array}
Derivation
  1. Initial program 99.5%

    \[\frac{1}{\sqrt{k}} \cdot {\left(\left(2 \cdot \pi\right) \cdot n\right)}^{\left(\frac{1 - k}{2}\right)} \]
  2. Add Preprocessing
  3. Taylor expanded in k around 0 31.3%

    \[\leadsto \color{blue}{\sqrt{\frac{n \cdot \pi}{k}} \cdot \sqrt{2}} \]
  4. Step-by-step derivation
    1. *-commutative31.3%

      \[\leadsto \color{blue}{\sqrt{2} \cdot \sqrt{\frac{n \cdot \pi}{k}}} \]
    2. associate-/l*31.3%

      \[\leadsto \sqrt{2} \cdot \sqrt{\color{blue}{n \cdot \frac{\pi}{k}}} \]
  5. Simplified31.3%

    \[\leadsto \color{blue}{\sqrt{2} \cdot \sqrt{n \cdot \frac{\pi}{k}}} \]
  6. Step-by-step derivation
    1. pow131.3%

      \[\leadsto \color{blue}{{\left(\sqrt{2} \cdot \sqrt{n \cdot \frac{\pi}{k}}\right)}^{1}} \]
    2. sqrt-unprod31.4%

      \[\leadsto {\color{blue}{\left(\sqrt{2 \cdot \left(n \cdot \frac{\pi}{k}\right)}\right)}}^{1} \]
    3. *-commutative31.4%

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

      \[\leadsto {\left(\sqrt{\color{blue}{\left(2 \cdot \frac{\pi}{k}\right) \cdot n}}\right)}^{1} \]
  7. Applied egg-rr31.4%

    \[\leadsto \color{blue}{{\left(\sqrt{\left(2 \cdot \frac{\pi}{k}\right) \cdot n}\right)}^{1}} \]
  8. Step-by-step derivation
    1. unpow131.4%

      \[\leadsto \color{blue}{\sqrt{\left(2 \cdot \frac{\pi}{k}\right) \cdot n}} \]
    2. associate-*l*31.4%

      \[\leadsto \sqrt{\color{blue}{2 \cdot \left(\frac{\pi}{k} \cdot n\right)}} \]
    3. associate-*l/31.4%

      \[\leadsto \sqrt{2 \cdot \color{blue}{\frac{\pi \cdot n}{k}}} \]
    4. associate-/l*31.4%

      \[\leadsto \sqrt{2 \cdot \color{blue}{\left(\pi \cdot \frac{n}{k}\right)}} \]
  9. Simplified31.4%

    \[\leadsto \color{blue}{\sqrt{2 \cdot \left(\pi \cdot \frac{n}{k}\right)}} \]
  10. Step-by-step derivation
    1. associate-*r/31.4%

      \[\leadsto \sqrt{2 \cdot \color{blue}{\frac{\pi \cdot n}{k}}} \]
    2. *-commutative31.4%

      \[\leadsto \sqrt{2 \cdot \frac{\color{blue}{n \cdot \pi}}{k}} \]
    3. sqrt-prod31.3%

      \[\leadsto \color{blue}{\sqrt{2} \cdot \sqrt{\frac{n \cdot \pi}{k}}} \]
    4. associate-/l*31.3%

      \[\leadsto \sqrt{2} \cdot \sqrt{\color{blue}{n \cdot \frac{\pi}{k}}} \]
    5. sqrt-prod41.8%

      \[\leadsto \sqrt{2} \cdot \color{blue}{\left(\sqrt{n} \cdot \sqrt{\frac{\pi}{k}}\right)} \]
    6. *-commutative41.8%

      \[\leadsto \sqrt{2} \cdot \color{blue}{\left(\sqrt{\frac{\pi}{k}} \cdot \sqrt{n}\right)} \]
    7. associate-*r*41.8%

      \[\leadsto \color{blue}{\left(\sqrt{2} \cdot \sqrt{\frac{\pi}{k}}\right) \cdot \sqrt{n}} \]
    8. sqrt-unprod41.9%

      \[\leadsto \color{blue}{\sqrt{2 \cdot \frac{\pi}{k}}} \cdot \sqrt{n} \]
  11. Applied egg-rr41.9%

    \[\leadsto \color{blue}{\sqrt{2 \cdot \frac{\pi}{k}} \cdot \sqrt{n}} \]
  12. Add Preprocessing

Alternative 6: 31.1% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \sqrt{2 \cdot \left|n \cdot \frac{\pi}{k}\right|} \end{array} \]
(FPCore (k n) :precision binary64 (sqrt (* 2.0 (fabs (* n (/ PI k))))))
double code(double k, double n) {
	return sqrt((2.0 * fabs((n * (((double) M_PI) / k)))));
}
public static double code(double k, double n) {
	return Math.sqrt((2.0 * Math.abs((n * (Math.PI / k)))));
}
def code(k, n):
	return math.sqrt((2.0 * math.fabs((n * (math.pi / k)))))
function code(k, n)
	return sqrt(Float64(2.0 * abs(Float64(n * Float64(pi / k)))))
end
function tmp = code(k, n)
	tmp = sqrt((2.0 * abs((n * (pi / k)))));
end
code[k_, n_] := N[Sqrt[N[(2.0 * N[Abs[N[(n * N[(Pi / k), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}

\\
\sqrt{2 \cdot \left|n \cdot \frac{\pi}{k}\right|}
\end{array}
Derivation
  1. Initial program 99.5%

    \[\frac{1}{\sqrt{k}} \cdot {\left(\left(2 \cdot \pi\right) \cdot n\right)}^{\left(\frac{1 - k}{2}\right)} \]
  2. Add Preprocessing
  3. Taylor expanded in k around 0 31.3%

    \[\leadsto \color{blue}{\sqrt{\frac{n \cdot \pi}{k}} \cdot \sqrt{2}} \]
  4. Step-by-step derivation
    1. *-commutative31.3%

      \[\leadsto \color{blue}{\sqrt{2} \cdot \sqrt{\frac{n \cdot \pi}{k}}} \]
    2. associate-/l*31.3%

      \[\leadsto \sqrt{2} \cdot \sqrt{\color{blue}{n \cdot \frac{\pi}{k}}} \]
  5. Simplified31.3%

    \[\leadsto \color{blue}{\sqrt{2} \cdot \sqrt{n \cdot \frac{\pi}{k}}} \]
  6. Step-by-step derivation
    1. pow131.3%

      \[\leadsto \color{blue}{{\left(\sqrt{2} \cdot \sqrt{n \cdot \frac{\pi}{k}}\right)}^{1}} \]
    2. sqrt-unprod31.4%

      \[\leadsto {\color{blue}{\left(\sqrt{2 \cdot \left(n \cdot \frac{\pi}{k}\right)}\right)}}^{1} \]
    3. *-commutative31.4%

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

      \[\leadsto {\left(\sqrt{\color{blue}{\left(2 \cdot \frac{\pi}{k}\right) \cdot n}}\right)}^{1} \]
  7. Applied egg-rr31.4%

    \[\leadsto \color{blue}{{\left(\sqrt{\left(2 \cdot \frac{\pi}{k}\right) \cdot n}\right)}^{1}} \]
  8. Step-by-step derivation
    1. unpow131.4%

      \[\leadsto \color{blue}{\sqrt{\left(2 \cdot \frac{\pi}{k}\right) \cdot n}} \]
    2. associate-*l*31.4%

      \[\leadsto \sqrt{\color{blue}{2 \cdot \left(\frac{\pi}{k} \cdot n\right)}} \]
    3. associate-*l/31.4%

      \[\leadsto \sqrt{2 \cdot \color{blue}{\frac{\pi \cdot n}{k}}} \]
    4. associate-/l*31.4%

      \[\leadsto \sqrt{2 \cdot \color{blue}{\left(\pi \cdot \frac{n}{k}\right)}} \]
  9. Simplified31.4%

    \[\leadsto \color{blue}{\sqrt{2 \cdot \left(\pi \cdot \frac{n}{k}\right)}} \]
  10. Step-by-step derivation
    1. associate-*r/31.4%

      \[\leadsto \sqrt{2 \cdot \color{blue}{\frac{\pi \cdot n}{k}}} \]
    2. *-commutative31.4%

      \[\leadsto \sqrt{2 \cdot \frac{\color{blue}{n \cdot \pi}}{k}} \]
    3. add-sqr-sqrt31.3%

      \[\leadsto \sqrt{2 \cdot \color{blue}{\left(\sqrt{\frac{n \cdot \pi}{k}} \cdot \sqrt{\frac{n \cdot \pi}{k}}\right)}} \]
    4. pow1/231.3%

      \[\leadsto \sqrt{2 \cdot \left(\color{blue}{{\left(\frac{n \cdot \pi}{k}\right)}^{0.5}} \cdot \sqrt{\frac{n \cdot \pi}{k}}\right)} \]
    5. pow1/231.3%

      \[\leadsto \sqrt{2 \cdot \left({\left(\frac{n \cdot \pi}{k}\right)}^{0.5} \cdot \color{blue}{{\left(\frac{n \cdot \pi}{k}\right)}^{0.5}}\right)} \]
    6. pow-prod-down27.3%

      \[\leadsto \sqrt{2 \cdot \color{blue}{{\left(\frac{n \cdot \pi}{k} \cdot \frac{n \cdot \pi}{k}\right)}^{0.5}}} \]
    7. pow227.3%

      \[\leadsto \sqrt{2 \cdot {\color{blue}{\left({\left(\frac{n \cdot \pi}{k}\right)}^{2}\right)}}^{0.5}} \]
    8. associate-/l*27.3%

      \[\leadsto \sqrt{2 \cdot {\left({\color{blue}{\left(n \cdot \frac{\pi}{k}\right)}}^{2}\right)}^{0.5}} \]
  11. Applied egg-rr27.3%

    \[\leadsto \sqrt{2 \cdot \color{blue}{{\left({\left(n \cdot \frac{\pi}{k}\right)}^{2}\right)}^{0.5}}} \]
  12. Step-by-step derivation
    1. unpow1/227.3%

      \[\leadsto \sqrt{2 \cdot \color{blue}{\sqrt{{\left(n \cdot \frac{\pi}{k}\right)}^{2}}}} \]
    2. unpow227.3%

      \[\leadsto \sqrt{2 \cdot \sqrt{\color{blue}{\left(n \cdot \frac{\pi}{k}\right) \cdot \left(n \cdot \frac{\pi}{k}\right)}}} \]
    3. rem-sqrt-square31.9%

      \[\leadsto \sqrt{2 \cdot \color{blue}{\left|n \cdot \frac{\pi}{k}\right|}} \]
  13. Simplified31.9%

    \[\leadsto \sqrt{2 \cdot \color{blue}{\left|n \cdot \frac{\pi}{k}\right|}} \]
  14. Add Preprocessing

Alternative 7: 31.1% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \sqrt{\left|n \cdot \left(\pi \cdot \frac{2}{k}\right)\right|} \end{array} \]
(FPCore (k n) :precision binary64 (sqrt (fabs (* n (* PI (/ 2.0 k))))))
double code(double k, double n) {
	return sqrt(fabs((n * (((double) M_PI) * (2.0 / k)))));
}
public static double code(double k, double n) {
	return Math.sqrt(Math.abs((n * (Math.PI * (2.0 / k)))));
}
def code(k, n):
	return math.sqrt(math.fabs((n * (math.pi * (2.0 / k)))))
function code(k, n)
	return sqrt(abs(Float64(n * Float64(pi * Float64(2.0 / k)))))
end
function tmp = code(k, n)
	tmp = sqrt(abs((n * (pi * (2.0 / k)))));
end
code[k_, n_] := N[Sqrt[N[Abs[N[(n * N[(Pi * N[(2.0 / k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]
\begin{array}{l}

\\
\sqrt{\left|n \cdot \left(\pi \cdot \frac{2}{k}\right)\right|}
\end{array}
Derivation
  1. Initial program 99.5%

    \[\frac{1}{\sqrt{k}} \cdot {\left(\left(2 \cdot \pi\right) \cdot n\right)}^{\left(\frac{1 - k}{2}\right)} \]
  2. Add Preprocessing
  3. Taylor expanded in k around 0 31.3%

    \[\leadsto \color{blue}{\sqrt{\frac{n \cdot \pi}{k}} \cdot \sqrt{2}} \]
  4. Step-by-step derivation
    1. *-commutative31.3%

      \[\leadsto \color{blue}{\sqrt{2} \cdot \sqrt{\frac{n \cdot \pi}{k}}} \]
    2. associate-/l*31.3%

      \[\leadsto \sqrt{2} \cdot \sqrt{\color{blue}{n \cdot \frac{\pi}{k}}} \]
  5. Simplified31.3%

    \[\leadsto \color{blue}{\sqrt{2} \cdot \sqrt{n \cdot \frac{\pi}{k}}} \]
  6. Step-by-step derivation
    1. pow131.3%

      \[\leadsto \color{blue}{{\left(\sqrt{2} \cdot \sqrt{n \cdot \frac{\pi}{k}}\right)}^{1}} \]
    2. sqrt-unprod31.4%

      \[\leadsto {\color{blue}{\left(\sqrt{2 \cdot \left(n \cdot \frac{\pi}{k}\right)}\right)}}^{1} \]
    3. *-commutative31.4%

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

      \[\leadsto {\left(\sqrt{\color{blue}{\left(2 \cdot \frac{\pi}{k}\right) \cdot n}}\right)}^{1} \]
  7. Applied egg-rr31.4%

    \[\leadsto \color{blue}{{\left(\sqrt{\left(2 \cdot \frac{\pi}{k}\right) \cdot n}\right)}^{1}} \]
  8. Step-by-step derivation
    1. unpow131.4%

      \[\leadsto \color{blue}{\sqrt{\left(2 \cdot \frac{\pi}{k}\right) \cdot n}} \]
    2. associate-*l*31.4%

      \[\leadsto \sqrt{\color{blue}{2 \cdot \left(\frac{\pi}{k} \cdot n\right)}} \]
    3. associate-*l/31.4%

      \[\leadsto \sqrt{2 \cdot \color{blue}{\frac{\pi \cdot n}{k}}} \]
    4. associate-/l*31.4%

      \[\leadsto \sqrt{2 \cdot \color{blue}{\left(\pi \cdot \frac{n}{k}\right)}} \]
  9. Simplified31.4%

    \[\leadsto \color{blue}{\sqrt{2 \cdot \left(\pi \cdot \frac{n}{k}\right)}} \]
  10. Step-by-step derivation
    1. add-sqr-sqrt31.4%

      \[\leadsto \sqrt{\color{blue}{\sqrt{2 \cdot \left(\pi \cdot \frac{n}{k}\right)} \cdot \sqrt{2 \cdot \left(\pi \cdot \frac{n}{k}\right)}}} \]
    2. pow1/231.4%

      \[\leadsto \sqrt{\color{blue}{{\left(2 \cdot \left(\pi \cdot \frac{n}{k}\right)\right)}^{0.5}} \cdot \sqrt{2 \cdot \left(\pi \cdot \frac{n}{k}\right)}} \]
    3. pow1/231.4%

      \[\leadsto \sqrt{{\left(2 \cdot \left(\pi \cdot \frac{n}{k}\right)\right)}^{0.5} \cdot \color{blue}{{\left(2 \cdot \left(\pi \cdot \frac{n}{k}\right)\right)}^{0.5}}} \]
    4. pow-prod-down27.3%

      \[\leadsto \sqrt{\color{blue}{{\left(\left(2 \cdot \left(\pi \cdot \frac{n}{k}\right)\right) \cdot \left(2 \cdot \left(\pi \cdot \frac{n}{k}\right)\right)\right)}^{0.5}}} \]
    5. pow227.3%

      \[\leadsto \sqrt{{\color{blue}{\left({\left(2 \cdot \left(\pi \cdot \frac{n}{k}\right)\right)}^{2}\right)}}^{0.5}} \]
    6. associate-*r/27.3%

      \[\leadsto \sqrt{{\left({\left(2 \cdot \color{blue}{\frac{\pi \cdot n}{k}}\right)}^{2}\right)}^{0.5}} \]
    7. *-commutative27.3%

      \[\leadsto \sqrt{{\left({\left(2 \cdot \frac{\color{blue}{n \cdot \pi}}{k}\right)}^{2}\right)}^{0.5}} \]
    8. associate-/l*27.3%

      \[\leadsto \sqrt{{\left({\left(2 \cdot \color{blue}{\left(n \cdot \frac{\pi}{k}\right)}\right)}^{2}\right)}^{0.5}} \]
  11. Applied egg-rr27.3%

    \[\leadsto \sqrt{\color{blue}{{\left({\left(2 \cdot \left(n \cdot \frac{\pi}{k}\right)\right)}^{2}\right)}^{0.5}}} \]
  12. Step-by-step derivation
    1. unpow1/227.3%

      \[\leadsto \sqrt{\color{blue}{\sqrt{{\left(2 \cdot \left(n \cdot \frac{\pi}{k}\right)\right)}^{2}}}} \]
    2. unpow227.3%

      \[\leadsto \sqrt{\sqrt{\color{blue}{\left(2 \cdot \left(n \cdot \frac{\pi}{k}\right)\right) \cdot \left(2 \cdot \left(n \cdot \frac{\pi}{k}\right)\right)}}} \]
    3. rem-sqrt-square31.9%

      \[\leadsto \sqrt{\color{blue}{\left|2 \cdot \left(n \cdot \frac{\pi}{k}\right)\right|}} \]
    4. *-commutative31.9%

      \[\leadsto \sqrt{\left|\color{blue}{\left(n \cdot \frac{\pi}{k}\right) \cdot 2}\right|} \]
    5. associate-*l*31.9%

      \[\leadsto \sqrt{\left|\color{blue}{n \cdot \left(\frac{\pi}{k} \cdot 2\right)}\right|} \]
    6. associate-*l/31.9%

      \[\leadsto \sqrt{\left|n \cdot \color{blue}{\frac{\pi \cdot 2}{k}}\right|} \]
    7. associate-/l*31.8%

      \[\leadsto \sqrt{\left|n \cdot \color{blue}{\left(\pi \cdot \frac{2}{k}\right)}\right|} \]
  13. Simplified31.8%

    \[\leadsto \sqrt{\color{blue}{\left|n \cdot \left(\pi \cdot \frac{2}{k}\right)\right|}} \]
  14. Add Preprocessing

Alternative 8: 31.0% accurate, 2.0× speedup?

\[\begin{array}{l} \\ \frac{1}{\sqrt{\frac{\frac{k}{\pi}}{2 \cdot n}}} \end{array} \]
(FPCore (k n) :precision binary64 (/ 1.0 (sqrt (/ (/ k PI) (* 2.0 n)))))
double code(double k, double n) {
	return 1.0 / sqrt(((k / ((double) M_PI)) / (2.0 * n)));
}
public static double code(double k, double n) {
	return 1.0 / Math.sqrt(((k / Math.PI) / (2.0 * n)));
}
def code(k, n):
	return 1.0 / math.sqrt(((k / math.pi) / (2.0 * n)))
function code(k, n)
	return Float64(1.0 / sqrt(Float64(Float64(k / pi) / Float64(2.0 * n))))
end
function tmp = code(k, n)
	tmp = 1.0 / sqrt(((k / pi) / (2.0 * n)));
end
code[k_, n_] := N[(1.0 / N[Sqrt[N[(N[(k / Pi), $MachinePrecision] / N[(2.0 * n), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\frac{1}{\sqrt{\frac{\frac{k}{\pi}}{2 \cdot n}}}
\end{array}
Derivation
  1. Initial program 99.5%

    \[\frac{1}{\sqrt{k}} \cdot {\left(\left(2 \cdot \pi\right) \cdot n\right)}^{\left(\frac{1 - k}{2}\right)} \]
  2. Add Preprocessing
  3. Taylor expanded in k around 0 31.3%

    \[\leadsto \color{blue}{\sqrt{\frac{n \cdot \pi}{k}} \cdot \sqrt{2}} \]
  4. Step-by-step derivation
    1. *-commutative31.3%

      \[\leadsto \color{blue}{\sqrt{2} \cdot \sqrt{\frac{n \cdot \pi}{k}}} \]
    2. associate-/l*31.3%

      \[\leadsto \sqrt{2} \cdot \sqrt{\color{blue}{n \cdot \frac{\pi}{k}}} \]
  5. Simplified31.3%

    \[\leadsto \color{blue}{\sqrt{2} \cdot \sqrt{n \cdot \frac{\pi}{k}}} \]
  6. Step-by-step derivation
    1. pow131.3%

      \[\leadsto \color{blue}{{\left(\sqrt{2} \cdot \sqrt{n \cdot \frac{\pi}{k}}\right)}^{1}} \]
    2. sqrt-unprod31.4%

      \[\leadsto {\color{blue}{\left(\sqrt{2 \cdot \left(n \cdot \frac{\pi}{k}\right)}\right)}}^{1} \]
    3. *-commutative31.4%

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

      \[\leadsto {\left(\sqrt{\color{blue}{\left(2 \cdot \frac{\pi}{k}\right) \cdot n}}\right)}^{1} \]
  7. Applied egg-rr31.4%

    \[\leadsto \color{blue}{{\left(\sqrt{\left(2 \cdot \frac{\pi}{k}\right) \cdot n}\right)}^{1}} \]
  8. Step-by-step derivation
    1. unpow131.4%

      \[\leadsto \color{blue}{\sqrt{\left(2 \cdot \frac{\pi}{k}\right) \cdot n}} \]
    2. associate-*l*31.4%

      \[\leadsto \sqrt{\color{blue}{2 \cdot \left(\frac{\pi}{k} \cdot n\right)}} \]
    3. associate-*l/31.4%

      \[\leadsto \sqrt{2 \cdot \color{blue}{\frac{\pi \cdot n}{k}}} \]
    4. associate-/l*31.4%

      \[\leadsto \sqrt{2 \cdot \color{blue}{\left(\pi \cdot \frac{n}{k}\right)}} \]
  9. Simplified31.4%

    \[\leadsto \color{blue}{\sqrt{2 \cdot \left(\pi \cdot \frac{n}{k}\right)}} \]
  10. Step-by-step derivation
    1. associate-*r/31.4%

      \[\leadsto \sqrt{2 \cdot \color{blue}{\frac{\pi \cdot n}{k}}} \]
    2. *-commutative31.4%

      \[\leadsto \sqrt{2 \cdot \frac{\color{blue}{n \cdot \pi}}{k}} \]
    3. associate-/l*31.4%

      \[\leadsto \sqrt{2 \cdot \color{blue}{\left(n \cdot \frac{\pi}{k}\right)}} \]
    4. clear-num31.3%

      \[\leadsto \sqrt{2 \cdot \left(n \cdot \color{blue}{\frac{1}{\frac{k}{\pi}}}\right)} \]
    5. un-div-inv31.4%

      \[\leadsto \sqrt{2 \cdot \color{blue}{\frac{n}{\frac{k}{\pi}}}} \]
  11. Applied egg-rr31.4%

    \[\leadsto \sqrt{2 \cdot \color{blue}{\frac{n}{\frac{k}{\pi}}}} \]
  12. Step-by-step derivation
    1. sqrt-prod31.3%

      \[\leadsto \color{blue}{\sqrt{2} \cdot \sqrt{\frac{n}{\frac{k}{\pi}}}} \]
    2. associate-/r/31.3%

      \[\leadsto \sqrt{2} \cdot \sqrt{\color{blue}{\frac{n}{k} \cdot \pi}} \]
    3. clear-num31.3%

      \[\leadsto \sqrt{2} \cdot \sqrt{\color{blue}{\frac{1}{\frac{k}{n}}} \cdot \pi} \]
    4. associate-*l/31.3%

      \[\leadsto \sqrt{2} \cdot \sqrt{\color{blue}{\frac{1 \cdot \pi}{\frac{k}{n}}}} \]
    5. *-un-lft-identity31.3%

      \[\leadsto \sqrt{2} \cdot \sqrt{\frac{\color{blue}{\pi}}{\frac{k}{n}}} \]
    6. sqrt-prod31.3%

      \[\leadsto \color{blue}{\sqrt{2 \cdot \frac{\pi}{\frac{k}{n}}}} \]
    7. associate-/l*31.3%

      \[\leadsto \sqrt{\color{blue}{\frac{2 \cdot \pi}{\frac{k}{n}}}} \]
    8. clear-num31.3%

      \[\leadsto \sqrt{\color{blue}{\frac{1}{\frac{\frac{k}{n}}{2 \cdot \pi}}}} \]
    9. sqrt-div31.5%

      \[\leadsto \color{blue}{\frac{\sqrt{1}}{\sqrt{\frac{\frac{k}{n}}{2 \cdot \pi}}}} \]
    10. metadata-eval31.5%

      \[\leadsto \frac{\color{blue}{1}}{\sqrt{\frac{\frac{k}{n}}{2 \cdot \pi}}} \]
    11. *-commutative31.5%

      \[\leadsto \frac{1}{\sqrt{\frac{\frac{k}{n}}{\color{blue}{\pi \cdot 2}}}} \]
    12. associate-/l/31.5%

      \[\leadsto \frac{1}{\sqrt{\color{blue}{\frac{k}{\left(\pi \cdot 2\right) \cdot n}}}} \]
    13. *-commutative31.5%

      \[\leadsto \frac{1}{\sqrt{\frac{k}{\color{blue}{n \cdot \left(\pi \cdot 2\right)}}}} \]
  13. Applied egg-rr31.5%

    \[\leadsto \color{blue}{\frac{1}{\sqrt{\frac{k}{n \cdot \left(\pi \cdot 2\right)}}}} \]
  14. Step-by-step derivation
    1. associate-*r*31.5%

      \[\leadsto \frac{1}{\sqrt{\frac{k}{\color{blue}{\left(n \cdot \pi\right) \cdot 2}}}} \]
    2. associate-/r*31.5%

      \[\leadsto \frac{1}{\sqrt{\color{blue}{\frac{\frac{k}{n \cdot \pi}}{2}}}} \]
    3. associate-/l/31.5%

      \[\leadsto \frac{1}{\sqrt{\frac{\color{blue}{\frac{\frac{k}{\pi}}{n}}}{2}}} \]
    4. associate-/l/31.5%

      \[\leadsto \frac{1}{\sqrt{\color{blue}{\frac{\frac{k}{\pi}}{2 \cdot n}}}} \]
  15. Simplified31.5%

    \[\leadsto \color{blue}{\frac{1}{\sqrt{\frac{\frac{k}{\pi}}{2 \cdot n}}}} \]
  16. Add Preprocessing

Alternative 9: 30.5% accurate, 2.0× speedup?

\[\begin{array}{l} \\ \sqrt{2 \cdot \left(\pi \cdot \frac{n}{k}\right)} \end{array} \]
(FPCore (k n) :precision binary64 (sqrt (* 2.0 (* PI (/ n k)))))
double code(double k, double n) {
	return sqrt((2.0 * (((double) M_PI) * (n / k))));
}
public static double code(double k, double n) {
	return Math.sqrt((2.0 * (Math.PI * (n / k))));
}
def code(k, n):
	return math.sqrt((2.0 * (math.pi * (n / k))))
function code(k, n)
	return sqrt(Float64(2.0 * Float64(pi * Float64(n / k))))
end
function tmp = code(k, n)
	tmp = sqrt((2.0 * (pi * (n / k))));
end
code[k_, n_] := N[Sqrt[N[(2.0 * N[(Pi * N[(n / k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}

\\
\sqrt{2 \cdot \left(\pi \cdot \frac{n}{k}\right)}
\end{array}
Derivation
  1. Initial program 99.5%

    \[\frac{1}{\sqrt{k}} \cdot {\left(\left(2 \cdot \pi\right) \cdot n\right)}^{\left(\frac{1 - k}{2}\right)} \]
  2. Add Preprocessing
  3. Taylor expanded in k around 0 31.3%

    \[\leadsto \color{blue}{\sqrt{\frac{n \cdot \pi}{k}} \cdot \sqrt{2}} \]
  4. Step-by-step derivation
    1. *-commutative31.3%

      \[\leadsto \color{blue}{\sqrt{2} \cdot \sqrt{\frac{n \cdot \pi}{k}}} \]
    2. associate-/l*31.3%

      \[\leadsto \sqrt{2} \cdot \sqrt{\color{blue}{n \cdot \frac{\pi}{k}}} \]
  5. Simplified31.3%

    \[\leadsto \color{blue}{\sqrt{2} \cdot \sqrt{n \cdot \frac{\pi}{k}}} \]
  6. Step-by-step derivation
    1. pow131.3%

      \[\leadsto \color{blue}{{\left(\sqrt{2} \cdot \sqrt{n \cdot \frac{\pi}{k}}\right)}^{1}} \]
    2. sqrt-unprod31.4%

      \[\leadsto {\color{blue}{\left(\sqrt{2 \cdot \left(n \cdot \frac{\pi}{k}\right)}\right)}}^{1} \]
    3. *-commutative31.4%

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

      \[\leadsto {\left(\sqrt{\color{blue}{\left(2 \cdot \frac{\pi}{k}\right) \cdot n}}\right)}^{1} \]
  7. Applied egg-rr31.4%

    \[\leadsto \color{blue}{{\left(\sqrt{\left(2 \cdot \frac{\pi}{k}\right) \cdot n}\right)}^{1}} \]
  8. Step-by-step derivation
    1. unpow131.4%

      \[\leadsto \color{blue}{\sqrt{\left(2 \cdot \frac{\pi}{k}\right) \cdot n}} \]
    2. associate-*l*31.4%

      \[\leadsto \sqrt{\color{blue}{2 \cdot \left(\frac{\pi}{k} \cdot n\right)}} \]
    3. associate-*l/31.4%

      \[\leadsto \sqrt{2 \cdot \color{blue}{\frac{\pi \cdot n}{k}}} \]
    4. associate-/l*31.4%

      \[\leadsto \sqrt{2 \cdot \color{blue}{\left(\pi \cdot \frac{n}{k}\right)}} \]
  9. Simplified31.4%

    \[\leadsto \color{blue}{\sqrt{2 \cdot \left(\pi \cdot \frac{n}{k}\right)}} \]
  10. Add Preprocessing

Reproduce

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