
(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 18 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 (* PI (* angle 0.005555555555555556))) 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((((double) M_PI) * (angle * 0.005555555555555556))), 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((Math.PI * (angle * 0.005555555555555556))), 2.0) * Math.cbrt((angle * (Math.PI * 0.005555555555555556)))))), 2.0);
}
function code(a, b, angle) return Float64((Float64(a * sin(Float64(angle / Float64(180.0 / pi)))) ^ 2.0) + (Float64(b * cos(Float64((cbrt(Float64(pi * Float64(angle * 0.005555555555555556))) ^ 2.0) * cbrt(Float64(angle * Float64(pi * 0.005555555555555556)))))) ^ 2.0)) end
code[a_, b_, angle_] := N[(N[Power[N[(a * N[Sin[N[(angle / N[(180.0 / Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[(b * N[Cos[N[(N[Power[N[Power[N[(Pi * N[(angle * 0.005555555555555556), $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision], 2.0], $MachinePrecision] * N[Power[N[(angle * N[(Pi * 0.005555555555555556), $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
{\left(a \cdot \sin \left(\frac{angle}{\frac{180}{\pi}}\right)\right)}^{2} + {\left(b \cdot \cos \left({\left(\sqrt[3]{\pi \cdot \left(angle \cdot 0.005555555555555556\right)}\right)}^{2} \cdot \sqrt[3]{angle \cdot \left(\pi \cdot 0.005555555555555556\right)}\right)\right)}^{2}
\end{array}
Initial program 80.5%
associate-/r/80.6%
associate-/r/80.7%
Simplified80.7%
associate-/r/80.6%
add-cube-cbrt80.7%
pow280.7%
associate-*l/80.7%
div-inv80.7%
associate-*r*80.7%
metadata-eval80.7%
associate-*l/80.7%
div-inv80.7%
associate-*r*80.7%
metadata-eval80.7%
Applied egg-rr80.7%
expm1-log1p-u66.4%
expm1-udef66.4%
Applied egg-rr66.4%
expm1-def66.4%
expm1-log1p80.8%
*-commutative80.8%
Simplified80.8%
Final simplification80.8%
(FPCore (a b angle)
:precision binary64
(let* ((t_0 (cbrt (* angle (* PI 0.005555555555555556)))))
(+
(pow (* a (sin (/ angle (/ 180.0 PI)))) 2.0)
(pow (* b (cos (* t_0 (pow t_0 2.0)))) 2.0))))
double code(double a, double b, double angle) {
double t_0 = cbrt((angle * (((double) M_PI) * 0.005555555555555556)));
return pow((a * sin((angle / (180.0 / ((double) M_PI))))), 2.0) + pow((b * cos((t_0 * pow(t_0, 2.0)))), 2.0);
}
public static double code(double a, double b, double angle) {
double t_0 = Math.cbrt((angle * (Math.PI * 0.005555555555555556)));
return Math.pow((a * Math.sin((angle / (180.0 / Math.PI)))), 2.0) + Math.pow((b * Math.cos((t_0 * Math.pow(t_0, 2.0)))), 2.0);
}
function code(a, b, angle) t_0 = cbrt(Float64(angle * Float64(pi * 0.005555555555555556))) return Float64((Float64(a * sin(Float64(angle / Float64(180.0 / pi)))) ^ 2.0) + (Float64(b * cos(Float64(t_0 * (t_0 ^ 2.0)))) ^ 2.0)) end
code[a_, b_, angle_] := Block[{t$95$0 = N[Power[N[(angle * N[(Pi * 0.005555555555555556), $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision]}, N[(N[Power[N[(a * N[Sin[N[(angle / N[(180.0 / Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[(b * N[Cos[N[(t$95$0 * N[Power[t$95$0, 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt[3]{angle \cdot \left(\pi \cdot 0.005555555555555556\right)}\\
{\left(a \cdot \sin \left(\frac{angle}{\frac{180}{\pi}}\right)\right)}^{2} + {\left(b \cdot \cos \left(t_0 \cdot {t_0}^{2}\right)\right)}^{2}
\end{array}
\end{array}
Initial program 80.5%
associate-/r/80.6%
associate-/r/80.7%
Simplified80.7%
associate-/r/80.6%
add-cube-cbrt80.7%
pow280.7%
associate-*l/80.7%
div-inv80.7%
associate-*r*80.7%
metadata-eval80.7%
associate-*l/80.7%
div-inv80.7%
associate-*r*80.7%
metadata-eval80.7%
Applied egg-rr80.7%
Final simplification80.7%
(FPCore (a b angle)
:precision binary64
(+
(pow (* a (sin (/ angle (/ 180.0 PI)))) 2.0)
(pow
(*
b
(cos
(*
angle
(*
(cbrt -0.005555555555555556)
(* PI (pow (cbrt 0.005555555555555556) 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((angle * (cbrt(-0.005555555555555556) * (((double) M_PI) * pow(cbrt(0.005555555555555556), 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((angle * (Math.cbrt(-0.005555555555555556) * (Math.PI * Math.pow(Math.cbrt(0.005555555555555556), 2.0)))))), 2.0);
}
function code(a, b, angle) return Float64((Float64(a * sin(Float64(angle / Float64(180.0 / pi)))) ^ 2.0) + (Float64(b * cos(Float64(angle * Float64(cbrt(-0.005555555555555556) * Float64(pi * (cbrt(0.005555555555555556) ^ 2.0)))))) ^ 2.0)) end
code[a_, b_, angle_] := N[(N[Power[N[(a * N[Sin[N[(angle / N[(180.0 / Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[(b * N[Cos[N[(angle * N[(N[Power[-0.005555555555555556, 1/3], $MachinePrecision] * N[(Pi * N[Power[N[Power[0.005555555555555556, 1/3], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
{\left(a \cdot \sin \left(\frac{angle}{\frac{180}{\pi}}\right)\right)}^{2} + {\left(b \cdot \cos \left(angle \cdot \left(\sqrt[3]{-0.005555555555555556} \cdot \left(\pi \cdot {\left(\sqrt[3]{0.005555555555555556}\right)}^{2}\right)\right)\right)\right)}^{2}
\end{array}
Initial program 80.5%
associate-/r/80.6%
associate-/r/80.7%
Simplified80.7%
associate-/r/80.6%
add-cube-cbrt80.7%
pow280.7%
associate-*l/80.7%
div-inv80.7%
associate-*r*80.7%
metadata-eval80.7%
associate-*l/80.7%
div-inv80.7%
associate-*r*80.7%
metadata-eval80.7%
Applied egg-rr80.7%
cbrt-prod80.6%
add-sqr-sqrt34.5%
associate-*l*34.5%
pow1/334.4%
sqrt-pow134.4%
metadata-eval34.4%
pow1/334.4%
sqrt-pow134.4%
metadata-eval34.4%
Applied egg-rr34.4%
Taylor expanded in angle around -inf 80.7%
mul-1-neg80.7%
cos-neg80.7%
pow-base-180.7%
*-lft-identity80.7%
*-commutative80.7%
associate-*l*80.7%
Simplified80.7%
Final simplification80.7%
(FPCore (a b angle) :precision binary64 (+ (pow (* a (sin (/ angle (/ 180.0 PI)))) 2.0) (pow (* b (cos (* (/ (sqrt angle) 180.0) (/ (sqrt angle) (/ 1.0 PI))))) 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(((sqrt(angle) / 180.0) * (sqrt(angle) / (1.0 / ((double) M_PI)))))), 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.sqrt(angle) / 180.0) * (Math.sqrt(angle) / (1.0 / Math.PI))))), 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.sqrt(angle) / 180.0) * (math.sqrt(angle) / (1.0 / math.pi))))), 2.0)
function code(a, b, angle) return Float64((Float64(a * sin(Float64(angle / Float64(180.0 / pi)))) ^ 2.0) + (Float64(b * cos(Float64(Float64(sqrt(angle) / 180.0) * Float64(sqrt(angle) / Float64(1.0 / pi))))) ^ 2.0)) end
function tmp = code(a, b, angle) tmp = ((a * sin((angle / (180.0 / pi)))) ^ 2.0) + ((b * cos(((sqrt(angle) / 180.0) * (sqrt(angle) / (1.0 / pi))))) ^ 2.0); end
code[a_, b_, angle_] := N[(N[Power[N[(a * N[Sin[N[(angle / N[(180.0 / Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[(b * N[Cos[N[(N[(N[Sqrt[angle], $MachinePrecision] / 180.0), $MachinePrecision] * N[(N[Sqrt[angle], $MachinePrecision] / N[(1.0 / Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
{\left(a \cdot \sin \left(\frac{angle}{\frac{180}{\pi}}\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{\sqrt{angle}}{180} \cdot \frac{\sqrt{angle}}{\frac{1}{\pi}}\right)\right)}^{2}
\end{array}
Initial program 80.5%
associate-/r/80.6%
associate-/r/80.7%
Simplified80.7%
add-sqr-sqrt34.4%
div-inv34.4%
times-frac34.5%
Applied egg-rr34.5%
Final simplification34.5%
(FPCore (a b angle) :precision binary64 (let* ((t_0 (* angle (/ PI 180.0)))) (+ (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 * (((double) M_PI) / 180.0);
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 * (Math.PI / 180.0);
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 * (math.pi / 180.0) 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(angle * Float64(pi / 180.0)) 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 * (pi / 180.0); tmp = ((a * sin(t_0)) ^ 2.0) + ((b * cos(t_0)) ^ 2.0); end
code[a_, b_, angle_] := Block[{t$95$0 = N[(angle * N[(Pi / 180.0), $MachinePrecision]), $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 := angle \cdot \frac{\pi}{180}\\
{\left(a \cdot \sin t_0\right)}^{2} + {\left(b \cdot \cos t_0\right)}^{2}
\end{array}
\end{array}
Initial program 80.5%
*-commutative80.5%
associate-*r/80.5%
associate-*l/80.6%
*-commutative80.6%
*-commutative80.6%
associate-*r/80.6%
associate-*l/80.6%
*-commutative80.6%
Simplified80.6%
Final simplification80.6%
(FPCore (a b angle) :precision binary64 (+ (pow (* a (sin (* PI (/ angle 180.0)))) 2.0) (pow (* b (cos (/ PI (/ 180.0 angle)))) 2.0)))
double code(double a, double b, double angle) {
return pow((a * sin((((double) M_PI) * (angle / 180.0)))), 2.0) + pow((b * cos((((double) M_PI) / (180.0 / angle)))), 2.0);
}
public static double code(double a, double b, double angle) {
return Math.pow((a * Math.sin((Math.PI * (angle / 180.0)))), 2.0) + Math.pow((b * Math.cos((Math.PI / (180.0 / angle)))), 2.0);
}
def code(a, b, angle): return math.pow((a * math.sin((math.pi * (angle / 180.0)))), 2.0) + math.pow((b * math.cos((math.pi / (180.0 / angle)))), 2.0)
function code(a, b, angle) return Float64((Float64(a * sin(Float64(pi * Float64(angle / 180.0)))) ^ 2.0) + (Float64(b * cos(Float64(pi / Float64(180.0 / angle)))) ^ 2.0)) end
function tmp = code(a, b, angle) tmp = ((a * sin((pi * (angle / 180.0)))) ^ 2.0) + ((b * cos((pi / (180.0 / angle)))) ^ 2.0); end
code[a_, b_, angle_] := N[(N[Power[N[(a * N[Sin[N[(Pi * N[(angle / 180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[(b * N[Cos[N[(Pi / N[(180.0 / angle), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
{\left(a \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{\pi}{\frac{180}{angle}}\right)\right)}^{2}
\end{array}
Initial program 80.5%
*-commutative80.5%
clear-num80.6%
un-div-inv80.6%
Applied egg-rr80.6%
Final simplification80.6%
(FPCore (a b angle) :precision binary64 (+ (pow (* a (sin (/ angle (/ 180.0 PI)))) 2.0) (pow (* b (cos (* 0.005555555555555556 (* angle PI)))) 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((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 / (180.0 / Math.PI)))), 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 / (180.0 / math.pi)))), 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(180.0 / pi)))) ^ 2.0) + (Float64(b * cos(Float64(0.005555555555555556 * Float64(angle * pi)))) ^ 2.0)) end
function tmp = code(a, b, angle) tmp = ((a * sin((angle / (180.0 / pi)))) ^ 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[(180.0 / Pi), $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(\frac{angle}{\frac{180}{\pi}}\right)\right)}^{2} + {\left(b \cdot \cos \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)}^{2}
\end{array}
Initial program 80.5%
associate-/r/80.6%
associate-/r/80.7%
Simplified80.7%
associate-/l*80.7%
div-inv80.6%
metadata-eval80.6%
Applied egg-rr80.6%
Final simplification80.6%
(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(angle / Float64(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[(angle / N[(180.0 / Pi), $MachinePrecision]), $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}{\frac{180}{\pi}}\\
{\left(a \cdot \sin t_0\right)}^{2} + {\left(b \cdot \cos t_0\right)}^{2}
\end{array}
\end{array}
Initial program 80.5%
associate-/r/80.6%
associate-/r/80.7%
Simplified80.7%
Final simplification80.7%
(FPCore (a b angle) :precision binary64 (+ (pow (* a (sin (* (sqrt angle) (* (* PI 0.005555555555555556) (sqrt angle))))) 2.0) (pow b 2.0)))
double code(double a, double b, double angle) {
return pow((a * sin((sqrt(angle) * ((((double) M_PI) * 0.005555555555555556) * sqrt(angle))))), 2.0) + pow(b, 2.0);
}
public static double code(double a, double b, double angle) {
return Math.pow((a * Math.sin((Math.sqrt(angle) * ((Math.PI * 0.005555555555555556) * Math.sqrt(angle))))), 2.0) + Math.pow(b, 2.0);
}
def code(a, b, angle): return math.pow((a * math.sin((math.sqrt(angle) * ((math.pi * 0.005555555555555556) * math.sqrt(angle))))), 2.0) + math.pow(b, 2.0)
function code(a, b, angle) return Float64((Float64(a * sin(Float64(sqrt(angle) * Float64(Float64(pi * 0.005555555555555556) * sqrt(angle))))) ^ 2.0) + (b ^ 2.0)) end
function tmp = code(a, b, angle) tmp = ((a * sin((sqrt(angle) * ((pi * 0.005555555555555556) * sqrt(angle))))) ^ 2.0) + (b ^ 2.0); end
code[a_, b_, angle_] := N[(N[Power[N[(a * N[Sin[N[(N[Sqrt[angle], $MachinePrecision] * N[(N[(Pi * 0.005555555555555556), $MachinePrecision] * N[Sqrt[angle], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[b, 2.0], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
{\left(a \cdot \sin \left(\sqrt{angle} \cdot \left(\left(\pi \cdot 0.005555555555555556\right) \cdot \sqrt{angle}\right)\right)\right)}^{2} + {b}^{2}
\end{array}
Initial program 80.5%
*-commutative80.5%
associate-*r/80.5%
associate-*l/80.6%
*-commutative80.6%
*-commutative80.6%
associate-*r/80.6%
associate-*l/80.6%
*-commutative80.6%
Simplified80.6%
Taylor expanded in angle around 0 80.3%
div-inv80.3%
metadata-eval80.3%
add-cube-cbrt80.0%
unpow280.0%
rem-cube-cbrt80.0%
unpow280.0%
add-cube-cbrt80.1%
associate-*r*80.1%
*-commutative80.1%
associate-*r*80.1%
Applied egg-rr80.1%
rem-cube-cbrt80.2%
*-commutative80.2%
associate-*r*80.3%
add-sqr-sqrt34.1%
associate-*r*34.1%
Applied egg-rr34.1%
Final simplification34.1%
(FPCore (a b angle) :precision binary64 (if (<= a 2.05e-109) (+ (pow (* a 0.0) 2.0) (pow (* b (cos (* PI (/ angle 180.0)))) 2.0)) (+ (pow b 2.0) (pow (* (* angle PI) (* a 0.005555555555555556)) 2.0))))
double code(double a, double b, double angle) {
double tmp;
if (a <= 2.05e-109) {
tmp = pow((a * 0.0), 2.0) + pow((b * cos((((double) M_PI) * (angle / 180.0)))), 2.0);
} else {
tmp = pow(b, 2.0) + 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 <= 2.05e-109) {
tmp = Math.pow((a * 0.0), 2.0) + Math.pow((b * Math.cos((Math.PI * (angle / 180.0)))), 2.0);
} else {
tmp = Math.pow(b, 2.0) + Math.pow(((angle * Math.PI) * (a * 0.005555555555555556)), 2.0);
}
return tmp;
}
def code(a, b, angle): tmp = 0 if a <= 2.05e-109: tmp = math.pow((a * 0.0), 2.0) + math.pow((b * math.cos((math.pi * (angle / 180.0)))), 2.0) else: tmp = math.pow(b, 2.0) + math.pow(((angle * math.pi) * (a * 0.005555555555555556)), 2.0) return tmp
function code(a, b, angle) tmp = 0.0 if (a <= 2.05e-109) tmp = Float64((Float64(a * 0.0) ^ 2.0) + (Float64(b * cos(Float64(pi * Float64(angle / 180.0)))) ^ 2.0)); else tmp = Float64((b ^ 2.0) + (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 <= 2.05e-109) tmp = ((a * 0.0) ^ 2.0) + ((b * cos((pi * (angle / 180.0)))) ^ 2.0); else tmp = (b ^ 2.0) + (((angle * pi) * (a * 0.005555555555555556)) ^ 2.0); end tmp_2 = tmp; end
code[a_, b_, angle_] := If[LessEqual[a, 2.05e-109], N[(N[Power[N[(a * 0.0), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[(b * N[Cos[N[(Pi * N[(angle / 180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision], N[(N[Power[b, 2.0], $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 2.05 \cdot 10^{-109}:\\
\;\;\;\;{\left(a \cdot 0\right)}^{2} + {\left(b \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\right)}^{2}\\
\mathbf{else}:\\
\;\;\;\;{b}^{2} + {\left(\left(angle \cdot \pi\right) \cdot \left(a \cdot 0.005555555555555556\right)\right)}^{2}\\
\end{array}
\end{array}
if a < 2.0500000000000001e-109Initial program 81.7%
add-cube-cbrt81.5%
pow381.6%
associate-*l/81.6%
div-inv81.6%
associate-*r*81.6%
metadata-eval81.6%
Applied egg-rr81.6%
Taylor expanded in angle around 0 66.2%
if 2.0500000000000001e-109 < a Initial program 78.0%
*-commutative78.0%
associate-*r/77.9%
associate-*l/77.9%
*-commutative77.9%
*-commutative77.9%
associate-*r/77.9%
associate-*l/77.9%
*-commutative77.9%
Simplified77.9%
Taylor expanded in angle around 0 77.8%
Taylor expanded in angle around 0 73.0%
associate-*r*73.1%
*-commutative73.1%
Simplified73.1%
Final simplification68.3%
(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.5%
*-commutative80.5%
associate-*r/80.5%
associate-*l/80.6%
*-commutative80.6%
*-commutative80.6%
associate-*r/80.6%
associate-*l/80.6%
*-commutative80.6%
Simplified80.6%
Taylor expanded in angle around 0 80.3%
Taylor expanded in angle around inf 80.2%
Final simplification80.2%
(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.5%
*-commutative80.5%
associate-*r/80.5%
associate-*l/80.6%
*-commutative80.6%
*-commutative80.6%
associate-*r/80.6%
associate-*l/80.6%
*-commutative80.6%
Simplified80.6%
Taylor expanded in angle around 0 80.3%
Final simplification80.3%
(FPCore (a b angle) :precision binary64 (+ (pow b 2.0) (pow (* a (sin (/ PI (/ 180.0 angle)))) 2.0)))
double code(double a, double b, double angle) {
return pow(b, 2.0) + pow((a * sin((((double) M_PI) / (180.0 / angle)))), 2.0);
}
public static double code(double a, double b, double angle) {
return Math.pow(b, 2.0) + Math.pow((a * Math.sin((Math.PI / (180.0 / angle)))), 2.0);
}
def code(a, b, angle): return math.pow(b, 2.0) + math.pow((a * math.sin((math.pi / (180.0 / angle)))), 2.0)
function code(a, b, angle) return Float64((b ^ 2.0) + (Float64(a * sin(Float64(pi / Float64(180.0 / angle)))) ^ 2.0)) end
function tmp = code(a, b, angle) tmp = (b ^ 2.0) + ((a * sin((pi / (180.0 / angle)))) ^ 2.0); end
code[a_, b_, angle_] := N[(N[Power[b, 2.0], $MachinePrecision] + N[Power[N[(a * N[Sin[N[(Pi / N[(180.0 / angle), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
{b}^{2} + {\left(a \cdot \sin \left(\frac{\pi}{\frac{180}{angle}}\right)\right)}^{2}
\end{array}
Initial program 80.5%
*-commutative80.5%
associate-*r/80.5%
associate-*l/80.6%
*-commutative80.6%
*-commutative80.6%
associate-*r/80.6%
associate-*l/80.6%
*-commutative80.6%
Simplified80.6%
Taylor expanded in angle around 0 80.3%
associate-*r/80.2%
associate-*l/80.2%
*-commutative80.2%
clear-num80.2%
un-div-inv80.3%
Applied egg-rr80.3%
Final simplification80.3%
(FPCore (a b angle) :precision binary64 (if (<= a 4.4e-116) (pow b 2.0) (+ (pow b 2.0) (pow (* a (* angle (* PI 0.005555555555555556))) 2.0))))
double code(double a, double b, double angle) {
double tmp;
if (a <= 4.4e-116) {
tmp = pow(b, 2.0);
} else {
tmp = pow(b, 2.0) + pow((a * (angle * (((double) M_PI) * 0.005555555555555556))), 2.0);
}
return tmp;
}
public static double code(double a, double b, double angle) {
double tmp;
if (a <= 4.4e-116) {
tmp = Math.pow(b, 2.0);
} else {
tmp = Math.pow(b, 2.0) + Math.pow((a * (angle * (Math.PI * 0.005555555555555556))), 2.0);
}
return tmp;
}
def code(a, b, angle): tmp = 0 if a <= 4.4e-116: tmp = math.pow(b, 2.0) else: tmp = math.pow(b, 2.0) + math.pow((a * (angle * (math.pi * 0.005555555555555556))), 2.0) return tmp
function code(a, b, angle) tmp = 0.0 if (a <= 4.4e-116) tmp = b ^ 2.0; else tmp = Float64((b ^ 2.0) + (Float64(a * Float64(angle * Float64(pi * 0.005555555555555556))) ^ 2.0)); end return tmp end
function tmp_2 = code(a, b, angle) tmp = 0.0; if (a <= 4.4e-116) tmp = b ^ 2.0; else tmp = (b ^ 2.0) + ((a * (angle * (pi * 0.005555555555555556))) ^ 2.0); end tmp_2 = tmp; end
code[a_, b_, angle_] := If[LessEqual[a, 4.4e-116], N[Power[b, 2.0], $MachinePrecision], N[(N[Power[b, 2.0], $MachinePrecision] + N[Power[N[(a * N[(angle * N[(Pi * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq 4.4 \cdot 10^{-116}:\\
\;\;\;\;{b}^{2}\\
\mathbf{else}:\\
\;\;\;\;{b}^{2} + {\left(a \cdot \left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right)\right)}^{2}\\
\end{array}
\end{array}
if a < 4.4000000000000002e-116Initial program 81.3%
*-commutative81.3%
associate-*r/81.3%
associate-*l/81.4%
*-commutative81.4%
*-commutative81.4%
associate-*r/81.5%
associate-*l/81.4%
*-commutative81.4%
Simplified81.4%
Taylor expanded in angle around 0 81.5%
Taylor expanded in angle around 0 74.6%
*-commutative74.6%
*-commutative74.6%
associate-*l*74.6%
Simplified74.6%
Taylor expanded in angle around 0 65.5%
if 4.4000000000000002e-116 < a Initial program 78.9%
*-commutative78.9%
associate-*r/78.9%
associate-*l/78.9%
*-commutative78.9%
*-commutative78.9%
associate-*r/78.8%
associate-*l/78.9%
*-commutative78.9%
Simplified78.9%
Taylor expanded in angle around 0 77.9%
Taylor expanded in angle around 0 73.3%
*-commutative73.3%
associate-*r*73.4%
Simplified73.4%
Final simplification68.1%
(FPCore (a b angle) :precision binary64 (if (<= a 1.35e-115) (pow b 2.0) (+ (pow b 2.0) (pow (* (* angle PI) (* a 0.005555555555555556)) 2.0))))
double code(double a, double b, double angle) {
double tmp;
if (a <= 1.35e-115) {
tmp = pow(b, 2.0);
} else {
tmp = pow(b, 2.0) + 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.35e-115) {
tmp = Math.pow(b, 2.0);
} else {
tmp = Math.pow(b, 2.0) + Math.pow(((angle * Math.PI) * (a * 0.005555555555555556)), 2.0);
}
return tmp;
}
def code(a, b, angle): tmp = 0 if a <= 1.35e-115: tmp = math.pow(b, 2.0) else: tmp = math.pow(b, 2.0) + math.pow(((angle * math.pi) * (a * 0.005555555555555556)), 2.0) return tmp
function code(a, b, angle) tmp = 0.0 if (a <= 1.35e-115) tmp = b ^ 2.0; else tmp = Float64((b ^ 2.0) + (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.35e-115) tmp = b ^ 2.0; else tmp = (b ^ 2.0) + (((angle * pi) * (a * 0.005555555555555556)) ^ 2.0); end tmp_2 = tmp; end
code[a_, b_, angle_] := If[LessEqual[a, 1.35e-115], N[Power[b, 2.0], $MachinePrecision], N[(N[Power[b, 2.0], $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.35 \cdot 10^{-115}:\\
\;\;\;\;{b}^{2}\\
\mathbf{else}:\\
\;\;\;\;{b}^{2} + {\left(\left(angle \cdot \pi\right) \cdot \left(a \cdot 0.005555555555555556\right)\right)}^{2}\\
\end{array}
\end{array}
if a < 1.35e-115Initial program 81.3%
*-commutative81.3%
associate-*r/81.3%
associate-*l/81.4%
*-commutative81.4%
*-commutative81.4%
associate-*r/81.5%
associate-*l/81.4%
*-commutative81.4%
Simplified81.4%
Taylor expanded in angle around 0 81.5%
Taylor expanded in angle around 0 74.6%
*-commutative74.6%
*-commutative74.6%
associate-*l*74.6%
Simplified74.6%
Taylor expanded in angle around 0 65.5%
if 1.35e-115 < a Initial program 78.9%
*-commutative78.9%
associate-*r/78.9%
associate-*l/78.9%
*-commutative78.9%
*-commutative78.9%
associate-*r/78.8%
associate-*l/78.9%
*-commutative78.9%
Simplified78.9%
Taylor expanded in angle around 0 77.9%
Taylor expanded in angle around 0 73.3%
associate-*r*73.4%
*-commutative73.4%
Simplified73.4%
Final simplification68.1%
(FPCore (a b angle) :precision binary64 (if (<= a 2.4e-115) (pow b 2.0) (pow (hypot (* PI (* 0.005555555555555556 (* a angle))) b) 2.0)))
double code(double a, double b, double angle) {
double tmp;
if (a <= 2.4e-115) {
tmp = pow(b, 2.0);
} else {
tmp = pow(hypot((((double) M_PI) * (0.005555555555555556 * (a * angle))), b), 2.0);
}
return tmp;
}
public static double code(double a, double b, double angle) {
double tmp;
if (a <= 2.4e-115) {
tmp = Math.pow(b, 2.0);
} else {
tmp = Math.pow(Math.hypot((Math.PI * (0.005555555555555556 * (a * angle))), b), 2.0);
}
return tmp;
}
def code(a, b, angle): tmp = 0 if a <= 2.4e-115: tmp = math.pow(b, 2.0) else: tmp = math.pow(math.hypot((math.pi * (0.005555555555555556 * (a * angle))), b), 2.0) return tmp
function code(a, b, angle) tmp = 0.0 if (a <= 2.4e-115) tmp = b ^ 2.0; else tmp = hypot(Float64(pi * Float64(0.005555555555555556 * Float64(a * angle))), b) ^ 2.0; end return tmp end
function tmp_2 = code(a, b, angle) tmp = 0.0; if (a <= 2.4e-115) tmp = b ^ 2.0; else tmp = hypot((pi * (0.005555555555555556 * (a * angle))), b) ^ 2.0; end tmp_2 = tmp; end
code[a_, b_, angle_] := If[LessEqual[a, 2.4e-115], N[Power[b, 2.0], $MachinePrecision], N[Power[N[Sqrt[N[(Pi * N[(0.005555555555555556 * N[(a * angle), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] ^ 2 + b ^ 2], $MachinePrecision], 2.0], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq 2.4 \cdot 10^{-115}:\\
\;\;\;\;{b}^{2}\\
\mathbf{else}:\\
\;\;\;\;{\left(\mathsf{hypot}\left(\pi \cdot \left(0.005555555555555556 \cdot \left(a \cdot angle\right)\right), b\right)\right)}^{2}\\
\end{array}
\end{array}
if a < 2.40000000000000021e-115Initial program 81.3%
*-commutative81.3%
associate-*r/81.3%
associate-*l/81.4%
*-commutative81.4%
*-commutative81.4%
associate-*r/81.5%
associate-*l/81.4%
*-commutative81.4%
Simplified81.4%
Taylor expanded in angle around 0 81.5%
Taylor expanded in angle around 0 74.6%
*-commutative74.6%
*-commutative74.6%
associate-*l*74.6%
Simplified74.6%
Taylor expanded in angle around 0 65.5%
if 2.40000000000000021e-115 < a Initial program 78.9%
*-commutative78.9%
associate-*r/78.9%
associate-*l/78.9%
*-commutative78.9%
*-commutative78.9%
associate-*r/78.8%
associate-*l/78.9%
*-commutative78.9%
Simplified78.9%
Taylor expanded in angle around 0 77.9%
Taylor expanded in angle around 0 73.3%
*-commutative73.3%
*-commutative73.3%
associate-*l*73.3%
Simplified73.3%
add-sqr-sqrt73.3%
pow273.3%
unpow273.3%
*-rgt-identity73.3%
pow273.3%
hypot-def73.3%
associate-*r*73.4%
*-commutative73.4%
associate-*l*73.4%
Applied egg-rr73.4%
Final simplification68.1%
(FPCore (a b angle) :precision binary64 (if (<= a 2.4e-115) (pow b 2.0) (pow (hypot (* (* PI 0.005555555555555556) (* a angle)) b) 2.0)))
double code(double a, double b, double angle) {
double tmp;
if (a <= 2.4e-115) {
tmp = pow(b, 2.0);
} else {
tmp = pow(hypot(((((double) M_PI) * 0.005555555555555556) * (a * angle)), b), 2.0);
}
return tmp;
}
public static double code(double a, double b, double angle) {
double tmp;
if (a <= 2.4e-115) {
tmp = Math.pow(b, 2.0);
} else {
tmp = Math.pow(Math.hypot(((Math.PI * 0.005555555555555556) * (a * angle)), b), 2.0);
}
return tmp;
}
def code(a, b, angle): tmp = 0 if a <= 2.4e-115: tmp = math.pow(b, 2.0) else: tmp = math.pow(math.hypot(((math.pi * 0.005555555555555556) * (a * angle)), b), 2.0) return tmp
function code(a, b, angle) tmp = 0.0 if (a <= 2.4e-115) tmp = b ^ 2.0; else tmp = hypot(Float64(Float64(pi * 0.005555555555555556) * Float64(a * angle)), b) ^ 2.0; end return tmp end
function tmp_2 = code(a, b, angle) tmp = 0.0; if (a <= 2.4e-115) tmp = b ^ 2.0; else tmp = hypot(((pi * 0.005555555555555556) * (a * angle)), b) ^ 2.0; end tmp_2 = tmp; end
code[a_, b_, angle_] := If[LessEqual[a, 2.4e-115], N[Power[b, 2.0], $MachinePrecision], N[Power[N[Sqrt[N[(N[(Pi * 0.005555555555555556), $MachinePrecision] * N[(a * angle), $MachinePrecision]), $MachinePrecision] ^ 2 + b ^ 2], $MachinePrecision], 2.0], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq 2.4 \cdot 10^{-115}:\\
\;\;\;\;{b}^{2}\\
\mathbf{else}:\\
\;\;\;\;{\left(\mathsf{hypot}\left(\left(\pi \cdot 0.005555555555555556\right) \cdot \left(a \cdot angle\right), b\right)\right)}^{2}\\
\end{array}
\end{array}
if a < 2.40000000000000021e-115Initial program 81.3%
*-commutative81.3%
associate-*r/81.3%
associate-*l/81.4%
*-commutative81.4%
*-commutative81.4%
associate-*r/81.5%
associate-*l/81.4%
*-commutative81.4%
Simplified81.4%
Taylor expanded in angle around 0 81.5%
Taylor expanded in angle around 0 74.6%
*-commutative74.6%
*-commutative74.6%
associate-*l*74.6%
Simplified74.6%
Taylor expanded in angle around 0 65.5%
if 2.40000000000000021e-115 < a Initial program 78.9%
*-commutative78.9%
associate-*r/78.9%
associate-*l/78.9%
*-commutative78.9%
*-commutative78.9%
associate-*r/78.8%
associate-*l/78.9%
*-commutative78.9%
Simplified78.9%
Taylor expanded in angle around 0 77.9%
Taylor expanded in angle around 0 73.3%
*-commutative73.3%
*-commutative73.3%
associate-*l*73.3%
Simplified73.3%
expm1-log1p-u71.5%
expm1-udef58.9%
Applied egg-rr58.9%
expm1-def71.5%
expm1-log1p73.4%
associate-*r*73.4%
Simplified73.4%
Final simplification68.1%
(FPCore (a b angle) :precision binary64 (pow b 2.0))
double code(double a, double b, double angle) {
return pow(b, 2.0);
}
real(8) function code(a, b, angle)
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: angle
code = b ** 2.0d0
end function
public static double code(double a, double b, double angle) {
return Math.pow(b, 2.0);
}
def code(a, b, angle): return math.pow(b, 2.0)
function code(a, b, angle) return b ^ 2.0 end
function tmp = code(a, b, angle) tmp = b ^ 2.0; end
code[a_, b_, angle_] := N[Power[b, 2.0], $MachinePrecision]
\begin{array}{l}
\\
{b}^{2}
\end{array}
Initial program 80.5%
*-commutative80.5%
associate-*r/80.5%
associate-*l/80.6%
*-commutative80.6%
*-commutative80.6%
associate-*r/80.6%
associate-*l/80.6%
*-commutative80.6%
Simplified80.6%
Taylor expanded in angle around 0 80.3%
Taylor expanded in angle around 0 74.2%
*-commutative74.2%
*-commutative74.2%
associate-*l*74.2%
Simplified74.2%
Taylor expanded in angle around 0 61.1%
Final simplification61.1%
herbie shell --seed 2024010
(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)))