
(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 20 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 (+ (pow (* a (sin (* (/ angle 180.0) (PI)))) 2.0) (pow (* b (cos (pow (/ (/ 180.0 angle) (PI)) -1.0))) 2.0)))
\begin{array}{l}
\\
{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left({\left(\frac{\frac{180}{angle}}{\mathsf{PI}\left(\right)}\right)}^{-1}\right)\right)}^{2}
\end{array}
Initial program 79.5%
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
clear-numN/A
lower-/.f64N/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f6479.6
Applied rewrites79.6%
Final simplification79.6%
(FPCore (a b angle) :precision binary64 (+ (pow (* a (sin (* (/ angle 180.0) (PI)))) 2.0) (pow (* b (cos (/ (PI) (/ 180.0 angle)))) 2.0)))
\begin{array}{l}
\\
{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{\mathsf{PI}\left(\right)}{\frac{180}{angle}}\right)\right)}^{2}
\end{array}
Initial program 79.5%
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lower-/.f64N/A
lower-/.f6479.6
Applied rewrites79.6%
(FPCore (a b angle) :precision binary64 (fma (pow (cos (/ (PI) (/ -180.0 angle))) 2.0) (* b b) (pow (* (sin (* (PI) (* angle 0.005555555555555556))) a) 2.0)))
\begin{array}{l}
\\
\mathsf{fma}\left({\cos \left(\frac{\mathsf{PI}\left(\right)}{\frac{-180}{angle}}\right)}^{2}, b \cdot b, {\left(\sin \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot 0.005555555555555556\right)\right) \cdot a\right)}^{2}\right)
\end{array}
Initial program 79.5%
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
clear-numN/A
lower-/.f64N/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f6479.6
Applied rewrites79.6%
lift-/.f64N/A
lift-/.f64N/A
associate-/r/N/A
lift-/.f64N/A
clear-numN/A
lift-/.f64N/A
lift-PI.f64N/A
add-sqr-sqrtN/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lift-/.f64N/A
div-invN/A
metadata-evalN/A
*-commutativeN/A
lift-*.f64N/A
lift-PI.f64N/A
lower-sqrt.f64N/A
lift-PI.f64N/A
lower-sqrt.f6479.6
Applied rewrites79.6%
Applied rewrites79.6%
(FPCore (a b angle) :precision binary64 (+ (pow (* a (sin (* (* angle 0.005555555555555556) (PI)))) 2.0) (pow (* b (cos (/ (PI) (/ 180.0 angle)))) 2.0)))
\begin{array}{l}
\\
{\left(a \cdot \sin \left(\left(angle \cdot 0.005555555555555556\right) \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{\mathsf{PI}\left(\right)}{\frac{180}{angle}}\right)\right)}^{2}
\end{array}
Initial program 79.5%
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lower-/.f64N/A
lower-/.f6479.6
Applied rewrites79.6%
lift-/.f64N/A
div-invN/A
metadata-evalN/A
lower-*.f6479.6
Applied rewrites79.6%
(FPCore (a b angle) :precision binary64 (fma (* (pow (cos (/ (* (PI) angle) -180.0)) 2.0) b) b (pow (* (sin (* (PI) (* 0.005555555555555556 angle))) a) 2.0)))
\begin{array}{l}
\\
\mathsf{fma}\left({\cos \left(\frac{\mathsf{PI}\left(\right) \cdot angle}{-180}\right)}^{2} \cdot b, b, {\left(\sin \left(\mathsf{PI}\left(\right) \cdot \left(0.005555555555555556 \cdot angle\right)\right) \cdot a\right)}^{2}\right)
\end{array}
Initial program 79.5%
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 rewrites79.6%
(FPCore (a b angle) :precision binary64 (+ (pow (* (sin (* (PI) (* 0.005555555555555556 angle))) a) 2.0) (pow (* (cos (/ (* (PI) angle) -180.0)) b) 2.0)))
\begin{array}{l}
\\
{\left(\sin \left(\mathsf{PI}\left(\right) \cdot \left(0.005555555555555556 \cdot angle\right)\right) \cdot a\right)}^{2} + {\left(\cos \left(\frac{\mathsf{PI}\left(\right) \cdot angle}{-180}\right) \cdot b\right)}^{2}
\end{array}
Initial program 79.5%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6479.5
lift-*.f64N/A
*-commutativeN/A
lower-*.f6479.5
lift-/.f64N/A
clear-numN/A
associate-/r/N/A
lower-*.f64N/A
metadata-eval79.5
Applied rewrites79.6%
(FPCore (a b angle) :precision binary64 (+ (pow (* a (sin (* (/ angle 180.0) (PI)))) 2.0) (pow (* b (cos (* (* (PI) angle) 0.005555555555555556))) 2.0)))
\begin{array}{l}
\\
{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot 0.005555555555555556\right)\right)}^{2}
\end{array}
Initial program 79.5%
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
div-invN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
metadata-eval79.6
Applied rewrites79.6%
(FPCore (a b angle) :precision binary64 (+ (pow (* a (sin (* (* 0.005555555555555556 (PI)) angle))) 2.0) (pow (* b (cos (* (/ angle 180.0) (PI)))) 2.0)))
\begin{array}{l}
\\
{\left(a \cdot \sin \left(\left(0.005555555555555556 \cdot \mathsf{PI}\left(\right)\right) \cdot angle\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}
\end{array}
Initial program 79.5%
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-eval79.6
Applied rewrites79.6%
(FPCore (a b angle) :precision binary64 (fma (* (pow (cos (* -0.005555555555555556 (* (PI) angle))) 2.0) b) b (pow (* (sin (* (* 0.005555555555555556 angle) (PI))) a) 2.0)))
\begin{array}{l}
\\
\mathsf{fma}\left({\cos \left(-0.005555555555555556 \cdot \left(\mathsf{PI}\left(\right) \cdot angle\right)\right)}^{2} \cdot b, b, {\left(\sin \left(\left(0.005555555555555556 \cdot angle\right) \cdot \mathsf{PI}\left(\right)\right) \cdot a\right)}^{2}\right)
\end{array}
Initial program 79.5%
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
clear-numN/A
lower-/.f64N/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f6479.6
Applied rewrites79.6%
Applied rewrites79.6%
(FPCore (a b angle) :precision binary64 (+ (pow (* (sin (* (* 0.005555555555555556 angle) (PI))) a) 2.0) (pow (* (cos (* -0.005555555555555556 (* (PI) angle))) b) 2.0)))
\begin{array}{l}
\\
{\left(\sin \left(\left(0.005555555555555556 \cdot angle\right) \cdot \mathsf{PI}\left(\right)\right) \cdot a\right)}^{2} + {\left(\cos \left(-0.005555555555555556 \cdot \left(\mathsf{PI}\left(\right) \cdot angle\right)\right) \cdot b\right)}^{2}
\end{array}
Initial program 79.5%
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
clear-numN/A
lower-/.f64N/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f6479.6
Applied rewrites79.6%
Applied rewrites79.5%
(FPCore (a b angle) :precision binary64 (+ (pow (* a (sin (* (/ angle 180.0) (PI)))) 2.0) (pow (* b 1.0) 2.0)))
\begin{array}{l}
\\
{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot 1\right)}^{2}
\end{array}
Initial program 79.5%
Taylor expanded in angle around 0
Applied rewrites79.3%
(FPCore (a b angle)
:precision binary64
(if (<= a 1.12e-108)
(* (pow (cos (* -0.005555555555555556 (* (PI) angle))) 2.0) (* b b))
(+
(* (* 3.08641975308642e-5 (* a (* (* angle angle) a))) (* (PI) (PI)))
(pow (* b (cos (* (/ angle 180.0) (PI)))) 2.0))))\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq 1.12 \cdot 10^{-108}:\\
\;\;\;\;{\cos \left(-0.005555555555555556 \cdot \left(\mathsf{PI}\left(\right) \cdot angle\right)\right)}^{2} \cdot \left(b \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;\left(3.08641975308642 \cdot 10^{-5} \cdot \left(a \cdot \left(\left(angle \cdot angle\right) \cdot a\right)\right)\right) \cdot \left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right) + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}\\
\end{array}
\end{array}
if a < 1.11999999999999992e-108Initial program 81.5%
Applied rewrites8.0%
Taylor expanded in a 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-*.f6460.8
Applied rewrites60.8%
if 1.11999999999999992e-108 < a Initial program 76.2%
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.f6471.1
Applied rewrites71.1%
(FPCore (a b angle)
:precision binary64
(if (<= a 1.12e-108)
(* (pow (cos (* -0.005555555555555556 (* (PI) angle))) 2.0) (* b b))
(if (<= a 3.6e+146)
(fma
(* (* (* 3.08641975308642e-5 (* a a)) (PI)) (PI))
(* angle angle)
(* b b))
(* (pow (* (* a (PI)) angle) 2.0) 3.08641975308642e-5))))\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq 1.12 \cdot 10^{-108}:\\
\;\;\;\;{\cos \left(-0.005555555555555556 \cdot \left(\mathsf{PI}\left(\right) \cdot angle\right)\right)}^{2} \cdot \left(b \cdot b\right)\\
\mathbf{elif}\;a \leq 3.6 \cdot 10^{+146}:\\
\;\;\;\;\mathsf{fma}\left(\left(\left(3.08641975308642 \cdot 10^{-5} \cdot \left(a \cdot a\right)\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \mathsf{PI}\left(\right), angle \cdot angle, 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.11999999999999992e-108Initial program 81.5%
Applied rewrites8.0%
Taylor expanded in a 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-*.f6460.8
Applied rewrites60.8%
if 1.11999999999999992e-108 < a < 3.5999999999999998e146Initial program 64.7%
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
clear-numN/A
lower-/.f64N/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f6464.6
Applied rewrites64.6%
Taylor expanded in angle around 0
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites33.5%
Taylor expanded in a around inf
Applied rewrites58.3%
if 3.5999999999999998e146 < a Initial program 97.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-/.f6497.3
Applied rewrites97.3%
Taylor expanded in angle around 0
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites42.1%
Taylor expanded in a around inf
Applied rewrites59.8%
Applied rewrites74.5%
(FPCore (a b angle)
:precision binary64
(if (<= a 1.12e-108)
(* b b)
(if (<= a 3.6e+146)
(fma
(* (* (* 3.08641975308642e-5 (* a a)) (PI)) (PI))
(* angle angle)
(* b b))
(* (pow (* (* a (PI)) angle) 2.0) 3.08641975308642e-5))))\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq 1.12 \cdot 10^{-108}:\\
\;\;\;\;b \cdot b\\
\mathbf{elif}\;a \leq 3.6 \cdot 10^{+146}:\\
\;\;\;\;\mathsf{fma}\left(\left(\left(3.08641975308642 \cdot 10^{-5} \cdot \left(a \cdot a\right)\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \mathsf{PI}\left(\right), angle \cdot angle, 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.11999999999999992e-108Initial program 81.5%
Taylor expanded in angle around 0
unpow2N/A
lower-*.f6460.4
Applied rewrites60.4%
if 1.11999999999999992e-108 < a < 3.5999999999999998e146Initial program 64.7%
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
clear-numN/A
lower-/.f64N/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f6464.6
Applied rewrites64.6%
Taylor expanded in angle around 0
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites33.5%
Taylor expanded in a around inf
Applied rewrites58.3%
if 3.5999999999999998e146 < a Initial program 97.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-/.f6497.3
Applied rewrites97.3%
Taylor expanded in angle around 0
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites42.1%
Taylor expanded in a around inf
Applied rewrites59.8%
Applied rewrites74.5%
Final simplification61.7%
(FPCore (a b angle)
:precision binary64
(let* ((t_0 (* (* a angle) (PI))))
(if (<= b 1.85e+40)
(fma
(*
(*
(fma (* a a) 3.08641975308642e-5 (* (* b b) -3.08641975308642e-5))
angle)
angle)
(* (PI) (PI))
(* b b))
(if (<= b 3.5e+116)
(*
(fma
(* t_0 t_0)
(/ 3.08641975308642e-5 (* b b))
(fma (* (* (* angle angle) -3.08641975308642e-5) (PI)) (PI) 1.0))
(* b b))
(* b b)))))\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(a \cdot angle\right) \cdot \mathsf{PI}\left(\right)\\
\mathbf{if}\;b \leq 1.85 \cdot 10^{+40}:\\
\;\;\;\;\mathsf{fma}\left(\left(\mathsf{fma}\left(a \cdot a, 3.08641975308642 \cdot 10^{-5}, \left(b \cdot b\right) \cdot -3.08641975308642 \cdot 10^{-5}\right) \cdot angle\right) \cdot angle, \mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right), b \cdot b\right)\\
\mathbf{elif}\;b \leq 3.5 \cdot 10^{+116}:\\
\;\;\;\;\mathsf{fma}\left(t\_0 \cdot t\_0, \frac{3.08641975308642 \cdot 10^{-5}}{b \cdot b}, \mathsf{fma}\left(\left(\left(angle \cdot angle\right) \cdot -3.08641975308642 \cdot 10^{-5}\right) \cdot \mathsf{PI}\left(\right), \mathsf{PI}\left(\right), 1\right)\right) \cdot \left(b \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;b \cdot b\\
\end{array}
\end{array}
if b < 1.85e40Initial program 78.1%
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
clear-numN/A
lower-/.f64N/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f6478.2
Applied rewrites78.2%
Taylor expanded in angle around 0
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites42.9%
Applied rewrites47.2%
if 1.85e40 < b < 3.49999999999999997e116Initial program 70.2%
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
clear-numN/A
lower-/.f64N/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f6471.8
Applied rewrites71.8%
Taylor expanded in angle around 0
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites50.9%
Taylor expanded in b around inf
Applied rewrites64.6%
if 3.49999999999999997e116 < b Initial program 91.5%
Taylor expanded in angle around 0
unpow2N/A
lower-*.f6490.7
Applied rewrites90.7%
Final simplification54.1%
(FPCore (a b angle)
:precision binary64
(if (<= b 5.2e+19)
(fma
(*
(*
(fma (* a a) 3.08641975308642e-5 (* (* b b) -3.08641975308642e-5))
angle)
angle)
(* (PI) (PI))
(* b b))
(* b b)))\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq 5.2 \cdot 10^{+19}:\\
\;\;\;\;\mathsf{fma}\left(\left(\mathsf{fma}\left(a \cdot a, 3.08641975308642 \cdot 10^{-5}, \left(b \cdot b\right) \cdot -3.08641975308642 \cdot 10^{-5}\right) \cdot angle\right) \cdot angle, \mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right), b \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;b \cdot b\\
\end{array}
\end{array}
if b < 5.2e19Initial program 79.0%
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
clear-numN/A
lower-/.f64N/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f6479.0
Applied rewrites79.0%
Taylor expanded in angle around 0
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites42.9%
Applied rewrites47.3%
if 5.2e19 < b Initial program 81.3%
Taylor expanded in angle around 0
unpow2N/A
lower-*.f6474.4
Applied rewrites74.4%
Final simplification53.2%
(FPCore (a b angle)
:precision binary64
(if (<= a 1.12e-108)
(* b b)
(if (<= a 1.5e+142)
(fma
(* (* (* 3.08641975308642e-5 (* a a)) (PI)) (PI))
(* angle angle)
(* b b))
(* (* (* (* angle angle) 3.08641975308642e-5) a) (* (* (PI) (PI)) a)))))\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq 1.12 \cdot 10^{-108}:\\
\;\;\;\;b \cdot b\\
\mathbf{elif}\;a \leq 1.5 \cdot 10^{+142}:\\
\;\;\;\;\mathsf{fma}\left(\left(\left(3.08641975308642 \cdot 10^{-5} \cdot \left(a \cdot a\right)\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \mathsf{PI}\left(\right), angle \cdot angle, b \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(\left(angle \cdot angle\right) \cdot 3.08641975308642 \cdot 10^{-5}\right) \cdot a\right) \cdot \left(\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right) \cdot a\right)\\
\end{array}
\end{array}
if a < 1.11999999999999992e-108Initial program 81.5%
Taylor expanded in angle around 0
unpow2N/A
lower-*.f6460.4
Applied rewrites60.4%
if 1.11999999999999992e-108 < a < 1.49999999999999987e142Initial program 65.4%
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
clear-numN/A
lower-/.f64N/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f6465.4
Applied rewrites65.4%
Taylor expanded in angle around 0
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites33.9%
Taylor expanded in a around inf
Applied rewrites59.1%
if 1.49999999999999987e142 < a Initial program 95.1%
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
clear-numN/A
lower-/.f64N/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f6495.1
Applied rewrites95.1%
Taylor expanded in angle around 0
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites41.2%
Taylor expanded in a around inf
Applied rewrites58.3%
Applied rewrites69.5%
Final simplification61.3%
(FPCore (a b angle) :precision binary64 (if (<= a 1.5e+141) (* b b) (* (* (* (* angle angle) 3.08641975308642e-5) a) (* (* (PI) (PI)) a))))
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq 1.5 \cdot 10^{+141}:\\
\;\;\;\;b \cdot b\\
\mathbf{else}:\\
\;\;\;\;\left(\left(\left(angle \cdot angle\right) \cdot 3.08641975308642 \cdot 10^{-5}\right) \cdot a\right) \cdot \left(\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right) \cdot a\right)\\
\end{array}
\end{array}
if a < 1.4999999999999999e141Initial program 77.3%
Taylor expanded in angle around 0
unpow2N/A
lower-*.f6458.3
Applied rewrites58.3%
if 1.4999999999999999e141 < a Initial program 93.2%
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
clear-numN/A
lower-/.f64N/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f6493.2
Applied rewrites93.2%
Taylor expanded in angle around 0
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites40.3%
Taylor expanded in a around inf
Applied rewrites57.0%
Applied rewrites67.8%
Final simplification59.7%
(FPCore (a b angle) :precision binary64 (if (<= a 1.5e+141) (* b b) (* (* 3.08641975308642e-5 (* a (* (* angle angle) a))) (* (PI) (PI)))))
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq 1.5 \cdot 10^{+141}:\\
\;\;\;\;b \cdot b\\
\mathbf{else}:\\
\;\;\;\;\left(3.08641975308642 \cdot 10^{-5} \cdot \left(a \cdot \left(\left(angle \cdot angle\right) \cdot a\right)\right)\right) \cdot \left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right)\\
\end{array}
\end{array}
if a < 1.4999999999999999e141Initial program 77.3%
Taylor expanded in angle around 0
unpow2N/A
lower-*.f6458.3
Applied rewrites58.3%
if 1.4999999999999999e141 < a Initial program 93.2%
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
clear-numN/A
lower-/.f64N/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f6493.2
Applied rewrites93.2%
Taylor expanded in angle around 0
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites40.3%
Taylor expanded in a around inf
Applied rewrites57.0%
Taylor expanded in a around 0
Applied rewrites67.9%
Final simplification59.7%
(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 79.5%
Taylor expanded in angle around 0
unpow2N/A
lower-*.f6455.9
Applied rewrites55.9%
Final simplification55.9%
herbie shell --seed 2024307
(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)))