
(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))))
double code(double a, double b, double angle) {
double t_0 = (angle / 180.0) * ((double) M_PI);
return pow((a * sin(t_0)), 2.0) + pow((b * cos(t_0)), 2.0);
}
public static double code(double a, double b, double angle) {
double t_0 = (angle / 180.0) * Math.PI;
return Math.pow((a * Math.sin(t_0)), 2.0) + Math.pow((b * Math.cos(t_0)), 2.0);
}
def code(a, b, angle): t_0 = (angle / 180.0) * math.pi return math.pow((a * math.sin(t_0)), 2.0) + math.pow((b * math.cos(t_0)), 2.0)
function code(a, b, angle) t_0 = Float64(Float64(angle / 180.0) * pi) return Float64((Float64(a * sin(t_0)) ^ 2.0) + (Float64(b * cos(t_0)) ^ 2.0)) end
function tmp = code(a, b, angle) t_0 = (angle / 180.0) * pi; tmp = ((a * sin(t_0)) ^ 2.0) + ((b * cos(t_0)) ^ 2.0); end
code[a_, b_, angle_] := Block[{t$95$0 = N[(N[(angle / 180.0), $MachinePrecision] * Pi), $MachinePrecision]}, N[(N[Power[N[(a * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[(b * N[Cos[t$95$0], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{angle}{180} \cdot \pi\\
{\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 14 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))))
double code(double a, double b, double angle) {
double t_0 = (angle / 180.0) * ((double) M_PI);
return pow((a * sin(t_0)), 2.0) + pow((b * cos(t_0)), 2.0);
}
public static double code(double a, double b, double angle) {
double t_0 = (angle / 180.0) * Math.PI;
return Math.pow((a * Math.sin(t_0)), 2.0) + Math.pow((b * Math.cos(t_0)), 2.0);
}
def code(a, b, angle): t_0 = (angle / 180.0) * math.pi return math.pow((a * math.sin(t_0)), 2.0) + math.pow((b * math.cos(t_0)), 2.0)
function code(a, b, angle) t_0 = Float64(Float64(angle / 180.0) * pi) return Float64((Float64(a * sin(t_0)) ^ 2.0) + (Float64(b * cos(t_0)) ^ 2.0)) end
function tmp = code(a, b, angle) t_0 = (angle / 180.0) * pi; tmp = ((a * sin(t_0)) ^ 2.0) + ((b * cos(t_0)) ^ 2.0); end
code[a_, b_, angle_] := Block[{t$95$0 = N[(N[(angle / 180.0), $MachinePrecision] * Pi), $MachinePrecision]}, N[(N[Power[N[(a * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[(b * N[Cos[t$95$0], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{angle}{180} \cdot \pi\\
{\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 (/ 1.0 (/ 180.0 (* angle PI))))) 2.0) (* b b)))
double code(double a, double b, double angle) {
return pow((a * sin((1.0 / (180.0 / (angle * ((double) M_PI)))))), 2.0) + (b * b);
}
public static double code(double a, double b, double angle) {
return Math.pow((a * Math.sin((1.0 / (180.0 / (angle * Math.PI))))), 2.0) + (b * b);
}
def code(a, b, angle): return math.pow((a * math.sin((1.0 / (180.0 / (angle * math.pi))))), 2.0) + (b * b)
function code(a, b, angle) return Float64((Float64(a * sin(Float64(1.0 / Float64(180.0 / Float64(angle * pi))))) ^ 2.0) + Float64(b * b)) end
function tmp = code(a, b, angle) tmp = ((a * sin((1.0 / (180.0 / (angle * pi))))) ^ 2.0) + (b * b); end
code[a_, b_, angle_] := N[(N[Power[N[(a * N[Sin[N[(1.0 / N[(180.0 / N[(angle * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + N[(b * b), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
{\left(a \cdot \sin \left(\frac{1}{\frac{180}{angle \cdot \pi}}\right)\right)}^{2} + b \cdot b
\end{array}
Initial program 85.8%
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
clear-numN/A
lower-/.f64N/A
lower-/.f64N/A
lower-*.f6485.9
Applied rewrites85.9%
Taylor expanded in angle around 0
Applied rewrites86.0%
Taylor expanded in angle around 0
unpow2N/A
lower-*.f6486.0
Applied rewrites86.0%
(FPCore (a b angle) :precision binary64 (+ (* b b) (pow (* a (sin (* angle (* PI 0.005555555555555556)))) 2.0)))
double code(double a, double b, double angle) {
return (b * b) + pow((a * sin((angle * (((double) M_PI) * 0.005555555555555556)))), 2.0);
}
public static double code(double a, double b, double angle) {
return (b * b) + Math.pow((a * Math.sin((angle * (Math.PI * 0.005555555555555556)))), 2.0);
}
def code(a, b, angle): return (b * b) + math.pow((a * math.sin((angle * (math.pi * 0.005555555555555556)))), 2.0)
function code(a, b, angle) return Float64(Float64(b * b) + (Float64(a * sin(Float64(angle * Float64(pi * 0.005555555555555556)))) ^ 2.0)) end
function tmp = code(a, b, angle) tmp = (b * b) + ((a * sin((angle * (pi * 0.005555555555555556)))) ^ 2.0); end
code[a_, b_, angle_] := N[(N[(b * b), $MachinePrecision] + N[Power[N[(a * N[Sin[N[(angle * N[(Pi * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
b \cdot b + {\left(a \cdot \sin \left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right)\right)}^{2}
\end{array}
Initial program 85.8%
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
clear-numN/A
lower-/.f64N/A
lower-/.f64N/A
lower-*.f6485.9
Applied rewrites85.9%
Taylor expanded in angle around 0
Applied rewrites86.0%
Taylor expanded in angle around 0
unpow2N/A
lower-*.f6486.0
Applied rewrites86.0%
lift-/.f64N/A
lift-/.f64N/A
associate-/r/N/A
metadata-evalN/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
lift-*.f64N/A
lower-*.f6485.9
Applied rewrites85.9%
Final simplification85.9%
(FPCore (a b angle) :precision binary64 (+ (* b b) (pow (* a (sin (* PI (* angle 0.005555555555555556)))) 2.0)))
double code(double a, double b, double angle) {
return (b * b) + pow((a * sin((((double) M_PI) * (angle * 0.005555555555555556)))), 2.0);
}
public static double code(double a, double b, double angle) {
return (b * b) + Math.pow((a * Math.sin((Math.PI * (angle * 0.005555555555555556)))), 2.0);
}
def code(a, b, angle): return (b * b) + math.pow((a * math.sin((math.pi * (angle * 0.005555555555555556)))), 2.0)
function code(a, b, angle) return Float64(Float64(b * b) + (Float64(a * sin(Float64(pi * Float64(angle * 0.005555555555555556)))) ^ 2.0)) end
function tmp = code(a, b, angle) tmp = (b * b) + ((a * sin((pi * (angle * 0.005555555555555556)))) ^ 2.0); end
code[a_, b_, angle_] := N[(N[(b * b), $MachinePrecision] + N[Power[N[(a * N[Sin[N[(Pi * N[(angle * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
b \cdot b + {\left(a \cdot \sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)}^{2}
\end{array}
Initial program 85.8%
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
clear-numN/A
lower-/.f64N/A
lower-/.f64N/A
lower-*.f6485.9
Applied rewrites85.9%
Taylor expanded in angle around 0
Applied rewrites86.0%
Taylor expanded in angle around 0
unpow2N/A
lower-*.f6486.0
Applied rewrites86.0%
lift-/.f64N/A
lift-/.f64N/A
clear-numN/A
lift-*.f64N/A
associate-*l/N/A
lower-*.f64N/A
div-invN/A
metadata-evalN/A
lower-*.f6485.8
Applied rewrites85.8%
Final simplification85.8%
(FPCore (a b angle)
:precision binary64
(if (<= (/ angle 180.0) 4e-6)
(+
(* b b)
(pow
(*
angle
(*
a
(*
PI
(fma
(* (* angle angle) -2.8577960676726107e-8)
(* PI PI)
0.005555555555555556))))
2.0))
(/
1.0
(/
1.0
(fma
(* a a)
(- 0.5 (* 0.5 (cos (* 2.0 (* angle (* PI 0.005555555555555556))))))
(* (* b b) (* 1.0 1.0)))))))
double code(double a, double b, double angle) {
double tmp;
if ((angle / 180.0) <= 4e-6) {
tmp = (b * b) + pow((angle * (a * (((double) M_PI) * fma(((angle * angle) * -2.8577960676726107e-8), (((double) M_PI) * ((double) M_PI)), 0.005555555555555556)))), 2.0);
} else {
tmp = 1.0 / (1.0 / fma((a * a), (0.5 - (0.5 * cos((2.0 * (angle * (((double) M_PI) * 0.005555555555555556)))))), ((b * b) * (1.0 * 1.0))));
}
return tmp;
}
function code(a, b, angle) tmp = 0.0 if (Float64(angle / 180.0) <= 4e-6) tmp = Float64(Float64(b * b) + (Float64(angle * Float64(a * Float64(pi * fma(Float64(Float64(angle * angle) * -2.8577960676726107e-8), Float64(pi * pi), 0.005555555555555556)))) ^ 2.0)); else tmp = Float64(1.0 / Float64(1.0 / fma(Float64(a * a), Float64(0.5 - Float64(0.5 * cos(Float64(2.0 * Float64(angle * Float64(pi * 0.005555555555555556)))))), Float64(Float64(b * b) * Float64(1.0 * 1.0))))); end return tmp end
code[a_, b_, angle_] := If[LessEqual[N[(angle / 180.0), $MachinePrecision], 4e-6], N[(N[(b * b), $MachinePrecision] + N[Power[N[(angle * N[(a * N[(Pi * N[(N[(N[(angle * angle), $MachinePrecision] * -2.8577960676726107e-8), $MachinePrecision] * N[(Pi * Pi), $MachinePrecision] + 0.005555555555555556), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(1.0 / N[(N[(a * a), $MachinePrecision] * N[(0.5 - N[(0.5 * N[Cos[N[(2.0 * N[(angle * N[(Pi * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(b * b), $MachinePrecision] * N[(1.0 * 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{angle}{180} \leq 4 \cdot 10^{-6}:\\
\;\;\;\;b \cdot b + {\left(angle \cdot \left(a \cdot \left(\pi \cdot \mathsf{fma}\left(\left(angle \cdot angle\right) \cdot -2.8577960676726107 \cdot 10^{-8}, \pi \cdot \pi, 0.005555555555555556\right)\right)\right)\right)}^{2}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\frac{1}{\mathsf{fma}\left(a \cdot a, 0.5 - 0.5 \cdot \cos \left(2 \cdot \left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right)\right), \left(b \cdot b\right) \cdot \left(1 \cdot 1\right)\right)}}\\
\end{array}
\end{array}
if (/.f64 angle #s(literal 180 binary64)) < 3.99999999999999982e-6Initial program 89.3%
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
clear-numN/A
lower-/.f64N/A
lower-/.f64N/A
lower-*.f6489.3
Applied rewrites89.3%
Taylor expanded in angle around 0
Applied rewrites89.4%
Taylor expanded in angle around 0
unpow2N/A
lower-*.f6489.4
Applied rewrites89.4%
Taylor expanded in angle around 0
Applied rewrites86.1%
if 3.99999999999999982e-6 < (/.f64 angle #s(literal 180 binary64)) Initial program 74.3%
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
clear-numN/A
lower-/.f64N/A
lower-/.f64N/A
lower-*.f6474.4
Applied rewrites74.4%
Taylor expanded in angle around 0
Applied rewrites74.3%
Applied rewrites73.9%
Final simplification83.3%
(FPCore (a b angle)
:precision binary64
(if (<= (/ angle 180.0) 4e-6)
(+
(* b b)
(pow
(*
angle
(*
a
(*
PI
(fma
(* (* angle angle) -2.8577960676726107e-8)
(* PI PI)
0.005555555555555556))))
2.0))
(fma
(* 1.0 (* b 1.0))
b
(*
a
(*
a
(- 0.5 (* 0.5 (cos (* 2.0 (* angle (* PI 0.005555555555555556)))))))))))
double code(double a, double b, double angle) {
double tmp;
if ((angle / 180.0) <= 4e-6) {
tmp = (b * b) + pow((angle * (a * (((double) M_PI) * fma(((angle * angle) * -2.8577960676726107e-8), (((double) M_PI) * ((double) M_PI)), 0.005555555555555556)))), 2.0);
} else {
tmp = fma((1.0 * (b * 1.0)), b, (a * (a * (0.5 - (0.5 * cos((2.0 * (angle * (((double) M_PI) * 0.005555555555555556)))))))));
}
return tmp;
}
function code(a, b, angle) tmp = 0.0 if (Float64(angle / 180.0) <= 4e-6) tmp = Float64(Float64(b * b) + (Float64(angle * Float64(a * Float64(pi * fma(Float64(Float64(angle * angle) * -2.8577960676726107e-8), Float64(pi * pi), 0.005555555555555556)))) ^ 2.0)); else tmp = fma(Float64(1.0 * Float64(b * 1.0)), b, Float64(a * Float64(a * Float64(0.5 - Float64(0.5 * cos(Float64(2.0 * Float64(angle * Float64(pi * 0.005555555555555556))))))))); end return tmp end
code[a_, b_, angle_] := If[LessEqual[N[(angle / 180.0), $MachinePrecision], 4e-6], N[(N[(b * b), $MachinePrecision] + N[Power[N[(angle * N[(a * N[(Pi * N[(N[(N[(angle * angle), $MachinePrecision] * -2.8577960676726107e-8), $MachinePrecision] * N[(Pi * Pi), $MachinePrecision] + 0.005555555555555556), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision], N[(N[(1.0 * N[(b * 1.0), $MachinePrecision]), $MachinePrecision] * b + N[(a * N[(a * N[(0.5 - N[(0.5 * N[Cos[N[(2.0 * N[(angle * N[(Pi * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{angle}{180} \leq 4 \cdot 10^{-6}:\\
\;\;\;\;b \cdot b + {\left(angle \cdot \left(a \cdot \left(\pi \cdot \mathsf{fma}\left(\left(angle \cdot angle\right) \cdot -2.8577960676726107 \cdot 10^{-8}, \pi \cdot \pi, 0.005555555555555556\right)\right)\right)\right)}^{2}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(1 \cdot \left(b \cdot 1\right), b, a \cdot \left(a \cdot \left(0.5 - 0.5 \cdot \cos \left(2 \cdot \left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right)\right)\right)\right)\right)\\
\end{array}
\end{array}
if (/.f64 angle #s(literal 180 binary64)) < 3.99999999999999982e-6Initial program 89.3%
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
clear-numN/A
lower-/.f64N/A
lower-/.f64N/A
lower-*.f6489.3
Applied rewrites89.3%
Taylor expanded in angle around 0
Applied rewrites89.4%
Taylor expanded in angle around 0
unpow2N/A
lower-*.f6489.4
Applied rewrites89.4%
Taylor expanded in angle around 0
Applied rewrites86.1%
if 3.99999999999999982e-6 < (/.f64 angle #s(literal 180 binary64)) Initial program 74.3%
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
clear-numN/A
lower-/.f64N/A
lower-/.f64N/A
lower-*.f6474.4
Applied rewrites74.4%
Taylor expanded in angle around 0
Applied rewrites74.3%
Applied rewrites73.9%
Final simplification83.3%
(FPCore (a b angle)
:precision binary64
(if (<= (/ angle 180.0) 4e-6)
(+
(* b b)
(pow
(*
angle
(*
a
(*
PI
(fma
(* (* angle angle) -2.8577960676726107e-8)
(* PI PI)
0.005555555555555556))))
2.0))
(fma
a
(* a (- 0.5 (* 0.5 (cos (* 2.0 (* (* angle PI) 0.005555555555555556))))))
(* b b))))
double code(double a, double b, double angle) {
double tmp;
if ((angle / 180.0) <= 4e-6) {
tmp = (b * b) + pow((angle * (a * (((double) M_PI) * fma(((angle * angle) * -2.8577960676726107e-8), (((double) M_PI) * ((double) M_PI)), 0.005555555555555556)))), 2.0);
} else {
tmp = fma(a, (a * (0.5 - (0.5 * cos((2.0 * ((angle * ((double) M_PI)) * 0.005555555555555556)))))), (b * b));
}
return tmp;
}
function code(a, b, angle) tmp = 0.0 if (Float64(angle / 180.0) <= 4e-6) tmp = Float64(Float64(b * b) + (Float64(angle * Float64(a * Float64(pi * fma(Float64(Float64(angle * angle) * -2.8577960676726107e-8), Float64(pi * pi), 0.005555555555555556)))) ^ 2.0)); else tmp = fma(a, Float64(a * Float64(0.5 - Float64(0.5 * cos(Float64(2.0 * Float64(Float64(angle * pi) * 0.005555555555555556)))))), Float64(b * b)); end return tmp end
code[a_, b_, angle_] := If[LessEqual[N[(angle / 180.0), $MachinePrecision], 4e-6], N[(N[(b * b), $MachinePrecision] + N[Power[N[(angle * N[(a * N[(Pi * N[(N[(N[(angle * angle), $MachinePrecision] * -2.8577960676726107e-8), $MachinePrecision] * N[(Pi * Pi), $MachinePrecision] + 0.005555555555555556), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision], N[(a * N[(a * N[(0.5 - N[(0.5 * N[Cos[N[(2.0 * N[(N[(angle * Pi), $MachinePrecision] * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(b * b), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{angle}{180} \leq 4 \cdot 10^{-6}:\\
\;\;\;\;b \cdot b + {\left(angle \cdot \left(a \cdot \left(\pi \cdot \mathsf{fma}\left(\left(angle \cdot angle\right) \cdot -2.8577960676726107 \cdot 10^{-8}, \pi \cdot \pi, 0.005555555555555556\right)\right)\right)\right)}^{2}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(a, a \cdot \left(0.5 - 0.5 \cdot \cos \left(2 \cdot \left(\left(angle \cdot \pi\right) \cdot 0.005555555555555556\right)\right)\right), b \cdot b\right)\\
\end{array}
\end{array}
if (/.f64 angle #s(literal 180 binary64)) < 3.99999999999999982e-6Initial program 89.3%
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
clear-numN/A
lower-/.f64N/A
lower-/.f64N/A
lower-*.f6489.3
Applied rewrites89.3%
Taylor expanded in angle around 0
Applied rewrites89.4%
Taylor expanded in angle around 0
unpow2N/A
lower-*.f6489.4
Applied rewrites89.4%
Taylor expanded in angle around 0
Applied rewrites86.1%
if 3.99999999999999982e-6 < (/.f64 angle #s(literal 180 binary64)) Initial program 74.3%
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
clear-numN/A
lower-/.f64N/A
lower-/.f64N/A
lower-*.f6474.4
Applied rewrites74.4%
Taylor expanded in angle around 0
Applied rewrites74.3%
Taylor expanded in angle around 0
unpow2N/A
lower-*.f6474.3
Applied rewrites74.3%
lift-+.f64N/A
lift-pow.f64N/A
lift-*.f64N/A
unpow-prod-downN/A
pow2N/A
lift-sin.f64N/A
lift-/.f64N/A
lift-/.f64N/A
associate-/r/N/A
metadata-evalN/A
lift-*.f64N/A
lift-PI.f64N/A
associate-*l*N/A
Applied rewrites74.2%
Final simplification83.4%
(FPCore (a b angle)
:precision binary64
(if (<= (/ angle 180.0) 4e-6)
(+ (* b b) (pow (* (* angle PI) (* a 0.005555555555555556)) 2.0))
(fma
a
(* a (- 0.5 (* 0.5 (cos (* 2.0 (* (* angle PI) 0.005555555555555556))))))
(* b b))))
double code(double a, double b, double angle) {
double tmp;
if ((angle / 180.0) <= 4e-6) {
tmp = (b * b) + pow(((angle * ((double) M_PI)) * (a * 0.005555555555555556)), 2.0);
} else {
tmp = fma(a, (a * (0.5 - (0.5 * cos((2.0 * ((angle * ((double) M_PI)) * 0.005555555555555556)))))), (b * b));
}
return tmp;
}
function code(a, b, angle) tmp = 0.0 if (Float64(angle / 180.0) <= 4e-6) tmp = Float64(Float64(b * b) + (Float64(Float64(angle * pi) * Float64(a * 0.005555555555555556)) ^ 2.0)); else tmp = fma(a, Float64(a * Float64(0.5 - Float64(0.5 * cos(Float64(2.0 * Float64(Float64(angle * pi) * 0.005555555555555556)))))), Float64(b * b)); end return tmp end
code[a_, b_, angle_] := If[LessEqual[N[(angle / 180.0), $MachinePrecision], 4e-6], N[(N[(b * b), $MachinePrecision] + N[Power[N[(N[(angle * Pi), $MachinePrecision] * N[(a * 0.005555555555555556), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision], N[(a * N[(a * N[(0.5 - N[(0.5 * N[Cos[N[(2.0 * N[(N[(angle * Pi), $MachinePrecision] * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(b * b), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{angle}{180} \leq 4 \cdot 10^{-6}:\\
\;\;\;\;b \cdot b + {\left(\left(angle \cdot \pi\right) \cdot \left(a \cdot 0.005555555555555556\right)\right)}^{2}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(a, a \cdot \left(0.5 - 0.5 \cdot \cos \left(2 \cdot \left(\left(angle \cdot \pi\right) \cdot 0.005555555555555556\right)\right)\right), b \cdot b\right)\\
\end{array}
\end{array}
if (/.f64 angle #s(literal 180 binary64)) < 3.99999999999999982e-6Initial program 89.3%
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
clear-numN/A
lower-/.f64N/A
lower-/.f64N/A
lower-*.f6489.3
Applied rewrites89.3%
Taylor expanded in angle around 0
Applied rewrites89.4%
Taylor expanded in angle around 0
unpow2N/A
lower-*.f6489.4
Applied rewrites89.4%
Taylor expanded in angle around 0
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f64N/A
lower-*.f6486.8
Applied rewrites86.8%
if 3.99999999999999982e-6 < (/.f64 angle #s(literal 180 binary64)) Initial program 74.3%
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
clear-numN/A
lower-/.f64N/A
lower-/.f64N/A
lower-*.f6474.4
Applied rewrites74.4%
Taylor expanded in angle around 0
Applied rewrites74.3%
Taylor expanded in angle around 0
unpow2N/A
lower-*.f6474.3
Applied rewrites74.3%
lift-+.f64N/A
lift-pow.f64N/A
lift-*.f64N/A
unpow-prod-downN/A
pow2N/A
lift-sin.f64N/A
lift-/.f64N/A
lift-/.f64N/A
associate-/r/N/A
metadata-evalN/A
lift-*.f64N/A
lift-PI.f64N/A
associate-*l*N/A
Applied rewrites74.2%
Final simplification83.9%
(FPCore (a b angle) :precision binary64 (if (<= a 4.4e-148) (* b b) (+ (* b b) (pow (* (* angle PI) (* a 0.005555555555555556)) 2.0))))
double code(double a, double b, double angle) {
double tmp;
if (a <= 4.4e-148) {
tmp = b * b;
} else {
tmp = (b * b) + pow(((angle * ((double) M_PI)) * (a * 0.005555555555555556)), 2.0);
}
return tmp;
}
public static double code(double a, double b, double angle) {
double tmp;
if (a <= 4.4e-148) {
tmp = b * b;
} else {
tmp = (b * b) + Math.pow(((angle * Math.PI) * (a * 0.005555555555555556)), 2.0);
}
return tmp;
}
def code(a, b, angle): tmp = 0 if a <= 4.4e-148: tmp = b * b else: tmp = (b * b) + math.pow(((angle * math.pi) * (a * 0.005555555555555556)), 2.0) return tmp
function code(a, b, angle) tmp = 0.0 if (a <= 4.4e-148) tmp = Float64(b * b); else tmp = Float64(Float64(b * b) + (Float64(Float64(angle * pi) * Float64(a * 0.005555555555555556)) ^ 2.0)); end return tmp end
function tmp_2 = code(a, b, angle) tmp = 0.0; if (a <= 4.4e-148) tmp = b * b; else tmp = (b * b) + (((angle * pi) * (a * 0.005555555555555556)) ^ 2.0); end tmp_2 = tmp; end
code[a_, b_, angle_] := If[LessEqual[a, 4.4e-148], N[(b * b), $MachinePrecision], N[(N[(b * b), $MachinePrecision] + N[Power[N[(N[(angle * Pi), $MachinePrecision] * N[(a * 0.005555555555555556), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq 4.4 \cdot 10^{-148}:\\
\;\;\;\;b \cdot b\\
\mathbf{else}:\\
\;\;\;\;b \cdot b + {\left(\left(angle \cdot \pi\right) \cdot \left(a \cdot 0.005555555555555556\right)\right)}^{2}\\
\end{array}
\end{array}
if a < 4.40000000000000034e-148Initial program 85.6%
Taylor expanded in angle around 0
unpow2N/A
lower-*.f6468.2
Applied rewrites68.2%
if 4.40000000000000034e-148 < a Initial program 86.2%
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
clear-numN/A
lower-/.f64N/A
lower-/.f64N/A
lower-*.f6486.2
Applied rewrites86.2%
Taylor expanded in angle around 0
Applied rewrites86.3%
Taylor expanded in angle around 0
unpow2N/A
lower-*.f6486.3
Applied rewrites86.3%
Taylor expanded in angle around 0
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f64N/A
lower-*.f6484.1
Applied rewrites84.1%
Final simplification74.5%
(FPCore (a b angle)
:precision binary64
(if (<= b 7e-92)
(fma
(*
angle
(*
(* PI PI)
(fma a (* a 3.08641975308642e-5) (* (* b b) -3.08641975308642e-5))))
angle
(* b b))
(if (<= b 4e+141)
(*
(* b b)
(fma
angle
(* angle (* (* PI PI) -3.08641975308642e-5))
(fma
(* PI (* PI (* a (* a (* angle angle)))))
(/ 3.08641975308642e-5 (* b b))
1.0)))
(* b b))))
double code(double a, double b, double angle) {
double tmp;
if (b <= 7e-92) {
tmp = fma((angle * ((((double) M_PI) * ((double) M_PI)) * fma(a, (a * 3.08641975308642e-5), ((b * b) * -3.08641975308642e-5)))), angle, (b * b));
} else if (b <= 4e+141) {
tmp = (b * b) * fma(angle, (angle * ((((double) M_PI) * ((double) M_PI)) * -3.08641975308642e-5)), fma((((double) M_PI) * (((double) M_PI) * (a * (a * (angle * angle))))), (3.08641975308642e-5 / (b * b)), 1.0));
} else {
tmp = b * b;
}
return tmp;
}
function code(a, b, angle) tmp = 0.0 if (b <= 7e-92) tmp = fma(Float64(angle * Float64(Float64(pi * pi) * fma(a, Float64(a * 3.08641975308642e-5), Float64(Float64(b * b) * -3.08641975308642e-5)))), angle, Float64(b * b)); elseif (b <= 4e+141) tmp = Float64(Float64(b * b) * fma(angle, Float64(angle * Float64(Float64(pi * pi) * -3.08641975308642e-5)), fma(Float64(pi * Float64(pi * Float64(a * Float64(a * Float64(angle * angle))))), Float64(3.08641975308642e-5 / Float64(b * b)), 1.0))); else tmp = Float64(b * b); end return tmp end
code[a_, b_, angle_] := If[LessEqual[b, 7e-92], N[(N[(angle * N[(N[(Pi * Pi), $MachinePrecision] * N[(a * N[(a * 3.08641975308642e-5), $MachinePrecision] + N[(N[(b * b), $MachinePrecision] * -3.08641975308642e-5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * angle + N[(b * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 4e+141], N[(N[(b * b), $MachinePrecision] * N[(angle * N[(angle * N[(N[(Pi * Pi), $MachinePrecision] * -3.08641975308642e-5), $MachinePrecision]), $MachinePrecision] + N[(N[(Pi * N[(Pi * N[(a * N[(a * N[(angle * angle), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(3.08641975308642e-5 / N[(b * b), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(b * b), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq 7 \cdot 10^{-92}:\\
\;\;\;\;\mathsf{fma}\left(angle \cdot \left(\left(\pi \cdot \pi\right) \cdot \mathsf{fma}\left(a, a \cdot 3.08641975308642 \cdot 10^{-5}, \left(b \cdot b\right) \cdot -3.08641975308642 \cdot 10^{-5}\right)\right), angle, b \cdot b\right)\\
\mathbf{elif}\;b \leq 4 \cdot 10^{+141}:\\
\;\;\;\;\left(b \cdot b\right) \cdot \mathsf{fma}\left(angle, angle \cdot \left(\left(\pi \cdot \pi\right) \cdot -3.08641975308642 \cdot 10^{-5}\right), \mathsf{fma}\left(\pi \cdot \left(\pi \cdot \left(a \cdot \left(a \cdot \left(angle \cdot angle\right)\right)\right)\right), \frac{3.08641975308642 \cdot 10^{-5}}{b \cdot b}, 1\right)\right)\\
\mathbf{else}:\\
\;\;\;\;b \cdot b\\
\end{array}
\end{array}
if b < 7e-92Initial program 84.6%
Taylor expanded in angle around 0
distribute-rgt-inN/A
+-commutativeN/A
associate-*r*N/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
associate-*l*N/A
*-commutativeN/A
distribute-rgt-outN/A
Applied rewrites38.7%
Applied rewrites43.7%
if 7e-92 < b < 4.00000000000000007e141Initial program 79.3%
Taylor expanded in angle around 0
distribute-rgt-inN/A
+-commutativeN/A
associate-*r*N/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
associate-*l*N/A
*-commutativeN/A
distribute-rgt-outN/A
Applied rewrites62.5%
Taylor expanded in b around 0
Applied rewrites16.0%
Taylor expanded in b around inf
Applied rewrites71.4%
if 4.00000000000000007e141 < b Initial program 98.2%
Taylor expanded in angle around 0
unpow2N/A
lower-*.f6498.1
Applied rewrites98.1%
Final simplification57.7%
(FPCore (a b angle)
:precision binary64
(let* ((t_0 (* (* b b) -3.08641975308642e-5)))
(if (<= b 4e-94)
(fma
(* angle (* (* PI PI) (fma a (* a 3.08641975308642e-5) t_0)))
angle
(* b b))
(if (<= b 7.5e+91)
(fma
(* t_0 (* angle (* PI PI)))
angle
(fma
a
(* (* a 3.08641975308642e-5) (* (* angle PI) (* angle PI)))
(* b b)))
(* b b)))))
double code(double a, double b, double angle) {
double t_0 = (b * b) * -3.08641975308642e-5;
double tmp;
if (b <= 4e-94) {
tmp = fma((angle * ((((double) M_PI) * ((double) M_PI)) * fma(a, (a * 3.08641975308642e-5), t_0))), angle, (b * b));
} else if (b <= 7.5e+91) {
tmp = fma((t_0 * (angle * (((double) M_PI) * ((double) M_PI)))), angle, fma(a, ((a * 3.08641975308642e-5) * ((angle * ((double) M_PI)) * (angle * ((double) M_PI)))), (b * b)));
} else {
tmp = b * b;
}
return tmp;
}
function code(a, b, angle) t_0 = Float64(Float64(b * b) * -3.08641975308642e-5) tmp = 0.0 if (b <= 4e-94) tmp = fma(Float64(angle * Float64(Float64(pi * pi) * fma(a, Float64(a * 3.08641975308642e-5), t_0))), angle, Float64(b * b)); elseif (b <= 7.5e+91) tmp = fma(Float64(t_0 * Float64(angle * Float64(pi * pi))), angle, fma(a, Float64(Float64(a * 3.08641975308642e-5) * Float64(Float64(angle * pi) * Float64(angle * pi))), Float64(b * b))); else tmp = Float64(b * b); end return tmp end
code[a_, b_, angle_] := Block[{t$95$0 = N[(N[(b * b), $MachinePrecision] * -3.08641975308642e-5), $MachinePrecision]}, If[LessEqual[b, 4e-94], N[(N[(angle * N[(N[(Pi * Pi), $MachinePrecision] * N[(a * N[(a * 3.08641975308642e-5), $MachinePrecision] + t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * angle + N[(b * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 7.5e+91], N[(N[(t$95$0 * N[(angle * N[(Pi * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * angle + N[(a * N[(N[(a * 3.08641975308642e-5), $MachinePrecision] * N[(N[(angle * Pi), $MachinePrecision] * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(b * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(b * b), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(b \cdot b\right) \cdot -3.08641975308642 \cdot 10^{-5}\\
\mathbf{if}\;b \leq 4 \cdot 10^{-94}:\\
\;\;\;\;\mathsf{fma}\left(angle \cdot \left(\left(\pi \cdot \pi\right) \cdot \mathsf{fma}\left(a, a \cdot 3.08641975308642 \cdot 10^{-5}, t\_0\right)\right), angle, b \cdot b\right)\\
\mathbf{elif}\;b \leq 7.5 \cdot 10^{+91}:\\
\;\;\;\;\mathsf{fma}\left(t\_0 \cdot \left(angle \cdot \left(\pi \cdot \pi\right)\right), angle, \mathsf{fma}\left(a, \left(a \cdot 3.08641975308642 \cdot 10^{-5}\right) \cdot \left(\left(angle \cdot \pi\right) \cdot \left(angle \cdot \pi\right)\right), b \cdot b\right)\right)\\
\mathbf{else}:\\
\;\;\;\;b \cdot b\\
\end{array}
\end{array}
if b < 3.9999999999999998e-94Initial program 84.6%
Taylor expanded in angle around 0
distribute-rgt-inN/A
+-commutativeN/A
associate-*r*N/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
associate-*l*N/A
*-commutativeN/A
distribute-rgt-outN/A
Applied rewrites38.7%
Applied rewrites43.7%
if 3.9999999999999998e-94 < b < 7.50000000000000033e91Initial program 85.9%
Taylor expanded in angle around 0
distribute-rgt-inN/A
+-commutativeN/A
associate-*r*N/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
associate-*l*N/A
*-commutativeN/A
distribute-rgt-outN/A
Applied rewrites74.9%
Applied rewrites80.4%
if 7.50000000000000033e91 < b Initial program 89.7%
Taylor expanded in angle around 0
unpow2N/A
lower-*.f6486.1
Applied rewrites86.1%
(FPCore (a b angle)
:precision binary64
(if (<= b 1250000000000.0)
(fma
(*
angle
(*
(* PI PI)
(fma a (* a 3.08641975308642e-5) (* (* b b) -3.08641975308642e-5))))
angle
(* b b))
(* b b)))
double code(double a, double b, double angle) {
double tmp;
if (b <= 1250000000000.0) {
tmp = fma((angle * ((((double) M_PI) * ((double) M_PI)) * fma(a, (a * 3.08641975308642e-5), ((b * b) * -3.08641975308642e-5)))), angle, (b * b));
} else {
tmp = b * b;
}
return tmp;
}
function code(a, b, angle) tmp = 0.0 if (b <= 1250000000000.0) tmp = fma(Float64(angle * Float64(Float64(pi * pi) * fma(a, Float64(a * 3.08641975308642e-5), Float64(Float64(b * b) * -3.08641975308642e-5)))), angle, Float64(b * b)); else tmp = Float64(b * b); end return tmp end
code[a_, b_, angle_] := If[LessEqual[b, 1250000000000.0], N[(N[(angle * N[(N[(Pi * Pi), $MachinePrecision] * N[(a * N[(a * 3.08641975308642e-5), $MachinePrecision] + N[(N[(b * b), $MachinePrecision] * -3.08641975308642e-5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * angle + N[(b * b), $MachinePrecision]), $MachinePrecision], N[(b * b), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq 1250000000000:\\
\;\;\;\;\mathsf{fma}\left(angle \cdot \left(\left(\pi \cdot \pi\right) \cdot \mathsf{fma}\left(a, a \cdot 3.08641975308642 \cdot 10^{-5}, \left(b \cdot b\right) \cdot -3.08641975308642 \cdot 10^{-5}\right)\right), angle, b \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;b \cdot b\\
\end{array}
\end{array}
if b < 1.25e12Initial program 85.3%
Taylor expanded in angle around 0
distribute-rgt-inN/A
+-commutativeN/A
associate-*r*N/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
associate-*l*N/A
*-commutativeN/A
distribute-rgt-outN/A
Applied rewrites42.4%
Applied rewrites47.0%
if 1.25e12 < b Initial program 87.2%
Taylor expanded in angle around 0
unpow2N/A
lower-*.f6480.9
Applied rewrites80.9%
(FPCore (a b angle)
:precision binary64
(if (<= b 3.1e-145)
(* angle (* (* angle 3.08641975308642e-5) (* PI (* PI (* a a)))))
(if (<= b 4e+87)
(fma
(* angle (* angle (* PI PI)))
(* (* a a) 3.08641975308642e-5)
(* b b))
(* b b))))
double code(double a, double b, double angle) {
double tmp;
if (b <= 3.1e-145) {
tmp = angle * ((angle * 3.08641975308642e-5) * (((double) M_PI) * (((double) M_PI) * (a * a))));
} else if (b <= 4e+87) {
tmp = fma((angle * (angle * (((double) M_PI) * ((double) M_PI)))), ((a * a) * 3.08641975308642e-5), (b * b));
} else {
tmp = b * b;
}
return tmp;
}
function code(a, b, angle) tmp = 0.0 if (b <= 3.1e-145) tmp = Float64(angle * Float64(Float64(angle * 3.08641975308642e-5) * Float64(pi * Float64(pi * Float64(a * a))))); elseif (b <= 4e+87) tmp = fma(Float64(angle * Float64(angle * Float64(pi * pi))), Float64(Float64(a * a) * 3.08641975308642e-5), Float64(b * b)); else tmp = Float64(b * b); end return tmp end
code[a_, b_, angle_] := If[LessEqual[b, 3.1e-145], N[(angle * N[(N[(angle * 3.08641975308642e-5), $MachinePrecision] * N[(Pi * N[(Pi * N[(a * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 4e+87], N[(N[(angle * N[(angle * N[(Pi * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(a * a), $MachinePrecision] * 3.08641975308642e-5), $MachinePrecision] + N[(b * b), $MachinePrecision]), $MachinePrecision], N[(b * b), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq 3.1 \cdot 10^{-145}:\\
\;\;\;\;angle \cdot \left(\left(angle \cdot 3.08641975308642 \cdot 10^{-5}\right) \cdot \left(\pi \cdot \left(\pi \cdot \left(a \cdot a\right)\right)\right)\right)\\
\mathbf{elif}\;b \leq 4 \cdot 10^{+87}:\\
\;\;\;\;\mathsf{fma}\left(angle \cdot \left(angle \cdot \left(\pi \cdot \pi\right)\right), \left(a \cdot a\right) \cdot 3.08641975308642 \cdot 10^{-5}, b \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;b \cdot b\\
\end{array}
\end{array}
if b < 3.1e-145Initial program 86.1%
Taylor expanded in angle around 0
distribute-rgt-inN/A
+-commutativeN/A
associate-*r*N/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
associate-*l*N/A
*-commutativeN/A
distribute-rgt-outN/A
Applied rewrites38.8%
Taylor expanded in b around 0
Applied rewrites36.5%
Applied rewrites43.7%
if 3.1e-145 < b < 3.9999999999999998e87Initial program 79.3%
Taylor expanded in angle around 0
distribute-rgt-inN/A
+-commutativeN/A
associate-*r*N/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
associate-*l*N/A
*-commutativeN/A
distribute-rgt-outN/A
Applied rewrites68.5%
Taylor expanded in b around 0
Applied rewrites69.3%
if 3.9999999999999998e87 < b Initial program 89.9%
Taylor expanded in angle around 0
unpow2N/A
lower-*.f6486.3
Applied rewrites86.3%
(FPCore (a b angle) :precision binary64 (if (<= b 1.35e-137) (* angle (* (* angle 3.08641975308642e-5) (* PI (* PI (* a a))))) (* b b)))
double code(double a, double b, double angle) {
double tmp;
if (b <= 1.35e-137) {
tmp = angle * ((angle * 3.08641975308642e-5) * (((double) M_PI) * (((double) M_PI) * (a * a))));
} else {
tmp = b * b;
}
return tmp;
}
public static double code(double a, double b, double angle) {
double tmp;
if (b <= 1.35e-137) {
tmp = angle * ((angle * 3.08641975308642e-5) * (Math.PI * (Math.PI * (a * a))));
} else {
tmp = b * b;
}
return tmp;
}
def code(a, b, angle): tmp = 0 if b <= 1.35e-137: tmp = angle * ((angle * 3.08641975308642e-5) * (math.pi * (math.pi * (a * a)))) else: tmp = b * b return tmp
function code(a, b, angle) tmp = 0.0 if (b <= 1.35e-137) tmp = Float64(angle * Float64(Float64(angle * 3.08641975308642e-5) * Float64(pi * Float64(pi * Float64(a * a))))); else tmp = Float64(b * b); end return tmp end
function tmp_2 = code(a, b, angle) tmp = 0.0; if (b <= 1.35e-137) tmp = angle * ((angle * 3.08641975308642e-5) * (pi * (pi * (a * a)))); else tmp = b * b; end tmp_2 = tmp; end
code[a_, b_, angle_] := If[LessEqual[b, 1.35e-137], N[(angle * N[(N[(angle * 3.08641975308642e-5), $MachinePrecision] * N[(Pi * N[(Pi * N[(a * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(b * b), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq 1.35 \cdot 10^{-137}:\\
\;\;\;\;angle \cdot \left(\left(angle \cdot 3.08641975308642 \cdot 10^{-5}\right) \cdot \left(\pi \cdot \left(\pi \cdot \left(a \cdot a\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;b \cdot b\\
\end{array}
\end{array}
if b < 1.34999999999999996e-137Initial program 86.1%
Taylor expanded in angle around 0
distribute-rgt-inN/A
+-commutativeN/A
associate-*r*N/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
associate-*l*N/A
*-commutativeN/A
distribute-rgt-outN/A
Applied rewrites38.8%
Taylor expanded in b around 0
Applied rewrites36.5%
Applied rewrites43.7%
if 1.34999999999999996e-137 < b Initial program 85.4%
Taylor expanded in angle around 0
unpow2N/A
lower-*.f6474.9
Applied rewrites74.9%
(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 85.8%
Taylor expanded in angle around 0
unpow2N/A
lower-*.f6464.2
Applied rewrites64.2%
herbie shell --seed 2024233
(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)))