
(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}
Herbie found 9 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(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}
(FPCore (k n) :precision binary64 (* (/ 1.0 (sqrt k)) (pow (* (* 2.0 PI) n) (+ 0.5 (* -0.5 k)))))
double code(double k, double n) {
return (1.0 / sqrt(k)) * pow(((2.0 * ((double) M_PI)) * n), (0.5 + (-0.5 * k)));
}
public static double code(double k, double n) {
return (1.0 / Math.sqrt(k)) * Math.pow(((2.0 * Math.PI) * n), (0.5 + (-0.5 * k)));
}
def code(k, n): return (1.0 / math.sqrt(k)) * math.pow(((2.0 * math.pi) * n), (0.5 + (-0.5 * k)))
function code(k, n) return Float64(Float64(1.0 / sqrt(k)) * (Float64(Float64(2.0 * pi) * n) ^ Float64(0.5 + Float64(-0.5 * k)))) end
function tmp = code(k, n) tmp = (1.0 / sqrt(k)) * (((2.0 * pi) * n) ^ (0.5 + (-0.5 * k))); end
code[k_, n_] := N[(N[(1.0 / N[Sqrt[k], $MachinePrecision]), $MachinePrecision] * N[Power[N[(N[(2.0 * Pi), $MachinePrecision] * n), $MachinePrecision], N[(0.5 + N[(-0.5 * k), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{1}{\sqrt{k}} \cdot {\left(\left(2 \cdot \pi\right) \cdot n\right)}^{\left(0.5 + -0.5 \cdot k\right)}
\end{array}
Initial program 99.4%
Taylor expanded in k around 0
lower-+.f64N/A
lower-*.f6499.4
Applied rewrites99.4%
(FPCore (k n) :precision binary64 (* (sqrt (/ 1.0 k)) (pow (* (* 2.0 PI) n) (+ 0.5 (* -0.5 k)))))
double code(double k, double n) {
return sqrt((1.0 / k)) * pow(((2.0 * ((double) M_PI)) * n), (0.5 + (-0.5 * k)));
}
public static double code(double k, double n) {
return Math.sqrt((1.0 / k)) * Math.pow(((2.0 * Math.PI) * n), (0.5 + (-0.5 * k)));
}
def code(k, n): return math.sqrt((1.0 / k)) * math.pow(((2.0 * math.pi) * n), (0.5 + (-0.5 * k)))
function code(k, n) return Float64(sqrt(Float64(1.0 / k)) * (Float64(Float64(2.0 * pi) * n) ^ Float64(0.5 + Float64(-0.5 * k)))) end
function tmp = code(k, n) tmp = sqrt((1.0 / k)) * (((2.0 * pi) * n) ^ (0.5 + (-0.5 * k))); end
code[k_, n_] := N[(N[Sqrt[N[(1.0 / k), $MachinePrecision]], $MachinePrecision] * N[Power[N[(N[(2.0 * Pi), $MachinePrecision] * n), $MachinePrecision], N[(0.5 + N[(-0.5 * k), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\sqrt{\frac{1}{k}} \cdot {\left(\left(2 \cdot \pi\right) \cdot n\right)}^{\left(0.5 + -0.5 \cdot k\right)}
\end{array}
Initial program 99.4%
Taylor expanded in k around 0
lower-sqrt.f64N/A
lower-/.f6499.4
Applied rewrites99.4%
Taylor expanded in k around 0
Applied rewrites48.8%
Taylor expanded in k around 0
lower-+.f64N/A
lower-*.f6499.4
Applied rewrites99.4%
(FPCore (k n) :precision binary64 (let* ((t_0 (/ 1.0 (sqrt k))) (t_1 (* (* 2.0 PI) n))) (if (<= k 1.0) (* t_0 (pow t_1 0.5)) (* t_0 (pow t_1 (* -0.5 k))))))
double code(double k, double n) {
double t_0 = 1.0 / sqrt(k);
double t_1 = (2.0 * ((double) M_PI)) * n;
double tmp;
if (k <= 1.0) {
tmp = t_0 * pow(t_1, 0.5);
} else {
tmp = t_0 * pow(t_1, (-0.5 * k));
}
return tmp;
}
public static double code(double k, double n) {
double t_0 = 1.0 / Math.sqrt(k);
double t_1 = (2.0 * Math.PI) * n;
double tmp;
if (k <= 1.0) {
tmp = t_0 * Math.pow(t_1, 0.5);
} else {
tmp = t_0 * Math.pow(t_1, (-0.5 * k));
}
return tmp;
}
def code(k, n): t_0 = 1.0 / math.sqrt(k) t_1 = (2.0 * math.pi) * n tmp = 0 if k <= 1.0: tmp = t_0 * math.pow(t_1, 0.5) else: tmp = t_0 * math.pow(t_1, (-0.5 * k)) return tmp
function code(k, n) t_0 = Float64(1.0 / sqrt(k)) t_1 = Float64(Float64(2.0 * pi) * n) tmp = 0.0 if (k <= 1.0) tmp = Float64(t_0 * (t_1 ^ 0.5)); else tmp = Float64(t_0 * (t_1 ^ Float64(-0.5 * k))); end return tmp end
function tmp_2 = code(k, n) t_0 = 1.0 / sqrt(k); t_1 = (2.0 * pi) * n; tmp = 0.0; if (k <= 1.0) tmp = t_0 * (t_1 ^ 0.5); else tmp = t_0 * (t_1 ^ (-0.5 * k)); end tmp_2 = tmp; end
code[k_, n_] := Block[{t$95$0 = N[(1.0 / N[Sqrt[k], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(2.0 * Pi), $MachinePrecision] * n), $MachinePrecision]}, If[LessEqual[k, 1.0], N[(t$95$0 * N[Power[t$95$1, 0.5], $MachinePrecision]), $MachinePrecision], N[(t$95$0 * N[Power[t$95$1, N[(-0.5 * k), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{1}{\sqrt{k}}\\
t_1 := \left(2 \cdot \pi\right) \cdot n\\
\mathbf{if}\;k \leq 1:\\
\;\;\;\;t\_0 \cdot {t\_1}^{0.5}\\
\mathbf{else}:\\
\;\;\;\;t\_0 \cdot {t\_1}^{\left(-0.5 \cdot k\right)}\\
\end{array}
\end{array}
if k < 1Initial program 99.4%
Taylor expanded in k around 0
Applied rewrites48.8%
if 1 < k Initial program 99.4%
Taylor expanded in k around inf
lower-*.f6453.9
Applied rewrites53.9%
(FPCore (k n)
:precision binary64
(let* ((t_0 (/ 1.0 (sqrt k))) (t_1 (* (* 2.0 PI) n)))
(if (<= (* t_0 (pow t_1 (/ (- 1.0 k) 2.0))) 2e-70)
(* k (* (sqrt (/ (* n PI) (pow k 3.0))) (sqrt 2.0)))
(* t_0 (pow t_1 0.5)))))
double code(double k, double n) {
double t_0 = 1.0 / sqrt(k);
double t_1 = (2.0 * ((double) M_PI)) * n;
double tmp;
if ((t_0 * pow(t_1, ((1.0 - k) / 2.0))) <= 2e-70) {
tmp = k * (sqrt(((n * ((double) M_PI)) / pow(k, 3.0))) * sqrt(2.0));
} else {
tmp = t_0 * pow(t_1, 0.5);
}
return tmp;
}
public static double code(double k, double n) {
double t_0 = 1.0 / Math.sqrt(k);
double t_1 = (2.0 * Math.PI) * n;
double tmp;
if ((t_0 * Math.pow(t_1, ((1.0 - k) / 2.0))) <= 2e-70) {
tmp = k * (Math.sqrt(((n * Math.PI) / Math.pow(k, 3.0))) * Math.sqrt(2.0));
} else {
tmp = t_0 * Math.pow(t_1, 0.5);
}
return tmp;
}
def code(k, n): t_0 = 1.0 / math.sqrt(k) t_1 = (2.0 * math.pi) * n tmp = 0 if (t_0 * math.pow(t_1, ((1.0 - k) / 2.0))) <= 2e-70: tmp = k * (math.sqrt(((n * math.pi) / math.pow(k, 3.0))) * math.sqrt(2.0)) else: tmp = t_0 * math.pow(t_1, 0.5) return tmp
function code(k, n) t_0 = Float64(1.0 / sqrt(k)) t_1 = Float64(Float64(2.0 * pi) * n) tmp = 0.0 if (Float64(t_0 * (t_1 ^ Float64(Float64(1.0 - k) / 2.0))) <= 2e-70) tmp = Float64(k * Float64(sqrt(Float64(Float64(n * pi) / (k ^ 3.0))) * sqrt(2.0))); else tmp = Float64(t_0 * (t_1 ^ 0.5)); end return tmp end
function tmp_2 = code(k, n) t_0 = 1.0 / sqrt(k); t_1 = (2.0 * pi) * n; tmp = 0.0; if ((t_0 * (t_1 ^ ((1.0 - k) / 2.0))) <= 2e-70) tmp = k * (sqrt(((n * pi) / (k ^ 3.0))) * sqrt(2.0)); else tmp = t_0 * (t_1 ^ 0.5); end tmp_2 = tmp; end
code[k_, n_] := Block[{t$95$0 = N[(1.0 / N[Sqrt[k], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(2.0 * Pi), $MachinePrecision] * n), $MachinePrecision]}, If[LessEqual[N[(t$95$0 * N[Power[t$95$1, N[(N[(1.0 - k), $MachinePrecision] / 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2e-70], N[(k * N[(N[Sqrt[N[(N[(n * Pi), $MachinePrecision] / N[Power[k, 3.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$0 * N[Power[t$95$1, 0.5], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{1}{\sqrt{k}}\\
t_1 := \left(2 \cdot \pi\right) \cdot n\\
\mathbf{if}\;t\_0 \cdot {t\_1}^{\left(\frac{1 - k}{2}\right)} \leq 2 \cdot 10^{-70}:\\
\;\;\;\;k \cdot \left(\sqrt{\frac{n \cdot \pi}{{k}^{3}}} \cdot \sqrt{2}\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0 \cdot {t\_1}^{0.5}\\
\end{array}
\end{array}
if (*.f64 (/.f64 #s(literal 1 binary64) (sqrt.f64 k)) (pow.f64 (*.f64 (*.f64 #s(literal 2 binary64) (PI.f64)) n) (/.f64 (-.f64 #s(literal 1 binary64) k) #s(literal 2 binary64)))) < 1.99999999999999999e-70Initial program 99.4%
Taylor expanded in k around 0
lower-/.f64N/A
Applied rewrites54.8%
Taylor expanded in k around inf
lower-*.f64N/A
lower-fma.f64N/A
Applied rewrites14.0%
Taylor expanded in k around 0
lift-*.f64N/A
lift-PI.f64N/A
lift-pow.f64N/A
lift-/.f64N/A
lift-sqrt.f64N/A
lift-sqrt.f64N/A
lift-*.f6430.5
Applied rewrites30.5%
if 1.99999999999999999e-70 < (*.f64 (/.f64 #s(literal 1 binary64) (sqrt.f64 k)) (pow.f64 (*.f64 (*.f64 #s(literal 2 binary64) (PI.f64)) n) (/.f64 (-.f64 #s(literal 1 binary64) k) #s(literal 2 binary64)))) Initial program 99.4%
Taylor expanded in k around 0
Applied rewrites48.8%
(FPCore (k n) :precision binary64 (if (<= (* (/ 1.0 (sqrt k)) (pow (* (* 2.0 PI) n) (/ (- 1.0 k) 2.0))) 5e+151) (* (sqrt (/ (* n PI) k)) (sqrt 2.0)) (/ (* (sqrt (* k (* n PI))) (sqrt 2.0)) k)))
double code(double k, double n) {
double tmp;
if (((1.0 / sqrt(k)) * pow(((2.0 * ((double) M_PI)) * n), ((1.0 - k) / 2.0))) <= 5e+151) {
tmp = sqrt(((n * ((double) M_PI)) / k)) * sqrt(2.0);
} else {
tmp = (sqrt((k * (n * ((double) M_PI)))) * sqrt(2.0)) / k;
}
return tmp;
}
public static double code(double k, double n) {
double tmp;
if (((1.0 / Math.sqrt(k)) * Math.pow(((2.0 * Math.PI) * n), ((1.0 - k) / 2.0))) <= 5e+151) {
tmp = Math.sqrt(((n * Math.PI) / k)) * Math.sqrt(2.0);
} else {
tmp = (Math.sqrt((k * (n * Math.PI))) * Math.sqrt(2.0)) / k;
}
return tmp;
}
def code(k, n): tmp = 0 if ((1.0 / math.sqrt(k)) * math.pow(((2.0 * math.pi) * n), ((1.0 - k) / 2.0))) <= 5e+151: tmp = math.sqrt(((n * math.pi) / k)) * math.sqrt(2.0) else: tmp = (math.sqrt((k * (n * math.pi))) * math.sqrt(2.0)) / k return tmp
function code(k, n) tmp = 0.0 if (Float64(Float64(1.0 / sqrt(k)) * (Float64(Float64(2.0 * pi) * n) ^ Float64(Float64(1.0 - k) / 2.0))) <= 5e+151) tmp = Float64(sqrt(Float64(Float64(n * pi) / k)) * sqrt(2.0)); else tmp = Float64(Float64(sqrt(Float64(k * Float64(n * pi))) * sqrt(2.0)) / k); end return tmp end
function tmp_2 = code(k, n) tmp = 0.0; if (((1.0 / sqrt(k)) * (((2.0 * pi) * n) ^ ((1.0 - k) / 2.0))) <= 5e+151) tmp = sqrt(((n * pi) / k)) * sqrt(2.0); else tmp = (sqrt((k * (n * pi))) * sqrt(2.0)) / k; end tmp_2 = tmp; end
code[k_, n_] := If[LessEqual[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], 5e+151], N[(N[Sqrt[N[(N[(n * Pi), $MachinePrecision] / k), $MachinePrecision]], $MachinePrecision] * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision], N[(N[(N[Sqrt[N[(k * N[(n * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision] / k), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{1}{\sqrt{k}} \cdot {\left(\left(2 \cdot \pi\right) \cdot n\right)}^{\left(\frac{1 - k}{2}\right)} \leq 5 \cdot 10^{+151}:\\
\;\;\;\;\sqrt{\frac{n \cdot \pi}{k}} \cdot \sqrt{2}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{k \cdot \left(n \cdot \pi\right)} \cdot \sqrt{2}}{k}\\
\end{array}
\end{array}
if (*.f64 (/.f64 #s(literal 1 binary64) (sqrt.f64 k)) (pow.f64 (*.f64 (*.f64 #s(literal 2 binary64) (PI.f64)) n) (/.f64 (-.f64 #s(literal 1 binary64) k) #s(literal 2 binary64)))) < 5.0000000000000002e151Initial program 99.4%
Taylor expanded in k around 0
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lift-PI.f64N/A
lower-sqrt.f6437.2
Applied rewrites37.2%
if 5.0000000000000002e151 < (*.f64 (/.f64 #s(literal 1 binary64) (sqrt.f64 k)) (pow.f64 (*.f64 (*.f64 #s(literal 2 binary64) (PI.f64)) n) (/.f64 (-.f64 #s(literal 1 binary64) k) #s(literal 2 binary64)))) Initial program 99.4%
Taylor expanded in k around 0
lower-/.f64N/A
Applied rewrites54.8%
Taylor expanded in k around 0
lift-*.f64N/A
lift-PI.f64N/A
lift-*.f64N/A
lift-sqrt.f64N/A
lift-sqrt.f64N/A
lift-*.f6438.0
Applied rewrites38.0%
(FPCore (k n) :precision binary64 (* (/ 1.0 (sqrt k)) (pow (* (* 2.0 PI) n) 0.5)))
double code(double k, double n) {
return (1.0 / sqrt(k)) * pow(((2.0 * ((double) M_PI)) * n), 0.5);
}
public static double code(double k, double n) {
return (1.0 / Math.sqrt(k)) * Math.pow(((2.0 * Math.PI) * n), 0.5);
}
def code(k, n): return (1.0 / math.sqrt(k)) * math.pow(((2.0 * math.pi) * n), 0.5)
function code(k, n) return Float64(Float64(1.0 / sqrt(k)) * (Float64(Float64(2.0 * pi) * n) ^ 0.5)) end
function tmp = code(k, n) tmp = (1.0 / sqrt(k)) * (((2.0 * pi) * n) ^ 0.5); end
code[k_, n_] := N[(N[(1.0 / N[Sqrt[k], $MachinePrecision]), $MachinePrecision] * N[Power[N[(N[(2.0 * Pi), $MachinePrecision] * n), $MachinePrecision], 0.5], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{1}{\sqrt{k}} \cdot {\left(\left(2 \cdot \pi\right) \cdot n\right)}^{0.5}
\end{array}
Initial program 99.4%
Taylor expanded in k around 0
Applied rewrites48.8%
(FPCore (k n) :precision binary64 (* (sqrt (/ 1.0 k)) (pow (* (* 2.0 PI) n) 0.5)))
double code(double k, double n) {
return sqrt((1.0 / k)) * pow(((2.0 * ((double) M_PI)) * n), 0.5);
}
public static double code(double k, double n) {
return Math.sqrt((1.0 / k)) * Math.pow(((2.0 * Math.PI) * n), 0.5);
}
def code(k, n): return math.sqrt((1.0 / k)) * math.pow(((2.0 * math.pi) * n), 0.5)
function code(k, n) return Float64(sqrt(Float64(1.0 / k)) * (Float64(Float64(2.0 * pi) * n) ^ 0.5)) end
function tmp = code(k, n) tmp = sqrt((1.0 / k)) * (((2.0 * pi) * n) ^ 0.5); end
code[k_, n_] := N[(N[Sqrt[N[(1.0 / k), $MachinePrecision]], $MachinePrecision] * N[Power[N[(N[(2.0 * Pi), $MachinePrecision] * n), $MachinePrecision], 0.5], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\sqrt{\frac{1}{k}} \cdot {\left(\left(2 \cdot \pi\right) \cdot n\right)}^{0.5}
\end{array}
Initial program 99.4%
Taylor expanded in k around 0
lower-sqrt.f64N/A
lower-/.f6499.4
Applied rewrites99.4%
Taylor expanded in k around 0
Applied rewrites48.8%
Taylor expanded in k around 0
Applied rewrites48.8%
(FPCore (k n) :precision binary64 (* (sqrt (/ 1.0 k)) (* (sqrt (* n PI)) (sqrt 2.0))))
double code(double k, double n) {
return sqrt((1.0 / k)) * (sqrt((n * ((double) M_PI))) * sqrt(2.0));
}
public static double code(double k, double n) {
return Math.sqrt((1.0 / k)) * (Math.sqrt((n * Math.PI)) * Math.sqrt(2.0));
}
def code(k, n): return math.sqrt((1.0 / k)) * (math.sqrt((n * math.pi)) * math.sqrt(2.0))
function code(k, n) return Float64(sqrt(Float64(1.0 / k)) * Float64(sqrt(Float64(n * pi)) * sqrt(2.0))) end
function tmp = code(k, n) tmp = sqrt((1.0 / k)) * (sqrt((n * pi)) * sqrt(2.0)); end
code[k_, n_] := N[(N[Sqrt[N[(1.0 / k), $MachinePrecision]], $MachinePrecision] * N[(N[Sqrt[N[(n * Pi), $MachinePrecision]], $MachinePrecision] * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\sqrt{\frac{1}{k}} \cdot \left(\sqrt{n \cdot \pi} \cdot \sqrt{2}\right)
\end{array}
Initial program 99.4%
Taylor expanded in k around inf
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-exp.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-log.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lift-PI.f64N/A
lift--.f6496.1
Applied rewrites96.1%
Taylor expanded in k around 0
lift-*.f64N/A
lift-PI.f64N/A
lift-sqrt.f64N/A
lift-sqrt.f64N/A
lift-*.f6448.8
Applied rewrites48.8%
(FPCore (k n) :precision binary64 (* (sqrt (/ (* n PI) k)) (sqrt 2.0)))
double code(double k, double n) {
return sqrt(((n * ((double) M_PI)) / k)) * sqrt(2.0);
}
public static double code(double k, double n) {
return Math.sqrt(((n * Math.PI) / k)) * Math.sqrt(2.0);
}
def code(k, n): return math.sqrt(((n * math.pi) / k)) * math.sqrt(2.0)
function code(k, n) return Float64(sqrt(Float64(Float64(n * pi) / k)) * sqrt(2.0)) end
function tmp = code(k, n) tmp = sqrt(((n * pi) / k)) * sqrt(2.0); end
code[k_, n_] := N[(N[Sqrt[N[(N[(n * Pi), $MachinePrecision] / k), $MachinePrecision]], $MachinePrecision] * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\sqrt{\frac{n \cdot \pi}{k}} \cdot \sqrt{2}
\end{array}
Initial program 99.4%
Taylor expanded in k around 0
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lift-PI.f64N/A
lower-sqrt.f6437.2
Applied rewrites37.2%
herbie shell --seed 2025129
(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))))