
(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 18 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 (sqrt (PI)))
(t_1
(*
(sin (* (* t_0 t_0) (* angle 0.005555555555555556)))
(* 2.0 (- b_m a))))
(t_2 (pow (cbrt t_0) 3.0)))
(if (<= b_m 6e+177)
(* (* t_1 (cos (* (* angle 0.005555555555555556) (* t_2 t_2)))) (+ a b_m))
(* (* (cos (* (* angle 0.005555555555555556) (PI))) t_1) (+ a b_m)))))\begin{array}{l}
b_m = \left|b\right|
\\
\begin{array}{l}
t_0 := \sqrt{\mathsf{PI}\left(\right)}\\
t_1 := \sin \left(\left(t\_0 \cdot t\_0\right) \cdot \left(angle \cdot 0.005555555555555556\right)\right) \cdot \left(2 \cdot \left(b\_m - a\right)\right)\\
t_2 := {\left(\sqrt[3]{t\_0}\right)}^{3}\\
\mathbf{if}\;b\_m \leq 6 \cdot 10^{+177}:\\
\;\;\;\;\left(t\_1 \cdot \cos \left(\left(angle \cdot 0.005555555555555556\right) \cdot \left(t\_2 \cdot t\_2\right)\right)\right) \cdot \left(a + b\_m\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\cos \left(\left(angle \cdot 0.005555555555555556\right) \cdot \mathsf{PI}\left(\right)\right) \cdot t\_1\right) \cdot \left(a + b\_m\right)\\
\end{array}
\end{array}
if b < 6e177Initial program 51.8%
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-*.f6465.7
Applied rewrites66.5%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lower-*.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
*-commutativeN/A
lower-*.f6466.5
lift-/.f64N/A
div-invN/A
metadata-evalN/A
*-commutativeN/A
lift-*.f6467.3
lift-*.f64N/A
Applied rewrites67.3%
lift-PI.f64N/A
add-sqr-sqrtN/A
lower-*.f64N/A
lift-PI.f64N/A
lower-sqrt.f64N/A
lift-PI.f64N/A
lower-sqrt.f6467.5
Applied rewrites67.5%
rem-cube-cbrtN/A
lift-PI.f64N/A
lift-PI.f64N/A
rem-square-sqrtN/A
lift-sqrt.f64N/A
lift-sqrt.f64N/A
cbrt-prodN/A
unpow-prod-downN/A
lower-*.f64N/A
lower-pow.f64N/A
lower-cbrt.f64N/A
lower-pow.f64N/A
lower-cbrt.f6470.8
Applied rewrites70.8%
if 6e177 < b Initial program 41.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.1
Applied rewrites70.4%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lower-*.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
*-commutativeN/A
lower-*.f6470.4
lift-/.f64N/A
div-invN/A
metadata-evalN/A
*-commutativeN/A
lift-*.f6477.8
lift-*.f64N/A
Applied rewrites77.8%
lift-PI.f64N/A
add-sqr-sqrtN/A
lower-*.f64N/A
lift-PI.f64N/A
lower-sqrt.f64N/A
lift-PI.f64N/A
lower-sqrt.f6477.8
Applied rewrites77.8%
Final simplification71.5%
b_m = (fabs.f64 b)
(FPCore (a b_m angle)
:precision binary64
(let* ((t_0 (* 2.0 (- b_m a)))
(t_1 (sqrt (PI)))
(t_2 (* (cbrt (PI)) (cbrt t_1)))
(t_3 (* (* angle 0.005555555555555556) (PI))))
(if (<= b_m 9.5e+211)
(*
(*
(* (sin t_3) t_0)
(cos (* (* t_2 t_2) (* angle 0.005555555555555556))))
(+ a b_m))
(*
(*
(cos t_3)
(* (sin (* (* t_1 t_1) (* angle 0.005555555555555556))) t_0))
(+ a b_m)))))\begin{array}{l}
b_m = \left|b\right|
\\
\begin{array}{l}
t_0 := 2 \cdot \left(b\_m - a\right)\\
t_1 := \sqrt{\mathsf{PI}\left(\right)}\\
t_2 := \sqrt[3]{\mathsf{PI}\left(\right)} \cdot \sqrt[3]{t\_1}\\
t_3 := \left(angle \cdot 0.005555555555555556\right) \cdot \mathsf{PI}\left(\right)\\
\mathbf{if}\;b\_m \leq 9.5 \cdot 10^{+211}:\\
\;\;\;\;\left(\left(\sin t\_3 \cdot t\_0\right) \cdot \cos \left(\left(t\_2 \cdot t\_2\right) \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right) \cdot \left(a + b\_m\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\cos t\_3 \cdot \left(\sin \left(\left(t\_1 \cdot t\_1\right) \cdot \left(angle \cdot 0.005555555555555556\right)\right) \cdot t\_0\right)\right) \cdot \left(a + b\_m\right)\\
\end{array}
\end{array}
if b < 9.4999999999999997e211Initial program 51.1%
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-*.f6465.2
Applied rewrites65.9%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lower-*.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
*-commutativeN/A
lower-*.f6465.9
lift-/.f64N/A
div-invN/A
metadata-evalN/A
*-commutativeN/A
lift-*.f6467.1
lift-*.f64N/A
Applied rewrites67.1%
lift-PI.f64N/A
add-cube-cbrtN/A
associate-*l*N/A
add-sqr-sqrtN/A
cbrt-prodN/A
unswap-sqrN/A
lower-*.f64N/A
lower-*.f64N/A
lower-cbrt.f64N/A
lift-PI.f64N/A
lower-sqrt.f64N/A
lift-PI.f64N/A
lower-cbrt.f64N/A
lower-*.f64N/A
lower-cbrt.f64N/A
lift-PI.f64N/A
lower-sqrt.f64N/A
lift-PI.f64N/A
lower-cbrt.f6468.9
Applied rewrites68.9%
if 9.4999999999999997e211 < b Initial program 46.1%
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-*.f6481.8
Applied rewrites77.3%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lower-*.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
*-commutativeN/A
lower-*.f6477.3
lift-/.f64N/A
div-invN/A
metadata-evalN/A
*-commutativeN/A
lift-*.f6481.8
lift-*.f64N/A
Applied rewrites81.8%
lift-PI.f64N/A
add-sqr-sqrtN/A
lower-*.f64N/A
lift-PI.f64N/A
lower-sqrt.f64N/A
lift-PI.f64N/A
lower-sqrt.f6481.7
Applied rewrites81.7%
Final simplification70.0%
b_m = (fabs.f64 b)
(FPCore (a b_m angle)
:precision binary64
(let* ((t_0 (sin (* (* angle 0.005555555555555556) (PI)))))
(if (<= b_m 1.65e-15)
(*
(* (cos (/ 1.0 (/ 180.0 (* angle (PI))))) (* t_0 (* 2.0 (- b_m a))))
(+ a b_m))
(if (<= b_m 3.8e+276)
(* 1.0 (* (* (* t_0 2.0) (- b_m a)) (+ a b_m)))
(*
(cos (* (/ angle 180.0) (PI)))
(*
(sin (* (* 0.005555555555555556 (PI)) angle))
(* (* b_m b_m) 2.0)))))))\begin{array}{l}
b_m = \left|b\right|
\\
\begin{array}{l}
t_0 := \sin \left(\left(angle \cdot 0.005555555555555556\right) \cdot \mathsf{PI}\left(\right)\right)\\
\mathbf{if}\;b\_m \leq 1.65 \cdot 10^{-15}:\\
\;\;\;\;\left(\cos \left(\frac{1}{\frac{180}{angle \cdot \mathsf{PI}\left(\right)}}\right) \cdot \left(t\_0 \cdot \left(2 \cdot \left(b\_m - a\right)\right)\right)\right) \cdot \left(a + b\_m\right)\\
\mathbf{elif}\;b\_m \leq 3.8 \cdot 10^{+276}:\\
\;\;\;\;1 \cdot \left(\left(\left(t\_0 \cdot 2\right) \cdot \left(b\_m - a\right)\right) \cdot \left(a + b\_m\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right) \cdot \left(\sin \left(\left(0.005555555555555556 \cdot \mathsf{PI}\left(\right)\right) \cdot angle\right) \cdot \left(\left(b\_m \cdot b\_m\right) \cdot 2\right)\right)\\
\end{array}
\end{array}
if b < 1.65e-15Initial program 51.4%
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-*.f6465.3
Applied rewrites66.1%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lower-*.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
*-commutativeN/A
lower-*.f6466.1
lift-/.f64N/A
div-invN/A
metadata-evalN/A
*-commutativeN/A
lift-*.f6467.0
lift-*.f64N/A
Applied rewrites67.0%
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
metadata-evalN/A
div-invN/A
associate-*r/N/A
lift-*.f64N/A
clear-numN/A
lower-/.f64N/A
lower-/.f6467.8
lift-*.f64N/A
*-commutativeN/A
lower-*.f6467.8
Applied rewrites67.8%
if 1.65e-15 < b < 3.79999999999999976e276Initial program 46.8%
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-*.f6467.9
Applied rewrites68.0%
Taylor expanded in angle around 0
Applied rewrites71.8%
if 3.79999999999999976e276 < b Initial program 55.6%
Taylor expanded in b around inf
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-PI.f64100.0
Applied rewrites100.0%
Final simplification69.7%
b_m = (fabs.f64 b)
(FPCore (a b_m angle)
:precision binary64
(let* ((t_0
(*
(* (* (sin (* (* angle 0.005555555555555556) (PI))) 2.0) (- b_m a))
(+ a b_m))))
(if (<= b_m 1.65e-15)
(* (cos (/ 1.0 (/ 180.0 (* angle (PI))))) t_0)
(if (<= b_m 3.8e+276)
(* 1.0 t_0)
(*
(cos (* (/ angle 180.0) (PI)))
(*
(sin (* (* 0.005555555555555556 (PI)) angle))
(* (* b_m b_m) 2.0)))))))\begin{array}{l}
b_m = \left|b\right|
\\
\begin{array}{l}
t_0 := \left(\left(\sin \left(\left(angle \cdot 0.005555555555555556\right) \cdot \mathsf{PI}\left(\right)\right) \cdot 2\right) \cdot \left(b\_m - a\right)\right) \cdot \left(a + b\_m\right)\\
\mathbf{if}\;b\_m \leq 1.65 \cdot 10^{-15}:\\
\;\;\;\;\cos \left(\frac{1}{\frac{180}{angle \cdot \mathsf{PI}\left(\right)}}\right) \cdot t\_0\\
\mathbf{elif}\;b\_m \leq 3.8 \cdot 10^{+276}:\\
\;\;\;\;1 \cdot t\_0\\
\mathbf{else}:\\
\;\;\;\;\cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right) \cdot \left(\sin \left(\left(0.005555555555555556 \cdot \mathsf{PI}\left(\right)\right) \cdot angle\right) \cdot \left(\left(b\_m \cdot b\_m\right) \cdot 2\right)\right)\\
\end{array}
\end{array}
if b < 1.65e-15Initial program 51.4%
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-*.f6465.3
Applied rewrites66.1%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
clear-numN/A
lower-/.f64N/A
lower-/.f64N/A
lower-*.f6467.8
Applied rewrites67.8%
if 1.65e-15 < b < 3.79999999999999976e276Initial program 46.8%
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-*.f6467.9
Applied rewrites68.0%
Taylor expanded in angle around 0
Applied rewrites71.8%
if 3.79999999999999976e276 < b Initial program 55.6%
Taylor expanded in b around inf
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-PI.f64100.0
Applied rewrites100.0%
Final simplification69.7%
b_m = (fabs.f64 b)
(FPCore (a b_m angle)
:precision binary64
(let* ((t_0 (* (* 0.005555555555555556 (PI)) angle))
(t_1
(*
(* (* (sin (* (* angle 0.005555555555555556) (PI))) 2.0) (- b_m a))
(+ a b_m))))
(if (<= b_m 1.55e-15)
(* (cos t_0) t_1)
(if (<= b_m 3.8e+276)
(* 1.0 t_1)
(* (cos (* (/ angle 180.0) (PI))) (* (sin t_0) (* (* b_m b_m) 2.0)))))))\begin{array}{l}
b_m = \left|b\right|
\\
\begin{array}{l}
t_0 := \left(0.005555555555555556 \cdot \mathsf{PI}\left(\right)\right) \cdot angle\\
t_1 := \left(\left(\sin \left(\left(angle \cdot 0.005555555555555556\right) \cdot \mathsf{PI}\left(\right)\right) \cdot 2\right) \cdot \left(b\_m - a\right)\right) \cdot \left(a + b\_m\right)\\
\mathbf{if}\;b\_m \leq 1.55 \cdot 10^{-15}:\\
\;\;\;\;\cos t\_0 \cdot t\_1\\
\mathbf{elif}\;b\_m \leq 3.8 \cdot 10^{+276}:\\
\;\;\;\;1 \cdot t\_1\\
\mathbf{else}:\\
\;\;\;\;\cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right) \cdot \left(\sin t\_0 \cdot \left(\left(b\_m \cdot b\_m\right) \cdot 2\right)\right)\\
\end{array}
\end{array}
if b < 1.5499999999999999e-15Initial program 51.4%
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-*.f6465.3
Applied rewrites66.1%
lift-*.f64N/A
lift-/.f64N/A
div-invN/A
metadata-evalN/A
*-commutativeN/A
associate-*l*N/A
lift-*.f64N/A
lift-*.f6467.9
Applied rewrites67.9%
if 1.5499999999999999e-15 < b < 3.79999999999999976e276Initial program 46.8%
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-*.f6467.9
Applied rewrites68.0%
Taylor expanded in angle around 0
Applied rewrites71.8%
if 3.79999999999999976e276 < b Initial program 55.6%
Taylor expanded in b around inf
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-PI.f64100.0
Applied rewrites100.0%
Final simplification69.8%
b_m = (fabs.f64 b)
(FPCore (a b_m angle)
:precision binary64
(if (<= b_m 3.8e+276)
(*
1.0
(*
(* (* (sin (* (* angle 0.005555555555555556) (PI))) 2.0) (- b_m a))
(+ a b_m)))
(*
(cos (* (/ angle 180.0) (PI)))
(* (sin (* (* 0.005555555555555556 (PI)) angle)) (* (* b_m b_m) 2.0)))))\begin{array}{l}
b_m = \left|b\right|
\\
\begin{array}{l}
\mathbf{if}\;b\_m \leq 3.8 \cdot 10^{+276}:\\
\;\;\;\;1 \cdot \left(\left(\left(\sin \left(\left(angle \cdot 0.005555555555555556\right) \cdot \mathsf{PI}\left(\right)\right) \cdot 2\right) \cdot \left(b\_m - a\right)\right) \cdot \left(a + b\_m\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right) \cdot \left(\sin \left(\left(0.005555555555555556 \cdot \mathsf{PI}\left(\right)\right) \cdot angle\right) \cdot \left(\left(b\_m \cdot b\_m\right) \cdot 2\right)\right)\\
\end{array}
\end{array}
if b < 3.79999999999999976e276Initial 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-*.f6465.8
Applied rewrites66.5%
Taylor expanded in angle around 0
Applied rewrites68.9%
if 3.79999999999999976e276 < b Initial program 55.6%
Taylor expanded in b around inf
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-PI.f64100.0
Applied rewrites100.0%
Final simplification69.9%
b_m = (fabs.f64 b) (FPCore (a b_m angle) :precision binary64 (if (<= (- (pow b_m 2.0) (pow a 2.0)) -5e-175) (* (* (* -0.011111111111111112 a) (PI)) (* angle a)) (fma (* 0.011111111111111112 (* angle (PI))) (* b_m b_m) 0.0)))
\begin{array}{l}
b_m = \left|b\right|
\\
\begin{array}{l}
\mathbf{if}\;{b\_m}^{2} - {a}^{2} \leq -5 \cdot 10^{-175}:\\
\;\;\;\;\left(\left(-0.011111111111111112 \cdot a\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \left(angle \cdot a\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(0.011111111111111112 \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right), b\_m \cdot b\_m, 0\right)\\
\end{array}
\end{array}
if (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) < -5e-175Initial program 46.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--.f6443.5
Applied rewrites43.5%
Taylor expanded in b around 0
Applied rewrites43.4%
Applied rewrites61.1%
Applied rewrites61.1%
if -5e-175 < (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) Initial program 53.7%
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.4
Applied rewrites58.4%
Taylor expanded in b around inf
Applied rewrites59.0%
Final simplification59.9%
b_m = (fabs.f64 b) (FPCore (a b_m angle) :precision binary64 (if (<= (- (pow b_m 2.0) (pow a 2.0)) -5e-175) (* (* (* -0.011111111111111112 a) (PI)) (* angle a)) (* (* (* (* b_m b_m) (PI)) angle) 0.011111111111111112)))
\begin{array}{l}
b_m = \left|b\right|
\\
\begin{array}{l}
\mathbf{if}\;{b\_m}^{2} - {a}^{2} \leq -5 \cdot 10^{-175}:\\
\;\;\;\;\left(\left(-0.011111111111111112 \cdot a\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \left(angle \cdot a\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(\left(b\_m \cdot b\_m\right) \cdot \mathsf{PI}\left(\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))) < -5e-175Initial program 46.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--.f6443.5
Applied rewrites43.5%
Taylor expanded in b around 0
Applied rewrites43.4%
Applied rewrites61.1%
Applied rewrites61.1%
if -5e-175 < (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) Initial program 53.7%
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.4
Applied rewrites58.4%
Taylor expanded in b around inf
Applied rewrites59.0%
Final simplification59.9%
b_m = (fabs.f64 b)
(FPCore (a b_m angle)
:precision binary64
(if (<= a 9.5e+282)
(*
1.0
(*
(* (* (sin (* (* angle 0.005555555555555556) (PI))) 2.0) (- b_m a))
(+ a b_m)))
(*
(fma (* (* angle angle) -1.54320987654321e-5) (* (PI) (PI)) 1.0)
(* (* (* a a) -2.0) (sin (* (* 0.005555555555555556 (PI)) angle))))))\begin{array}{l}
b_m = \left|b\right|
\\
\begin{array}{l}
\mathbf{if}\;a \leq 9.5 \cdot 10^{+282}:\\
\;\;\;\;1 \cdot \left(\left(\left(\sin \left(\left(angle \cdot 0.005555555555555556\right) \cdot \mathsf{PI}\left(\right)\right) \cdot 2\right) \cdot \left(b\_m - a\right)\right) \cdot \left(a + b\_m\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\left(angle \cdot angle\right) \cdot -1.54320987654321 \cdot 10^{-5}, \mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right), 1\right) \cdot \left(\left(\left(a \cdot a\right) \cdot -2\right) \cdot \sin \left(\left(0.005555555555555556 \cdot \mathsf{PI}\left(\right)\right) \cdot angle\right)\right)\\
\end{array}
\end{array}
if a < 9.5000000000000005e282Initial program 50.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-*.f6467.0
Applied rewrites66.9%
Taylor expanded in angle around 0
Applied rewrites68.8%
if 9.5000000000000005e282 < a Initial program 50.0%
Taylor expanded in b around 0
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-PI.f6450.0
Applied rewrites50.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.f64100.0
Applied rewrites100.0%
Final simplification69.6%
b_m = (fabs.f64 b)
(FPCore (a b_m angle)
:precision binary64
(if (<= (/ angle 180.0) 1e-21)
(* (* (* (* 0.011111111111111112 (PI)) angle) (- b_m a)) (+ a b_m))
(*
(sin (* (* (* angle 0.005555555555555556) (PI)) 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 10^{-21}:\\
\;\;\;\;\left(\left(\left(0.011111111111111112 \cdot \mathsf{PI}\left(\right)\right) \cdot angle\right) \cdot \left(b\_m - a\right)\right) \cdot \left(a + b\_m\right)\\
\mathbf{else}:\\
\;\;\;\;\sin \left(\left(\left(angle \cdot 0.005555555555555556\right) \cdot \mathsf{PI}\left(\right)\right) \cdot 2\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)) < 9.99999999999999908e-22Initial program 57.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--.f6460.1
Applied rewrites60.1%
Applied rewrites74.6%
if 9.99999999999999908e-22 < (/.f64 angle #s(literal 180 binary64)) Initial program 34.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-*.f6437.0
Applied rewrites39.8%
Applied rewrites40.1%
Final simplification64.9%
b_m = (fabs.f64 b)
(FPCore (a b_m angle)
:precision binary64
(let* ((t_0 (* (* 0.011111111111111112 (PI)) angle)))
(if (<= (/ angle 180.0) 1e-21)
(* (* t_0 (- b_m a)) (+ a b_m))
(* (sin t_0) (* (- b_m a) (+ a b_m))))))\begin{array}{l}
b_m = \left|b\right|
\\
\begin{array}{l}
t_0 := \left(0.011111111111111112 \cdot \mathsf{PI}\left(\right)\right) \cdot angle\\
\mathbf{if}\;\frac{angle}{180} \leq 10^{-21}:\\
\;\;\;\;\left(t\_0 \cdot \left(b\_m - a\right)\right) \cdot \left(a + b\_m\right)\\
\mathbf{else}:\\
\;\;\;\;\sin t\_0 \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)) < 9.99999999999999908e-22Initial program 57.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--.f6460.1
Applied rewrites60.1%
Applied rewrites74.6%
if 9.99999999999999908e-22 < (/.f64 angle #s(literal 180 binary64)) Initial program 34.2%
lift-pow.f64N/A
pow-to-expN/A
lower-exp.f64N/A
unpow1N/A
pow-to-expN/A
rem-log-expN/A
lower-*.f64N/A
rem-log-expN/A
pow-to-expN/A
unpow1N/A
lower-log.f6418.1
Applied rewrites18.1%
lift-*.f64N/A
lift-/.f64N/A
div-invN/A
metadata-evalN/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f6422.2
Applied rewrites22.2%
Applied rewrites40.8%
Final simplification65.1%
b_m = (fabs.f64 b) (FPCore (a b_m angle) :precision binary64 (* 1.0 (* (* (* (sin (* (* angle 0.005555555555555556) (PI))) 2.0) (- b_m a)) (+ a b_m))))
\begin{array}{l}
b_m = \left|b\right|
\\
1 \cdot \left(\left(\left(\sin \left(\left(angle \cdot 0.005555555555555556\right) \cdot \mathsf{PI}\left(\right)\right) \cdot 2\right) \cdot \left(b\_m - a\right)\right) \cdot \left(a + b\_m\right)\right)
\end{array}
Initial program 50.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-*.f6466.6
Applied rewrites66.9%
Taylor expanded in angle around 0
Applied rewrites68.4%
Final simplification68.4%
b_m = (fabs.f64 b) (FPCore (a b_m angle) :precision binary64 (if (<= (pow a 2.0) 2e-322) (* (* -0.011111111111111112 (* a a)) (* angle (PI))) (* (* (* -0.011111111111111112 a) (PI)) (* angle a))))
\begin{array}{l}
b_m = \left|b\right|
\\
\begin{array}{l}
\mathbf{if}\;{a}^{2} \leq 2 \cdot 10^{-322}:\\
\;\;\;\;\left(-0.011111111111111112 \cdot \left(a \cdot a\right)\right) \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(-0.011111111111111112 \cdot a\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \left(angle \cdot a\right)\\
\end{array}
\end{array}
if (pow.f64 a #s(literal 2 binary64)) < 1.97626e-322Initial program 69.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--.f6464.1
Applied rewrites64.1%
Taylor expanded in b around 0
Applied rewrites26.5%
if 1.97626e-322 < (pow.f64 a #s(literal 2 binary64)) Initial program 44.3%
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--.f6447.7
Applied rewrites47.7%
Taylor expanded in b around 0
Applied rewrites33.9%
Applied rewrites44.1%
Applied rewrites44.1%
Final simplification39.7%
b_m = (fabs.f64 b)
(FPCore (a b_m angle)
:precision binary64
(let* ((t_0 (* angle (PI))))
(if (<= (pow a 2.0) 2e+157)
(* (* -0.011111111111111112 (* a a)) t_0)
(* (* t_0 a) (* -0.011111111111111112 a)))))\begin{array}{l}
b_m = \left|b\right|
\\
\begin{array}{l}
t_0 := angle \cdot \mathsf{PI}\left(\right)\\
\mathbf{if}\;{a}^{2} \leq 2 \cdot 10^{+157}:\\
\;\;\;\;\left(-0.011111111111111112 \cdot \left(a \cdot a\right)\right) \cdot t\_0\\
\mathbf{else}:\\
\;\;\;\;\left(t\_0 \cdot a\right) \cdot \left(-0.011111111111111112 \cdot a\right)\\
\end{array}
\end{array}
if (pow.f64 a #s(literal 2 binary64)) < 1.99999999999999997e157Initial program 63.4%
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.5
Applied rewrites58.5%
Taylor expanded in b around 0
Applied rewrites31.3%
if 1.99999999999999997e157 < (pow.f64 a #s(literal 2 binary64)) Initial program 32.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--.f6442.6
Applied rewrites42.6%
Taylor expanded in b around 0
Applied rewrites33.0%
Applied rewrites51.5%
Final simplification39.6%
b_m = (fabs.f64 b)
(FPCore (a b_m angle)
:precision binary64
(if (<= (/ angle 180.0) 1e+20)
(* (* (* (* 0.011111111111111112 (PI)) angle) (- b_m a)) (+ a b_m))
(/
(*
(* (* (PI) (+ a b_m)) (* 0.011111111111111112 angle))
(* (- b_m a) (+ a b_m)))
(+ a b_m))))\begin{array}{l}
b_m = \left|b\right|
\\
\begin{array}{l}
\mathbf{if}\;\frac{angle}{180} \leq 10^{+20}:\\
\;\;\;\;\left(\left(\left(0.011111111111111112 \cdot \mathsf{PI}\left(\right)\right) \cdot angle\right) \cdot \left(b\_m - a\right)\right) \cdot \left(a + b\_m\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(\left(\mathsf{PI}\left(\right) \cdot \left(a + b\_m\right)\right) \cdot \left(0.011111111111111112 \cdot angle\right)\right) \cdot \left(\left(b\_m - a\right) \cdot \left(a + b\_m\right)\right)}{a + b\_m}\\
\end{array}
\end{array}
if (/.f64 angle #s(literal 180 binary64)) < 1e20Initial 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--.f6460.0
Applied rewrites60.0%
Applied rewrites73.6%
if 1e20 < (/.f64 angle #s(literal 180 binary64)) Initial program 26.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--.f6426.1
Applied rewrites26.1%
Applied rewrites27.5%
Final simplification62.7%
b_m = (fabs.f64 b) (FPCore (a b_m angle) :precision binary64 (if (<= (/ angle 180.0) 5e-10) (* (* (* -0.011111111111111112 a) (PI)) (* angle a)) (* (* (* -0.011111111111111112 (* a a)) angle) (PI))))
\begin{array}{l}
b_m = \left|b\right|
\\
\begin{array}{l}
\mathbf{if}\;\frac{angle}{180} \leq 5 \cdot 10^{-10}:\\
\;\;\;\;\left(\left(-0.011111111111111112 \cdot a\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \left(angle \cdot a\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(-0.011111111111111112 \cdot \left(a \cdot a\right)\right) \cdot angle\right) \cdot \mathsf{PI}\left(\right)\\
\end{array}
\end{array}
if (/.f64 angle #s(literal 180 binary64)) < 5.00000000000000031e-10Initial 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--.f6461.2
Applied rewrites61.2%
Taylor expanded in b around 0
Applied rewrites34.6%
Applied rewrites43.7%
Applied rewrites43.7%
if 5.00000000000000031e-10 < (/.f64 angle #s(literal 180 binary64)) Initial program 29.3%
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--.f6425.7
Applied rewrites25.7%
Taylor expanded in b around 0
Applied rewrites24.8%
Taylor expanded in b around 0
Applied rewrites24.8%
Final simplification38.8%
b_m = (fabs.f64 b) (FPCore (a b_m angle) :precision binary64 (* (* (* (* 0.011111111111111112 (PI)) angle) (- b_m a)) (+ a b_m)))
\begin{array}{l}
b_m = \left|b\right|
\\
\left(\left(\left(0.011111111111111112 \cdot \mathsf{PI}\left(\right)\right) \cdot angle\right) \cdot \left(b\_m - a\right)\right) \cdot \left(a + b\_m\right)
\end{array}
Initial program 50.7%
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--.f6451.9
Applied rewrites51.9%
Applied rewrites61.9%
Final simplification61.9%
b_m = (fabs.f64 b) (FPCore (a b_m angle) :precision binary64 (* (* (* angle (PI)) a) (* -0.011111111111111112 a)))
\begin{array}{l}
b_m = \left|b\right|
\\
\left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot a\right) \cdot \left(-0.011111111111111112 \cdot a\right)
\end{array}
Initial program 50.7%
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--.f6451.9
Applied rewrites51.9%
Taylor expanded in b around 0
Applied rewrites32.0%
Applied rewrites37.9%
Final simplification37.9%
herbie shell --seed 2024275
(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)))))