Migdal et al, Equation (51)

Percentage Accurate: 99.4% → 99.5%
Time: 12.3s
Alternatives: 9
Speedup: 1.0×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 9 alternatives:

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

Initial Program: 99.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.5% accurate, 1.0× speedup?

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

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

    \[\frac{1}{\sqrt{k}} \cdot {\left(\left(2 \cdot \pi\right) \cdot n\right)}^{\left(\frac{1 - k}{2}\right)} \]
  2. Step-by-step derivation
    1. expm1-log1p-u96.0%

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

      \[\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. inv-pow74.1%

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

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

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

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

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

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

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

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

Alternative 2: 99.2% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
t_0 := \pi \cdot \left(2 \cdot n\right)\\
\mathbf{if}\;k \leq 6.8 \cdot 10^{-38}:\\
\;\;\;\;{k}^{-0.5} \cdot \sqrt{t_0}\\

\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{1}{k \cdot {t_0}^{\left(k + -1\right)}}}\\


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

    1. Initial program 99.3%

      \[\frac{1}{\sqrt{k}} \cdot {\left(\left(2 \cdot \pi\right) \cdot n\right)}^{\left(\frac{1 - k}{2}\right)} \]
    2. Step-by-step derivation
      1. expm1-log1p-u92.4%

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

        \[\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. inv-pow92.4%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto {k}^{-0.5} \cdot \left(e^{\mathsf{log1p}\left(\color{blue}{\sqrt{2 \cdot \left(n \cdot \pi\right)}}\right)} - 1\right) \]
      4. *-commutative44.7%

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

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

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

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

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

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

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

    if 6.8000000000000004e-38 < 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. *-commutative99.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 99.3% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;k \leq 5.5 \cdot 10^{-38}:\\
\;\;\;\;{k}^{-0.5} \cdot \sqrt{\pi \cdot \left(2 \cdot n\right)}\\

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


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

    1. Initial program 99.3%

      \[\frac{1}{\sqrt{k}} \cdot {\left(\left(2 \cdot \pi\right) \cdot n\right)}^{\left(\frac{1 - k}{2}\right)} \]
    2. Step-by-step derivation
      1. expm1-log1p-u92.4%

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

        \[\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. inv-pow92.4%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto {k}^{-0.5} \cdot \left(e^{\mathsf{log1p}\left(\color{blue}{\sqrt{2 \cdot \left(n \cdot \pi\right)}}\right)} - 1\right) \]
      4. *-commutative44.7%

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

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

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

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

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

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

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

    if 5.50000000000000005e-38 < 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. *-commutative99.6%

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

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

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

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

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

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

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

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

Alternative 4: 99.5% accurate, 1.0× speedup?

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

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

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

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

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

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

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

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

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

Alternative 5: 50.3% accurate, 1.0× speedup?

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

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

    \[\frac{1}{\sqrt{k}} \cdot {\left(\left(2 \cdot \pi\right) \cdot n\right)}^{\left(\frac{1 - k}{2}\right)} \]
  2. Step-by-step derivation
    1. expm1-log1p-u96.0%

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

      \[\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. inv-pow74.1%

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

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

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

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

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

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

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

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

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

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

      \[\leadsto {k}^{-0.5} \cdot \left(e^{\mathsf{log1p}\left(\color{blue}{\sqrt{2 \cdot \left(n \cdot \pi\right)}}\right)} - 1\right) \]
    4. *-commutative25.8%

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

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

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

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

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

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

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

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

Alternative 6: 38.9% accurate, 1.0× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 50.3% accurate, 1.0× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 8: 39.0% accurate, 1.5× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{1}{\sqrt{\frac{k}{\color{blue}{\pi \cdot \left(n \cdot 2\right)}}}} \]
  10. Simplified44.7%

    \[\leadsto \color{blue}{\frac{1}{\sqrt{\frac{k}{\pi \cdot \left(n \cdot 2\right)}}}} \]
  11. Final simplification44.7%

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

Alternative 9: 38.3% 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.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Reproduce

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