
(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 5 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 (/ 1.3333333333333333 (* (fma (* (- v) v) (PI) (PI)) (sqrt (fma -6.0 (* v v) 2.0)))))
\begin{array}{l}
\\
\frac{1.3333333333333333}{\mathsf{fma}\left(\left(-v\right) \cdot v, \mathsf{PI}\left(\right), \mathsf{PI}\left(\right)\right) \cdot \sqrt{\mathsf{fma}\left(-6, v \cdot v, 2\right)}}
\end{array}
Initial program 98.5%
Applied rewrites99.2%
Applied rewrites100.0%
lift-*.f64N/A
*-commutativeN/A
lift-fma.f64N/A
distribute-rgt-inN/A
*-lft-identityN/A
lower-fma.f64N/A
lower-*.f64100.0
Applied rewrites100.0%
(FPCore (v) :precision binary64 (/ -1.3333333333333333 (* (* (fma v v -1.0) (PI)) (sqrt (fma (* -6.0 v) v 2.0)))))
\begin{array}{l}
\\
\frac{-1.3333333333333333}{\left(\mathsf{fma}\left(v, v, -1\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{\mathsf{fma}\left(-6 \cdot v, v, 2\right)}}
\end{array}
Initial program 98.5%
Applied rewrites99.2%
Applied rewrites100.0%
Applied rewrites100.0%
(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.5%
Applied rewrites99.2%
Taylor expanded in v around 0
lower-PI.f6499.3
Applied rewrites99.3%
(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.5%
Applied rewrites99.2%
Taylor expanded in v around 0
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-PI.f6499.2
Applied rewrites99.2%
(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.5%
Taylor expanded in v around 0
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-PI.f6497.7
Applied rewrites97.7%
herbie shell --seed 2024333
(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)))))))