
(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:
Herbie found 8 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 (let* ((t_0 (* PI (* 2.0 n)))) (/ (sqrt t_0) (* (sqrt k) (pow t_0 (* k 0.5))))))
double code(double k, double n) {
double t_0 = ((double) M_PI) * (2.0 * n);
return sqrt(t_0) / (sqrt(k) * pow(t_0, (k * 0.5)));
}
public static double code(double k, double n) {
double t_0 = Math.PI * (2.0 * n);
return Math.sqrt(t_0) / (Math.sqrt(k) * Math.pow(t_0, (k * 0.5)));
}
def code(k, n): t_0 = math.pi * (2.0 * n) return math.sqrt(t_0) / (math.sqrt(k) * math.pow(t_0, (k * 0.5)))
function code(k, n) t_0 = Float64(pi * Float64(2.0 * n)) return Float64(sqrt(t_0) / Float64(sqrt(k) * (t_0 ^ Float64(k * 0.5)))) end
function tmp = code(k, n) t_0 = pi * (2.0 * n); tmp = sqrt(t_0) / (sqrt(k) * (t_0 ^ (k * 0.5))); end
code[k_, n_] := Block[{t$95$0 = N[(Pi * N[(2.0 * n), $MachinePrecision]), $MachinePrecision]}, N[(N[Sqrt[t$95$0], $MachinePrecision] / N[(N[Sqrt[k], $MachinePrecision] * N[Power[t$95$0, N[(k * 0.5), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \pi \cdot \left(2 \cdot n\right)\\
\frac{\sqrt{t_0}}{\sqrt{k} \cdot {t_0}^{\left(k \cdot 0.5\right)}}
\end{array}
\end{array}
Initial program 99.6%
unpow-prod-down67.7%
unpow-prod-down99.6%
div-sub99.6%
metadata-eval99.6%
pow-sub99.7%
pow1/299.7%
frac-times99.7%
*-un-lft-identity99.7%
associate-*l*99.7%
associate-*l*99.7%
div-inv99.7%
metadata-eval99.7%
Applied egg-rr99.7%
associate-*r*99.7%
*-commutative99.7%
associate-*l*99.7%
associate-*r*99.7%
*-commutative99.7%
associate-*l*99.7%
*-commutative99.7%
Simplified99.7%
Final simplification99.7%
(FPCore (k n) :precision binary64 (if (<= k 1.6e-75) (/ 1.0 (/ (sqrt (/ k PI)) (sqrt (+ n n)))) (sqrt (/ (pow (* PI (* 2.0 n)) (- 1.0 k)) k))))
double code(double k, double n) {
double tmp;
if (k <= 1.6e-75) {
tmp = 1.0 / (sqrt((k / ((double) M_PI))) / sqrt((n + n)));
} else {
tmp = sqrt((pow((((double) M_PI) * (2.0 * n)), (1.0 - k)) / k));
}
return tmp;
}
public static double code(double k, double n) {
double tmp;
if (k <= 1.6e-75) {
tmp = 1.0 / (Math.sqrt((k / Math.PI)) / Math.sqrt((n + n)));
} else {
tmp = Math.sqrt((Math.pow((Math.PI * (2.0 * n)), (1.0 - k)) / k));
}
return tmp;
}
def code(k, n): tmp = 0 if k <= 1.6e-75: tmp = 1.0 / (math.sqrt((k / math.pi)) / math.sqrt((n + n))) else: tmp = math.sqrt((math.pow((math.pi * (2.0 * n)), (1.0 - k)) / k)) return tmp
function code(k, n) tmp = 0.0 if (k <= 1.6e-75) tmp = Float64(1.0 / Float64(sqrt(Float64(k / pi)) / sqrt(Float64(n + n)))); else tmp = sqrt(Float64((Float64(pi * Float64(2.0 * n)) ^ Float64(1.0 - k)) / k)); end return tmp end
function tmp_2 = code(k, n) tmp = 0.0; if (k <= 1.6e-75) tmp = 1.0 / (sqrt((k / pi)) / sqrt((n + n))); else tmp = sqrt((((pi * (2.0 * n)) ^ (1.0 - k)) / k)); end tmp_2 = tmp; end
code[k_, n_] := If[LessEqual[k, 1.6e-75], N[(1.0 / N[(N[Sqrt[N[(k / Pi), $MachinePrecision]], $MachinePrecision] / N[Sqrt[N[(n + n), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Sqrt[N[(N[Power[N[(Pi * N[(2.0 * n), $MachinePrecision]), $MachinePrecision], N[(1.0 - k), $MachinePrecision]], $MachinePrecision] / k), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;k \leq 1.6 \cdot 10^{-75}:\\
\;\;\;\;\frac{1}{\frac{\sqrt{\frac{k}{\pi}}}{\sqrt{n + n}}}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{{\left(\pi \cdot \left(2 \cdot n\right)\right)}^{\left(1 - k\right)}}{k}}\\
\end{array}
\end{array}
if k < 1.59999999999999988e-75Initial program 99.3%
*-commutative99.3%
div-sub99.3%
metadata-eval99.3%
div-inv99.4%
expm1-log1p-u93.1%
expm1-udef74.4%
Applied egg-rr45.5%
expm1-def64.1%
expm1-log1p67.5%
associate-*r*67.5%
*-commutative67.5%
associate-*l*67.5%
Simplified67.5%
clear-num67.5%
sqrt-div67.5%
metadata-eval67.5%
*-commutative67.5%
associate-*r*67.5%
*-commutative67.5%
*-commutative67.5%
associate-*r*67.5%
*-commutative67.5%
associate-*r*67.5%
Applied egg-rr67.5%
Taylor expanded in k around 0 67.5%
associate-*r*67.5%
*-commutative67.5%
*-commutative67.5%
Simplified67.5%
associate-/r*67.5%
sqrt-div99.4%
Applied egg-rr99.4%
*-commutative99.4%
rem-log-exp6.9%
log-pow6.9%
unpow26.9%
prod-exp7.0%
rem-log-exp99.4%
Simplified99.4%
if 1.59999999999999988e-75 < k Initial program 99.7%
*-commutative99.7%
div-sub99.7%
metadata-eval99.7%
div-inv99.7%
expm1-log1p-u99.4%
expm1-udef93.1%
Applied egg-rr93.1%
expm1-def99.4%
expm1-log1p99.7%
associate-*r*99.7%
*-commutative99.7%
associate-*l*99.7%
Simplified99.7%
Final simplification99.6%
(FPCore (k n) :precision binary64 (/ (pow (* n (* PI 2.0)) (- 0.5 (/ k 2.0))) (sqrt k)))
double code(double k, double n) {
return pow((n * (((double) M_PI) * 2.0)), (0.5 - (k / 2.0))) / sqrt(k);
}
public static double code(double k, double n) {
return Math.pow((n * (Math.PI * 2.0)), (0.5 - (k / 2.0))) / Math.sqrt(k);
}
def code(k, n): return math.pow((n * (math.pi * 2.0)), (0.5 - (k / 2.0))) / math.sqrt(k)
function code(k, n) return Float64((Float64(n * Float64(pi * 2.0)) ^ Float64(0.5 - Float64(k / 2.0))) / sqrt(k)) end
function tmp = code(k, n) tmp = ((n * (pi * 2.0)) ^ (0.5 - (k / 2.0))) / sqrt(k); end
code[k_, n_] := N[(N[Power[N[(n * N[(Pi * 2.0), $MachinePrecision]), $MachinePrecision], N[(0.5 - N[(k / 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[Sqrt[k], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{{\left(n \cdot \left(\pi \cdot 2\right)\right)}^{\left(0.5 - \frac{k}{2}\right)}}{\sqrt{k}}
\end{array}
Initial program 99.6%
associate-*l/99.6%
*-lft-identity99.6%
sqr-pow99.5%
pow-sqr99.6%
*-commutative99.6%
associate-*l/99.6%
associate-/l*99.6%
metadata-eval99.6%
/-rgt-identity99.6%
div-sub99.6%
metadata-eval99.6%
Simplified99.6%
Final simplification99.6%
(FPCore (k n) :precision binary64 (if (<= k 3.55e+145) (/ 1.0 (/ (sqrt (/ k PI)) (sqrt (+ n n)))) (pow (* (pow (* PI (/ n k)) 3.0) 8.0) 0.16666666666666666)))
double code(double k, double n) {
double tmp;
if (k <= 3.55e+145) {
tmp = 1.0 / (sqrt((k / ((double) M_PI))) / sqrt((n + n)));
} else {
tmp = pow((pow((((double) M_PI) * (n / k)), 3.0) * 8.0), 0.16666666666666666);
}
return tmp;
}
public static double code(double k, double n) {
double tmp;
if (k <= 3.55e+145) {
tmp = 1.0 / (Math.sqrt((k / Math.PI)) / Math.sqrt((n + n)));
} else {
tmp = Math.pow((Math.pow((Math.PI * (n / k)), 3.0) * 8.0), 0.16666666666666666);
}
return tmp;
}
def code(k, n): tmp = 0 if k <= 3.55e+145: tmp = 1.0 / (math.sqrt((k / math.pi)) / math.sqrt((n + n))) else: tmp = math.pow((math.pow((math.pi * (n / k)), 3.0) * 8.0), 0.16666666666666666) return tmp
function code(k, n) tmp = 0.0 if (k <= 3.55e+145) tmp = Float64(1.0 / Float64(sqrt(Float64(k / pi)) / sqrt(Float64(n + n)))); else tmp = Float64((Float64(pi * Float64(n / k)) ^ 3.0) * 8.0) ^ 0.16666666666666666; end return tmp end
function tmp_2 = code(k, n) tmp = 0.0; if (k <= 3.55e+145) tmp = 1.0 / (sqrt((k / pi)) / sqrt((n + n))); else tmp = (((pi * (n / k)) ^ 3.0) * 8.0) ^ 0.16666666666666666; end tmp_2 = tmp; end
code[k_, n_] := If[LessEqual[k, 3.55e+145], N[(1.0 / N[(N[Sqrt[N[(k / Pi), $MachinePrecision]], $MachinePrecision] / N[Sqrt[N[(n + n), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Power[N[(N[Power[N[(Pi * N[(n / k), $MachinePrecision]), $MachinePrecision], 3.0], $MachinePrecision] * 8.0), $MachinePrecision], 0.16666666666666666], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;k \leq 3.55 \cdot 10^{+145}:\\
\;\;\;\;\frac{1}{\frac{\sqrt{\frac{k}{\pi}}}{\sqrt{n + n}}}\\
\mathbf{else}:\\
\;\;\;\;{\left({\left(\pi \cdot \frac{n}{k}\right)}^{3} \cdot 8\right)}^{0.16666666666666666}\\
\end{array}
\end{array}
if k < 3.5500000000000002e145Initial program 99.4%
*-commutative99.4%
div-sub99.4%
metadata-eval99.4%
div-inv99.4%
expm1-log1p-u96.1%
expm1-udef81.1%
Applied egg-rr67.3%
expm1-def82.2%
expm1-log1p84.3%
associate-*r*84.3%
*-commutative84.3%
associate-*l*84.3%
Simplified84.3%
clear-num84.3%
sqrt-div84.2%
metadata-eval84.2%
*-commutative84.2%
associate-*r*84.2%
*-commutative84.2%
*-commutative84.2%
associate-*r*84.2%
*-commutative84.2%
associate-*r*84.2%
Applied egg-rr84.2%
Taylor expanded in k around 0 45.6%
associate-*r*45.6%
*-commutative45.6%
*-commutative45.6%
Simplified45.6%
associate-/r*45.5%
sqrt-div60.8%
Applied egg-rr60.8%
*-commutative60.8%
rem-log-exp4.8%
log-pow4.8%
unpow24.8%
prod-exp4.8%
rem-log-exp60.8%
Simplified60.8%
if 3.5500000000000002e145 < k Initial program 100.0%
*-commutative100.0%
div-sub100.0%
metadata-eval100.0%
div-inv100.0%
expm1-log1p-u100.0%
expm1-udef100.0%
Applied egg-rr100.0%
expm1-def100.0%
expm1-log1p100.0%
associate-*r*100.0%
*-commutative100.0%
associate-*l*100.0%
Simplified100.0%
pow-sub100.0%
pow1100.0%
clear-num100.0%
associate-*r*100.0%
associate-*r*100.0%
Applied egg-rr100.0%
Taylor expanded in k around 0 2.6%
pow1/22.6%
metadata-eval2.6%
associate-*r/2.6%
associate-*r*2.6%
*-commutative2.6%
*-commutative2.6%
pow-pow5.0%
sqr-pow5.0%
pow-prod-down22.2%
pow-prod-up22.2%
*-commutative22.2%
*-commutative22.2%
associate-*r*22.2%
associate-*r/22.2%
associate-/l*22.2%
metadata-eval22.2%
metadata-eval22.2%
Applied egg-rr22.2%
*-commutative22.2%
cube-prod22.2%
associate-/r/22.2%
*-commutative22.2%
metadata-eval22.2%
Simplified22.2%
Final simplification49.1%
(FPCore (k n) :precision binary64 (/ 1.0 (/ (sqrt (/ k PI)) (sqrt (+ n n)))))
double code(double k, double n) {
return 1.0 / (sqrt((k / ((double) M_PI))) / sqrt((n + n)));
}
public static double code(double k, double n) {
return 1.0 / (Math.sqrt((k / Math.PI)) / Math.sqrt((n + n)));
}
def code(k, n): return 1.0 / (math.sqrt((k / math.pi)) / math.sqrt((n + n)))
function code(k, n) return Float64(1.0 / Float64(sqrt(Float64(k / pi)) / sqrt(Float64(n + n)))) end
function tmp = code(k, n) tmp = 1.0 / (sqrt((k / pi)) / sqrt((n + n))); end
code[k_, n_] := N[(1.0 / N[(N[Sqrt[N[(k / Pi), $MachinePrecision]], $MachinePrecision] / N[Sqrt[N[(n + n), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{1}{\frac{\sqrt{\frac{k}{\pi}}}{\sqrt{n + n}}}
\end{array}
Initial program 99.6%
*-commutative99.6%
div-sub99.6%
metadata-eval99.6%
div-inv99.6%
expm1-log1p-u97.3%
expm1-udef86.9%
Applied egg-rr77.3%
expm1-def87.7%
expm1-log1p89.1%
associate-*r*89.1%
*-commutative89.1%
associate-*l*89.1%
Simplified89.1%
clear-num89.1%
sqrt-div89.0%
metadata-eval89.0%
*-commutative89.0%
associate-*r*89.0%
*-commutative89.0%
*-commutative89.0%
associate-*r*89.0%
*-commutative89.0%
associate-*r*89.0%
Applied egg-rr89.0%
Taylor expanded in k around 0 32.5%
associate-*r*32.5%
*-commutative32.5%
*-commutative32.5%
Simplified32.5%
associate-/r*32.5%
sqrt-div43.1%
Applied egg-rr43.1%
*-commutative43.1%
rem-log-exp3.8%
log-pow3.8%
unpow23.8%
prod-exp3.9%
rem-log-exp43.1%
Simplified43.1%
Final simplification43.1%
(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}
Initial program 99.6%
*-commutative99.6%
div-sub99.6%
metadata-eval99.6%
div-inv99.6%
expm1-log1p-u97.3%
expm1-udef86.9%
Applied egg-rr77.3%
expm1-def87.7%
expm1-log1p89.1%
associate-*r*89.1%
*-commutative89.1%
associate-*l*89.1%
Simplified89.1%
pow-sub89.2%
pow189.2%
clear-num89.2%
associate-*r*89.2%
associate-*r*89.2%
Applied egg-rr89.2%
Taylor expanded in k around 0 32.5%
associate-*r/32.5%
sqrt-div43.1%
associate-*r*43.1%
*-commutative43.1%
*-commutative43.1%
Applied egg-rr43.1%
Final simplification43.1%
(FPCore (k n) :precision binary64 (sqrt (* 2.0 (* n (/ PI k)))))
double code(double k, double n) {
return sqrt((2.0 * (n * (((double) M_PI) / k))));
}
public static double code(double k, double n) {
return Math.sqrt((2.0 * (n * (Math.PI / k))));
}
def code(k, n): return math.sqrt((2.0 * (n * (math.pi / k))))
function code(k, n) return sqrt(Float64(2.0 * Float64(n * Float64(pi / k)))) end
function tmp = code(k, n) tmp = sqrt((2.0 * (n * (pi / k)))); end
code[k_, n_] := N[Sqrt[N[(2.0 * N[(n * N[(Pi / k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\sqrt{2 \cdot \left(n \cdot \frac{\pi}{k}\right)}
\end{array}
Initial program 99.6%
*-commutative99.6%
div-sub99.6%
metadata-eval99.6%
div-inv99.6%
expm1-log1p-u97.3%
expm1-udef86.9%
Applied egg-rr77.3%
expm1-def87.7%
expm1-log1p89.1%
associate-*r*89.1%
*-commutative89.1%
associate-*l*89.1%
Simplified89.1%
pow-sub89.2%
pow189.2%
clear-num89.2%
associate-*r*89.2%
associate-*r*89.2%
Applied egg-rr89.2%
Taylor expanded in k around 0 32.5%
expm1-log1p-u31.2%
expm1-udef33.5%
associate-/l*33.5%
Applied egg-rr33.5%
expm1-def31.3%
expm1-log1p32.6%
associate-/l*32.5%
associate-*r/32.6%
Simplified32.6%
Final simplification32.6%
(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(2.0 * Float64(n / Float64(k / pi)))) end
function tmp = code(k, n) tmp = sqrt((2.0 * (n / (k / pi)))); end
code[k_, n_] := N[Sqrt[N[(2.0 * N[(n / N[(k / Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\sqrt{2 \cdot \frac{n}{\frac{k}{\pi}}}
\end{array}
Initial program 99.6%
*-commutative99.6%
div-sub99.6%
metadata-eval99.6%
div-inv99.6%
expm1-log1p-u97.3%
expm1-udef86.9%
Applied egg-rr77.3%
expm1-def87.7%
expm1-log1p89.1%
associate-*r*89.1%
*-commutative89.1%
associate-*l*89.1%
Simplified89.1%
clear-num89.1%
sqrt-div89.0%
metadata-eval89.0%
*-commutative89.0%
associate-*r*89.0%
*-commutative89.0%
*-commutative89.0%
associate-*r*89.0%
*-commutative89.0%
associate-*r*89.0%
Applied egg-rr89.0%
Taylor expanded in k around 0 32.5%
associate-*r*32.5%
*-commutative32.5%
*-commutative32.5%
Simplified32.5%
metadata-eval32.5%
sqrt-div32.5%
*-commutative32.5%
*-commutative32.5%
associate-*r*32.5%
clear-num32.5%
associate-*r/32.5%
associate-/l*32.6%
Applied egg-rr32.6%
Final simplification32.6%
herbie shell --seed 2023275
(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))))