
(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}
angle_m = (fabs.f64 angle)
(FPCore (a b angle_m)
:precision binary64
(let* ((t_0 (cbrt (pow (PI) 1.5))))
(+
(pow
(*
(cos
(*
(* t_0 t_0)
(* (pow (exp -1.0) (- (log angle_m))) (pow (exp -1.0) (log 180.0)))))
b)
2.0)
(pow (* (sin (* (* angle_m (PI)) 0.005555555555555556)) a) 2.0))))\begin{array}{l}
angle_m = \left|angle\right|
\\
\begin{array}{l}
t_0 := \sqrt[3]{{\mathsf{PI}\left(\right)}^{1.5}}\\
{\left(\cos \left(\left(t\_0 \cdot t\_0\right) \cdot \left({\left(e^{-1}\right)}^{\left(-\log angle\_m\right)} \cdot {\left(e^{-1}\right)}^{\log 180}\right)\right) \cdot b\right)}^{2} + {\left(\sin \left(\left(angle\_m \cdot \mathsf{PI}\left(\right)\right) \cdot 0.005555555555555556\right) \cdot a\right)}^{2}
\end{array}
\end{array}
Initial program 82.8%
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
div-invN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
metadata-eval82.9
Applied rewrites82.9%
lift-PI.f64N/A
add-cbrt-cubeN/A
lift-PI.f64N/A
lift-PI.f64N/A
lift-PI.f64N/A
rem-square-sqrtN/A
lift-sqrt.f64N/A
lift-sqrt.f64N/A
unswap-sqrN/A
cbrt-prodN/A
lower-*.f64N/A
lower-cbrt.f64N/A
unpow1N/A
lift-sqrt.f64N/A
pow1/2N/A
pow-prod-upN/A
metadata-evalN/A
metadata-evalN/A
lower-pow.f64N/A
metadata-evalN/A
Applied rewrites82.9%
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-/.f6440.1
Applied rewrites40.1%
lift-exp.f64N/A
lift-*.f64N/A
*-commutativeN/A
exp-prodN/A
lift-log.f64N/A
lift-/.f64N/A
log-divN/A
sub-negN/A
unpow-prod-upN/A
lower-*.f64N/A
lower-pow.f64N/A
lower-exp.f64N/A
lower-log.f64N/A
lower-pow.f64N/A
lower-exp.f64N/A
lower-neg.f64N/A
lower-log.f6440.2
Applied rewrites40.2%
Final simplification40.2%
angle_m = (fabs.f64 angle)
(FPCore (a b angle_m)
:precision binary64
(let* ((t_0 (cbrt (pow (PI) 1.5))))
(+
(pow (* (cos (* (exp (- (log (/ 180.0 angle_m)))) (* t_0 t_0))) b) 2.0)
(pow (* (sin (* (* angle_m (PI)) 0.005555555555555556)) a) 2.0))))\begin{array}{l}
angle_m = \left|angle\right|
\\
\begin{array}{l}
t_0 := \sqrt[3]{{\mathsf{PI}\left(\right)}^{1.5}}\\
{\left(\cos \left(e^{-\log \left(\frac{180}{angle\_m}\right)} \cdot \left(t\_0 \cdot t\_0\right)\right) \cdot b\right)}^{2} + {\left(\sin \left(\left(angle\_m \cdot \mathsf{PI}\left(\right)\right) \cdot 0.005555555555555556\right) \cdot a\right)}^{2}
\end{array}
\end{array}
Initial program 82.8%
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
div-invN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
metadata-eval82.9
Applied rewrites82.9%
lift-PI.f64N/A
add-cbrt-cubeN/A
lift-PI.f64N/A
lift-PI.f64N/A
lift-PI.f64N/A
rem-square-sqrtN/A
lift-sqrt.f64N/A
lift-sqrt.f64N/A
unswap-sqrN/A
cbrt-prodN/A
lower-*.f64N/A
lower-cbrt.f64N/A
unpow1N/A
lift-sqrt.f64N/A
pow1/2N/A
pow-prod-upN/A
metadata-evalN/A
metadata-evalN/A
lower-pow.f64N/A
metadata-evalN/A
Applied rewrites82.9%
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-/.f6440.1
Applied rewrites40.1%
Final simplification40.1%
angle_m = (fabs.f64 angle)
(FPCore (a b angle_m)
:precision binary64
(let* ((t_0 (cbrt (pow (PI) 1.5))))
(+
(pow (* (cos (* (/ angle_m 180.0) (* t_0 t_0))) b) 2.0)
(pow (* (sin (* (* angle_m (PI)) 0.005555555555555556)) a) 2.0))))\begin{array}{l}
angle_m = \left|angle\right|
\\
\begin{array}{l}
t_0 := \sqrt[3]{{\mathsf{PI}\left(\right)}^{1.5}}\\
{\left(\cos \left(\frac{angle\_m}{180} \cdot \left(t\_0 \cdot t\_0\right)\right) \cdot b\right)}^{2} + {\left(\sin \left(\left(angle\_m \cdot \mathsf{PI}\left(\right)\right) \cdot 0.005555555555555556\right) \cdot a\right)}^{2}
\end{array}
\end{array}
Initial program 82.8%
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
div-invN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
metadata-eval82.9
Applied rewrites82.9%
lift-PI.f64N/A
add-cbrt-cubeN/A
lift-PI.f64N/A
lift-PI.f64N/A
lift-PI.f64N/A
rem-square-sqrtN/A
lift-sqrt.f64N/A
lift-sqrt.f64N/A
unswap-sqrN/A
cbrt-prodN/A
lower-*.f64N/A
lower-cbrt.f64N/A
unpow1N/A
lift-sqrt.f64N/A
pow1/2N/A
pow-prod-upN/A
metadata-evalN/A
metadata-evalN/A
lower-pow.f64N/A
metadata-evalN/A
Applied rewrites82.9%
Final simplification82.9%
angle_m = (fabs.f64 angle)
(FPCore (a b angle_m)
:precision binary64
(let* ((t_0 (cbrt (pow (PI) 1.5))))
(+
(pow (* (cos (* (* 0.005555555555555556 angle_m) (* t_0 t_0))) b) 2.0)
(pow (* (sin (* (* angle_m (PI)) 0.005555555555555556)) a) 2.0))))\begin{array}{l}
angle_m = \left|angle\right|
\\
\begin{array}{l}
t_0 := \sqrt[3]{{\mathsf{PI}\left(\right)}^{1.5}}\\
{\left(\cos \left(\left(0.005555555555555556 \cdot angle\_m\right) \cdot \left(t\_0 \cdot t\_0\right)\right) \cdot b\right)}^{2} + {\left(\sin \left(\left(angle\_m \cdot \mathsf{PI}\left(\right)\right) \cdot 0.005555555555555556\right) \cdot a\right)}^{2}
\end{array}
\end{array}
Initial program 82.8%
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
div-invN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
metadata-eval82.9
Applied rewrites82.9%
lift-PI.f64N/A
add-cbrt-cubeN/A
lift-PI.f64N/A
lift-PI.f64N/A
lift-PI.f64N/A
rem-square-sqrtN/A
lift-sqrt.f64N/A
lift-sqrt.f64N/A
unswap-sqrN/A
cbrt-prodN/A
lower-*.f64N/A
lower-cbrt.f64N/A
unpow1N/A
lift-sqrt.f64N/A
pow1/2N/A
pow-prod-upN/A
metadata-evalN/A
metadata-evalN/A
lower-pow.f64N/A
metadata-evalN/A
Applied rewrites82.9%
lift-/.f64N/A
div-invN/A
metadata-evalN/A
lower-*.f6482.9
Applied rewrites82.9%
Final simplification82.9%
angle_m = (fabs.f64 angle)
(FPCore (a b angle_m)
:precision binary64
(let* ((t_0 (sqrt (PI))))
(+
(pow (* (cos (* (* (* t_0 angle_m) 0.005555555555555556) t_0)) b) 2.0)
(pow (* (sin (* (* angle_m (PI)) 0.005555555555555556)) a) 2.0))))\begin{array}{l}
angle_m = \left|angle\right|
\\
\begin{array}{l}
t_0 := \sqrt{\mathsf{PI}\left(\right)}\\
{\left(\cos \left(\left(\left(t\_0 \cdot angle\_m\right) \cdot 0.005555555555555556\right) \cdot t\_0\right) \cdot b\right)}^{2} + {\left(\sin \left(\left(angle\_m \cdot \mathsf{PI}\left(\right)\right) \cdot 0.005555555555555556\right) \cdot a\right)}^{2}
\end{array}
\end{array}
Initial program 82.8%
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
div-invN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
metadata-eval82.9
Applied rewrites82.9%
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
*-commutativeN/A
rem-square-sqrtN/A
lift-sqrt.f64N/A
lift-sqrt.f64N/A
associate-*l*N/A
lift-*.f64N/A
associate-*l/N/A
div-invN/A
metadata-evalN/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f6482.9
Applied rewrites82.9%
Final simplification82.9%
angle_m = (fabs.f64 angle) (FPCore (a b angle_m) :precision binary64 (+ (pow (* (cos (/ (PI) (/ 180.0 angle_m))) b) 2.0) (pow (* (sin (* (* angle_m (PI)) 0.005555555555555556)) a) 2.0)))
\begin{array}{l}
angle_m = \left|angle\right|
\\
{\left(\cos \left(\frac{\mathsf{PI}\left(\right)}{\frac{180}{angle\_m}}\right) \cdot b\right)}^{2} + {\left(\sin \left(\left(angle\_m \cdot \mathsf{PI}\left(\right)\right) \cdot 0.005555555555555556\right) \cdot a\right)}^{2}
\end{array}
Initial program 82.8%
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
div-invN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
metadata-eval82.9
Applied rewrites82.9%
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lower-/.f64N/A
lower-/.f6482.9
Applied rewrites82.9%
Final simplification82.9%
angle_m = (fabs.f64 angle) (FPCore (a b angle_m) :precision binary64 (+ (pow (* (cos (* (/ angle_m 180.0) (PI))) b) 2.0) (pow (* (sin (* (* angle_m (PI)) 0.005555555555555556)) a) 2.0)))
\begin{array}{l}
angle_m = \left|angle\right|
\\
{\left(\cos \left(\frac{angle\_m}{180} \cdot \mathsf{PI}\left(\right)\right) \cdot b\right)}^{2} + {\left(\sin \left(\left(angle\_m \cdot \mathsf{PI}\left(\right)\right) \cdot 0.005555555555555556\right) \cdot a\right)}^{2}
\end{array}
Initial program 82.8%
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
div-invN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
metadata-eval82.9
Applied rewrites82.9%
Final simplification82.9%
angle_m = (fabs.f64 angle) (FPCore (a b angle_m) :precision binary64 (+ (pow (* (sin (* (* 0.005555555555555556 (PI)) angle_m)) a) 2.0) (pow (* (cos (* (/ angle_m 180.0) (PI))) b) 2.0)))
\begin{array}{l}
angle_m = \left|angle\right|
\\
{\left(\sin \left(\left(0.005555555555555556 \cdot \mathsf{PI}\left(\right)\right) \cdot angle\_m\right) \cdot a\right)}^{2} + {\left(\cos \left(\frac{angle\_m}{180} \cdot \mathsf{PI}\left(\right)\right) \cdot b\right)}^{2}
\end{array}
Initial program 82.8%
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
div-invN/A
*-commutativeN/A
lower-*.f64N/A
metadata-eval82.9
Applied rewrites82.9%
Final simplification82.9%
angle_m = (fabs.f64 angle)
(FPCore (a b angle_m)
:precision binary64
(let* ((t_0 (* angle_m (PI))))
(+
(pow (* (cos (* t_0 -0.005555555555555556)) b) 2.0)
(pow (* (sin (* t_0 0.005555555555555556)) a) 2.0))))\begin{array}{l}
angle_m = \left|angle\right|
\\
\begin{array}{l}
t_0 := angle\_m \cdot \mathsf{PI}\left(\right)\\
{\left(\cos \left(t\_0 \cdot -0.005555555555555556\right) \cdot b\right)}^{2} + {\left(\sin \left(t\_0 \cdot 0.005555555555555556\right) \cdot a\right)}^{2}
\end{array}
\end{array}
Initial program 82.8%
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
div-invN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
metadata-eval82.9
Applied rewrites82.9%
lift-PI.f64N/A
add-cbrt-cubeN/A
lift-PI.f64N/A
lift-PI.f64N/A
lift-PI.f64N/A
rem-square-sqrtN/A
lift-sqrt.f64N/A
lift-sqrt.f64N/A
unswap-sqrN/A
cbrt-prodN/A
lower-*.f64N/A
lower-cbrt.f64N/A
unpow1N/A
lift-sqrt.f64N/A
pow1/2N/A
pow-prod-upN/A
metadata-evalN/A
metadata-evalN/A
lower-pow.f64N/A
metadata-evalN/A
Applied rewrites82.9%
Applied rewrites82.8%
Final simplification82.8%
angle_m = (fabs.f64 angle) (FPCore (a b angle_m) :precision binary64 (+ (pow (* (cos (* (* angle_m (PI)) -0.005555555555555556)) b) 2.0) (pow (* (sin (* (* 0.005555555555555556 angle_m) (PI))) a) 2.0)))
\begin{array}{l}
angle_m = \left|angle\right|
\\
{\left(\cos \left(\left(angle\_m \cdot \mathsf{PI}\left(\right)\right) \cdot -0.005555555555555556\right) \cdot b\right)}^{2} + {\left(\sin \left(\left(0.005555555555555556 \cdot angle\_m\right) \cdot \mathsf{PI}\left(\right)\right) \cdot a\right)}^{2}
\end{array}
Initial program 82.8%
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
div-invN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
metadata-eval82.9
Applied rewrites82.9%
Applied rewrites82.8%
Final simplification82.8%
angle_m = (fabs.f64 angle) (FPCore (a b angle_m) :precision binary64 (+ (pow (* 1.0 b) 2.0) (pow (* (sin (* (* angle_m (PI)) 0.005555555555555556)) a) 2.0)))
\begin{array}{l}
angle_m = \left|angle\right|
\\
{\left(1 \cdot b\right)}^{2} + {\left(\sin \left(\left(angle\_m \cdot \mathsf{PI}\left(\right)\right) \cdot 0.005555555555555556\right) \cdot a\right)}^{2}
\end{array}
Initial program 82.8%
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
div-invN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
metadata-eval82.9
Applied rewrites82.9%
Taylor expanded in angle around 0
Applied rewrites82.7%
Final simplification82.7%
angle_m = (fabs.f64 angle) (FPCore (a b angle_m) :precision binary64 (if (<= b 7e-146) (pow (* (sin (* (* 0.005555555555555556 (PI)) angle_m)) a) 2.0) (fma b b (pow (* (* (* (PI) a) 0.005555555555555556) angle_m) 2.0))))
\begin{array}{l}
angle_m = \left|angle\right|
\\
\begin{array}{l}
\mathbf{if}\;b \leq 7 \cdot 10^{-146}:\\
\;\;\;\;{\left(\sin \left(\left(0.005555555555555556 \cdot \mathsf{PI}\left(\right)\right) \cdot angle\_m\right) \cdot a\right)}^{2}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(b, b, {\left(\left(\left(\mathsf{PI}\left(\right) \cdot a\right) \cdot 0.005555555555555556\right) \cdot angle\_m\right)}^{2}\right)\\
\end{array}
\end{array}
if b < 7.0000000000000003e-146Initial program 81.1%
unpow1N/A
pow-to-expN/A
*-rgt-identityN/A
*-commutativeN/A
exp-prodN/A
lower-pow.f64N/A
exp-1-eN/A
lower-E.f64N/A
rem-log-expN/A
pow-to-expN/A
unpow1N/A
lower-log.f6446.5
lift-*.f64N/A
*-commutativeN/A
lower-*.f6446.5
Applied rewrites45.5%
Taylor expanded in b around 0
lower-pow.f64N/A
log-EN/A
unpow1N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-PI.f6443.9
Applied rewrites43.9%
if 7.0000000000000003e-146 < b Initial program 85.3%
unpow1N/A
pow-to-expN/A
*-rgt-identityN/A
*-commutativeN/A
exp-prodN/A
lower-pow.f64N/A
exp-1-eN/A
lower-E.f64N/A
rem-log-expN/A
pow-to-expN/A
unpow1N/A
lower-log.f6449.1
lift-*.f64N/A
*-commutativeN/A
lower-*.f6449.1
Applied rewrites47.7%
Taylor expanded in angle around 0
unpow2N/A
lower-fma.f64N/A
lower-pow.f64N/A
Applied rewrites82.7%
Final simplification59.7%
angle_m = (fabs.f64 angle) (FPCore (a b angle_m) :precision binary64 (if (<= a 6e-144) (* b b) (fma b b (pow (* (* (* (PI) a) 0.005555555555555556) angle_m) 2.0))))
\begin{array}{l}
angle_m = \left|angle\right|
\\
\begin{array}{l}
\mathbf{if}\;a \leq 6 \cdot 10^{-144}:\\
\;\;\;\;b \cdot b\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(b, b, {\left(\left(\left(\mathsf{PI}\left(\right) \cdot a\right) \cdot 0.005555555555555556\right) \cdot angle\_m\right)}^{2}\right)\\
\end{array}
\end{array}
if a < 5.9999999999999997e-144Initial program 84.2%
Taylor expanded in angle around 0
unpow2N/A
lower-*.f6467.2
Applied rewrites67.2%
if 5.9999999999999997e-144 < a Initial program 79.8%
unpow1N/A
pow-to-expN/A
*-rgt-identityN/A
*-commutativeN/A
exp-prodN/A
lower-pow.f64N/A
exp-1-eN/A
lower-E.f64N/A
rem-log-expN/A
pow-to-expN/A
unpow1N/A
lower-log.f6434.8
lift-*.f64N/A
*-commutativeN/A
lower-*.f6434.8
Applied rewrites34.1%
Taylor expanded in angle around 0
unpow2N/A
lower-fma.f64N/A
lower-pow.f64N/A
Applied rewrites76.8%
angle_m = (fabs.f64 angle)
(FPCore (a b angle_m)
:precision binary64
(if (<= b 9.8e+17)
(fma
(*
(* (* (PI) (PI)) angle_m)
(fma (* 3.08641975308642e-5 a) a (* -3.08641975308642e-5 (* b b))))
angle_m
(* b b))
(* b b)))\begin{array}{l}
angle_m = \left|angle\right|
\\
\begin{array}{l}
\mathbf{if}\;b \leq 9.8 \cdot 10^{+17}:\\
\;\;\;\;\mathsf{fma}\left(\left(\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right) \cdot angle\_m\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\_m, b \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;b \cdot b\\
\end{array}
\end{array}
if b < 9.8e17Initial program 80.1%
Taylor expanded in angle around 0
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites48.6%
Applied rewrites52.3%
if 9.8e17 < b Initial program 89.4%
Taylor expanded in angle around 0
unpow2N/A
lower-*.f6486.2
Applied rewrites86.2%
Final simplification62.1%
angle_m = (fabs.f64 angle)
(FPCore (a b angle_m)
:precision binary64
(if (<= (/ angle_m 180.0) 2e-166)
(* b b)
(fma
(* (* (* (* a a) 3.08641975308642e-5) (PI)) (PI))
(* angle_m angle_m)
(* b b))))\begin{array}{l}
angle_m = \left|angle\right|
\\
\begin{array}{l}
\mathbf{if}\;\frac{angle\_m}{180} \leq 2 \cdot 10^{-166}:\\
\;\;\;\;b \cdot b\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\left(\left(\left(a \cdot a\right) \cdot 3.08641975308642 \cdot 10^{-5}\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \mathsf{PI}\left(\right), angle\_m \cdot angle\_m, b \cdot b\right)\\
\end{array}
\end{array}
if (/.f64 angle #s(literal 180 binary64)) < 2.00000000000000008e-166Initial program 85.6%
Taylor expanded in angle around 0
unpow2N/A
lower-*.f6467.4
Applied rewrites67.4%
if 2.00000000000000008e-166 < (/.f64 angle #s(literal 180 binary64)) Initial program 77.9%
Taylor expanded in angle around 0
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites41.1%
Taylor expanded in b around 0
Applied rewrites71.0%
Final simplification68.7%
angle_m = (fabs.f64 angle) (FPCore (a b angle_m) :precision binary64 (if (<= b 3.3e-135) (* (* (* (* (PI) (PI)) a) a) (* (* angle_m angle_m) 3.08641975308642e-5)) (* b b)))
\begin{array}{l}
angle_m = \left|angle\right|
\\
\begin{array}{l}
\mathbf{if}\;b \leq 3.3 \cdot 10^{-135}:\\
\;\;\;\;\left(\left(\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right) \cdot a\right) \cdot a\right) \cdot \left(\left(angle\_m \cdot angle\_m\right) \cdot 3.08641975308642 \cdot 10^{-5}\right)\\
\mathbf{else}:\\
\;\;\;\;b \cdot b\\
\end{array}
\end{array}
if b < 3.2999999999999999e-135Initial program 80.8%
Taylor expanded in angle around 0
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites44.6%
Taylor expanded in b around inf
Applied rewrites46.9%
Taylor expanded in b around 0
Applied rewrites33.7%
if 3.2999999999999999e-135 < b Initial program 85.8%
Taylor expanded in angle around 0
unpow2N/A
lower-*.f6474.6
Applied rewrites74.6%
Final simplification50.1%
angle_m = (fabs.f64 angle) (FPCore (a b angle_m) :precision binary64 (* b b))
angle_m = fabs(angle);
double code(double a, double b, double angle_m) {
return b * b;
}
angle_m = abs(angle)
real(8) function code(a, b, angle_m)
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: angle_m
code = b * b
end function
angle_m = Math.abs(angle);
public static double code(double a, double b, double angle_m) {
return b * b;
}
angle_m = math.fabs(angle) def code(a, b, angle_m): return b * b
angle_m = abs(angle) function code(a, b, angle_m) return Float64(b * b) end
angle_m = abs(angle); function tmp = code(a, b, angle_m) tmp = b * b; end
angle_m = N[Abs[angle], $MachinePrecision] code[a_, b_, angle$95$m_] := N[(b * b), $MachinePrecision]
\begin{array}{l}
angle_m = \left|angle\right|
\\
b \cdot b
\end{array}
Initial program 82.8%
Taylor expanded in angle around 0
unpow2N/A
lower-*.f6464.0
Applied rewrites64.0%
herbie shell --seed 2024270
(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)))