
(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 (sqrt (PI))) (t_1 (pow (cbrt t_0) 1.5)))
(*
angle_s
(if (<= (/ angle_m 180.0) 1e+84)
(*
(cos (* (* (* t_1 t_1) t_0) (/ angle_m 180.0)))
(*
(* (- a_m b) (* 2.0 (sin (* (* (PI) angle_m) -0.005555555555555556))))
(+ b a_m)))
(*
1.0
(*
(* (* (sin (* (* 0.005555555555555556 angle_m) (PI))) 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 := \sqrt{\mathsf{PI}\left(\right)}\\
t_1 := {\left(\sqrt[3]{t\_0}\right)}^{1.5}\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;\frac{angle\_m}{180} \leq 10^{+84}:\\
\;\;\;\;\cos \left(\left(\left(t\_1 \cdot t\_1\right) \cdot t\_0\right) \cdot \frac{angle\_m}{180}\right) \cdot \left(\left(\left(a\_m - b\right) \cdot \left(2 \cdot \sin \left(\left(\mathsf{PI}\left(\right) \cdot angle\_m\right) \cdot -0.005555555555555556\right)\right)\right) \cdot \left(b + a\_m\right)\right)\\
\mathbf{else}:\\
\;\;\;\;1 \cdot \left(\left(\left(\sin \left(\left(0.005555555555555556 \cdot angle\_m\right) \cdot \mathsf{PI}\left(\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 angle #s(literal 180 binary64)) < 1.00000000000000006e84Initial program 58.0%
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-*.f6476.1
Applied rewrites76.1%
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.f6475.4
Applied rewrites75.4%
lift-sqrt.f64N/A
lift-PI.f64N/A
add-cube-cbrtN/A
pow3N/A
sqrt-pow1N/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
metadata-evalN/A
lower-pow.f64N/A
lower-cbrt.f64N/A
metadata-eval78.9
Applied rewrites78.9%
lift-sin.f64N/A
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
metadata-evalN/A
div-invN/A
lift-/.f64N/A
*-commutativeN/A
lift-PI.f64N/A
lift-/.f64N/A
lift-PI.f64N/A
clear-numN/A
lift-/.f64N/A
div-invN/A
frac-2negN/A
distribute-frac-negN/A
sin-negN/A
lower-neg.f64N/A
lower-sin.f64N/A
*-lft-identityN/A
lift-/.f64N/A
div-invN/A
distribute-lft-neg-inN/A
times-fracN/A
Applied rewrites79.4%
if 1.00000000000000006e84 < (/.f64 angle #s(literal 180 binary64)) Initial program 32.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-*.f6432.7
Applied rewrites38.8%
Taylor expanded in angle around 0
Applied rewrites46.4%
Final simplification73.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
(let* ((t_0 (- (pow b 2.0) (pow a_m 2.0)))
(t_1 (* (* (* -0.011111111111111112 a_m) angle_m) (* (PI) a_m))))
(*
angle_s
(if (<= t_0 -2e+276)
t_1
(if (<= t_0 1e+183)
(* (* (- b a_m) (+ b a_m)) (* (* 0.011111111111111112 (PI)) angle_m))
(if (<= t_0 INFINITY)
(* (fma (* (* (PI) b) angle_m) 0.011111111111111112 0.0) b)
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 := {b}^{2} - {a\_m}^{2}\\
t_1 := \left(\left(-0.011111111111111112 \cdot a\_m\right) \cdot angle\_m\right) \cdot \left(\mathsf{PI}\left(\right) \cdot a\_m\right)\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_0 \leq -2 \cdot 10^{+276}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_0 \leq 10^{+183}:\\
\;\;\;\;\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)\\
\mathbf{elif}\;t\_0 \leq \infty:\\
\;\;\;\;\mathsf{fma}\left(\left(\mathsf{PI}\left(\right) \cdot b\right) \cdot angle\_m, 0.011111111111111112, 0\right) \cdot b\\
\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))) < -2.0000000000000001e276 or +inf.0 < (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) Initial program 42.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--.f6447.4
Applied rewrites47.4%
Taylor expanded in b around 0
Applied rewrites47.3%
Applied rewrites63.3%
Applied rewrites63.4%
if -2.0000000000000001e276 < (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) < 9.99999999999999947e182Initial program 69.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--.f6463.7
Applied rewrites63.7%
if 9.99999999999999947e182 < (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) < +inf.0Initial program 44.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--.f6444.2
Applied rewrites44.2%
Taylor expanded in b around 0
Applied rewrites3.2%
Applied rewrites3.2%
Taylor expanded in b around inf
Applied rewrites63.5%
Final simplification63.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 (* (PI) a_m))
(t_1 (- (pow b 2.0) (pow a_m 2.0)))
(t_2 (* (* (* -0.011111111111111112 a_m) angle_m) t_0)))
(*
angle_s
(if (<= t_1 -2e+24)
t_2
(if (<= t_1 1e-309)
(* (* (* -0.011111111111111112 a_m) t_0) angle_m)
(if (<= t_1 INFINITY)
(* (fma (* (* (PI) b) angle_m) 0.011111111111111112 0.0) b)
t_2))))))\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 a\_m\\
t_1 := {b}^{2} - {a\_m}^{2}\\
t_2 := \left(\left(-0.011111111111111112 \cdot a\_m\right) \cdot angle\_m\right) \cdot t\_0\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_1 \leq -2 \cdot 10^{+24}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_1 \leq 10^{-309}:\\
\;\;\;\;\left(\left(-0.011111111111111112 \cdot a\_m\right) \cdot t\_0\right) \cdot angle\_m\\
\mathbf{elif}\;t\_1 \leq \infty:\\
\;\;\;\;\mathsf{fma}\left(\left(\mathsf{PI}\left(\right) \cdot b\right) \cdot angle\_m, 0.011111111111111112, 0\right) \cdot b\\
\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))) < -2e24 or +inf.0 < (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) Initial program 46.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--.f6449.2
Applied rewrites49.2%
Taylor expanded in b around 0
Applied rewrites49.1%
Applied rewrites61.5%
Applied rewrites61.6%
if -2e24 < (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) < 1.000000000000002e-309Initial program 75.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--.f6470.4
Applied rewrites70.4%
Taylor expanded in b around 0
Applied rewrites71.1%
Applied rewrites71.1%
if 1.000000000000002e-309 < (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) < +inf.0Initial program 52.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--.f6450.0
Applied rewrites50.0%
Taylor expanded in b around 0
Applied rewrites8.7%
Applied rewrites8.6%
Taylor expanded in b around inf
Applied rewrites62.4%
Final simplification63.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
(if (<= (/ angle_m 180.0) 2e+65)
(*
(cos (exp (- (log (/ (/ 180.0 angle_m) (PI))))))
(* (* (* (sin (/ (PI) (/ 180.0 angle_m))) 2.0) (- b a_m)) (+ b a_m)))
(*
1.0
(*
(* (* (sin (* (* 0.005555555555555556 angle_m) (PI))) 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 2 \cdot 10^{+65}:\\
\;\;\;\;\cos \left(e^{-\log \left(\frac{\frac{180}{angle\_m}}{\mathsf{PI}\left(\right)}\right)}\right) \cdot \left(\left(\left(\sin \left(\frac{\mathsf{PI}\left(\right)}{\frac{180}{angle\_m}}\right) \cdot 2\right) \cdot \left(b - a\_m\right)\right) \cdot \left(b + a\_m\right)\right)\\
\mathbf{else}:\\
\;\;\;\;1 \cdot \left(\left(\left(\sin \left(\left(0.005555555555555556 \cdot angle\_m\right) \cdot \mathsf{PI}\left(\right)\right) \cdot 2\right) \cdot \left(b - a\_m\right)\right) \cdot \left(b + a\_m\right)\right)\\
\end{array}
\end{array}
if (/.f64 angle #s(literal 180 binary64)) < 2e65Initial program 58.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-*.f6477.1
Applied rewrites77.2%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
metadata-evalN/A
associate-/r/N/A
un-div-invN/A
lower-/.f64N/A
lower-/.f6476.3
Applied rewrites76.3%
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
clear-numN/A
lift-/.f64N/A
associate-/r/N/A
inv-powN/A
pow-to-expN/A
lower-exp.f64N/A
lower-*.f64N/A
lower-log.f64N/A
lower-/.f6435.7
Applied rewrites35.7%
if 2e65 < (/.f64 angle #s(literal 180 binary64)) Initial program 33.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-*.f6433.5
Applied rewrites38.7%
Taylor expanded in angle around 0
Applied rewrites47.6%
Final simplification38.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
(*
(* (* (sin (* (* 0.005555555555555556 angle_m) (PI))) 2.0) (- b a_m))
(+ b a_m))))
(*
angle_s
(if (<= (/ angle_m 180.0) 4e+62)
(*
(cos (* (* (pow (pow (PI) 0.125) 4.0) (sqrt (PI))) (/ angle_m 180.0)))
t_0)
(* 1.0 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(\left(0.005555555555555556 \cdot angle\_m\right) \cdot \mathsf{PI}\left(\right)\right) \cdot 2\right) \cdot \left(b - a\_m\right)\right) \cdot \left(b + a\_m\right)\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;\frac{angle\_m}{180} \leq 4 \cdot 10^{+62}:\\
\;\;\;\;\cos \left(\left({\left({\mathsf{PI}\left(\right)}^{0.125}\right)}^{4} \cdot \sqrt{\mathsf{PI}\left(\right)}\right) \cdot \frac{angle\_m}{180}\right) \cdot t\_0\\
\mathbf{else}:\\
\;\;\;\;1 \cdot t\_0\\
\end{array}
\end{array}
\end{array}
if (/.f64 angle #s(literal 180 binary64)) < 4.00000000000000014e62Initial program 58.6%
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 rewrites77.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.f6476.7
Applied rewrites76.7%
lift-sqrt.f64N/A
lift-PI.f64N/A
add-cube-cbrtN/A
pow3N/A
sqrt-pow1N/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
metadata-evalN/A
lower-pow.f64N/A
lower-cbrt.f64N/A
metadata-eval79.9
Applied rewrites79.9%
lift-*.f64N/A
pow2N/A
lift-pow.f64N/A
sqr-powN/A
unpow-prod-downN/A
pow-prod-upN/A
lower-pow.f64N/A
lift-cbrt.f64N/A
pow1/3N/A
pow-powN/A
lift-sqrt.f64N/A
pow1/2N/A
pow-powN/A
lower-pow.f64N/A
metadata-evalN/A
metadata-evalN/A
metadata-evalN/A
metadata-eval77.8
Applied rewrites77.8%
if 4.00000000000000014e62 < (/.f64 angle #s(literal 180 binary64)) Initial program 34.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-*.f6434.1
Applied rewrites39.1%
Taylor expanded in angle around 0
Applied rewrites47.7%
Final simplification71.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
(let* ((t_0 (- (pow b 2.0) (pow a_m 2.0)))
(t_1 (* (* (* -0.011111111111111112 a_m) angle_m) (* (PI) a_m))))
(*
angle_s
(if (<= t_0 -1e-182)
t_1
(if (<= t_0 INFINITY)
(* (* b b) (* (* (PI) angle_m) 0.011111111111111112))
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 := {b}^{2} - {a\_m}^{2}\\
t_1 := \left(\left(-0.011111111111111112 \cdot a\_m\right) \cdot angle\_m\right) \cdot \left(\mathsf{PI}\left(\right) \cdot a\_m\right)\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_0 \leq -1 \cdot 10^{-182}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_0 \leq \infty:\\
\;\;\;\;\left(b \cdot b\right) \cdot \left(\left(\mathsf{PI}\left(\right) \cdot angle\_m\right) \cdot 0.011111111111111112\right)\\
\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))) < -1e-182 or +inf.0 < (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) Initial program 47.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--.f6449.3
Applied rewrites49.3%
Taylor expanded in b around 0
Applied rewrites49.2%
Applied rewrites59.6%
Applied rewrites59.7%
if -1e-182 < (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) < +inf.0Initial program 59.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--.f6456.4
Applied rewrites56.4%
Taylor expanded in b around 0
Applied rewrites21.3%
Taylor expanded in b around inf
Applied rewrites55.9%
Final simplification57.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
(let* ((t_0 (* (PI) angle_m))
(t_1 (- (pow b 2.0) (pow a_m 2.0)))
(t_2 (* (* t_0 a_m) (* -0.011111111111111112 a_m))))
(*
angle_s
(if (<= t_1 -1e-182)
t_2
(if (<= t_1 INFINITY) (* (* b b) (* t_0 0.011111111111111112)) t_2)))))\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 angle\_m\\
t_1 := {b}^{2} - {a\_m}^{2}\\
t_2 := \left(t\_0 \cdot a\_m\right) \cdot \left(-0.011111111111111112 \cdot a\_m\right)\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_1 \leq -1 \cdot 10^{-182}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_1 \leq \infty:\\
\;\;\;\;\left(b \cdot b\right) \cdot \left(t\_0 \cdot 0.011111111111111112\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))) < -1e-182 or +inf.0 < (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) Initial program 47.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--.f6449.3
Applied rewrites49.3%
Taylor expanded in b around 0
Applied rewrites49.2%
Applied rewrites59.6%
if -1e-182 < (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) < +inf.0Initial program 59.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--.f6456.4
Applied rewrites56.4%
Taylor expanded in b around 0
Applied rewrites21.3%
Taylor expanded in b around inf
Applied rewrites55.9%
Final simplification57.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
(let* ((t_0
(*
(* (* (sin (* (* 0.005555555555555556 angle_m) (PI))) 2.0) (- b a_m))
(+ b a_m))))
(*
angle_s
(if (<= (/ angle_m 180.0) 4e+62)
(* (cos (* (cbrt (* (* (PI) (PI)) (PI))) (/ angle_m 180.0))) t_0)
(* 1.0 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(\left(0.005555555555555556 \cdot angle\_m\right) \cdot \mathsf{PI}\left(\right)\right) \cdot 2\right) \cdot \left(b - a\_m\right)\right) \cdot \left(b + a\_m\right)\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;\frac{angle\_m}{180} \leq 4 \cdot 10^{+62}:\\
\;\;\;\;\cos \left(\sqrt[3]{\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \mathsf{PI}\left(\right)} \cdot \frac{angle\_m}{180}\right) \cdot t\_0\\
\mathbf{else}:\\
\;\;\;\;1 \cdot t\_0\\
\end{array}
\end{array}
\end{array}
if (/.f64 angle #s(literal 180 binary64)) < 4.00000000000000014e62Initial program 58.6%
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 rewrites77.5%
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.f6477.3
Applied rewrites77.3%
lift-pow.f64N/A
unpow3N/A
lower-*.f64N/A
lower-*.f6477.3
Applied rewrites77.3%
if 4.00000000000000014e62 < (/.f64 angle #s(literal 180 binary64)) Initial program 34.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-*.f6434.1
Applied rewrites39.1%
Taylor expanded in angle around 0
Applied rewrites47.7%
Final simplification70.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) angle_m)))
(*
angle_s
(if (<= (- (pow b 2.0) (pow a_m 2.0)) (- INFINITY))
(* (* (* (sin (* t_0 0.005555555555555556)) (* -2.0 a_m)) (+ b a_m)) 1.0)
(* (* (sin (* t_0 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)
\\
\begin{array}{l}
t_0 := \mathsf{PI}\left(\right) \cdot angle\_m\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;{b}^{2} - {a\_m}^{2} \leq -\infty:\\
\;\;\;\;\left(\left(\sin \left(t\_0 \cdot 0.005555555555555556\right) \cdot \left(-2 \cdot a\_m\right)\right) \cdot \left(b + a\_m\right)\right) \cdot 1\\
\mathbf{else}:\\
\;\;\;\;\left(\sin \left(t\_0 \cdot 0.011111111111111112\right) \cdot \left(b - a\_m\right)\right) \cdot \left(b + a\_m\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 48.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-*.f6469.8
Applied rewrites74.9%
Taylor expanded in angle around 0
Applied rewrites78.2%
Taylor expanded in b around 0
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-PI.f6476.6
Applied rewrites76.6%
if -inf.0 < (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) Initial program 54.8%
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 rewrites68.4%
Final simplification70.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
(let* ((t_0 (sqrt (PI))))
(*
angle_s
(if (<= (/ angle_m 180.0) 2e+65)
(*
(cos (* (* t_0 t_0) (/ angle_m 180.0)))
(*
(* (* (sin (* (* 0.005555555555555556 (PI)) angle_m)) 2.0) (+ b a_m))
(- b a_m)))
(*
1.0
(*
(* (* (sin (* (* 0.005555555555555556 angle_m) (PI))) 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 := \sqrt{\mathsf{PI}\left(\right)}\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;\frac{angle\_m}{180} \leq 2 \cdot 10^{+65}:\\
\;\;\;\;\cos \left(\left(t\_0 \cdot t\_0\right) \cdot \frac{angle\_m}{180}\right) \cdot \left(\left(\left(\sin \left(\left(0.005555555555555556 \cdot \mathsf{PI}\left(\right)\right) \cdot angle\_m\right) \cdot 2\right) \cdot \left(b + a\_m\right)\right) \cdot \left(b - a\_m\right)\right)\\
\mathbf{else}:\\
\;\;\;\;1 \cdot \left(\left(\left(\sin \left(\left(0.005555555555555556 \cdot angle\_m\right) \cdot \mathsf{PI}\left(\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 angle #s(literal 180 binary64)) < 2e65Initial program 58.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-*.f6477.1
Applied rewrites77.2%
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.f6476.5
Applied rewrites76.5%
lift-*.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
lift-*.f64N/A
associate-*r*N/A
*-commutativeN/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f6476.4
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
lower-*.f6477.4
Applied rewrites77.4%
if 2e65 < (/.f64 angle #s(literal 180 binary64)) Initial program 33.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-*.f6433.5
Applied rewrites38.7%
Taylor expanded in angle around 0
Applied rewrites47.6%
Final simplification71.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
(let* ((t_0 (* (* 0.005555555555555556 angle_m) (PI)))
(t_1 (* (* (* (sin t_0) 2.0) (- b a_m)) (+ b a_m))))
(*
angle_s
(if (<= (/ angle_m 180.0) 2e+65) (* (cos t_0) t_1) (* 1.0 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 := \left(0.005555555555555556 \cdot angle\_m\right) \cdot \mathsf{PI}\left(\right)\\
t_1 := \left(\left(\sin t\_0 \cdot 2\right) \cdot \left(b - a\_m\right)\right) \cdot \left(b + a\_m\right)\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;\frac{angle\_m}{180} \leq 2 \cdot 10^{+65}:\\
\;\;\;\;\cos t\_0 \cdot t\_1\\
\mathbf{else}:\\
\;\;\;\;1 \cdot t\_1\\
\end{array}
\end{array}
\end{array}
if (/.f64 angle #s(literal 180 binary64)) < 2e65Initial program 58.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-*.f6477.1
Applied rewrites77.2%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6477.2
lift-/.f64N/A
div-invN/A
metadata-evalN/A
lower-*.f6477.8
Applied rewrites77.8%
if 2e65 < (/.f64 angle #s(literal 180 binary64)) Initial program 33.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-*.f6433.5
Applied rewrites38.7%
Taylor expanded in angle around 0
Applied rewrites47.6%
Final simplification71.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 (<= (/ angle_m 180.0) 2e+65)
(*
(*
(* 0.5 (sin (* (* 0.011111111111111112 (PI)) angle_m)))
(* 2.0 (- b a_m)))
(+ b a_m))
(*
1.0
(*
(* (* (sin (* (* 0.005555555555555556 angle_m) (PI))) 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 2 \cdot 10^{+65}:\\
\;\;\;\;\left(\left(0.5 \cdot \sin \left(\left(0.011111111111111112 \cdot \mathsf{PI}\left(\right)\right) \cdot angle\_m\right)\right) \cdot \left(2 \cdot \left(b - a\_m\right)\right)\right) \cdot \left(b + a\_m\right)\\
\mathbf{else}:\\
\;\;\;\;1 \cdot \left(\left(\left(\sin \left(\left(0.005555555555555556 \cdot angle\_m\right) \cdot \mathsf{PI}\left(\right)\right) \cdot 2\right) \cdot \left(b - a\_m\right)\right) \cdot \left(b + a\_m\right)\right)\\
\end{array}
\end{array}
if (/.f64 angle #s(literal 180 binary64)) < 2e65Initial program 58.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-*.f6477.1
Applied rewrites77.2%
Applied rewrites77.3%
if 2e65 < (/.f64 angle #s(literal 180 binary64)) Initial program 33.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-*.f6433.5
Applied rewrites38.7%
Taylor expanded in angle around 0
Applied rewrites47.6%
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
(*
angle_s
(if (<= (/ angle_m 180.0) 2e+65)
(* (* (sin (* (* (PI) angle_m) 0.011111111111111112)) (- b a_m)) (+ b a_m))
(*
1.0
(*
(* (* (sin (* (* 0.005555555555555556 angle_m) (PI))) 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 2 \cdot 10^{+65}:\\
\;\;\;\;\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}:\\
\;\;\;\;1 \cdot \left(\left(\left(\sin \left(\left(0.005555555555555556 \cdot angle\_m\right) \cdot \mathsf{PI}\left(\right)\right) \cdot 2\right) \cdot \left(b - a\_m\right)\right) \cdot \left(b + a\_m\right)\right)\\
\end{array}
\end{array}
if (/.f64 angle #s(literal 180 binary64)) < 2e65Initial program 58.5%
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 rewrites77.4%
if 2e65 < (/.f64 angle #s(literal 180 binary64)) Initial program 33.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-*.f6433.5
Applied rewrites38.7%
Taylor expanded in angle around 0
Applied rewrites47.6%
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
(*
angle_s
(if (<= (/ angle_m 180.0) 5e+127)
(* (* (sin (* (* (PI) angle_m) 0.011111111111111112)) (- b a_m)) (+ b a_m))
(*
(* (* (- b a_m) (+ b a_m)) 2.0)
(* 1.0 (sin (* (* 0.005555555555555556 (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}\;\frac{angle\_m}{180} \leq 5 \cdot 10^{+127}:\\
\;\;\;\;\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}:\\
\;\;\;\;\left(\left(\left(b - a\_m\right) \cdot \left(b + a\_m\right)\right) \cdot 2\right) \cdot \left(1 \cdot \sin \left(\left(0.005555555555555556 \cdot \mathsf{PI}\left(\right)\right) \cdot angle\_m\right)\right)\\
\end{array}
\end{array}
if (/.f64 angle #s(literal 180 binary64)) < 5.0000000000000004e127Initial program 57.7%
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 rewrites74.9%
if 5.0000000000000004e127 < (/.f64 angle #s(literal 180 binary64)) Initial program 28.4%
Taylor expanded in angle around inf
*-commutativeN/A
associate-*r*N/A
associate-*l*N/A
lower-*.f64N/A
Applied rewrites31.5%
Taylor expanded in angle around 0
Applied rewrites43.0%
Final simplification70.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
(*
angle_s
(if (<= (/ angle_m 180.0) 1e-19)
(* (* (* (* 0.011111111111111112 (PI)) angle_m) (- b a_m)) (+ b a_m))
(*
(* (- b a_m) (+ b a_m))
(sin (* (* (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}\;\frac{angle\_m}{180} \leq 10^{-19}:\\
\;\;\;\;\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)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(b - a\_m\right) \cdot \left(b + a\_m\right)\right) \cdot \sin \left(\left(\mathsf{PI}\left(\right) \cdot angle\_m\right) \cdot 0.011111111111111112\right)\\
\end{array}
\end{array}
if (/.f64 angle #s(literal 180 binary64)) < 9.9999999999999998e-20Initial program 60.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--.f6460.6
Applied rewrites60.6%
Applied rewrites74.8%
if 9.9999999999999998e-20 < (/.f64 angle #s(literal 180 binary64)) Initial program 34.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 rewrites35.8%
Final simplification63.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 (* (* 0.011111111111111112 (PI)) angle_m)))
(*
angle_s
(if (<= (/ angle_m 180.0) 1e-19)
(* (* 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^{-19}:\\
\;\;\;\;\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)) < 9.9999999999999998e-20Initial program 60.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--.f6460.6
Applied rewrites60.6%
Applied rewrites74.8%
if 9.9999999999999998e-20 < (/.f64 angle #s(literal 180 binary64)) Initial program 34.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-*.f6437.4
Applied rewrites41.0%
Applied rewrites36.7%
Final simplification63.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) angle_m)))
(*
angle_s
(if (<= (pow a_m 2.0) 5e+159)
(* (* (* a_m a_m) -0.011111111111111112) t_0)
(* (* t_0 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)
\\
\begin{array}{l}
t_0 := \mathsf{PI}\left(\right) \cdot angle\_m\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;{a\_m}^{2} \leq 5 \cdot 10^{+159}:\\
\;\;\;\;\left(\left(a\_m \cdot a\_m\right) \cdot -0.011111111111111112\right) \cdot t\_0\\
\mathbf{else}:\\
\;\;\;\;\left(t\_0 \cdot a\_m\right) \cdot \left(-0.011111111111111112 \cdot a\_m\right)\\
\end{array}
\end{array}
\end{array}
if (pow.f64 a #s(literal 2 binary64)) < 5.00000000000000003e159Initial program 61.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--.f6456.6
Applied rewrites56.6%
Taylor expanded in b around 0
Applied rewrites28.4%
if 5.00000000000000003e159 < (pow.f64 a #s(literal 2 binary64)) Initial program 42.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--.f6447.5
Applied rewrites47.5%
Taylor expanded in b around 0
Applied rewrites45.3%
Applied rewrites58.1%
Final simplification40.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 (* (* (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 rewrites68.0%
Final simplification68.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
(*
angle_s
(if (<= (/ angle_m 180.0) 8e+64)
(* (* (* (* 0.011111111111111112 (PI)) angle_m) (- b a_m)) (+ b a_m))
(*
(*
(fma
(* (PI) (PI))
(* (* -1.1431184270690443e-7 (* angle_m angle_m)) (PI))
(* 0.005555555555555556 (PI)))
angle_m)
(* (* (- b a_m) (+ b a_m)) 2.0)))))\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 8 \cdot 10^{+64}:\\
\;\;\;\;\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)\\
\mathbf{else}:\\
\;\;\;\;\left(\mathsf{fma}\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right), \left(-1.1431184270690443 \cdot 10^{-7} \cdot \left(angle\_m \cdot angle\_m\right)\right) \cdot \mathsf{PI}\left(\right), 0.005555555555555556 \cdot \mathsf{PI}\left(\right)\right) \cdot angle\_m\right) \cdot \left(\left(\left(b - a\_m\right) \cdot \left(b + a\_m\right)\right) \cdot 2\right)\\
\end{array}
\end{array}
if (/.f64 angle #s(literal 180 binary64)) < 8.00000000000000017e64Initial program 58.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--.f6459.1
Applied rewrites59.1%
Applied rewrites71.9%
if 8.00000000000000017e64 < (/.f64 angle #s(literal 180 binary64)) Initial program 34.7%
Taylor expanded in angle around inf
*-commutativeN/A
associate-*r*N/A
associate-*l*N/A
lower-*.f64N/A
Applied rewrites33.5%
Taylor expanded in angle around 0
Applied rewrites34.8%
Applied rewrites34.8%
Final simplification64.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 (* (* 0.011111111111111112 (PI)) angle_m)))
(*
angle_s
(if (<= (/ angle_m 180.0) 1e-19)
(* (* t_0 (- b a_m)) (+ b a_m))
(* (* (- b a_m) (+ b a_m)) 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^{-19}:\\
\;\;\;\;\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 t\_0\\
\end{array}
\end{array}
\end{array}
if (/.f64 angle #s(literal 180 binary64)) < 9.9999999999999998e-20Initial program 60.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--.f6460.6
Applied rewrites60.6%
Applied rewrites74.8%
if 9.9999999999999998e-20 < (/.f64 angle #s(literal 180 binary64)) Initial program 34.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--.f6433.0
Applied rewrites33.0%
Final simplification62.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 (* (* (* (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.7
Applied rewrites52.7%
Taylor expanded in b around 0
Applied rewrites35.5%
Applied rewrites39.1%
Final simplification39.1%
herbie shell --seed 2024249
(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)))))