Migdal et al, Equation (51)

Percentage Accurate: 99.4% → 99.0%
Time: 17.2s
Alternatives: 14
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 14 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.4% 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: 99.0% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;k \leq 7.1 \cdot 10^{-51}:\\
\;\;\;\;\frac{1}{\sqrt{\frac{k}{\pi}} \cdot \sqrt{\frac{0.5}{n}}}\\

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


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

    1. Initial program 98.6%

      \[\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. unpow-prod-down99.0%

        \[\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)} \]
      2. unpow-prod-down98.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{\sqrt{\left(2 \cdot n\right) \cdot \pi}}{\color{blue}{1} \cdot \sqrt{k}} \]
    7. Step-by-step derivation
      1. *-un-lft-identity98.6%

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

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

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

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

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

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

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

        \[\leadsto \frac{1}{\sqrt{\color{blue}{\frac{\frac{k}{\pi}}{2 \cdot n}}}} \]
    10. Simplified75.3%

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

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

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

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

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

        \[\leadsto \frac{1}{\sqrt{\frac{k}{\pi}} \cdot \sqrt{\frac{\color{blue}{0.5}}{n}}} \]
    14. Simplified99.3%

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

    if 7.1e-51 < 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. Step-by-step derivation
      1. unpow-prod-down60.5%

        \[\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)} \]
      2. unpow-prod-down99.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \sqrt{\left(2 \cdot n\right) \cdot \pi} \cdot \frac{1}{\color{blue}{e^{\log \left({\left(\left(2 \cdot n\right) \cdot \pi\right)}^{\left(0.5 \cdot k\right)} \cdot \sqrt{k}\right)}}} \]
      3. rec-exp99.2%

        \[\leadsto \sqrt{\left(2 \cdot n\right) \cdot \pi} \cdot \color{blue}{e^{-\log \left({\left(\left(2 \cdot n\right) \cdot \pi\right)}^{\left(0.5 \cdot k\right)} \cdot \sqrt{k}\right)}} \]
      4. log-prod99.2%

        \[\leadsto \sqrt{\left(2 \cdot n\right) \cdot \pi} \cdot e^{-\color{blue}{\left(\log \left({\left(\left(2 \cdot n\right) \cdot \pi\right)}^{\left(0.5 \cdot k\right)}\right) + \log \left(\sqrt{k}\right)\right)}} \]
      5. pow1/299.2%

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

        \[\leadsto \sqrt{\left(2 \cdot n\right) \cdot \pi} \cdot e^{-\left(\log \left({\left(\left(2 \cdot n\right) \cdot \pi\right)}^{\left(0.5 \cdot k\right)}\right) + \log \left({k}^{\color{blue}{\left(--0.5\right)}}\right)\right)} \]
      7. pow-flip99.2%

        \[\leadsto \sqrt{\left(2 \cdot n\right) \cdot \pi} \cdot e^{-\left(\log \left({\left(\left(2 \cdot n\right) \cdot \pi\right)}^{\left(0.5 \cdot k\right)}\right) + \log \color{blue}{\left(\frac{1}{{k}^{-0.5}}\right)}\right)} \]
      8. log-prod99.2%

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

        \[\leadsto \sqrt{\left(2 \cdot n\right) \cdot \pi} \cdot e^{-\log \color{blue}{\left(\frac{{\left(\left(2 \cdot n\right) \cdot \pi\right)}^{\left(0.5 \cdot k\right)}}{{k}^{-0.5}}\right)}} \]
      10. rec-exp99.2%

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

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

        \[\leadsto {\left(\sqrt{\pi \cdot \left(2 \cdot n\right)}\right)}^{\left(1 - k\right)} \cdot {k}^{\color{blue}{\left(-0.25 \cdot 2\right)}} \]
      2. pow-pow99.6%

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;k \leq 7.1 \cdot 10^{-51}:\\ \;\;\;\;\frac{1}{\sqrt{\frac{k}{\pi}} \cdot \sqrt{\frac{0.5}{n}}}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\frac{1}{k} \cdot {\left(\left(2 \cdot n\right) \cdot \pi\right)}^{\left(1 - k\right)}}\\ \end{array} \]

