
(FPCore (a b angle) :precision binary64 (let* ((t_0 (* PI (/ angle 180.0)))) (+ (pow (* a (cos t_0)) 2.0) (pow (* b (sin t_0)) 2.0))))
double code(double a, double b, double angle) {
double t_0 = ((double) M_PI) * (angle / 180.0);
return pow((a * cos(t_0)), 2.0) + pow((b * sin(t_0)), 2.0);
}
public static double code(double a, double b, double angle) {
double t_0 = Math.PI * (angle / 180.0);
return Math.pow((a * Math.cos(t_0)), 2.0) + Math.pow((b * Math.sin(t_0)), 2.0);
}
def code(a, b, angle): t_0 = math.pi * (angle / 180.0) return math.pow((a * math.cos(t_0)), 2.0) + math.pow((b * math.sin(t_0)), 2.0)
function code(a, b, angle) t_0 = Float64(pi * Float64(angle / 180.0)) return Float64((Float64(a * cos(t_0)) ^ 2.0) + (Float64(b * sin(t_0)) ^ 2.0)) end
function tmp = code(a, b, angle) t_0 = pi * (angle / 180.0); tmp = ((a * cos(t_0)) ^ 2.0) + ((b * sin(t_0)) ^ 2.0); end
code[a_, b_, angle_] := Block[{t$95$0 = N[(Pi * N[(angle / 180.0), $MachinePrecision]), $MachinePrecision]}, N[(N[Power[N[(a * N[Cos[t$95$0], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[(b * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \pi \cdot \frac{angle}{180}\\
{\left(a \cdot \cos t\_0\right)}^{2} + {\left(b \cdot \sin t\_0\right)}^{2}
\end{array}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 13 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (a b angle) :precision binary64 (let* ((t_0 (* PI (/ angle 180.0)))) (+ (pow (* a (cos t_0)) 2.0) (pow (* b (sin t_0)) 2.0))))
double code(double a, double b, double angle) {
double t_0 = ((double) M_PI) * (angle / 180.0);
return pow((a * cos(t_0)), 2.0) + pow((b * sin(t_0)), 2.0);
}
public static double code(double a, double b, double angle) {
double t_0 = Math.PI * (angle / 180.0);
return Math.pow((a * Math.cos(t_0)), 2.0) + Math.pow((b * Math.sin(t_0)), 2.0);
}
def code(a, b, angle): t_0 = math.pi * (angle / 180.0) return math.pow((a * math.cos(t_0)), 2.0) + math.pow((b * math.sin(t_0)), 2.0)
function code(a, b, angle) t_0 = Float64(pi * Float64(angle / 180.0)) return Float64((Float64(a * cos(t_0)) ^ 2.0) + (Float64(b * sin(t_0)) ^ 2.0)) end
function tmp = code(a, b, angle) t_0 = pi * (angle / 180.0); tmp = ((a * cos(t_0)) ^ 2.0) + ((b * sin(t_0)) ^ 2.0); end
code[a_, b_, angle_] := Block[{t$95$0 = N[(Pi * N[(angle / 180.0), $MachinePrecision]), $MachinePrecision]}, N[(N[Power[N[(a * N[Cos[t$95$0], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[(b * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \pi \cdot \frac{angle}{180}\\
{\left(a \cdot \cos t\_0\right)}^{2} + {\left(b \cdot \sin t\_0\right)}^{2}
\end{array}
\end{array}
(FPCore (a b angle) :precision binary64 (+ (pow (* a (cos (* 0.005555555555555556 (pow (/ 1.0 (* PI angle)) -1.0)))) 2.0) (pow (* b (sin (/ 0.005555555555555556 (/ (/ 1.0 angle) PI)))) 2.0)))
double code(double a, double b, double angle) {
return pow((a * cos((0.005555555555555556 * pow((1.0 / (((double) M_PI) * angle)), -1.0)))), 2.0) + pow((b * sin((0.005555555555555556 / ((1.0 / angle) / ((double) M_PI))))), 2.0);
}
public static double code(double a, double b, double angle) {
return Math.pow((a * Math.cos((0.005555555555555556 * Math.pow((1.0 / (Math.PI * angle)), -1.0)))), 2.0) + Math.pow((b * Math.sin((0.005555555555555556 / ((1.0 / angle) / Math.PI)))), 2.0);
}
def code(a, b, angle): return math.pow((a * math.cos((0.005555555555555556 * math.pow((1.0 / (math.pi * angle)), -1.0)))), 2.0) + math.pow((b * math.sin((0.005555555555555556 / ((1.0 / angle) / math.pi)))), 2.0)
function code(a, b, angle) return Float64((Float64(a * cos(Float64(0.005555555555555556 * (Float64(1.0 / Float64(pi * angle)) ^ -1.0)))) ^ 2.0) + (Float64(b * sin(Float64(0.005555555555555556 / Float64(Float64(1.0 / angle) / pi)))) ^ 2.0)) end
function tmp = code(a, b, angle) tmp = ((a * cos((0.005555555555555556 * ((1.0 / (pi * angle)) ^ -1.0)))) ^ 2.0) + ((b * sin((0.005555555555555556 / ((1.0 / angle) / pi)))) ^ 2.0); end
code[a_, b_, angle_] := N[(N[Power[N[(a * N[Cos[N[(0.005555555555555556 * N[Power[N[(1.0 / N[(Pi * angle), $MachinePrecision]), $MachinePrecision], -1.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[(b * N[Sin[N[(0.005555555555555556 / N[(N[(1.0 / angle), $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
{\left(a \cdot \cos \left(0.005555555555555556 \cdot {\left(\frac{1}{\pi \cdot angle}\right)}^{-1}\right)\right)}^{2} + {\left(b \cdot \sin \left(\frac{0.005555555555555556}{\frac{\frac{1}{angle}}{\pi}}\right)\right)}^{2}
\end{array}
Initial program 82.2%
+-lowering-+.f64N/A
pow-lowering-pow.f64N/A
*-lowering-*.f64N/A
cos-lowering-cos.f64N/A
associate-*r/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
pow-lowering-pow.f64N/A
Simplified82.3%
clear-numN/A
inv-powN/A
div-invN/A
unpow-prod-downN/A
metadata-evalN/A
metadata-evalN/A
*-lowering-*.f64N/A
metadata-evalN/A
pow-lowering-pow.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f6482.4%
Applied egg-rr82.4%
clear-numN/A
div-invN/A
associate-/r*N/A
metadata-evalN/A
/-lowering-/.f64N/A
*-commutativeN/A
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
PI-lowering-PI.f6482.5%
Applied egg-rr82.5%
(FPCore (a b angle) :precision binary64 (+ (pow (* a (cos (* 0.005555555555555556 (pow (/ 1.0 (* PI angle)) -1.0)))) 2.0) (pow (* b (sin (/ (* PI angle) 180.0))) 2.0)))
double code(double a, double b, double angle) {
return pow((a * cos((0.005555555555555556 * pow((1.0 / (((double) M_PI) * angle)), -1.0)))), 2.0) + pow((b * sin(((((double) M_PI) * angle) / 180.0))), 2.0);
}
public static double code(double a, double b, double angle) {
return Math.pow((a * Math.cos((0.005555555555555556 * Math.pow((1.0 / (Math.PI * angle)), -1.0)))), 2.0) + Math.pow((b * Math.sin(((Math.PI * angle) / 180.0))), 2.0);
}
def code(a, b, angle): return math.pow((a * math.cos((0.005555555555555556 * math.pow((1.0 / (math.pi * angle)), -1.0)))), 2.0) + math.pow((b * math.sin(((math.pi * angle) / 180.0))), 2.0)
function code(a, b, angle) return Float64((Float64(a * cos(Float64(0.005555555555555556 * (Float64(1.0 / Float64(pi * angle)) ^ -1.0)))) ^ 2.0) + (Float64(b * sin(Float64(Float64(pi * angle) / 180.0))) ^ 2.0)) end
function tmp = code(a, b, angle) tmp = ((a * cos((0.005555555555555556 * ((1.0 / (pi * angle)) ^ -1.0)))) ^ 2.0) + ((b * sin(((pi * angle) / 180.0))) ^ 2.0); end
code[a_, b_, angle_] := N[(N[Power[N[(a * N[Cos[N[(0.005555555555555556 * N[Power[N[(1.0 / N[(Pi * angle), $MachinePrecision]), $MachinePrecision], -1.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[(b * N[Sin[N[(N[(Pi * angle), $MachinePrecision] / 180.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
{\left(a \cdot \cos \left(0.005555555555555556 \cdot {\left(\frac{1}{\pi \cdot angle}\right)}^{-1}\right)\right)}^{2} + {\left(b \cdot \sin \left(\frac{\pi \cdot angle}{180}\right)\right)}^{2}
\end{array}
Initial program 82.2%
+-lowering-+.f64N/A
pow-lowering-pow.f64N/A
*-lowering-*.f64N/A
cos-lowering-cos.f64N/A
associate-*r/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
pow-lowering-pow.f64N/A
Simplified82.3%
clear-numN/A
inv-powN/A
div-invN/A
unpow-prod-downN/A
metadata-evalN/A
metadata-evalN/A
*-lowering-*.f64N/A
metadata-evalN/A
pow-lowering-pow.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f6482.4%
Applied egg-rr82.4%
(FPCore (a b angle) :precision binary64 (+ (pow (* a (cos (* PI (/ angle 180.0)))) 2.0) (pow (* b (sin (* 0.005555555555555556 (/ PI (/ 1.0 angle))))) 2.0)))
double code(double a, double b, double angle) {
return pow((a * cos((((double) M_PI) * (angle / 180.0)))), 2.0) + pow((b * sin((0.005555555555555556 * (((double) M_PI) / (1.0 / angle))))), 2.0);
}
public static double code(double a, double b, double angle) {
return Math.pow((a * Math.cos((Math.PI * (angle / 180.0)))), 2.0) + Math.pow((b * Math.sin((0.005555555555555556 * (Math.PI / (1.0 / angle))))), 2.0);
}
def code(a, b, angle): return math.pow((a * math.cos((math.pi * (angle / 180.0)))), 2.0) + math.pow((b * math.sin((0.005555555555555556 * (math.pi / (1.0 / angle))))), 2.0)
function code(a, b, angle) return Float64((Float64(a * cos(Float64(pi * Float64(angle / 180.0)))) ^ 2.0) + (Float64(b * sin(Float64(0.005555555555555556 * Float64(pi / Float64(1.0 / angle))))) ^ 2.0)) end
function tmp = code(a, b, angle) tmp = ((a * cos((pi * (angle / 180.0)))) ^ 2.0) + ((b * sin((0.005555555555555556 * (pi / (1.0 / angle))))) ^ 2.0); end
code[a_, b_, angle_] := N[(N[Power[N[(a * N[Cos[N[(Pi * N[(angle / 180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[(b * N[Sin[N[(0.005555555555555556 * N[(Pi / N[(1.0 / angle), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
{\left(a \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\right)}^{2} + {\left(b \cdot \sin \left(0.005555555555555556 \cdot \frac{\pi}{\frac{1}{angle}}\right)\right)}^{2}
\end{array}
Initial program 82.2%
clear-numN/A
un-div-invN/A
*-un-lft-identityN/A
div-invN/A
times-fracN/A
*-lowering-*.f64N/A
metadata-evalN/A
/-lowering-/.f64N/A
PI-lowering-PI.f64N/A
/-lowering-/.f6482.3%
Applied egg-rr82.3%
(FPCore (a b angle) :precision binary64 (+ (pow (* b (sin (/ (* PI angle) 180.0))) 2.0) (* (+ 0.5 (* 0.5 (cos (* 2.0 (/ PI (/ 180.0 angle)))))) (* a a))))
double code(double a, double b, double angle) {
return pow((b * sin(((((double) M_PI) * angle) / 180.0))), 2.0) + ((0.5 + (0.5 * cos((2.0 * (((double) M_PI) / (180.0 / angle)))))) * (a * a));
}
public static double code(double a, double b, double angle) {
return Math.pow((b * Math.sin(((Math.PI * angle) / 180.0))), 2.0) + ((0.5 + (0.5 * Math.cos((2.0 * (Math.PI / (180.0 / angle)))))) * (a * a));
}
def code(a, b, angle): return math.pow((b * math.sin(((math.pi * angle) / 180.0))), 2.0) + ((0.5 + (0.5 * math.cos((2.0 * (math.pi / (180.0 / angle)))))) * (a * a))
function code(a, b, angle) return Float64((Float64(b * sin(Float64(Float64(pi * angle) / 180.0))) ^ 2.0) + Float64(Float64(0.5 + Float64(0.5 * cos(Float64(2.0 * Float64(pi / Float64(180.0 / angle)))))) * Float64(a * a))) end
function tmp = code(a, b, angle) tmp = ((b * sin(((pi * angle) / 180.0))) ^ 2.0) + ((0.5 + (0.5 * cos((2.0 * (pi / (180.0 / angle)))))) * (a * a)); end
code[a_, b_, angle_] := N[(N[Power[N[(b * N[Sin[N[(N[(Pi * angle), $MachinePrecision] / 180.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + N[(N[(0.5 + N[(0.5 * N[Cos[N[(2.0 * N[(Pi / N[(180.0 / angle), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(a * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
{\left(b \cdot \sin \left(\frac{\pi \cdot angle}{180}\right)\right)}^{2} + \left(0.5 + 0.5 \cdot \cos \left(2 \cdot \frac{\pi}{\frac{180}{angle}}\right)\right) \cdot \left(a \cdot a\right)
\end{array}
Initial program 82.2%
+-lowering-+.f64N/A
pow-lowering-pow.f64N/A
*-lowering-*.f64N/A
cos-lowering-cos.f64N/A
associate-*r/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
pow-lowering-pow.f64N/A
Simplified82.3%
*-commutativeN/A
associate-*r/N/A
unpow-prod-downN/A
*-lowering-*.f64N/A
Applied egg-rr82.3%
Final simplification82.3%
(FPCore (a b angle) :precision binary64 (+ (pow (* b (sin (/ 0.005555555555555556 (/ (/ 1.0 angle) PI)))) 2.0) (* a a)))
double code(double a, double b, double angle) {
return pow((b * sin((0.005555555555555556 / ((1.0 / angle) / ((double) M_PI))))), 2.0) + (a * a);
}
public static double code(double a, double b, double angle) {
return Math.pow((b * Math.sin((0.005555555555555556 / ((1.0 / angle) / Math.PI)))), 2.0) + (a * a);
}
def code(a, b, angle): return math.pow((b * math.sin((0.005555555555555556 / ((1.0 / angle) / math.pi)))), 2.0) + (a * a)
function code(a, b, angle) return Float64((Float64(b * sin(Float64(0.005555555555555556 / Float64(Float64(1.0 / angle) / pi)))) ^ 2.0) + Float64(a * a)) end
function tmp = code(a, b, angle) tmp = ((b * sin((0.005555555555555556 / ((1.0 / angle) / pi)))) ^ 2.0) + (a * a); end
code[a_, b_, angle_] := N[(N[Power[N[(b * N[Sin[N[(0.005555555555555556 / N[(N[(1.0 / angle), $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + N[(a * a), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
{\left(b \cdot \sin \left(\frac{0.005555555555555556}{\frac{\frac{1}{angle}}{\pi}}\right)\right)}^{2} + a \cdot a
\end{array}
Initial program 82.2%
+-lowering-+.f64N/A
pow-lowering-pow.f64N/A
*-lowering-*.f64N/A
cos-lowering-cos.f64N/A
associate-*r/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
pow-lowering-pow.f64N/A
Simplified82.3%
clear-numN/A
inv-powN/A
div-invN/A
unpow-prod-downN/A
metadata-evalN/A
metadata-evalN/A
*-lowering-*.f64N/A
metadata-evalN/A
pow-lowering-pow.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f6482.4%
Applied egg-rr82.4%
clear-numN/A
div-invN/A
associate-/r*N/A
metadata-evalN/A
/-lowering-/.f64N/A
*-commutativeN/A
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
PI-lowering-PI.f6482.5%
Applied egg-rr82.5%
Taylor expanded in angle around 0
unpow2N/A
*-lowering-*.f6481.7%
Simplified81.7%
Final simplification81.7%
(FPCore (a b angle) :precision binary64 (+ (pow (* b (sin (/ (* PI angle) 180.0))) 2.0) (* a a)))
double code(double a, double b, double angle) {
return pow((b * sin(((((double) M_PI) * angle) / 180.0))), 2.0) + (a * a);
}
public static double code(double a, double b, double angle) {
return Math.pow((b * Math.sin(((Math.PI * angle) / 180.0))), 2.0) + (a * a);
}
def code(a, b, angle): return math.pow((b * math.sin(((math.pi * angle) / 180.0))), 2.0) + (a * a)
function code(a, b, angle) return Float64((Float64(b * sin(Float64(Float64(pi * angle) / 180.0))) ^ 2.0) + Float64(a * a)) end
function tmp = code(a, b, angle) tmp = ((b * sin(((pi * angle) / 180.0))) ^ 2.0) + (a * a); end
code[a_, b_, angle_] := N[(N[Power[N[(b * N[Sin[N[(N[(Pi * angle), $MachinePrecision] / 180.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + N[(a * a), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
{\left(b \cdot \sin \left(\frac{\pi \cdot angle}{180}\right)\right)}^{2} + a \cdot a
\end{array}
Initial program 82.2%
+-lowering-+.f64N/A
pow-lowering-pow.f64N/A
*-lowering-*.f64N/A
cos-lowering-cos.f64N/A
associate-*r/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
pow-lowering-pow.f64N/A
Simplified82.3%
Taylor expanded in angle around 0
unpow2N/A
*-lowering-*.f6481.6%
Simplified81.6%
Final simplification81.6%
(FPCore (a b angle) :precision binary64 (+ (* a a) (pow (* b (sin (* PI (/ angle 180.0)))) 2.0)))
double code(double a, double b, double angle) {
return (a * a) + pow((b * sin((((double) M_PI) * (angle / 180.0)))), 2.0);
}
public static double code(double a, double b, double angle) {
return (a * a) + Math.pow((b * Math.sin((Math.PI * (angle / 180.0)))), 2.0);
}
def code(a, b, angle): return (a * a) + math.pow((b * math.sin((math.pi * (angle / 180.0)))), 2.0)
function code(a, b, angle) return Float64(Float64(a * a) + (Float64(b * sin(Float64(pi * Float64(angle / 180.0)))) ^ 2.0)) end
function tmp = code(a, b, angle) tmp = (a * a) + ((b * sin((pi * (angle / 180.0)))) ^ 2.0); end
code[a_, b_, angle_] := N[(N[(a * a), $MachinePrecision] + N[Power[N[(b * N[Sin[N[(Pi * N[(angle / 180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
a \cdot a + {\left(b \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right)}^{2}
\end{array}
Initial program 82.2%
Taylor expanded in angle around 0
unpow2N/A
*-lowering-*.f6481.6%
Simplified81.6%
(FPCore (a b angle)
:precision binary64
(if (<= b 1.08e+154)
(+
(*
(+ 0.5 (* (cos (* (/ PI (/ 1.0 angle)) 0.011111111111111112)) -0.5))
(* b b))
(* a (* a (+ 0.5 0.5))))
(* (* angle b) (* angle (* b (* (* PI PI) 3.08641975308642e-5))))))
double code(double a, double b, double angle) {
double tmp;
if (b <= 1.08e+154) {
tmp = ((0.5 + (cos(((((double) M_PI) / (1.0 / angle)) * 0.011111111111111112)) * -0.5)) * (b * b)) + (a * (a * (0.5 + 0.5)));
} else {
tmp = (angle * b) * (angle * (b * ((((double) M_PI) * ((double) M_PI)) * 3.08641975308642e-5)));
}
return tmp;
}
public static double code(double a, double b, double angle) {
double tmp;
if (b <= 1.08e+154) {
tmp = ((0.5 + (Math.cos(((Math.PI / (1.0 / angle)) * 0.011111111111111112)) * -0.5)) * (b * b)) + (a * (a * (0.5 + 0.5)));
} else {
tmp = (angle * b) * (angle * (b * ((Math.PI * Math.PI) * 3.08641975308642e-5)));
}
return tmp;
}
def code(a, b, angle): tmp = 0 if b <= 1.08e+154: tmp = ((0.5 + (math.cos(((math.pi / (1.0 / angle)) * 0.011111111111111112)) * -0.5)) * (b * b)) + (a * (a * (0.5 + 0.5))) else: tmp = (angle * b) * (angle * (b * ((math.pi * math.pi) * 3.08641975308642e-5))) return tmp
function code(a, b, angle) tmp = 0.0 if (b <= 1.08e+154) tmp = Float64(Float64(Float64(0.5 + Float64(cos(Float64(Float64(pi / Float64(1.0 / angle)) * 0.011111111111111112)) * -0.5)) * Float64(b * b)) + Float64(a * Float64(a * Float64(0.5 + 0.5)))); else tmp = Float64(Float64(angle * b) * Float64(angle * Float64(b * Float64(Float64(pi * pi) * 3.08641975308642e-5)))); end return tmp end
function tmp_2 = code(a, b, angle) tmp = 0.0; if (b <= 1.08e+154) tmp = ((0.5 + (cos(((pi / (1.0 / angle)) * 0.011111111111111112)) * -0.5)) * (b * b)) + (a * (a * (0.5 + 0.5))); else tmp = (angle * b) * (angle * (b * ((pi * pi) * 3.08641975308642e-5))); end tmp_2 = tmp; end
code[a_, b_, angle_] := If[LessEqual[b, 1.08e+154], N[(N[(N[(0.5 + N[(N[Cos[N[(N[(Pi / N[(1.0 / angle), $MachinePrecision]), $MachinePrecision] * 0.011111111111111112), $MachinePrecision]], $MachinePrecision] * -0.5), $MachinePrecision]), $MachinePrecision] * N[(b * b), $MachinePrecision]), $MachinePrecision] + N[(a * N[(a * N[(0.5 + 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(angle * b), $MachinePrecision] * N[(angle * N[(b * N[(N[(Pi * Pi), $MachinePrecision] * 3.08641975308642e-5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq 1.08 \cdot 10^{+154}:\\
\;\;\;\;\left(0.5 + \cos \left(\frac{\pi}{\frac{1}{angle}} \cdot 0.011111111111111112\right) \cdot -0.5\right) \cdot \left(b \cdot b\right) + a \cdot \left(a \cdot \left(0.5 + 0.5\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(angle \cdot b\right) \cdot \left(angle \cdot \left(b \cdot \left(\left(\pi \cdot \pi\right) \cdot 3.08641975308642 \cdot 10^{-5}\right)\right)\right)\\
\end{array}
\end{array}
if b < 1.08e154Initial program 80.0%
+-lowering-+.f64N/A
pow-lowering-pow.f64N/A
*-lowering-*.f64N/A
cos-lowering-cos.f64N/A
associate-*r/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
pow-lowering-pow.f64N/A
Simplified80.0%
*-commutativeN/A
add-sqr-sqrtN/A
associate-*r*N/A
associate-/l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
PI-lowering-PI.f64N/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
PI-lowering-PI.f6480.2%
Applied egg-rr80.2%
Applied egg-rr69.0%
Taylor expanded in angle around 0
Simplified68.3%
if 1.08e154 < b Initial program 99.5%
Taylor expanded in angle around 0
+-commutativeN/A
+-lowering-+.f64N/A
unpow2N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-commutativeN/A
associate-*r*N/A
associate-*r*N/A
distribute-rgt-outN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
PI-lowering-PI.f64N/A
+-lowering-+.f64N/A
Simplified21.5%
Taylor expanded in a around 0
*-commutativeN/A
associate-*r*N/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
associate-*r*N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
PI-lowering-PI.f6450.1%
Simplified50.1%
associate-*l*N/A
associate-*r*N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
PI-lowering-PI.f6476.7%
Applied egg-rr76.7%
Final simplification69.2%
(FPCore (a b angle) :precision binary64 (if (<= b 1.05e+154) (* a (* a (+ 0.5 (* 0.5 (cos (* (* PI angle) 0.011111111111111112)))))) (* (* angle b) (* angle (* b (* (* PI PI) 3.08641975308642e-5))))))
double code(double a, double b, double angle) {
double tmp;
if (b <= 1.05e+154) {
tmp = a * (a * (0.5 + (0.5 * cos(((((double) M_PI) * angle) * 0.011111111111111112)))));
} else {
tmp = (angle * b) * (angle * (b * ((((double) M_PI) * ((double) M_PI)) * 3.08641975308642e-5)));
}
return tmp;
}
public static double code(double a, double b, double angle) {
double tmp;
if (b <= 1.05e+154) {
tmp = a * (a * (0.5 + (0.5 * Math.cos(((Math.PI * angle) * 0.011111111111111112)))));
} else {
tmp = (angle * b) * (angle * (b * ((Math.PI * Math.PI) * 3.08641975308642e-5)));
}
return tmp;
}
def code(a, b, angle): tmp = 0 if b <= 1.05e+154: tmp = a * (a * (0.5 + (0.5 * math.cos(((math.pi * angle) * 0.011111111111111112))))) else: tmp = (angle * b) * (angle * (b * ((math.pi * math.pi) * 3.08641975308642e-5))) return tmp
function code(a, b, angle) tmp = 0.0 if (b <= 1.05e+154) tmp = Float64(a * Float64(a * Float64(0.5 + Float64(0.5 * cos(Float64(Float64(pi * angle) * 0.011111111111111112)))))); else tmp = Float64(Float64(angle * b) * Float64(angle * Float64(b * Float64(Float64(pi * pi) * 3.08641975308642e-5)))); end return tmp end
function tmp_2 = code(a, b, angle) tmp = 0.0; if (b <= 1.05e+154) tmp = a * (a * (0.5 + (0.5 * cos(((pi * angle) * 0.011111111111111112))))); else tmp = (angle * b) * (angle * (b * ((pi * pi) * 3.08641975308642e-5))); end tmp_2 = tmp; end
code[a_, b_, angle_] := If[LessEqual[b, 1.05e+154], N[(a * N[(a * N[(0.5 + N[(0.5 * N[Cos[N[(N[(Pi * angle), $MachinePrecision] * 0.011111111111111112), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(angle * b), $MachinePrecision] * N[(angle * N[(b * N[(N[(Pi * Pi), $MachinePrecision] * 3.08641975308642e-5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq 1.05 \cdot 10^{+154}:\\
\;\;\;\;a \cdot \left(a \cdot \left(0.5 + 0.5 \cdot \cos \left(\left(\pi \cdot angle\right) \cdot 0.011111111111111112\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(angle \cdot b\right) \cdot \left(angle \cdot \left(b \cdot \left(\left(\pi \cdot \pi\right) \cdot 3.08641975308642 \cdot 10^{-5}\right)\right)\right)\\
\end{array}
\end{array}
if b < 1.04999999999999997e154Initial program 80.0%
+-commutativeN/A
unpow-prod-downN/A
*-commutativeN/A
fma-defineN/A
fma-lowering-fma.f64N/A
Applied egg-rr68.9%
Taylor expanded in b around 0
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
cos-lowering-cos.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f6464.8%
Simplified64.8%
if 1.04999999999999997e154 < b Initial program 99.5%
Taylor expanded in angle around 0
+-commutativeN/A
+-lowering-+.f64N/A
unpow2N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-commutativeN/A
associate-*r*N/A
associate-*r*N/A
distribute-rgt-outN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
PI-lowering-PI.f64N/A
+-lowering-+.f64N/A
Simplified21.5%
Taylor expanded in a around 0
*-commutativeN/A
associate-*r*N/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
associate-*r*N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
PI-lowering-PI.f6450.1%
Simplified50.1%
associate-*l*N/A
associate-*r*N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
PI-lowering-PI.f6476.7%
Applied egg-rr76.7%
Final simplification66.1%
(FPCore (a b angle) :precision binary64 (if (<= b 1.46e+153) (* a (* a (+ 0.5 (* 0.5 (cos (* angle (* PI 0.011111111111111112))))))) (* (* angle b) (* angle (* b (* (* PI PI) 3.08641975308642e-5))))))
double code(double a, double b, double angle) {
double tmp;
if (b <= 1.46e+153) {
tmp = a * (a * (0.5 + (0.5 * cos((angle * (((double) M_PI) * 0.011111111111111112))))));
} else {
tmp = (angle * b) * (angle * (b * ((((double) M_PI) * ((double) M_PI)) * 3.08641975308642e-5)));
}
return tmp;
}
public static double code(double a, double b, double angle) {
double tmp;
if (b <= 1.46e+153) {
tmp = a * (a * (0.5 + (0.5 * Math.cos((angle * (Math.PI * 0.011111111111111112))))));
} else {
tmp = (angle * b) * (angle * (b * ((Math.PI * Math.PI) * 3.08641975308642e-5)));
}
return tmp;
}
def code(a, b, angle): tmp = 0 if b <= 1.46e+153: tmp = a * (a * (0.5 + (0.5 * math.cos((angle * (math.pi * 0.011111111111111112)))))) else: tmp = (angle * b) * (angle * (b * ((math.pi * math.pi) * 3.08641975308642e-5))) return tmp
function code(a, b, angle) tmp = 0.0 if (b <= 1.46e+153) tmp = Float64(a * Float64(a * Float64(0.5 + Float64(0.5 * cos(Float64(angle * Float64(pi * 0.011111111111111112))))))); else tmp = Float64(Float64(angle * b) * Float64(angle * Float64(b * Float64(Float64(pi * pi) * 3.08641975308642e-5)))); end return tmp end
function tmp_2 = code(a, b, angle) tmp = 0.0; if (b <= 1.46e+153) tmp = a * (a * (0.5 + (0.5 * cos((angle * (pi * 0.011111111111111112)))))); else tmp = (angle * b) * (angle * (b * ((pi * pi) * 3.08641975308642e-5))); end tmp_2 = tmp; end
code[a_, b_, angle_] := If[LessEqual[b, 1.46e+153], N[(a * N[(a * N[(0.5 + N[(0.5 * N[Cos[N[(angle * N[(Pi * 0.011111111111111112), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(angle * b), $MachinePrecision] * N[(angle * N[(b * N[(N[(Pi * Pi), $MachinePrecision] * 3.08641975308642e-5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq 1.46 \cdot 10^{+153}:\\
\;\;\;\;a \cdot \left(a \cdot \left(0.5 + 0.5 \cdot \cos \left(angle \cdot \left(\pi \cdot 0.011111111111111112\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(angle \cdot b\right) \cdot \left(angle \cdot \left(b \cdot \left(\left(\pi \cdot \pi\right) \cdot 3.08641975308642 \cdot 10^{-5}\right)\right)\right)\\
\end{array}
\end{array}
if b < 1.4600000000000001e153Initial program 80.0%
+-commutativeN/A
unpow-prod-downN/A
*-commutativeN/A
fma-defineN/A
fma-lowering-fma.f64N/A
Applied egg-rr68.9%
sqr-sin-aN/A
sin-multN/A
/-lowering-/.f64N/A
Applied egg-rr69.0%
Taylor expanded in b around 0
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
cos-lowering-cos.f64N/A
*-commutativeN/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f6464.7%
Simplified64.7%
if 1.4600000000000001e153 < b Initial program 99.5%
Taylor expanded in angle around 0
+-commutativeN/A
+-lowering-+.f64N/A
unpow2N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-commutativeN/A
associate-*r*N/A
associate-*r*N/A
distribute-rgt-outN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
PI-lowering-PI.f64N/A
+-lowering-+.f64N/A
Simplified21.5%
Taylor expanded in a around 0
*-commutativeN/A
associate-*r*N/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
associate-*r*N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
PI-lowering-PI.f6450.1%
Simplified50.1%
associate-*l*N/A
associate-*r*N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
PI-lowering-PI.f6476.7%
Applied egg-rr76.7%
(FPCore (a b angle) :precision binary64 (if (<= b 7.5e+152) (* a a) (* (* angle b) (* angle (* b (* (* PI PI) 3.08641975308642e-5))))))
double code(double a, double b, double angle) {
double tmp;
if (b <= 7.5e+152) {
tmp = a * a;
} else {
tmp = (angle * b) * (angle * (b * ((((double) M_PI) * ((double) M_PI)) * 3.08641975308642e-5)));
}
return tmp;
}
public static double code(double a, double b, double angle) {
double tmp;
if (b <= 7.5e+152) {
tmp = a * a;
} else {
tmp = (angle * b) * (angle * (b * ((Math.PI * Math.PI) * 3.08641975308642e-5)));
}
return tmp;
}
def code(a, b, angle): tmp = 0 if b <= 7.5e+152: tmp = a * a else: tmp = (angle * b) * (angle * (b * ((math.pi * math.pi) * 3.08641975308642e-5))) return tmp
function code(a, b, angle) tmp = 0.0 if (b <= 7.5e+152) tmp = Float64(a * a); else tmp = Float64(Float64(angle * b) * Float64(angle * Float64(b * Float64(Float64(pi * pi) * 3.08641975308642e-5)))); end return tmp end
function tmp_2 = code(a, b, angle) tmp = 0.0; if (b <= 7.5e+152) tmp = a * a; else tmp = (angle * b) * (angle * (b * ((pi * pi) * 3.08641975308642e-5))); end tmp_2 = tmp; end
code[a_, b_, angle_] := If[LessEqual[b, 7.5e+152], N[(a * a), $MachinePrecision], N[(N[(angle * b), $MachinePrecision] * N[(angle * N[(b * N[(N[(Pi * Pi), $MachinePrecision] * 3.08641975308642e-5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq 7.5 \cdot 10^{+152}:\\
\;\;\;\;a \cdot a\\
\mathbf{else}:\\
\;\;\;\;\left(angle \cdot b\right) \cdot \left(angle \cdot \left(b \cdot \left(\left(\pi \cdot \pi\right) \cdot 3.08641975308642 \cdot 10^{-5}\right)\right)\right)\\
\end{array}
\end{array}
if b < 7.50000000000000046e152Initial program 80.0%
Taylor expanded in angle around 0
unpow2N/A
*-lowering-*.f6464.0%
Simplified64.0%
if 7.50000000000000046e152 < b Initial program 99.5%
Taylor expanded in angle around 0
+-commutativeN/A
+-lowering-+.f64N/A
unpow2N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-commutativeN/A
associate-*r*N/A
associate-*r*N/A
distribute-rgt-outN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
PI-lowering-PI.f64N/A
+-lowering-+.f64N/A
Simplified21.5%
Taylor expanded in a around 0
*-commutativeN/A
associate-*r*N/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
associate-*r*N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
PI-lowering-PI.f6450.1%
Simplified50.1%
associate-*l*N/A
associate-*r*N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
PI-lowering-PI.f6476.7%
Applied egg-rr76.7%
(FPCore (a b angle) :precision binary64 (if (<= b 1.95e+154) (* a a) (* b (* (* b (* (* PI PI) 3.08641975308642e-5)) (* angle angle)))))
double code(double a, double b, double angle) {
double tmp;
if (b <= 1.95e+154) {
tmp = a * a;
} else {
tmp = b * ((b * ((((double) M_PI) * ((double) M_PI)) * 3.08641975308642e-5)) * (angle * angle));
}
return tmp;
}
public static double code(double a, double b, double angle) {
double tmp;
if (b <= 1.95e+154) {
tmp = a * a;
} else {
tmp = b * ((b * ((Math.PI * Math.PI) * 3.08641975308642e-5)) * (angle * angle));
}
return tmp;
}
def code(a, b, angle): tmp = 0 if b <= 1.95e+154: tmp = a * a else: tmp = b * ((b * ((math.pi * math.pi) * 3.08641975308642e-5)) * (angle * angle)) return tmp
function code(a, b, angle) tmp = 0.0 if (b <= 1.95e+154) tmp = Float64(a * a); else tmp = Float64(b * Float64(Float64(b * Float64(Float64(pi * pi) * 3.08641975308642e-5)) * Float64(angle * angle))); end return tmp end
function tmp_2 = code(a, b, angle) tmp = 0.0; if (b <= 1.95e+154) tmp = a * a; else tmp = b * ((b * ((pi * pi) * 3.08641975308642e-5)) * (angle * angle)); end tmp_2 = tmp; end
code[a_, b_, angle_] := If[LessEqual[b, 1.95e+154], N[(a * a), $MachinePrecision], N[(b * N[(N[(b * N[(N[(Pi * Pi), $MachinePrecision] * 3.08641975308642e-5), $MachinePrecision]), $MachinePrecision] * N[(angle * angle), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq 1.95 \cdot 10^{+154}:\\
\;\;\;\;a \cdot a\\
\mathbf{else}:\\
\;\;\;\;b \cdot \left(\left(b \cdot \left(\left(\pi \cdot \pi\right) \cdot 3.08641975308642 \cdot 10^{-5}\right)\right) \cdot \left(angle \cdot angle\right)\right)\\
\end{array}
\end{array}
if b < 1.9500000000000001e154Initial program 80.0%
Taylor expanded in angle around 0
unpow2N/A
*-lowering-*.f6464.0%
Simplified64.0%
if 1.9500000000000001e154 < b Initial program 99.5%
Taylor expanded in angle around 0
+-commutativeN/A
+-lowering-+.f64N/A
unpow2N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-commutativeN/A
associate-*r*N/A
associate-*r*N/A
distribute-rgt-outN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
PI-lowering-PI.f64N/A
+-lowering-+.f64N/A
Simplified21.5%
Taylor expanded in a around 0
*-commutativeN/A
associate-*r*N/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
associate-*r*N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
PI-lowering-PI.f6450.1%
Simplified50.1%
associate-*l*N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
PI-lowering-PI.f6450.0%
Applied egg-rr50.0%
Final simplification62.4%
(FPCore (a b angle) :precision binary64 (* a a))
double code(double a, double b, double angle) {
return a * a;
}
real(8) function code(a, b, angle)
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: angle
code = a * a
end function
public static double code(double a, double b, double angle) {
return a * a;
}
def code(a, b, angle): return a * a
function code(a, b, angle) return Float64(a * a) end
function tmp = code(a, b, angle) tmp = a * a; end
code[a_, b_, angle_] := N[(a * a), $MachinePrecision]
\begin{array}{l}
\\
a \cdot a
\end{array}
Initial program 82.2%
Taylor expanded in angle around 0
unpow2N/A
*-lowering-*.f6461.6%
Simplified61.6%
herbie shell --seed 2024156
(FPCore (a b angle)
:name "ab-angle->ABCF C"
:precision binary64
(+ (pow (* a (cos (* PI (/ angle 180.0)))) 2.0) (pow (* b (sin (* PI (/ angle 180.0)))) 2.0)))