
(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 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
(let* ((t_0 (* 2.0 (* PI n))))
(if (<= k 1.75e-53)
(/ (sqrt t_0) (sqrt k))
(sqrt (/ (pow t_0 (- 1.0 k)) k)))))
double code(double k, double n) {
double t_0 = 2.0 * (((double) M_PI) * n);
double tmp;
if (k <= 1.75e-53) {
tmp = sqrt(t_0) / sqrt(k);
} else {
tmp = sqrt((pow(t_0, (1.0 - k)) / k));
}
return tmp;
}
public static double code(double k, double n) {
double t_0 = 2.0 * (Math.PI * n);
double tmp;
if (k <= 1.75e-53) {
tmp = Math.sqrt(t_0) / Math.sqrt(k);
} else {
tmp = Math.sqrt((Math.pow(t_0, (1.0 - k)) / k));
}
return tmp;
}
def code(k, n): t_0 = 2.0 * (math.pi * n) tmp = 0 if k <= 1.75e-53: tmp = math.sqrt(t_0) / math.sqrt(k) else: tmp = math.sqrt((math.pow(t_0, (1.0 - k)) / k)) return tmp
function code(k, n) t_0 = Float64(2.0 * Float64(pi * n)) tmp = 0.0 if (k <= 1.75e-53) tmp = Float64(sqrt(t_0) / sqrt(k)); else tmp = sqrt(Float64((t_0 ^ Float64(1.0 - k)) / k)); end return tmp end
function tmp_2 = code(k, n) t_0 = 2.0 * (pi * n); tmp = 0.0; if (k <= 1.75e-53) tmp = sqrt(t_0) / sqrt(k); else tmp = sqrt(((t_0 ^ (1.0 - k)) / k)); end tmp_2 = tmp; end
code[k_, n_] := Block[{t$95$0 = N[(2.0 * N[(Pi * n), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[k, 1.75e-53], N[(N[Sqrt[t$95$0], $MachinePrecision] / N[Sqrt[k], $MachinePrecision]), $MachinePrecision], N[Sqrt[N[(N[Power[t$95$0, N[(1.0 - k), $MachinePrecision]], $MachinePrecision] / k), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 2 \cdot \left(\pi \cdot n\right)\\
\mathbf{if}\;k \leq 1.75 \cdot 10^{-53}:\\
\;\;\;\;\frac{\sqrt{t\_0}}{\sqrt{k}}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{{t\_0}^{\left(1 - k\right)}}{k}}\\
\end{array}
\end{array}
if k < 1.74999999999999997e-53Initial program 99.3%
Applied egg-rr90.1%
Taylor expanded in k around 0
div-expN/A
*-commutativeN/A
exp-to-powN/A
unpow1/2N/A
/-lowering-/.f64N/A
*-commutativeN/A
exp-to-powN/A
unpow1/2N/A
sqrt-lowering-sqrt.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
sqrt-lowering-sqrt.f6499.5%
Simplified99.5%
if 1.74999999999999997e-53 < k Initial program 99.7%
Taylor expanded in k around 0
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f6499.7%
Simplified99.7%
*-commutativeN/A
*-commutativeN/A
associate-*r*N/A
div-invN/A
metadata-evalN/A
pow-unpowN/A
pow1/2N/A
pow-prod-downN/A
pow-lowering-pow.f64N/A
Applied egg-rr99.7%
unpow1/2N/A
sqrt-lowering-sqrt.f64N/A
un-div-invN/A
/-lowering-/.f64N/A
pow-lowering-pow.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
--lowering--.f6499.7%
Applied egg-rr99.7%
Final simplification99.6%
(FPCore (k n)
:precision binary64
(let* ((t_0 (/ 2.0 (/ k (* PI n)))))
(if (<= k 1.85e+193)
(/ (sqrt (* 2.0 (* PI n))) (sqrt k))
(pow (* t_0 t_0) 0.25))))
double code(double k, double n) {
double t_0 = 2.0 / (k / (((double) M_PI) * n));
double tmp;
if (k <= 1.85e+193) {
tmp = sqrt((2.0 * (((double) M_PI) * n))) / sqrt(k);
} else {
tmp = pow((t_0 * t_0), 0.25);
}
return tmp;
}
public static double code(double k, double n) {
double t_0 = 2.0 / (k / (Math.PI * n));
double tmp;
if (k <= 1.85e+193) {
tmp = Math.sqrt((2.0 * (Math.PI * n))) / Math.sqrt(k);
} else {
tmp = Math.pow((t_0 * t_0), 0.25);
}
return tmp;
}
def code(k, n): t_0 = 2.0 / (k / (math.pi * n)) tmp = 0 if k <= 1.85e+193: tmp = math.sqrt((2.0 * (math.pi * n))) / math.sqrt(k) else: tmp = math.pow((t_0 * t_0), 0.25) return tmp
function code(k, n) t_0 = Float64(2.0 / Float64(k / Float64(pi * n))) tmp = 0.0 if (k <= 1.85e+193) tmp = Float64(sqrt(Float64(2.0 * Float64(pi * n))) / sqrt(k)); else tmp = Float64(t_0 * t_0) ^ 0.25; end return tmp end
function tmp_2 = code(k, n) t_0 = 2.0 / (k / (pi * n)); tmp = 0.0; if (k <= 1.85e+193) tmp = sqrt((2.0 * (pi * n))) / sqrt(k); else tmp = (t_0 * t_0) ^ 0.25; end tmp_2 = tmp; end
code[k_, n_] := Block[{t$95$0 = N[(2.0 / N[(k / N[(Pi * n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[k, 1.85e+193], N[(N[Sqrt[N[(2.0 * N[(Pi * n), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[Sqrt[k], $MachinePrecision]), $MachinePrecision], N[Power[N[(t$95$0 * t$95$0), $MachinePrecision], 0.25], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{2}{\frac{k}{\pi \cdot n}}\\
\mathbf{if}\;k \leq 1.85 \cdot 10^{+193}:\\
\;\;\;\;\frac{\sqrt{2 \cdot \left(\pi \cdot n\right)}}{\sqrt{k}}\\
\mathbf{else}:\\
\;\;\;\;{\left(t\_0 \cdot t\_0\right)}^{0.25}\\
\end{array}
\end{array}
if k < 1.8500000000000001e193Initial program 99.4%
Applied egg-rr51.2%
Taylor expanded in k around 0
div-expN/A
*-commutativeN/A
exp-to-powN/A
unpow1/2N/A
/-lowering-/.f64N/A
*-commutativeN/A
exp-to-powN/A
unpow1/2N/A
sqrt-lowering-sqrt.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
sqrt-lowering-sqrt.f6456.6%
Simplified56.6%
if 1.8500000000000001e193 < k Initial program 100.0%
Taylor expanded in k around 0
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
sqrt-lowering-sqrt.f642.6%
Simplified2.6%
sqrt-unprodN/A
sqrt-lowering-sqrt.f64N/A
associate-*l/N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
/-lowering-/.f64N/A
*-commutativeN/A
associate-*r*N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
PI-lowering-PI.f642.6%
Applied egg-rr2.6%
pow1/2N/A
metadata-evalN/A
metadata-evalN/A
metadata-evalN/A
pow-prod-upN/A
pow-prod-downN/A
pow-lowering-pow.f64N/A
Applied egg-rr17.0%
Final simplification49.5%
(FPCore (k n)
:precision binary64
(let* ((t_0 (/ 2.0 (/ k (* PI n)))))
(if (<= k 1.8e+192)
(* (sqrt n) (sqrt (* 2.0 (/ PI k))))
(pow (* t_0 t_0) 0.25))))
double code(double k, double n) {
double t_0 = 2.0 / (k / (((double) M_PI) * n));
double tmp;
if (k <= 1.8e+192) {
tmp = sqrt(n) * sqrt((2.0 * (((double) M_PI) / k)));
} else {
tmp = pow((t_0 * t_0), 0.25);
}
return tmp;
}
public static double code(double k, double n) {
double t_0 = 2.0 / (k / (Math.PI * n));
double tmp;
if (k <= 1.8e+192) {
tmp = Math.sqrt(n) * Math.sqrt((2.0 * (Math.PI / k)));
} else {
tmp = Math.pow((t_0 * t_0), 0.25);
}
return tmp;
}
def code(k, n): t_0 = 2.0 / (k / (math.pi * n)) tmp = 0 if k <= 1.8e+192: tmp = math.sqrt(n) * math.sqrt((2.0 * (math.pi / k))) else: tmp = math.pow((t_0 * t_0), 0.25) return tmp
function code(k, n) t_0 = Float64(2.0 / Float64(k / Float64(pi * n))) tmp = 0.0 if (k <= 1.8e+192) tmp = Float64(sqrt(n) * sqrt(Float64(2.0 * Float64(pi / k)))); else tmp = Float64(t_0 * t_0) ^ 0.25; end return tmp end
function tmp_2 = code(k, n) t_0 = 2.0 / (k / (pi * n)); tmp = 0.0; if (k <= 1.8e+192) tmp = sqrt(n) * sqrt((2.0 * (pi / k))); else tmp = (t_0 * t_0) ^ 0.25; end tmp_2 = tmp; end
code[k_, n_] := Block[{t$95$0 = N[(2.0 / N[(k / N[(Pi * n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[k, 1.8e+192], N[(N[Sqrt[n], $MachinePrecision] * N[Sqrt[N[(2.0 * N[(Pi / k), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[Power[N[(t$95$0 * t$95$0), $MachinePrecision], 0.25], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{2}{\frac{k}{\pi \cdot n}}\\
\mathbf{if}\;k \leq 1.8 \cdot 10^{+192}:\\
\;\;\;\;\sqrt{n} \cdot \sqrt{2 \cdot \frac{\pi}{k}}\\
\mathbf{else}:\\
\;\;\;\;{\left(t\_0 \cdot t\_0\right)}^{0.25}\\
\end{array}
\end{array}
if k < 1.8000000000000001e192Initial program 99.4%
Taylor expanded in k around 0
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
sqrt-lowering-sqrt.f6439.1%
Simplified39.1%
sqrt-unprodN/A
associate-/l*N/A
associate-*l*N/A
sqrt-prodN/A
pow1/2N/A
*-lowering-*.f64N/A
pow1/2N/A
sqrt-lowering-sqrt.f64N/A
sqrt-lowering-sqrt.f64N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
PI-lowering-PI.f6456.6%
Applied egg-rr56.6%
if 1.8000000000000001e192 < k Initial program 100.0%
Taylor expanded in k around 0
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
sqrt-lowering-sqrt.f642.6%
Simplified2.6%
sqrt-unprodN/A
sqrt-lowering-sqrt.f64N/A
associate-*l/N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
/-lowering-/.f64N/A
*-commutativeN/A
associate-*r*N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
PI-lowering-PI.f642.6%
Applied egg-rr2.6%
pow1/2N/A
metadata-evalN/A
metadata-evalN/A
metadata-evalN/A
pow-prod-upN/A
pow-prod-downN/A
pow-lowering-pow.f64N/A
Applied egg-rr17.0%
Final simplification49.5%
(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}
Initial program 99.5%
Taylor expanded in k around 0
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f6499.6%
Simplified99.6%
*-commutativeN/A
sqrt-divN/A
metadata-evalN/A
un-div-invN/A
/-lowering-/.f64N/A
*-commutativeN/A
associate-*r*N/A
pow-lowering-pow.f64N/A
*-commutativeN/A
associate-*r*N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
div-subN/A
metadata-evalN/A
--lowering--.f64N/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f6499.6%
Applied egg-rr99.6%
(FPCore (k n)
:precision binary64
(let* ((t_0 (/ 2.0 (/ k (* PI n)))))
(if (<= k 1.9e+179)
(pow (/ k (* n (* 2.0 PI))) -0.5)
(pow (* t_0 t_0) 0.25))))
double code(double k, double n) {
double t_0 = 2.0 / (k / (((double) M_PI) * n));
double tmp;
if (k <= 1.9e+179) {
tmp = pow((k / (n * (2.0 * ((double) M_PI)))), -0.5);
} else {
tmp = pow((t_0 * t_0), 0.25);
}
return tmp;
}
public static double code(double k, double n) {
double t_0 = 2.0 / (k / (Math.PI * n));
double tmp;
if (k <= 1.9e+179) {
tmp = Math.pow((k / (n * (2.0 * Math.PI))), -0.5);
} else {
tmp = Math.pow((t_0 * t_0), 0.25);
}
return tmp;
}
def code(k, n): t_0 = 2.0 / (k / (math.pi * n)) tmp = 0 if k <= 1.9e+179: tmp = math.pow((k / (n * (2.0 * math.pi))), -0.5) else: tmp = math.pow((t_0 * t_0), 0.25) return tmp
function code(k, n) t_0 = Float64(2.0 / Float64(k / Float64(pi * n))) tmp = 0.0 if (k <= 1.9e+179) tmp = Float64(k / Float64(n * Float64(2.0 * pi))) ^ -0.5; else tmp = Float64(t_0 * t_0) ^ 0.25; end return tmp end
function tmp_2 = code(k, n) t_0 = 2.0 / (k / (pi * n)); tmp = 0.0; if (k <= 1.9e+179) tmp = (k / (n * (2.0 * pi))) ^ -0.5; else tmp = (t_0 * t_0) ^ 0.25; end tmp_2 = tmp; end
code[k_, n_] := Block[{t$95$0 = N[(2.0 / N[(k / N[(Pi * n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[k, 1.9e+179], N[Power[N[(k / N[(n * N[(2.0 * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision], N[Power[N[(t$95$0 * t$95$0), $MachinePrecision], 0.25], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{2}{\frac{k}{\pi \cdot n}}\\
\mathbf{if}\;k \leq 1.9 \cdot 10^{+179}:\\
\;\;\;\;{\left(\frac{k}{n \cdot \left(2 \cdot \pi\right)}\right)}^{-0.5}\\
\mathbf{else}:\\
\;\;\;\;{\left(t\_0 \cdot t\_0\right)}^{0.25}\\
\end{array}
\end{array}
if k < 1.9e179Initial program 99.4%
Taylor expanded in k around 0
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
sqrt-lowering-sqrt.f6440.6%
Simplified40.6%
sqrt-unprodN/A
sqrt-lowering-sqrt.f64N/A
associate-*l/N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
/-lowering-/.f64N/A
*-commutativeN/A
associate-*r*N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
PI-lowering-PI.f6440.7%
Applied egg-rr40.7%
pow1/2N/A
clear-numN/A
inv-powN/A
pow-powN/A
pow-lowering-pow.f64N/A
/-lowering-/.f64N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
metadata-eval42.0%
Applied egg-rr42.0%
if 1.9e179 < k Initial program 100.0%
Taylor expanded in k around 0
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
sqrt-lowering-sqrt.f642.5%
Simplified2.5%
sqrt-unprodN/A
sqrt-lowering-sqrt.f64N/A
associate-*l/N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
/-lowering-/.f64N/A
*-commutativeN/A
associate-*r*N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
PI-lowering-PI.f642.5%
Applied egg-rr2.5%
pow1/2N/A
metadata-evalN/A
metadata-evalN/A
metadata-evalN/A
pow-prod-upN/A
pow-prod-downN/A
pow-lowering-pow.f64N/A
Applied egg-rr14.8%
(FPCore (k n) :precision binary64 (pow (/ k (* n (* 2.0 PI))) -0.5))
double code(double k, double n) {
return pow((k / (n * (2.0 * ((double) M_PI)))), -0.5);
}
public static double code(double k, double n) {
return Math.pow((k / (n * (2.0 * Math.PI))), -0.5);
}
def code(k, n): return math.pow((k / (n * (2.0 * math.pi))), -0.5)
function code(k, n) return Float64(k / Float64(n * Float64(2.0 * pi))) ^ -0.5 end
function tmp = code(k, n) tmp = (k / (n * (2.0 * pi))) ^ -0.5; end
code[k_, n_] := N[Power[N[(k / N[(n * N[(2.0 * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]
\begin{array}{l}
\\
{\left(\frac{k}{n \cdot \left(2 \cdot \pi\right)}\right)}^{-0.5}
\end{array}
Initial program 99.5%
Taylor expanded in k around 0
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
sqrt-lowering-sqrt.f6432.6%
Simplified32.6%
sqrt-unprodN/A
sqrt-lowering-sqrt.f64N/A
associate-*l/N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
/-lowering-/.f64N/A
*-commutativeN/A
associate-*r*N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
PI-lowering-PI.f6432.7%
Applied egg-rr32.7%
pow1/2N/A
clear-numN/A
inv-powN/A
pow-powN/A
pow-lowering-pow.f64N/A
/-lowering-/.f64N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
metadata-eval33.7%
Applied egg-rr33.7%
(FPCore (k n) :precision binary64 (sqrt (* n (/ PI (/ k 2.0)))))
double code(double k, double n) {
return sqrt((n * (((double) M_PI) / (k / 2.0))));
}
public static double code(double k, double n) {
return Math.sqrt((n * (Math.PI / (k / 2.0))));
}
def code(k, n): return math.sqrt((n * (math.pi / (k / 2.0))))
function code(k, n) return sqrt(Float64(n * Float64(pi / Float64(k / 2.0)))) end
function tmp = code(k, n) tmp = sqrt((n * (pi / (k / 2.0)))); end
code[k_, n_] := N[Sqrt[N[(n * N[(Pi / N[(k / 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\sqrt{n \cdot \frac{\pi}{\frac{k}{2}}}
\end{array}
Initial program 99.5%
Taylor expanded in k around 0
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
sqrt-lowering-sqrt.f6432.6%
Simplified32.6%
sqrt-unprodN/A
sqrt-lowering-sqrt.f64N/A
associate-*l/N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
/-lowering-/.f64N/A
*-commutativeN/A
associate-*r*N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
PI-lowering-PI.f6432.7%
Applied egg-rr32.7%
clear-numN/A
associate-/r/N/A
*-commutativeN/A
associate-*r*N/A
associate-*l*N/A
associate-*l*N/A
*-commutativeN/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
associate-*l/N/A
metadata-evalN/A
/-lowering-/.f64N/A
PI-lowering-PI.f6432.6%
Applied egg-rr32.6%
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
PI-lowering-PI.f64N/A
/-lowering-/.f6432.7%
Applied egg-rr32.7%
Final simplification32.7%
(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}
Initial program 99.5%
Taylor expanded in k around 0
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
sqrt-lowering-sqrt.f6432.6%
Simplified32.6%
sqrt-unprodN/A
sqrt-lowering-sqrt.f64N/A
associate-*l/N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
/-lowering-/.f64N/A
*-commutativeN/A
associate-*r*N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
PI-lowering-PI.f6432.7%
Applied egg-rr32.7%
associate-*r*N/A
associate-/l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
/-lowering-/.f6432.6%
Applied egg-rr32.6%
(FPCore (k n) :precision binary64 (sqrt (* n (* PI (/ 2.0 k)))))
double code(double k, double n) {
return sqrt((n * (((double) M_PI) * (2.0 / k))));
}
public static double code(double k, double n) {
return Math.sqrt((n * (Math.PI * (2.0 / k))));
}
def code(k, n): return math.sqrt((n * (math.pi * (2.0 / k))))
function code(k, n) return sqrt(Float64(n * Float64(pi * Float64(2.0 / k)))) end
function tmp = code(k, n) tmp = sqrt((n * (pi * (2.0 / k)))); end
code[k_, n_] := N[Sqrt[N[(n * N[(Pi * N[(2.0 / k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\sqrt{n \cdot \left(\pi \cdot \frac{2}{k}\right)}
\end{array}
Initial program 99.5%
Taylor expanded in k around 0
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
sqrt-lowering-sqrt.f6432.6%
Simplified32.6%
sqrt-unprodN/A
sqrt-lowering-sqrt.f64N/A
associate-*l/N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
/-lowering-/.f64N/A
*-commutativeN/A
associate-*r*N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
PI-lowering-PI.f6432.7%
Applied egg-rr32.7%
clear-numN/A
associate-/r/N/A
*-commutativeN/A
associate-*r*N/A
associate-*l*N/A
associate-*l*N/A
*-commutativeN/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
associate-*l/N/A
metadata-evalN/A
/-lowering-/.f64N/A
PI-lowering-PI.f6432.6%
Applied egg-rr32.6%
Final simplification32.6%
herbie shell --seed 2024185
(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))))