
(FPCore (a b angle) :precision binary64 (let* ((t_0 (* (/ angle 180.0) (PI)))) (+ (pow (* a (sin t_0)) 2.0) (pow (* b (cos t_0)) 2.0))))
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{angle}{180} \cdot \mathsf{PI}\left(\right)\\
{\left(a \cdot \sin t\_0\right)}^{2} + {\left(b \cdot \cos t\_0\right)}^{2}
\end{array}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 17 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (a b angle) :precision binary64 (let* ((t_0 (* (/ angle 180.0) (PI)))) (+ (pow (* a (sin t_0)) 2.0) (pow (* b (cos t_0)) 2.0))))
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{angle}{180} \cdot \mathsf{PI}\left(\right)\\
{\left(a \cdot \sin t\_0\right)}^{2} + {\left(b \cdot \cos t\_0\right)}^{2}
\end{array}
\end{array}
(FPCore (a b angle)
:precision binary64
(let* ((t_0 (cbrt (PI))))
(fma
(*
b
(pow
(cos (* (* 0.005555555555555556 (pow t_0 2.0)) (* (- angle) t_0)))
2.0))
b
(pow (* (sin (* (* angle 0.005555555555555556) (PI))) a) 2.0))))\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt[3]{\mathsf{PI}\left(\right)}\\
\mathsf{fma}\left(b \cdot {\cos \left(\left(0.005555555555555556 \cdot {t\_0}^{2}\right) \cdot \left(\left(-angle\right) \cdot t\_0\right)\right)}^{2}, b, {\left(\sin \left(\left(angle \cdot 0.005555555555555556\right) \cdot \mathsf{PI}\left(\right)\right) \cdot a\right)}^{2}\right)
\end{array}
\end{array}
Initial program 76.3%
lift-+.f64N/A
+-commutativeN/A
lift-pow.f64N/A
unpow2N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites76.3%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
clear-numN/A
metadata-evalN/A
distribute-neg-fracN/A
lift-/.f64N/A
un-div-invN/A
distribute-neg-frac2N/A
lift-PI.f64N/A
add-cube-cbrtN/A
lift-/.f64N/A
div-invN/A
unpow-1N/A
lift-pow.f64N/A
times-fracN/A
distribute-rgt-neg-inN/A
lower-*.f64N/A
Applied rewrites76.5%
Final simplification76.5%
(FPCore (a b angle)
:precision binary64
(let* ((t_0 (cbrt (PI))))
(fma
(*
(pow
(cos (* (* (* 0.005555555555555556 (pow t_0 2.0)) t_0) (- angle)))
2.0)
b)
b
(pow (* (sin (* (* angle 0.005555555555555556) (PI))) a) 2.0))))\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt[3]{\mathsf{PI}\left(\right)}\\
\mathsf{fma}\left({\cos \left(\left(\left(0.005555555555555556 \cdot {t\_0}^{2}\right) \cdot t\_0\right) \cdot \left(-angle\right)\right)}^{2} \cdot b, b, {\left(\sin \left(\left(angle \cdot 0.005555555555555556\right) \cdot \mathsf{PI}\left(\right)\right) \cdot a\right)}^{2}\right)
\end{array}
\end{array}
Initial program 76.3%
lift-+.f64N/A
+-commutativeN/A
lift-pow.f64N/A
unpow2N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites76.3%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
clear-numN/A
metadata-evalN/A
distribute-neg-fracN/A
lift-/.f64N/A
un-div-invN/A
distribute-neg-frac2N/A
lift-PI.f64N/A
add-cube-cbrtN/A
lift-/.f64N/A
div-invN/A
unpow-1N/A
lift-pow.f64N/A
times-fracN/A
distribute-rgt-neg-inN/A
lower-*.f64N/A
Applied rewrites76.5%
lift-*.f64N/A
lift-neg.f64N/A
lift-*.f64N/A
distribute-lft-neg-inN/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-neg.f6476.5
Applied rewrites76.5%
Final simplification76.5%
(FPCore (a b angle)
:precision binary64
(let* ((t_0 (cbrt (PI))))
(+
(pow
(* (cos (* (* 0.005555555555555556 (pow t_0 2.0)) (* angle t_0))) b)
2.0)
(pow (* (sin (* (* 0.005555555555555556 (PI)) angle)) a) 2.0))))\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt[3]{\mathsf{PI}\left(\right)}\\
{\left(\cos \left(\left(0.005555555555555556 \cdot {t\_0}^{2}\right) \cdot \left(angle \cdot t\_0\right)\right) \cdot b\right)}^{2} + {\left(\sin \left(\left(0.005555555555555556 \cdot \mathsf{PI}\left(\right)\right) \cdot angle\right) \cdot a\right)}^{2}
\end{array}
\end{array}
Initial program 76.3%
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
clear-numN/A
lower-/.f64N/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f6476.4
Applied rewrites76.4%
lift-/.f64N/A
lift-/.f64N/A
clear-numN/A
lift-PI.f64N/A
add-cube-cbrtN/A
lift-/.f64N/A
div-invN/A
unpow-1N/A
lift-pow.f64N/A
times-fracN/A
lower-*.f64N/A
div-invN/A
metadata-evalN/A
lower-*.f64N/A
pow2N/A
lower-pow.f64N/A
lift-PI.f64N/A
lower-cbrt.f64N/A
div-invN/A
lift-pow.f64N/A
unpow-1N/A
remove-double-divN/A
Applied rewrites76.5%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6476.5
lift-*.f64N/A
lift-/.f64N/A
div-invN/A
metadata-evalN/A
associate-*l*N/A
lift-PI.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-PI.f64N/A
lower-*.f6476.5
Applied rewrites76.5%
Final simplification76.5%
(FPCore (a b angle) :precision binary64 (fma (* (pow (cos (/ 1.0 (/ (/ -180.0 angle) (PI)))) 2.0) b) b (pow (* (sin (* (* angle 0.005555555555555556) (PI))) a) 2.0)))
\begin{array}{l}
\\
\mathsf{fma}\left({\cos \left(\frac{1}{\frac{\frac{-180}{angle}}{\mathsf{PI}\left(\right)}}\right)}^{2} \cdot b, b, {\left(\sin \left(\left(angle \cdot 0.005555555555555556\right) \cdot \mathsf{PI}\left(\right)\right) \cdot a\right)}^{2}\right)
\end{array}
Initial program 76.3%
lift-+.f64N/A
+-commutativeN/A
lift-pow.f64N/A
unpow2N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites76.3%
lift-/.f64N/A
clear-numN/A
metadata-evalN/A
distribute-neg-fracN/A
lift-*.f64N/A
associate-/l/N/A
lift-/.f64N/A
lift-/.f64N/A
lower-/.f64N/A
lift-/.f64N/A
distribute-neg-fracN/A
lower-/.f64N/A
lift-/.f64N/A
distribute-neg-fracN/A
metadata-evalN/A
lower-/.f6476.5
Applied rewrites76.5%
Final simplification76.5%
(FPCore (a b angle)
:precision binary64
(let* ((t_0 (sqrt (PI))))
(+
(pow (* (cos (* (* t_0 t_0) (* angle 0.005555555555555556))) b) 2.0)
(pow (* (sin (* (* angle 0.005555555555555556) (PI))) a) 2.0))))\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{\mathsf{PI}\left(\right)}\\
{\left(\cos \left(\left(t\_0 \cdot t\_0\right) \cdot \left(angle \cdot 0.005555555555555556\right)\right) \cdot b\right)}^{2} + {\left(\sin \left(\left(angle \cdot 0.005555555555555556\right) \cdot \mathsf{PI}\left(\right)\right) \cdot a\right)}^{2}
\end{array}
\end{array}
Initial program 76.3%
lift-+.f64N/A
+-commutativeN/A
lift-pow.f64N/A
unpow2N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites76.3%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
clear-numN/A
metadata-evalN/A
distribute-neg-fracN/A
lift-/.f64N/A
un-div-invN/A
distribute-neg-frac2N/A
lift-PI.f64N/A
add-cube-cbrtN/A
lift-/.f64N/A
div-invN/A
unpow-1N/A
lift-pow.f64N/A
times-fracN/A
distribute-rgt-neg-inN/A
lower-*.f64N/A
Applied rewrites76.5%
Applied rewrites76.3%
lift-PI.f64N/A
add-sqr-sqrtN/A
lower-*.f64N/A
lift-PI.f64N/A
lower-sqrt.f64N/A
lift-PI.f64N/A
lower-sqrt.f6476.4
Applied rewrites76.4%
Final simplification76.4%
(FPCore (a b angle) :precision binary64 (+ (pow (* (cos (* (/ angle 180.0) (PI))) b) 2.0) (pow (* (sin (/ (PI) (/ 180.0 angle))) a) 2.0)))
\begin{array}{l}
\\
{\left(\cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right) \cdot b\right)}^{2} + {\left(\sin \left(\frac{\mathsf{PI}\left(\right)}{\frac{180}{angle}}\right) \cdot a\right)}^{2}
\end{array}
Initial program 76.3%
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lower-/.f64N/A
lower-/.f6476.4
Applied rewrites76.4%
Final simplification76.4%
(FPCore (a b angle) :precision binary64 (fma (* (+ (* (cos (* (/ (PI) (/ -180.0 angle)) 2.0)) 0.5) 0.5) b) b (pow (* (sin (* (* angle 0.005555555555555556) (PI))) a) 2.0)))
\begin{array}{l}
\\
\mathsf{fma}\left(\left(\cos \left(\frac{\mathsf{PI}\left(\right)}{\frac{-180}{angle}} \cdot 2\right) \cdot 0.5 + 0.5\right) \cdot b, b, {\left(\sin \left(\left(angle \cdot 0.005555555555555556\right) \cdot \mathsf{PI}\left(\right)\right) \cdot a\right)}^{2}\right)
\end{array}
Initial program 76.3%
lift-+.f64N/A
+-commutativeN/A
lift-pow.f64N/A
unpow2N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites76.3%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
clear-numN/A
metadata-evalN/A
distribute-neg-fracN/A
lift-/.f64N/A
un-div-invN/A
distribute-neg-frac2N/A
lift-PI.f64N/A
add-cube-cbrtN/A
lift-/.f64N/A
div-invN/A
unpow-1N/A
lift-pow.f64N/A
times-fracN/A
distribute-rgt-neg-inN/A
lower-*.f64N/A
Applied rewrites76.5%
lift-pow.f64N/A
unpow2N/A
lift-cos.f64N/A
lift-cos.f64N/A
sqr-cos-aN/A
lift-*.f64N/A
lift-neg.f64N/A
distribute-rgt-neg-outN/A
Applied rewrites76.3%
Final simplification76.3%
(FPCore (a b angle) :precision binary64 (let* ((t_0 (* (* angle 0.005555555555555556) (PI)))) (fma (* (+ (* (cos (* t_0 2.0)) 0.5) 0.5) b) b (pow (* (sin t_0) a) 2.0))))
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(angle \cdot 0.005555555555555556\right) \cdot \mathsf{PI}\left(\right)\\
\mathsf{fma}\left(\left(\cos \left(t\_0 \cdot 2\right) \cdot 0.5 + 0.5\right) \cdot b, b, {\left(\sin t\_0 \cdot a\right)}^{2}\right)
\end{array}
\end{array}
Initial program 76.3%
lift-+.f64N/A
+-commutativeN/A
lift-pow.f64N/A
unpow2N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites76.3%
lift-pow.f64N/A
lift-cos.f64N/A
lift-/.f64N/A
metadata-evalN/A
distribute-neg-frac2N/A
lift-*.f64N/A
*-commutativeN/A
associate-*l/N/A
lift-/.f64N/A
lift-*.f64N/A
cos-negN/A
lift-cos.f64N/A
unpow2N/A
lift-cos.f64N/A
lift-cos.f64N/A
sqr-cos-aN/A
lower-+.f64N/A
lower-*.f64N/A
Applied rewrites76.3%
Final simplification76.3%
(FPCore (a b angle) :precision binary64 (fma (* (+ (* (cos (* -0.011111111111111112 (* angle (PI)))) 0.5) 0.5) b) b (pow (* (sin (* (* angle 0.005555555555555556) (PI))) a) 2.0)))
\begin{array}{l}
\\
\mathsf{fma}\left(\left(\cos \left(-0.011111111111111112 \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) \cdot 0.5 + 0.5\right) \cdot b, b, {\left(\sin \left(\left(angle \cdot 0.005555555555555556\right) \cdot \mathsf{PI}\left(\right)\right) \cdot a\right)}^{2}\right)
\end{array}
Initial program 76.3%
lift-+.f64N/A
+-commutativeN/A
lift-pow.f64N/A
unpow2N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites76.3%
lift-pow.f64N/A
unpow2N/A
lift-cos.f64N/A
lift-cos.f64N/A
sqr-cos-aN/A
lower-+.f64N/A
lower-*.f64N/A
cos-2N/A
cos-sumN/A
lower-cos.f64N/A
lift-/.f64N/A
div-invN/A
lift-/.f64N/A
div-invN/A
distribute-lft-outN/A
lower-*.f64N/A
metadata-evalN/A
metadata-evalN/A
metadata-eval76.3
Applied rewrites76.3%
Final simplification76.3%
(FPCore (a b angle) :precision binary64 (if (<= a 1.5e+168) (* (pow (cos (* (* 0.005555555555555556 (PI)) angle)) 2.0) (* b b)) (* (pow (* (* a (PI)) angle) 2.0) 3.08641975308642e-5)))
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq 1.5 \cdot 10^{+168}:\\
\;\;\;\;{\cos \left(\left(0.005555555555555556 \cdot \mathsf{PI}\left(\right)\right) \cdot angle\right)}^{2} \cdot \left(b \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;{\left(\left(a \cdot \mathsf{PI}\left(\right)\right) \cdot angle\right)}^{2} \cdot 3.08641975308642 \cdot 10^{-5}\\
\end{array}
\end{array}
if a < 1.4999999999999999e168Initial program 73.6%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
*-commutativeN/A
associate-*r*N/A
lower-cos.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-PI.f64N/A
unpow2N/A
lower-*.f6461.5
Applied rewrites61.5%
if 1.4999999999999999e168 < a Initial program 99.7%
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
div-invN/A
associate-/r*N/A
lower-/.f64N/A
div-invN/A
*-commutativeN/A
lower-*.f64N/A
metadata-evalN/A
inv-powN/A
lower-pow.f6499.7
Applied rewrites99.7%
Taylor expanded in angle around 0
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites74.2%
Taylor expanded in b around 0
Applied rewrites74.2%
Applied rewrites86.3%
Final simplification64.1%
(FPCore (a b angle) :precision binary64 (if (<= a 1.5e+168) (* (pow (cos (* -0.005555555555555556 (* angle (PI)))) 2.0) (* b b)) (* (pow (* (* a (PI)) angle) 2.0) 3.08641975308642e-5)))
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq 1.5 \cdot 10^{+168}:\\
\;\;\;\;{\cos \left(-0.005555555555555556 \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} \cdot \left(b \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;{\left(\left(a \cdot \mathsf{PI}\left(\right)\right) \cdot angle\right)}^{2} \cdot 3.08641975308642 \cdot 10^{-5}\\
\end{array}
\end{array}
if a < 1.4999999999999999e168Initial program 73.6%
lift-+.f64N/A
+-commutativeN/A
lift-pow.f64N/A
unpow2N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites73.6%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-PI.f64N/A
unpow2N/A
lower-*.f6461.3
Applied rewrites61.3%
if 1.4999999999999999e168 < a Initial program 99.7%
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
div-invN/A
associate-/r*N/A
lower-/.f64N/A
div-invN/A
*-commutativeN/A
lower-*.f64N/A
metadata-evalN/A
inv-powN/A
lower-pow.f6499.7
Applied rewrites99.7%
Taylor expanded in angle around 0
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites74.2%
Taylor expanded in b around 0
Applied rewrites74.2%
Applied rewrites86.3%
Final simplification64.0%
(FPCore (a b angle) :precision binary64 (+ (* b b) (pow (* (sin (* (* angle 0.005555555555555556) (PI))) a) 2.0)))
\begin{array}{l}
\\
b \cdot b + {\left(\sin \left(\left(angle \cdot 0.005555555555555556\right) \cdot \mathsf{PI}\left(\right)\right) \cdot a\right)}^{2}
\end{array}
Initial program 76.3%
lift-+.f64N/A
+-commutativeN/A
lift-pow.f64N/A
unpow2N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites76.3%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
clear-numN/A
metadata-evalN/A
distribute-neg-fracN/A
lift-/.f64N/A
un-div-invN/A
distribute-neg-frac2N/A
lift-PI.f64N/A
add-cube-cbrtN/A
lift-/.f64N/A
div-invN/A
unpow-1N/A
lift-pow.f64N/A
times-fracN/A
distribute-rgt-neg-inN/A
lower-*.f64N/A
Applied rewrites76.5%
Applied rewrites76.3%
Taylor expanded in angle around 0
unpow2N/A
lower-*.f6476.0
Applied rewrites76.0%
Final simplification76.0%
(FPCore (a b angle) :precision binary64 (if (<= a 1.5e+168) (* b b) (* (pow (* (* a (PI)) angle) 2.0) 3.08641975308642e-5)))
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq 1.5 \cdot 10^{+168}:\\
\;\;\;\;b \cdot b\\
\mathbf{else}:\\
\;\;\;\;{\left(\left(a \cdot \mathsf{PI}\left(\right)\right) \cdot angle\right)}^{2} \cdot 3.08641975308642 \cdot 10^{-5}\\
\end{array}
\end{array}
if a < 1.4999999999999999e168Initial program 73.6%
Taylor expanded in angle around 0
unpow2N/A
lower-*.f6461.0
Applied rewrites61.0%
if 1.4999999999999999e168 < a Initial program 99.7%
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
div-invN/A
associate-/r*N/A
lower-/.f64N/A
div-invN/A
*-commutativeN/A
lower-*.f64N/A
metadata-evalN/A
inv-powN/A
lower-pow.f6499.7
Applied rewrites99.7%
Taylor expanded in angle around 0
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites74.2%
Taylor expanded in b around 0
Applied rewrites74.2%
Applied rewrites86.3%
(FPCore (a b angle)
:precision binary64
(if (<= b 9.2e+39)
(fma
(*
(* (* (PI) (PI)) angle)
(fma (* 3.08641975308642e-5 a) a (* -3.08641975308642e-5 (* b b))))
angle
(* b b))
(* b b)))\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq 9.2 \cdot 10^{+39}:\\
\;\;\;\;\mathsf{fma}\left(\left(\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right) \cdot angle\right) \cdot \mathsf{fma}\left(3.08641975308642 \cdot 10^{-5} \cdot a, a, -3.08641975308642 \cdot 10^{-5} \cdot \left(b \cdot b\right)\right), angle, b \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;b \cdot b\\
\end{array}
\end{array}
if b < 9.20000000000000047e39Initial program 74.5%
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
div-invN/A
associate-/r*N/A
lower-/.f64N/A
div-invN/A
*-commutativeN/A
lower-*.f64N/A
metadata-evalN/A
inv-powN/A
lower-pow.f6474.4
Applied rewrites74.4%
Taylor expanded in angle around 0
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites47.8%
Applied rewrites47.9%
if 9.20000000000000047e39 < b Initial program 82.7%
Taylor expanded in angle around 0
unpow2N/A
lower-*.f6475.9
Applied rewrites75.9%
Final simplification54.3%
(FPCore (a b angle) :precision binary64 (if (<= a 4.4e+177) (* b b) (* (* (* (PI) (PI)) a) (* (* (* angle angle) 3.08641975308642e-5) a))))
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq 4.4 \cdot 10^{+177}:\\
\;\;\;\;b \cdot b\\
\mathbf{else}:\\
\;\;\;\;\left(\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right) \cdot a\right) \cdot \left(\left(\left(angle \cdot angle\right) \cdot 3.08641975308642 \cdot 10^{-5}\right) \cdot a\right)\\
\end{array}
\end{array}
if a < 4.3999999999999996e177Initial program 73.9%
Taylor expanded in angle around 0
unpow2N/A
lower-*.f6460.7
Applied rewrites60.7%
if 4.3999999999999996e177 < a Initial program 99.8%
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
div-invN/A
associate-/r*N/A
lower-/.f64N/A
div-invN/A
*-commutativeN/A
lower-*.f64N/A
metadata-evalN/A
inv-powN/A
lower-pow.f6499.9
Applied rewrites99.9%
Taylor expanded in angle around 0
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites79.2%
Taylor expanded in b around 0
Applied rewrites79.2%
Applied rewrites79.6%
Final simplification62.5%
(FPCore (a b angle) :precision binary64 (if (<= a 1.08e+175) (* b b) (* (* (* (* (PI) (PI)) a) a) (* (* angle angle) 3.08641975308642e-5))))
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq 1.08 \cdot 10^{+175}:\\
\;\;\;\;b \cdot b\\
\mathbf{else}:\\
\;\;\;\;\left(\left(\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right) \cdot a\right) \cdot a\right) \cdot \left(\left(angle \cdot angle\right) \cdot 3.08641975308642 \cdot 10^{-5}\right)\\
\end{array}
\end{array}
if a < 1.08e175Initial program 73.9%
Taylor expanded in angle around 0
unpow2N/A
lower-*.f6460.7
Applied rewrites60.7%
if 1.08e175 < a Initial program 99.8%
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
div-invN/A
associate-/r*N/A
lower-/.f64N/A
div-invN/A
*-commutativeN/A
lower-*.f64N/A
metadata-evalN/A
inv-powN/A
lower-pow.f6499.9
Applied rewrites99.9%
Taylor expanded in angle around 0
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites79.2%
Taylor expanded in b around 0
Applied rewrites79.2%
Final simplification62.4%
(FPCore (a b angle) :precision binary64 (* b b))
double code(double a, double b, double angle) {
return b * b;
}
real(8) function code(a, b, angle)
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: angle
code = b * b
end function
public static double code(double a, double b, double angle) {
return b * b;
}
def code(a, b, angle): return b * b
function code(a, b, angle) return Float64(b * b) end
function tmp = code(a, b, angle) tmp = b * b; end
code[a_, b_, angle_] := N[(b * b), $MachinePrecision]
\begin{array}{l}
\\
b \cdot b
\end{array}
Initial program 76.3%
Taylor expanded in angle around 0
unpow2N/A
lower-*.f6457.2
Applied rewrites57.2%
herbie shell --seed 2024264
(FPCore (a b angle)
:name "ab-angle->ABCF A"
:precision binary64
(+ (pow (* a (sin (* (/ angle 180.0) (PI)))) 2.0) (pow (* b (cos (* (/ angle 180.0) (PI)))) 2.0)))