
(FPCore (a b angle) :precision binary64 (let* ((t_0 (* PI (/ angle 180.0)))) (+ (pow (* a (cos t_0)) 2.0) (pow (* b (sin t_0)) 2.0))))
double code(double a, double b, double angle) {
double t_0 = ((double) M_PI) * (angle / 180.0);
return pow((a * cos(t_0)), 2.0) + pow((b * sin(t_0)), 2.0);
}
public static double code(double a, double b, double angle) {
double t_0 = Math.PI * (angle / 180.0);
return Math.pow((a * Math.cos(t_0)), 2.0) + Math.pow((b * Math.sin(t_0)), 2.0);
}
def code(a, b, angle): t_0 = math.pi * (angle / 180.0) return math.pow((a * math.cos(t_0)), 2.0) + math.pow((b * math.sin(t_0)), 2.0)
function code(a, b, angle) t_0 = Float64(pi * Float64(angle / 180.0)) return Float64((Float64(a * cos(t_0)) ^ 2.0) + (Float64(b * sin(t_0)) ^ 2.0)) end
function tmp = code(a, b, angle) t_0 = pi * (angle / 180.0); tmp = ((a * cos(t_0)) ^ 2.0) + ((b * sin(t_0)) ^ 2.0); end
code[a_, b_, angle_] := Block[{t$95$0 = N[(Pi * N[(angle / 180.0), $MachinePrecision]), $MachinePrecision]}, N[(N[Power[N[(a * N[Cos[t$95$0], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[(b * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \pi \cdot \frac{angle}{180}\\
{\left(a \cdot \cos t\_0\right)}^{2} + {\left(b \cdot \sin t\_0\right)}^{2}
\end{array}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 17 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (a b angle) :precision binary64 (let* ((t_0 (* PI (/ angle 180.0)))) (+ (pow (* a (cos t_0)) 2.0) (pow (* b (sin t_0)) 2.0))))
double code(double a, double b, double angle) {
double t_0 = ((double) M_PI) * (angle / 180.0);
return pow((a * cos(t_0)), 2.0) + pow((b * sin(t_0)), 2.0);
}
public static double code(double a, double b, double angle) {
double t_0 = Math.PI * (angle / 180.0);
return Math.pow((a * Math.cos(t_0)), 2.0) + Math.pow((b * Math.sin(t_0)), 2.0);
}
def code(a, b, angle): t_0 = math.pi * (angle / 180.0) return math.pow((a * math.cos(t_0)), 2.0) + math.pow((b * math.sin(t_0)), 2.0)
function code(a, b, angle) t_0 = Float64(pi * Float64(angle / 180.0)) return Float64((Float64(a * cos(t_0)) ^ 2.0) + (Float64(b * sin(t_0)) ^ 2.0)) end
function tmp = code(a, b, angle) t_0 = pi * (angle / 180.0); tmp = ((a * cos(t_0)) ^ 2.0) + ((b * sin(t_0)) ^ 2.0); end
code[a_, b_, angle_] := Block[{t$95$0 = N[(Pi * N[(angle / 180.0), $MachinePrecision]), $MachinePrecision]}, N[(N[Power[N[(a * N[Cos[t$95$0], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[(b * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \pi \cdot \frac{angle}{180}\\
{\left(a \cdot \cos t\_0\right)}^{2} + {\left(b \cdot \sin t\_0\right)}^{2}
\end{array}
\end{array}
(FPCore (a b angle) :precision binary64 (+ (pow (* a (cos (* PI (* -0.005555555555555556 angle)))) 2.0) (pow (* b (log1p (expm1 (sin (* angle (* PI -0.005555555555555556)))))) 2.0)))
double code(double a, double b, double angle) {
return pow((a * cos((((double) M_PI) * (-0.005555555555555556 * angle)))), 2.0) + pow((b * log1p(expm1(sin((angle * (((double) M_PI) * -0.005555555555555556)))))), 2.0);
}
public static double code(double a, double b, double angle) {
return Math.pow((a * Math.cos((Math.PI * (-0.005555555555555556 * angle)))), 2.0) + Math.pow((b * Math.log1p(Math.expm1(Math.sin((angle * (Math.PI * -0.005555555555555556)))))), 2.0);
}
def code(a, b, angle): return math.pow((a * math.cos((math.pi * (-0.005555555555555556 * angle)))), 2.0) + math.pow((b * math.log1p(math.expm1(math.sin((angle * (math.pi * -0.005555555555555556)))))), 2.0)
function code(a, b, angle) return Float64((Float64(a * cos(Float64(pi * Float64(-0.005555555555555556 * angle)))) ^ 2.0) + (Float64(b * log1p(expm1(sin(Float64(angle * Float64(pi * -0.005555555555555556)))))) ^ 2.0)) end
code[a_, b_, angle_] := N[(N[Power[N[(a * N[Cos[N[(Pi * N[(-0.005555555555555556 * angle), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[(b * N[Log[1 + N[(Exp[N[Sin[N[(angle * N[(Pi * -0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]] - 1), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
{\left(a \cdot \cos \left(\pi \cdot \left(-0.005555555555555556 \cdot angle\right)\right)\right)}^{2} + {\left(b \cdot \mathsf{log1p}\left(\mathsf{expm1}\left(\sin \left(angle \cdot \left(\pi \cdot -0.005555555555555556\right)\right)\right)\right)\right)}^{2}
\end{array}
Initial program 74.7%
Simplified74.8%
add-sqr-sqrt35.6%
sqrt-unprod58.6%
associate-*r/58.6%
associate-*r/58.7%
frac-times58.5%
*-commutative58.5%
*-commutative58.5%
metadata-eval58.5%
metadata-eval58.5%
frac-times58.7%
associate-*r/58.6%
associate-*r/58.6%
sqrt-unprod38.7%
add-sqr-sqrt74.7%
log1p-expm1-u74.8%
Applied egg-rr74.8%
Taylor expanded in a around 0 74.6%
associate-*r*74.8%
*-commutative74.8%
Simplified74.8%
Final simplification74.8%
(FPCore (a b angle) :precision binary64 (+ (pow (* b (log1p (expm1 (sin (* angle (* PI -0.005555555555555556)))))) 2.0) (pow (* a (cos (* angle (/ PI -180.0)))) 2.0)))
double code(double a, double b, double angle) {
return pow((b * log1p(expm1(sin((angle * (((double) M_PI) * -0.005555555555555556)))))), 2.0) + pow((a * cos((angle * (((double) M_PI) / -180.0)))), 2.0);
}
public static double code(double a, double b, double angle) {
return Math.pow((b * Math.log1p(Math.expm1(Math.sin((angle * (Math.PI * -0.005555555555555556)))))), 2.0) + Math.pow((a * Math.cos((angle * (Math.PI / -180.0)))), 2.0);
}
def code(a, b, angle): return math.pow((b * math.log1p(math.expm1(math.sin((angle * (math.pi * -0.005555555555555556)))))), 2.0) + math.pow((a * math.cos((angle * (math.pi / -180.0)))), 2.0)
function code(a, b, angle) return Float64((Float64(b * log1p(expm1(sin(Float64(angle * Float64(pi * -0.005555555555555556)))))) ^ 2.0) + (Float64(a * cos(Float64(angle * Float64(pi / -180.0)))) ^ 2.0)) end
code[a_, b_, angle_] := N[(N[Power[N[(b * N[Log[1 + N[(Exp[N[Sin[N[(angle * N[(Pi * -0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]] - 1), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[(a * N[Cos[N[(angle * N[(Pi / -180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
{\left(b \cdot \mathsf{log1p}\left(\mathsf{expm1}\left(\sin \left(angle \cdot \left(\pi \cdot -0.005555555555555556\right)\right)\right)\right)\right)}^{2} + {\left(a \cdot \cos \left(angle \cdot \frac{\pi}{-180}\right)\right)}^{2}
\end{array}
Initial program 74.7%
Simplified74.8%
add-sqr-sqrt35.6%
sqrt-unprod58.6%
associate-*r/58.6%
associate-*r/58.7%
frac-times58.5%
*-commutative58.5%
*-commutative58.5%
metadata-eval58.5%
metadata-eval58.5%
frac-times58.7%
associate-*r/58.6%
associate-*r/58.6%
sqrt-unprod38.7%
add-sqr-sqrt74.7%
log1p-expm1-u74.8%
Applied egg-rr74.8%
Final simplification74.8%
(FPCore (a b angle) :precision binary64 (+ (pow (* a (cos (* angle (/ PI -180.0)))) 2.0) (pow (* b (sin (* -0.005555555555555556 (* PI angle)))) 2.0)))
double code(double a, double b, double angle) {
return pow((a * cos((angle * (((double) M_PI) / -180.0)))), 2.0) + pow((b * sin((-0.005555555555555556 * (((double) M_PI) * angle)))), 2.0);
}
public static double code(double a, double b, double angle) {
return Math.pow((a * Math.cos((angle * (Math.PI / -180.0)))), 2.0) + Math.pow((b * Math.sin((-0.005555555555555556 * (Math.PI * angle)))), 2.0);
}
def code(a, b, angle): return math.pow((a * math.cos((angle * (math.pi / -180.0)))), 2.0) + math.pow((b * math.sin((-0.005555555555555556 * (math.pi * angle)))), 2.0)
function code(a, b, angle) return Float64((Float64(a * cos(Float64(angle * Float64(pi / -180.0)))) ^ 2.0) + (Float64(b * sin(Float64(-0.005555555555555556 * Float64(pi * angle)))) ^ 2.0)) end
function tmp = code(a, b, angle) tmp = ((a * cos((angle * (pi / -180.0)))) ^ 2.0) + ((b * sin((-0.005555555555555556 * (pi * angle)))) ^ 2.0); end
code[a_, b_, angle_] := N[(N[Power[N[(a * N[Cos[N[(angle * N[(Pi / -180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[(b * N[Sin[N[(-0.005555555555555556 * N[(Pi * angle), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
{\left(a \cdot \cos \left(angle \cdot \frac{\pi}{-180}\right)\right)}^{2} + {\left(b \cdot \sin \left(-0.005555555555555556 \cdot \left(\pi \cdot angle\right)\right)\right)}^{2}
\end{array}
Initial program 74.7%
Simplified74.8%
Taylor expanded in angle around inf 74.7%
Final simplification74.7%
(FPCore (a b angle) :precision binary64 (let* ((t_0 (* angle (/ PI -180.0)))) (+ (pow (* a (cos t_0)) 2.0) (pow (* b (sin t_0)) 2.0))))
double code(double a, double b, double angle) {
double t_0 = angle * (((double) M_PI) / -180.0);
return pow((a * cos(t_0)), 2.0) + pow((b * sin(t_0)), 2.0);
}
public static double code(double a, double b, double angle) {
double t_0 = angle * (Math.PI / -180.0);
return Math.pow((a * Math.cos(t_0)), 2.0) + Math.pow((b * Math.sin(t_0)), 2.0);
}
def code(a, b, angle): t_0 = angle * (math.pi / -180.0) return math.pow((a * math.cos(t_0)), 2.0) + math.pow((b * math.sin(t_0)), 2.0)
function code(a, b, angle) t_0 = Float64(angle * Float64(pi / -180.0)) return Float64((Float64(a * cos(t_0)) ^ 2.0) + (Float64(b * sin(t_0)) ^ 2.0)) end
function tmp = code(a, b, angle) t_0 = angle * (pi / -180.0); tmp = ((a * cos(t_0)) ^ 2.0) + ((b * sin(t_0)) ^ 2.0); end
code[a_, b_, angle_] := Block[{t$95$0 = N[(angle * N[(Pi / -180.0), $MachinePrecision]), $MachinePrecision]}, N[(N[Power[N[(a * N[Cos[t$95$0], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[(b * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := angle \cdot \frac{\pi}{-180}\\
{\left(a \cdot \cos t\_0\right)}^{2} + {\left(b \cdot \sin t\_0\right)}^{2}
\end{array}
\end{array}
Initial program 74.7%
Simplified74.8%
Final simplification74.8%
(FPCore (a b angle) :precision binary64 (+ (pow (* b (sin (* -0.005555555555555556 (* PI angle)))) 2.0) (pow a 2.0)))
double code(double a, double b, double angle) {
return pow((b * sin((-0.005555555555555556 * (((double) M_PI) * angle)))), 2.0) + pow(a, 2.0);
}
public static double code(double a, double b, double angle) {
return Math.pow((b * Math.sin((-0.005555555555555556 * (Math.PI * angle)))), 2.0) + Math.pow(a, 2.0);
}
def code(a, b, angle): return math.pow((b * math.sin((-0.005555555555555556 * (math.pi * angle)))), 2.0) + math.pow(a, 2.0)
function code(a, b, angle) return Float64((Float64(b * sin(Float64(-0.005555555555555556 * Float64(pi * angle)))) ^ 2.0) + (a ^ 2.0)) end
function tmp = code(a, b, angle) tmp = ((b * sin((-0.005555555555555556 * (pi * angle)))) ^ 2.0) + (a ^ 2.0); end
code[a_, b_, angle_] := N[(N[Power[N[(b * N[Sin[N[(-0.005555555555555556 * N[(Pi * angle), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[a, 2.0], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
{\left(b \cdot \sin \left(-0.005555555555555556 \cdot \left(\pi \cdot angle\right)\right)\right)}^{2} + {a}^{2}
\end{array}
Initial program 74.7%
Simplified74.8%
Taylor expanded in angle around 0 74.3%
Taylor expanded in angle around inf 74.2%
Final simplification74.2%
(FPCore (a b angle) :precision binary64 (+ (pow (* b (sin (* angle (/ PI -180.0)))) 2.0) (pow a 2.0)))
double code(double a, double b, double angle) {
return pow((b * sin((angle * (((double) M_PI) / -180.0)))), 2.0) + pow(a, 2.0);
}
public static double code(double a, double b, double angle) {
return Math.pow((b * Math.sin((angle * (Math.PI / -180.0)))), 2.0) + Math.pow(a, 2.0);
}
def code(a, b, angle): return math.pow((b * math.sin((angle * (math.pi / -180.0)))), 2.0) + math.pow(a, 2.0)
function code(a, b, angle) return Float64((Float64(b * sin(Float64(angle * Float64(pi / -180.0)))) ^ 2.0) + (a ^ 2.0)) end
function tmp = code(a, b, angle) tmp = ((b * sin((angle * (pi / -180.0)))) ^ 2.0) + (a ^ 2.0); end
code[a_, b_, angle_] := N[(N[Power[N[(b * N[Sin[N[(angle * N[(Pi / -180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[a, 2.0], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
{\left(b \cdot \sin \left(angle \cdot \frac{\pi}{-180}\right)\right)}^{2} + {a}^{2}
\end{array}
Initial program 74.7%
Simplified74.8%
Taylor expanded in angle around 0 74.3%
Final simplification74.3%
(FPCore (a b angle)
:precision binary64
(if (<= angle 2.6e-12)
(+ (pow a 2.0) (pow (* b (* PI (* -0.005555555555555556 angle))) 2.0))
(+
(pow (* a (cos (* angle (/ PI -180.0)))) 2.0)
(*
PI
(*
(* -0.005555555555555556 angle)
(* b (* (* -0.005555555555555556 angle) (* PI b))))))))
double code(double a, double b, double angle) {
double tmp;
if (angle <= 2.6e-12) {
tmp = pow(a, 2.0) + pow((b * (((double) M_PI) * (-0.005555555555555556 * angle))), 2.0);
} else {
tmp = pow((a * cos((angle * (((double) M_PI) / -180.0)))), 2.0) + (((double) M_PI) * ((-0.005555555555555556 * angle) * (b * ((-0.005555555555555556 * angle) * (((double) M_PI) * b)))));
}
return tmp;
}
public static double code(double a, double b, double angle) {
double tmp;
if (angle <= 2.6e-12) {
tmp = Math.pow(a, 2.0) + Math.pow((b * (Math.PI * (-0.005555555555555556 * angle))), 2.0);
} else {
tmp = Math.pow((a * Math.cos((angle * (Math.PI / -180.0)))), 2.0) + (Math.PI * ((-0.005555555555555556 * angle) * (b * ((-0.005555555555555556 * angle) * (Math.PI * b)))));
}
return tmp;
}
def code(a, b, angle): tmp = 0 if angle <= 2.6e-12: tmp = math.pow(a, 2.0) + math.pow((b * (math.pi * (-0.005555555555555556 * angle))), 2.0) else: tmp = math.pow((a * math.cos((angle * (math.pi / -180.0)))), 2.0) + (math.pi * ((-0.005555555555555556 * angle) * (b * ((-0.005555555555555556 * angle) * (math.pi * b))))) return tmp
function code(a, b, angle) tmp = 0.0 if (angle <= 2.6e-12) tmp = Float64((a ^ 2.0) + (Float64(b * Float64(pi * Float64(-0.005555555555555556 * angle))) ^ 2.0)); else tmp = Float64((Float64(a * cos(Float64(angle * Float64(pi / -180.0)))) ^ 2.0) + Float64(pi * Float64(Float64(-0.005555555555555556 * angle) * Float64(b * Float64(Float64(-0.005555555555555556 * angle) * Float64(pi * b)))))); end return tmp end
function tmp_2 = code(a, b, angle) tmp = 0.0; if (angle <= 2.6e-12) tmp = (a ^ 2.0) + ((b * (pi * (-0.005555555555555556 * angle))) ^ 2.0); else tmp = ((a * cos((angle * (pi / -180.0)))) ^ 2.0) + (pi * ((-0.005555555555555556 * angle) * (b * ((-0.005555555555555556 * angle) * (pi * b))))); end tmp_2 = tmp; end
code[a_, b_, angle_] := If[LessEqual[angle, 2.6e-12], N[(N[Power[a, 2.0], $MachinePrecision] + N[Power[N[(b * N[(Pi * N[(-0.005555555555555556 * angle), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision], N[(N[Power[N[(a * N[Cos[N[(angle * N[(Pi / -180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + N[(Pi * N[(N[(-0.005555555555555556 * angle), $MachinePrecision] * N[(b * N[(N[(-0.005555555555555556 * angle), $MachinePrecision] * N[(Pi * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;angle \leq 2.6 \cdot 10^{-12}:\\
\;\;\;\;{a}^{2} + {\left(b \cdot \left(\pi \cdot \left(-0.005555555555555556 \cdot angle\right)\right)\right)}^{2}\\
\mathbf{else}:\\
\;\;\;\;{\left(a \cdot \cos \left(angle \cdot \frac{\pi}{-180}\right)\right)}^{2} + \pi \cdot \left(\left(-0.005555555555555556 \cdot angle\right) \cdot \left(b \cdot \left(\left(-0.005555555555555556 \cdot angle\right) \cdot \left(\pi \cdot b\right)\right)\right)\right)\\
\end{array}
\end{array}
if angle < 2.59999999999999983e-12Initial program 85.1%
Simplified85.1%
Taylor expanded in angle around 0 84.9%
Taylor expanded in angle around 0 80.5%
*-commutative80.5%
Simplified80.5%
unpow280.5%
associate-*r*80.5%
associate-*l*78.9%
*-commutative78.9%
associate-*l*78.9%
Applied egg-rr78.9%
Taylor expanded in angle around 0 65.6%
associate-*r*65.6%
metadata-eval65.6%
unpow265.6%
swap-sqr65.6%
*-commutative65.6%
unpow265.6%
unpow265.6%
swap-sqr65.6%
swap-sqr80.4%
unpow280.4%
associate-*r*80.5%
associate-*r*80.5%
*-commutative80.5%
associate-*r*80.5%
*-commutative80.5%
*-commutative80.5%
Simplified80.5%
if 2.59999999999999983e-12 < angle Initial program 49.1%
Simplified49.4%
Taylor expanded in angle around 0 40.6%
associate-*r*40.7%
*-commutative40.7%
associate-*r*40.6%
unpow240.6%
metadata-eval40.6%
swap-sqr40.6%
unpow240.6%
swap-sqr40.6%
associate-*r*40.6%
*-commutative40.6%
associate-*r*40.6%
associate-*r*40.6%
*-commutative40.6%
associate-*r*40.6%
unpow240.6%
Simplified40.6%
pow-prod-down42.3%
associate-*l*42.3%
Applied egg-rr42.3%
*-commutative42.3%
associate-*r*42.4%
*-commutative42.4%
associate-*r*42.4%
pow242.4%
*-commutative42.4%
associate-*r*42.4%
associate-*l*42.4%
*-commutative42.4%
*-commutative42.4%
associate-*r*43.3%
*-commutative43.3%
associate-*l*43.3%
associate-*l*43.3%
Applied egg-rr43.3%
Final simplification69.7%
(FPCore (a b angle)
:precision binary64
(if (<= b 1.45e+172)
(+
(pow (* a (cos (* angle (/ PI -180.0)))) 2.0)
(*
(* -0.005555555555555556 (* PI angle))
(* b (* (* -0.005555555555555556 angle) (* PI b)))))
(+
(pow a 2.0)
(*
(* PI b)
(*
(* -0.005555555555555556 angle)
(* -0.005555555555555556 (* PI (* angle b))))))))
double code(double a, double b, double angle) {
double tmp;
if (b <= 1.45e+172) {
tmp = pow((a * cos((angle * (((double) M_PI) / -180.0)))), 2.0) + ((-0.005555555555555556 * (((double) M_PI) * angle)) * (b * ((-0.005555555555555556 * angle) * (((double) M_PI) * b))));
} else {
tmp = pow(a, 2.0) + ((((double) M_PI) * b) * ((-0.005555555555555556 * angle) * (-0.005555555555555556 * (((double) M_PI) * (angle * b)))));
}
return tmp;
}
public static double code(double a, double b, double angle) {
double tmp;
if (b <= 1.45e+172) {
tmp = Math.pow((a * Math.cos((angle * (Math.PI / -180.0)))), 2.0) + ((-0.005555555555555556 * (Math.PI * angle)) * (b * ((-0.005555555555555556 * angle) * (Math.PI * b))));
} else {
tmp = Math.pow(a, 2.0) + ((Math.PI * b) * ((-0.005555555555555556 * angle) * (-0.005555555555555556 * (Math.PI * (angle * b)))));
}
return tmp;
}
def code(a, b, angle): tmp = 0 if b <= 1.45e+172: tmp = math.pow((a * math.cos((angle * (math.pi / -180.0)))), 2.0) + ((-0.005555555555555556 * (math.pi * angle)) * (b * ((-0.005555555555555556 * angle) * (math.pi * b)))) else: tmp = math.pow(a, 2.0) + ((math.pi * b) * ((-0.005555555555555556 * angle) * (-0.005555555555555556 * (math.pi * (angle * b))))) return tmp
function code(a, b, angle) tmp = 0.0 if (b <= 1.45e+172) tmp = Float64((Float64(a * cos(Float64(angle * Float64(pi / -180.0)))) ^ 2.0) + Float64(Float64(-0.005555555555555556 * Float64(pi * angle)) * Float64(b * Float64(Float64(-0.005555555555555556 * angle) * Float64(pi * b))))); else tmp = Float64((a ^ 2.0) + Float64(Float64(pi * b) * Float64(Float64(-0.005555555555555556 * angle) * Float64(-0.005555555555555556 * Float64(pi * Float64(angle * b)))))); end return tmp end
function tmp_2 = code(a, b, angle) tmp = 0.0; if (b <= 1.45e+172) tmp = ((a * cos((angle * (pi / -180.0)))) ^ 2.0) + ((-0.005555555555555556 * (pi * angle)) * (b * ((-0.005555555555555556 * angle) * (pi * b)))); else tmp = (a ^ 2.0) + ((pi * b) * ((-0.005555555555555556 * angle) * (-0.005555555555555556 * (pi * (angle * b))))); end tmp_2 = tmp; end
code[a_, b_, angle_] := If[LessEqual[b, 1.45e+172], N[(N[Power[N[(a * N[Cos[N[(angle * N[(Pi / -180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + N[(N[(-0.005555555555555556 * N[(Pi * angle), $MachinePrecision]), $MachinePrecision] * N[(b * N[(N[(-0.005555555555555556 * angle), $MachinePrecision] * N[(Pi * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Power[a, 2.0], $MachinePrecision] + N[(N[(Pi * b), $MachinePrecision] * N[(N[(-0.005555555555555556 * angle), $MachinePrecision] * N[(-0.005555555555555556 * N[(Pi * N[(angle * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq 1.45 \cdot 10^{+172}:\\
\;\;\;\;{\left(a \cdot \cos \left(angle \cdot \frac{\pi}{-180}\right)\right)}^{2} + \left(-0.005555555555555556 \cdot \left(\pi \cdot angle\right)\right) \cdot \left(b \cdot \left(\left(-0.005555555555555556 \cdot angle\right) \cdot \left(\pi \cdot b\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;{a}^{2} + \left(\pi \cdot b\right) \cdot \left(\left(-0.005555555555555556 \cdot angle\right) \cdot \left(-0.005555555555555556 \cdot \left(\pi \cdot \left(angle \cdot b\right)\right)\right)\right)\\
\end{array}
\end{array}
if b < 1.45e172Initial program 72.4%
Simplified72.5%
Taylor expanded in angle around 0 58.4%
associate-*r*58.4%
*-commutative58.4%
associate-*r*58.4%
unpow258.4%
metadata-eval58.4%
swap-sqr58.4%
unpow258.4%
swap-sqr58.4%
associate-*r*58.4%
*-commutative58.4%
associate-*r*58.4%
associate-*r*58.4%
*-commutative58.4%
associate-*r*58.4%
unpow258.4%
Simplified58.4%
pow-prod-down66.8%
associate-*l*66.8%
Applied egg-rr66.8%
unpow266.8%
associate-*r*66.8%
associate-*l*66.7%
associate-*r*66.7%
*-commutative66.7%
*-commutative66.7%
associate-*r*66.7%
*-commutative66.7%
associate-*r*66.7%
*-commutative66.7%
associate-*r*66.7%
associate-*l*66.7%
*-commutative66.7%
*-commutative66.7%
Applied egg-rr66.7%
if 1.45e172 < b Initial program 99.7%
Simplified99.7%
Taylor expanded in angle around 0 99.7%
Taylor expanded in angle around 0 99.7%
*-commutative99.7%
Simplified99.7%
unpow299.7%
associate-*r*99.9%
associate-*r*100.0%
*-commutative100.0%
associate-*l*100.0%
Applied egg-rr100.0%
Final simplification69.6%
(FPCore (a b angle)
:precision binary64
(+
(pow (* a (cos (* angle (/ PI -180.0)))) 2.0)
(*
b
(*
angle
(*
PI
(*
-0.005555555555555556
(* b (* PI (* -0.005555555555555556 angle)))))))))
double code(double a, double b, double angle) {
return pow((a * cos((angle * (((double) M_PI) / -180.0)))), 2.0) + (b * (angle * (((double) M_PI) * (-0.005555555555555556 * (b * (((double) M_PI) * (-0.005555555555555556 * angle)))))));
}
public static double code(double a, double b, double angle) {
return Math.pow((a * Math.cos((angle * (Math.PI / -180.0)))), 2.0) + (b * (angle * (Math.PI * (-0.005555555555555556 * (b * (Math.PI * (-0.005555555555555556 * angle)))))));
}
def code(a, b, angle): return math.pow((a * math.cos((angle * (math.pi / -180.0)))), 2.0) + (b * (angle * (math.pi * (-0.005555555555555556 * (b * (math.pi * (-0.005555555555555556 * angle)))))))
function code(a, b, angle) return Float64((Float64(a * cos(Float64(angle * Float64(pi / -180.0)))) ^ 2.0) + Float64(b * Float64(angle * Float64(pi * Float64(-0.005555555555555556 * Float64(b * Float64(pi * Float64(-0.005555555555555556 * angle)))))))) end
function tmp = code(a, b, angle) tmp = ((a * cos((angle * (pi / -180.0)))) ^ 2.0) + (b * (angle * (pi * (-0.005555555555555556 * (b * (pi * (-0.005555555555555556 * angle))))))); end
code[a_, b_, angle_] := N[(N[Power[N[(a * N[Cos[N[(angle * N[(Pi / -180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + N[(b * N[(angle * N[(Pi * N[(-0.005555555555555556 * N[(b * N[(Pi * N[(-0.005555555555555556 * angle), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
{\left(a \cdot \cos \left(angle \cdot \frac{\pi}{-180}\right)\right)}^{2} + b \cdot \left(angle \cdot \left(\pi \cdot \left(-0.005555555555555556 \cdot \left(b \cdot \left(\pi \cdot \left(-0.005555555555555556 \cdot angle\right)\right)\right)\right)\right)\right)
\end{array}
Initial program 74.7%
Simplified74.8%
Taylor expanded in angle around 0 58.6%
associate-*r*58.6%
*-commutative58.6%
associate-*r*58.6%
unpow258.6%
metadata-eval58.6%
swap-sqr58.6%
unpow258.6%
swap-sqr58.6%
associate-*r*58.6%
*-commutative58.6%
associate-*r*58.6%
associate-*r*58.6%
*-commutative58.6%
associate-*r*58.6%
unpow258.6%
Simplified58.6%
pow-prod-down69.6%
associate-*l*69.6%
Applied egg-rr69.6%
unpow269.6%
*-commutative69.6%
associate-*r*69.7%
associate-*l*69.7%
*-commutative69.7%
*-commutative69.7%
*-commutative69.7%
associate-*l*69.7%
associate-*l*69.7%
*-commutative69.7%
Applied egg-rr69.7%
associate-*r*69.7%
*-commutative69.7%
associate-*l*69.7%
associate-*r*68.8%
*-commutative68.8%
*-commutative68.8%
associate-*r*68.8%
*-commutative68.8%
*-commutative68.8%
associate-*r*68.8%
associate-*r*68.8%
*-commutative68.8%
associate-*r*68.8%
*-commutative68.8%
*-commutative68.8%
Simplified68.8%
Final simplification68.8%
(FPCore (a b angle) :precision binary64 (+ (pow a 2.0) (pow (* -0.005555555555555556 (* angle (* PI b))) 2.0)))
double code(double a, double b, double angle) {
return pow(a, 2.0) + pow((-0.005555555555555556 * (angle * (((double) M_PI) * b))), 2.0);
}
public static double code(double a, double b, double angle) {
return Math.pow(a, 2.0) + Math.pow((-0.005555555555555556 * (angle * (Math.PI * b))), 2.0);
}
def code(a, b, angle): return math.pow(a, 2.0) + math.pow((-0.005555555555555556 * (angle * (math.pi * b))), 2.0)
function code(a, b, angle) return Float64((a ^ 2.0) + (Float64(-0.005555555555555556 * Float64(angle * Float64(pi * b))) ^ 2.0)) end
function tmp = code(a, b, angle) tmp = (a ^ 2.0) + ((-0.005555555555555556 * (angle * (pi * b))) ^ 2.0); end
code[a_, b_, angle_] := N[(N[Power[a, 2.0], $MachinePrecision] + N[Power[N[(-0.005555555555555556 * N[(angle * N[(Pi * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
{a}^{2} + {\left(-0.005555555555555556 \cdot \left(angle \cdot \left(\pi \cdot b\right)\right)\right)}^{2}
\end{array}
Initial program 74.7%
Simplified74.8%
Taylor expanded in angle around 0 74.3%
Taylor expanded in angle around 0 68.7%
*-commutative68.7%
Simplified68.7%
Final simplification68.7%
(FPCore (a b angle) :precision binary64 (+ (pow a 2.0) (pow (* b (* -0.005555555555555556 (* PI angle))) 2.0)))
double code(double a, double b, double angle) {
return pow(a, 2.0) + pow((b * (-0.005555555555555556 * (((double) M_PI) * angle))), 2.0);
}
public static double code(double a, double b, double angle) {
return Math.pow(a, 2.0) + Math.pow((b * (-0.005555555555555556 * (Math.PI * angle))), 2.0);
}
def code(a, b, angle): return math.pow(a, 2.0) + math.pow((b * (-0.005555555555555556 * (math.pi * angle))), 2.0)
function code(a, b, angle) return Float64((a ^ 2.0) + (Float64(b * Float64(-0.005555555555555556 * Float64(pi * angle))) ^ 2.0)) end
function tmp = code(a, b, angle) tmp = (a ^ 2.0) + ((b * (-0.005555555555555556 * (pi * angle))) ^ 2.0); end
code[a_, b_, angle_] := N[(N[Power[a, 2.0], $MachinePrecision] + N[Power[N[(b * N[(-0.005555555555555556 * N[(Pi * angle), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
{a}^{2} + {\left(b \cdot \left(-0.005555555555555556 \cdot \left(\pi \cdot angle\right)\right)\right)}^{2}
\end{array}
Initial program 74.7%
Simplified74.8%
Taylor expanded in angle around 0 74.3%
Taylor expanded in angle around 0 68.7%
Final simplification68.7%
(FPCore (a b angle) :precision binary64 (+ (pow a 2.0) (pow (* b (* PI (* -0.005555555555555556 angle))) 2.0)))
double code(double a, double b, double angle) {
return pow(a, 2.0) + pow((b * (((double) M_PI) * (-0.005555555555555556 * angle))), 2.0);
}
public static double code(double a, double b, double angle) {
return Math.pow(a, 2.0) + Math.pow((b * (Math.PI * (-0.005555555555555556 * angle))), 2.0);
}
def code(a, b, angle): return math.pow(a, 2.0) + math.pow((b * (math.pi * (-0.005555555555555556 * angle))), 2.0)
function code(a, b, angle) return Float64((a ^ 2.0) + (Float64(b * Float64(pi * Float64(-0.005555555555555556 * angle))) ^ 2.0)) end
function tmp = code(a, b, angle) tmp = (a ^ 2.0) + ((b * (pi * (-0.005555555555555556 * angle))) ^ 2.0); end
code[a_, b_, angle_] := N[(N[Power[a, 2.0], $MachinePrecision] + N[Power[N[(b * N[(Pi * N[(-0.005555555555555556 * angle), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
{a}^{2} + {\left(b \cdot \left(\pi \cdot \left(-0.005555555555555556 \cdot angle\right)\right)\right)}^{2}
\end{array}
Initial program 74.7%
Simplified74.8%
Taylor expanded in angle around 0 74.3%
Taylor expanded in angle around 0 68.7%
*-commutative68.7%
Simplified68.7%
unpow268.7%
associate-*r*68.7%
associate-*l*67.9%
*-commutative67.9%
associate-*l*67.9%
Applied egg-rr67.9%
Taylor expanded in angle around 0 57.6%
associate-*r*57.6%
metadata-eval57.6%
unpow257.6%
swap-sqr57.6%
*-commutative57.6%
unpow257.6%
unpow257.6%
swap-sqr57.6%
swap-sqr68.7%
unpow268.7%
associate-*r*68.7%
associate-*r*68.7%
*-commutative68.7%
associate-*r*68.7%
*-commutative68.7%
*-commutative68.7%
Simplified68.7%
Final simplification68.7%
(FPCore (a b angle) :precision binary64 (+ (pow a 2.0) (* (* -0.005555555555555556 angle) (* (* PI b) (* -0.005555555555555556 (* angle (* PI b)))))))
double code(double a, double b, double angle) {
return pow(a, 2.0) + ((-0.005555555555555556 * angle) * ((((double) M_PI) * b) * (-0.005555555555555556 * (angle * (((double) M_PI) * b)))));
}
public static double code(double a, double b, double angle) {
return Math.pow(a, 2.0) + ((-0.005555555555555556 * angle) * ((Math.PI * b) * (-0.005555555555555556 * (angle * (Math.PI * b)))));
}
def code(a, b, angle): return math.pow(a, 2.0) + ((-0.005555555555555556 * angle) * ((math.pi * b) * (-0.005555555555555556 * (angle * (math.pi * b)))))
function code(a, b, angle) return Float64((a ^ 2.0) + Float64(Float64(-0.005555555555555556 * angle) * Float64(Float64(pi * b) * Float64(-0.005555555555555556 * Float64(angle * Float64(pi * b)))))) end
function tmp = code(a, b, angle) tmp = (a ^ 2.0) + ((-0.005555555555555556 * angle) * ((pi * b) * (-0.005555555555555556 * (angle * (pi * b))))); end
code[a_, b_, angle_] := N[(N[Power[a, 2.0], $MachinePrecision] + N[(N[(-0.005555555555555556 * angle), $MachinePrecision] * N[(N[(Pi * b), $MachinePrecision] * N[(-0.005555555555555556 * N[(angle * N[(Pi * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
{a}^{2} + \left(-0.005555555555555556 \cdot angle\right) \cdot \left(\left(\pi \cdot b\right) \cdot \left(-0.005555555555555556 \cdot \left(angle \cdot \left(\pi \cdot b\right)\right)\right)\right)
\end{array}
Initial program 74.7%
Simplified74.8%
Taylor expanded in angle around 0 74.3%
Taylor expanded in angle around 0 68.7%
*-commutative68.7%
Simplified68.7%
unpow268.7%
associate-*r*68.7%
associate-*l*67.9%
*-commutative67.9%
associate-*l*67.9%
Applied egg-rr67.9%
Taylor expanded in b around 0 67.9%
Final simplification67.9%
(FPCore (a b angle) :precision binary64 (+ (pow a 2.0) (* (* -0.005555555555555556 angle) (* (* PI b) (* -0.005555555555555556 (* PI (* angle b)))))))
double code(double a, double b, double angle) {
return pow(a, 2.0) + ((-0.005555555555555556 * angle) * ((((double) M_PI) * b) * (-0.005555555555555556 * (((double) M_PI) * (angle * b)))));
}
public static double code(double a, double b, double angle) {
return Math.pow(a, 2.0) + ((-0.005555555555555556 * angle) * ((Math.PI * b) * (-0.005555555555555556 * (Math.PI * (angle * b)))));
}
def code(a, b, angle): return math.pow(a, 2.0) + ((-0.005555555555555556 * angle) * ((math.pi * b) * (-0.005555555555555556 * (math.pi * (angle * b)))))
function code(a, b, angle) return Float64((a ^ 2.0) + Float64(Float64(-0.005555555555555556 * angle) * Float64(Float64(pi * b) * Float64(-0.005555555555555556 * Float64(pi * Float64(angle * b)))))) end
function tmp = code(a, b, angle) tmp = (a ^ 2.0) + ((-0.005555555555555556 * angle) * ((pi * b) * (-0.005555555555555556 * (pi * (angle * b))))); end
code[a_, b_, angle_] := N[(N[Power[a, 2.0], $MachinePrecision] + N[(N[(-0.005555555555555556 * angle), $MachinePrecision] * N[(N[(Pi * b), $MachinePrecision] * N[(-0.005555555555555556 * N[(Pi * N[(angle * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
{a}^{2} + \left(-0.005555555555555556 \cdot angle\right) \cdot \left(\left(\pi \cdot b\right) \cdot \left(-0.005555555555555556 \cdot \left(\pi \cdot \left(angle \cdot b\right)\right)\right)\right)
\end{array}
Initial program 74.7%
Simplified74.8%
Taylor expanded in angle around 0 74.3%
Taylor expanded in angle around 0 68.7%
*-commutative68.7%
Simplified68.7%
unpow268.7%
associate-*r*68.7%
associate-*l*67.9%
*-commutative67.9%
associate-*l*67.9%
Applied egg-rr67.9%
Final simplification67.9%
(FPCore (a b angle) :precision binary64 (+ (pow a 2.0) (* (* -0.005555555555555556 angle) (* (* PI b) (* -0.005555555555555556 (* b (* PI angle)))))))
double code(double a, double b, double angle) {
return pow(a, 2.0) + ((-0.005555555555555556 * angle) * ((((double) M_PI) * b) * (-0.005555555555555556 * (b * (((double) M_PI) * angle)))));
}
public static double code(double a, double b, double angle) {
return Math.pow(a, 2.0) + ((-0.005555555555555556 * angle) * ((Math.PI * b) * (-0.005555555555555556 * (b * (Math.PI * angle)))));
}
def code(a, b, angle): return math.pow(a, 2.0) + ((-0.005555555555555556 * angle) * ((math.pi * b) * (-0.005555555555555556 * (b * (math.pi * angle)))))
function code(a, b, angle) return Float64((a ^ 2.0) + Float64(Float64(-0.005555555555555556 * angle) * Float64(Float64(pi * b) * Float64(-0.005555555555555556 * Float64(b * Float64(pi * angle)))))) end
function tmp = code(a, b, angle) tmp = (a ^ 2.0) + ((-0.005555555555555556 * angle) * ((pi * b) * (-0.005555555555555556 * (b * (pi * angle))))); end
code[a_, b_, angle_] := N[(N[Power[a, 2.0], $MachinePrecision] + N[(N[(-0.005555555555555556 * angle), $MachinePrecision] * N[(N[(Pi * b), $MachinePrecision] * N[(-0.005555555555555556 * N[(b * N[(Pi * angle), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
{a}^{2} + \left(-0.005555555555555556 \cdot angle\right) \cdot \left(\left(\pi \cdot b\right) \cdot \left(-0.005555555555555556 \cdot \left(b \cdot \left(\pi \cdot angle\right)\right)\right)\right)
\end{array}
Initial program 74.7%
Simplified74.8%
Taylor expanded in angle around 0 74.3%
Taylor expanded in angle around 0 68.7%
*-commutative68.7%
Simplified68.7%
unpow268.7%
associate-*r*68.7%
associate-*l*67.9%
*-commutative67.9%
associate-*l*67.9%
Applied egg-rr67.9%
Taylor expanded in b around 0 67.9%
*-commutative67.9%
associate-*r*67.9%
Simplified67.9%
Final simplification67.9%
(FPCore (a b angle) :precision binary64 (let* ((t_0 (* -0.005555555555555556 (* PI (* angle b))))) (+ (pow a 2.0) (* t_0 t_0))))
double code(double a, double b, double angle) {
double t_0 = -0.005555555555555556 * (((double) M_PI) * (angle * b));
return pow(a, 2.0) + (t_0 * t_0);
}
public static double code(double a, double b, double angle) {
double t_0 = -0.005555555555555556 * (Math.PI * (angle * b));
return Math.pow(a, 2.0) + (t_0 * t_0);
}
def code(a, b, angle): t_0 = -0.005555555555555556 * (math.pi * (angle * b)) return math.pow(a, 2.0) + (t_0 * t_0)
function code(a, b, angle) t_0 = Float64(-0.005555555555555556 * Float64(pi * Float64(angle * b))) return Float64((a ^ 2.0) + Float64(t_0 * t_0)) end
function tmp = code(a, b, angle) t_0 = -0.005555555555555556 * (pi * (angle * b)); tmp = (a ^ 2.0) + (t_0 * t_0); end
code[a_, b_, angle_] := Block[{t$95$0 = N[(-0.005555555555555556 * N[(Pi * N[(angle * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, N[(N[Power[a, 2.0], $MachinePrecision] + N[(t$95$0 * t$95$0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := -0.005555555555555556 \cdot \left(\pi \cdot \left(angle \cdot b\right)\right)\\
{a}^{2} + t\_0 \cdot t\_0
\end{array}
\end{array}
Initial program 74.7%
Simplified74.8%
Taylor expanded in angle around 0 74.3%
Taylor expanded in angle around 0 68.7%
*-commutative68.7%
Simplified68.7%
unpow268.7%
*-commutative68.7%
associate-*l*68.8%
*-commutative68.8%
associate-*l*68.7%
Applied egg-rr68.7%
Final simplification68.7%
(FPCore (a b angle)
:precision binary64
(let* ((t_0 (* PI (* angle b))))
(+
(pow a 2.0)
(* t_0 (* -0.005555555555555556 (* -0.005555555555555556 t_0))))))
double code(double a, double b, double angle) {
double t_0 = ((double) M_PI) * (angle * b);
return pow(a, 2.0) + (t_0 * (-0.005555555555555556 * (-0.005555555555555556 * t_0)));
}
public static double code(double a, double b, double angle) {
double t_0 = Math.PI * (angle * b);
return Math.pow(a, 2.0) + (t_0 * (-0.005555555555555556 * (-0.005555555555555556 * t_0)));
}
def code(a, b, angle): t_0 = math.pi * (angle * b) return math.pow(a, 2.0) + (t_0 * (-0.005555555555555556 * (-0.005555555555555556 * t_0)))
function code(a, b, angle) t_0 = Float64(pi * Float64(angle * b)) return Float64((a ^ 2.0) + Float64(t_0 * Float64(-0.005555555555555556 * Float64(-0.005555555555555556 * t_0)))) end
function tmp = code(a, b, angle) t_0 = pi * (angle * b); tmp = (a ^ 2.0) + (t_0 * (-0.005555555555555556 * (-0.005555555555555556 * t_0))); end
code[a_, b_, angle_] := Block[{t$95$0 = N[(Pi * N[(angle * b), $MachinePrecision]), $MachinePrecision]}, N[(N[Power[a, 2.0], $MachinePrecision] + N[(t$95$0 * N[(-0.005555555555555556 * N[(-0.005555555555555556 * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \pi \cdot \left(angle \cdot b\right)\\
{a}^{2} + t\_0 \cdot \left(-0.005555555555555556 \cdot \left(-0.005555555555555556 \cdot t\_0\right)\right)
\end{array}
\end{array}
Initial program 74.7%
Simplified74.8%
Taylor expanded in angle around 0 74.3%
Taylor expanded in angle around 0 68.7%
*-commutative68.7%
Simplified68.7%
unpow268.7%
associate-*r*68.7%
*-commutative68.7%
associate-*l*68.7%
*-commutative68.7%
associate-*l*68.7%
Applied egg-rr68.7%
Final simplification68.7%
herbie shell --seed 2024044
(FPCore (a b angle)
:name "ab-angle->ABCF C"
:precision binary64
(+ (pow (* a (cos (* PI (/ angle 180.0)))) 2.0) (pow (* b (sin (* PI (/ angle 180.0)))) 2.0)))