
(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 21 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}
a_m = (fabs.f64 a)
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a_m b angle_m)
:precision binary64
(let* ((t_0 (* (PI) (/ angle_m 180.0)))
(t_1 (/ -1.0 (+ b a_m)))
(t_2 (/ t_1 (- b a_m))))
(*
angle_s
(if (<= (/ angle_m 180.0) 3e+79)
(*
(cos (* (/ (PI) (pow angle_m -1.0)) 0.005555555555555556))
(*
(* (* (sin (* (PI) (* 0.005555555555555556 angle_m))) 2.0) (+ b a_m))
(- b a_m)))
(if (<= (/ angle_m 180.0) 1e+238)
(/ (sin (/ (* 2.0 (PI)) (/ 180.0 angle_m))) (/ t_1 (- a_m b)))
(* (* (* (pow (* t_2 t_2) -0.5) 2.0) (sin t_0)) (cos t_0)))))))\begin{array}{l}
a_m = \left|a\right|
\\
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
\begin{array}{l}
t_0 := \mathsf{PI}\left(\right) \cdot \frac{angle\_m}{180}\\
t_1 := \frac{-1}{b + a\_m}\\
t_2 := \frac{t\_1}{b - a\_m}\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;\frac{angle\_m}{180} \leq 3 \cdot 10^{+79}:\\
\;\;\;\;\cos \left(\frac{\mathsf{PI}\left(\right)}{{angle\_m}^{-1}} \cdot 0.005555555555555556\right) \cdot \left(\left(\left(\sin \left(\mathsf{PI}\left(\right) \cdot \left(0.005555555555555556 \cdot angle\_m\right)\right) \cdot 2\right) \cdot \left(b + a\_m\right)\right) \cdot \left(b - a\_m\right)\right)\\
\mathbf{elif}\;\frac{angle\_m}{180} \leq 10^{+238}:\\
\;\;\;\;\frac{\sin \left(\frac{2 \cdot \mathsf{PI}\left(\right)}{\frac{180}{angle\_m}}\right)}{\frac{t\_1}{a\_m - b}}\\
\mathbf{else}:\\
\;\;\;\;\left(\left({\left(t\_2 \cdot t\_2\right)}^{-0.5} \cdot 2\right) \cdot \sin t\_0\right) \cdot \cos t\_0\\
\end{array}
\end{array}
\end{array}
if (/.f64 angle #s(literal 180 binary64)) < 2.99999999999999974e79Initial program 57.8%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*r*N/A
lift--.f64N/A
lift-pow.f64N/A
unpow2N/A
lift-pow.f64N/A
unpow2N/A
difference-of-squaresN/A
associate-*r*N/A
lower-*.f64N/A
Applied rewrites75.8%
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
associate-*r/N/A
*-commutativeN/A
div-invN/A
times-fracN/A
metadata-evalN/A
lower-*.f64N/A
lower-/.f64N/A
inv-powN/A
lower-pow.f6476.5
Applied rewrites76.5%
if 2.99999999999999974e79 < (/.f64 angle #s(literal 180 binary64)) < 1e238Initial program 33.3%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*r*N/A
lift--.f64N/A
lift-pow.f64N/A
unpow2N/A
lift-pow.f64N/A
unpow2N/A
difference-of-squaresN/A
associate-*r*N/A
lower-*.f64N/A
Applied rewrites36.4%
Applied rewrites38.8%
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lift-*.f64N/A
metadata-evalN/A
associate-/r/N/A
un-div-invN/A
lower-/.f64N/A
lower-*.f64N/A
lower-/.f6443.9
Applied rewrites43.9%
if 1e238 < (/.f64 angle #s(literal 180 binary64)) Initial program 39.2%
lift--.f64N/A
flip--N/A
clear-numN/A
lower-/.f64N/A
clear-numN/A
flip--N/A
lift--.f64N/A
inv-powN/A
lower-pow.f6439.2
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-+.f6445.1
Applied rewrites45.1%
Applied rewrites53.6%
Final simplification70.7%
a_m = (fabs.f64 a)
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a_m b angle_m)
:precision binary64
(let* ((t_0
(*
(* (* (sin (* (PI) (* 0.005555555555555556 angle_m))) 2.0) (+ b a_m))
(- b a_m)))
(t_1 (* (PI) (/ angle_m 180.0)))
(t_2 (cos t_1)))
(*
angle_s
(if (<=
(* (* (sin t_1) (* (- (pow b 2.0) (pow a_m 2.0)) 2.0)) t_2)
50000000000.0)
(* t_2 t_0)
(* (cos (* (exp (- (log (/ 180.0 angle_m)))) (PI))) t_0)))))\begin{array}{l}
a_m = \left|a\right|
\\
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
\begin{array}{l}
t_0 := \left(\left(\sin \left(\mathsf{PI}\left(\right) \cdot \left(0.005555555555555556 \cdot angle\_m\right)\right) \cdot 2\right) \cdot \left(b + a\_m\right)\right) \cdot \left(b - a\_m\right)\\
t_1 := \mathsf{PI}\left(\right) \cdot \frac{angle\_m}{180}\\
t_2 := \cos t\_1\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;\left(\sin t\_1 \cdot \left(\left({b}^{2} - {a\_m}^{2}\right) \cdot 2\right)\right) \cdot t\_2 \leq 50000000000:\\
\;\;\;\;t\_2 \cdot t\_0\\
\mathbf{else}:\\
\;\;\;\;\cos \left(e^{-\log \left(\frac{180}{angle\_m}\right)} \cdot \mathsf{PI}\left(\right)\right) \cdot t\_0\\
\end{array}
\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))))) < 5e10Initial program 61.1%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*r*N/A
lift--.f64N/A
lift-pow.f64N/A
unpow2N/A
lift-pow.f64N/A
unpow2N/A
difference-of-squaresN/A
associate-*r*N/A
lower-*.f64N/A
Applied rewrites69.0%
if 5e10 < (*.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 40.2%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*r*N/A
lift--.f64N/A
lift-pow.f64N/A
unpow2N/A
lift-pow.f64N/A
unpow2N/A
difference-of-squaresN/A
associate-*r*N/A
lower-*.f64N/A
Applied rewrites69.5%
lift-/.f64N/A
clear-numN/A
inv-powN/A
pow-to-expN/A
lower-exp.f64N/A
lower-*.f64N/A
lower-log.f64N/A
lower-/.f6439.0
Applied rewrites39.0%
Final simplification58.0%
a_m = (fabs.f64 a)
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a_m b angle_m)
:precision binary64
(let* ((t_0 (pow (/ 180.0 angle_m) -0.5)) (t_1 (pow (cbrt (sqrt (PI))) 3.0)))
(*
angle_s
(if (<= (pow a_m 2.0) 1e+168)
(*
(cos (* (* t_0 t_0) (PI)))
(*
(* (* (sin (* (PI) (* 0.005555555555555556 angle_m))) 2.0) (+ b a_m))
(- b a_m)))
(*
(cos (* (PI) (/ angle_m 180.0)))
(*
(*
(* (sin (* (* t_1 t_1) (* 0.005555555555555556 angle_m))) 2.0)
(+ b a_m))
(- b a_m)))))))\begin{array}{l}
a_m = \left|a\right|
\\
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
\begin{array}{l}
t_0 := {\left(\frac{180}{angle\_m}\right)}^{-0.5}\\
t_1 := {\left(\sqrt[3]{\sqrt{\mathsf{PI}\left(\right)}}\right)}^{3}\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;{a\_m}^{2} \leq 10^{+168}:\\
\;\;\;\;\cos \left(\left(t\_0 \cdot t\_0\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \left(\left(\left(\sin \left(\mathsf{PI}\left(\right) \cdot \left(0.005555555555555556 \cdot angle\_m\right)\right) \cdot 2\right) \cdot \left(b + a\_m\right)\right) \cdot \left(b - a\_m\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\cos \left(\mathsf{PI}\left(\right) \cdot \frac{angle\_m}{180}\right) \cdot \left(\left(\left(\sin \left(\left(t\_1 \cdot t\_1\right) \cdot \left(0.005555555555555556 \cdot angle\_m\right)\right) \cdot 2\right) \cdot \left(b + a\_m\right)\right) \cdot \left(b - a\_m\right)\right)\\
\end{array}
\end{array}
\end{array}
if (pow.f64 a #s(literal 2 binary64)) < 9.9999999999999993e167Initial program 59.5%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*r*N/A
lift--.f64N/A
lift-pow.f64N/A
unpow2N/A
lift-pow.f64N/A
unpow2N/A
difference-of-squaresN/A
associate-*r*N/A
lower-*.f64N/A
Applied rewrites67.2%
lift-/.f64N/A
clear-numN/A
inv-powN/A
sqr-powN/A
lower-*.f64N/A
lower-pow.f64N/A
lower-/.f64N/A
metadata-evalN/A
lower-pow.f64N/A
lower-/.f64N/A
metadata-eval36.0
Applied rewrites36.0%
if 9.9999999999999993e167 < (pow.f64 a #s(literal 2 binary64)) Initial program 44.1%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*r*N/A
lift--.f64N/A
lift-pow.f64N/A
unpow2N/A
lift-pow.f64N/A
unpow2N/A
difference-of-squaresN/A
associate-*r*N/A
lower-*.f64N/A
Applied rewrites72.2%
rem-cube-cbrtN/A
lift-PI.f64N/A
add-sqr-sqrtN/A
cbrt-prodN/A
unpow-prod-downN/A
lower-*.f64N/A
lower-pow.f64N/A
lower-cbrt.f64N/A
lift-PI.f64N/A
lower-sqrt.f64N/A
lower-pow.f64N/A
lower-cbrt.f64N/A
lift-PI.f64N/A
lower-sqrt.f6476.9
Applied rewrites76.9%
Final simplification52.1%
a_m = (fabs.f64 a)
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a_m b angle_m)
:precision binary64
(let* ((t_0 (cbrt (PI))) (t_1 (sqrt (PI))))
(*
angle_s
(if (<= (/ angle_m 180.0) 1e+132)
(*
(cos (* (* t_0 (* 0.005555555555555556 angle_m)) (pow t_0 2.0)))
(*
(- b a_m)
(*
(+ b a_m)
(*
2.0
(sin (* (cbrt (pow (PI) 3.0)) (* 0.005555555555555556 angle_m)))))))
(/
(sin (* (* t_1 (* 0.011111111111111112 angle_m)) t_1))
(/ (/ -1.0 (+ b a_m)) (- a_m b)))))))\begin{array}{l}
a_m = \left|a\right|
\\
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 := \sqrt{\mathsf{PI}\left(\right)}\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;\frac{angle\_m}{180} \leq 10^{+132}:\\
\;\;\;\;\cos \left(\left(t\_0 \cdot \left(0.005555555555555556 \cdot angle\_m\right)\right) \cdot {t\_0}^{2}\right) \cdot \left(\left(b - a\_m\right) \cdot \left(\left(b + a\_m\right) \cdot \left(2 \cdot \sin \left(\sqrt[3]{{\mathsf{PI}\left(\right)}^{3}} \cdot \left(0.005555555555555556 \cdot angle\_m\right)\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\sin \left(\left(t\_1 \cdot \left(0.011111111111111112 \cdot angle\_m\right)\right) \cdot t\_1\right)}{\frac{\frac{-1}{b + a\_m}}{a\_m - b}}\\
\end{array}
\end{array}
\end{array}
if (/.f64 angle #s(literal 180 binary64)) < 9.99999999999999991e131Initial program 56.1%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*r*N/A
lift--.f64N/A
lift-pow.f64N/A
unpow2N/A
lift-pow.f64N/A
unpow2N/A
difference-of-squaresN/A
associate-*r*N/A
lower-*.f64N/A
Applied rewrites73.3%
lift-*.f64N/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.f6473.6
lift-/.f64N/A
div-invN/A
metadata-evalN/A
*-commutativeN/A
lift-*.f6474.0
Applied rewrites74.0%
lift-PI.f64N/A
add-cbrt-cubeN/A
lower-cbrt.f64N/A
rem-cube-cbrtN/A
add-cbrt-cubeN/A
lift-PI.f64N/A
lower-pow.f6476.4
Applied rewrites76.4%
if 9.99999999999999991e131 < (/.f64 angle #s(literal 180 binary64)) Initial program 37.4%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*r*N/A
lift--.f64N/A
lift-pow.f64N/A
unpow2N/A
lift-pow.f64N/A
unpow2N/A
difference-of-squaresN/A
associate-*r*N/A
lower-*.f64N/A
Applied rewrites43.7%
Applied rewrites46.2%
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lift-*.f64N/A
associate-*r*N/A
metadata-evalN/A
lift-*.f64N/A
associate-*l*N/A
lift-PI.f64N/A
*-commutativeN/A
lift-PI.f64N/A
associate-*r*N/A
lift-PI.f64N/A
add-sqr-sqrtN/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-PI.f64N/A
lower-sqrt.f64N/A
lift-PI.f64N/A
lower-sqrt.f6439.3
Applied rewrites39.3%
Final simplification71.2%
a_m = (fabs.f64 a)
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a_m b angle_m)
:precision binary64
(let* ((t_0 (cos (* (PI) (/ angle_m 180.0)))))
(*
angle_s
(if (<= (- (pow b 2.0) (pow a_m 2.0)) (- INFINITY))
(*
(*
(* (* (* (* (PI) angle_m) 0.005555555555555556) 2.0) (+ b a_m))
(- b a_m))
t_0)
(*
t_0
(*
(* (* (sin (* (PI) (* 0.005555555555555556 angle_m))) 2.0) (+ b a_m))
(- b a_m)))))))\begin{array}{l}
a_m = \left|a\right|
\\
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
\begin{array}{l}
t_0 := \cos \left(\mathsf{PI}\left(\right) \cdot \frac{angle\_m}{180}\right)\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;{b}^{2} - {a\_m}^{2} \leq -\infty:\\
\;\;\;\;\left(\left(\left(\left(\left(\mathsf{PI}\left(\right) \cdot angle\_m\right) \cdot 0.005555555555555556\right) \cdot 2\right) \cdot \left(b + a\_m\right)\right) \cdot \left(b - a\_m\right)\right) \cdot t\_0\\
\mathbf{else}:\\
\;\;\;\;t\_0 \cdot \left(\left(\left(\sin \left(\mathsf{PI}\left(\right) \cdot \left(0.005555555555555556 \cdot angle\_m\right)\right) \cdot 2\right) \cdot \left(b + a\_m\right)\right) \cdot \left(b - a\_m\right)\right)\\
\end{array}
\end{array}
\end{array}
if (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) < -inf.0Initial program 49.4%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*r*N/A
lift--.f64N/A
lift-pow.f64N/A
unpow2N/A
lift-pow.f64N/A
unpow2N/A
difference-of-squaresN/A
associate-*r*N/A
lower-*.f64N/A
Applied rewrites77.0%
Taylor expanded in angle around 0
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-PI.f6485.4
Applied rewrites85.4%
if -inf.0 < (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) Initial program 54.4%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*r*N/A
lift--.f64N/A
lift-pow.f64N/A
unpow2N/A
lift-pow.f64N/A
unpow2N/A
difference-of-squaresN/A
associate-*r*N/A
lower-*.f64N/A
Applied rewrites67.4%
Final simplification70.7%
a_m = (fabs.f64 a)
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a_m b angle_m)
:precision binary64
(let* ((t_0 (sqrt (PI))))
(*
angle_s
(if (<= (/ angle_m 180.0) 2e+115)
(*
(cos (* (/ (PI) (pow angle_m -1.0)) 0.005555555555555556))
(*
(* (* (sin (* (PI) (* 0.005555555555555556 angle_m))) 2.0) (+ b a_m))
(- b a_m)))
(/
(sin (* (* t_0 (* 0.011111111111111112 angle_m)) t_0))
(/ (/ -1.0 (+ b a_m)) (- a_m b)))))))\begin{array}{l}
a_m = \left|a\right|
\\
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
\begin{array}{l}
t_0 := \sqrt{\mathsf{PI}\left(\right)}\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;\frac{angle\_m}{180} \leq 2 \cdot 10^{+115}:\\
\;\;\;\;\cos \left(\frac{\mathsf{PI}\left(\right)}{{angle\_m}^{-1}} \cdot 0.005555555555555556\right) \cdot \left(\left(\left(\sin \left(\mathsf{PI}\left(\right) \cdot \left(0.005555555555555556 \cdot angle\_m\right)\right) \cdot 2\right) \cdot \left(b + a\_m\right)\right) \cdot \left(b - a\_m\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\sin \left(\left(t\_0 \cdot \left(0.011111111111111112 \cdot angle\_m\right)\right) \cdot t\_0\right)}{\frac{\frac{-1}{b + a\_m}}{a\_m - b}}\\
\end{array}
\end{array}
\end{array}
if (/.f64 angle #s(literal 180 binary64)) < 2e115Initial program 56.5%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*r*N/A
lift--.f64N/A
lift-pow.f64N/A
unpow2N/A
lift-pow.f64N/A
unpow2N/A
difference-of-squaresN/A
associate-*r*N/A
lower-*.f64N/A
Applied rewrites73.9%
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
associate-*r/N/A
*-commutativeN/A
div-invN/A
times-fracN/A
metadata-evalN/A
lower-*.f64N/A
lower-/.f64N/A
inv-powN/A
lower-pow.f6474.0
Applied rewrites74.0%
if 2e115 < (/.f64 angle #s(literal 180 binary64)) Initial program 36.0%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*r*N/A
lift--.f64N/A
lift-pow.f64N/A
unpow2N/A
lift-pow.f64N/A
unpow2N/A
difference-of-squaresN/A
associate-*r*N/A
lower-*.f64N/A
Applied rewrites41.9%
Applied rewrites44.3%
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lift-*.f64N/A
associate-*r*N/A
metadata-evalN/A
lift-*.f64N/A
associate-*l*N/A
lift-PI.f64N/A
*-commutativeN/A
lift-PI.f64N/A
associate-*r*N/A
lift-PI.f64N/A
add-sqr-sqrtN/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-PI.f64N/A
lower-sqrt.f64N/A
lift-PI.f64N/A
lower-sqrt.f6439.9
Applied rewrites39.9%
Final simplification68.9%
a_m = (fabs.f64 a)
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a_m b angle_m)
:precision binary64
(*
angle_s
(if (<= (- (pow b 2.0) (pow a_m 2.0)) -2e+298)
(*
(*
(* (* (* (* (PI) angle_m) 0.005555555555555556) 2.0) (+ b a_m))
(- b a_m))
(cos (* (PI) (/ angle_m 180.0))))
(*
(* (sin (* (* 0.011111111111111112 (PI)) angle_m)) (+ b a_m))
(- b a_m)))))\begin{array}{l}
a_m = \left|a\right|
\\
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;{b}^{2} - {a\_m}^{2} \leq -2 \cdot 10^{+298}:\\
\;\;\;\;\left(\left(\left(\left(\left(\mathsf{PI}\left(\right) \cdot angle\_m\right) \cdot 0.005555555555555556\right) \cdot 2\right) \cdot \left(b + a\_m\right)\right) \cdot \left(b - a\_m\right)\right) \cdot \cos \left(\mathsf{PI}\left(\right) \cdot \frac{angle\_m}{180}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\sin \left(\left(0.011111111111111112 \cdot \mathsf{PI}\left(\right)\right) \cdot angle\_m\right) \cdot \left(b + a\_m\right)\right) \cdot \left(b - a\_m\right)\\
\end{array}
\end{array}
if (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) < -1.9999999999999999e298Initial program 50.4%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*r*N/A
lift--.f64N/A
lift-pow.f64N/A
unpow2N/A
lift-pow.f64N/A
unpow2N/A
difference-of-squaresN/A
associate-*r*N/A
lower-*.f64N/A
Applied rewrites77.5%
Taylor expanded in angle around 0
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-PI.f6485.7
Applied rewrites85.7%
if -1.9999999999999999e298 < (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) Initial program 54.2%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*r*N/A
lift--.f64N/A
lift-pow.f64N/A
unpow2N/A
lift-pow.f64N/A
unpow2N/A
difference-of-squaresN/A
associate-*r*N/A
lower-*.f64N/A
Applied rewrites67.2%
Applied rewrites59.2%
lift-/.f64N/A
lift-/.f64N/A
associate-/r/N/A
*-commutativeN/A
lower-*.f64N/A
div-invN/A
lift-/.f64N/A
clear-numN/A
lift-+.f64N/A
+-commutativeN/A
flip-+N/A
lift--.f64N/A
associate-/l/N/A
neg-mul-1N/A
distribute-neg-frac2N/A
lift--.f64N/A
flip-+N/A
+-commutativeN/A
lift-+.f64N/A
Applied rewrites66.9%
Final simplification70.5%
a_m = (fabs.f64 a)
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a_m b angle_m)
:precision binary64
(*
angle_s
(if (<= (- (pow b 2.0) (pow a_m 2.0)) (- INFINITY))
(*
(* (* (* (* (+ b a_m) (PI)) angle_m) 0.011111111111111112) (- b a_m))
(cos (* (PI) (/ angle_m 180.0))))
(*
(* (sin (* (* 0.011111111111111112 (PI)) angle_m)) (+ b a_m))
(- b a_m)))))\begin{array}{l}
a_m = \left|a\right|
\\
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;{b}^{2} - {a\_m}^{2} \leq -\infty:\\
\;\;\;\;\left(\left(\left(\left(\left(b + a\_m\right) \cdot \mathsf{PI}\left(\right)\right) \cdot angle\_m\right) \cdot 0.011111111111111112\right) \cdot \left(b - a\_m\right)\right) \cdot \cos \left(\mathsf{PI}\left(\right) \cdot \frac{angle\_m}{180}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\sin \left(\left(0.011111111111111112 \cdot \mathsf{PI}\left(\right)\right) \cdot angle\_m\right) \cdot \left(b + a\_m\right)\right) \cdot \left(b - a\_m\right)\\
\end{array}
\end{array}
if (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) < -inf.0Initial program 49.4%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*r*N/A
lift--.f64N/A
lift-pow.f64N/A
unpow2N/A
lift-pow.f64N/A
unpow2N/A
difference-of-squaresN/A
associate-*r*N/A
lower-*.f64N/A
Applied rewrites77.0%
Taylor expanded in angle around 0
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-PI.f6485.3
Applied rewrites85.3%
if -inf.0 < (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) Initial program 54.4%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*r*N/A
lift--.f64N/A
lift-pow.f64N/A
unpow2N/A
lift-pow.f64N/A
unpow2N/A
difference-of-squaresN/A
associate-*r*N/A
lower-*.f64N/A
Applied rewrites67.4%
Applied rewrites59.4%
lift-/.f64N/A
lift-/.f64N/A
associate-/r/N/A
*-commutativeN/A
lower-*.f64N/A
div-invN/A
lift-/.f64N/A
clear-numN/A
lift-+.f64N/A
+-commutativeN/A
flip-+N/A
lift--.f64N/A
associate-/l/N/A
neg-mul-1N/A
distribute-neg-frac2N/A
lift--.f64N/A
flip-+N/A
+-commutativeN/A
lift-+.f64N/A
Applied rewrites67.1%
Final simplification70.5%
a_m = (fabs.f64 a)
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a_m b angle_m)
:precision binary64
(let* ((t_0 (sqrt (PI))) (t_1 (cos (* (PI) (/ angle_m 180.0)))))
(*
angle_s
(if (<= b 2.2e+215)
(*
t_1
(*
(* (* (sin (* (PI) (* 0.005555555555555556 angle_m))) 2.0) (+ b a_m))
(- b a_m)))
(*
(*
(*
(* (sin (* (* t_0 t_0) (* 0.005555555555555556 angle_m))) 2.0)
(+ b a_m))
(- b a_m))
t_1)))))\begin{array}{l}
a_m = \left|a\right|
\\
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 := \cos \left(\mathsf{PI}\left(\right) \cdot \frac{angle\_m}{180}\right)\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;b \leq 2.2 \cdot 10^{+215}:\\
\;\;\;\;t\_1 \cdot \left(\left(\left(\sin \left(\mathsf{PI}\left(\right) \cdot \left(0.005555555555555556 \cdot angle\_m\right)\right) \cdot 2\right) \cdot \left(b + a\_m\right)\right) \cdot \left(b - a\_m\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(\left(\sin \left(\left(t\_0 \cdot t\_0\right) \cdot \left(0.005555555555555556 \cdot angle\_m\right)\right) \cdot 2\right) \cdot \left(b + a\_m\right)\right) \cdot \left(b - a\_m\right)\right) \cdot t\_1\\
\end{array}
\end{array}
\end{array}
if b < 2.2000000000000001e215Initial program 55.4%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*r*N/A
lift--.f64N/A
lift-pow.f64N/A
unpow2N/A
lift-pow.f64N/A
unpow2N/A
difference-of-squaresN/A
associate-*r*N/A
lower-*.f64N/A
Applied rewrites68.6%
if 2.2000000000000001e215 < b Initial program 25.6%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*r*N/A
lift--.f64N/A
lift-pow.f64N/A
unpow2N/A
lift-pow.f64N/A
unpow2N/A
difference-of-squaresN/A
associate-*r*N/A
lower-*.f64N/A
Applied rewrites76.5%
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.f6488.1
Applied rewrites88.1%
Final simplification69.9%
a_m = (fabs.f64 a)
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a_m b angle_m)
:precision binary64
(let* ((t_0 (* (PI) (* 0.005555555555555556 angle_m))))
(*
angle_s
(if (<= a_m 5e+169)
(* (* (* (cos t_0) (- b a_m)) (* (sin t_0) 2.0)) (+ b a_m))
(*
(*
(* (* (* (* (PI) angle_m) 0.005555555555555556) 2.0) (+ b a_m))
(- b a_m))
(cos (* (PI) (/ angle_m 180.0))))))))\begin{array}{l}
a_m = \left|a\right|
\\
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
\begin{array}{l}
t_0 := \mathsf{PI}\left(\right) \cdot \left(0.005555555555555556 \cdot angle\_m\right)\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;a\_m \leq 5 \cdot 10^{+169}:\\
\;\;\;\;\left(\left(\cos t\_0 \cdot \left(b - a\_m\right)\right) \cdot \left(\sin t\_0 \cdot 2\right)\right) \cdot \left(b + a\_m\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(\left(\left(\left(\mathsf{PI}\left(\right) \cdot angle\_m\right) \cdot 0.005555555555555556\right) \cdot 2\right) \cdot \left(b + a\_m\right)\right) \cdot \left(b - a\_m\right)\right) \cdot \cos \left(\mathsf{PI}\left(\right) \cdot \frac{angle\_m}{180}\right)\\
\end{array}
\end{array}
\end{array}
if a < 5.00000000000000017e169Initial program 55.2%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*r*N/A
lift--.f64N/A
lift-pow.f64N/A
unpow2N/A
lift-pow.f64N/A
unpow2N/A
difference-of-squaresN/A
associate-*r*N/A
lower-*.f64N/A
Applied rewrites67.9%
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
+-commutativeN/A
lift-+.f64N/A
lower-*.f64N/A
Applied rewrites68.3%
if 5.00000000000000017e169 < a Initial program 39.3%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*r*N/A
lift--.f64N/A
lift-pow.f64N/A
unpow2N/A
lift-pow.f64N/A
unpow2N/A
difference-of-squaresN/A
associate-*r*N/A
lower-*.f64N/A
Applied rewrites79.2%
Taylor expanded in angle around 0
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-PI.f6489.6
Applied rewrites89.6%
Final simplification70.7%
a_m = (fabs.f64 a)
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a_m b angle_m)
:precision binary64
(*
angle_s
(if (<= (- (pow b 2.0) (pow a_m 2.0)) (- INFINITY))
(* -0.011111111111111112 (* (* (* (PI) angle_m) a_m) a_m))
(* (* (* (- b a_m) (+ b a_m)) (* 0.011111111111111112 (PI))) angle_m))))\begin{array}{l}
a_m = \left|a\right|
\\
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;{b}^{2} - {a\_m}^{2} \leq -\infty:\\
\;\;\;\;-0.011111111111111112 \cdot \left(\left(\left(\mathsf{PI}\left(\right) \cdot angle\_m\right) \cdot a\_m\right) \cdot a\_m\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(\left(b - a\_m\right) \cdot \left(b + a\_m\right)\right) \cdot \left(0.011111111111111112 \cdot \mathsf{PI}\left(\right)\right)\right) \cdot angle\_m\\
\end{array}
\end{array}
if (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) < -inf.0Initial program 49.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--.f6451.4
Applied rewrites51.4%
Taylor expanded in b around 0
Applied rewrites51.4%
Applied rewrites72.8%
Applied rewrites72.9%
if -inf.0 < (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) Initial program 54.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--.f6452.4
Applied rewrites52.4%
Applied rewrites52.5%
Final simplification56.3%
a_m = (fabs.f64 a)
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a_m b angle_m)
:precision binary64
(*
angle_s
(if (<= (- (pow b 2.0) (pow a_m 2.0)) (- INFINITY))
(* -0.011111111111111112 (* (* (* (PI) angle_m) a_m) a_m))
(* (* (* (- b a_m) (+ b a_m)) angle_m) (* 0.011111111111111112 (PI))))))\begin{array}{l}
a_m = \left|a\right|
\\
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;{b}^{2} - {a\_m}^{2} \leq -\infty:\\
\;\;\;\;-0.011111111111111112 \cdot \left(\left(\left(\mathsf{PI}\left(\right) \cdot angle\_m\right) \cdot a\_m\right) \cdot a\_m\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(\left(b - a\_m\right) \cdot \left(b + a\_m\right)\right) \cdot angle\_m\right) \cdot \left(0.011111111111111112 \cdot \mathsf{PI}\left(\right)\right)\\
\end{array}
\end{array}
if (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) < -inf.0Initial program 49.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--.f6451.4
Applied rewrites51.4%
Taylor expanded in b around 0
Applied rewrites51.4%
Applied rewrites72.8%
Applied rewrites72.9%
if -inf.0 < (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) Initial program 54.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--.f6452.4
Applied rewrites52.4%
Applied rewrites52.5%
Final simplification56.3%
a_m = (fabs.f64 a)
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a_m b angle_m)
:precision binary64
(*
angle_s
(if (<= (- (pow b 2.0) (pow a_m 2.0)) (- INFINITY))
(* -0.011111111111111112 (* (* (* (PI) angle_m) a_m) a_m))
(* (* (- b a_m) (+ b a_m)) (* (* 0.011111111111111112 (PI)) angle_m)))))\begin{array}{l}
a_m = \left|a\right|
\\
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;{b}^{2} - {a\_m}^{2} \leq -\infty:\\
\;\;\;\;-0.011111111111111112 \cdot \left(\left(\left(\mathsf{PI}\left(\right) \cdot angle\_m\right) \cdot a\_m\right) \cdot a\_m\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(b - a\_m\right) \cdot \left(b + a\_m\right)\right) \cdot \left(\left(0.011111111111111112 \cdot \mathsf{PI}\left(\right)\right) \cdot angle\_m\right)\\
\end{array}
\end{array}
if (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) < -inf.0Initial program 49.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--.f6451.4
Applied rewrites51.4%
Taylor expanded in b around 0
Applied rewrites51.4%
Applied rewrites72.8%
Applied rewrites72.9%
if -inf.0 < (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) Initial program 54.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--.f6452.4
Applied rewrites52.4%
Final simplification56.3%
a_m = (fabs.f64 a)
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a_m b angle_m)
:precision binary64
(*
angle_s
(if (<= (- (pow b 2.0) (pow a_m 2.0)) -5e-184)
(* (* (* (PI) angle_m) a_m) (* -0.011111111111111112 a_m))
(* (* (* (* b b) (PI)) angle_m) 0.011111111111111112))))\begin{array}{l}
a_m = \left|a\right|
\\
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;{b}^{2} - {a\_m}^{2} \leq -5 \cdot 10^{-184}:\\
\;\;\;\;\left(\left(\mathsf{PI}\left(\right) \cdot angle\_m\right) \cdot a\_m\right) \cdot \left(-0.011111111111111112 \cdot a\_m\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(\left(b \cdot b\right) \cdot \mathsf{PI}\left(\right)\right) \cdot angle\_m\right) \cdot 0.011111111111111112\\
\end{array}
\end{array}
if (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) < -5.00000000000000003e-184Initial program 55.9%
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 b around 0
Applied rewrites54.8%
Applied rewrites64.4%
if -5.00000000000000003e-184 < (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) Initial program 51.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--.f6450.4
Applied rewrites50.4%
Taylor expanded in b around inf
Applied rewrites49.5%
Final simplification55.7%
a_m = (fabs.f64 a)
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a_m b angle_m)
:precision binary64
(*
angle_s
(if (<= (pow a_m 2.0) 0.0)
(* (* b b) (sin (* (* (PI) angle_m) 0.011111111111111112)))
(* (* (* (* 0.011111111111111112 (PI)) angle_m) (- b a_m)) (+ b a_m)))))\begin{array}{l}
a_m = \left|a\right|
\\
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;{a\_m}^{2} \leq 0:\\
\;\;\;\;\left(b \cdot b\right) \cdot \sin \left(\left(\mathsf{PI}\left(\right) \cdot angle\_m\right) \cdot 0.011111111111111112\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(\left(0.011111111111111112 \cdot \mathsf{PI}\left(\right)\right) \cdot angle\_m\right) \cdot \left(b - a\_m\right)\right) \cdot \left(b + a\_m\right)\\
\end{array}
\end{array}
if (pow.f64 a #s(literal 2 binary64)) < 0.0Initial program 61.9%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*r*N/A
lift--.f64N/A
lift-pow.f64N/A
unpow2N/A
lift-pow.f64N/A
unpow2N/A
difference-of-squaresN/A
associate-*r*N/A
lower-*.f64N/A
Applied rewrites67.7%
Applied rewrites61.9%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-PI.f64N/A
unpow2N/A
lower-*.f6457.0
Applied rewrites57.0%
if 0.0 < (pow.f64 a #s(literal 2 binary64)) Initial program 50.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--.f6453.2
Applied rewrites53.2%
Applied rewrites65.6%
Final simplification63.6%
a_m = (fabs.f64 a)
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a_m b angle_m)
:precision binary64
(*
angle_s
(if (<= (/ angle_m 180.0) 5e+104)
(* (* (sin (* (* (PI) angle_m) 0.011111111111111112)) (- b a_m)) (+ b a_m))
(*
(sin (* (* (PI) (* 0.005555555555555556 angle_m)) 2.0))
(* (- b a_m) (+ b a_m))))))\begin{array}{l}
a_m = \left|a\right|
\\
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 5 \cdot 10^{+104}:\\
\;\;\;\;\left(\sin \left(\left(\mathsf{PI}\left(\right) \cdot angle\_m\right) \cdot 0.011111111111111112\right) \cdot \left(b - a\_m\right)\right) \cdot \left(b + a\_m\right)\\
\mathbf{else}:\\
\;\;\;\;\sin \left(\left(\mathsf{PI}\left(\right) \cdot \left(0.005555555555555556 \cdot angle\_m\right)\right) \cdot 2\right) \cdot \left(\left(b - a\_m\right) \cdot \left(b + a\_m\right)\right)\\
\end{array}
\end{array}
if (/.f64 angle #s(literal 180 binary64)) < 4.9999999999999997e104Initial program 56.9%
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 rewrites73.4%
if 4.9999999999999997e104 < (/.f64 angle #s(literal 180 binary64)) Initial program 35.8%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*r*N/A
lift--.f64N/A
lift-pow.f64N/A
unpow2N/A
lift-pow.f64N/A
unpow2N/A
difference-of-squaresN/A
associate-*r*N/A
lower-*.f64N/A
Applied rewrites43.6%
Applied rewrites45.7%
Final simplification68.9%
a_m = (fabs.f64 a)
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a_m b angle_m)
:precision binary64
(let* ((t_0 (* (* 0.011111111111111112 (PI)) angle_m)))
(*
angle_s
(if (<= (/ angle_m 180.0) 1e-50)
(* (* t_0 (- b a_m)) (+ b a_m))
(* (* (- b a_m) (+ b a_m)) (sin t_0))))))\begin{array}{l}
a_m = \left|a\right|
\\
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
\begin{array}{l}
t_0 := \left(0.011111111111111112 \cdot \mathsf{PI}\left(\right)\right) \cdot angle\_m\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;\frac{angle\_m}{180} \leq 10^{-50}:\\
\;\;\;\;\left(t\_0 \cdot \left(b - a\_m\right)\right) \cdot \left(b + a\_m\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(b - a\_m\right) \cdot \left(b + a\_m\right)\right) \cdot \sin t\_0\\
\end{array}
\end{array}
\end{array}
if (/.f64 angle #s(literal 180 binary64)) < 1.00000000000000001e-50Initial program 59.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--.f6460.6
Applied rewrites60.6%
Applied rewrites75.3%
if 1.00000000000000001e-50 < (/.f64 angle #s(literal 180 binary64)) Initial program 38.4%
lift--.f64N/A
sub-negN/A
+-commutativeN/A
lift-pow.f64N/A
unpow2N/A
distribute-lft-neg-inN/A
unpow1N/A
sqr-powN/A
associate-*r*N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-neg.f64N/A
metadata-evalN/A
unpow1/2N/A
lower-sqrt.f64N/A
metadata-evalN/A
unpow1/2N/A
lower-sqrt.f6425.8
lift-pow.f64N/A
unpow2N/A
lower-*.f6425.8
Applied rewrites25.8%
Applied rewrites41.0%
Final simplification65.6%
a_m = (fabs.f64 a) angle\_m = (fabs.f64 angle) angle\_s = (copysign.f64 #s(literal 1 binary64) angle) (FPCore (angle_s a_m b angle_m) :precision binary64 (* angle_s (* (* (sin (* (* 0.011111111111111112 (PI)) angle_m)) (+ b a_m)) (- b a_m))))
\begin{array}{l}
a_m = \left|a\right|
\\
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
angle\_s \cdot \left(\left(\sin \left(\left(0.011111111111111112 \cdot \mathsf{PI}\left(\right)\right) \cdot angle\_m\right) \cdot \left(b + a\_m\right)\right) \cdot \left(b - a\_m\right)\right)
\end{array}
Initial program 53.4%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*r*N/A
lift--.f64N/A
lift-pow.f64N/A
unpow2N/A
lift-pow.f64N/A
unpow2N/A
difference-of-squaresN/A
associate-*r*N/A
lower-*.f64N/A
Applied rewrites69.2%
Applied rewrites59.2%
lift-/.f64N/A
lift-/.f64N/A
associate-/r/N/A
*-commutativeN/A
lower-*.f64N/A
div-invN/A
lift-/.f64N/A
clear-numN/A
lift-+.f64N/A
+-commutativeN/A
flip-+N/A
lift--.f64N/A
associate-/l/N/A
neg-mul-1N/A
distribute-neg-frac2N/A
lift--.f64N/A
flip-+N/A
+-commutativeN/A
lift-+.f64N/A
Applied rewrites67.8%
Final simplification67.8%
a_m = (fabs.f64 a) angle\_m = (fabs.f64 angle) angle\_s = (copysign.f64 #s(literal 1 binary64) angle) (FPCore (angle_s a_m b angle_m) :precision binary64 (* angle_s (* (* (sin (* (* (PI) angle_m) 0.011111111111111112)) (- b a_m)) (+ b a_m))))
\begin{array}{l}
a_m = \left|a\right|
\\
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
angle\_s \cdot \left(\left(\sin \left(\left(\mathsf{PI}\left(\right) \cdot angle\_m\right) \cdot 0.011111111111111112\right) \cdot \left(b - a\_m\right)\right) \cdot \left(b + a\_m\right)\right)
\end{array}
Initial program 53.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 rewrites67.4%
Final simplification67.4%
a_m = (fabs.f64 a) angle\_m = (fabs.f64 angle) angle\_s = (copysign.f64 #s(literal 1 binary64) angle) (FPCore (angle_s a_m b angle_m) :precision binary64 (* angle_s (* (* (* (* 0.011111111111111112 (PI)) angle_m) (- b a_m)) (+ b a_m))))
\begin{array}{l}
a_m = \left|a\right|
\\
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
angle\_s \cdot \left(\left(\left(\left(0.011111111111111112 \cdot \mathsf{PI}\left(\right)\right) \cdot angle\_m\right) \cdot \left(b - a\_m\right)\right) \cdot \left(b + a\_m\right)\right)
\end{array}
Initial program 53.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--.f6452.3
Applied rewrites52.3%
Applied rewrites61.7%
Final simplification61.7%
a_m = (fabs.f64 a) angle\_m = (fabs.f64 angle) angle\_s = (copysign.f64 #s(literal 1 binary64) angle) (FPCore (angle_s a_m b angle_m) :precision binary64 (* angle_s (* (* (* (PI) angle_m) a_m) (* -0.011111111111111112 a_m))))
\begin{array}{l}
a_m = \left|a\right|
\\
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\_m\right) \cdot \left(-0.011111111111111112 \cdot a\_m\right)\right)
\end{array}
Initial program 53.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--.f6452.3
Applied rewrites52.3%
Taylor expanded in b around 0
Applied rewrites35.1%
Applied rewrites39.1%
Final simplification39.1%
herbie shell --seed 2024284
(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)))))