
(FPCore (v) :precision binary64 (/ 4.0 (* (* (* 3.0 (PI)) (- 1.0 (* v v))) (sqrt (- 2.0 (* 6.0 (* v v)))))))
\begin{array}{l}
\\
\frac{4}{\left(\left(3 \cdot \mathsf{PI}\left(\right)\right) \cdot \left(1 - v \cdot v\right)\right) \cdot \sqrt{2 - 6 \cdot \left(v \cdot v\right)}}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 7 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (v) :precision binary64 (/ 4.0 (* (* (* 3.0 (PI)) (- 1.0 (* v v))) (sqrt (- 2.0 (* 6.0 (* v v)))))))
\begin{array}{l}
\\
\frac{4}{\left(\left(3 \cdot \mathsf{PI}\left(\right)\right) \cdot \left(1 - v \cdot v\right)\right) \cdot \sqrt{2 - 6 \cdot \left(v \cdot v\right)}}
\end{array}
(FPCore (v) :precision binary64 (let* ((t_0 (sqrt (fma -6.0 (* v v) 2.0)))) (/ 4.0 (fma (* t_0 3.0) (PI) (* (* (* (* v v) (PI)) -3.0) t_0)))))
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{\mathsf{fma}\left(-6, v \cdot v, 2\right)}\\
\frac{4}{\mathsf{fma}\left(t\_0 \cdot 3, \mathsf{PI}\left(\right), \left(\left(\left(v \cdot v\right) \cdot \mathsf{PI}\left(\right)\right) \cdot -3\right) \cdot t\_0\right)}
\end{array}
\end{array}
Initial program 98.4%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
distribute-lft-inN/A
distribute-rgt-inN/A
*-rgt-identityN/A
*-commutativeN/A
lift-*.f64N/A
associate-*r*N/A
lower-fma.f64N/A
Applied rewrites100.0%
Taylor expanded in v around 0
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-PI.f64100.0
Applied rewrites100.0%
(FPCore (v) :precision binary64 (/ (/ 4.0 (* (fma -3.0 (* v v) 3.0) (PI))) (sqrt (fma -6.0 (* v v) 2.0))))
\begin{array}{l}
\\
\frac{\frac{4}{\mathsf{fma}\left(-3, v \cdot v, 3\right) \cdot \mathsf{PI}\left(\right)}}{\sqrt{\mathsf{fma}\left(-6, v \cdot v, 2\right)}}
\end{array}
Initial program 98.4%
Taylor expanded in v around 0
associate-*r*N/A
distribute-rgt-outN/A
lower-*.f64N/A
lower-PI.f64N/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6498.5
Applied rewrites98.5%
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
lift-sqrt.f64N/A
pow1/2N/A
lift--.f64N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
metadata-evalN/A
*-commutativeN/A
+-commutativeN/A
lift-fma.f64N/A
pow1/2N/A
lift-sqrt.f64N/A
Applied rewrites100.0%
(FPCore (v) :precision binary64 (/ 4.0 (* (sqrt (fma -6.0 (* v v) 2.0)) (* (fma -3.0 (* v v) 3.0) (PI)))))
\begin{array}{l}
\\
\frac{4}{\sqrt{\mathsf{fma}\left(-6, v \cdot v, 2\right)} \cdot \left(\mathsf{fma}\left(-3, v \cdot v, 3\right) \cdot \mathsf{PI}\left(\right)\right)}
\end{array}
Initial program 98.4%
Taylor expanded in v around 0
associate-*r*N/A
distribute-rgt-outN/A
lower-*.f64N/A
lower-PI.f64N/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6498.5
Applied rewrites98.5%
lift-*.f64N/A
*-commutativeN/A
lift-sqrt.f64N/A
pow1/2N/A
lift--.f64N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
metadata-evalN/A
*-commutativeN/A
+-commutativeN/A
lift-fma.f64N/A
pow1/2N/A
lift-sqrt.f64N/A
lower-*.f6498.5
Applied rewrites98.5%
(FPCore (v) :precision binary64 (/ (/ 4.0 (sqrt (fma (* v v) -6.0 2.0))) (* (PI) 3.0)))
\begin{array}{l}
\\
\frac{\frac{4}{\sqrt{\mathsf{fma}\left(v \cdot v, -6, 2\right)}}}{\mathsf{PI}\left(\right) \cdot 3}
\end{array}
Initial program 98.4%
Taylor expanded in v around 0
lower-*.f64N/A
lower-PI.f6496.7
Applied rewrites96.7%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift--.f64N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
metadata-evalN/A
+-commutativeN/A
lift-fma.f64N/A
associate-/r*N/A
lower-/.f64N/A
Applied rewrites98.2%
(FPCore (v) :precision binary64 (/ 1.3333333333333333 (* (PI) (sqrt (fma -6.0 (* v v) 2.0)))))
\begin{array}{l}
\\
\frac{1.3333333333333333}{\mathsf{PI}\left(\right) \cdot \sqrt{\mathsf{fma}\left(-6, v \cdot v, 2\right)}}
\end{array}
Initial program 98.4%
Applied rewrites98.2%
Taylor expanded in v around 0
lower-PI.f6498.2
Applied rewrites98.2%
(FPCore (v) :precision binary64 (/ 1.3333333333333333 (* (sqrt 2.0) (PI))))
\begin{array}{l}
\\
\frac{1.3333333333333333}{\sqrt{2} \cdot \mathsf{PI}\left(\right)}
\end{array}
Initial program 98.4%
Applied rewrites98.2%
Taylor expanded in v around 0
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-PI.f6498.1
Applied rewrites98.1%
(FPCore (v) :precision binary64 (* (/ (sqrt 0.5) (PI)) 1.3333333333333333))
\begin{array}{l}
\\
\frac{\sqrt{0.5}}{\mathsf{PI}\left(\right)} \cdot 1.3333333333333333
\end{array}
Initial program 98.4%
Taylor expanded in v around 0
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-PI.f6496.6
Applied rewrites96.6%
herbie shell --seed 2024361
(FPCore (v)
:name "Falkner and Boettcher, Equation (22+)"
:precision binary64
(/ 4.0 (* (* (* 3.0 (PI)) (- 1.0 (* v v))) (sqrt (- 2.0 (* 6.0 (* v v)))))))