
(FPCore (k n) :precision binary64 (* (/ 1.0 (sqrt k)) (pow (* (* 2.0 (PI)) n) (/ (- 1.0 k) 2.0))))
\begin{array}{l}
\\
\frac{1}{\sqrt{k}} \cdot {\left(\left(2 \cdot \mathsf{PI}\left(\right)\right) \cdot n\right)}^{\left(\frac{1 - k}{2}\right)}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 7 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (k n) :precision binary64 (* (/ 1.0 (sqrt k)) (pow (* (* 2.0 (PI)) n) (/ (- 1.0 k) 2.0))))
\begin{array}{l}
\\
\frac{1}{\sqrt{k}} \cdot {\left(\left(2 \cdot \mathsf{PI}\left(\right)\right) \cdot n\right)}^{\left(\frac{1 - k}{2}\right)}
\end{array}
(FPCore (k n) :precision binary64 (let* ((t_0 (* (* 2.0 (PI)) n))) (/ (sqrt t_0) (* (pow t_0 (* 0.5 k)) (sqrt k)))))
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(2 \cdot \mathsf{PI}\left(\right)\right) \cdot n\\
\frac{\sqrt{t\_0}}{{t\_0}^{\left(0.5 \cdot k\right)} \cdot \sqrt{k}}
\end{array}
\end{array}
Initial program 99.5%
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
un-div-invN/A
lift-pow.f64N/A
lift-/.f64N/A
lift--.f64N/A
div-subN/A
metadata-evalN/A
pow-subN/A
associate-/l/N/A
lower-/.f64N/A
Applied rewrites99.8%
lift-pow.f64N/A
lift-pow.f64N/A
pow-powN/A
*-commutativeN/A
lower-pow.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6499.8
Applied rewrites99.8%
Final simplification99.8%
(FPCore (k n) :precision binary64 (/ (pow (sqrt (* (* 2.0 (PI)) n)) (- 1.0 k)) (sqrt k)))
\begin{array}{l}
\\
\frac{{\left(\sqrt{\left(2 \cdot \mathsf{PI}\left(\right)\right) \cdot n}\right)}^{\left(1 - k\right)}}{\sqrt{k}}
\end{array}
Initial program 99.5%
lift-pow.f64N/A
rem-exp-logN/A
lift-/.f64N/A
frac-2negN/A
distribute-frac-negN/A
pow-negN/A
lower-/.f64N/A
rem-exp-logN/A
distribute-neg-frac2N/A
lift-/.f64N/A
lower-pow.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-/.f64N/A
clear-numN/A
associate-/r/N/A
metadata-evalN/A
Applied rewrites99.4%
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
div-invN/A
lower-/.f6499.4
Applied rewrites99.5%
(FPCore (k n) :precision binary64 (/ (pow (* (* 2.0 (PI)) n) (fma -0.5 k 0.5)) (sqrt k)))
\begin{array}{l}
\\
\frac{{\left(\left(2 \cdot \mathsf{PI}\left(\right)\right) \cdot n\right)}^{\left(\mathsf{fma}\left(-0.5, k, 0.5\right)\right)}}{\sqrt{k}}
\end{array}
Initial program 99.5%
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
un-div-invN/A
lift-pow.f64N/A
lift-/.f64N/A
lift--.f64N/A
div-subN/A
metadata-evalN/A
pow-subN/A
associate-/l/N/A
lower-/.f64N/A
Applied rewrites99.8%
lift-pow.f64N/A
lift-pow.f64N/A
pow-powN/A
*-commutativeN/A
lower-pow.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6499.8
Applied rewrites99.8%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/r*N/A
Applied rewrites99.5%
(FPCore (k n) :precision binary64 (/ (sqrt (* (* 2.0 (PI)) n)) (sqrt k)))
\begin{array}{l}
\\
\frac{\sqrt{\left(2 \cdot \mathsf{PI}\left(\right)\right) \cdot n}}{\sqrt{k}}
\end{array}
Initial program 99.5%
Taylor expanded in k around 0
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-PI.f6432.5
Applied rewrites32.5%
Applied rewrites44.9%
(FPCore (k n) :precision binary64 (* (sqrt (/ (* 2.0 (PI)) k)) (sqrt n)))
\begin{array}{l}
\\
\sqrt{\frac{2 \cdot \mathsf{PI}\left(\right)}{k}} \cdot \sqrt{n}
\end{array}
Initial program 99.5%
Taylor expanded in k around 0
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-PI.f6432.5
Applied rewrites32.5%
Applied rewrites44.9%
Final simplification44.9%
(FPCore (k n) :precision binary64 (sqrt (* (/ n k) (* 2.0 (PI)))))
\begin{array}{l}
\\
\sqrt{\frac{n}{k} \cdot \left(2 \cdot \mathsf{PI}\left(\right)\right)}
\end{array}
Initial program 99.5%
Taylor expanded in k around 0
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-PI.f6432.5
Applied rewrites32.5%
Applied rewrites32.5%
Applied rewrites32.5%
(FPCore (k n) :precision binary64 (sqrt (* (/ (PI) k) (* 2.0 n))))
\begin{array}{l}
\\
\sqrt{\frac{\mathsf{PI}\left(\right)}{k} \cdot \left(2 \cdot n\right)}
\end{array}
Initial program 99.5%
Taylor expanded in k around 0
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-PI.f6432.5
Applied rewrites32.5%
Applied rewrites32.5%
Applied rewrites32.5%
Final simplification32.5%
herbie shell --seed 2024256
(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))))