Alternative 2: 99.4% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
t_0 := \left(2 \cdot n\right) \cdot \pi\\
\frac{\sqrt{t_0}}{{t_0}^{\left(0.5 \cdot k\right)} \cdot \sqrt{k}}
\end{array}
\end{array}
Derivation
  1. Initial program 99.2%

    \[\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. unpow-prod-down77.0%

      \[\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)} \]
    2. unpow-prod-down99.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 99.4% accurate, 0.8× speedup?

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

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

    \[\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. unpow-prod-down77.0%

      \[\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)} \]
    2. unpow-prod-down99.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \color{blue}{\frac{\sqrt{\left(2 \cdot n\right) \cdot \pi}}{{\left(\left(2 \cdot n\right) \cdot \pi\right)}^{\left(0.5 \cdot k\right)} \cdot \sqrt{k}}} \]
  6. Step-by-step derivation
    1. div-inv99.3%

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

      \[\leadsto \sqrt{\left(2 \cdot n\right) \cdot \pi} \cdot \frac{1}{\color{blue}{e^{\log \left({\left(\left(2 \cdot n\right) \cdot \pi\right)}^{\left(0.5 \cdot k\right)} \cdot \sqrt{k}\right)}}} \]
    3. rec-exp95.7%

      \[\leadsto \sqrt{\left(2 \cdot n\right) \cdot \pi} \cdot \color{blue}{e^{-\log \left({\left(\left(2 \cdot n\right) \cdot \pi\right)}^{\left(0.5 \cdot k\right)} \cdot \sqrt{k}\right)}} \]
    4. log-prod95.7%

      \[\leadsto \sqrt{\left(2 \cdot n\right) \cdot \pi} \cdot e^{-\color{blue}{\left(\log \left({\left(\left(2 \cdot n\right) \cdot \pi\right)}^{\left(0.5 \cdot k\right)}\right) + \log \left(\sqrt{k}\right)\right)}} \]
    5. pow1/295.7%

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

      \[\leadsto \sqrt{\left(2 \cdot n\right) \cdot \pi} \cdot e^{-\left(\log \left({\left(\left(2 \cdot n\right) \cdot \pi\right)}^{\left(0.5 \cdot k\right)}\right) + \log \left({k}^{\color{blue}{\left(--0.5\right)}}\right)\right)} \]
    7. pow-flip95.7%

      \[\leadsto \sqrt{\left(2 \cdot n\right) \cdot \pi} \cdot e^{-\left(\log \left({\left(\left(2 \cdot n\right) \cdot \pi\right)}^{\left(0.5 \cdot k\right)}\right) + \log \color{blue}{\left(\frac{1}{{k}^{-0.5}}\right)}\right)} \]
    8. log-prod95.7%

      \[\leadsto \sqrt{\left(2 \cdot n\right) \cdot \pi} \cdot e^{-\color{blue}{\log \left({\left(\left(2 \cdot n\right) \cdot \pi\right)}^{\left(0.5 \cdot k\right)} \cdot \frac{1}{{k}^{-0.5}}\right)}} \]
    9. div-inv95.7%

      \[\leadsto \sqrt{\left(2 \cdot n\right) \cdot \pi} \cdot e^{-\log \color{blue}{\left(\frac{{\left(\left(2 \cdot n\right) \cdot \pi\right)}^{\left(0.5 \cdot k\right)}}{{k}^{-0.5}}\right)}} \]
    10. rec-exp95.7%

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

    \[\leadsto \color{blue}{{\left(\sqrt{\pi \cdot \left(2 \cdot n\right)}\right)}^{\left(1 - k\right)} \cdot {k}^{-0.5}} \]
  8. Final simplification99.2%

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

Alternative 4: 99.5% accurate, 1.0× speedup?

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

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

    \[\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. expm1-log1p-u95.7%

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

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

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

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

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

    \[\leadsto \color{blue}{\left(e^{\mathsf{log1p}\left({k}^{-0.5}\right)} - 1\right)} \cdot {\left(\left(2 \cdot \pi\right) \cdot n\right)}^{\left(\frac{1 - k}{2}\right)} \]
  4. Step-by-step derivation
    1. expm1-def95.7%

      \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left({k}^{-0.5}\right)\right)} \cdot {\left(\left(2 \cdot \pi\right) \cdot n\right)}^{\left(\frac{1 - k}{2}\right)} \]
    2. expm1-log1p99.2%

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

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

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

