
(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 19 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 (/ PI (/ 180.0 angle)))) 2.0) (pow (* b (cos (/ (pow (cbrt (* angle (cbrt (pow PI 3.0)))) 3.0) 180.0))) 2.0)))
double code(double a, double b, double angle) {
return pow((a * sin((((double) M_PI) / (180.0 / angle)))), 2.0) + pow((b * cos((pow(cbrt((angle * cbrt(pow(((double) M_PI), 3.0)))), 3.0) / 180.0))), 2.0);
}
public static double code(double a, double b, double angle) {
return Math.pow((a * Math.sin((Math.PI / (180.0 / angle)))), 2.0) + Math.pow((b * Math.cos((Math.pow(Math.cbrt((angle * Math.cbrt(Math.pow(Math.PI, 3.0)))), 3.0) / 180.0))), 2.0);
}
function code(a, b, angle) return Float64((Float64(a * sin(Float64(pi / Float64(180.0 / angle)))) ^ 2.0) + (Float64(b * cos(Float64((cbrt(Float64(angle * cbrt((pi ^ 3.0)))) ^ 3.0) / 180.0))) ^ 2.0)) end
code[a_, b_, angle_] := N[(N[Power[N[(a * N[Sin[N[(Pi / N[(180.0 / angle), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[(b * N[Cos[N[(N[Power[N[Power[N[(angle * N[Power[N[Power[Pi, 3.0], $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision], 3.0], $MachinePrecision] / 180.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
{\left(a \cdot \sin \left(\frac{\pi}{\frac{180}{angle}}\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{{\left(\sqrt[3]{angle \cdot \sqrt[3]{{\pi}^{3}}}\right)}^{3}}{180}\right)\right)}^{2}
\end{array}
Initial program 78.9%
associate-*l/78.9%
Applied egg-rr78.9%
*-commutative78.9%
clear-num78.9%
un-div-inv79.0%
Applied egg-rr79.0%
add-cube-cbrt79.1%
pow379.1%
Applied egg-rr79.1%
add-cbrt-cube79.1%
pow379.1%
Applied egg-rr79.1%
(FPCore (a b angle) :precision binary64 (+ (pow (* a (sin (/ PI (/ 180.0 angle)))) 2.0) (pow (* b (cos (/ (pow (cbrt (expm1 (log1p (* PI angle)))) 3.0) 180.0))) 2.0)))
double code(double a, double b, double angle) {
return pow((a * sin((((double) M_PI) / (180.0 / angle)))), 2.0) + pow((b * cos((pow(cbrt(expm1(log1p((((double) M_PI) * angle)))), 3.0) / 180.0))), 2.0);
}
public static double code(double a, double b, double angle) {
return Math.pow((a * Math.sin((Math.PI / (180.0 / angle)))), 2.0) + Math.pow((b * Math.cos((Math.pow(Math.cbrt(Math.expm1(Math.log1p((Math.PI * angle)))), 3.0) / 180.0))), 2.0);
}
function code(a, b, angle) return Float64((Float64(a * sin(Float64(pi / Float64(180.0 / angle)))) ^ 2.0) + (Float64(b * cos(Float64((cbrt(expm1(log1p(Float64(pi * angle)))) ^ 3.0) / 180.0))) ^ 2.0)) end
code[a_, b_, angle_] := N[(N[Power[N[(a * N[Sin[N[(Pi / N[(180.0 / angle), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[(b * N[Cos[N[(N[Power[N[Power[N[(Exp[N[Log[1 + N[(Pi * angle), $MachinePrecision]], $MachinePrecision]] - 1), $MachinePrecision], 1/3], $MachinePrecision], 3.0], $MachinePrecision] / 180.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
{\left(a \cdot \sin \left(\frac{\pi}{\frac{180}{angle}}\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{{\left(\sqrt[3]{\mathsf{expm1}\left(\mathsf{log1p}\left(\pi \cdot angle\right)\right)}\right)}^{3}}{180}\right)\right)}^{2}
\end{array}
Initial program 78.9%
associate-*l/78.9%
Applied egg-rr78.9%
*-commutative78.9%
clear-num78.9%
un-div-inv79.0%
Applied egg-rr79.0%
add-cube-cbrt79.1%
pow379.1%
Applied egg-rr79.1%
expm1-log1p-u64.7%
expm1-undefine64.7%
Applied egg-rr64.7%
expm1-define64.7%
Simplified64.7%
Final simplification64.7%
(FPCore (a b angle) :precision binary64 (+ (pow (* a (sin (/ PI (/ 180.0 angle)))) 2.0) (pow (* b (cos (/ (pow (cbrt (* PI angle)) 3.0) 180.0))) 2.0)))
double code(double a, double b, double angle) {
return pow((a * sin((((double) M_PI) / (180.0 / angle)))), 2.0) + pow((b * cos((pow(cbrt((((double) M_PI) * angle)), 3.0) / 180.0))), 2.0);
}
public static double code(double a, double b, double angle) {
return Math.pow((a * Math.sin((Math.PI / (180.0 / angle)))), 2.0) + Math.pow((b * Math.cos((Math.pow(Math.cbrt((Math.PI * angle)), 3.0) / 180.0))), 2.0);
}
function code(a, b, angle) return Float64((Float64(a * sin(Float64(pi / Float64(180.0 / angle)))) ^ 2.0) + (Float64(b * cos(Float64((cbrt(Float64(pi * angle)) ^ 3.0) / 180.0))) ^ 2.0)) end
code[a_, b_, angle_] := N[(N[Power[N[(a * N[Sin[N[(Pi / N[(180.0 / angle), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[(b * N[Cos[N[(N[Power[N[Power[N[(Pi * angle), $MachinePrecision], 1/3], $MachinePrecision], 3.0], $MachinePrecision] / 180.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
{\left(a \cdot \sin \left(\frac{\pi}{\frac{180}{angle}}\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{{\left(\sqrt[3]{\pi \cdot angle}\right)}^{3}}{180}\right)\right)}^{2}
\end{array}
Initial program 78.9%
associate-*l/78.9%
Applied egg-rr78.9%
*-commutative78.9%
clear-num78.9%
un-div-inv79.0%
Applied egg-rr79.0%
add-cube-cbrt79.1%
pow379.1%
Applied egg-rr79.1%
Final simplification79.1%
(FPCore (a b angle) :precision binary64 (+ (pow (* a (sin (/ PI (/ 180.0 angle)))) 2.0) (pow (* b (cos (/ (expm1 (log1p (* PI angle))) 180.0))) 2.0)))
double code(double a, double b, double angle) {
return pow((a * sin((((double) M_PI) / (180.0 / angle)))), 2.0) + pow((b * cos((expm1(log1p((((double) M_PI) * angle))) / 180.0))), 2.0);
}
public static double code(double a, double b, double angle) {
return Math.pow((a * Math.sin((Math.PI / (180.0 / angle)))), 2.0) + Math.pow((b * Math.cos((Math.expm1(Math.log1p((Math.PI * angle))) / 180.0))), 2.0);
}
def code(a, b, angle): return math.pow((a * math.sin((math.pi / (180.0 / angle)))), 2.0) + math.pow((b * math.cos((math.expm1(math.log1p((math.pi * angle))) / 180.0))), 2.0)
function code(a, b, angle) return Float64((Float64(a * sin(Float64(pi / Float64(180.0 / angle)))) ^ 2.0) + (Float64(b * cos(Float64(expm1(log1p(Float64(pi * angle))) / 180.0))) ^ 2.0)) end
code[a_, b_, angle_] := N[(N[Power[N[(a * N[Sin[N[(Pi / N[(180.0 / angle), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[(b * N[Cos[N[(N[(Exp[N[Log[1 + N[(Pi * angle), $MachinePrecision]], $MachinePrecision]] - 1), $MachinePrecision] / 180.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
{\left(a \cdot \sin \left(\frac{\pi}{\frac{180}{angle}}\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{\mathsf{expm1}\left(\mathsf{log1p}\left(\pi \cdot angle\right)\right)}{180}\right)\right)}^{2}
\end{array}
Initial program 78.9%
associate-*l/78.9%
Applied egg-rr78.9%
*-commutative78.9%
clear-num78.9%
un-div-inv79.0%
Applied egg-rr79.0%
expm1-log1p-u64.7%
expm1-undefine64.7%
Applied egg-rr64.7%
expm1-define64.7%
Simplified64.7%
Final simplification64.7%
(FPCore (a b angle) :precision binary64 (+ (pow (* a (sin (* PI (/ angle 180.0)))) 2.0) (pow (* b (cos (exp (log (* angle (* PI 0.005555555555555556)))))) 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(exp(log((angle * (((double) M_PI) * 0.005555555555555556)))))), 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.exp(Math.log((angle * (Math.PI * 0.005555555555555556)))))), 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.exp(math.log((angle * (math.pi * 0.005555555555555556)))))), 2.0)
function code(a, b, angle) return Float64((Float64(a * sin(Float64(pi * Float64(angle / 180.0)))) ^ 2.0) + (Float64(b * cos(exp(log(Float64(angle * Float64(pi * 0.005555555555555556)))))) ^ 2.0)) end
function tmp = code(a, b, angle) tmp = ((a * sin((pi * (angle / 180.0)))) ^ 2.0) + ((b * cos(exp(log((angle * (pi * 0.005555555555555556)))))) ^ 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[Exp[N[Log[N[(angle * N[(Pi * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $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(e^{\log \left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right)}\right)\right)}^{2}
\end{array}
Initial program 78.9%
associate-*l/78.9%
associate-*r/78.8%
add-exp-log39.8%
div-inv39.8%
metadata-eval39.8%
Applied egg-rr39.8%
Final simplification39.8%
(FPCore (a b angle) :precision binary64 (+ (pow (* a (sin (/ PI (/ 180.0 angle)))) 2.0) (pow (* b (cos (/ (* PI angle) 180.0))) 2.0)))
double code(double a, double b, double angle) {
return pow((a * sin((((double) M_PI) / (180.0 / angle)))), 2.0) + pow((b * cos(((((double) M_PI) * angle) / 180.0))), 2.0);
}
public static double code(double a, double b, double angle) {
return Math.pow((a * Math.sin((Math.PI / (180.0 / angle)))), 2.0) + Math.pow((b * Math.cos(((Math.PI * angle) / 180.0))), 2.0);
}
def code(a, b, angle): return math.pow((a * math.sin((math.pi / (180.0 / angle)))), 2.0) + math.pow((b * math.cos(((math.pi * angle) / 180.0))), 2.0)
function code(a, b, angle) return Float64((Float64(a * sin(Float64(pi / Float64(180.0 / angle)))) ^ 2.0) + (Float64(b * cos(Float64(Float64(pi * angle) / 180.0))) ^ 2.0)) end
function tmp = code(a, b, angle) tmp = ((a * sin((pi / (180.0 / angle)))) ^ 2.0) + ((b * cos(((pi * angle) / 180.0))) ^ 2.0); end
code[a_, b_, angle_] := N[(N[Power[N[(a * N[Sin[N[(Pi / N[(180.0 / angle), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[(b * N[Cos[N[(N[(Pi * angle), $MachinePrecision] / 180.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
{\left(a \cdot \sin \left(\frac{\pi}{\frac{180}{angle}}\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{\pi \cdot angle}{180}\right)\right)}^{2}
\end{array}
Initial program 78.9%
associate-*l/78.9%
Applied egg-rr78.9%
*-commutative78.9%
clear-num78.9%
un-div-inv79.0%
Applied egg-rr79.0%
Final simplification79.0%
(FPCore (a b angle) :precision binary64 (+ (pow (* a (sin (/ PI (/ 180.0 angle)))) 2.0) (pow (* b (cos (* PI (/ angle 180.0)))) 2.0)))
double code(double a, double b, double angle) {
return pow((a * sin((((double) M_PI) / (180.0 / angle)))), 2.0) + pow((b * cos((((double) M_PI) * (angle / 180.0)))), 2.0);
}
public static double code(double a, double b, double angle) {
return Math.pow((a * Math.sin((Math.PI / (180.0 / angle)))), 2.0) + Math.pow((b * Math.cos((Math.PI * (angle / 180.0)))), 2.0);
}
def code(a, b, angle): return math.pow((a * math.sin((math.pi / (180.0 / angle)))), 2.0) + math.pow((b * math.cos((math.pi * (angle / 180.0)))), 2.0)
function code(a, b, angle) return Float64((Float64(a * sin(Float64(pi / Float64(180.0 / angle)))) ^ 2.0) + (Float64(b * cos(Float64(pi * Float64(angle / 180.0)))) ^ 2.0)) end
function tmp = code(a, b, angle) tmp = ((a * sin((pi / (180.0 / angle)))) ^ 2.0) + ((b * cos((pi * (angle / 180.0)))) ^ 2.0); end
code[a_, b_, angle_] := N[(N[Power[N[(a * N[Sin[N[(Pi / N[(180.0 / angle), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[(b * N[Cos[N[(Pi * N[(angle / 180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
{\left(a \cdot \sin \left(\frac{\pi}{\frac{180}{angle}}\right)\right)}^{2} + {\left(b \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\right)}^{2}
\end{array}
Initial program 78.9%
*-commutative78.9%
clear-num78.9%
un-div-inv79.0%
Applied egg-rr79.0%
Final simplification79.0%
(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 78.9%
unpow278.9%
associate-*l/78.9%
associate-/l*78.9%
unpow278.9%
Simplified78.9%
(FPCore (a b angle)
:precision binary64
(let* ((t_0 (* a (* PI angle))))
(if (<= a 1.2e-48)
(* (pow b 2.0) (pow (cos (* PI (* angle 0.005555555555555556))) 2.0))
(+
(pow (* b (cos (/ (* PI angle) 180.0))) 2.0)
(* 3.08641975308642e-5 (* t_0 t_0))))))
double code(double a, double b, double angle) {
double t_0 = a * (((double) M_PI) * angle);
double tmp;
if (a <= 1.2e-48) {
tmp = pow(b, 2.0) * pow(cos((((double) M_PI) * (angle * 0.005555555555555556))), 2.0);
} else {
tmp = pow((b * cos(((((double) M_PI) * angle) / 180.0))), 2.0) + (3.08641975308642e-5 * (t_0 * t_0));
}
return tmp;
}
public static double code(double a, double b, double angle) {
double t_0 = a * (Math.PI * angle);
double tmp;
if (a <= 1.2e-48) {
tmp = Math.pow(b, 2.0) * Math.pow(Math.cos((Math.PI * (angle * 0.005555555555555556))), 2.0);
} else {
tmp = Math.pow((b * Math.cos(((Math.PI * angle) / 180.0))), 2.0) + (3.08641975308642e-5 * (t_0 * t_0));
}
return tmp;
}
def code(a, b, angle): t_0 = a * (math.pi * angle) tmp = 0 if a <= 1.2e-48: tmp = math.pow(b, 2.0) * math.pow(math.cos((math.pi * (angle * 0.005555555555555556))), 2.0) else: tmp = math.pow((b * math.cos(((math.pi * angle) / 180.0))), 2.0) + (3.08641975308642e-5 * (t_0 * t_0)) return tmp
function code(a, b, angle) t_0 = Float64(a * Float64(pi * angle)) tmp = 0.0 if (a <= 1.2e-48) tmp = Float64((b ^ 2.0) * (cos(Float64(pi * Float64(angle * 0.005555555555555556))) ^ 2.0)); else tmp = Float64((Float64(b * cos(Float64(Float64(pi * angle) / 180.0))) ^ 2.0) + Float64(3.08641975308642e-5 * Float64(t_0 * t_0))); end return tmp end
function tmp_2 = code(a, b, angle) t_0 = a * (pi * angle); tmp = 0.0; if (a <= 1.2e-48) tmp = (b ^ 2.0) * (cos((pi * (angle * 0.005555555555555556))) ^ 2.0); else tmp = ((b * cos(((pi * angle) / 180.0))) ^ 2.0) + (3.08641975308642e-5 * (t_0 * t_0)); end tmp_2 = tmp; end
code[a_, b_, angle_] := Block[{t$95$0 = N[(a * N[(Pi * angle), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, 1.2e-48], N[(N[Power[b, 2.0], $MachinePrecision] * N[Power[N[Cos[N[(Pi * N[(angle * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision], N[(N[Power[N[(b * N[Cos[N[(N[(Pi * angle), $MachinePrecision] / 180.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + N[(3.08641975308642e-5 * N[(t$95$0 * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := a \cdot \left(\pi \cdot angle\right)\\
\mathbf{if}\;a \leq 1.2 \cdot 10^{-48}:\\
\;\;\;\;{b}^{2} \cdot {\cos \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)}^{2}\\
\mathbf{else}:\\
\;\;\;\;{\left(b \cdot \cos \left(\frac{\pi \cdot angle}{180}\right)\right)}^{2} + 3.08641975308642 \cdot 10^{-5} \cdot \left(t\_0 \cdot t\_0\right)\\
\end{array}
\end{array}
if a < 1.2e-48Initial program 77.0%
unpow277.0%
associate-*l/77.1%
associate-/l*77.0%
unpow277.0%
Simplified77.0%
Taylor expanded in a around 0 58.6%
associate-*r*58.6%
Simplified58.6%
if 1.2e-48 < a Initial program 84.0%
associate-*l/84.0%
Applied egg-rr84.0%
Taylor expanded in angle around 0 63.5%
unpow263.5%
unpow263.5%
unpow263.5%
swap-sqr63.5%
swap-sqr82.1%
unpow282.1%
*-commutative82.1%
Simplified82.1%
unpow282.1%
*-commutative82.1%
*-commutative82.1%
*-commutative82.1%
*-commutative82.1%
Applied egg-rr82.1%
Final simplification64.9%
(FPCore (a b angle) :precision binary64 (+ (pow (* a (sin (/ PI (/ 180.0 angle)))) 2.0) (pow b 2.0)))
double code(double a, double b, double angle) {
return pow((a * sin((((double) M_PI) / (180.0 / angle)))), 2.0) + pow(b, 2.0);
}
public static double code(double a, double b, double angle) {
return Math.pow((a * Math.sin((Math.PI / (180.0 / angle)))), 2.0) + Math.pow(b, 2.0);
}
def code(a, b, angle): return math.pow((a * math.sin((math.pi / (180.0 / angle)))), 2.0) + math.pow(b, 2.0)
function code(a, b, angle) return Float64((Float64(a * sin(Float64(pi / Float64(180.0 / angle)))) ^ 2.0) + (b ^ 2.0)) end
function tmp = code(a, b, angle) tmp = ((a * sin((pi / (180.0 / angle)))) ^ 2.0) + (b ^ 2.0); end
code[a_, b_, angle_] := N[(N[Power[N[(a * N[Sin[N[(Pi / N[(180.0 / angle), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[b, 2.0], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
{\left(a \cdot \sin \left(\frac{\pi}{\frac{180}{angle}}\right)\right)}^{2} + {b}^{2}
\end{array}
Initial program 78.9%
associate-*l/78.9%
Applied egg-rr78.9%
*-commutative78.9%
clear-num78.9%
un-div-inv79.0%
Applied egg-rr79.0%
add-cube-cbrt79.1%
pow379.1%
Applied egg-rr79.1%
Taylor expanded in angle around 0 78.9%
(FPCore (a b angle) :precision binary64 (+ (pow (* a (sin (* PI (/ angle 180.0)))) 2.0) (pow b 2.0)))
double code(double a, double b, double angle) {
return pow((a * sin((((double) M_PI) * (angle / 180.0)))), 2.0) + pow(b, 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, 2.0);
}
def code(a, b, angle): return math.pow((a * math.sin((math.pi * (angle / 180.0)))), 2.0) + math.pow(b, 2.0)
function code(a, b, angle) return Float64((Float64(a * sin(Float64(pi * Float64(angle / 180.0)))) ^ 2.0) + (b ^ 2.0)) end
function tmp = code(a, b, angle) tmp = ((a * sin((pi * (angle / 180.0)))) ^ 2.0) + (b ^ 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[b, 2.0], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
{\left(a \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right)}^{2} + {b}^{2}
\end{array}
Initial program 78.9%
associate-*l/78.9%
associate-*r/78.8%
add-exp-log39.8%
div-inv39.8%
metadata-eval39.8%
Applied egg-rr39.8%
Taylor expanded in angle around 0 78.8%
Final simplification78.8%
(FPCore (a b angle)
:precision binary64
(let* ((t_0 (* a (* PI angle))))
(if (<= a 2.15e-48)
(pow (* b (cos (/ angle (/ -180.0 PI)))) 2.0)
(+
(pow (* b (cos (/ (* PI angle) 180.0))) 2.0)
(* 3.08641975308642e-5 (* t_0 t_0))))))
double code(double a, double b, double angle) {
double t_0 = a * (((double) M_PI) * angle);
double tmp;
if (a <= 2.15e-48) {
tmp = pow((b * cos((angle / (-180.0 / ((double) M_PI))))), 2.0);
} else {
tmp = pow((b * cos(((((double) M_PI) * angle) / 180.0))), 2.0) + (3.08641975308642e-5 * (t_0 * t_0));
}
return tmp;
}
public static double code(double a, double b, double angle) {
double t_0 = a * (Math.PI * angle);
double tmp;
if (a <= 2.15e-48) {
tmp = Math.pow((b * Math.cos((angle / (-180.0 / Math.PI)))), 2.0);
} else {
tmp = Math.pow((b * Math.cos(((Math.PI * angle) / 180.0))), 2.0) + (3.08641975308642e-5 * (t_0 * t_0));
}
return tmp;
}
def code(a, b, angle): t_0 = a * (math.pi * angle) tmp = 0 if a <= 2.15e-48: tmp = math.pow((b * math.cos((angle / (-180.0 / math.pi)))), 2.0) else: tmp = math.pow((b * math.cos(((math.pi * angle) / 180.0))), 2.0) + (3.08641975308642e-5 * (t_0 * t_0)) return tmp
function code(a, b, angle) t_0 = Float64(a * Float64(pi * angle)) tmp = 0.0 if (a <= 2.15e-48) tmp = Float64(b * cos(Float64(angle / Float64(-180.0 / pi)))) ^ 2.0; else tmp = Float64((Float64(b * cos(Float64(Float64(pi * angle) / 180.0))) ^ 2.0) + Float64(3.08641975308642e-5 * Float64(t_0 * t_0))); end return tmp end
function tmp_2 = code(a, b, angle) t_0 = a * (pi * angle); tmp = 0.0; if (a <= 2.15e-48) tmp = (b * cos((angle / (-180.0 / pi)))) ^ 2.0; else tmp = ((b * cos(((pi * angle) / 180.0))) ^ 2.0) + (3.08641975308642e-5 * (t_0 * t_0)); end tmp_2 = tmp; end
code[a_, b_, angle_] := Block[{t$95$0 = N[(a * N[(Pi * angle), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, 2.15e-48], N[Power[N[(b * N[Cos[N[(angle / N[(-180.0 / Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision], N[(N[Power[N[(b * N[Cos[N[(N[(Pi * angle), $MachinePrecision] / 180.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + N[(3.08641975308642e-5 * N[(t$95$0 * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := a \cdot \left(\pi \cdot angle\right)\\
\mathbf{if}\;a \leq 2.15 \cdot 10^{-48}:\\
\;\;\;\;{\left(b \cdot \cos \left(\frac{angle}{\frac{-180}{\pi}}\right)\right)}^{2}\\
\mathbf{else}:\\
\;\;\;\;{\left(b \cdot \cos \left(\frac{\pi \cdot angle}{180}\right)\right)}^{2} + 3.08641975308642 \cdot 10^{-5} \cdot \left(t\_0 \cdot t\_0\right)\\
\end{array}
\end{array}
if a < 2.15e-48Initial program 77.0%
associate-*l/77.0%
associate-*r/77.0%
add-exp-log39.2%
div-inv39.2%
metadata-eval39.2%
Applied egg-rr39.2%
Taylor expanded in a around 0 58.6%
unpow258.6%
*-commutative58.6%
associate-*r*58.6%
unpow258.6%
swap-sqr58.6%
unpow258.6%
Simplified58.6%
if 2.15e-48 < a Initial program 84.0%
associate-*l/84.0%
Applied egg-rr84.0%
Taylor expanded in angle around 0 63.5%
unpow263.5%
unpow263.5%
unpow263.5%
swap-sqr63.5%
swap-sqr82.1%
unpow282.1%
*-commutative82.1%
Simplified82.1%
unpow282.1%
*-commutative82.1%
*-commutative82.1%
*-commutative82.1%
*-commutative82.1%
Applied egg-rr82.1%
Final simplification64.9%
(FPCore (a b angle)
:precision binary64
(if (<= b 6e-160)
(pow (* a (sin (* angle (* PI 0.005555555555555556)))) 2.0)
(+
(pow (* b (cos (/ (* PI angle) 180.0))) 2.0)
(* 3.08641975308642e-5 (* angle (* (* a (* PI angle)) (* a PI)))))))
double code(double a, double b, double angle) {
double tmp;
if (b <= 6e-160) {
tmp = pow((a * sin((angle * (((double) M_PI) * 0.005555555555555556)))), 2.0);
} else {
tmp = pow((b * cos(((((double) M_PI) * angle) / 180.0))), 2.0) + (3.08641975308642e-5 * (angle * ((a * (((double) M_PI) * angle)) * (a * ((double) M_PI)))));
}
return tmp;
}
public static double code(double a, double b, double angle) {
double tmp;
if (b <= 6e-160) {
tmp = Math.pow((a * Math.sin((angle * (Math.PI * 0.005555555555555556)))), 2.0);
} else {
tmp = Math.pow((b * Math.cos(((Math.PI * angle) / 180.0))), 2.0) + (3.08641975308642e-5 * (angle * ((a * (Math.PI * angle)) * (a * Math.PI))));
}
return tmp;
}
def code(a, b, angle): tmp = 0 if b <= 6e-160: tmp = math.pow((a * math.sin((angle * (math.pi * 0.005555555555555556)))), 2.0) else: tmp = math.pow((b * math.cos(((math.pi * angle) / 180.0))), 2.0) + (3.08641975308642e-5 * (angle * ((a * (math.pi * angle)) * (a * math.pi)))) return tmp
function code(a, b, angle) tmp = 0.0 if (b <= 6e-160) tmp = Float64(a * sin(Float64(angle * Float64(pi * 0.005555555555555556)))) ^ 2.0; else tmp = Float64((Float64(b * cos(Float64(Float64(pi * angle) / 180.0))) ^ 2.0) + Float64(3.08641975308642e-5 * Float64(angle * Float64(Float64(a * Float64(pi * angle)) * Float64(a * pi))))); end return tmp end
function tmp_2 = code(a, b, angle) tmp = 0.0; if (b <= 6e-160) tmp = (a * sin((angle * (pi * 0.005555555555555556)))) ^ 2.0; else tmp = ((b * cos(((pi * angle) / 180.0))) ^ 2.0) + (3.08641975308642e-5 * (angle * ((a * (pi * angle)) * (a * pi)))); end tmp_2 = tmp; end
code[a_, b_, angle_] := If[LessEqual[b, 6e-160], N[Power[N[(a * N[Sin[N[(angle * N[(Pi * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision], N[(N[Power[N[(b * N[Cos[N[(N[(Pi * angle), $MachinePrecision] / 180.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + N[(3.08641975308642e-5 * N[(angle * N[(N[(a * N[(Pi * angle), $MachinePrecision]), $MachinePrecision] * N[(a * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq 6 \cdot 10^{-160}:\\
\;\;\;\;{\left(a \cdot \sin \left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right)\right)}^{2}\\
\mathbf{else}:\\
\;\;\;\;{\left(b \cdot \cos \left(\frac{\pi \cdot angle}{180}\right)\right)}^{2} + 3.08641975308642 \cdot 10^{-5} \cdot \left(angle \cdot \left(\left(a \cdot \left(\pi \cdot angle\right)\right) \cdot \left(a \cdot \pi\right)\right)\right)\\
\end{array}
\end{array}
if b < 5.99999999999999993e-160Initial program 77.8%
associate-*l/77.9%
Applied egg-rr77.9%
*-commutative77.9%
clear-num77.9%
un-div-inv78.0%
Applied egg-rr78.0%
Taylor expanded in a around inf 37.2%
unpow237.2%
*-commutative37.2%
*-commutative37.2%
associate-*r*37.3%
unpow237.3%
swap-sqr45.1%
unpow245.1%
*-commutative45.1%
associate-*l*45.2%
Simplified45.2%
if 5.99999999999999993e-160 < b Initial program 80.7%
associate-*l/80.7%
Applied egg-rr80.7%
Taylor expanded in angle around 0 65.2%
unpow265.2%
unpow265.2%
unpow265.2%
swap-sqr65.2%
swap-sqr78.5%
unpow278.5%
*-commutative78.5%
Simplified78.5%
unpow278.5%
associate-*l*78.5%
associate-*l*75.4%
*-commutative75.4%
*-commutative75.4%
*-commutative75.4%
Applied egg-rr75.4%
Final simplification55.9%
(FPCore (a b angle) :precision binary64 (if (<= a 2.8e+153) (pow (* b (cos (/ angle (/ -180.0 PI)))) 2.0) (pow (* a (sin (* angle (* PI 0.005555555555555556)))) 2.0)))
double code(double a, double b, double angle) {
double tmp;
if (a <= 2.8e+153) {
tmp = pow((b * cos((angle / (-180.0 / ((double) M_PI))))), 2.0);
} else {
tmp = pow((a * sin((angle * (((double) M_PI) * 0.005555555555555556)))), 2.0);
}
return tmp;
}
public static double code(double a, double b, double angle) {
double tmp;
if (a <= 2.8e+153) {
tmp = Math.pow((b * Math.cos((angle / (-180.0 / Math.PI)))), 2.0);
} else {
tmp = Math.pow((a * Math.sin((angle * (Math.PI * 0.005555555555555556)))), 2.0);
}
return tmp;
}
def code(a, b, angle): tmp = 0 if a <= 2.8e+153: tmp = math.pow((b * math.cos((angle / (-180.0 / math.pi)))), 2.0) else: tmp = math.pow((a * math.sin((angle * (math.pi * 0.005555555555555556)))), 2.0) return tmp
function code(a, b, angle) tmp = 0.0 if (a <= 2.8e+153) tmp = Float64(b * cos(Float64(angle / Float64(-180.0 / pi)))) ^ 2.0; else tmp = Float64(a * sin(Float64(angle * Float64(pi * 0.005555555555555556)))) ^ 2.0; end return tmp end
function tmp_2 = code(a, b, angle) tmp = 0.0; if (a <= 2.8e+153) tmp = (b * cos((angle / (-180.0 / pi)))) ^ 2.0; else tmp = (a * sin((angle * (pi * 0.005555555555555556)))) ^ 2.0; end tmp_2 = tmp; end
code[a_, b_, angle_] := If[LessEqual[a, 2.8e+153], N[Power[N[(b * N[Cos[N[(angle / N[(-180.0 / Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision], N[Power[N[(a * N[Sin[N[(angle * N[(Pi * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq 2.8 \cdot 10^{+153}:\\
\;\;\;\;{\left(b \cdot \cos \left(\frac{angle}{\frac{-180}{\pi}}\right)\right)}^{2}\\
\mathbf{else}:\\
\;\;\;\;{\left(a \cdot \sin \left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right)\right)}^{2}\\
\end{array}
\end{array}
if a < 2.79999999999999985e153Initial program 75.8%
associate-*l/75.8%
associate-*r/75.8%
add-exp-log38.1%
div-inv38.1%
metadata-eval38.1%
Applied egg-rr38.1%
Taylor expanded in a around 0 58.0%
unpow258.0%
*-commutative58.0%
associate-*r*58.0%
unpow258.0%
swap-sqr58.0%
unpow258.0%
Simplified58.0%
if 2.79999999999999985e153 < a Initial program 99.7%
associate-*l/99.7%
Applied egg-rr99.7%
*-commutative99.7%
clear-num99.6%
un-div-inv99.7%
Applied egg-rr99.7%
Taylor expanded in a around inf 67.0%
unpow267.0%
*-commutative67.0%
*-commutative67.0%
associate-*r*67.0%
unpow267.0%
swap-sqr88.2%
unpow288.2%
*-commutative88.2%
associate-*l*88.3%
Simplified88.3%
Final simplification61.9%
(FPCore (a b angle) :precision binary64 (if (<= a 3.2e+153) (pow (* b (cos (* (* PI angle) 0.005555555555555556))) 2.0) (pow (* a (sin (* angle (* PI 0.005555555555555556)))) 2.0)))
double code(double a, double b, double angle) {
double tmp;
if (a <= 3.2e+153) {
tmp = pow((b * cos(((((double) M_PI) * angle) * 0.005555555555555556))), 2.0);
} else {
tmp = pow((a * sin((angle * (((double) M_PI) * 0.005555555555555556)))), 2.0);
}
return tmp;
}
public static double code(double a, double b, double angle) {
double tmp;
if (a <= 3.2e+153) {
tmp = Math.pow((b * Math.cos(((Math.PI * angle) * 0.005555555555555556))), 2.0);
} else {
tmp = Math.pow((a * Math.sin((angle * (Math.PI * 0.005555555555555556)))), 2.0);
}
return tmp;
}
def code(a, b, angle): tmp = 0 if a <= 3.2e+153: tmp = math.pow((b * math.cos(((math.pi * angle) * 0.005555555555555556))), 2.0) else: tmp = math.pow((a * math.sin((angle * (math.pi * 0.005555555555555556)))), 2.0) return tmp
function code(a, b, angle) tmp = 0.0 if (a <= 3.2e+153) tmp = Float64(b * cos(Float64(Float64(pi * angle) * 0.005555555555555556))) ^ 2.0; else tmp = Float64(a * sin(Float64(angle * Float64(pi * 0.005555555555555556)))) ^ 2.0; end return tmp end
function tmp_2 = code(a, b, angle) tmp = 0.0; if (a <= 3.2e+153) tmp = (b * cos(((pi * angle) * 0.005555555555555556))) ^ 2.0; else tmp = (a * sin((angle * (pi * 0.005555555555555556)))) ^ 2.0; end tmp_2 = tmp; end
code[a_, b_, angle_] := If[LessEqual[a, 3.2e+153], N[Power[N[(b * N[Cos[N[(N[(Pi * angle), $MachinePrecision] * 0.005555555555555556), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision], N[Power[N[(a * N[Sin[N[(angle * N[(Pi * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq 3.2 \cdot 10^{+153}:\\
\;\;\;\;{\left(b \cdot \cos \left(\left(\pi \cdot angle\right) \cdot 0.005555555555555556\right)\right)}^{2}\\
\mathbf{else}:\\
\;\;\;\;{\left(a \cdot \sin \left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right)\right)}^{2}\\
\end{array}
\end{array}
if a < 3.2000000000000001e153Initial program 75.8%
unpow275.8%
associate-*l/75.8%
associate-/l*75.9%
unpow275.9%
Simplified75.8%
Taylor expanded in a around 0 58.0%
*-commutative58.0%
associate-*r*58.0%
unpow258.0%
unpow258.0%
swap-sqr58.0%
unpow258.0%
associate-*r*58.0%
*-commutative58.0%
Simplified58.0%
if 3.2000000000000001e153 < a Initial program 99.7%
associate-*l/99.7%
Applied egg-rr99.7%
*-commutative99.7%
clear-num99.6%
un-div-inv99.7%
Applied egg-rr99.7%
Taylor expanded in a around inf 67.0%
unpow267.0%
*-commutative67.0%
*-commutative67.0%
associate-*r*67.0%
unpow267.0%
swap-sqr88.2%
unpow288.2%
*-commutative88.2%
associate-*l*88.3%
Simplified88.3%
Final simplification61.9%
(FPCore (a b angle) :precision binary64 (if (<= a 3.05e+153) (* b b) (pow (* a (sin (* angle (* PI 0.005555555555555556)))) 2.0)))
double code(double a, double b, double angle) {
double tmp;
if (a <= 3.05e+153) {
tmp = b * b;
} else {
tmp = pow((a * sin((angle * (((double) M_PI) * 0.005555555555555556)))), 2.0);
}
return tmp;
}
public static double code(double a, double b, double angle) {
double tmp;
if (a <= 3.05e+153) {
tmp = b * b;
} else {
tmp = Math.pow((a * Math.sin((angle * (Math.PI * 0.005555555555555556)))), 2.0);
}
return tmp;
}
def code(a, b, angle): tmp = 0 if a <= 3.05e+153: tmp = b * b else: tmp = math.pow((a * math.sin((angle * (math.pi * 0.005555555555555556)))), 2.0) return tmp
function code(a, b, angle) tmp = 0.0 if (a <= 3.05e+153) tmp = Float64(b * b); else tmp = Float64(a * sin(Float64(angle * Float64(pi * 0.005555555555555556)))) ^ 2.0; end return tmp end
function tmp_2 = code(a, b, angle) tmp = 0.0; if (a <= 3.05e+153) tmp = b * b; else tmp = (a * sin((angle * (pi * 0.005555555555555556)))) ^ 2.0; end tmp_2 = tmp; end
code[a_, b_, angle_] := If[LessEqual[a, 3.05e+153], N[(b * b), $MachinePrecision], N[Power[N[(a * N[Sin[N[(angle * N[(Pi * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq 3.05 \cdot 10^{+153}:\\
\;\;\;\;b \cdot b\\
\mathbf{else}:\\
\;\;\;\;{\left(a \cdot \sin \left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right)\right)}^{2}\\
\end{array}
\end{array}
if a < 3.0499999999999999e153Initial program 75.8%
unpow275.8%
associate-*l/75.8%
associate-/l*75.9%
unpow275.9%
Simplified75.8%
Taylor expanded in angle around 0 58.0%
unpow258.0%
Applied egg-rr58.0%
if 3.0499999999999999e153 < a Initial program 99.7%
associate-*l/99.7%
Applied egg-rr99.7%
*-commutative99.7%
clear-num99.6%
un-div-inv99.7%
Applied egg-rr99.7%
Taylor expanded in a around inf 67.0%
unpow267.0%
*-commutative67.0%
*-commutative67.0%
associate-*r*67.0%
unpow267.0%
swap-sqr88.2%
unpow288.2%
*-commutative88.2%
associate-*l*88.3%
Simplified88.3%
Final simplification61.9%
(FPCore (a b angle) :precision binary64 (if (<= a 3.5e+153) (* b b) (pow (* a (sin (* (* PI angle) 0.005555555555555556))) 2.0)))
double code(double a, double b, double angle) {
double tmp;
if (a <= 3.5e+153) {
tmp = b * b;
} else {
tmp = pow((a * sin(((((double) M_PI) * angle) * 0.005555555555555556))), 2.0);
}
return tmp;
}
public static double code(double a, double b, double angle) {
double tmp;
if (a <= 3.5e+153) {
tmp = b * b;
} else {
tmp = Math.pow((a * Math.sin(((Math.PI * angle) * 0.005555555555555556))), 2.0);
}
return tmp;
}
def code(a, b, angle): tmp = 0 if a <= 3.5e+153: tmp = b * b else: tmp = math.pow((a * math.sin(((math.pi * angle) * 0.005555555555555556))), 2.0) return tmp
function code(a, b, angle) tmp = 0.0 if (a <= 3.5e+153) tmp = Float64(b * b); else tmp = Float64(a * sin(Float64(Float64(pi * angle) * 0.005555555555555556))) ^ 2.0; end return tmp end
function tmp_2 = code(a, b, angle) tmp = 0.0; if (a <= 3.5e+153) tmp = b * b; else tmp = (a * sin(((pi * angle) * 0.005555555555555556))) ^ 2.0; end tmp_2 = tmp; end
code[a_, b_, angle_] := If[LessEqual[a, 3.5e+153], N[(b * b), $MachinePrecision], N[Power[N[(a * N[Sin[N[(N[(Pi * angle), $MachinePrecision] * 0.005555555555555556), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq 3.5 \cdot 10^{+153}:\\
\;\;\;\;b \cdot b\\
\mathbf{else}:\\
\;\;\;\;{\left(a \cdot \sin \left(\left(\pi \cdot angle\right) \cdot 0.005555555555555556\right)\right)}^{2}\\
\end{array}
\end{array}
if a < 3.4999999999999999e153Initial program 75.8%
unpow275.8%
associate-*l/75.8%
associate-/l*75.9%
unpow275.9%
Simplified75.8%
Taylor expanded in angle around 0 58.0%
unpow258.0%
Applied egg-rr58.0%
if 3.4999999999999999e153 < a Initial program 99.7%
unpow299.7%
associate-*l/99.5%
associate-/l*99.9%
unpow299.9%
Simplified99.9%
Taylor expanded in a around inf 67.0%
unpow267.0%
*-commutative67.0%
associate-*r*67.0%
unpow267.0%
swap-sqr88.3%
unpow288.3%
associate-*r*88.3%
*-commutative88.3%
Simplified88.3%
Final simplification61.9%
(FPCore (a b angle) :precision binary64 (if (<= a 2.9e+153) (* b b) (pow (* PI (* a (* angle 0.005555555555555556))) 2.0)))
double code(double a, double b, double angle) {
double tmp;
if (a <= 2.9e+153) {
tmp = b * b;
} else {
tmp = pow((((double) M_PI) * (a * (angle * 0.005555555555555556))), 2.0);
}
return tmp;
}
public static double code(double a, double b, double angle) {
double tmp;
if (a <= 2.9e+153) {
tmp = b * b;
} else {
tmp = Math.pow((Math.PI * (a * (angle * 0.005555555555555556))), 2.0);
}
return tmp;
}
def code(a, b, angle): tmp = 0 if a <= 2.9e+153: tmp = b * b else: tmp = math.pow((math.pi * (a * (angle * 0.005555555555555556))), 2.0) return tmp
function code(a, b, angle) tmp = 0.0 if (a <= 2.9e+153) tmp = Float64(b * b); else tmp = Float64(pi * Float64(a * Float64(angle * 0.005555555555555556))) ^ 2.0; end return tmp end
function tmp_2 = code(a, b, angle) tmp = 0.0; if (a <= 2.9e+153) tmp = b * b; else tmp = (pi * (a * (angle * 0.005555555555555556))) ^ 2.0; end tmp_2 = tmp; end
code[a_, b_, angle_] := If[LessEqual[a, 2.9e+153], N[(b * b), $MachinePrecision], N[Power[N[(Pi * N[(a * N[(angle * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq 2.9 \cdot 10^{+153}:\\
\;\;\;\;b \cdot b\\
\mathbf{else}:\\
\;\;\;\;{\left(\pi \cdot \left(a \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)}^{2}\\
\end{array}
\end{array}
if a < 2.90000000000000002e153Initial program 75.8%
unpow275.8%
associate-*l/75.8%
associate-/l*75.9%
unpow275.9%
Simplified75.8%
Taylor expanded in angle around 0 58.0%
unpow258.0%
Applied egg-rr58.0%
if 2.90000000000000002e153 < a Initial program 99.7%
associate-*l/99.7%
Applied egg-rr99.7%
Taylor expanded in angle around 0 99.8%
*-commutative99.8%
*-commutative99.8%
associate-*r*99.7%
*-commutative99.7%
Simplified99.7%
Taylor expanded in angle around inf 67.0%
associate-*r*67.0%
*-commutative67.0%
*-commutative67.0%
unpow267.0%
unpow267.0%
swap-sqr67.0%
unpow267.0%
associate-*l*67.0%
unpow267.0%
swap-sqr67.0%
unpow267.0%
unpow267.0%
*-commutative67.0%
unpow267.0%
associate-*r*67.0%
metadata-eval67.0%
unpow267.0%
swap-sqr67.0%
*-commutative67.0%
*-commutative67.0%
unpow267.0%
Simplified88.3%
Final simplification61.9%
(FPCore (a b angle) :precision binary64 (* b b))
double code(double a, double b, double angle) {
return b * b;
}
real(8) function code(a, b, angle)
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: angle
code = b * b
end function
public static double code(double a, double b, double angle) {
return b * b;
}
def code(a, b, angle): return b * b
function code(a, b, angle) return Float64(b * b) end
function tmp = code(a, b, angle) tmp = b * b; end
code[a_, b_, angle_] := N[(b * b), $MachinePrecision]
\begin{array}{l}
\\
b \cdot b
\end{array}
Initial program 78.9%
unpow278.9%
associate-*l/78.9%
associate-/l*78.9%
unpow278.9%
Simplified78.9%
Taylor expanded in angle around 0 53.5%
unpow253.5%
Applied egg-rr53.5%
herbie shell --seed 2024182
(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)))