
(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
(+
(pow (* a (sin (/ (PI) (/ 180.0 angle)))) 2.0)
(pow
(*
b
(cos
(*
(pow (/ 180.0 (pow (PI) 0.6666666666666666)) -1.0)
(pow (/ (/ 1.0 angle) (cbrt (PI))) -1.0))))
2.0)))\begin{array}{l}
\\
{\left(a \cdot \sin \left(\frac{\mathsf{PI}\left(\right)}{\frac{180}{angle}}\right)\right)}^{2} + {\left(b \cdot \cos \left({\left(\frac{180}{{\mathsf{PI}\left(\right)}^{0.6666666666666666}}\right)}^{-1} \cdot {\left(\frac{\frac{1}{angle}}{\sqrt[3]{\mathsf{PI}\left(\right)}}\right)}^{-1}\right)\right)}^{2}
\end{array}
Initial program 77.4%
lift-PI.f64N/A
associate-*l/N/A
clear-numN/A
associate-/r*N/A
clear-numN/A
lower-/.f64N/A
lower-/.f6477.4
Applied rewrites77.4%
clear-numN/A
lift-/.f64N/A
lift-PI.f64N/A
associate-/r/N/A
inv-powN/A
lift-/.f64N/A
div-invN/A
inv-powN/A
metadata-evalN/A
pow-prod-upN/A
lift-pow.f64N/A
lift-pow.f64N/A
lift-PI.f64N/A
add-cube-cbrtN/A
times-fracN/A
unpow-prod-downN/A
lower-*.f64N/A
Applied rewrites77.5%
(FPCore (a b angle)
:precision binary64
(let* ((t_0 (sqrt (PI))))
(+
(pow (* a (sin (/ (PI) (/ 180.0 angle)))) 2.0)
(pow
(*
b
(cos
(*
(/ angle 180.0)
(* (pow (* (* (PI) (PI)) t_0) 0.3333333333333333) (cbrt t_0)))))
2.0))))\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{\mathsf{PI}\left(\right)}\\
{\left(a \cdot \sin \left(\frac{\mathsf{PI}\left(\right)}{\frac{180}{angle}}\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \left({\left(\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right) \cdot t\_0\right)}^{0.3333333333333333} \cdot \sqrt[3]{t\_0}\right)\right)\right)}^{2}
\end{array}
\end{array}
Initial program 77.4%
lift-PI.f64N/A
associate-*l/N/A
clear-numN/A
associate-/r*N/A
clear-numN/A
lower-/.f64N/A
lower-/.f6477.4
Applied rewrites77.4%
add-cbrt-cubeN/A
pow1/3N/A
lift-PI.f64N/A
rem-square-sqrtN/A
lift-sqrt.f64N/A
lift-sqrt.f64N/A
associate-*r*N/A
unpow-prod-downN/A
pow1/3N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-*.f64N/A
lift-PI.f64N/A
lift-PI.f64N/A
lower-*.f64N/A
lower-cbrt.f6477.5
Applied rewrites77.5%
(FPCore (a b angle) :precision binary64 (+ (pow (* a (sin (/ (* (PI) 0.005555555555555556) (/ 1.0 angle)))) 2.0) (pow (* b (cos (* (PI) (/ angle 180.0)))) 2.0)))
\begin{array}{l}
\\
{\left(a \cdot \sin \left(\frac{\mathsf{PI}\left(\right) \cdot 0.005555555555555556}{\frac{1}{angle}}\right)\right)}^{2} + {\left(b \cdot \cos \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2}
\end{array}
Initial program 77.4%
lift-PI.f64N/A
associate-*l/N/A
clear-numN/A
associate-/r*N/A
clear-numN/A
div-invN/A
associate-/r*N/A
lower-/.f64N/A
div-invN/A
lower-*.f64N/A
metadata-evalN/A
lower-/.f6477.5
Applied rewrites77.5%
Final simplification77.5%
(FPCore (a b angle) :precision binary64 (+ (pow (* a (sin (* (PI) (/ angle 180.0)))) 2.0) (pow (* b (cos (/ (* (PI) angle) 180.0))) 2.0)))
\begin{array}{l}
\\
{\left(a \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{\mathsf{PI}\left(\right) \cdot angle}{180}\right)\right)}^{2}
\end{array}
Initial program 77.4%
lift-PI.f64N/A
associate-*l/N/A
lower-/.f64N/A
lower-*.f6477.5
Applied rewrites77.5%
Final simplification77.5%
(FPCore (a b angle) :precision binary64 (+ (pow (* b (cos (* (PI) (/ angle 180.0)))) 2.0) (pow (* a (sin (* angle (* (PI) 0.005555555555555556)))) 2.0)))
\begin{array}{l}
\\
{\left(b \cdot \cos \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2} + {\left(a \cdot \sin \left(angle \cdot \left(\mathsf{PI}\left(\right) \cdot 0.005555555555555556\right)\right)\right)}^{2}
\end{array}
Initial program 77.4%
lift-PI.f64N/A
associate-*l/N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
div-invN/A
lower-*.f64N/A
metadata-eval77.5
Applied rewrites77.5%
Final simplification77.5%
(FPCore (a b angle) :precision binary64 (+ (pow (* a (sin (/ (* (PI) 0.005555555555555556) (/ 1.0 angle)))) 2.0) (pow b 2.0)))
\begin{array}{l}
\\
{\left(a \cdot \sin \left(\frac{\mathsf{PI}\left(\right) \cdot 0.005555555555555556}{\frac{1}{angle}}\right)\right)}^{2} + {b}^{2}
\end{array}
Initial program 77.4%
lift-PI.f64N/A
associate-*l/N/A
clear-numN/A
associate-/r*N/A
clear-numN/A
div-invN/A
associate-/r*N/A
lower-/.f64N/A
div-invN/A
lower-*.f64N/A
metadata-evalN/A
lower-/.f6477.5
Applied rewrites77.5%
Taylor expanded in angle around 0
Applied rewrites76.5%
Final simplification76.5%
(FPCore (a b angle) :precision binary64 (+ (pow (* a (sin (* (PI) (/ angle 180.0)))) 2.0) (pow b 2.0)))
\begin{array}{l}
\\
{\left(a \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2} + {b}^{2}
\end{array}
Initial program 77.4%
Taylor expanded in angle around 0
Applied rewrites76.4%
Final simplification76.4%
(FPCore (a b angle)
:precision binary64
(let* ((t_0 (* (PI) (* angle 0.005555555555555556))) (t_1 (sin t_0)))
(if (<= (/ angle 180.0) 200000000.0)
(fma
(pow (* angle (* a 0.005555555555555556)) 2.0)
(* (PI) (PI))
(* b (* b (+ 0.5 (* 0.5 (cos (* 2.0 t_0)))))))
(fma (* t_1 (* a a)) t_1 (* b b)))))\begin{array}{l}
\\
\begin{array}{l}
t_0 := \mathsf{PI}\left(\right) \cdot \left(angle \cdot 0.005555555555555556\right)\\
t_1 := \sin t\_0\\
\mathbf{if}\;\frac{angle}{180} \leq 200000000:\\
\;\;\;\;\mathsf{fma}\left({\left(angle \cdot \left(a \cdot 0.005555555555555556\right)\right)}^{2}, \mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right), b \cdot \left(b \cdot \left(0.5 + 0.5 \cdot \cos \left(2 \cdot t\_0\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(t\_1 \cdot \left(a \cdot a\right), t\_1, b \cdot b\right)\\
\end{array}
\end{array}
if (/.f64 angle #s(literal 180 binary64)) < 2e8Initial program 87.2%
Taylor expanded in angle around 0
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f6484.0
Applied rewrites84.0%
Applied rewrites84.1%
if 2e8 < (/.f64 angle #s(literal 180 binary64)) Initial program 54.8%
Applied rewrites54.6%
Taylor expanded in angle around 0
Applied rewrites54.9%
Final simplification75.3%
(FPCore (a b angle)
:precision binary64
(let* ((t_0 (* (PI) (* angle 0.005555555555555556)))
(t_1 (* 0.005555555555555556 (* a (* (PI) angle))))
(t_2 (sin t_0)))
(if (<= (/ angle 180.0) 200000000.0)
(fma t_1 t_1 (* b (* b (+ 0.5 (* 0.5 (cos (* 2.0 t_0)))))))
(fma (* t_2 (* a a)) t_2 (* b b)))))\begin{array}{l}
\\
\begin{array}{l}
t_0 := \mathsf{PI}\left(\right) \cdot \left(angle \cdot 0.005555555555555556\right)\\
t_1 := 0.005555555555555556 \cdot \left(a \cdot \left(\mathsf{PI}\left(\right) \cdot angle\right)\right)\\
t_2 := \sin t\_0\\
\mathbf{if}\;\frac{angle}{180} \leq 200000000:\\
\;\;\;\;\mathsf{fma}\left(t\_1, t\_1, b \cdot \left(b \cdot \left(0.5 + 0.5 \cdot \cos \left(2 \cdot t\_0\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(t\_2 \cdot \left(a \cdot a\right), t\_2, b \cdot b\right)\\
\end{array}
\end{array}
if (/.f64 angle #s(literal 180 binary64)) < 2e8Initial program 87.2%
Taylor expanded in angle around 0
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f6484.0
Applied rewrites84.0%
Applied rewrites84.0%
if 2e8 < (/.f64 angle #s(literal 180 binary64)) Initial program 54.8%
Applied rewrites54.6%
Taylor expanded in angle around 0
Applied rewrites54.9%
Final simplification75.3%
(FPCore (a b angle)
:precision binary64
(let* ((t_0 (* 0.005555555555555556 (* a (* (PI) angle)))))
(if (<= a 3.5e-15)
(* (* b b) (pow (cos (* angle (* (PI) 0.005555555555555556))) 2.0))
(fma
t_0
t_0
(*
b
(*
b
(+
0.5
(* 0.5 (cos (* 2.0 (* (PI) (* angle 0.005555555555555556))))))))))))\begin{array}{l}
\\
\begin{array}{l}
t_0 := 0.005555555555555556 \cdot \left(a \cdot \left(\mathsf{PI}\left(\right) \cdot angle\right)\right)\\
\mathbf{if}\;a \leq 3.5 \cdot 10^{-15}:\\
\;\;\;\;\left(b \cdot b\right) \cdot {\cos \left(angle \cdot \left(\mathsf{PI}\left(\right) \cdot 0.005555555555555556\right)\right)}^{2}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(t\_0, t\_0, b \cdot \left(b \cdot \left(0.5 + 0.5 \cdot \cos \left(2 \cdot \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)\right)\right)\right)\\
\end{array}
\end{array}
if a < 3.5000000000000001e-15Initial program 78.8%
lift-PI.f64N/A
associate-*l/N/A
clear-numN/A
associate-/r*N/A
clear-numN/A
div-invN/A
associate-/r*N/A
lower-/.f64N/A
div-invN/A
lower-*.f64N/A
metadata-evalN/A
lower-/.f6478.8
Applied rewrites78.8%
lift-PI.f64N/A
lift-/.f64N/A
lift-*.f64N/A
clear-numN/A
associate-/r/N/A
lift-*.f64N/A
metadata-evalN/A
div-invN/A
frac-2negN/A
metadata-evalN/A
frac-timesN/A
neg-mul-1N/A
lower-/.f64N/A
lower-neg.f64N/A
lower-*.f64N/A
lift-/.f64N/A
distribute-neg-fracN/A
metadata-evalN/A
lower-/.f6478.8
Applied rewrites78.8%
Taylor expanded in a around 0
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-pow.f64N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
lower-cos.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-PI.f6462.9
Applied rewrites62.9%
if 3.5000000000000001e-15 < a Initial program 74.0%
Taylor expanded in angle around 0
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f6470.4
Applied rewrites70.4%
Applied rewrites70.4%
Final simplification65.0%
(FPCore (a b angle)
:precision binary64
(let* ((t_0 (* (PI) angle)) (t_1 (* 0.005555555555555556 (* a t_0))))
(if (<= a 3.5e-15)
(* (* b b) (pow (cos (* 0.005555555555555556 t_0)) 2.0))
(fma
t_1
t_1
(*
b
(*
b
(+
0.5
(* 0.5 (cos (* 2.0 (* (PI) (* angle 0.005555555555555556))))))))))))\begin{array}{l}
\\
\begin{array}{l}
t_0 := \mathsf{PI}\left(\right) \cdot angle\\
t_1 := 0.005555555555555556 \cdot \left(a \cdot t\_0\right)\\
\mathbf{if}\;a \leq 3.5 \cdot 10^{-15}:\\
\;\;\;\;\left(b \cdot b\right) \cdot {\cos \left(0.005555555555555556 \cdot t\_0\right)}^{2}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(t\_1, t\_1, b \cdot \left(b \cdot \left(0.5 + 0.5 \cdot \cos \left(2 \cdot \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)\right)\right)\right)\\
\end{array}
\end{array}
if a < 3.5000000000000001e-15Initial program 78.8%
Taylor expanded in a around 0
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-pow.f64N/A
*-commutativeN/A
associate-*r*N/A
lower-cos.f64N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f6462.9
Applied rewrites62.9%
if 3.5000000000000001e-15 < a Initial program 74.0%
Taylor expanded in angle around 0
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f6470.4
Applied rewrites70.4%
Applied rewrites70.4%
Final simplification65.0%
(FPCore (a b angle)
:precision binary64
(let* ((t_0 (* 0.005555555555555556 (* a (* (PI) angle)))))
(if (<= a 3.5e-15)
(* (* b b) (fma 0.5 (cos (* angle (* (PI) 0.011111111111111112))) 0.5))
(fma
t_0
t_0
(*
b
(*
b
(+
0.5
(* 0.5 (cos (* 2.0 (* (PI) (* angle 0.005555555555555556))))))))))))\begin{array}{l}
\\
\begin{array}{l}
t_0 := 0.005555555555555556 \cdot \left(a \cdot \left(\mathsf{PI}\left(\right) \cdot angle\right)\right)\\
\mathbf{if}\;a \leq 3.5 \cdot 10^{-15}:\\
\;\;\;\;\left(b \cdot b\right) \cdot \mathsf{fma}\left(0.5, \cos \left(angle \cdot \left(\mathsf{PI}\left(\right) \cdot 0.011111111111111112\right)\right), 0.5\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(t\_0, t\_0, b \cdot \left(b \cdot \left(0.5 + 0.5 \cdot \cos \left(2 \cdot \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)\right)\right)\right)\\
\end{array}
\end{array}
if a < 3.5000000000000001e-15Initial program 78.8%
Applied rewrites73.7%
Taylor expanded in a around 0
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-cos.f64N/A
*-commutativeN/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f6462.9
Applied rewrites62.9%
if 3.5000000000000001e-15 < a Initial program 74.0%
Taylor expanded in angle around 0
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f6470.4
Applied rewrites70.4%
Applied rewrites70.4%
Final simplification65.0%
(FPCore (a b angle) :precision binary64 (if (<= a 3.5e-15) (* (* b b) (fma 0.5 (cos (* angle (* (PI) 0.011111111111111112))) 0.5)) (fma (pow (* angle (* a 0.005555555555555556)) 2.0) (* (PI) (PI)) (* b b))))
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq 3.5 \cdot 10^{-15}:\\
\;\;\;\;\left(b \cdot b\right) \cdot \mathsf{fma}\left(0.5, \cos \left(angle \cdot \left(\mathsf{PI}\left(\right) \cdot 0.011111111111111112\right)\right), 0.5\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left({\left(angle \cdot \left(a \cdot 0.005555555555555556\right)\right)}^{2}, \mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right), b \cdot b\right)\\
\end{array}
\end{array}
if a < 3.5000000000000001e-15Initial program 78.8%
Applied rewrites73.7%
Taylor expanded in a around 0
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-cos.f64N/A
*-commutativeN/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f6462.9
Applied rewrites62.9%
if 3.5000000000000001e-15 < a Initial program 74.0%
Taylor expanded in angle around 0
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f6470.4
Applied rewrites70.4%
Applied rewrites70.4%
Taylor expanded in angle around 0
Applied rewrites69.9%
Final simplification64.8%
(FPCore (a b angle)
:precision binary64
(let* ((t_0 (* angle (* a 0.005555555555555556))))
(if (<= a 2.6e+127)
(* (* b b) (fma 0.5 (cos (* angle (* (PI) 0.011111111111111112))) 0.5))
(* t_0 (* (* (PI) (PI)) t_0)))))\begin{array}{l}
\\
\begin{array}{l}
t_0 := angle \cdot \left(a \cdot 0.005555555555555556\right)\\
\mathbf{if}\;a \leq 2.6 \cdot 10^{+127}:\\
\;\;\;\;\left(b \cdot b\right) \cdot \mathsf{fma}\left(0.5, \cos \left(angle \cdot \left(\mathsf{PI}\left(\right) \cdot 0.011111111111111112\right)\right), 0.5\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0 \cdot \left(\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right) \cdot t\_0\right)\\
\end{array}
\end{array}
if a < 2.6000000000000002e127Initial program 75.8%
Applied rewrites71.5%
Taylor expanded in a around 0
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-cos.f64N/A
*-commutativeN/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f6460.5
Applied rewrites60.5%
if 2.6000000000000002e127 < a Initial program 87.6%
lift-PI.f64N/A
associate-*l/N/A
clear-numN/A
associate-/r*N/A
clear-numN/A
div-invN/A
associate-/r*N/A
lower-/.f64N/A
div-invN/A
lower-*.f64N/A
metadata-evalN/A
lower-/.f6487.7
Applied rewrites87.7%
Taylor expanded in angle around 0
lower-fma.f64N/A
Applied rewrites44.8%
Taylor expanded in b around 0
*-commutativeN/A
associate-*r*N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-PI.f64N/A
lower-PI.f6464.8
Applied rewrites64.8%
lift-*.f64N/A
lift-*.f64N/A
lift-PI.f64N/A
lift-PI.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
Applied rewrites75.1%
Final simplification62.5%
(FPCore (a b angle) :precision binary64 (let* ((t_0 (* angle (* a 0.005555555555555556)))) (if (<= a 2.6e+127) (* b b) (* t_0 (* (* (PI) (PI)) t_0)))))
\begin{array}{l}
\\
\begin{array}{l}
t_0 := angle \cdot \left(a \cdot 0.005555555555555556\right)\\
\mathbf{if}\;a \leq 2.6 \cdot 10^{+127}:\\
\;\;\;\;b \cdot b\\
\mathbf{else}:\\
\;\;\;\;t\_0 \cdot \left(\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right) \cdot t\_0\right)\\
\end{array}
\end{array}
if a < 2.6000000000000002e127Initial program 75.8%
Taylor expanded in angle around 0
unpow2N/A
lower-*.f6460.2
Applied rewrites60.2%
if 2.6000000000000002e127 < a Initial program 87.6%
lift-PI.f64N/A
associate-*l/N/A
clear-numN/A
associate-/r*N/A
clear-numN/A
div-invN/A
associate-/r*N/A
lower-/.f64N/A
div-invN/A
lower-*.f64N/A
metadata-evalN/A
lower-/.f6487.7
Applied rewrites87.7%
Taylor expanded in angle around 0
lower-fma.f64N/A
Applied rewrites44.8%
Taylor expanded in b around 0
*-commutativeN/A
associate-*r*N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-PI.f64N/A
lower-PI.f6464.8
Applied rewrites64.8%
lift-*.f64N/A
lift-*.f64N/A
lift-PI.f64N/A
lift-PI.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
Applied rewrites75.1%
Final simplification62.2%
(FPCore (a b angle) :precision binary64 (let* ((t_0 (* a (* (PI) angle)))) (if (<= a 3e+127) (* b b) (* 3.08641975308642e-5 (* t_0 t_0)))))
\begin{array}{l}
\\
\begin{array}{l}
t_0 := a \cdot \left(\mathsf{PI}\left(\right) \cdot angle\right)\\
\mathbf{if}\;a \leq 3 \cdot 10^{+127}:\\
\;\;\;\;b \cdot b\\
\mathbf{else}:\\
\;\;\;\;3.08641975308642 \cdot 10^{-5} \cdot \left(t\_0 \cdot t\_0\right)\\
\end{array}
\end{array}
if a < 3.0000000000000002e127Initial program 75.8%
Taylor expanded in angle around 0
unpow2N/A
lower-*.f6460.2
Applied rewrites60.2%
if 3.0000000000000002e127 < a Initial program 87.6%
lift-PI.f64N/A
associate-*l/N/A
clear-numN/A
associate-/r*N/A
clear-numN/A
div-invN/A
associate-/r*N/A
lower-/.f64N/A
div-invN/A
lower-*.f64N/A
metadata-evalN/A
lower-/.f6487.7
Applied rewrites87.7%
Taylor expanded in angle around 0
lower-fma.f64N/A
Applied rewrites44.8%
Taylor expanded in b around 0
*-commutativeN/A
associate-*r*N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-PI.f64N/A
lower-PI.f6464.8
Applied rewrites64.8%
Taylor expanded in angle around 0
lower-*.f64N/A
unpow2N/A
unpow2N/A
unpow2N/A
unswap-sqrN/A
unswap-sqrN/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f6475.0
Applied rewrites75.0%
Final simplification62.2%
(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 77.4%
Taylor expanded in angle around 0
unpow2N/A
lower-*.f6456.6
Applied rewrites56.6%
herbie shell --seed 2024216
(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)))