Migdal et al, Equation (51)

Percentage Accurate: 99.4% → 99.2%
Time: 14.9s
Alternatives: 10
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 10 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.2% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;k \leq 10^{-45}:\\ \;\;\;\;\sqrt{\frac{\pi}{k}} \cdot \sqrt{2 \cdot n}\\ \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 1e-45)
   (* (sqrt (/ PI k)) (sqrt (* 2.0 n)))
   (sqrt (/ (pow (* 2.0 (* PI n)) (- 1.0 k)) k))))
double code(double k, double n) {
	double tmp;
	if (k <= 1e-45) {
		tmp = sqrt((((double) M_PI) / k)) * sqrt((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 <= 1e-45) {
		tmp = Math.sqrt((Math.PI / k)) * Math.sqrt((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 <= 1e-45:
		tmp = math.sqrt((math.pi / k)) * math.sqrt((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 <= 1e-45)
		tmp = Float64(sqrt(Float64(pi / k)) * sqrt(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 <= 1e-45)
		tmp = sqrt((pi / k)) * sqrt((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, 1e-45], N[(N[Sqrt[N[(Pi / k), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(2.0 * n), $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 10^{-45}:\\
\;\;\;\;\sqrt{\frac{\pi}{k}} \cdot \sqrt{2 \cdot n}\\

\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 < 9.99999999999999984e-46

    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. Add Preprocessing
    3. Taylor expanded in k around 0 65.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 9.99999999999999984e-46 < k

    1. Initial program 99.7%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 59.6% accurate, 1.0× speedup?

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

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

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


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

    1. Initial program 99.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.2e46 < k

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 59.6% accurate, 1.0× speedup?

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

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

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


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

    1. Initial program 99.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 6.7999999999999996e46 < k

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 99.4% accurate, 1.0× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto {\left(2 \cdot \left(\pi \cdot n\right)\right)}^{\left(0.5 + \left(-k \cdot \color{blue}{0.5}\right)\right)} \cdot \frac{1}{\sqrt{k}} \]
    5. distribute-rgt-neg-in99.5%

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

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

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

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

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

    \[\leadsto \color{blue}{{\left(2 \cdot \left(\pi \cdot n\right)\right)}^{\left(0.5 + k \cdot -0.5\right)} \cdot {k}^{-0.5}} \]
  7. Add Preprocessing

Alternative 5: 99.4% accurate, 1.0× speedup?

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

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

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

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

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

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

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

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

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

Alternative 6: 49.3% accurate, 1.0× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 38.9% accurate, 2.0× speedup?

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{1}{\frac{\sqrt{k}}{{\left(2 \cdot \left(\pi \cdot n\right)\right)}^{\left(0.5 + \left(-k \cdot \color{blue}{0.5}\right)\right)}}} \]
    8. distribute-rgt-neg-in99.5%

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

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

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

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

      \[\leadsto \frac{1}{\color{blue}{\frac{\sqrt{\frac{k}{n \cdot \pi}} \cdot 1}{\sqrt{2}}}} \]
    2. *-rgt-identity32.8%

      \[\leadsto \frac{1}{\frac{\color{blue}{\sqrt{\frac{k}{n \cdot \pi}}}}{\sqrt{2}}} \]
  7. Simplified32.8%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 8: 38.3% accurate, 2.0× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 9: 38.3% accurate, 2.0× speedup?

\[\begin{array}{l} \\ \sqrt{\left(2 \cdot \pi\right) \cdot \frac{n}{k}} \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(Float64(2.0 * pi) * Float64(n / k)))
end
function tmp = code(k, n)
	tmp = sqrt(((2.0 * pi) * (n / k)));
end
code[k_, n_] := N[Sqrt[N[(N[(2.0 * Pi), $MachinePrecision] * N[(n / k), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}

\\
\sqrt{\left(2 \cdot \pi\right) \cdot \frac{n}{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. Add Preprocessing
  3. Step-by-step derivation
    1. associate-/r/99.5%

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

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

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

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

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

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

      \[\leadsto \frac{1}{\frac{\sqrt{k}}{{\left(2 \cdot \left(\pi \cdot n\right)\right)}^{\left(0.5 + \left(-k \cdot \color{blue}{0.5}\right)\right)}}} \]
    8. distribute-rgt-neg-in99.5%

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

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

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

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

      \[\leadsto \frac{1}{\color{blue}{\frac{\sqrt{\frac{k}{n \cdot \pi}} \cdot 1}{\sqrt{2}}}} \]
    2. *-rgt-identity32.8%

      \[\leadsto \frac{1}{\frac{\color{blue}{\sqrt{\frac{k}{n \cdot \pi}}}}{\sqrt{2}}} \]
  7. Simplified32.8%

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \frac{1}{\color{blue}{\frac{1}{\sqrt{2 \cdot \left(n \cdot \frac{\pi}{k}\right)}}}} \]
  12. Step-by-step derivation
    1. remove-double-div32.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 10: 38.3% accurate, 2.0× speedup?

\[\begin{array}{l} \\ \sqrt{2 \cdot \frac{\pi \cdot n}{k}} \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(Float64(pi * 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[(N[(Pi * n), $MachinePrecision] / k), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}

\\
\sqrt{2 \cdot \frac{\pi \cdot n}{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. Add Preprocessing
  3. Taylor expanded in k around 0 32.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

Reproduce

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