
(FPCore (a b angle) :precision binary64 (let* ((t_0 (* (PI) (/ angle 180.0)))) (+ (pow (* a (cos t_0)) 2.0) (pow (* b (sin t_0)) 2.0))))
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \mathsf{PI}\left(\right) \cdot \frac{angle}{180}\\
{\left(a \cdot \cos t\_0\right)}^{2} + {\left(b \cdot \sin t\_0\right)}^{2}
\end{array}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 24 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (a b angle) :precision binary64 (let* ((t_0 (* (PI) (/ angle 180.0)))) (+ (pow (* a (cos t_0)) 2.0) (pow (* b (sin t_0)) 2.0))))
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \mathsf{PI}\left(\right) \cdot \frac{angle}{180}\\
{\left(a \cdot \cos t\_0\right)}^{2} + {\left(b \cdot \sin t\_0\right)}^{2}
\end{array}
\end{array}
angle_m = (fabs.f64 angle)
(FPCore (a b angle_m)
:precision binary64
(let* ((t_0 (sqrt (PI))) (t_1 (log t_0)))
(+
(pow (* (sin (* (/ angle_m 180.0) (PI))) b) 2.0)
(pow
(*
(cos
(*
(/
(/ 1.0 (exp (/ (pow t_1 2.0) (- (log (/ t_0 angle_m))))))
(exp (/ (pow (log angle_m) 2.0) (- t_1 (log angle_m)))))
(/ t_0 180.0)))
a)
2.0))))\begin{array}{l}
angle_m = \left|angle\right|
\\
\begin{array}{l}
t_0 := \sqrt{\mathsf{PI}\left(\right)}\\
t_1 := \log t\_0\\
{\left(\sin \left(\frac{angle\_m}{180} \cdot \mathsf{PI}\left(\right)\right) \cdot b\right)}^{2} + {\left(\cos \left(\frac{\frac{1}{e^{\frac{{t\_1}^{2}}{-\log \left(\frac{t\_0}{angle\_m}\right)}}}}{e^{\frac{{\log angle\_m}^{2}}{t\_1 - \log angle\_m}}} \cdot \frac{t\_0}{180}\right) \cdot a\right)}^{2}
\end{array}
\end{array}
Initial program 76.3%
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lift-PI.f64N/A
add-sqr-sqrtN/A
div-invN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lift-PI.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lift-PI.f64N/A
lower-sqrt.f64N/A
inv-powN/A
lower-pow.f6476.4
Applied rewrites76.4%
lift-/.f64N/A
div-invN/A
lift-sqrt.f64N/A
pow1/2N/A
pow-to-expN/A
lift-pow.f64N/A
pow-to-expN/A
rec-expN/A
prod-expN/A
lower-exp.f64N/A
rem-log-expN/A
pow-to-expN/A
log-powN/A
lower-fma.f64N/A
lower-log.f64N/A
rem-log-expN/A
rec-expN/A
pow-to-expN/A
unpow-1N/A
remove-double-divN/A
lower-log.f6442.1
Applied rewrites42.1%
lift-exp.f64N/A
lift-fma.f64N/A
flip-+N/A
div-subN/A
exp-diffN/A
lower-/.f64N/A
Applied rewrites42.1%
lift-exp.f64N/A
lift-/.f64N/A
frac-2negN/A
distribute-frac-negN/A
exp-negN/A
lower-/.f64N/A
lower-exp.f64N/A
lower-/.f64N/A
lower-neg.f6442.1
lift--.f64N/A
lift-log.f64N/A
lift-log.f64N/A
Applied rewrites42.1%
Final simplification42.1%
angle_m = (fabs.f64 angle)
(FPCore (a b angle_m)
:precision binary64
(let* ((t_0 (sqrt (PI))) (t_1 (log t_0)))
(+
(pow
(*
(cos
(*
(/
(exp (/ (pow t_1 2.0) (- t_1 (log angle_m))))
(exp (/ (pow (log angle_m) 2.0) (log (/ t_0 angle_m)))))
(/ t_0 180.0)))
a)
2.0)
(pow (* (sin (* (/ angle_m 180.0) (PI))) b) 2.0))))\begin{array}{l}
angle_m = \left|angle\right|
\\
\begin{array}{l}
t_0 := \sqrt{\mathsf{PI}\left(\right)}\\
t_1 := \log t\_0\\
{\left(\cos \left(\frac{e^{\frac{{t\_1}^{2}}{t\_1 - \log angle\_m}}}{e^{\frac{{\log angle\_m}^{2}}{\log \left(\frac{t\_0}{angle\_m}\right)}}} \cdot \frac{t\_0}{180}\right) \cdot a\right)}^{2} + {\left(\sin \left(\frac{angle\_m}{180} \cdot \mathsf{PI}\left(\right)\right) \cdot b\right)}^{2}
\end{array}
\end{array}
Initial program 76.3%
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lift-PI.f64N/A
add-sqr-sqrtN/A
div-invN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lift-PI.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lift-PI.f64N/A
lower-sqrt.f64N/A
inv-powN/A
lower-pow.f6476.4
Applied rewrites76.4%
lift-/.f64N/A
div-invN/A
lift-sqrt.f64N/A
pow1/2N/A
pow-to-expN/A
lift-pow.f64N/A
pow-to-expN/A
rec-expN/A
prod-expN/A
lower-exp.f64N/A
rem-log-expN/A
pow-to-expN/A
log-powN/A
lower-fma.f64N/A
lower-log.f64N/A
rem-log-expN/A
rec-expN/A
pow-to-expN/A
unpow-1N/A
remove-double-divN/A
lower-log.f6442.1
Applied rewrites42.1%
lift-exp.f64N/A
lift-fma.f64N/A
flip-+N/A
div-subN/A
exp-diffN/A
lower-/.f64N/A
Applied rewrites42.1%
lift--.f64N/A
lift-log.f64N/A
lift-log.f64N/A
diff-logN/A
lower-log.f64N/A
lower-/.f6442.1
Applied rewrites42.1%
Final simplification42.1%
angle_m = (fabs.f64 angle)
(FPCore (a b angle_m)
:precision binary64
(let* ((t_0 (sqrt (PI))) (t_1 (log t_0)))
(+
(pow
(*
(cos
(*
(/
(pow t_0 (/ t_1 (log (/ t_0 angle_m))))
(exp (/ (pow (log angle_m) 2.0) (- t_1 (log angle_m)))))
(/ t_0 180.0)))
a)
2.0)
(pow (* (sin (* (/ angle_m 180.0) (PI))) b) 2.0))))\begin{array}{l}
angle_m = \left|angle\right|
\\
\begin{array}{l}
t_0 := \sqrt{\mathsf{PI}\left(\right)}\\
t_1 := \log t\_0\\
{\left(\cos \left(\frac{{t\_0}^{\left(\frac{t\_1}{\log \left(\frac{t\_0}{angle\_m}\right)}\right)}}{e^{\frac{{\log angle\_m}^{2}}{t\_1 - \log angle\_m}}} \cdot \frac{t\_0}{180}\right) \cdot a\right)}^{2} + {\left(\sin \left(\frac{angle\_m}{180} \cdot \mathsf{PI}\left(\right)\right) \cdot b\right)}^{2}
\end{array}
\end{array}
Initial program 76.3%
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lift-PI.f64N/A
add-sqr-sqrtN/A
div-invN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lift-PI.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lift-PI.f64N/A
lower-sqrt.f64N/A
inv-powN/A
lower-pow.f6476.4
Applied rewrites76.4%
lift-/.f64N/A
div-invN/A
lift-sqrt.f64N/A
pow1/2N/A
pow-to-expN/A
lift-pow.f64N/A
pow-to-expN/A
rec-expN/A
prod-expN/A
lower-exp.f64N/A
rem-log-expN/A
pow-to-expN/A
log-powN/A
lower-fma.f64N/A
lower-log.f64N/A
rem-log-expN/A
rec-expN/A
pow-to-expN/A
unpow-1N/A
remove-double-divN/A
lower-log.f6442.1
Applied rewrites42.1%
lift-exp.f64N/A
lift-fma.f64N/A
flip-+N/A
div-subN/A
exp-diffN/A
lower-/.f64N/A
Applied rewrites42.1%
lift-exp.f64N/A
lift-/.f64N/A
lift-pow.f64N/A
unpow2N/A
associate-/l*N/A
lift-log.f64N/A
exp-to-powN/A
lower-pow.f64N/A
lower-/.f6442.1
lift--.f64N/A
lift-log.f64N/A
lift-log.f64N/A
diff-logN/A
Applied rewrites42.1%
Final simplification42.1%
angle_m = (fabs.f64 angle)
(FPCore (a b angle_m)
:precision binary64
(+
(pow
(*
(cos (* (exp (fma 0.5 (log (PI)) (log angle_m))) (/ (sqrt (PI)) 180.0)))
a)
2.0)
(pow (* (sin (* (/ angle_m 180.0) (PI))) b) 2.0)))\begin{array}{l}
angle_m = \left|angle\right|
\\
{\left(\cos \left(e^{\mathsf{fma}\left(0.5, \log \mathsf{PI}\left(\right), \log angle\_m\right)} \cdot \frac{\sqrt{\mathsf{PI}\left(\right)}}{180}\right) \cdot a\right)}^{2} + {\left(\sin \left(\frac{angle\_m}{180} \cdot \mathsf{PI}\left(\right)\right) \cdot b\right)}^{2}
\end{array}
Initial program 76.3%
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lift-PI.f64N/A
add-sqr-sqrtN/A
div-invN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lift-PI.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lift-PI.f64N/A
lower-sqrt.f64N/A
inv-powN/A
lower-pow.f6476.4
Applied rewrites76.4%
lift-/.f64N/A
div-invN/A
lift-sqrt.f64N/A
pow1/2N/A
pow-to-expN/A
lift-pow.f64N/A
pow-to-expN/A
rec-expN/A
prod-expN/A
lower-exp.f64N/A
rem-log-expN/A
pow-to-expN/A
log-powN/A
lower-fma.f64N/A
lower-log.f64N/A
rem-log-expN/A
rec-expN/A
pow-to-expN/A
unpow-1N/A
remove-double-divN/A
lower-log.f6442.1
Applied rewrites42.1%
Final simplification42.1%
angle_m = (fabs.f64 angle)
(FPCore (a b angle_m)
:precision binary64
(let* ((t_0 (sqrt (PI))))
(+
(pow (* (cos (/ 1.0 (/ (/ (/ 180.0 t_0) angle_m) t_0))) a) 2.0)
(pow (* (sin (* (/ angle_m 180.0) (PI))) b) 2.0))))\begin{array}{l}
angle_m = \left|angle\right|
\\
\begin{array}{l}
t_0 := \sqrt{\mathsf{PI}\left(\right)}\\
{\left(\cos \left(\frac{1}{\frac{\frac{\frac{180}{t\_0}}{angle\_m}}{t\_0}}\right) \cdot a\right)}^{2} + {\left(\sin \left(\frac{angle\_m}{180} \cdot \mathsf{PI}\left(\right)\right) \cdot b\right)}^{2}
\end{array}
\end{array}
Initial program 76.3%
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lift-PI.f64N/A
add-sqr-sqrtN/A
div-invN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lift-PI.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lift-PI.f64N/A
lower-sqrt.f64N/A
inv-powN/A
lower-pow.f6476.4
Applied rewrites76.4%
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
lift-/.f64N/A
frac-2negN/A
clear-numN/A
frac-timesN/A
*-rgt-identityN/A
distribute-lft-neg-outN/A
frac-2negN/A
clear-numN/A
lower-/.f64N/A
lower-/.f64N/A
Applied rewrites76.4%
Final simplification76.4%
angle_m = (fabs.f64 angle)
(FPCore (a b angle_m)
:precision binary64
(let* ((t_0 (sqrt (PI))))
(+
(pow (* (cos (* (/ -1.0 (/ -1.0 (* angle_m t_0))) (/ t_0 180.0))) a) 2.0)
(pow (* (sin (* (/ angle_m 180.0) (PI))) b) 2.0))))\begin{array}{l}
angle_m = \left|angle\right|
\\
\begin{array}{l}
t_0 := \sqrt{\mathsf{PI}\left(\right)}\\
{\left(\cos \left(\frac{-1}{\frac{-1}{angle\_m \cdot t\_0}} \cdot \frac{t\_0}{180}\right) \cdot a\right)}^{2} + {\left(\sin \left(\frac{angle\_m}{180} \cdot \mathsf{PI}\left(\right)\right) \cdot b\right)}^{2}
\end{array}
\end{array}
Initial program 76.3%
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lift-PI.f64N/A
add-sqr-sqrtN/A
div-invN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lift-PI.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lift-PI.f64N/A
lower-sqrt.f64N/A
inv-powN/A
lower-pow.f6476.4
Applied rewrites76.4%
lift-/.f64N/A
clear-numN/A
frac-2negN/A
metadata-evalN/A
lower-/.f64N/A
clear-numN/A
lift-/.f64N/A
distribute-neg-fracN/A
metadata-evalN/A
lower-/.f6476.4
lift-/.f64N/A
clear-numN/A
associate-/r/N/A
lift-pow.f64N/A
unpow-1N/A
remove-double-divN/A
lower-*.f6476.4
Applied rewrites76.4%
Final simplification76.4%
angle_m = (fabs.f64 angle)
(FPCore (a b angle_m)
:precision binary64
(let* ((t_0 (sqrt (PI))))
(+
(pow (* (cos (* (* angle_m t_0) (/ t_0 180.0))) a) 2.0)
(pow (* (sin (* (/ angle_m 180.0) (PI))) b) 2.0))))\begin{array}{l}
angle_m = \left|angle\right|
\\
\begin{array}{l}
t_0 := \sqrt{\mathsf{PI}\left(\right)}\\
{\left(\cos \left(\left(angle\_m \cdot t\_0\right) \cdot \frac{t\_0}{180}\right) \cdot a\right)}^{2} + {\left(\sin \left(\frac{angle\_m}{180} \cdot \mathsf{PI}\left(\right)\right) \cdot b\right)}^{2}
\end{array}
\end{array}
Initial program 76.3%
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lift-PI.f64N/A
add-sqr-sqrtN/A
div-invN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lift-PI.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lift-PI.f64N/A
lower-sqrt.f64N/A
inv-powN/A
lower-pow.f6476.4
Applied rewrites76.4%
lift-/.f64N/A
div-invN/A
lift-pow.f64N/A
unpow-1N/A
remove-double-divN/A
lower-*.f6476.4
Applied rewrites76.4%
Final simplification76.4%
angle_m = (fabs.f64 angle)
(FPCore (a b angle_m)
:precision binary64
(let* ((t_0 (sqrt (PI))))
(+
(pow (* (cos (* (* 0.005555555555555556 (* angle_m t_0)) t_0)) a) 2.0)
(pow (* (sin (* (/ angle_m 180.0) (PI))) b) 2.0))))\begin{array}{l}
angle_m = \left|angle\right|
\\
\begin{array}{l}
t_0 := \sqrt{\mathsf{PI}\left(\right)}\\
{\left(\cos \left(\left(0.005555555555555556 \cdot \left(angle\_m \cdot t\_0\right)\right) \cdot t\_0\right) \cdot a\right)}^{2} + {\left(\sin \left(\frac{angle\_m}{180} \cdot \mathsf{PI}\left(\right)\right) \cdot b\right)}^{2}
\end{array}
\end{array}
Initial program 76.3%
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lift-PI.f64N/A
add-sqr-sqrtN/A
div-invN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lift-PI.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lift-PI.f64N/A
lower-sqrt.f64N/A
inv-powN/A
lower-pow.f6476.4
Applied rewrites76.4%
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
div-invN/A
lift-pow.f64N/A
unpow-1N/A
remove-double-divN/A
associate-*r*N/A
*-commutativeN/A
lift-/.f64N/A
div-invN/A
metadata-evalN/A
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f6476.3
Applied rewrites76.4%
Final simplification76.4%
angle_m = (fabs.f64 angle) (FPCore (a b angle_m) :precision binary64 (+ (pow (* (cos (/ 1.0 (/ (/ 180.0 (PI)) angle_m))) a) 2.0) (pow (* (sin (* (/ angle_m 180.0) (PI))) b) 2.0)))
\begin{array}{l}
angle_m = \left|angle\right|
\\
{\left(\cos \left(\frac{1}{\frac{\frac{180}{\mathsf{PI}\left(\right)}}{angle\_m}}\right) \cdot a\right)}^{2} + {\left(\sin \left(\frac{angle\_m}{180} \cdot \mathsf{PI}\left(\right)\right) \cdot b\right)}^{2}
\end{array}
Initial program 76.3%
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lift-PI.f64N/A
add-sqr-sqrtN/A
div-invN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lift-PI.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lift-PI.f64N/A
lower-sqrt.f64N/A
inv-powN/A
lower-pow.f6476.4
Applied rewrites76.4%
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
lift-/.f64N/A
frac-2negN/A
clear-numN/A
frac-timesN/A
*-rgt-identityN/A
distribute-lft-neg-outN/A
frac-2negN/A
clear-numN/A
lower-/.f64N/A
lower-/.f64N/A
Applied rewrites76.4%
lift-/.f64N/A
div-invN/A
lift-/.f64N/A
associate-*l/N/A
lift-/.f64N/A
clear-numN/A
lift-/.f64N/A
frac-timesN/A
metadata-evalN/A
lower-/.f64N/A
Applied rewrites76.3%
Final simplification76.3%
angle_m = (fabs.f64 angle) (FPCore (a b angle_m) :precision binary64 (+ (pow (* (cos (/ 1.0 (/ (/ 180.0 angle_m) (PI)))) a) 2.0) (pow (* (sin (* (/ angle_m 180.0) (PI))) b) 2.0)))
\begin{array}{l}
angle_m = \left|angle\right|
\\
{\left(\cos \left(\frac{1}{\frac{\frac{180}{angle\_m}}{\mathsf{PI}\left(\right)}}\right) \cdot a\right)}^{2} + {\left(\sin \left(\frac{angle\_m}{180} \cdot \mathsf{PI}\left(\right)\right) \cdot b\right)}^{2}
\end{array}
Initial program 76.3%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
clear-numN/A
lower-/.f64N/A
*-commutativeN/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f6476.3
Applied rewrites76.3%
Final simplification76.3%
angle_m = (fabs.f64 angle) (FPCore (a b angle_m) :precision binary64 (let* ((t_0 (* (/ angle_m 180.0) (PI)))) (+ (pow (* (cos t_0) a) 2.0) (pow (* (sin t_0) b) 2.0))))
\begin{array}{l}
angle_m = \left|angle\right|
\\
\begin{array}{l}
t_0 := \frac{angle\_m}{180} \cdot \mathsf{PI}\left(\right)\\
{\left(\cos t\_0 \cdot a\right)}^{2} + {\left(\sin t\_0 \cdot b\right)}^{2}
\end{array}
\end{array}
Initial program 76.3%
Final simplification76.3%
angle_m = (fabs.f64 angle) (FPCore (a b angle_m) :precision binary64 (+ (pow (* (cos (* (* -0.005555555555555556 angle_m) (PI))) a) 2.0) (pow (* (sin (* (/ angle_m 180.0) (PI))) b) 2.0)))
\begin{array}{l}
angle_m = \left|angle\right|
\\
{\left(\cos \left(\left(-0.005555555555555556 \cdot angle\_m\right) \cdot \mathsf{PI}\left(\right)\right) \cdot a\right)}^{2} + {\left(\sin \left(\frac{angle\_m}{180} \cdot \mathsf{PI}\left(\right)\right) \cdot b\right)}^{2}
\end{array}
Initial program 76.3%
lift-cos.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
frac-2negN/A
distribute-frac-negN/A
distribute-lft-neg-outN/A
cos-negN/A
lower-cos.f64N/A
lower-*.f64N/A
div-invN/A
lower-*.f64N/A
metadata-evalN/A
metadata-eval76.3
Applied rewrites76.3%
Final simplification76.3%
angle_m = (fabs.f64 angle) (FPCore (a b angle_m) :precision binary64 (let* ((t_0 (* (* 0.005555555555555556 angle_m) (PI)))) (fma a (* (pow (cos t_0) 2.0) a) (pow (* (sin t_0) b) 2.0))))
\begin{array}{l}
angle_m = \left|angle\right|
\\
\begin{array}{l}
t_0 := \left(0.005555555555555556 \cdot angle\_m\right) \cdot \mathsf{PI}\left(\right)\\
\mathsf{fma}\left(a, {\cos t\_0}^{2} \cdot a, {\left(\sin t\_0 \cdot b\right)}^{2}\right)
\end{array}
\end{array}
Initial program 76.3%
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lift-PI.f64N/A
add-sqr-sqrtN/A
div-invN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lift-PI.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lift-PI.f64N/A
lower-sqrt.f64N/A
inv-powN/A
lower-pow.f6476.4
Applied rewrites76.4%
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
lift-/.f64N/A
frac-2negN/A
clear-numN/A
frac-timesN/A
*-rgt-identityN/A
distribute-lft-neg-outN/A
frac-2negN/A
clear-numN/A
lower-/.f64N/A
lower-/.f64N/A
Applied rewrites76.4%
Applied rewrites76.2%
Final simplification76.2%
angle_m = (fabs.f64 angle) (FPCore (a b angle_m) :precision binary64 (+ (pow (* (cos (* (* angle_m (PI)) -0.005555555555555556)) a) 2.0) (pow (* (sin (* (* 0.005555555555555556 (PI)) angle_m)) b) 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 a\right)}^{2} + {\left(\sin \left(\left(0.005555555555555556 \cdot \mathsf{PI}\left(\right)\right) \cdot angle\_m\right) \cdot b\right)}^{2}
\end{array}
Initial program 76.3%
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lift-PI.f64N/A
add-sqr-sqrtN/A
div-invN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lift-PI.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lift-PI.f64N/A
lower-sqrt.f64N/A
inv-powN/A
lower-pow.f6476.4
Applied rewrites76.4%
Applied rewrites76.2%
Final simplification76.2%
angle_m = (fabs.f64 angle) (FPCore (a b angle_m) :precision binary64 (+ (pow (* (sin (* (* angle_m (PI)) 0.005555555555555556)) b) 2.0) (pow (* (cos (* (* -0.005555555555555556 angle_m) (PI))) a) 2.0)))
\begin{array}{l}
angle_m = \left|angle\right|
\\
{\left(\sin \left(\left(angle\_m \cdot \mathsf{PI}\left(\right)\right) \cdot 0.005555555555555556\right) \cdot b\right)}^{2} + {\left(\cos \left(\left(-0.005555555555555556 \cdot angle\_m\right) \cdot \mathsf{PI}\left(\right)\right) \cdot a\right)}^{2}
\end{array}
Initial program 76.3%
lift-cos.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
frac-2negN/A
distribute-frac-negN/A
distribute-lft-neg-outN/A
cos-negN/A
lower-cos.f64N/A
lower-*.f64N/A
div-invN/A
lower-*.f64N/A
metadata-evalN/A
metadata-eval76.3
Applied rewrites76.3%
lift-*.f64N/A
lift-/.f64N/A
div-invN/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
metadata-eval76.1
Applied rewrites76.1%
Final simplification76.1%
angle_m = (fabs.f64 angle) (FPCore (a b angle_m) :precision binary64 (+ (* a a) (pow (* (sin (* (/ angle_m 180.0) (PI))) b) 2.0)))
\begin{array}{l}
angle_m = \left|angle\right|
\\
a \cdot a + {\left(\sin \left(\frac{angle\_m}{180} \cdot \mathsf{PI}\left(\right)\right) \cdot b\right)}^{2}
\end{array}
Initial program 76.3%
Taylor expanded in angle around 0
unpow2N/A
lower-*.f6475.8
Applied rewrites75.8%
Final simplification75.8%
angle_m = (fabs.f64 angle)
(FPCore (a b angle_m)
:precision binary64
(if (<= a 1.15e+20)
(fma
(*
(* (* (PI) (PI)) angle_m)
(fma (* 3.08641975308642e-5 b) b (* -3.08641975308642e-5 (* a a))))
angle_m
(* a a))
(* (pow (cos (* (* angle_m (PI)) -0.005555555555555556)) 2.0) (* a a))))\begin{array}{l}
angle_m = \left|angle\right|
\\
\begin{array}{l}
\mathbf{if}\;a \leq 1.15 \cdot 10^{+20}:\\
\;\;\;\;\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 b, b, -3.08641975308642 \cdot 10^{-5} \cdot \left(a \cdot a\right)\right), angle\_m, a \cdot a\right)\\
\mathbf{else}:\\
\;\;\;\;{\cos \left(\left(angle\_m \cdot \mathsf{PI}\left(\right)\right) \cdot -0.005555555555555556\right)}^{2} \cdot \left(a \cdot a\right)\\
\end{array}
\end{array}
if a < 1.15e20Initial program 73.2%
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lift-PI.f64N/A
add-sqr-sqrtN/A
div-invN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lift-PI.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lift-PI.f64N/A
lower-sqrt.f64N/A
inv-powN/A
lower-pow.f6473.3
Applied rewrites73.3%
Taylor expanded in angle around 0
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites46.5%
Applied rewrites50.5%
if 1.15e20 < a Initial program 86.8%
lift-+.f64N/A
+-commutativeN/A
lift-pow.f64N/A
unpow2N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
lower-fma.f64N/A
Applied rewrites86.8%
Taylor expanded in b around 0
*-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-*.f6478.6
Applied rewrites78.6%
Final simplification56.9%
angle_m = (fabs.f64 angle) (FPCore (a b angle_m) :precision binary64 (+ (* a a) (pow (* (sin (* (* angle_m (PI)) 0.005555555555555556)) b) 2.0)))
\begin{array}{l}
angle_m = \left|angle\right|
\\
a \cdot a + {\left(\sin \left(\left(angle\_m \cdot \mathsf{PI}\left(\right)\right) \cdot 0.005555555555555556\right) \cdot b\right)}^{2}
\end{array}
Initial program 76.3%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
div-invN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
metadata-eval76.2
Applied rewrites76.2%
Taylor expanded in angle around 0
unpow2N/A
lower-*.f6475.7
Applied rewrites75.7%
Final simplification75.7%
angle_m = (fabs.f64 angle)
(FPCore (a b angle_m)
:precision binary64
(if (<= a 3.7e+144)
(fma
(*
(* (* (PI) (PI)) angle_m)
(fma (* 3.08641975308642e-5 b) b (* -3.08641975308642e-5 (* a a))))
angle_m
(* a a))
(* a a)))\begin{array}{l}
angle_m = \left|angle\right|
\\
\begin{array}{l}
\mathbf{if}\;a \leq 3.7 \cdot 10^{+144}:\\
\;\;\;\;\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 b, b, -3.08641975308642 \cdot 10^{-5} \cdot \left(a \cdot a\right)\right), angle\_m, a \cdot a\right)\\
\mathbf{else}:\\
\;\;\;\;a \cdot a\\
\end{array}
\end{array}
if a < 3.6999999999999997e144Initial program 72.9%
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lift-PI.f64N/A
add-sqr-sqrtN/A
div-invN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lift-PI.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lift-PI.f64N/A
lower-sqrt.f64N/A
inv-powN/A
lower-pow.f6473.0
Applied rewrites73.0%
Taylor expanded in angle around 0
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites46.2%
Applied rewrites49.8%
if 3.6999999999999997e144 < a Initial program 100.0%
Taylor expanded in angle around 0
unpow2N/A
lower-*.f64100.0
Applied rewrites100.0%
Final simplification56.1%
angle_m = (fabs.f64 angle)
(FPCore (a b angle_m)
:precision binary64
(if (<= b 7.5e-77)
(* a a)
(fma
(* (* (* b b) 3.08641975308642e-5) (* (PI) (PI)))
(* angle_m angle_m)
(* a a))))\begin{array}{l}
angle_m = \left|angle\right|
\\
\begin{array}{l}
\mathbf{if}\;b \leq 7.5 \cdot 10^{-77}:\\
\;\;\;\;a \cdot a\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\left(\left(b \cdot b\right) \cdot 3.08641975308642 \cdot 10^{-5}\right) \cdot \left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right), angle\_m \cdot angle\_m, a \cdot a\right)\\
\end{array}
\end{array}
if b < 7.5000000000000006e-77Initial program 76.6%
Taylor expanded in angle around 0
unpow2N/A
lower-*.f6459.5
Applied rewrites59.5%
if 7.5000000000000006e-77 < b Initial program 75.5%
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lift-PI.f64N/A
add-sqr-sqrtN/A
div-invN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lift-PI.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lift-PI.f64N/A
lower-sqrt.f64N/A
inv-powN/A
lower-pow.f6475.5
Applied rewrites75.5%
Taylor expanded in angle around 0
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites37.1%
Taylor expanded in b around inf
Applied rewrites57.3%
Final simplification58.8%
angle_m = (fabs.f64 angle) (FPCore (a b angle_m) :precision binary64 (if (<= b 6.5e+138) (* a a) (* (* (* (PI) (PI)) b) (* (* (* angle_m angle_m) 3.08641975308642e-5) b))))
\begin{array}{l}
angle_m = \left|angle\right|
\\
\begin{array}{l}
\mathbf{if}\;b \leq 6.5 \cdot 10^{+138}:\\
\;\;\;\;a \cdot a\\
\mathbf{else}:\\
\;\;\;\;\left(\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right) \cdot b\right) \cdot \left(\left(\left(angle\_m \cdot angle\_m\right) \cdot 3.08641975308642 \cdot 10^{-5}\right) \cdot b\right)\\
\end{array}
\end{array}
if b < 6.50000000000000054e138Initial program 74.6%
Taylor expanded in angle around 0
unpow2N/A
lower-*.f6457.1
Applied rewrites57.1%
if 6.50000000000000054e138 < b Initial program 88.6%
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lift-PI.f64N/A
add-sqr-sqrtN/A
div-invN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lift-PI.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lift-PI.f64N/A
lower-sqrt.f64N/A
inv-powN/A
lower-pow.f6488.6
Applied rewrites88.6%
Taylor expanded in angle around 0
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites50.3%
Taylor expanded in b around inf
Applied rewrites63.2%
Applied rewrites68.1%
Final simplification58.4%
angle_m = (fabs.f64 angle) (FPCore (a b angle_m) :precision binary64 (if (<= b 6.5e+138) (* a a) (* (* (* (* (PI) (PI)) b) b) (* (* 3.08641975308642e-5 angle_m) angle_m))))
\begin{array}{l}
angle_m = \left|angle\right|
\\
\begin{array}{l}
\mathbf{if}\;b \leq 6.5 \cdot 10^{+138}:\\
\;\;\;\;a \cdot a\\
\mathbf{else}:\\
\;\;\;\;\left(\left(\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right) \cdot b\right) \cdot b\right) \cdot \left(\left(3.08641975308642 \cdot 10^{-5} \cdot angle\_m\right) \cdot angle\_m\right)\\
\end{array}
\end{array}
if b < 6.50000000000000054e138Initial program 74.6%
Taylor expanded in angle around 0
unpow2N/A
lower-*.f6457.1
Applied rewrites57.1%
if 6.50000000000000054e138 < b Initial program 88.6%
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lift-PI.f64N/A
add-sqr-sqrtN/A
div-invN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lift-PI.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lift-PI.f64N/A
lower-sqrt.f64N/A
inv-powN/A
lower-pow.f6488.6
Applied rewrites88.6%
Taylor expanded in angle around 0
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites50.3%
Taylor expanded in b around inf
Applied rewrites63.2%
Applied rewrites63.2%
Final simplification57.8%
angle_m = (fabs.f64 angle) (FPCore (a b angle_m) :precision binary64 (if (<= b 6.5e+138) (* a a) (* (* (* (* (PI) (PI)) b) b) (* (* angle_m angle_m) 3.08641975308642e-5))))
\begin{array}{l}
angle_m = \left|angle\right|
\\
\begin{array}{l}
\mathbf{if}\;b \leq 6.5 \cdot 10^{+138}:\\
\;\;\;\;a \cdot a\\
\mathbf{else}:\\
\;\;\;\;\left(\left(\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right) \cdot b\right) \cdot b\right) \cdot \left(\left(angle\_m \cdot angle\_m\right) \cdot 3.08641975308642 \cdot 10^{-5}\right)\\
\end{array}
\end{array}
if b < 6.50000000000000054e138Initial program 74.6%
Taylor expanded in angle around 0
unpow2N/A
lower-*.f6457.1
Applied rewrites57.1%
if 6.50000000000000054e138 < b Initial program 88.6%
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lift-PI.f64N/A
add-sqr-sqrtN/A
div-invN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lift-PI.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lift-PI.f64N/A
lower-sqrt.f64N/A
inv-powN/A
lower-pow.f6488.6
Applied rewrites88.6%
Taylor expanded in angle around 0
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites50.3%
Taylor expanded in b around inf
Applied rewrites63.2%
Final simplification57.8%
angle_m = (fabs.f64 angle) (FPCore (a b angle_m) :precision binary64 (* a a))
angle_m = fabs(angle);
double code(double a, double b, double angle_m) {
return a * a;
}
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 = a * a
end function
angle_m = Math.abs(angle);
public static double code(double a, double b, double angle_m) {
return a * a;
}
angle_m = math.fabs(angle) def code(a, b, angle_m): return a * a
angle_m = abs(angle) function code(a, b, angle_m) return Float64(a * a) end
angle_m = abs(angle); function tmp = code(a, b, angle_m) tmp = a * a; end
angle_m = N[Abs[angle], $MachinePrecision] code[a_, b_, angle$95$m_] := N[(a * a), $MachinePrecision]
\begin{array}{l}
angle_m = \left|angle\right|
\\
a \cdot a
\end{array}
Initial program 76.3%
Taylor expanded in angle around 0
unpow2N/A
lower-*.f6453.6
Applied rewrites53.6%
herbie shell --seed 2024264
(FPCore (a b angle)
:name "ab-angle->ABCF C"
:precision binary64
(+ (pow (* a (cos (* (PI) (/ angle 180.0)))) 2.0) (pow (* b (sin (* (PI) (/ angle 180.0)))) 2.0)))