
(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 9 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 (* (/ angle 180.0) PI))) 2.0)
(pow
(*
b
(cos
(* (pow (cbrt angle) 2.0) (* (cbrt angle) (* PI 0.005555555555555556)))))
2.0)))
double code(double a, double b, double angle) {
return pow((a * sin(((angle / 180.0) * ((double) M_PI)))), 2.0) + pow((b * cos((pow(cbrt(angle), 2.0) * (cbrt(angle) * (((double) M_PI) * 0.005555555555555556))))), 2.0);
}
public static double code(double a, double b, double angle) {
return Math.pow((a * Math.sin(((angle / 180.0) * Math.PI))), 2.0) + Math.pow((b * Math.cos((Math.pow(Math.cbrt(angle), 2.0) * (Math.cbrt(angle) * (Math.PI * 0.005555555555555556))))), 2.0);
}
function code(a, b, angle) return Float64((Float64(a * sin(Float64(Float64(angle / 180.0) * pi))) ^ 2.0) + (Float64(b * cos(Float64((cbrt(angle) ^ 2.0) * Float64(cbrt(angle) * Float64(pi * 0.005555555555555556))))) ^ 2.0)) end
code[a_, b_, angle_] := N[(N[Power[N[(a * N[Sin[N[(N[(angle / 180.0), $MachinePrecision] * Pi), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[(b * N[Cos[N[(N[Power[N[Power[angle, 1/3], $MachinePrecision], 2.0], $MachinePrecision] * N[(N[Power[angle, 1/3], $MachinePrecision] * N[(Pi * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \left({\left(\sqrt[3]{angle}\right)}^{2} \cdot \left(\sqrt[3]{angle} \cdot \left(\pi \cdot 0.005555555555555556\right)\right)\right)\right)}^{2}
\end{array}
Initial program 80.0%
add-sqr-sqrt37.4%
pow237.4%
associate-*l/37.5%
associate-*r/37.4%
div-inv37.4%
metadata-eval37.4%
Applied egg-rr37.4%
unpow237.4%
add-sqr-sqrt80.0%
add-cube-cbrt80.1%
associate-*l*80.2%
pow280.2%
Applied egg-rr80.2%
(FPCore (a b angle)
:precision binary64
(+
(pow (* a (sin (* (/ angle 180.0) PI))) 2.0)
(pow
(*
b
(cos (* (cbrt PI) (* (* angle 0.005555555555555556) (pow (cbrt PI) 2.0)))))
2.0)))
double code(double a, double b, double angle) {
return pow((a * sin(((angle / 180.0) * ((double) M_PI)))), 2.0) + pow((b * cos((cbrt(((double) M_PI)) * ((angle * 0.005555555555555556) * pow(cbrt(((double) M_PI)), 2.0))))), 2.0);
}
public static double code(double a, double b, double angle) {
return Math.pow((a * Math.sin(((angle / 180.0) * Math.PI))), 2.0) + Math.pow((b * Math.cos((Math.cbrt(Math.PI) * ((angle * 0.005555555555555556) * Math.pow(Math.cbrt(Math.PI), 2.0))))), 2.0);
}
function code(a, b, angle) return Float64((Float64(a * sin(Float64(Float64(angle / 180.0) * pi))) ^ 2.0) + (Float64(b * cos(Float64(cbrt(pi) * Float64(Float64(angle * 0.005555555555555556) * (cbrt(pi) ^ 2.0))))) ^ 2.0)) end
code[a_, b_, angle_] := N[(N[Power[N[(a * N[Sin[N[(N[(angle / 180.0), $MachinePrecision] * Pi), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[(b * N[Cos[N[(N[Power[Pi, 1/3], $MachinePrecision] * N[(N[(angle * 0.005555555555555556), $MachinePrecision] * N[Power[N[Power[Pi, 1/3], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \left(\sqrt[3]{\pi} \cdot \left(\left(angle \cdot 0.005555555555555556\right) \cdot {\left(\sqrt[3]{\pi}\right)}^{2}\right)\right)\right)}^{2}
\end{array}
Initial program 80.0%
add-sqr-sqrt37.4%
pow237.4%
associate-*l/37.5%
associate-*r/37.4%
div-inv37.4%
metadata-eval37.4%
Applied egg-rr37.4%
unpow237.4%
add-sqr-sqrt80.0%
associate-*r*80.1%
metadata-eval80.1%
div-inv80.1%
associate-*l/80.0%
add-cube-cbrt80.1%
associate-*r*80.1%
div-inv80.2%
metadata-eval80.2%
pow280.2%
Applied egg-rr80.2%
Final simplification80.2%
(FPCore (a b angle) :precision binary64 (+ (pow (* a (sin (* (/ angle 180.0) PI))) 2.0) (pow (* b (cos (expm1 (log1p (* angle (* PI 0.005555555555555556)))))) 2.0)))
double code(double a, double b, double angle) {
return pow((a * sin(((angle / 180.0) * ((double) M_PI)))), 2.0) + pow((b * cos(expm1(log1p((angle * (((double) M_PI) * 0.005555555555555556)))))), 2.0);
}
public static double code(double a, double b, double angle) {
return Math.pow((a * Math.sin(((angle / 180.0) * Math.PI))), 2.0) + Math.pow((b * Math.cos(Math.expm1(Math.log1p((angle * (Math.PI * 0.005555555555555556)))))), 2.0);
}
def code(a, b, angle): return math.pow((a * math.sin(((angle / 180.0) * math.pi))), 2.0) + math.pow((b * math.cos(math.expm1(math.log1p((angle * (math.pi * 0.005555555555555556)))))), 2.0)
function code(a, b, angle) return Float64((Float64(a * sin(Float64(Float64(angle / 180.0) * pi))) ^ 2.0) + (Float64(b * cos(expm1(log1p(Float64(angle * Float64(pi * 0.005555555555555556)))))) ^ 2.0)) end
code[a_, b_, angle_] := N[(N[Power[N[(a * N[Sin[N[(N[(angle / 180.0), $MachinePrecision] * Pi), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[(b * N[Cos[N[(Exp[N[Log[1 + N[(angle * N[(Pi * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]] - 1), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \left(\mathsf{expm1}\left(\mathsf{log1p}\left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right)\right)\right)\right)}^{2}
\end{array}
Initial program 80.0%
expm1-log1p-u65.6%
associate-*l/65.6%
associate-*r/65.6%
div-inv65.6%
metadata-eval65.6%
Applied egg-rr65.6%
(FPCore (a b angle) :precision binary64 (+ (pow (* a (sin (* angle (/ PI 180.0)))) 2.0) (pow (* b (cos (* 0.005555555555555556 (* angle PI)))) 2.0)))
double code(double a, double b, double angle) {
return pow((a * sin((angle * (((double) M_PI) / 180.0)))), 2.0) + pow((b * cos((0.005555555555555556 * (angle * ((double) M_PI))))), 2.0);
}
public static double code(double a, double b, double angle) {
return Math.pow((a * Math.sin((angle * (Math.PI / 180.0)))), 2.0) + Math.pow((b * Math.cos((0.005555555555555556 * (angle * Math.PI)))), 2.0);
}
def code(a, b, angle): return math.pow((a * math.sin((angle * (math.pi / 180.0)))), 2.0) + math.pow((b * math.cos((0.005555555555555556 * (angle * math.pi)))), 2.0)
function code(a, b, angle) return Float64((Float64(a * sin(Float64(angle * Float64(pi / 180.0)))) ^ 2.0) + (Float64(b * cos(Float64(0.005555555555555556 * Float64(angle * pi)))) ^ 2.0)) end
function tmp = code(a, b, angle) tmp = ((a * sin((angle * (pi / 180.0)))) ^ 2.0) + ((b * cos((0.005555555555555556 * (angle * pi)))) ^ 2.0); 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[Power[N[(b * N[Cos[N[(0.005555555555555556 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
{\left(a \cdot \sin \left(angle \cdot \frac{\pi}{180}\right)\right)}^{2} + {\left(b \cdot \cos \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)}^{2}
\end{array}
Initial program 80.0%
associate-*l/80.0%
associate-/l*80.1%
cos-neg80.1%
distribute-lft-neg-out80.1%
distribute-frac-neg80.1%
distribute-frac-neg80.1%
distribute-lft-neg-out80.1%
cos-neg80.1%
associate-*l/80.1%
associate-/l*80.0%
Simplified80.0%
Taylor expanded in angle around inf 80.1%
(FPCore (a b angle) :precision binary64 (+ (pow (* a (sin (* angle (/ PI 180.0)))) 2.0) (pow b 2.0)))
double code(double a, double b, double angle) {
return pow((a * sin((angle * (((double) M_PI) / 180.0)))), 2.0) + pow(b, 2.0);
}
public static double code(double a, double b, double angle) {
return Math.pow((a * Math.sin((angle * (Math.PI / 180.0)))), 2.0) + Math.pow(b, 2.0);
}
def code(a, b, angle): return math.pow((a * math.sin((angle * (math.pi / 180.0)))), 2.0) + math.pow(b, 2.0)
function code(a, b, angle) return Float64((Float64(a * sin(Float64(angle * Float64(pi / 180.0)))) ^ 2.0) + (b ^ 2.0)) end
function tmp = code(a, b, angle) tmp = ((a * sin((angle * (pi / 180.0)))) ^ 2.0) + (b ^ 2.0); 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[Power[b, 2.0], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
{\left(a \cdot \sin \left(angle \cdot \frac{\pi}{180}\right)\right)}^{2} + {b}^{2}
\end{array}
Initial program 80.0%
associate-*l/80.0%
associate-/l*80.1%
cos-neg80.1%
distribute-lft-neg-out80.1%
distribute-frac-neg80.1%
distribute-frac-neg80.1%
distribute-lft-neg-out80.1%
cos-neg80.1%
associate-*l/80.1%
associate-/l*80.0%
Simplified80.0%
Taylor expanded in angle around 0 80.1%
Final simplification80.1%
(FPCore (a b angle) :precision binary64 (+ (pow b 2.0) (pow (* a (sin (* 0.005555555555555556 (* angle PI)))) 2.0)))
double code(double a, double b, double angle) {
return pow(b, 2.0) + pow((a * sin((0.005555555555555556 * (angle * ((double) M_PI))))), 2.0);
}
public static double code(double a, double b, double angle) {
return Math.pow(b, 2.0) + Math.pow((a * Math.sin((0.005555555555555556 * (angle * Math.PI)))), 2.0);
}
def code(a, b, angle): return math.pow(b, 2.0) + math.pow((a * math.sin((0.005555555555555556 * (angle * math.pi)))), 2.0)
function code(a, b, angle) return Float64((b ^ 2.0) + (Float64(a * sin(Float64(0.005555555555555556 * Float64(angle * pi)))) ^ 2.0)) end
function tmp = code(a, b, angle) tmp = (b ^ 2.0) + ((a * sin((0.005555555555555556 * (angle * pi)))) ^ 2.0); end
code[a_, b_, angle_] := N[(N[Power[b, 2.0], $MachinePrecision] + N[Power[N[(a * N[Sin[N[(0.005555555555555556 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
{b}^{2} + {\left(a \cdot \sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)}^{2}
\end{array}
Initial program 80.0%
associate-*l/80.0%
associate-/l*80.1%
cos-neg80.1%
distribute-lft-neg-out80.1%
distribute-frac-neg80.1%
distribute-frac-neg80.1%
distribute-lft-neg-out80.1%
cos-neg80.1%
associate-*l/80.1%
associate-/l*80.0%
Simplified80.0%
Taylor expanded in angle around 0 80.1%
Taylor expanded in angle around inf 80.1%
Final simplification80.1%
(FPCore (a b angle) :precision binary64 (+ (pow b 2.0) (* 0.005555555555555556 (* (* angle (* 0.005555555555555556 (* a PI))) (* angle (* a PI))))))
double code(double a, double b, double angle) {
return pow(b, 2.0) + (0.005555555555555556 * ((angle * (0.005555555555555556 * (a * ((double) M_PI)))) * (angle * (a * ((double) M_PI)))));
}
public static double code(double a, double b, double angle) {
return Math.pow(b, 2.0) + (0.005555555555555556 * ((angle * (0.005555555555555556 * (a * Math.PI))) * (angle * (a * Math.PI))));
}
def code(a, b, angle): return math.pow(b, 2.0) + (0.005555555555555556 * ((angle * (0.005555555555555556 * (a * math.pi))) * (angle * (a * math.pi))))
function code(a, b, angle) return Float64((b ^ 2.0) + Float64(0.005555555555555556 * Float64(Float64(angle * Float64(0.005555555555555556 * Float64(a * pi))) * Float64(angle * Float64(a * pi))))) end
function tmp = code(a, b, angle) tmp = (b ^ 2.0) + (0.005555555555555556 * ((angle * (0.005555555555555556 * (a * pi))) * (angle * (a * pi)))); end
code[a_, b_, angle_] := N[(N[Power[b, 2.0], $MachinePrecision] + N[(0.005555555555555556 * N[(N[(angle * N[(0.005555555555555556 * N[(a * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(angle * N[(a * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
{b}^{2} + 0.005555555555555556 \cdot \left(\left(angle \cdot \left(0.005555555555555556 \cdot \left(a \cdot \pi\right)\right)\right) \cdot \left(angle \cdot \left(a \cdot \pi\right)\right)\right)
\end{array}
Initial program 80.0%
associate-*l/80.0%
associate-/l*80.1%
cos-neg80.1%
distribute-lft-neg-out80.1%
distribute-frac-neg80.1%
distribute-frac-neg80.1%
distribute-lft-neg-out80.1%
cos-neg80.1%
associate-*l/80.1%
associate-/l*80.0%
Simplified80.0%
Taylor expanded in angle around 0 80.1%
Taylor expanded in angle around 0 75.1%
*-commutative75.1%
Simplified75.1%
unpow275.1%
*-commutative75.1%
associate-*r*75.1%
*-commutative75.1%
associate-*l*75.1%
associate-*l*75.1%
associate-*l*75.1%
Applied egg-rr75.1%
Final simplification75.1%
(FPCore (a b angle) :precision binary64 (+ (pow b 2.0) (* (* angle (* a PI)) (* 0.005555555555555556 (* angle (* 0.005555555555555556 (* a PI)))))))
double code(double a, double b, double angle) {
return pow(b, 2.0) + ((angle * (a * ((double) M_PI))) * (0.005555555555555556 * (angle * (0.005555555555555556 * (a * ((double) M_PI))))));
}
public static double code(double a, double b, double angle) {
return Math.pow(b, 2.0) + ((angle * (a * Math.PI)) * (0.005555555555555556 * (angle * (0.005555555555555556 * (a * Math.PI)))));
}
def code(a, b, angle): return math.pow(b, 2.0) + ((angle * (a * math.pi)) * (0.005555555555555556 * (angle * (0.005555555555555556 * (a * math.pi)))))
function code(a, b, angle) return Float64((b ^ 2.0) + Float64(Float64(angle * Float64(a * pi)) * Float64(0.005555555555555556 * Float64(angle * Float64(0.005555555555555556 * Float64(a * pi)))))) end
function tmp = code(a, b, angle) tmp = (b ^ 2.0) + ((angle * (a * pi)) * (0.005555555555555556 * (angle * (0.005555555555555556 * (a * pi))))); end
code[a_, b_, angle_] := N[(N[Power[b, 2.0], $MachinePrecision] + N[(N[(angle * N[(a * Pi), $MachinePrecision]), $MachinePrecision] * N[(0.005555555555555556 * N[(angle * N[(0.005555555555555556 * N[(a * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
{b}^{2} + \left(angle \cdot \left(a \cdot \pi\right)\right) \cdot \left(0.005555555555555556 \cdot \left(angle \cdot \left(0.005555555555555556 \cdot \left(a \cdot \pi\right)\right)\right)\right)
\end{array}
Initial program 80.0%
associate-*l/80.0%
associate-/l*80.1%
cos-neg80.1%
distribute-lft-neg-out80.1%
distribute-frac-neg80.1%
distribute-frac-neg80.1%
distribute-lft-neg-out80.1%
cos-neg80.1%
associate-*l/80.1%
associate-/l*80.0%
Simplified80.0%
Taylor expanded in angle around 0 80.1%
Taylor expanded in angle around 0 75.1%
*-commutative75.1%
Simplified75.1%
unpow275.1%
associate-*r*75.1%
*-commutative75.1%
associate-*l*75.1%
associate-*l*75.1%
associate-*l*75.1%
Applied egg-rr75.1%
Final simplification75.1%
(FPCore (a b angle) :precision binary64 (let* ((t_0 (* angle (* 0.005555555555555556 (* a PI))))) (+ (pow b 2.0) (* t_0 t_0))))
double code(double a, double b, double angle) {
double t_0 = angle * (0.005555555555555556 * (a * ((double) M_PI)));
return pow(b, 2.0) + (t_0 * t_0);
}
public static double code(double a, double b, double angle) {
double t_0 = angle * (0.005555555555555556 * (a * Math.PI));
return Math.pow(b, 2.0) + (t_0 * t_0);
}
def code(a, b, angle): t_0 = angle * (0.005555555555555556 * (a * math.pi)) return math.pow(b, 2.0) + (t_0 * t_0)
function code(a, b, angle) t_0 = Float64(angle * Float64(0.005555555555555556 * Float64(a * pi))) return Float64((b ^ 2.0) + Float64(t_0 * t_0)) end
function tmp = code(a, b, angle) t_0 = angle * (0.005555555555555556 * (a * pi)); tmp = (b ^ 2.0) + (t_0 * t_0); end
code[a_, b_, angle_] := Block[{t$95$0 = N[(angle * N[(0.005555555555555556 * N[(a * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, N[(N[Power[b, 2.0], $MachinePrecision] + N[(t$95$0 * t$95$0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := angle \cdot \left(0.005555555555555556 \cdot \left(a \cdot \pi\right)\right)\\
{b}^{2} + t\_0 \cdot t\_0
\end{array}
\end{array}
Initial program 80.0%
associate-*l/80.0%
associate-/l*80.1%
cos-neg80.1%
distribute-lft-neg-out80.1%
distribute-frac-neg80.1%
distribute-frac-neg80.1%
distribute-lft-neg-out80.1%
cos-neg80.1%
associate-*l/80.1%
associate-/l*80.0%
Simplified80.0%
Taylor expanded in angle around 0 80.1%
Taylor expanded in angle around 0 75.1%
*-commutative75.1%
Simplified75.1%
unpow275.1%
*-commutative75.1%
associate-*l*75.1%
associate-*l*75.1%
*-commutative75.1%
associate-*l*75.1%
associate-*l*75.1%
Applied egg-rr75.1%
Final simplification75.1%
herbie shell --seed 2024108
(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)))