
(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 16 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}
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a b angle_m)
:precision binary64
(let* ((t_0 (* (- b a) (+ b a)))
(t_1 (* (* (PI) 0.005555555555555556) angle_m))
(t_2 (sqrt (PI))))
(*
angle_s
(if (<= (/ angle_m 180.0) 5e+175)
(*
(cos (* (/ angle_m 180.0) (PI)))
(* (* (* (* (sin t_1) (- b a)) (+ b a)) (/ 2.0 (+ b a))) (+ b a)))
(if (<= (/ angle_m 180.0) 1e+255)
(*
(* t_0 (* 0.5 (sin (* (* t_2 (* 0.011111111111111112 angle_m)) t_2))))
2.0)
(*
(* t_0 2.0)
(*
(cos t_1)
(sin (* (* (* t_2 t_2) 0.005555555555555556) angle_m)))))))))\begin{array}{l}
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
\begin{array}{l}
t_0 := \left(b - a\right) \cdot \left(b + a\right)\\
t_1 := \left(\mathsf{PI}\left(\right) \cdot 0.005555555555555556\right) \cdot angle\_m\\
t_2 := \sqrt{\mathsf{PI}\left(\right)}\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;\frac{angle\_m}{180} \leq 5 \cdot 10^{+175}:\\
\;\;\;\;\cos \left(\frac{angle\_m}{180} \cdot \mathsf{PI}\left(\right)\right) \cdot \left(\left(\left(\left(\sin t\_1 \cdot \left(b - a\right)\right) \cdot \left(b + a\right)\right) \cdot \frac{2}{b + a}\right) \cdot \left(b + a\right)\right)\\
\mathbf{elif}\;\frac{angle\_m}{180} \leq 10^{+255}:\\
\;\;\;\;\left(t\_0 \cdot \left(0.5 \cdot \sin \left(\left(t\_2 \cdot \left(0.011111111111111112 \cdot angle\_m\right)\right) \cdot t\_2\right)\right)\right) \cdot 2\\
\mathbf{else}:\\
\;\;\;\;\left(t\_0 \cdot 2\right) \cdot \left(\cos t\_1 \cdot \sin \left(\left(\left(t\_2 \cdot t\_2\right) \cdot 0.005555555555555556\right) \cdot angle\_m\right)\right)\\
\end{array}
\end{array}
\end{array}
if (/.f64 angle #s(literal 180 binary64)) < 5e175Initial program 60.3%
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-*.f6477.4
Applied rewrites76.4%
Applied rewrites78.4%
lift-*.f64N/A
lift-/.f64N/A
/-rgt-identityN/A
*-commutativeN/A
lower-*.f6478.4
lift-+.f64N/A
+-commutativeN/A
lift-+.f6478.4
lift-*.f64N/A
*-commutativeN/A
lower-*.f6478.4
Applied rewrites78.4%
if 5e175 < (/.f64 angle #s(literal 180 binary64)) < 9.99999999999999988e254Initial program 42.6%
Applied rewrites46.9%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*r*N/A
*-commutativeN/A
rem-cbrt-cubeN/A
metadata-evalN/A
pow-prod-upN/A
lift-pow.f64N/A
lift-pow.f64N/A
cbrt-unprodN/A
lift-cbrt.f64N/A
lift-cbrt.f64N/A
associate-*r*N/A
lower-*.f64N/A
Applied rewrites58.0%
if 9.99999999999999988e254 < (/.f64 angle #s(literal 180 binary64)) Initial program 30.7%
Taylor expanded in angle around inf
*-commutativeN/A
associate-*r*N/A
associate-*l*N/A
lower-*.f64N/A
Applied rewrites30.7%
Applied rewrites72.0%
Final simplification77.1%
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a b angle_m)
:precision binary64
(let* ((t_0 (- (pow b 2.0) (pow a 2.0)))
(t_1 (* (PI) angle_m))
(t_2 (* (sin (* t_1 0.011111111111111112)) (* (- b a) (+ b a)))))
(*
angle_s
(if (<= t_0 -5e+299)
(* (* (* -0.011111111111111112 a) angle_m) (* (PI) a))
(if (<= t_0 2e+280)
t_2
(if (<= t_0 INFINITY)
(fma
(* (* a a) -0.011111111111111112)
t_1
(* (* (* (* (PI) b) angle_m) 0.011111111111111112) b))
t_2))))))\begin{array}{l}
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
\begin{array}{l}
t_0 := {b}^{2} - {a}^{2}\\
t_1 := \mathsf{PI}\left(\right) \cdot angle\_m\\
t_2 := \sin \left(t\_1 \cdot 0.011111111111111112\right) \cdot \left(\left(b - a\right) \cdot \left(b + a\right)\right)\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_0 \leq -5 \cdot 10^{+299}:\\
\;\;\;\;\left(\left(-0.011111111111111112 \cdot a\right) \cdot angle\_m\right) \cdot \left(\mathsf{PI}\left(\right) \cdot a\right)\\
\mathbf{elif}\;t\_0 \leq 2 \cdot 10^{+280}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_0 \leq \infty:\\
\;\;\;\;\mathsf{fma}\left(\left(a \cdot a\right) \cdot -0.011111111111111112, t\_1, \left(\left(\left(\mathsf{PI}\left(\right) \cdot b\right) \cdot angle\_m\right) \cdot 0.011111111111111112\right) \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
\end{array}
if (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) < -5.0000000000000003e299Initial program 58.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--.f6455.3
Applied rewrites55.3%
Taylor expanded in a around inf
Applied rewrites55.3%
Applied rewrites80.5%
Applied rewrites80.5%
if -5.0000000000000003e299 < (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) < 2.0000000000000001e280 or +inf.0 < (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) Initial program 55.7%
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 rewrites67.3%
if 2.0000000000000001e280 < (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) < +inf.0Initial program 64.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--.f6458.7
Applied rewrites58.7%
Taylor expanded in b around 0
Applied rewrites75.4%
Final simplification72.3%
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a b angle_m)
:precision binary64
(let* ((t_0 (cbrt (pow (PI) 1.5))))
(*
angle_s
(*
(cos (* (/ angle_m 180.0) (* t_0 t_0)))
(*
(* (* 2.0 (sin (* (PI) (* angle_m 0.005555555555555556)))) (- b a))
(+ b a))))))\begin{array}{l}
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
\begin{array}{l}
t_0 := \sqrt[3]{{\mathsf{PI}\left(\right)}^{1.5}}\\
angle\_s \cdot \left(\cos \left(\frac{angle\_m}{180} \cdot \left(t\_0 \cdot t\_0\right)\right) \cdot \left(\left(\left(2 \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \left(angle\_m \cdot 0.005555555555555556\right)\right)\right) \cdot \left(b - a\right)\right) \cdot \left(b + a\right)\right)\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%
Final simplification76.4%
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a b angle_m)
:precision binary64
(let* ((t_0 (cbrt (PI))) (t_1 (cos (* (/ angle_m 180.0) (PI)))))
(*
angle_s
(if (<= (/ angle_m 180.0) 5e+174)
(*
t_1
(*
(*
(*
(* (sin (* (* (PI) 0.005555555555555556) angle_m)) (- b a))
(+ b a))
(/ 2.0 (+ b a)))
(+ b a)))
(*
(*
(*
(*
(sin (* (* (pow t_0 2.0) t_0) (* angle_m 0.005555555555555556)))
2.0)
(- b a))
(+ b a))
t_1)))))\begin{array}{l}
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
\begin{array}{l}
t_0 := \sqrt[3]{\mathsf{PI}\left(\right)}\\
t_1 := \cos \left(\frac{angle\_m}{180} \cdot \mathsf{PI}\left(\right)\right)\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;\frac{angle\_m}{180} \leq 5 \cdot 10^{+174}:\\
\;\;\;\;t\_1 \cdot \left(\left(\left(\left(\sin \left(\left(\mathsf{PI}\left(\right) \cdot 0.005555555555555556\right) \cdot angle\_m\right) \cdot \left(b - a\right)\right) \cdot \left(b + a\right)\right) \cdot \frac{2}{b + a}\right) \cdot \left(b + a\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(\left(\sin \left(\left({t\_0}^{2} \cdot t\_0\right) \cdot \left(angle\_m \cdot 0.005555555555555556\right)\right) \cdot 2\right) \cdot \left(b - a\right)\right) \cdot \left(b + a\right)\right) \cdot t\_1\\
\end{array}
\end{array}
\end{array}
if (/.f64 angle #s(literal 180 binary64)) < 4.9999999999999997e174Initial program 60.3%
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-*.f6477.4
Applied rewrites76.4%
Applied rewrites78.4%
lift-*.f64N/A
lift-/.f64N/A
/-rgt-identityN/A
*-commutativeN/A
lower-*.f6478.4
lift-+.f64N/A
+-commutativeN/A
lift-+.f6478.4
lift-*.f64N/A
*-commutativeN/A
lower-*.f6478.4
Applied rewrites78.4%
if 4.9999999999999997e174 < (/.f64 angle #s(literal 180 binary64)) Initial program 37.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-*.f6446.1
Applied rewrites42.7%
lift-PI.f64N/A
add-cube-cbrtN/A
lower-*.f64N/A
pow2N/A
lower-pow.f64N/A
lift-PI.f64N/A
lower-cbrt.f64N/A
lift-PI.f64N/A
lower-cbrt.f6447.3
Applied rewrites47.3%
Final simplification75.6%
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a b angle_m)
:precision binary64
(let* ((t_0 (- (pow b 2.0) (pow a 2.0)))
(t_1 (* (* (* (PI) angle_m) a) (* -0.011111111111111112 a))))
(*
angle_s
(if (<= t_0 -2e-244)
t_1
(if (<= t_0 INFINITY)
(* (* (* (* b b) (PI)) angle_m) 0.011111111111111112)
t_1)))))\begin{array}{l}
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
\begin{array}{l}
t_0 := {b}^{2} - {a}^{2}\\
t_1 := \left(\left(\mathsf{PI}\left(\right) \cdot angle\_m\right) \cdot a\right) \cdot \left(-0.011111111111111112 \cdot a\right)\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_0 \leq -2 \cdot 10^{-244}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_0 \leq \infty:\\
\;\;\;\;\left(\left(\left(b \cdot b\right) \cdot \mathsf{PI}\left(\right)\right) \cdot angle\_m\right) \cdot 0.011111111111111112\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\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%
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a b angle_m)
:precision binary64
(let* ((t_0 (* (PI) angle_m))
(t_1 (- (pow b 2.0) (pow a 2.0)))
(t_2 (* (* t_0 a) (* -0.011111111111111112 a))))
(*
angle_s
(if (<= t_1 -2e-244)
t_2
(if (<= t_1 INFINITY) (* (* t_0 0.011111111111111112) (* b b)) t_2)))))\begin{array}{l}
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
\begin{array}{l}
t_0 := \mathsf{PI}\left(\right) \cdot angle\_m\\
t_1 := {b}^{2} - {a}^{2}\\
t_2 := \left(t\_0 \cdot a\right) \cdot \left(-0.011111111111111112 \cdot a\right)\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_1 \leq -2 \cdot 10^{-244}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_1 \leq \infty:\\
\;\;\;\;\left(t\_0 \cdot 0.011111111111111112\right) \cdot \left(b \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\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 b around inf
Applied rewrites63.0%
Final simplification64.8%
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a b angle_m)
:precision binary64
(let* ((t_0 (sqrt (PI)))
(t_1 (* (* (PI) 0.005555555555555556) angle_m))
(t_2 (sin t_1)))
(*
angle_s
(if (<= (/ angle_m 180.0) 1e+196)
(* (* (cos t_1) 2.0) (* (* t_2 (- b a)) (+ b a)))
(*
(* (cos (* (* (* t_0 t_0) 0.005555555555555556) angle_m)) t_2)
(* (* (- b a) (+ b a)) 2.0))))))\begin{array}{l}
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
\begin{array}{l}
t_0 := \sqrt{\mathsf{PI}\left(\right)}\\
t_1 := \left(\mathsf{PI}\left(\right) \cdot 0.005555555555555556\right) \cdot angle\_m\\
t_2 := \sin t\_1\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;\frac{angle\_m}{180} \leq 10^{+196}:\\
\;\;\;\;\left(\cos t\_1 \cdot 2\right) \cdot \left(\left(t\_2 \cdot \left(b - a\right)\right) \cdot \left(b + a\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\cos \left(\left(\left(t\_0 \cdot t\_0\right) \cdot 0.005555555555555556\right) \cdot angle\_m\right) \cdot t\_2\right) \cdot \left(\left(\left(b - a\right) \cdot \left(b + a\right)\right) \cdot 2\right)\\
\end{array}
\end{array}
\end{array}
if (/.f64 angle #s(literal 180 binary64)) < 9.9999999999999995e195Initial program 59.8%
Taylor expanded in angle around inf
*-commutativeN/A
associate-*r*N/A
associate-*l*N/A
lower-*.f64N/A
Applied rewrites66.0%
Applied rewrites65.0%
Applied rewrites76.8%
if 9.9999999999999995e195 < (/.f64 angle #s(literal 180 binary64)) Initial program 36.9%
Taylor expanded in angle around inf
*-commutativeN/A
associate-*r*N/A
associate-*l*N/A
lower-*.f64N/A
Applied rewrites32.6%
Applied rewrites61.4%
Final simplification75.8%
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a b angle_m)
:precision binary64
(let* ((t_0 (* (* (PI) 0.005555555555555556) angle_m)))
(*
angle_s
(if (<= (/ angle_m 180.0) 1e+196)
(* (* (cos t_0) 2.0) (* (* (sin t_0) (- b a)) (+ b a)))
(*
(*
(*
(* (* b b) (sin (* (* (PI) angle_m) 0.005555555555555556)))
(/ 2.0 (+ b a)))
(+ b a))
(cos (* (/ angle_m 180.0) (PI))))))))\begin{array}{l}
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
\begin{array}{l}
t_0 := \left(\mathsf{PI}\left(\right) \cdot 0.005555555555555556\right) \cdot angle\_m\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;\frac{angle\_m}{180} \leq 10^{+196}:\\
\;\;\;\;\left(\cos t\_0 \cdot 2\right) \cdot \left(\left(\sin t\_0 \cdot \left(b - a\right)\right) \cdot \left(b + a\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(\left(\left(b \cdot b\right) \cdot \sin \left(\left(\mathsf{PI}\left(\right) \cdot angle\_m\right) \cdot 0.005555555555555556\right)\right) \cdot \frac{2}{b + a}\right) \cdot \left(b + a\right)\right) \cdot \cos \left(\frac{angle\_m}{180} \cdot \mathsf{PI}\left(\right)\right)\\
\end{array}
\end{array}
\end{array}
if (/.f64 angle #s(literal 180 binary64)) < 9.9999999999999995e195Initial program 59.8%
Taylor expanded in angle around inf
*-commutativeN/A
associate-*r*N/A
associate-*l*N/A
lower-*.f64N/A
Applied rewrites66.0%
Applied rewrites65.0%
Applied rewrites76.8%
if 9.9999999999999995e195 < (/.f64 angle #s(literal 180 binary64)) Initial program 36.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-*.f6448.7
Applied rewrites49.9%
Applied rewrites44.0%
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.f64N/A
unpow2N/A
lower-*.f6449.8
Applied rewrites49.8%
Final simplification75.0%
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a b angle_m)
:precision binary64
(*
angle_s
(if (<= b 6.4e+226)
(* (* (sin (* (* (PI) angle_m) 0.011111111111111112)) (- b a)) (+ b a))
(*
(*
(*
(fma
(* (* angle_m angle_m) -5.7155921353452215e-8)
(pow (PI) 3.0)
(* 0.011111111111111112 (PI)))
(* (- b a) (+ b a)))
angle_m)
(cos (* (/ angle_m 180.0) (PI)))))))\begin{array}{l}
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;b \leq 6.4 \cdot 10^{+226}:\\
\;\;\;\;\left(\sin \left(\left(\mathsf{PI}\left(\right) \cdot angle\_m\right) \cdot 0.011111111111111112\right) \cdot \left(b - a\right)\right) \cdot \left(b + a\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(\mathsf{fma}\left(\left(angle\_m \cdot angle\_m\right) \cdot -5.7155921353452215 \cdot 10^{-8}, {\mathsf{PI}\left(\right)}^{3}, 0.011111111111111112 \cdot \mathsf{PI}\left(\right)\right) \cdot \left(\left(b - a\right) \cdot \left(b + a\right)\right)\right) \cdot angle\_m\right) \cdot \cos \left(\frac{angle\_m}{180} \cdot \mathsf{PI}\left(\right)\right)\\
\end{array}
\end{array}
if b < 6.39999999999999954e226Initial program 59.1%
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 rewrites72.0%
if 6.39999999999999954e226 < b Initial program 50.5%
Taylor expanded in angle around 0
*-commutativeN/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
+-commutativeN/A
lower-*.f64N/A
Applied rewrites89.0%
Final simplification73.8%
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a b angle_m)
:precision binary64
(let* ((t_0 (* (PI) 0.005555555555555556)) (t_1 (* t_0 angle_m)))
(*
angle_s
(if (<= (/ angle_m 180.0) 1.5e+237)
(* (* (cos t_1) 2.0) (* (* (sin t_1) (- b a)) (+ b a)))
(*
(*
(fma (* -1.1431184270690443e-7 (pow (PI) 3.0)) (* angle_m angle_m) t_0)
angle_m)
(* (* (- b a) (+ b a)) 2.0))))))\begin{array}{l}
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
\begin{array}{l}
t_0 := \mathsf{PI}\left(\right) \cdot 0.005555555555555556\\
t_1 := t\_0 \cdot angle\_m\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;\frac{angle\_m}{180} \leq 1.5 \cdot 10^{+237}:\\
\;\;\;\;\left(\cos t\_1 \cdot 2\right) \cdot \left(\left(\sin t\_1 \cdot \left(b - a\right)\right) \cdot \left(b + a\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\mathsf{fma}\left(-1.1431184270690443 \cdot 10^{-7} \cdot {\mathsf{PI}\left(\right)}^{3}, angle\_m \cdot angle\_m, t\_0\right) \cdot angle\_m\right) \cdot \left(\left(\left(b - a\right) \cdot \left(b + a\right)\right) \cdot 2\right)\\
\end{array}
\end{array}
\end{array}
if (/.f64 angle #s(literal 180 binary64)) < 1.5e237Initial program 59.4%
Taylor expanded in angle around inf
*-commutativeN/A
associate-*r*N/A
associate-*l*N/A
lower-*.f64N/A
Applied rewrites65.6%
Applied rewrites64.6%
Applied rewrites76.3%
if 1.5e237 < (/.f64 angle #s(literal 180 binary64)) Initial program 37.6%
Taylor expanded in angle around inf
*-commutativeN/A
associate-*r*N/A
associate-*l*N/A
lower-*.f64N/A
Applied rewrites32.3%
Taylor expanded in angle around 0
Applied rewrites50.7%
Final simplification74.9%
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a b angle_m)
:precision binary64
(*
angle_s
(if (<= (/ angle_m 180.0) 1.5e+237)
(* (* (sin (* (* (PI) angle_m) 0.011111111111111112)) (- b a)) (+ b a))
(*
(*
(fma
(* -1.1431184270690443e-7 (pow (PI) 3.0))
(* angle_m angle_m)
(* (PI) 0.005555555555555556))
angle_m)
(* (* (- b a) (+ b a)) 2.0)))))\begin{array}{l}
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;\frac{angle\_m}{180} \leq 1.5 \cdot 10^{+237}:\\
\;\;\;\;\left(\sin \left(\left(\mathsf{PI}\left(\right) \cdot angle\_m\right) \cdot 0.011111111111111112\right) \cdot \left(b - a\right)\right) \cdot \left(b + a\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\mathsf{fma}\left(-1.1431184270690443 \cdot 10^{-7} \cdot {\mathsf{PI}\left(\right)}^{3}, angle\_m \cdot angle\_m, \mathsf{PI}\left(\right) \cdot 0.005555555555555556\right) \cdot angle\_m\right) \cdot \left(\left(\left(b - a\right) \cdot \left(b + a\right)\right) \cdot 2\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%
Taylor expanded in angle around inf
*-commutativeN/A
associate-*r*N/A
associate-*l*N/A
lower-*.f64N/A
Applied rewrites32.3%
Taylor expanded in angle around 0
Applied rewrites50.7%
Final simplification73.9%
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a b angle_m)
:precision binary64
(*
angle_s
(if (<= (pow a 2.0) 2e+276)
(fma
(* (* a a) -0.011111111111111112)
(* (PI) angle_m)
(* (* (* (* (PI) b) angle_m) 0.011111111111111112) b))
(* (* (* -0.011111111111111112 a) angle_m) (* (PI) a)))))\begin{array}{l}
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;{a}^{2} \leq 2 \cdot 10^{+276}:\\
\;\;\;\;\mathsf{fma}\left(\left(a \cdot a\right) \cdot -0.011111111111111112, \mathsf{PI}\left(\right) \cdot angle\_m, \left(\left(\left(\mathsf{PI}\left(\right) \cdot b\right) \cdot angle\_m\right) \cdot 0.011111111111111112\right) \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(-0.011111111111111112 \cdot a\right) \cdot angle\_m\right) \cdot \left(\mathsf{PI}\left(\right) \cdot a\right)\\
\end{array}
\end{array}
if (pow.f64 a #s(literal 2 binary64)) < 2.0000000000000001e276Initial 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.5
Applied rewrites60.5%
Taylor expanded in b around 0
Applied rewrites64.4%
if 2.0000000000000001e276 < (pow.f64 a #s(literal 2 binary64)) Initial program 46.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.4
Applied rewrites55.4%
Taylor expanded in a around inf
Applied rewrites55.5%
Applied rewrites73.6%
Applied rewrites73.7%
Final simplification67.7%
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a b angle_m)
:precision binary64
(let* ((t_0 (* (PI) angle_m)))
(*
angle_s
(if (<= (/ angle_m 180.0) 1e+248)
(* (* (sin (* t_0 0.011111111111111112)) (- b a)) (+ b a))
(* (* (* a a) -0.011111111111111112) t_0)))))\begin{array}{l}
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
\begin{array}{l}
t_0 := \mathsf{PI}\left(\right) \cdot angle\_m\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;\frac{angle\_m}{180} \leq 10^{+248}:\\
\;\;\;\;\left(\sin \left(t\_0 \cdot 0.011111111111111112\right) \cdot \left(b - a\right)\right) \cdot \left(b + a\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(a \cdot a\right) \cdot -0.011111111111111112\right) \cdot t\_0\\
\end{array}
\end{array}
\end{array}
if (/.f64 angle #s(literal 180 binary64)) < 1.00000000000000005e248Initial 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.2%
if 1.00000000000000005e248 < (/.f64 angle #s(literal 180 binary64)) Initial program 35.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--.f6426.0
Applied rewrites26.0%
Taylor expanded in a around inf
Applied rewrites52.1%
Final simplification74.1%
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a b angle_m)
:precision binary64
(*
angle_s
(if (<= (pow a 2.0) 5e+282)
(* (* (* (- b a) (+ b a)) angle_m) (* 0.011111111111111112 (PI)))
(* (* (* -0.011111111111111112 a) angle_m) (* (PI) a)))))\begin{array}{l}
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;{a}^{2} \leq 5 \cdot 10^{+282}:\\
\;\;\;\;\left(\left(\left(b - a\right) \cdot \left(b + a\right)\right) \cdot angle\_m\right) \cdot \left(0.011111111111111112 \cdot \mathsf{PI}\left(\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(-0.011111111111111112 \cdot a\right) \cdot angle\_m\right) \cdot \left(\mathsf{PI}\left(\right) \cdot a\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%
Final simplification65.2%
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a b angle_m)
:precision binary64
(*
angle_s
(if (<= (pow a 2.0) 1e+283)
(* (* (* 0.011111111111111112 (PI)) angle_m) (* (- b a) (+ b a)))
(* (* (* -0.011111111111111112 a) angle_m) (* (PI) a)))))\begin{array}{l}
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;{a}^{2} \leq 10^{+283}:\\
\;\;\;\;\left(\left(0.011111111111111112 \cdot \mathsf{PI}\left(\right)\right) \cdot angle\_m\right) \cdot \left(\left(b - a\right) \cdot \left(b + a\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(-0.011111111111111112 \cdot a\right) \cdot angle\_m\right) \cdot \left(\mathsf{PI}\left(\right) \cdot a\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%
Final simplification65.2%
angle\_m = (fabs.f64 angle) angle\_s = (copysign.f64 #s(literal 1 binary64) angle) (FPCore (angle_s a b angle_m) :precision binary64 (* angle_s (* (* (* (PI) angle_m) a) (* -0.011111111111111112 a))))
\begin{array}{l}
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
angle\_s \cdot \left(\left(\left(\mathsf{PI}\left(\right) \cdot angle\_m\right) \cdot a\right) \cdot \left(-0.011111111111111112 \cdot a\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%
Final simplification41.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)))))