
(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 12 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)
(FPCore (a b_m angle)
:precision binary64
(let* ((t_0 (* (- b_m a) (PI))) (t_1 (cos (* (PI) (/ angle 180.0)))))
(if (<= b_m 2.15e+139)
(* (+ a b_m) (* (- b_m a) (sin (* (* angle (PI)) 0.011111111111111112))))
(if (<= b_m 4.2e+226)
(* (* (+ a b_m) (* (* t_0 angle) 0.011111111111111112)) t_1)
(*
(*
(+ a b_m)
(*
(fma
(* -5.7155921353452215e-8 (* angle angle))
(* (pow (PI) 3.0) (- b_m a))
(* t_0 0.011111111111111112))
angle))
t_1)))))\begin{array}{l}
b_m = \left|b\right|
\\
\begin{array}{l}
t_0 := \left(b\_m - a\right) \cdot \mathsf{PI}\left(\right)\\
t_1 := \cos \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\\
\mathbf{if}\;b\_m \leq 2.15 \cdot 10^{+139}:\\
\;\;\;\;\left(a + b\_m\right) \cdot \left(\left(b\_m - a\right) \cdot \sin \left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot 0.011111111111111112\right)\right)\\
\mathbf{elif}\;b\_m \leq 4.2 \cdot 10^{+226}:\\
\;\;\;\;\left(\left(a + b\_m\right) \cdot \left(\left(t\_0 \cdot angle\right) \cdot 0.011111111111111112\right)\right) \cdot t\_1\\
\mathbf{else}:\\
\;\;\;\;\left(\left(a + b\_m\right) \cdot \left(\mathsf{fma}\left(-5.7155921353452215 \cdot 10^{-8} \cdot \left(angle \cdot angle\right), {\mathsf{PI}\left(\right)}^{3} \cdot \left(b\_m - a\right), t\_0 \cdot 0.011111111111111112\right) \cdot angle\right)\right) \cdot t\_1\\
\end{array}
\end{array}
if b < 2.1499999999999999e139Initial program 59.4%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/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
Applied rewrites71.3%
if 2.1499999999999999e139 < b < 4.19999999999999986e226Initial program 55.9%
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-*.f6479.8
Applied rewrites74.8%
Taylor expanded in angle around 0
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
lower-PI.f6489.8
Applied rewrites89.8%
if 4.19999999999999986e226 < b Initial program 50.5%
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-*.f6480.8
Applied rewrites88.5%
Taylor expanded in angle around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites96.2%
b_m = (fabs.f64 b)
(FPCore (a b_m angle)
:precision binary64
(let* ((t_0 (cbrt (pow (PI) 1.5))))
(*
(*
(+ a b_m)
(* (- b_m a) (* (sin (* (* 0.005555555555555556 angle) (PI))) 2.0)))
(cos (* (* t_0 t_0) (/ angle 180.0))))))\begin{array}{l}
b_m = \left|b\right|
\\
\begin{array}{l}
t_0 := \sqrt[3]{{\mathsf{PI}\left(\right)}^{1.5}}\\
\left(\left(a + b\_m\right) \cdot \left(\left(b\_m - a\right) \cdot \left(\sin \left(\left(0.005555555555555556 \cdot angle\right) \cdot \mathsf{PI}\left(\right)\right) \cdot 2\right)\right)\right) \cdot \cos \left(\left(t\_0 \cdot t\_0\right) \cdot \frac{angle}{180}\right)
\end{array}
\end{array}
Initial program 58.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-*.f6474.6
Applied rewrites73.4%
lift-PI.f64N/A
add-cbrt-cubeN/A
lift-PI.f64N/A
lift-PI.f64N/A
add-sqr-sqrtN/A
unswap-sqrN/A
cbrt-prodN/A
lower-*.f64N/A
lower-cbrt.f64N/A
unpow1N/A
lift-PI.f64N/A
pow1/2N/A
pow-prod-upN/A
metadata-evalN/A
metadata-evalN/A
lower-pow.f64N/A
metadata-evalN/A
lower-cbrt.f64N/A
unpow1N/A
lift-PI.f64N/A
Applied rewrites76.4%
b_m = (fabs.f64 b)
(FPCore (a b_m angle)
:precision binary64
(let* ((t_0 (- (pow b_m 2.0) (pow a 2.0))))
(if (or (<= t_0 -2e-244) (not (<= t_0 INFINITY)))
(* (* -0.011111111111111112 a) (* a (* (PI) angle)))
(* (* (* (PI) (* b_m b_m)) angle) 0.011111111111111112))))\begin{array}{l}
b_m = \left|b\right|
\\
\begin{array}{l}
t_0 := {b\_m}^{2} - {a}^{2}\\
\mathbf{if}\;t\_0 \leq -2 \cdot 10^{-244} \lor \neg \left(t\_0 \leq \infty\right):\\
\;\;\;\;\left(-0.011111111111111112 \cdot a\right) \cdot \left(a \cdot \left(\mathsf{PI}\left(\right) \cdot angle\right)\right)\\
\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 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) < -1.9999999999999999e-244 or +inf.0 < (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) Initial program 48.5%
Taylor expanded in angle around 0
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
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--.f6454.8
Applied rewrites54.8%
Taylor expanded in a around inf
Applied rewrites54.0%
Applied rewrites66.5%
if -1.9999999999999999e-244 < (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) < +inf.0Initial program 68.6%
Taylor expanded in angle around 0
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
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.9
Applied rewrites62.9%
Taylor expanded in a around 0
Applied rewrites63.0%
Final simplification64.8%
b_m = (fabs.f64 b)
(FPCore (a b_m angle)
:precision binary64
(let* ((t_0 (cos (* (PI) (/ angle 180.0)))))
(if (<= b_m 2.15e+139)
(* (+ a b_m) (* (- b_m a) (sin (* (* angle (PI)) 0.011111111111111112))))
(if (<= b_m 5e+226)
(*
(* (+ a b_m) (* (* (* (- b_m a) (PI)) angle) 0.011111111111111112))
t_0)
(*
(*
(*
(* (+ b_m a) (- b_m a))
(fma
(* -5.7155921353452215e-8 (* angle angle))
(pow (PI) 3.0)
(* 0.011111111111111112 (PI))))
angle)
t_0)))))\begin{array}{l}
b_m = \left|b\right|
\\
\begin{array}{l}
t_0 := \cos \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\\
\mathbf{if}\;b\_m \leq 2.15 \cdot 10^{+139}:\\
\;\;\;\;\left(a + b\_m\right) \cdot \left(\left(b\_m - a\right) \cdot \sin \left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot 0.011111111111111112\right)\right)\\
\mathbf{elif}\;b\_m \leq 5 \cdot 10^{+226}:\\
\;\;\;\;\left(\left(a + b\_m\right) \cdot \left(\left(\left(\left(b\_m - a\right) \cdot \mathsf{PI}\left(\right)\right) \cdot angle\right) \cdot 0.011111111111111112\right)\right) \cdot t\_0\\
\mathbf{else}:\\
\;\;\;\;\left(\left(\left(\left(b\_m + a\right) \cdot \left(b\_m - a\right)\right) \cdot \mathsf{fma}\left(-5.7155921353452215 \cdot 10^{-8} \cdot \left(angle \cdot angle\right), {\mathsf{PI}\left(\right)}^{3}, 0.011111111111111112 \cdot \mathsf{PI}\left(\right)\right)\right) \cdot angle\right) \cdot t\_0\\
\end{array}
\end{array}
if b < 2.1499999999999999e139Initial program 59.4%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/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
Applied rewrites71.3%
if 2.1499999999999999e139 < b < 5.0000000000000005e226Initial program 55.9%
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-*.f6479.8
Applied rewrites74.8%
Taylor expanded in angle around 0
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
lower-PI.f6489.8
Applied rewrites89.8%
if 5.0000000000000005e226 < b Initial program 50.5%
Taylor expanded in angle around 0
*-commutativeN/A
+-commutativeN/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites89.0%
b_m = (fabs.f64 b)
(FPCore (a b_m angle)
:precision binary64
(let* ((t_0 (* (* (PI) angle) 0.005555555555555556)))
(if (<= (/ angle 180.0) 1.5e+237)
(* (+ a b_m) (* (- b_m a) (sin (* (* angle (PI)) 0.011111111111111112))))
(* (* (- b_m a) (+ b_m a)) (* (cos t_0) (* t_0 2.0))))))\begin{array}{l}
b_m = \left|b\right|
\\
\begin{array}{l}
t_0 := \left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot 0.005555555555555556\\
\mathbf{if}\;\frac{angle}{180} \leq 1.5 \cdot 10^{+237}:\\
\;\;\;\;\left(a + b\_m\right) \cdot \left(\left(b\_m - a\right) \cdot \sin \left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot 0.011111111111111112\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(b\_m - a\right) \cdot \left(b\_m + a\right)\right) \cdot \left(\cos t\_0 \cdot \left(t\_0 \cdot 2\right)\right)\\
\end{array}
\end{array}
if (/.f64 angle #s(literal 180 binary64)) < 1.5e237Initial program 59.4%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/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
Applied rewrites75.3%
if 1.5e237 < (/.f64 angle #s(literal 180 binary64)) Initial program 37.6%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*r*N/A
associate-*r*N/A
lower-*.f64N/A
Applied rewrites46.6%
Taylor expanded in angle around 0
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-PI.f6451.0
Applied rewrites51.0%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lift-+.f64N/A
+-commutativeN/A
lift--.f64N/A
difference-of-squaresN/A
lift-*.f64N/A
lift-*.f64N/A
lower-*.f64N/A
Applied rewrites65.3%
b_m = (fabs.f64 b)
(FPCore (a b_m angle)
:precision binary64
(let* ((t_0 (* (- b_m a) (+ a b_m))))
(if (<= (/ angle 180.0) 1e-19)
(* (+ b_m a) (* (- b_m a) (* (* 0.011111111111111112 (PI)) angle)))
(if (<= (/ angle 180.0) 1.5e+237)
(* t_0 (sin (* (* angle (PI)) 0.011111111111111112)))
(*
(*
(fma (* -1.54320987654321e-5 (* angle angle)) (* (PI) (PI)) 1.0)
(* (* (* (PI) angle) 0.005555555555555556) 2.0))
t_0)))))\begin{array}{l}
b_m = \left|b\right|
\\
\begin{array}{l}
t_0 := \left(b\_m - a\right) \cdot \left(a + b\_m\right)\\
\mathbf{if}\;\frac{angle}{180} \leq 10^{-19}:\\
\;\;\;\;\left(b\_m + a\right) \cdot \left(\left(b\_m - a\right) \cdot \left(\left(0.011111111111111112 \cdot \mathsf{PI}\left(\right)\right) \cdot angle\right)\right)\\
\mathbf{elif}\;\frac{angle}{180} \leq 1.5 \cdot 10^{+237}:\\
\;\;\;\;t\_0 \cdot \sin \left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot 0.011111111111111112\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\mathsf{fma}\left(-1.54320987654321 \cdot 10^{-5} \cdot \left(angle \cdot angle\right), \mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right), 1\right) \cdot \left(\left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot 0.005555555555555556\right) \cdot 2\right)\right) \cdot t\_0\\
\end{array}
\end{array}
if (/.f64 angle #s(literal 180 binary64)) < 9.9999999999999998e-20Initial program 63.1%
Taylor expanded in angle around 0
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
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--.f6465.9
Applied rewrites65.9%
Applied rewrites77.4%
if 9.9999999999999998e-20 < (/.f64 angle #s(literal 180 binary64)) < 1.5e237Initial program 37.2%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
*-commutativeN/A
associate-*l*N/A
lower-*.f64N/A
lift--.f64N/A
lift-pow.f64N/A
unpow2N/A
lift-pow.f64N/A
unpow2N/A
difference-of-squaresN/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
+-commutativeN/A
lower-+.f64N/A
Applied rewrites45.5%
if 1.5e237 < (/.f64 angle #s(literal 180 binary64)) Initial program 37.6%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*r*N/A
associate-*r*N/A
lower-*.f64N/A
Applied rewrites46.6%
Taylor expanded in angle around 0
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-PI.f6451.0
Applied rewrites51.0%
Taylor expanded in angle around 0
+-commutativeN/A
associate-*r*N/A
lower-fma.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-PI.f64N/A
lower-PI.f6450.7
Applied rewrites50.7%
b_m = (fabs.f64 b)
(FPCore (a b_m angle)
:precision binary64
(if (<= (/ angle 180.0) 1.5e+237)
(* (+ a b_m) (* (- b_m a) (sin (* (* angle (PI)) 0.011111111111111112))))
(*
(*
(fma (* -1.54320987654321e-5 (* angle angle)) (* (PI) (PI)) 1.0)
(* (* (* (PI) angle) 0.005555555555555556) 2.0))
(* (- b_m a) (+ a b_m)))))\begin{array}{l}
b_m = \left|b\right|
\\
\begin{array}{l}
\mathbf{if}\;\frac{angle}{180} \leq 1.5 \cdot 10^{+237}:\\
\;\;\;\;\left(a + b\_m\right) \cdot \left(\left(b\_m - a\right) \cdot \sin \left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot 0.011111111111111112\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\mathsf{fma}\left(-1.54320987654321 \cdot 10^{-5} \cdot \left(angle \cdot angle\right), \mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right), 1\right) \cdot \left(\left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot 0.005555555555555556\right) \cdot 2\right)\right) \cdot \left(\left(b\_m - a\right) \cdot \left(a + b\_m\right)\right)\\
\end{array}
\end{array}
if (/.f64 angle #s(literal 180 binary64)) < 1.5e237Initial program 59.4%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/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
Applied rewrites75.3%
if 1.5e237 < (/.f64 angle #s(literal 180 binary64)) Initial program 37.6%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*r*N/A
associate-*r*N/A
lower-*.f64N/A
Applied rewrites46.6%
Taylor expanded in angle around 0
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-PI.f6451.0
Applied rewrites51.0%
Taylor expanded in angle around 0
+-commutativeN/A
associate-*r*N/A
lower-fma.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-PI.f64N/A
lower-PI.f6450.7
Applied rewrites50.7%
b_m = (fabs.f64 b) (FPCore (a b_m angle) :precision binary64 (if (<= (pow a 2.0) 5e+282) (* (* (* (- b_m a) (+ b_m a)) angle) (* 0.011111111111111112 (PI))) (* (* a (PI)) (* angle (* -0.011111111111111112 a)))))
\begin{array}{l}
b_m = \left|b\right|
\\
\begin{array}{l}
\mathbf{if}\;{a}^{2} \leq 5 \cdot 10^{+282}:\\
\;\;\;\;\left(\left(\left(b\_m - a\right) \cdot \left(b\_m + a\right)\right) \cdot angle\right) \cdot \left(0.011111111111111112 \cdot \mathsf{PI}\left(\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(a \cdot \mathsf{PI}\left(\right)\right) \cdot \left(angle \cdot \left(-0.011111111111111112 \cdot a\right)\right)\\
\end{array}
\end{array}
if (pow.f64 a #s(literal 2 binary64)) < 4.99999999999999978e282Initial program 65.0%
Taylor expanded in angle around 0
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
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.4
Applied rewrites60.4%
Applied rewrites60.4%
if 4.99999999999999978e282 < (pow.f64 a #s(literal 2 binary64)) Initial program 45.6%
Taylor expanded in angle around 0
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
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--.f6455.5
Applied rewrites55.5%
Taylor expanded in a around inf
Applied rewrites55.6%
Applied rewrites74.2%
Applied rewrites74.2%
b_m = (fabs.f64 b) (FPCore (a b_m angle) :precision binary64 (if (<= (pow a 2.0) 1e+283) (* (* angle (* 0.011111111111111112 (PI))) (* (+ b_m a) (- b_m a))) (* (* a (PI)) (* angle (* -0.011111111111111112 a)))))
\begin{array}{l}
b_m = \left|b\right|
\\
\begin{array}{l}
\mathbf{if}\;{a}^{2} \leq 10^{+283}:\\
\;\;\;\;\left(angle \cdot \left(0.011111111111111112 \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left(\left(b\_m + a\right) \cdot \left(b\_m - a\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(a \cdot \mathsf{PI}\left(\right)\right) \cdot \left(angle \cdot \left(-0.011111111111111112 \cdot a\right)\right)\\
\end{array}
\end{array}
if (pow.f64 a #s(literal 2 binary64)) < 9.99999999999999955e282Initial program 65.2%
Taylor expanded in angle around 0
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
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.6
Applied rewrites60.6%
if 9.99999999999999955e282 < (pow.f64 a #s(literal 2 binary64)) Initial program 45.0%
Taylor expanded in angle around 0
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
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--.f6455.0
Applied rewrites55.0%
Taylor expanded in a around inf
Applied rewrites55.1%
Applied rewrites73.9%
Applied rewrites73.9%
b_m = (fabs.f64 b) (FPCore (a b_m angle) :precision binary64 (if (<= (pow a 2.0) 1e+283) (* (* 0.011111111111111112 angle) (* (PI) (* (- b_m a) (+ b_m a)))) (* (* a (PI)) (* angle (* -0.011111111111111112 a)))))
\begin{array}{l}
b_m = \left|b\right|
\\
\begin{array}{l}
\mathbf{if}\;{a}^{2} \leq 10^{+283}:\\
\;\;\;\;\left(0.011111111111111112 \cdot angle\right) \cdot \left(\mathsf{PI}\left(\right) \cdot \left(\left(b\_m - a\right) \cdot \left(b\_m + a\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(a \cdot \mathsf{PI}\left(\right)\right) \cdot \left(angle \cdot \left(-0.011111111111111112 \cdot a\right)\right)\\
\end{array}
\end{array}
if (pow.f64 a #s(literal 2 binary64)) < 9.99999999999999955e282Initial program 65.2%
Taylor expanded in angle around 0
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
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.6
Applied rewrites60.6%
Applied rewrites60.5%
if 9.99999999999999955e282 < (pow.f64 a #s(literal 2 binary64)) Initial program 45.0%
Taylor expanded in angle around 0
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
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--.f6455.0
Applied rewrites55.0%
Taylor expanded in a around inf
Applied rewrites55.1%
Applied rewrites73.9%
Applied rewrites73.9%
b_m = (fabs.f64 b) (FPCore (a b_m angle) :precision binary64 (if (<= (/ angle 180.0) 2e+191) (* (+ b_m a) (* (- b_m a) (* (* 0.011111111111111112 (PI)) angle))) (* (* (* -0.011111111111111112 a) (* a (PI))) angle)))
\begin{array}{l}
b_m = \left|b\right|
\\
\begin{array}{l}
\mathbf{if}\;\frac{angle}{180} \leq 2 \cdot 10^{+191}:\\
\;\;\;\;\left(b\_m + a\right) \cdot \left(\left(b\_m - a\right) \cdot \left(\left(0.011111111111111112 \cdot \mathsf{PI}\left(\right)\right) \cdot angle\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(-0.011111111111111112 \cdot a\right) \cdot \left(a \cdot \mathsf{PI}\left(\right)\right)\right) \cdot angle\\
\end{array}
\end{array}
if (/.f64 angle #s(literal 180 binary64)) < 2.00000000000000015e191Initial program 60.0%
Taylor expanded in angle around 0
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
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.1
Applied rewrites61.1%
Applied rewrites71.2%
if 2.00000000000000015e191 < (/.f64 angle #s(literal 180 binary64)) Initial program 37.8%
Taylor expanded in angle around 0
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
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--.f6430.9
Applied rewrites30.9%
Taylor expanded in a around inf
Applied rewrites48.2%
Applied rewrites42.4%
Applied rewrites48.2%
b_m = (fabs.f64 b) (FPCore (a b_m angle) :precision binary64 (* (* -0.011111111111111112 a) (* a (* (PI) angle))))
\begin{array}{l}
b_m = \left|b\right|
\\
\left(-0.011111111111111112 \cdot a\right) \cdot \left(a \cdot \left(\mathsf{PI}\left(\right) \cdot angle\right)\right)
\end{array}
Initial program 58.2%
Taylor expanded in angle around 0
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
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--.f6458.7
Applied rewrites58.7%
Taylor expanded in a around inf
Applied rewrites36.4%
Applied rewrites41.7%
herbie shell --seed 2024327
(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)))))