
(FPCore (a b angle) :precision binary64 (let* ((t_0 (* (PI) (/ angle 180.0)))) (* (* (* 2.0 (- (pow b 2.0) (pow a 2.0))) (sin t_0)) (cos t_0))))
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \mathsf{PI}\left(\right) \cdot \frac{angle}{180}\\
\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin t\_0\right) \cdot \cos t\_0
\end{array}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 15 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (a b angle) :precision binary64 (let* ((t_0 (* (PI) (/ angle 180.0)))) (* (* (* 2.0 (- (pow b 2.0) (pow a 2.0))) (sin t_0)) (cos t_0))))
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \mathsf{PI}\left(\right) \cdot \frac{angle}{180}\\
\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin t\_0\right) \cdot \cos t\_0
\end{array}
\end{array}
b_m = (fabs.f64 b)
a_m = (fabs.f64 a)
(FPCore (a_m b_m angle)
:precision binary64
(let* ((t_0 (cbrt (PI))))
(if (<= b_m 4.9e+190)
(*
(* (+ a_m b_m) (* (- b_m a_m) (* (sin (* (/ angle 180.0) (PI))) 2.0)))
(cos (* (PI) (/ angle 180.0))))
(*
(+ a_m b_m)
(*
(- b_m a_m)
(sin (* 2.0 (* (pow t_0 2.0) (* t_0 (/ angle 180.0))))))))))\begin{array}{l}
b_m = \left|b\right|
\\
a_m = \left|a\right|
\\
\begin{array}{l}
t_0 := \sqrt[3]{\mathsf{PI}\left(\right)}\\
\mathbf{if}\;b\_m \leq 4.9 \cdot 10^{+190}:\\
\;\;\;\;\left(\left(a\_m + b\_m\right) \cdot \left(\left(b\_m - a\_m\right) \cdot \left(\sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right) \cdot 2\right)\right)\right) \cdot \cos \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(a\_m + b\_m\right) \cdot \left(\left(b\_m - a\_m\right) \cdot \sin \left(2 \cdot \left({t\_0}^{2} \cdot \left(t\_0 \cdot \frac{angle}{180}\right)\right)\right)\right)\\
\end{array}
\end{array}
if b < 4.8999999999999996e190Initial program 60.2%
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*l*N/A
lift--.f64N/A
lift-pow.f64N/A
unpow2N/A
lift-pow.f64N/A
unpow2N/A
difference-of-squaresN/A
associate-*l*N/A
lower-*.f64N/A
+-commutativeN/A
lower-+.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f6469.4
Applied rewrites69.4%
if 4.8999999999999996e190 < b Initial program 53.6%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
lift--.f64N/A
lift-pow.f64N/A
unpow2N/A
lift-pow.f64N/A
unpow2N/A
difference-of-squaresN/A
lift-sin.f64N/A
lift-cos.f64N/A
Applied rewrites85.6%
lift-*.f64N/A
*-commutativeN/A
lift-PI.f64N/A
add-cube-cbrtN/A
associate-*l*N/A
lower-*.f64N/A
pow2N/A
lower-pow.f64N/A
lift-PI.f64N/A
lower-cbrt.f64N/A
lower-*.f64N/A
lift-PI.f64N/A
lower-cbrt.f6489.9
Applied rewrites89.9%
b_m = (fabs.f64 b)
a_m = (fabs.f64 a)
(FPCore (a_m b_m angle)
:precision binary64
(let* ((t_0 (* (PI) angle)) (t_1 (* (PI) (/ angle 180.0))))
(if (<=
(* (* (* 2.0 (- (pow b_m 2.0) (pow a_m 2.0))) (sin t_1)) (cos t_1))
-4e-27)
(* (* t_0 (* -0.011111111111111112 a_m)) a_m)
(* (* t_0 -0.011111111111111112) (* a_m a_m)))))\begin{array}{l}
b_m = \left|b\right|
\\
a_m = \left|a\right|
\\
\begin{array}{l}
t_0 := \mathsf{PI}\left(\right) \cdot angle\\
t_1 := \mathsf{PI}\left(\right) \cdot \frac{angle}{180}\\
\mathbf{if}\;\left(\left(2 \cdot \left({b\_m}^{2} - {a\_m}^{2}\right)\right) \cdot \sin t\_1\right) \cdot \cos t\_1 \leq -4 \cdot 10^{-27}:\\
\;\;\;\;\left(t\_0 \cdot \left(-0.011111111111111112 \cdot a\_m\right)\right) \cdot a\_m\\
\mathbf{else}:\\
\;\;\;\;\left(t\_0 \cdot -0.011111111111111112\right) \cdot \left(a\_m \cdot a\_m\right)\\
\end{array}
\end{array}
if (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64)))) (sin.f64 (*.f64 (PI.f64) (/.f64 angle #s(literal 180 binary64))))) (cos.f64 (*.f64 (PI.f64) (/.f64 angle #s(literal 180 binary64))))) < -4.0000000000000002e-27Initial program 55.3%
Taylor expanded in angle around 0
associate-*r*N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f64N/A
unpow2N/A
unpow2N/A
difference-of-squaresN/A
lower-*.f64N/A
lower-+.f64N/A
lower--.f6447.8
Applied rewrites47.8%
Taylor expanded in a around inf
Applied rewrites21.7%
Applied rewrites27.2%
if -4.0000000000000002e-27 < (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64)))) (sin.f64 (*.f64 (PI.f64) (/.f64 angle #s(literal 180 binary64))))) (cos.f64 (*.f64 (PI.f64) (/.f64 angle #s(literal 180 binary64))))) Initial program 61.9%
Taylor expanded in angle around 0
associate-*r*N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f64N/A
unpow2N/A
unpow2N/A
difference-of-squaresN/A
lower-*.f64N/A
lower-+.f64N/A
lower--.f6462.4
Applied rewrites62.4%
Taylor expanded in a around inf
Applied rewrites42.9%
Applied rewrites42.9%
b_m = (fabs.f64 b)
a_m = (fabs.f64 a)
(FPCore (a_m b_m angle)
:precision binary64
(let* ((t_0 (* (PI) (/ angle 180.0))))
(if (<=
(* (* (* 2.0 (- (pow b_m 2.0) (pow a_m 2.0))) (sin t_0)) (cos t_0))
-1e-120)
(* (* -0.011111111111111112 a_m) (* (* a_m (PI)) angle))
(* (* (* (PI) angle) -0.011111111111111112) (* a_m a_m)))))\begin{array}{l}
b_m = \left|b\right|
\\
a_m = \left|a\right|
\\
\begin{array}{l}
t_0 := \mathsf{PI}\left(\right) \cdot \frac{angle}{180}\\
\mathbf{if}\;\left(\left(2 \cdot \left({b\_m}^{2} - {a\_m}^{2}\right)\right) \cdot \sin t\_0\right) \cdot \cos t\_0 \leq -1 \cdot 10^{-120}:\\
\;\;\;\;\left(-0.011111111111111112 \cdot a\_m\right) \cdot \left(\left(a\_m \cdot \mathsf{PI}\left(\right)\right) \cdot angle\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot -0.011111111111111112\right) \cdot \left(a\_m \cdot a\_m\right)\\
\end{array}
\end{array}
if (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64)))) (sin.f64 (*.f64 (PI.f64) (/.f64 angle #s(literal 180 binary64))))) (cos.f64 (*.f64 (PI.f64) (/.f64 angle #s(literal 180 binary64))))) < -9.99999999999999979e-121Initial program 55.9%
Taylor expanded in angle around 0
associate-*r*N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f64N/A
unpow2N/A
unpow2N/A
difference-of-squaresN/A
lower-*.f64N/A
lower-+.f64N/A
lower--.f6448.6
Applied rewrites48.6%
Taylor expanded in a around inf
Applied rewrites23.0%
Applied rewrites27.8%
Applied rewrites27.8%
if -9.99999999999999979e-121 < (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64)))) (sin.f64 (*.f64 (PI.f64) (/.f64 angle #s(literal 180 binary64))))) (cos.f64 (*.f64 (PI.f64) (/.f64 angle #s(literal 180 binary64))))) Initial program 61.9%
Taylor expanded in angle around 0
associate-*r*N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f64N/A
unpow2N/A
unpow2N/A
difference-of-squaresN/A
lower-*.f64N/A
lower-+.f64N/A
lower--.f6462.7
Applied rewrites62.7%
Taylor expanded in a around inf
Applied rewrites43.3%
Applied rewrites43.3%
b_m = (fabs.f64 b)
a_m = (fabs.f64 a)
(FPCore (a_m b_m angle)
:precision binary64
(let* ((t_0 (* (PI) (/ angle 180.0))))
(if (<=
(* (* (* 2.0 (- (pow b_m 2.0) (pow a_m 2.0))) (sin t_0)) (cos t_0))
-1e-120)
(* (* -0.011111111111111112 a_m) (* (* a_m (PI)) angle))
(* (* -0.011111111111111112 (* a_m a_m)) (* (PI) angle)))))\begin{array}{l}
b_m = \left|b\right|
\\
a_m = \left|a\right|
\\
\begin{array}{l}
t_0 := \mathsf{PI}\left(\right) \cdot \frac{angle}{180}\\
\mathbf{if}\;\left(\left(2 \cdot \left({b\_m}^{2} - {a\_m}^{2}\right)\right) \cdot \sin t\_0\right) \cdot \cos t\_0 \leq -1 \cdot 10^{-120}:\\
\;\;\;\;\left(-0.011111111111111112 \cdot a\_m\right) \cdot \left(\left(a\_m \cdot \mathsf{PI}\left(\right)\right) \cdot angle\right)\\
\mathbf{else}:\\
\;\;\;\;\left(-0.011111111111111112 \cdot \left(a\_m \cdot a\_m\right)\right) \cdot \left(\mathsf{PI}\left(\right) \cdot angle\right)\\
\end{array}
\end{array}
if (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64)))) (sin.f64 (*.f64 (PI.f64) (/.f64 angle #s(literal 180 binary64))))) (cos.f64 (*.f64 (PI.f64) (/.f64 angle #s(literal 180 binary64))))) < -9.99999999999999979e-121Initial program 55.9%
Taylor expanded in angle around 0
associate-*r*N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f64N/A
unpow2N/A
unpow2N/A
difference-of-squaresN/A
lower-*.f64N/A
lower-+.f64N/A
lower--.f6448.6
Applied rewrites48.6%
Taylor expanded in a around inf
Applied rewrites23.0%
Applied rewrites27.8%
Applied rewrites27.8%
if -9.99999999999999979e-121 < (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64)))) (sin.f64 (*.f64 (PI.f64) (/.f64 angle #s(literal 180 binary64))))) (cos.f64 (*.f64 (PI.f64) (/.f64 angle #s(literal 180 binary64))))) Initial program 61.9%
Taylor expanded in angle around 0
associate-*r*N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f64N/A
unpow2N/A
unpow2N/A
difference-of-squaresN/A
lower-*.f64N/A
lower-+.f64N/A
lower--.f6462.7
Applied rewrites62.7%
Taylor expanded in a around inf
Applied rewrites43.3%
b_m = (fabs.f64 b)
a_m = (fabs.f64 a)
(FPCore (a_m b_m angle)
:precision binary64
(let* ((t_0 (sin (* (* (PI) angle) 0.011111111111111112))))
(if (<= (* 2.0 (- (pow b_m 2.0) (pow a_m 2.0))) 2e-322)
(* (+ a_m b_m) (* (- a_m) t_0))
(* (+ a_m b_m) (* t_0 b_m)))))\begin{array}{l}
b_m = \left|b\right|
\\
a_m = \left|a\right|
\\
\begin{array}{l}
t_0 := \sin \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot 0.011111111111111112\right)\\
\mathbf{if}\;2 \cdot \left({b\_m}^{2} - {a\_m}^{2}\right) \leq 2 \cdot 10^{-322}:\\
\;\;\;\;\left(a\_m + b\_m\right) \cdot \left(\left(-a\_m\right) \cdot t\_0\right)\\
\mathbf{else}:\\
\;\;\;\;\left(a\_m + b\_m\right) \cdot \left(t\_0 \cdot b\_m\right)\\
\end{array}
\end{array}
if (*.f64 #s(literal 2 binary64) (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64)))) < 1.97626e-322Initial program 61.4%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
lift--.f64N/A
lift-pow.f64N/A
unpow2N/A
lift-pow.f64N/A
unpow2N/A
difference-of-squaresN/A
lift-sin.f64N/A
lift-cos.f64N/A
Applied rewrites70.0%
Taylor expanded in a around inf
associate-*r*N/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-PI.f6468.7
Applied rewrites68.7%
if 1.97626e-322 < (*.f64 #s(literal 2 binary64) (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64)))) Initial program 57.6%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
lift--.f64N/A
lift-pow.f64N/A
unpow2N/A
lift-pow.f64N/A
unpow2N/A
difference-of-squaresN/A
lift-sin.f64N/A
lift-cos.f64N/A
Applied rewrites71.5%
Taylor expanded in a around 0
*-commutativeN/A
lower-*.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-PI.f6471.3
Applied rewrites71.3%
b_m = (fabs.f64 b)
a_m = (fabs.f64 a)
(FPCore (a_m b_m angle)
:precision binary64
(let* ((t_0 (* (PI) angle)))
(if (<= (* 2.0 (- (pow b_m 2.0) (pow a_m 2.0))) -2e-214)
(fma
(* -0.011111111111111112 (* t_0 a_m))
a_m
(* (* (* (PI) (* b_m b_m)) angle) 0.011111111111111112))
(* (+ a_m b_m) (* (sin (* t_0 0.011111111111111112)) b_m)))))\begin{array}{l}
b_m = \left|b\right|
\\
a_m = \left|a\right|
\\
\begin{array}{l}
t_0 := \mathsf{PI}\left(\right) \cdot angle\\
\mathbf{if}\;2 \cdot \left({b\_m}^{2} - {a\_m}^{2}\right) \leq -2 \cdot 10^{-214}:\\
\;\;\;\;\mathsf{fma}\left(-0.011111111111111112 \cdot \left(t\_0 \cdot a\_m\right), a\_m, \left(\left(\mathsf{PI}\left(\right) \cdot \left(b\_m \cdot b\_m\right)\right) \cdot angle\right) \cdot 0.011111111111111112\right)\\
\mathbf{else}:\\
\;\;\;\;\left(a\_m + b\_m\right) \cdot \left(\sin \left(t\_0 \cdot 0.011111111111111112\right) \cdot b\_m\right)\\
\end{array}
\end{array}
if (*.f64 #s(literal 2 binary64) (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64)))) < -1.99999999999999983e-214Initial program 55.7%
Taylor expanded in angle around 0
associate-*r*N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f64N/A
unpow2N/A
unpow2N/A
difference-of-squaresN/A
lower-*.f64N/A
lower-+.f64N/A
lower--.f6449.9
Applied rewrites49.9%
Taylor expanded in a around 0
Applied rewrites60.6%
if -1.99999999999999983e-214 < (*.f64 #s(literal 2 binary64) (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64)))) Initial program 62.9%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
lift--.f64N/A
lift-pow.f64N/A
unpow2N/A
lift-pow.f64N/A
unpow2N/A
difference-of-squaresN/A
lift-sin.f64N/A
lift-cos.f64N/A
Applied rewrites74.2%
Taylor expanded in a around 0
*-commutativeN/A
lower-*.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-PI.f6473.9
Applied rewrites73.9%
Final simplification68.0%
b_m = (fabs.f64 b) a_m = (fabs.f64 a) (FPCore (a_m b_m angle) :precision binary64 (* (* (+ a_m b_m) (* (- b_m a_m) (* (sin (* (/ angle 180.0) (PI))) 2.0))) (cos (* (PI) (/ angle 180.0)))))
\begin{array}{l}
b_m = \left|b\right|
\\
a_m = \left|a\right|
\\
\left(\left(a\_m + b\_m\right) \cdot \left(\left(b\_m - a\_m\right) \cdot \left(\sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right) \cdot 2\right)\right)\right) \cdot \cos \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)
\end{array}
Initial program 59.7%
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*l*N/A
lift--.f64N/A
lift-pow.f64N/A
unpow2N/A
lift-pow.f64N/A
unpow2N/A
difference-of-squaresN/A
associate-*l*N/A
lower-*.f64N/A
+-commutativeN/A
lower-+.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f6470.7
Applied rewrites70.7%
b_m = (fabs.f64 b) a_m = (fabs.f64 a) (FPCore (a_m b_m angle) :precision binary64 (if (<= (* 2.0 (- (pow b_m 2.0) (pow a_m 2.0))) -1e+241) (* (* (* (PI) angle) (* -0.011111111111111112 a_m)) a_m) (* angle (* 0.011111111111111112 (* (* (PI) (- b_m a_m)) (+ b_m a_m))))))
\begin{array}{l}
b_m = \left|b\right|
\\
a_m = \left|a\right|
\\
\begin{array}{l}
\mathbf{if}\;2 \cdot \left({b\_m}^{2} - {a\_m}^{2}\right) \leq -1 \cdot 10^{+241}:\\
\;\;\;\;\left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot \left(-0.011111111111111112 \cdot a\_m\right)\right) \cdot a\_m\\
\mathbf{else}:\\
\;\;\;\;angle \cdot \left(0.011111111111111112 \cdot \left(\left(\mathsf{PI}\left(\right) \cdot \left(b\_m - a\_m\right)\right) \cdot \left(b\_m + a\_m\right)\right)\right)\\
\end{array}
\end{array}
if (*.f64 #s(literal 2 binary64) (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64)))) < -1.0000000000000001e241Initial program 55.3%
Taylor expanded in angle around 0
associate-*r*N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f64N/A
unpow2N/A
unpow2N/A
difference-of-squaresN/A
lower-*.f64N/A
lower-+.f64N/A
lower--.f6449.4
Applied rewrites49.4%
Taylor expanded in a around inf
Applied rewrites49.5%
Applied rewrites68.8%
if -1.0000000000000001e241 < (*.f64 #s(literal 2 binary64) (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64)))) Initial program 61.1%
Taylor expanded in angle around 0
associate-*r*N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f64N/A
unpow2N/A
unpow2N/A
difference-of-squaresN/A
lower-*.f64N/A
lower-+.f64N/A
lower--.f6460.0
Applied rewrites60.0%
Applied rewrites60.5%
b_m = (fabs.f64 b) a_m = (fabs.f64 a) (FPCore (a_m b_m angle) :precision binary64 (if (<= (* 2.0 (- (pow b_m 2.0) (pow a_m 2.0))) -2e-214) (* (* (* (* (PI) angle) a_m) a_m) -0.011111111111111112) (* (* (* (PI) (* b_m b_m)) angle) 0.011111111111111112)))
\begin{array}{l}
b_m = \left|b\right|
\\
a_m = \left|a\right|
\\
\begin{array}{l}
\mathbf{if}\;2 \cdot \left({b\_m}^{2} - {a\_m}^{2}\right) \leq -2 \cdot 10^{-214}:\\
\;\;\;\;\left(\left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot a\_m\right) \cdot a\_m\right) \cdot -0.011111111111111112\\
\mathbf{else}:\\
\;\;\;\;\left(\left(\mathsf{PI}\left(\right) \cdot \left(b\_m \cdot b\_m\right)\right) \cdot angle\right) \cdot 0.011111111111111112\\
\end{array}
\end{array}
if (*.f64 #s(literal 2 binary64) (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64)))) < -1.99999999999999983e-214Initial program 55.7%
Taylor expanded in angle around 0
associate-*r*N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f64N/A
unpow2N/A
unpow2N/A
difference-of-squaresN/A
lower-*.f64N/A
lower-+.f64N/A
lower--.f6449.9
Applied rewrites49.9%
Taylor expanded in a around inf
Applied rewrites49.6%
Applied rewrites60.2%
Applied rewrites60.3%
if -1.99999999999999983e-214 < (*.f64 #s(literal 2 binary64) (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64)))) Initial program 62.9%
Taylor expanded in angle around 0
associate-*r*N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f64N/A
unpow2N/A
unpow2N/A
difference-of-squaresN/A
lower-*.f64N/A
lower-+.f64N/A
lower--.f6463.5
Applied rewrites63.5%
Taylor expanded in a around 0
Applied rewrites62.9%
b_m = (fabs.f64 b) a_m = (fabs.f64 a) (FPCore (a_m b_m angle) :precision binary64 (if (<= (* 2.0 (- (pow b_m 2.0) (pow a_m 2.0))) -2e-214) (* (* (* (PI) angle) (* -0.011111111111111112 a_m)) a_m) (* (* (* (PI) (* b_m b_m)) angle) 0.011111111111111112)))
\begin{array}{l}
b_m = \left|b\right|
\\
a_m = \left|a\right|
\\
\begin{array}{l}
\mathbf{if}\;2 \cdot \left({b\_m}^{2} - {a\_m}^{2}\right) \leq -2 \cdot 10^{-214}:\\
\;\;\;\;\left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot \left(-0.011111111111111112 \cdot a\_m\right)\right) \cdot a\_m\\
\mathbf{else}:\\
\;\;\;\;\left(\left(\mathsf{PI}\left(\right) \cdot \left(b\_m \cdot b\_m\right)\right) \cdot angle\right) \cdot 0.011111111111111112\\
\end{array}
\end{array}
if (*.f64 #s(literal 2 binary64) (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64)))) < -1.99999999999999983e-214Initial program 55.7%
Taylor expanded in angle around 0
associate-*r*N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f64N/A
unpow2N/A
unpow2N/A
difference-of-squaresN/A
lower-*.f64N/A
lower-+.f64N/A
lower--.f6449.9
Applied rewrites49.9%
Taylor expanded in a around inf
Applied rewrites49.6%
Applied rewrites60.2%
if -1.99999999999999983e-214 < (*.f64 #s(literal 2 binary64) (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64)))) Initial program 62.9%
Taylor expanded in angle around 0
associate-*r*N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f64N/A
unpow2N/A
unpow2N/A
difference-of-squaresN/A
lower-*.f64N/A
lower-+.f64N/A
lower--.f6463.5
Applied rewrites63.5%
Taylor expanded in a around 0
Applied rewrites62.9%
b_m = (fabs.f64 b) a_m = (fabs.f64 a) (FPCore (a_m b_m angle) :precision binary64 (* (+ a_m b_m) (* (- b_m a_m) (sin (* (/ angle 180.0) (+ (PI) (PI)))))))
\begin{array}{l}
b_m = \left|b\right|
\\
a_m = \left|a\right|
\\
\left(a\_m + b\_m\right) \cdot \left(\left(b\_m - a\_m\right) \cdot \sin \left(\frac{angle}{180} \cdot \left(\mathsf{PI}\left(\right) + \mathsf{PI}\left(\right)\right)\right)\right)
\end{array}
Initial program 59.7%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
lift--.f64N/A
lift-pow.f64N/A
unpow2N/A
lift-pow.f64N/A
unpow2N/A
difference-of-squaresN/A
lift-sin.f64N/A
lift-cos.f64N/A
Applied rewrites70.7%
lift-*.f64N/A
count-2-revN/A
lift-*.f64N/A
lift-*.f64N/A
distribute-lft-outN/A
lower-*.f64N/A
lower-+.f6470.7
Applied rewrites70.7%
b_m = (fabs.f64 b) a_m = (fabs.f64 a) (FPCore (a_m b_m angle) :precision binary64 (if (<= angle 1.08e+164) (* (+ b_m a_m) (* (- b_m a_m) (* (* 0.011111111111111112 angle) (PI)))) (* (* (- a_m) a_m) (sin (* (* (PI) angle) 0.011111111111111112)))))
\begin{array}{l}
b_m = \left|b\right|
\\
a_m = \left|a\right|
\\
\begin{array}{l}
\mathbf{if}\;angle \leq 1.08 \cdot 10^{+164}:\\
\;\;\;\;\left(b\_m + a\_m\right) \cdot \left(\left(b\_m - a\_m\right) \cdot \left(\left(0.011111111111111112 \cdot angle\right) \cdot \mathsf{PI}\left(\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(-a\_m\right) \cdot a\_m\right) \cdot \sin \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot 0.011111111111111112\right)\\
\end{array}
\end{array}
if angle < 1.08e164Initial program 62.3%
Taylor expanded in angle around 0
associate-*r*N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f64N/A
unpow2N/A
unpow2N/A
difference-of-squaresN/A
lower-*.f64N/A
lower-+.f64N/A
lower--.f6461.6
Applied rewrites61.6%
Applied rewrites69.6%
if 1.08e164 < angle Initial program 43.8%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
lift--.f64N/A
lift-pow.f64N/A
unpow2N/A
lift-pow.f64N/A
unpow2N/A
difference-of-squaresN/A
lift-sin.f64N/A
lift-cos.f64N/A
Applied rewrites43.8%
Taylor expanded in a around inf
associate-*r*N/A
lower-*.f64N/A
mul-1-negN/A
unpow2N/A
distribute-lft-neg-inN/A
mul-1-negN/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-PI.f6426.4
Applied rewrites26.4%
b_m = (fabs.f64 b) a_m = (fabs.f64 a) (FPCore (a_m b_m angle) :precision binary64 (* (+ a_m b_m) (* (- b_m a_m) (sin (* (* (PI) angle) 0.011111111111111112)))))
\begin{array}{l}
b_m = \left|b\right|
\\
a_m = \left|a\right|
\\
\left(a\_m + b\_m\right) \cdot \left(\left(b\_m - a\_m\right) \cdot \sin \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot 0.011111111111111112\right)\right)
\end{array}
Initial program 59.7%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
lift--.f64N/A
lift-pow.f64N/A
unpow2N/A
lift-pow.f64N/A
unpow2N/A
difference-of-squaresN/A
lift-sin.f64N/A
lift-cos.f64N/A
Applied rewrites70.7%
Taylor expanded in angle around 0
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-PI.f6470.3
Applied rewrites70.3%
b_m = (fabs.f64 b) a_m = (fabs.f64 a) (FPCore (a_m b_m angle) :precision binary64 (if (<= angle 3.5e-5) (* (+ b_m a_m) (* (- b_m a_m) (* (* 0.011111111111111112 angle) (PI)))) (* angle (* 0.011111111111111112 (* (* (PI) (- b_m a_m)) (+ b_m a_m))))))
\begin{array}{l}
b_m = \left|b\right|
\\
a_m = \left|a\right|
\\
\begin{array}{l}
\mathbf{if}\;angle \leq 3.5 \cdot 10^{-5}:\\
\;\;\;\;\left(b\_m + a\_m\right) \cdot \left(\left(b\_m - a\_m\right) \cdot \left(\left(0.011111111111111112 \cdot angle\right) \cdot \mathsf{PI}\left(\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;angle \cdot \left(0.011111111111111112 \cdot \left(\left(\mathsf{PI}\left(\right) \cdot \left(b\_m - a\_m\right)\right) \cdot \left(b\_m + a\_m\right)\right)\right)\\
\end{array}
\end{array}
if angle < 3.4999999999999997e-5Initial program 70.4%
Taylor expanded in angle around 0
associate-*r*N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f64N/A
unpow2N/A
unpow2N/A
difference-of-squaresN/A
lower-*.f64N/A
lower-+.f64N/A
lower--.f6468.5
Applied rewrites68.5%
Applied rewrites79.0%
if 3.4999999999999997e-5 < angle Initial program 36.1%
Taylor expanded in angle around 0
associate-*r*N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f64N/A
unpow2N/A
unpow2N/A
difference-of-squaresN/A
lower-*.f64N/A
lower-+.f64N/A
lower--.f6433.1
Applied rewrites33.1%
Applied rewrites34.3%
b_m = (fabs.f64 b) a_m = (fabs.f64 a) (FPCore (a_m b_m angle) :precision binary64 (* (* -0.011111111111111112 a_m) (* a_m (* (PI) angle))))
\begin{array}{l}
b_m = \left|b\right|
\\
a_m = \left|a\right|
\\
\left(-0.011111111111111112 \cdot a\_m\right) \cdot \left(a\_m \cdot \left(\mathsf{PI}\left(\right) \cdot angle\right)\right)
\end{array}
Initial program 59.7%
Taylor expanded in angle around 0
associate-*r*N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f64N/A
unpow2N/A
unpow2N/A
difference-of-squaresN/A
lower-*.f64N/A
lower-+.f64N/A
lower--.f6457.4
Applied rewrites57.4%
Taylor expanded in a around inf
Applied rewrites35.7%
Applied rewrites37.8%
herbie shell --seed 2024358
(FPCore (a b angle)
:name "ab-angle->ABCF B"
:precision binary64
(* (* (* 2.0 (- (pow b 2.0) (pow a 2.0))) (sin (* (PI) (/ angle 180.0)))) (cos (* (PI) (/ angle 180.0)))))