Alternative 5: 99.0% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;k \leq 6 \cdot 10^{-51}:\\
\;\;\;\;\frac{1}{\sqrt{\frac{k}{\pi}} \cdot \sqrt{\frac{0.5}{n}}}\\

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


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

    1. Initial program 98.6%

      \[\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. unpow-prod-down99.0%

        \[\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)} \]
      2. unpow-prod-down98.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{\sqrt{\left(2 \cdot n\right) \cdot \pi}}{\color{blue}{1} \cdot \sqrt{k}} \]
    7. Step-by-step derivation
      1. *-un-lft-identity98.6%

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

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

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

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

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

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

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

        \[\leadsto \frac{1}{\sqrt{\color{blue}{\frac{\frac{k}{\pi}}{2 \cdot n}}}} \]
    10. Simplified75.3%

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

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

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

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

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

        \[\leadsto \frac{1}{\sqrt{\frac{k}{\pi}} \cdot \sqrt{\frac{\color{blue}{0.5}}{n}}} \]
    14. Simplified99.3%

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

    if 6.00000000000000005e-51 < 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. Step-by-step derivation
      1. *-commutative99.6%

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

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

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

        \[\leadsto \color{blue}{\frac{{\left(\left(2 \cdot \pi\right) \cdot n\right)}^{\left(0.5 - \frac{k}{2}\right)}}{\sqrt{k}}} \]
      5. expm1-log1p-u99.0%

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

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

      \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\sqrt{\frac{{\left(2 \cdot \left(\pi \cdot n\right)\right)}^{\left(1 - k\right)}}{k}}\right)} - 1} \]
    4. Step-by-step derivation
      1. expm1-def99.0%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;k \leq 6 \cdot 10^{-51}:\\ \;\;\;\;\frac{1}{\sqrt{\frac{k}{\pi}} \cdot \sqrt{\frac{0.5}{n}}}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\frac{{\left(\left(2 \cdot n\right) \cdot \pi\right)}^{\left(1 - k\right)}}{k}}\\ \end{array} \]

Alternative 6: 99.4% accurate, 1.0× speedup?

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

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

    \[\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.2%

      \[\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.2%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 49.8% accurate, 1.0× speedup?

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

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

    \[\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. unpow-prod-down77.0%

      \[\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)} \]
    2. unpow-prod-down99.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \frac{\sqrt{\left(2 \cdot n\right) \cdot \pi}}{\color{blue}{1} \cdot \sqrt{k}} \]
  7. Step-by-step derivation
    1. *-un-lft-identity53.2%

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

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

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

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

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

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

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

      \[\leadsto \frac{1}{\sqrt{\color{blue}{\frac{\frac{k}{\pi}}{2 \cdot n}}}} \]
  10. Simplified43.1%

    \[\leadsto \color{blue}{\frac{1}{\sqrt{\frac{\frac{k}{\pi}}{2 \cdot n}}}} \]
  11. Step-by-step derivation
    1. div-inv43.1%

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

      \[\leadsto \frac{1}{\color{blue}{\sqrt{\frac{k}{\pi}} \cdot \sqrt{\frac{1}{2 \cdot n}}}} \]
  12. Applied egg-rr53.1%

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

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

      \[\leadsto \frac{1}{\sqrt{\frac{k}{\pi}} \cdot \sqrt{\frac{\color{blue}{0.5}}{n}}} \]
  14. Simplified53.5%

    \[\leadsto \frac{1}{\color{blue}{\sqrt{\frac{k}{\pi}} \cdot \sqrt{\frac{0.5}{n}}}} \]
  15. Final simplification53.5%

    \[\leadsto \frac{1}{\sqrt{\frac{k}{\pi}} \cdot \sqrt{\frac{0.5}{n}}} \]

Alternative 8: 49.8% accurate, 1.0× speedup?

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

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

    \[\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. unpow-prod-down77.0%

      \[\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)} \]
    2. unpow-prod-down99.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 9: 49.8% accurate, 1.0× speedup?

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

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

    \[\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. unpow-prod-down77.0%

      \[\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)} \]
    2. unpow-prod-down99.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \frac{\sqrt{\left(2 \cdot n\right) \cdot \pi}}{\color{blue}{1} \cdot \sqrt{k}} \]
  7. Step-by-step derivation
    1. *-un-lft-identity53.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \color{blue}{\sqrt{\frac{2}{k}} \cdot \sqrt{\pi \cdot n}} \]
  13. Final simplification53.2%

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

