
(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 7 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) (pow b 2.0)))
double code(double a, double b, double angle) {
return pow((a * sin((1.0 / (180.0 / (angle * ((double) M_PI)))))), 2.0) + pow(b, 2.0);
}
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) + Math.pow(b, 2.0);
}
def code(a, b, angle): return math.pow((a * math.sin((1.0 / (180.0 / (angle * math.pi))))), 2.0) + math.pow(b, 2.0)
function code(a, b, angle) return Float64((Float64(a * sin(Float64(1.0 / Float64(180.0 / Float64(angle * pi))))) ^ 2.0) + (b ^ 2.0)) end
function tmp = code(a, b, angle) tmp = ((a * sin((1.0 / (180.0 / (angle * pi))))) ^ 2.0) + (b ^ 2.0); 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[Power[b, 2.0], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
{\left(a \cdot \sin \left(\frac{1}{\frac{180}{angle \cdot \pi}}\right)\right)}^{2} + {b}^{2}
\end{array}
Initial program 79.2%
associate-*l/79.2%
clear-num79.2%
Applied egg-rr79.2%
Taylor expanded in angle around 0 79.3%
Final simplification79.3%
(FPCore (a b angle) :precision binary64 (if (<= b 1.45e-134) (pow (* a (sin (/ (* PI 0.005555555555555556) (/ 1.0 angle)))) 2.0) (+ (* b b) (pow (* (* angle PI) (* a 0.005555555555555556)) 2.0))))
double code(double a, double b, double angle) {
double tmp;
if (b <= 1.45e-134) {
tmp = pow((a * sin(((((double) M_PI) * 0.005555555555555556) / (1.0 / angle)))), 2.0);
} 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 (b <= 1.45e-134) {
tmp = Math.pow((a * Math.sin(((Math.PI * 0.005555555555555556) / (1.0 / angle)))), 2.0);
} else {
tmp = (b * b) + Math.pow(((angle * Math.PI) * (a * 0.005555555555555556)), 2.0);
}
return tmp;
}
def code(a, b, angle): tmp = 0 if b <= 1.45e-134: tmp = math.pow((a * math.sin(((math.pi * 0.005555555555555556) / (1.0 / angle)))), 2.0) 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 (b <= 1.45e-134) tmp = Float64(a * sin(Float64(Float64(pi * 0.005555555555555556) / Float64(1.0 / angle)))) ^ 2.0; 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 (b <= 1.45e-134) tmp = (a * sin(((pi * 0.005555555555555556) / (1.0 / angle)))) ^ 2.0; else tmp = (b * b) + (((angle * pi) * (a * 0.005555555555555556)) ^ 2.0); end tmp_2 = tmp; end
code[a_, b_, angle_] := If[LessEqual[b, 1.45e-134], N[Power[N[(a * N[Sin[N[(N[(Pi * 0.005555555555555556), $MachinePrecision] / N[(1.0 / angle), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $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}\;b \leq 1.45 \cdot 10^{-134}:\\
\;\;\;\;{\left(a \cdot \sin \left(\frac{\pi \cdot 0.005555555555555556}{\frac{1}{angle}}\right)\right)}^{2}\\
\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 b < 1.44999999999999997e-134Initial program 78.8%
associate-*l/78.8%
associate-/l*78.8%
cos-neg78.8%
distribute-lft-neg-out78.8%
distribute-frac-neg78.8%
distribute-frac-neg78.8%
distribute-lft-neg-out78.8%
cos-neg78.8%
associate-*l/78.7%
associate-/l*78.8%
Simplified78.8%
Taylor expanded in a around inf 49.0%
unpow249.0%
*-commutative49.0%
associate-*r*49.0%
unpow249.0%
swap-sqr52.2%
unpow252.2%
associate-*r*52.2%
*-commutative52.2%
Simplified52.2%
metadata-eval52.2%
associate-/r/52.2%
associate-/r*52.2%
clear-num52.2%
div-inv52.2%
associate-/r*52.3%
div-inv52.3%
metadata-eval52.3%
Applied egg-rr52.3%
if 1.44999999999999997e-134 < b Initial program 79.8%
associate-*l/79.8%
associate-/l*79.7%
cos-neg79.7%
distribute-lft-neg-out79.7%
distribute-frac-neg79.7%
distribute-frac-neg79.7%
distribute-lft-neg-out79.7%
cos-neg79.7%
associate-*l/79.7%
associate-/l*79.6%
Simplified79.6%
Taylor expanded in angle around 0 79.2%
*-rgt-identity79.2%
unpow279.3%
Applied egg-rr79.3%
Taylor expanded in angle around 0 76.0%
associate-*r*76.0%
Simplified76.0%
Final simplification62.3%
(FPCore (a b angle) :precision binary64 (if (<= b 5e-135) (pow (* a (sin (* (* angle PI) 0.005555555555555556))) 2.0) (+ (* b b) (pow (* (* angle PI) (* a 0.005555555555555556)) 2.0))))
double code(double a, double b, double angle) {
double tmp;
if (b <= 5e-135) {
tmp = pow((a * sin(((angle * ((double) M_PI)) * 0.005555555555555556))), 2.0);
} 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 (b <= 5e-135) {
tmp = Math.pow((a * Math.sin(((angle * Math.PI) * 0.005555555555555556))), 2.0);
} else {
tmp = (b * b) + Math.pow(((angle * Math.PI) * (a * 0.005555555555555556)), 2.0);
}
return tmp;
}
def code(a, b, angle): tmp = 0 if b <= 5e-135: tmp = math.pow((a * math.sin(((angle * math.pi) * 0.005555555555555556))), 2.0) 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 (b <= 5e-135) tmp = Float64(a * sin(Float64(Float64(angle * pi) * 0.005555555555555556))) ^ 2.0; 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 (b <= 5e-135) tmp = (a * sin(((angle * pi) * 0.005555555555555556))) ^ 2.0; else tmp = (b * b) + (((angle * pi) * (a * 0.005555555555555556)) ^ 2.0); end tmp_2 = tmp; end
code[a_, b_, angle_] := If[LessEqual[b, 5e-135], N[Power[N[(a * N[Sin[N[(N[(angle * Pi), $MachinePrecision] * 0.005555555555555556), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $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}\;b \leq 5 \cdot 10^{-135}:\\
\;\;\;\;{\left(a \cdot \sin \left(\left(angle \cdot \pi\right) \cdot 0.005555555555555556\right)\right)}^{2}\\
\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 b < 5.0000000000000002e-135Initial program 78.8%
associate-*l/78.8%
associate-/l*78.8%
cos-neg78.8%
distribute-lft-neg-out78.8%
distribute-frac-neg78.8%
distribute-frac-neg78.8%
distribute-lft-neg-out78.8%
cos-neg78.8%
associate-*l/78.7%
associate-/l*78.8%
Simplified78.8%
Taylor expanded in a around inf 49.0%
unpow249.0%
*-commutative49.0%
associate-*r*49.0%
unpow249.0%
swap-sqr52.2%
unpow252.2%
associate-*r*52.2%
*-commutative52.2%
Simplified52.2%
if 5.0000000000000002e-135 < b Initial program 79.8%
associate-*l/79.8%
associate-/l*79.7%
cos-neg79.7%
distribute-lft-neg-out79.7%
distribute-frac-neg79.7%
distribute-frac-neg79.7%
distribute-lft-neg-out79.7%
cos-neg79.7%
associate-*l/79.7%
associate-/l*79.6%
Simplified79.6%
Taylor expanded in angle around 0 79.2%
*-rgt-identity79.2%
unpow279.3%
Applied egg-rr79.3%
Taylor expanded in angle around 0 76.0%
associate-*r*76.0%
Simplified76.0%
Final simplification62.3%
(FPCore (a b angle) :precision binary64 (+ (pow (* a (sin (* angle (/ PI 180.0)))) 2.0) (* b b)))
double code(double a, double b, double angle) {
return pow((a * sin((angle * (((double) M_PI) / 180.0)))), 2.0) + (b * b);
}
public static double code(double a, double b, double angle) {
return Math.pow((a * Math.sin((angle * (Math.PI / 180.0)))), 2.0) + (b * b);
}
def code(a, b, angle): return math.pow((a * math.sin((angle * (math.pi / 180.0)))), 2.0) + (b * b)
function code(a, b, angle) return Float64((Float64(a * sin(Float64(angle * Float64(pi / 180.0)))) ^ 2.0) + Float64(b * b)) end
function tmp = code(a, b, angle) tmp = ((a * sin((angle * (pi / 180.0)))) ^ 2.0) + (b * b); end
code[a_, b_, angle_] := N[(N[Power[N[(a * N[Sin[N[(angle * N[(Pi / 180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + N[(b * b), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
{\left(a \cdot \sin \left(angle \cdot \frac{\pi}{180}\right)\right)}^{2} + b \cdot b
\end{array}
Initial program 79.2%
associate-*l/79.2%
associate-/l*79.2%
cos-neg79.2%
distribute-lft-neg-out79.2%
distribute-frac-neg79.2%
distribute-frac-neg79.2%
distribute-lft-neg-out79.2%
cos-neg79.2%
associate-*l/79.1%
associate-/l*79.1%
Simplified79.1%
Taylor expanded in angle around 0 79.3%
*-rgt-identity79.3%
unpow279.3%
Applied egg-rr79.3%
(FPCore (a b angle) :precision binary64 (if (<= a 1.45e-96) (pow b 2.0) (+ (* b b) (pow (* (* angle PI) (* a 0.005555555555555556)) 2.0))))
double code(double a, double b, double angle) {
double tmp;
if (a <= 1.45e-96) {
tmp = pow(b, 2.0);
} 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 <= 1.45e-96) {
tmp = Math.pow(b, 2.0);
} 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 <= 1.45e-96: tmp = math.pow(b, 2.0) 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 <= 1.45e-96) tmp = b ^ 2.0; 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 <= 1.45e-96) tmp = b ^ 2.0; else tmp = (b * b) + (((angle * pi) * (a * 0.005555555555555556)) ^ 2.0); end tmp_2 = tmp; end
code[a_, b_, angle_] := If[LessEqual[a, 1.45e-96], N[Power[b, 2.0], $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 1.45 \cdot 10^{-96}:\\
\;\;\;\;{b}^{2}\\
\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 < 1.44999999999999997e-96Initial program 78.3%
associate-*l/78.4%
associate-/l*78.4%
cos-neg78.4%
distribute-lft-neg-out78.4%
distribute-frac-neg78.4%
distribute-frac-neg78.4%
distribute-lft-neg-out78.4%
cos-neg78.4%
associate-*l/78.3%
associate-/l*78.3%
Simplified78.3%
Taylor expanded in angle around 0 60.3%
if 1.44999999999999997e-96 < a Initial program 81.1%
associate-*l/81.1%
associate-/l*81.0%
cos-neg81.0%
distribute-lft-neg-out81.0%
distribute-frac-neg81.0%
distribute-frac-neg81.0%
distribute-lft-neg-out81.0%
cos-neg81.0%
associate-*l/80.9%
associate-/l*80.9%
Simplified80.9%
Taylor expanded in angle around 0 80.4%
*-rgt-identity80.4%
unpow280.4%
Applied egg-rr80.4%
Taylor expanded in angle around 0 76.1%
associate-*r*76.2%
Simplified76.2%
Final simplification65.3%
(FPCore (a b angle)
:precision binary64
(if (<= a 1.32e+159)
(pow b 2.0)
(*
(* 0.005555555555555556 (* (* angle PI) (* a 0.005555555555555556)))
(* angle (* a PI)))))
double code(double a, double b, double angle) {
double tmp;
if (a <= 1.32e+159) {
tmp = pow(b, 2.0);
} else {
tmp = (0.005555555555555556 * ((angle * ((double) M_PI)) * (a * 0.005555555555555556))) * (angle * (a * ((double) M_PI)));
}
return tmp;
}
public static double code(double a, double b, double angle) {
double tmp;
if (a <= 1.32e+159) {
tmp = Math.pow(b, 2.0);
} else {
tmp = (0.005555555555555556 * ((angle * Math.PI) * (a * 0.005555555555555556))) * (angle * (a * Math.PI));
}
return tmp;
}
def code(a, b, angle): tmp = 0 if a <= 1.32e+159: tmp = math.pow(b, 2.0) else: tmp = (0.005555555555555556 * ((angle * math.pi) * (a * 0.005555555555555556))) * (angle * (a * math.pi)) return tmp
function code(a, b, angle) tmp = 0.0 if (a <= 1.32e+159) tmp = b ^ 2.0; else tmp = Float64(Float64(0.005555555555555556 * Float64(Float64(angle * pi) * Float64(a * 0.005555555555555556))) * Float64(angle * Float64(a * pi))); end return tmp end
function tmp_2 = code(a, b, angle) tmp = 0.0; if (a <= 1.32e+159) tmp = b ^ 2.0; else tmp = (0.005555555555555556 * ((angle * pi) * (a * 0.005555555555555556))) * (angle * (a * pi)); end tmp_2 = tmp; end
code[a_, b_, angle_] := If[LessEqual[a, 1.32e+159], N[Power[b, 2.0], $MachinePrecision], N[(N[(0.005555555555555556 * N[(N[(angle * Pi), $MachinePrecision] * N[(a * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(angle * N[(a * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq 1.32 \cdot 10^{+159}:\\
\;\;\;\;{b}^{2}\\
\mathbf{else}:\\
\;\;\;\;\left(0.005555555555555556 \cdot \left(\left(angle \cdot \pi\right) \cdot \left(a \cdot 0.005555555555555556\right)\right)\right) \cdot \left(angle \cdot \left(a \cdot \pi\right)\right)\\
\end{array}
\end{array}
if a < 1.32000000000000007e159Initial program 76.9%
associate-*l/76.9%
associate-/l*76.8%
cos-neg76.8%
distribute-lft-neg-out76.8%
distribute-frac-neg76.8%
distribute-frac-neg76.8%
distribute-lft-neg-out76.8%
cos-neg76.8%
associate-*l/76.8%
associate-/l*76.8%
Simplified76.8%
Taylor expanded in angle around 0 60.4%
if 1.32000000000000007e159 < a Initial program 99.6%
associate-*l/99.8%
associate-/l*99.8%
cos-neg99.8%
distribute-lft-neg-out99.8%
distribute-frac-neg99.8%
distribute-frac-neg99.8%
distribute-lft-neg-out99.8%
cos-neg99.8%
associate-*l/99.8%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in a around inf 73.7%
unpow273.7%
*-commutative73.7%
associate-*r*73.7%
unpow273.7%
swap-sqr88.8%
unpow288.8%
associate-*r*88.8%
*-commutative88.8%
Simplified88.8%
Taylor expanded in angle around 0 88.8%
unpow288.8%
associate-*r*88.8%
*-commutative88.8%
*-commutative88.8%
associate-*l*88.8%
*-commutative88.8%
associate-*l*88.8%
Applied egg-rr88.8%
Final simplification63.3%
(FPCore (a b angle) :precision binary64 (* (* a 0.005555555555555556) (* (* angle PI) (* (* angle PI) (* a 0.005555555555555556)))))
double code(double a, double b, double angle) {
return (a * 0.005555555555555556) * ((angle * ((double) M_PI)) * ((angle * ((double) M_PI)) * (a * 0.005555555555555556)));
}
public static double code(double a, double b, double angle) {
return (a * 0.005555555555555556) * ((angle * Math.PI) * ((angle * Math.PI) * (a * 0.005555555555555556)));
}
def code(a, b, angle): return (a * 0.005555555555555556) * ((angle * math.pi) * ((angle * math.pi) * (a * 0.005555555555555556)))
function code(a, b, angle) return Float64(Float64(a * 0.005555555555555556) * Float64(Float64(angle * pi) * Float64(Float64(angle * pi) * Float64(a * 0.005555555555555556)))) end
function tmp = code(a, b, angle) tmp = (a * 0.005555555555555556) * ((angle * pi) * ((angle * pi) * (a * 0.005555555555555556))); end
code[a_, b_, angle_] := N[(N[(a * 0.005555555555555556), $MachinePrecision] * N[(N[(angle * Pi), $MachinePrecision] * N[(N[(angle * Pi), $MachinePrecision] * N[(a * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(a \cdot 0.005555555555555556\right) \cdot \left(\left(angle \cdot \pi\right) \cdot \left(\left(angle \cdot \pi\right) \cdot \left(a \cdot 0.005555555555555556\right)\right)\right)
\end{array}
Initial program 79.2%
associate-*l/79.2%
associate-/l*79.2%
cos-neg79.2%
distribute-lft-neg-out79.2%
distribute-frac-neg79.2%
distribute-frac-neg79.2%
distribute-lft-neg-out79.2%
cos-neg79.2%
associate-*l/79.1%
associate-/l*79.1%
Simplified79.1%
Taylor expanded in a around inf 37.9%
unpow237.9%
*-commutative37.9%
associate-*r*37.9%
unpow237.9%
swap-sqr39.9%
unpow239.9%
associate-*r*39.9%
*-commutative39.9%
Simplified39.9%
Taylor expanded in angle around 0 38.2%
unpow238.2%
associate-*r*38.2%
associate-*l*38.4%
*-commutative38.4%
*-commutative38.4%
associate-*l*38.5%
Applied egg-rr38.5%
Final simplification38.5%
herbie shell --seed 2024145
(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)))