
(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}
(FPCore (a b angle) :precision binary64 (fma (* b (pow (cos (* angle (* -0.005555555555555556 (cbrt (pow (PI) 3.0))))) 2.0)) b (pow (* a (sin (* (* 0.005555555555555556 angle) (PI)))) 2.0)))
\begin{array}{l}
\\
\mathsf{fma}\left(b \cdot {\cos \left(angle \cdot \left(-0.005555555555555556 \cdot \sqrt[3]{{\mathsf{PI}\left(\right)}^{3}}\right)\right)}^{2}, b, {\left(a \cdot \sin \left(\left(0.005555555555555556 \cdot angle\right) \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}\right)
\end{array}
Initial program 79.6%
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%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
clear-numN/A
metadata-evalN/A
distribute-neg-fracN/A
lift-/.f64N/A
un-div-invN/A
distribute-neg-frac2N/A
lift-/.f64N/A
frac-2negN/A
metadata-evalN/A
associate-/r/N/A
distribute-rgt-neg-inN/A
remove-double-negN/A
lower-*.f64N/A
div-invN/A
lower-*.f64N/A
metadata-eval79.7
Applied rewrites79.7%
rem-cbrt-cubeN/A
lift-pow.f64N/A
lift-cbrt.f6479.8
Applied rewrites79.8%
Final simplification79.8%
(FPCore (a b angle)
:precision binary64
(let* ((t_0 (sqrt (PI))))
(fma
(* (pow (cos (* (* (* t_0 t_0) -0.005555555555555556) angle)) 2.0) b)
b
(pow (* a (sin (* (* 0.005555555555555556 angle) (PI)))) 2.0))))\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{\mathsf{PI}\left(\right)}\\
\mathsf{fma}\left({\cos \left(\left(\left(t\_0 \cdot t\_0\right) \cdot -0.005555555555555556\right) \cdot angle\right)}^{2} \cdot b, b, {\left(a \cdot \sin \left(\left(0.005555555555555556 \cdot angle\right) \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}\right)
\end{array}
\end{array}
Initial program 79.6%
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%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
clear-numN/A
metadata-evalN/A
distribute-neg-fracN/A
lift-/.f64N/A
un-div-invN/A
distribute-neg-frac2N/A
lift-/.f64N/A
frac-2negN/A
metadata-evalN/A
associate-/r/N/A
distribute-rgt-neg-inN/A
remove-double-negN/A
lower-*.f64N/A
div-invN/A
lower-*.f64N/A
metadata-eval79.7
Applied rewrites79.7%
lift-PI.f64N/A
add-sqr-sqrtN/A
lower-*.f64N/A
lift-PI.f64N/A
lower-sqrt.f64N/A
lift-PI.f64N/A
lower-sqrt.f6479.7
Applied rewrites79.7%
Final simplification79.7%
(FPCore (a b angle) :precision binary64 (fma (* (pow (cos (* (* -0.005555555555555556 (PI)) angle)) 2.0) b) b (pow (* a (sin (* (* 0.005555555555555556 angle) (PI)))) 2.0)))
\begin{array}{l}
\\
\mathsf{fma}\left({\cos \left(\left(-0.005555555555555556 \cdot \mathsf{PI}\left(\right)\right) \cdot angle\right)}^{2} \cdot b, b, {\left(a \cdot \sin \left(\left(0.005555555555555556 \cdot angle\right) \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}\right)
\end{array}
Initial program 79.6%
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%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
clear-numN/A
metadata-evalN/A
distribute-neg-fracN/A
lift-/.f64N/A
un-div-invN/A
distribute-neg-frac2N/A
lift-/.f64N/A
frac-2negN/A
metadata-evalN/A
associate-/r/N/A
distribute-rgt-neg-inN/A
remove-double-negN/A
lower-*.f64N/A
div-invN/A
lower-*.f64N/A
metadata-eval79.7
Applied rewrites79.7%
Final simplification79.7%
(FPCore (a b angle) :precision binary64 (fma (* (+ (* (cos (* (* (* -0.005555555555555556 (PI)) angle) 2.0)) 0.5) 0.5) b) b (pow (* a (sin (* (* 0.005555555555555556 angle) (PI)))) 2.0)))
\begin{array}{l}
\\
\mathsf{fma}\left(\left(\cos \left(\left(\left(-0.005555555555555556 \cdot \mathsf{PI}\left(\right)\right) \cdot angle\right) \cdot 2\right) \cdot 0.5 + 0.5\right) \cdot b, b, {\left(a \cdot \sin \left(\left(0.005555555555555556 \cdot angle\right) \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}\right)
\end{array}
Initial program 79.6%
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%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
clear-numN/A
metadata-evalN/A
distribute-neg-fracN/A
lift-/.f64N/A
un-div-invN/A
distribute-neg-frac2N/A
lift-/.f64N/A
frac-2negN/A
metadata-evalN/A
associate-/r/N/A
distribute-rgt-neg-inN/A
remove-double-negN/A
lower-*.f64N/A
div-invN/A
lower-*.f64N/A
metadata-eval79.7
Applied rewrites79.7%
lift-pow.f64N/A
unpow2N/A
lift-cos.f64N/A
lift-cos.f64N/A
sqr-cos-aN/A
lower-+.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f6479.7
lift-*.f64N/A
*-commutativeN/A
lower-*.f6479.7
Applied rewrites79.7%
Final simplification79.7%
(FPCore (a b angle) :precision binary64 (fma (* (+ (* (cos (* -0.011111111111111112 (* angle (PI)))) 0.5) 0.5) b) b (pow (* a (sin (* (* 0.005555555555555556 angle) (PI)))) 2.0)))
\begin{array}{l}
\\
\mathsf{fma}\left(\left(\cos \left(-0.011111111111111112 \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) \cdot 0.5 + 0.5\right) \cdot b, b, {\left(a \cdot \sin \left(\left(0.005555555555555556 \cdot angle\right) \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}\right)
\end{array}
Initial program 79.6%
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%
lift-pow.f64N/A
unpow2N/A
lift-cos.f64N/A
lift-cos.f64N/A
sqr-cos-aN/A
lower-+.f64N/A
lower-*.f64N/A
cos-2N/A
cos-sumN/A
lower-cos.f64N/A
lift-/.f64N/A
div-invN/A
lift-/.f64N/A
div-invN/A
distribute-lft-outN/A
lower-*.f64N/A
metadata-evalN/A
metadata-evalN/A
metadata-eval79.6
Applied rewrites79.6%
Final simplification79.6%
(FPCore (a b angle)
:precision binary64
(if (<= a 2.95e-12)
(* (* b b) (pow (cos (* (* 0.005555555555555556 (PI)) angle)) 2.0))
(if (<= a 1.25e+138)
(fma
(* (* (* a a) 3.08641975308642e-5) (* (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 2.95 \cdot 10^{-12}:\\
\;\;\;\;\left(b \cdot b\right) \cdot {\cos \left(\left(0.005555555555555556 \cdot \mathsf{PI}\left(\right)\right) \cdot angle\right)}^{2}\\
\mathbf{elif}\;a \leq 1.25 \cdot 10^{+138}:\\
\;\;\;\;\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 \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 < 2.95e-12Initial program 78.3%
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-*.f6458.8
Applied rewrites58.8%
if 2.95e-12 < a < 1.25000000000000004e138Initial program 72.3%
unpow1N/A
metadata-evalN/A
pow-prod-upN/A
pow-prod-downN/A
lower-pow.f64N/A
Applied rewrites69.4%
Taylor expanded in angle around 0
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites53.6%
Taylor expanded in b around 0
Applied rewrites65.2%
if 1.25000000000000004e138 < a Initial program 92.6%
unpow1N/A
metadata-evalN/A
pow-prod-upN/A
pow-prod-downN/A
lower-pow.f64N/A
Applied rewrites76.5%
Taylor expanded in angle around 0
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites44.9%
Taylor expanded in b around 0
Applied rewrites59.2%
Applied rewrites81.5%
Final simplification62.6%
(FPCore (a b angle)
:precision binary64
(if (<= a 2.95e-12)
(* (pow (cos (* (* angle (PI)) -0.005555555555555556)) 2.0) (* b b))
(if (<= a 1.25e+138)
(fma
(* (* (* a a) 3.08641975308642e-5) (* (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 2.95 \cdot 10^{-12}:\\
\;\;\;\;{\cos \left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot -0.005555555555555556\right)}^{2} \cdot \left(b \cdot b\right)\\
\mathbf{elif}\;a \leq 1.25 \cdot 10^{+138}:\\
\;\;\;\;\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 \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 < 2.95e-12Initial program 78.3%
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 rewrites78.3%
Taylor expanded in b around inf
*-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-*.f6458.7
Applied rewrites58.7%
if 2.95e-12 < a < 1.25000000000000004e138Initial program 72.3%
unpow1N/A
metadata-evalN/A
pow-prod-upN/A
pow-prod-downN/A
lower-pow.f64N/A
Applied rewrites69.4%
Taylor expanded in angle around 0
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites53.6%
Taylor expanded in b around 0
Applied rewrites65.2%
if 1.25000000000000004e138 < a Initial program 92.6%
unpow1N/A
metadata-evalN/A
pow-prod-upN/A
pow-prod-downN/A
lower-pow.f64N/A
Applied rewrites76.5%
Taylor expanded in angle around 0
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites44.9%
Taylor expanded in b around 0
Applied rewrites59.2%
Applied rewrites81.5%
Final simplification62.5%
(FPCore (a b angle) :precision binary64 (fma (* 1.0 b) b (pow (* a (sin (* (* 0.005555555555555556 angle) (PI)))) 2.0)))
\begin{array}{l}
\\
\mathsf{fma}\left(1 \cdot b, b, {\left(a \cdot \sin \left(\left(0.005555555555555556 \cdot angle\right) \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}\right)
\end{array}
Initial program 79.6%
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%
Taylor expanded in angle around 0
Applied rewrites79.4%
Final simplification79.4%
(FPCore (a b angle)
:precision binary64
(if (<= a 2.95e-12)
(* b b)
(if (<= a 1.25e+138)
(fma
(* (* (* a a) 3.08641975308642e-5) (* (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 2.95 \cdot 10^{-12}:\\
\;\;\;\;b \cdot b\\
\mathbf{elif}\;a \leq 1.25 \cdot 10^{+138}:\\
\;\;\;\;\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 \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 < 2.95e-12Initial program 78.3%
Taylor expanded in angle around 0
unpow2N/A
lower-*.f6458.4
Applied rewrites58.4%
if 2.95e-12 < a < 1.25000000000000004e138Initial program 72.3%
unpow1N/A
metadata-evalN/A
pow-prod-upN/A
pow-prod-downN/A
lower-pow.f64N/A
Applied rewrites69.4%
Taylor expanded in angle around 0
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites53.6%
Taylor expanded in b around 0
Applied rewrites65.2%
if 1.25000000000000004e138 < a Initial program 92.6%
unpow1N/A
metadata-evalN/A
pow-prod-upN/A
pow-prod-downN/A
lower-pow.f64N/A
Applied rewrites76.5%
Taylor expanded in angle around 0
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites44.9%
Taylor expanded in b around 0
Applied rewrites59.2%
Applied rewrites81.5%
Final simplification62.3%
(FPCore (a b angle)
:precision binary64
(if (<= a 2.95e-12)
(* b b)
(if (<= a 5e+147)
(fma
(* (* (* a a) 3.08641975308642e-5) (* (PI) (PI)))
(* angle angle)
(* b b))
(* (* (* (* (* angle angle) 3.08641975308642e-5) (PI)) (* a (PI))) a))))\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq 2.95 \cdot 10^{-12}:\\
\;\;\;\;b \cdot b\\
\mathbf{elif}\;a \leq 5 \cdot 10^{+147}:\\
\;\;\;\;\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 \cdot angle, b \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(\left(\left(angle \cdot angle\right) \cdot 3.08641975308642 \cdot 10^{-5}\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \left(a \cdot \mathsf{PI}\left(\right)\right)\right) \cdot a\\
\end{array}
\end{array}
if a < 2.95e-12Initial program 78.3%
Taylor expanded in angle around 0
unpow2N/A
lower-*.f6458.4
Applied rewrites58.4%
if 2.95e-12 < a < 5.0000000000000002e147Initial program 70.4%
unpow1N/A
metadata-evalN/A
pow-prod-upN/A
pow-prod-downN/A
lower-pow.f64N/A
Applied rewrites67.4%
Taylor expanded in angle around 0
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites52.1%
Taylor expanded in b around 0
Applied rewrites63.2%
if 5.0000000000000002e147 < a Initial program 94.8%
unpow1N/A
metadata-evalN/A
pow-prod-upN/A
pow-prod-downN/A
lower-pow.f64N/A
Applied rewrites78.4%
Taylor expanded in angle around 0
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites45.9%
Taylor expanded in b around 0
Applied rewrites60.6%
Applied rewrites66.4%
Final simplification60.0%
(FPCore (a b angle)
:precision binary64
(let* ((t_0 (* (PI) (PI))))
(if (<= a 2.95e-12)
(* b b)
(if (<= a 9.8e+139)
(fma (* (* (* 3.08641975308642e-5 t_0) a) a) (* angle angle) (* b b))
(* (* t_0 a) (* (* (* angle angle) 3.08641975308642e-5) a))))))\begin{array}{l}
\\
\begin{array}{l}
t_0 := \mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\\
\mathbf{if}\;a \leq 2.95 \cdot 10^{-12}:\\
\;\;\;\;b \cdot b\\
\mathbf{elif}\;a \leq 9.8 \cdot 10^{+139}:\\
\;\;\;\;\mathsf{fma}\left(\left(\left(3.08641975308642 \cdot 10^{-5} \cdot t\_0\right) \cdot a\right) \cdot a, angle \cdot angle, b \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;\left(t\_0 \cdot a\right) \cdot \left(\left(\left(angle \cdot angle\right) \cdot 3.08641975308642 \cdot 10^{-5}\right) \cdot a\right)\\
\end{array}
\end{array}
if a < 2.95e-12Initial program 78.3%
Taylor expanded in angle around 0
unpow2N/A
lower-*.f6458.4
Applied rewrites58.4%
if 2.95e-12 < a < 9.80000000000000045e139Initial program 72.3%
unpow1N/A
metadata-evalN/A
pow-prod-upN/A
pow-prod-downN/A
lower-pow.f64N/A
Applied rewrites69.4%
Taylor expanded in angle around 0
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites53.6%
Taylor expanded in b around 0
Applied rewrites65.1%
if 9.80000000000000045e139 < a Initial program 92.6%
unpow1N/A
metadata-evalN/A
pow-prod-upN/A
pow-prod-downN/A
lower-pow.f64N/A
Applied rewrites76.5%
Taylor expanded in angle around 0
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites44.9%
Taylor expanded in b around 0
Applied rewrites59.2%
Applied rewrites64.8%
Final simplification60.0%
(FPCore (a b angle) :precision binary64 (if (<= a 6.6e+120) (* b b) (* (* (* (* (* angle angle) 3.08641975308642e-5) (PI)) (* a (PI))) a)))
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq 6.6 \cdot 10^{+120}:\\
\;\;\;\;b \cdot b\\
\mathbf{else}:\\
\;\;\;\;\left(\left(\left(\left(angle \cdot angle\right) \cdot 3.08641975308642 \cdot 10^{-5}\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \left(a \cdot \mathsf{PI}\left(\right)\right)\right) \cdot a\\
\end{array}
\end{array}
if a < 6.59999999999999981e120Initial program 77.4%
Taylor expanded in angle around 0
unpow2N/A
lower-*.f6458.2
Applied rewrites58.2%
if 6.59999999999999981e120 < a Initial program 92.8%
unpow1N/A
metadata-evalN/A
pow-prod-upN/A
pow-prod-downN/A
lower-pow.f64N/A
Applied rewrites77.1%
Taylor expanded in angle around 0
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites46.4%
Taylor expanded in b around 0
Applied rewrites58.8%
Applied rewrites64.3%
(FPCore (a b angle) :precision binary64 (if (<= a 6.6e+120) (* b b) (* (* (* (PI) (PI)) a) (* (* (* angle angle) 3.08641975308642e-5) a))))
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq 6.6 \cdot 10^{+120}:\\
\;\;\;\;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 \cdot angle\right) \cdot 3.08641975308642 \cdot 10^{-5}\right) \cdot a\right)\\
\end{array}
\end{array}
if a < 6.59999999999999981e120Initial program 77.4%
Taylor expanded in angle around 0
unpow2N/A
lower-*.f6458.2
Applied rewrites58.2%
if 6.59999999999999981e120 < a Initial program 92.8%
unpow1N/A
metadata-evalN/A
pow-prod-upN/A
pow-prod-downN/A
lower-pow.f64N/A
Applied rewrites77.1%
Taylor expanded in angle around 0
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites46.4%
Taylor expanded in b around 0
Applied rewrites58.8%
Applied rewrites64.3%
Final simplification59.1%
(FPCore (a b angle) :precision binary64 (if (<= a 6.6e+120) (* b b) (* (* (* (* angle angle) 3.08641975308642e-5) (* a a)) (* (PI) (PI)))))
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq 6.6 \cdot 10^{+120}:\\
\;\;\;\;b \cdot b\\
\mathbf{else}:\\
\;\;\;\;\left(\left(\left(angle \cdot angle\right) \cdot 3.08641975308642 \cdot 10^{-5}\right) \cdot \left(a \cdot a\right)\right) \cdot \left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right)\\
\end{array}
\end{array}
if a < 6.59999999999999981e120Initial program 77.4%
Taylor expanded in angle around 0
unpow2N/A
lower-*.f6458.2
Applied rewrites58.2%
if 6.59999999999999981e120 < a Initial program 92.8%
unpow1N/A
metadata-evalN/A
pow-prod-upN/A
pow-prod-downN/A
lower-pow.f64N/A
Applied rewrites77.1%
Taylor expanded in angle around 0
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites46.4%
Taylor expanded in b around 0
Applied rewrites58.8%
Applied rewrites58.8%
Final simplification58.3%
(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.6%
Taylor expanded in angle around 0
unpow2N/A
lower-*.f6453.2
Applied rewrites53.2%
herbie shell --seed 2024258
(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)))