Alternative 10: 49.7% accurate, 1.0× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 11: 38.8% accurate, 1.5× speedup?

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

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

    \[\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. unpow-prod-down77.0%

      \[\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)} \]
    2. unpow-prod-down99.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \frac{\sqrt{\left(2 \cdot n\right) \cdot \pi}}{\color{blue}{1} \cdot \sqrt{k}} \]
  7. Step-by-step derivation
    1. *-un-lft-identity53.2%

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

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

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

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

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

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

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

      \[\leadsto \frac{1}{\sqrt{\color{blue}{\frac{\frac{k}{\pi}}{2 \cdot n}}}} \]
  10. Simplified43.1%

    \[\leadsto \color{blue}{\frac{1}{\sqrt{\frac{\frac{k}{\pi}}{2 \cdot n}}}} \]
  11. Step-by-step derivation
    1. pow1/243.1%

      \[\leadsto \frac{1}{\color{blue}{{\left(\frac{\frac{k}{\pi}}{2 \cdot n}\right)}^{0.5}}} \]
    2. pow-flip43.2%

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

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

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

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

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

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

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

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

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

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

      \[\leadsto {\left(\frac{k}{\pi} \cdot \frac{\color{blue}{0.5}}{n}\right)}^{-0.5} \]
  14. Simplified43.2%

    \[\leadsto \color{blue}{{\left(\frac{k}{\pi} \cdot \frac{0.5}{n}\right)}^{-0.5}} \]
  15. Final simplification43.2%

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

Alternative 12: 38.8% accurate, 1.5× speedup?

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

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

    \[\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. unpow-prod-down77.0%

      \[\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)} \]
    2. unpow-prod-down99.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \frac{\sqrt{\left(2 \cdot n\right) \cdot \pi}}{\color{blue}{1} \cdot \sqrt{k}} \]
  7. Step-by-step derivation
    1. *-un-lft-identity53.2%

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

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

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

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

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

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

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

      \[\leadsto \frac{1}{\sqrt{\color{blue}{\frac{\frac{k}{\pi}}{2 \cdot n}}}} \]
  10. Simplified43.1%

    \[\leadsto \color{blue}{\frac{1}{\sqrt{\frac{\frac{k}{\pi}}{2 \cdot n}}}} \]
  11. Step-by-step derivation
    1. pow1/243.1%

      \[\leadsto \frac{1}{\color{blue}{{\left(\frac{\frac{k}{\pi}}{2 \cdot n}\right)}^{0.5}}} \]
    2. pow-flip43.2%

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

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

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

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

    \[\leadsto \color{blue}{{\left(\frac{k}{\pi \cdot \left(2 \cdot n\right)}\right)}^{-0.5}} \]
  13. Final simplification43.2%

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

Alternative 13: 38.0% accurate, 1.5× 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.2%

    \[\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. unpow-prod-down77.0%

      \[\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)} \]
    2. unpow-prod-down99.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \frac{\sqrt{\left(2 \cdot n\right) \cdot \pi}}{\color{blue}{1} \cdot \sqrt{k}} \]
  7. Step-by-step derivation
    1. *-un-lft-identity53.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \color{blue}{\sqrt{\frac{2}{\frac{k}{n \cdot \pi}}}} \]
  11. Taylor expanded in k around 0 42.0%

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

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

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

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

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

Alternative 14: 38.0% accurate, 1.5× speedup?

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

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

    \[\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. unpow-prod-down77.0%

      \[\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)} \]
    2. unpow-prod-down99.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \frac{\sqrt{\left(2 \cdot n\right) \cdot \pi}}{\color{blue}{1} \cdot \sqrt{k}} \]
  7. Step-by-step derivation
    1. *-un-lft-identity53.2%

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \sqrt{\color{blue}{\frac{\pi}{\frac{k}{2 \cdot n}}}} \]
  10. Simplified42.0%

    \[\leadsto \color{blue}{\sqrt{\frac{\pi}{\frac{k}{2 \cdot n}}}} \]
  11. Final simplification42.0%

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

Reproduce

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