
(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 15 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 (+ (pow (* (cos (exp (+ (log angle_m) (log (* 0.005555555555555556 (PI)))))) b) 2.0) (pow (* (sin (* (PI) (/ angle_m 180.0))) a) 2.0)))
\begin{array}{l}
angle_m = \left|angle\right|
\\
{\left(\cos \left(e^{\log angle\_m + \log \left(0.005555555555555556 \cdot \mathsf{PI}\left(\right)\right)}\right) \cdot b\right)}^{2} + {\left(\sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle\_m}{180}\right) \cdot a\right)}^{2}
\end{array}
Initial program 78.3%
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
clear-numN/A
inv-powN/A
pow-to-expN/A
lower-exp.f64N/A
lower-*.f64N/A
lower-log.f64N/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f6438.1
Applied rewrites38.1%
lift-*.f64N/A
*-commutativeN/A
mul-1-negN/A
lift-log.f64N/A
neg-logN/A
lift-/.f64N/A
clear-numN/A
lift-/.f64N/A
associate-/r/N/A
log-prodN/A
lower-+.f64N/A
lower-log.f64N/A
div-invN/A
metadata-evalN/A
*-commutativeN/A
lower-*.f64N/A
lower-log.f6438.1
Applied rewrites38.1%
Final simplification38.1%
angle_m = (fabs.f64 angle) (FPCore (a b angle_m) :precision binary64 (let* ((t_0 (* (* 0.005555555555555556 angle_m) (PI)))) (+ (pow (* (cos (exp (log t_0))) b) 2.0) (pow (* (sin t_0) a) 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)\\
{\left(\cos \left(e^{\log t\_0}\right) \cdot b\right)}^{2} + {\left(\sin t\_0 \cdot a\right)}^{2}
\end{array}
\end{array}
Initial program 78.3%
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
clear-numN/A
inv-powN/A
pow-to-expN/A
lower-exp.f64N/A
lower-*.f64N/A
lower-log.f64N/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f6438.1
Applied rewrites38.1%
lift-*.f64N/A
*-commutativeN/A
mul-1-negN/A
lift-log.f64N/A
neg-logN/A
lift-/.f64N/A
clear-numN/A
lift-/.f64N/A
associate-/r/N/A
log-prodN/A
lower-+.f64N/A
lower-log.f64N/A
div-invN/A
metadata-evalN/A
*-commutativeN/A
lower-*.f64N/A
lower-log.f6438.1
Applied rewrites38.1%
lift-+.f64N/A
lift-log.f64N/A
lift-log.f64N/A
sum-logN/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
lift-*.f64N/A
lift-*.f64N/A
lower-log.f6438.1
lift-*.f64N/A
*-commutativeN/A
lift-*.f6438.1
lift-*.f64N/A
*-commutativeN/A
lower-*.f6438.1
Applied rewrites38.1%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6438.1
lift-/.f64N/A
div-invN/A
metadata-evalN/A
*-commutativeN/A
lower-*.f6438.1
Applied rewrites38.1%
Final simplification38.1%
angle_m = (fabs.f64 angle)
(FPCore (a b angle_m)
:precision binary64
(let* ((t_0 (sqrt (PI))))
(+
(pow (* (cos (* (* t_0 t_0) (/ angle_m 180.0))) b) 2.0)
(pow (* (sin (* (* (PI) angle_m) 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(t\_0 \cdot t\_0\right) \cdot \frac{angle\_m}{180}\right) \cdot b\right)}^{2} + {\left(\sin \left(\left(\mathsf{PI}\left(\right) \cdot angle\_m\right) \cdot 0.005555555555555556\right) \cdot a\right)}^{2}
\end{array}
\end{array}
Initial program 78.3%
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
div-invN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
metadata-eval78.4
Applied rewrites78.4%
rem-square-sqrtN/A
lift-sqrt.f64N/A
lift-sqrt.f64N/A
lower-*.f6478.4
Applied rewrites78.4%
Final simplification78.4%
angle_m = (fabs.f64 angle) (FPCore (a b angle_m) :precision binary64 (+ (pow (* (cos (* (PI) (/ angle_m 180.0))) b) 2.0) (pow (* (sin (* (* (PI) angle_m) 0.005555555555555556)) a) 2.0)))
\begin{array}{l}
angle_m = \left|angle\right|
\\
{\left(\cos \left(\mathsf{PI}\left(\right) \cdot \frac{angle\_m}{180}\right) \cdot b\right)}^{2} + {\left(\sin \left(\left(\mathsf{PI}\left(\right) \cdot angle\_m\right) \cdot 0.005555555555555556\right) \cdot a\right)}^{2}
\end{array}
Initial program 78.3%
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
div-invN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
metadata-eval78.4
Applied rewrites78.4%
Final simplification78.4%
angle_m = (fabs.f64 angle) (FPCore (a b angle_m) :precision binary64 (let* ((t_0 (* (* 0.005555555555555556 angle_m) (PI)))) (+ (pow (* (cos t_0) b) 2.0) (pow (* (sin t_0) a) 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)\\
{\left(\cos t\_0 \cdot b\right)}^{2} + {\left(\sin t\_0 \cdot a\right)}^{2}
\end{array}
\end{array}
Initial program 78.3%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6478.3
lift-*.f64N/A
*-commutativeN/A
lower-*.f6478.3
lift-/.f64N/A
clear-numN/A
associate-/r/N/A
lower-*.f64N/A
metadata-eval78.3
Applied rewrites78.2%
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.f6478.3
lift-/.f64N/A
div-invN/A
metadata-evalN/A
*-commutativeN/A
lift-*.f6478.3
Applied rewrites78.3%
Final simplification78.3%
angle_m = (fabs.f64 angle) (FPCore (a b angle_m) :precision binary64 (+ (pow (* 1.0 b) 2.0) (pow (* (sin (* (* (PI) angle_m) 0.005555555555555556)) a) 2.0)))
\begin{array}{l}
angle_m = \left|angle\right|
\\
{\left(1 \cdot b\right)}^{2} + {\left(\sin \left(\left(\mathsf{PI}\left(\right) \cdot angle\_m\right) \cdot 0.005555555555555556\right) \cdot a\right)}^{2}
\end{array}
Initial program 78.3%
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
div-invN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
metadata-eval78.4
Applied rewrites78.4%
Taylor expanded in angle around 0
Applied rewrites78.2%
Final simplification78.2%
angle_m = (fabs.f64 angle)
(FPCore (a b angle_m)
:precision binary64
(let* ((t_0 (sqrt (PI))))
(if (<= a 4.6e-139)
(*
(* b b)
(pow (cos (* (* t_0 0.005555555555555556) (* t_0 angle_m))) 2.0))
(+
(* (* (PI) (PI)) (* (* (* (* angle_m angle_m) a) a) 3.08641975308642e-5))
(pow (* (cos (* (PI) (/ angle_m 180.0))) b) 2.0)))))\begin{array}{l}
angle_m = \left|angle\right|
\\
\begin{array}{l}
t_0 := \sqrt{\mathsf{PI}\left(\right)}\\
\mathbf{if}\;a \leq 4.6 \cdot 10^{-139}:\\
\;\;\;\;\left(b \cdot b\right) \cdot {\cos \left(\left(t\_0 \cdot 0.005555555555555556\right) \cdot \left(t\_0 \cdot angle\_m\right)\right)}^{2}\\
\mathbf{else}:\\
\;\;\;\;\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \left(\left(\left(\left(angle\_m \cdot angle\_m\right) \cdot a\right) \cdot a\right) \cdot 3.08641975308642 \cdot 10^{-5}\right) + {\left(\cos \left(\mathsf{PI}\left(\right) \cdot \frac{angle\_m}{180}\right) \cdot b\right)}^{2}\\
\end{array}
\end{array}
if a < 4.60000000000000025e-139Initial program 77.2%
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
clear-numN/A
inv-powN/A
pow-to-expN/A
lower-exp.f64N/A
lower-*.f64N/A
lower-log.f64N/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f6438.0
Applied rewrites38.0%
rem-log-expN/A
lift-*.f64N/A
lift-log.f64N/A
exp-to-powN/A
unpow-1N/A
lift-/.f64N/A
lift-/.f64N/A
associate-/r*N/A
rem-square-sqrtN/A
lift-sqrt.f64N/A
lift-sqrt.f64N/A
associate-*r*N/A
*-commutativeN/A
lift-*.f64N/A
clear-numN/A
associate-*r/N/A
lift-/.f64N/A
Applied rewrites37.9%
Taylor expanded in b around inf
Applied rewrites57.6%
if 4.60000000000000025e-139 < a Initial program 80.0%
Taylor expanded in angle around 0
associate-*r*N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
associate-*l*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-PI.f64N/A
lower-PI.f6473.3
Applied rewrites73.3%
Final simplification63.5%
angle_m = (fabs.f64 angle)
(FPCore (a b angle_m)
:precision binary64
(let* ((t_0 (sqrt (PI))))
(if (<= a 4.6e-139)
(*
(* b b)
(pow (cos (* (* t_0 0.005555555555555556) (* t_0 angle_m))) 2.0))
(if (<= a 6e+151)
(fma
(* (* (* a a) 3.08641975308642e-5) (* (PI) (PI)))
(* angle_m angle_m)
(* b b))
(* (pow (* (* (PI) a) angle_m) 2.0) 3.08641975308642e-5)))))\begin{array}{l}
angle_m = \left|angle\right|
\\
\begin{array}{l}
t_0 := \sqrt{\mathsf{PI}\left(\right)}\\
\mathbf{if}\;a \leq 4.6 \cdot 10^{-139}:\\
\;\;\;\;\left(b \cdot b\right) \cdot {\cos \left(\left(t\_0 \cdot 0.005555555555555556\right) \cdot \left(t\_0 \cdot angle\_m\right)\right)}^{2}\\
\mathbf{elif}\;a \leq 6 \cdot 10^{+151}:\\
\;\;\;\;\mathsf{fma}\left(\left(\left(a \cdot a\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, b \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;{\left(\left(\mathsf{PI}\left(\right) \cdot a\right) \cdot angle\_m\right)}^{2} \cdot 3.08641975308642 \cdot 10^{-5}\\
\end{array}
\end{array}
if a < 4.60000000000000025e-139Initial program 77.2%
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
clear-numN/A
inv-powN/A
pow-to-expN/A
lower-exp.f64N/A
lower-*.f64N/A
lower-log.f64N/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f6438.0
Applied rewrites38.0%
rem-log-expN/A
lift-*.f64N/A
lift-log.f64N/A
exp-to-powN/A
unpow-1N/A
lift-/.f64N/A
lift-/.f64N/A
associate-/r*N/A
rem-square-sqrtN/A
lift-sqrt.f64N/A
lift-sqrt.f64N/A
associate-*r*N/A
*-commutativeN/A
lift-*.f64N/A
clear-numN/A
associate-*r/N/A
lift-/.f64N/A
Applied rewrites37.9%
Taylor expanded in b around inf
Applied rewrites57.6%
if 4.60000000000000025e-139 < a < 5.9999999999999998e151Initial program 68.1%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6468.1
lift-*.f64N/A
*-commutativeN/A
lower-*.f6468.1
lift-/.f64N/A
clear-numN/A
associate-/r/N/A
lower-*.f64N/A
metadata-eval68.2
Applied rewrites68.1%
Taylor expanded in angle around 0
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites34.7%
Taylor expanded in b around 0
Applied rewrites62.1%
if 5.9999999999999998e151 < a Initial program 98.0%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6498.0
lift-*.f64N/A
*-commutativeN/A
lower-*.f6498.0
lift-/.f64N/A
clear-numN/A
associate-/r/N/A
lower-*.f64N/A
metadata-eval97.8
Applied rewrites97.8%
Taylor expanded in angle around 0
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites63.8%
Taylor expanded in b around 0
Applied rewrites71.6%
Applied rewrites82.6%
Final simplification62.3%
angle_m = (fabs.f64 angle)
(FPCore (a b angle_m)
:precision binary64
(if (<= a 4.6e-139)
(* (pow (cos (* (* 0.005555555555555556 (PI)) angle_m)) 2.0) (* b b))
(if (<= a 6.5e+151)
(fma
(* (* (* a a) 3.08641975308642e-5) (* (PI) (PI)))
(* angle_m angle_m)
(* b b))
(* (pow (* (* (PI) a) angle_m) 2.0) 3.08641975308642e-5))))\begin{array}{l}
angle_m = \left|angle\right|
\\
\begin{array}{l}
\mathbf{if}\;a \leq 4.6 \cdot 10^{-139}:\\
\;\;\;\;{\cos \left(\left(0.005555555555555556 \cdot \mathsf{PI}\left(\right)\right) \cdot angle\_m\right)}^{2} \cdot \left(b \cdot b\right)\\
\mathbf{elif}\;a \leq 6.5 \cdot 10^{+151}:\\
\;\;\;\;\mathsf{fma}\left(\left(\left(a \cdot a\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, b \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;{\left(\left(\mathsf{PI}\left(\right) \cdot a\right) \cdot angle\_m\right)}^{2} \cdot 3.08641975308642 \cdot 10^{-5}\\
\end{array}
\end{array}
if a < 4.60000000000000025e-139Initial program 77.2%
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-*.f6457.6
Applied rewrites57.6%
if 4.60000000000000025e-139 < a < 6.5000000000000002e151Initial program 68.1%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6468.1
lift-*.f64N/A
*-commutativeN/A
lower-*.f6468.1
lift-/.f64N/A
clear-numN/A
associate-/r/N/A
lower-*.f64N/A
metadata-eval68.2
Applied rewrites68.1%
Taylor expanded in angle around 0
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites34.7%
Taylor expanded in b around 0
Applied rewrites62.1%
if 6.5000000000000002e151 < a Initial program 98.0%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6498.0
lift-*.f64N/A
*-commutativeN/A
lower-*.f6498.0
lift-/.f64N/A
clear-numN/A
associate-/r/N/A
lower-*.f64N/A
metadata-eval97.8
Applied rewrites97.8%
Taylor expanded in angle around 0
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites63.8%
Taylor expanded in b around 0
Applied rewrites71.6%
Applied rewrites82.6%
Final simplification62.3%
angle_m = (fabs.f64 angle) (FPCore (a b angle_m) :precision binary64 (if (<= a 1.05e+136) (* b b) (* (pow (* (* (PI) a) angle_m) 2.0) 3.08641975308642e-5)))
\begin{array}{l}
angle_m = \left|angle\right|
\\
\begin{array}{l}
\mathbf{if}\;a \leq 1.05 \cdot 10^{+136}:\\
\;\;\;\;b \cdot b\\
\mathbf{else}:\\
\;\;\;\;{\left(\left(\mathsf{PI}\left(\right) \cdot a\right) \cdot angle\_m\right)}^{2} \cdot 3.08641975308642 \cdot 10^{-5}\\
\end{array}
\end{array}
if a < 1.05e136Initial program 75.1%
Taylor expanded in angle around 0
unpow2N/A
lower-*.f6458.0
Applied rewrites58.0%
if 1.05e136 < a Initial program 94.4%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6494.4
lift-*.f64N/A
*-commutativeN/A
lower-*.f6494.4
lift-/.f64N/A
clear-numN/A
associate-/r/N/A
lower-*.f64N/A
metadata-eval94.2
Applied rewrites94.2%
Taylor expanded in angle around 0
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites60.4%
Taylor expanded in b around 0
Applied rewrites67.6%
Applied rewrites77.5%
Final simplification61.2%
angle_m = (fabs.f64 angle)
(FPCore (a b angle_m)
:precision binary64
(if (<= b 2.3e+151)
(fma
(PI)
(*
(*
(*
(fma (* a a) 3.08641975308642e-5 (* -3.08641975308642e-5 (* b b)))
angle_m)
angle_m)
(PI))
(* b b))
(* b b)))\begin{array}{l}
angle_m = \left|angle\right|
\\
\begin{array}{l}
\mathbf{if}\;b \leq 2.3 \cdot 10^{+151}:\\
\;\;\;\;\mathsf{fma}\left(\mathsf{PI}\left(\right), \left(\left(\mathsf{fma}\left(a \cdot a, 3.08641975308642 \cdot 10^{-5}, -3.08641975308642 \cdot 10^{-5} \cdot \left(b \cdot b\right)\right) \cdot angle\_m\right) \cdot angle\_m\right) \cdot \mathsf{PI}\left(\right), b \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;b \cdot b\\
\end{array}
\end{array}
if b < 2.3000000000000001e151Initial program 74.1%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6474.1
lift-*.f64N/A
*-commutativeN/A
lower-*.f6474.1
lift-/.f64N/A
clear-numN/A
associate-/r/N/A
lower-*.f64N/A
metadata-eval74.2
Applied rewrites74.1%
Taylor expanded in angle around 0
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites43.4%
Applied rewrites46.4%
if 2.3000000000000001e151 < b Initial program 100.0%
Taylor expanded in angle around 0
unpow2N/A
lower-*.f64100.0
Applied rewrites100.0%
Final simplification55.0%
angle_m = (fabs.f64 angle) (FPCore (a b angle_m) :precision binary64 (if (<= a 4e+136) (* b b) (* (* (* (* (* angle_m angle_m) 3.08641975308642e-5) a) (* (PI) (PI))) a)))
\begin{array}{l}
angle_m = \left|angle\right|
\\
\begin{array}{l}
\mathbf{if}\;a \leq 4 \cdot 10^{+136}:\\
\;\;\;\;b \cdot b\\
\mathbf{else}:\\
\;\;\;\;\left(\left(\left(\left(angle\_m \cdot angle\_m\right) \cdot 3.08641975308642 \cdot 10^{-5}\right) \cdot a\right) \cdot \left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right)\right) \cdot a\\
\end{array}
\end{array}
if a < 4.00000000000000023e136Initial program 75.1%
Taylor expanded in angle around 0
unpow2N/A
lower-*.f6458.0
Applied rewrites58.0%
if 4.00000000000000023e136 < a Initial program 94.4%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6494.4
lift-*.f64N/A
*-commutativeN/A
lower-*.f6494.4
lift-/.f64N/A
clear-numN/A
associate-/r/N/A
lower-*.f64N/A
metadata-eval94.2
Applied rewrites94.2%
Taylor expanded in angle around 0
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites60.4%
Taylor expanded in b around 0
Applied rewrites67.6%
Applied rewrites70.3%
angle_m = (fabs.f64 angle) (FPCore (a b angle_m) :precision binary64 (if (<= a 4e+136) (* b b) (* (* (* (PI) (PI)) a) (* (* (* angle_m angle_m) 3.08641975308642e-5) a))))
\begin{array}{l}
angle_m = \left|angle\right|
\\
\begin{array}{l}
\mathbf{if}\;a \leq 4 \cdot 10^{+136}:\\
\;\;\;\;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\_m \cdot angle\_m\right) \cdot 3.08641975308642 \cdot 10^{-5}\right) \cdot a\right)\\
\end{array}
\end{array}
if a < 4.00000000000000023e136Initial program 75.1%
Taylor expanded in angle around 0
unpow2N/A
lower-*.f6458.0
Applied rewrites58.0%
if 4.00000000000000023e136 < a Initial program 94.4%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6494.4
lift-*.f64N/A
*-commutativeN/A
lower-*.f6494.4
lift-/.f64N/A
clear-numN/A
associate-/r/N/A
lower-*.f64N/A
metadata-eval94.2
Applied rewrites94.2%
Taylor expanded in angle around 0
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites60.4%
Taylor expanded in b around 0
Applied rewrites67.6%
Applied rewrites70.3%
Final simplification60.0%
angle_m = (fabs.f64 angle) (FPCore (a b angle_m) :precision binary64 (if (<= a 4e+136) (* b b) (* (* (* (* (PI) (PI)) a) a) (* (* 3.08641975308642e-5 angle_m) angle_m))))
\begin{array}{l}
angle_m = \left|angle\right|
\\
\begin{array}{l}
\mathbf{if}\;a \leq 4 \cdot 10^{+136}:\\
\;\;\;\;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(3.08641975308642 \cdot 10^{-5} \cdot angle\_m\right) \cdot angle\_m\right)\\
\end{array}
\end{array}
if a < 4.00000000000000023e136Initial program 75.1%
Taylor expanded in angle around 0
unpow2N/A
lower-*.f6458.0
Applied rewrites58.0%
if 4.00000000000000023e136 < a Initial program 94.4%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6494.4
lift-*.f64N/A
*-commutativeN/A
lower-*.f6494.4
lift-/.f64N/A
clear-numN/A
associate-/r/N/A
lower-*.f64N/A
metadata-eval94.2
Applied rewrites94.2%
Taylor expanded in angle around 0
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites60.4%
Taylor expanded in b around 0
Applied rewrites67.6%
Applied rewrites67.6%
Final simplification59.6%
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 78.3%
Taylor expanded in angle around 0
unpow2N/A
lower-*.f6452.8
Applied rewrites52.8%
herbie shell --seed 2024276
(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)))