
(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 15 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}
angle_m = (fabs.f64 angle)
(FPCore (a b angle_m)
:precision binary64
(let* ((t_0 (cbrt (* PI (* angle_m 0.005555555555555556))))
(t_1 (* angle_m (* 0.005555555555555556 PI))))
(+
(pow
(*
a
(cos
(*
(* (pow (cbrt t_1) 2.0) (exp (* 0.16666666666666666 (log t_1))))
(*
(pow (pow t_0 2.0) 0.16666666666666666)
(pow t_0 0.16666666666666666)))))
2.0)
(pow (* b (sin (/ PI (/ 180.0 angle_m)))) 2.0))))angle_m = fabs(angle);
double code(double a, double b, double angle_m) {
double t_0 = cbrt((((double) M_PI) * (angle_m * 0.005555555555555556)));
double t_1 = angle_m * (0.005555555555555556 * ((double) M_PI));
return pow((a * cos(((pow(cbrt(t_1), 2.0) * exp((0.16666666666666666 * log(t_1)))) * (pow(pow(t_0, 2.0), 0.16666666666666666) * pow(t_0, 0.16666666666666666))))), 2.0) + pow((b * sin((((double) M_PI) / (180.0 / angle_m)))), 2.0);
}
angle_m = Math.abs(angle);
public static double code(double a, double b, double angle_m) {
double t_0 = Math.cbrt((Math.PI * (angle_m * 0.005555555555555556)));
double t_1 = angle_m * (0.005555555555555556 * Math.PI);
return Math.pow((a * Math.cos(((Math.pow(Math.cbrt(t_1), 2.0) * Math.exp((0.16666666666666666 * Math.log(t_1)))) * (Math.pow(Math.pow(t_0, 2.0), 0.16666666666666666) * Math.pow(t_0, 0.16666666666666666))))), 2.0) + Math.pow((b * Math.sin((Math.PI / (180.0 / angle_m)))), 2.0);
}
angle_m = abs(angle) function code(a, b, angle_m) t_0 = cbrt(Float64(pi * Float64(angle_m * 0.005555555555555556))) t_1 = Float64(angle_m * Float64(0.005555555555555556 * pi)) return Float64((Float64(a * cos(Float64(Float64((cbrt(t_1) ^ 2.0) * exp(Float64(0.16666666666666666 * log(t_1)))) * Float64(((t_0 ^ 2.0) ^ 0.16666666666666666) * (t_0 ^ 0.16666666666666666))))) ^ 2.0) + (Float64(b * sin(Float64(pi / Float64(180.0 / angle_m)))) ^ 2.0)) end
angle_m = N[Abs[angle], $MachinePrecision]
code[a_, b_, angle$95$m_] := Block[{t$95$0 = N[Power[N[(Pi * N[(angle$95$m * 0.005555555555555556), $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision]}, Block[{t$95$1 = N[(angle$95$m * N[(0.005555555555555556 * Pi), $MachinePrecision]), $MachinePrecision]}, N[(N[Power[N[(a * N[Cos[N[(N[(N[Power[N[Power[t$95$1, 1/3], $MachinePrecision], 2.0], $MachinePrecision] * N[Exp[N[(0.16666666666666666 * N[Log[t$95$1], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(N[Power[N[Power[t$95$0, 2.0], $MachinePrecision], 0.16666666666666666], $MachinePrecision] * N[Power[t$95$0, 0.16666666666666666], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[(b * N[Sin[N[(Pi / N[(180.0 / angle$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
angle_m = \left|angle\right|
\\
\begin{array}{l}
t_0 := \sqrt[3]{\pi \cdot \left(angle\_m \cdot 0.005555555555555556\right)}\\
t_1 := angle\_m \cdot \left(0.005555555555555556 \cdot \pi\right)\\
{\left(a \cdot \cos \left(\left({\left(\sqrt[3]{t\_1}\right)}^{2} \cdot e^{0.16666666666666666 \cdot \log t\_1}\right) \cdot \left({\left({t\_0}^{2}\right)}^{0.16666666666666666} \cdot {t\_0}^{0.16666666666666666}\right)\right)\right)}^{2} + {\left(b \cdot \sin \left(\frac{\pi}{\frac{180}{angle\_m}}\right)\right)}^{2}
\end{array}
\end{array}
Initial program 82.6%
Simplified82.6%
metadata-eval82.6%
div-inv82.6%
clear-num82.6%
un-div-inv82.7%
Applied egg-rr82.7%
metadata-eval82.7%
div-inv82.7%
add-cube-cbrt82.6%
pow382.6%
pow-to-exp37.9%
div-inv37.9%
metadata-eval37.9%
Applied egg-rr37.9%
Applied egg-rr37.9%
add-exp-log37.9%
log-pow37.9%
Applied egg-rr37.9%
add-cube-cbrt37.9%
unpow237.9%
unpow-prod-down37.9%
Applied egg-rr37.9%
associate-*r*37.9%
associate-*r*37.9%
Simplified37.9%
Final simplification37.9%
angle_m = (fabs.f64 angle)
(FPCore (a b angle_m)
:precision binary64
(+
(pow (* b (sin (/ PI (/ 180.0 angle_m)))) 2.0)
(pow
(*
a
(cos (exp (* (log (cbrt (* PI (* angle_m 0.005555555555555556)))) 3.0))))
2.0)))angle_m = fabs(angle);
double code(double a, double b, double angle_m) {
return pow((b * sin((((double) M_PI) / (180.0 / angle_m)))), 2.0) + pow((a * cos(exp((log(cbrt((((double) M_PI) * (angle_m * 0.005555555555555556)))) * 3.0)))), 2.0);
}
angle_m = Math.abs(angle);
public static double code(double a, double b, double angle_m) {
return Math.pow((b * Math.sin((Math.PI / (180.0 / angle_m)))), 2.0) + Math.pow((a * Math.cos(Math.exp((Math.log(Math.cbrt((Math.PI * (angle_m * 0.005555555555555556)))) * 3.0)))), 2.0);
}
angle_m = abs(angle) function code(a, b, angle_m) return Float64((Float64(b * sin(Float64(pi / Float64(180.0 / angle_m)))) ^ 2.0) + (Float64(a * cos(exp(Float64(log(cbrt(Float64(pi * Float64(angle_m * 0.005555555555555556)))) * 3.0)))) ^ 2.0)) end
angle_m = N[Abs[angle], $MachinePrecision] code[a_, b_, angle$95$m_] := N[(N[Power[N[(b * N[Sin[N[(Pi / N[(180.0 / angle$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[(a * N[Cos[N[Exp[N[(N[Log[N[Power[N[(Pi * N[(angle$95$m * 0.005555555555555556), $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision]], $MachinePrecision] * 3.0), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
angle_m = \left|angle\right|
\\
{\left(b \cdot \sin \left(\frac{\pi}{\frac{180}{angle\_m}}\right)\right)}^{2} + {\left(a \cdot \cos \left(e^{\log \left(\sqrt[3]{\pi \cdot \left(angle\_m \cdot 0.005555555555555556\right)}\right) \cdot 3}\right)\right)}^{2}
\end{array}
Initial program 82.6%
Simplified82.6%
metadata-eval82.6%
div-inv82.6%
clear-num82.6%
un-div-inv82.7%
Applied egg-rr82.7%
metadata-eval82.7%
div-inv82.7%
add-cube-cbrt82.6%
pow382.6%
pow-to-exp37.9%
div-inv37.9%
metadata-eval37.9%
Applied egg-rr37.9%
Final simplification37.9%
angle_m = (fabs.f64 angle) (FPCore (a b angle_m) :precision binary64 (+ (pow (* b (sin (/ PI (/ 180.0 angle_m)))) 2.0) (pow (* a (cos (* PI (/ 1.0 (/ 180.0 angle_m))))) 2.0)))
angle_m = fabs(angle);
double code(double a, double b, double angle_m) {
return pow((b * sin((((double) M_PI) / (180.0 / angle_m)))), 2.0) + pow((a * cos((((double) M_PI) * (1.0 / (180.0 / angle_m))))), 2.0);
}
angle_m = Math.abs(angle);
public static double code(double a, double b, double angle_m) {
return Math.pow((b * Math.sin((Math.PI / (180.0 / angle_m)))), 2.0) + Math.pow((a * Math.cos((Math.PI * (1.0 / (180.0 / angle_m))))), 2.0);
}
angle_m = math.fabs(angle) def code(a, b, angle_m): return math.pow((b * math.sin((math.pi / (180.0 / angle_m)))), 2.0) + math.pow((a * math.cos((math.pi * (1.0 / (180.0 / angle_m))))), 2.0)
angle_m = abs(angle) function code(a, b, angle_m) return Float64((Float64(b * sin(Float64(pi / Float64(180.0 / angle_m)))) ^ 2.0) + (Float64(a * cos(Float64(pi * Float64(1.0 / Float64(180.0 / angle_m))))) ^ 2.0)) end
angle_m = abs(angle); function tmp = code(a, b, angle_m) tmp = ((b * sin((pi / (180.0 / angle_m)))) ^ 2.0) + ((a * cos((pi * (1.0 / (180.0 / angle_m))))) ^ 2.0); end
angle_m = N[Abs[angle], $MachinePrecision] code[a_, b_, angle$95$m_] := N[(N[Power[N[(b * N[Sin[N[(Pi / N[(180.0 / angle$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[(a * N[Cos[N[(Pi * N[(1.0 / N[(180.0 / angle$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
angle_m = \left|angle\right|
\\
{\left(b \cdot \sin \left(\frac{\pi}{\frac{180}{angle\_m}}\right)\right)}^{2} + {\left(a \cdot \cos \left(\pi \cdot \frac{1}{\frac{180}{angle\_m}}\right)\right)}^{2}
\end{array}
Initial program 82.6%
Simplified82.6%
metadata-eval82.6%
div-inv82.6%
clear-num82.6%
un-div-inv82.7%
Applied egg-rr82.7%
metadata-eval82.7%
div-inv82.7%
clear-num82.7%
Applied egg-rr82.7%
Final simplification82.7%
angle_m = (fabs.f64 angle) (FPCore (a b angle_m) :precision binary64 (+ (pow (* b (sin (/ PI (/ 180.0 angle_m)))) 2.0) (pow (* a (cos (* PI (/ 0.005555555555555556 (/ 1.0 angle_m))))) 2.0)))
angle_m = fabs(angle);
double code(double a, double b, double angle_m) {
return pow((b * sin((((double) M_PI) / (180.0 / angle_m)))), 2.0) + pow((a * cos((((double) M_PI) * (0.005555555555555556 / (1.0 / angle_m))))), 2.0);
}
angle_m = Math.abs(angle);
public static double code(double a, double b, double angle_m) {
return Math.pow((b * Math.sin((Math.PI / (180.0 / angle_m)))), 2.0) + Math.pow((a * Math.cos((Math.PI * (0.005555555555555556 / (1.0 / angle_m))))), 2.0);
}
angle_m = math.fabs(angle) def code(a, b, angle_m): return math.pow((b * math.sin((math.pi / (180.0 / angle_m)))), 2.0) + math.pow((a * math.cos((math.pi * (0.005555555555555556 / (1.0 / angle_m))))), 2.0)
angle_m = abs(angle) function code(a, b, angle_m) return Float64((Float64(b * sin(Float64(pi / Float64(180.0 / angle_m)))) ^ 2.0) + (Float64(a * cos(Float64(pi * Float64(0.005555555555555556 / Float64(1.0 / angle_m))))) ^ 2.0)) end
angle_m = abs(angle); function tmp = code(a, b, angle_m) tmp = ((b * sin((pi / (180.0 / angle_m)))) ^ 2.0) + ((a * cos((pi * (0.005555555555555556 / (1.0 / angle_m))))) ^ 2.0); end
angle_m = N[Abs[angle], $MachinePrecision] code[a_, b_, angle$95$m_] := N[(N[Power[N[(b * N[Sin[N[(Pi / N[(180.0 / angle$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[(a * N[Cos[N[(Pi * N[(0.005555555555555556 / N[(1.0 / angle$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
angle_m = \left|angle\right|
\\
{\left(b \cdot \sin \left(\frac{\pi}{\frac{180}{angle\_m}}\right)\right)}^{2} + {\left(a \cdot \cos \left(\pi \cdot \frac{0.005555555555555556}{\frac{1}{angle\_m}}\right)\right)}^{2}
\end{array}
Initial program 82.6%
Simplified82.6%
metadata-eval82.6%
div-inv82.6%
clear-num82.6%
un-div-inv82.7%
Applied egg-rr82.7%
metadata-eval82.7%
div-inv82.7%
clear-num82.7%
div-inv82.6%
associate-/r*82.7%
metadata-eval82.7%
Applied egg-rr82.7%
Final simplification82.7%
angle_m = (fabs.f64 angle) (FPCore (a b angle_m) :precision binary64 (+ (pow (* b (sin (/ PI (/ 180.0 angle_m)))) 2.0) (pow (* a (cos (* angle_m (* 0.005555555555555556 PI)))) 2.0)))
angle_m = fabs(angle);
double code(double a, double b, double angle_m) {
return pow((b * sin((((double) M_PI) / (180.0 / angle_m)))), 2.0) + pow((a * cos((angle_m * (0.005555555555555556 * ((double) M_PI))))), 2.0);
}
angle_m = Math.abs(angle);
public static double code(double a, double b, double angle_m) {
return Math.pow((b * Math.sin((Math.PI / (180.0 / angle_m)))), 2.0) + Math.pow((a * Math.cos((angle_m * (0.005555555555555556 * Math.PI)))), 2.0);
}
angle_m = math.fabs(angle) def code(a, b, angle_m): return math.pow((b * math.sin((math.pi / (180.0 / angle_m)))), 2.0) + math.pow((a * math.cos((angle_m * (0.005555555555555556 * math.pi)))), 2.0)
angle_m = abs(angle) function code(a, b, angle_m) return Float64((Float64(b * sin(Float64(pi / Float64(180.0 / angle_m)))) ^ 2.0) + (Float64(a * cos(Float64(angle_m * Float64(0.005555555555555556 * pi)))) ^ 2.0)) end
angle_m = abs(angle); function tmp = code(a, b, angle_m) tmp = ((b * sin((pi / (180.0 / angle_m)))) ^ 2.0) + ((a * cos((angle_m * (0.005555555555555556 * pi)))) ^ 2.0); end
angle_m = N[Abs[angle], $MachinePrecision] code[a_, b_, angle$95$m_] := N[(N[Power[N[(b * N[Sin[N[(Pi / N[(180.0 / angle$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[(a * N[Cos[N[(angle$95$m * N[(0.005555555555555556 * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
angle_m = \left|angle\right|
\\
{\left(b \cdot \sin \left(\frac{\pi}{\frac{180}{angle\_m}}\right)\right)}^{2} + {\left(a \cdot \cos \left(angle\_m \cdot \left(0.005555555555555556 \cdot \pi\right)\right)\right)}^{2}
\end{array}
Initial program 82.6%
Simplified82.6%
metadata-eval82.6%
div-inv82.6%
clear-num82.6%
un-div-inv82.7%
Applied egg-rr82.7%
Taylor expanded in angle around inf 82.5%
associate-*r*82.7%
*-commutative82.7%
associate-*r*82.7%
Simplified82.7%
Final simplification82.7%
angle_m = (fabs.f64 angle) (FPCore (a b angle_m) :precision binary64 (+ (pow (* b (sin (/ PI (/ 180.0 angle_m)))) 2.0) (pow a 2.0)))
angle_m = fabs(angle);
double code(double a, double b, double angle_m) {
return pow((b * sin((((double) M_PI) / (180.0 / angle_m)))), 2.0) + pow(a, 2.0);
}
angle_m = Math.abs(angle);
public static double code(double a, double b, double angle_m) {
return Math.pow((b * Math.sin((Math.PI / (180.0 / angle_m)))), 2.0) + Math.pow(a, 2.0);
}
angle_m = math.fabs(angle) def code(a, b, angle_m): return math.pow((b * math.sin((math.pi / (180.0 / angle_m)))), 2.0) + math.pow(a, 2.0)
angle_m = abs(angle) function code(a, b, angle_m) return Float64((Float64(b * sin(Float64(pi / Float64(180.0 / angle_m)))) ^ 2.0) + (a ^ 2.0)) end
angle_m = abs(angle); function tmp = code(a, b, angle_m) tmp = ((b * sin((pi / (180.0 / angle_m)))) ^ 2.0) + (a ^ 2.0); end
angle_m = N[Abs[angle], $MachinePrecision] code[a_, b_, angle$95$m_] := N[(N[Power[N[(b * N[Sin[N[(Pi / N[(180.0 / angle$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[a, 2.0], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
angle_m = \left|angle\right|
\\
{\left(b \cdot \sin \left(\frac{\pi}{\frac{180}{angle\_m}}\right)\right)}^{2} + {a}^{2}
\end{array}
Initial program 82.6%
Simplified82.6%
metadata-eval82.6%
div-inv82.6%
clear-num82.6%
un-div-inv82.7%
Applied egg-rr82.7%
Taylor expanded in angle around 0 82.6%
Final simplification82.6%
angle_m = (fabs.f64 angle) (FPCore (a b angle_m) :precision binary64 (+ (pow a 2.0) (pow (* b (sin (* PI (* angle_m 0.005555555555555556)))) 2.0)))
angle_m = fabs(angle);
double code(double a, double b, double angle_m) {
return pow(a, 2.0) + pow((b * sin((((double) M_PI) * (angle_m * 0.005555555555555556)))), 2.0);
}
angle_m = Math.abs(angle);
public static double code(double a, double b, double angle_m) {
return Math.pow(a, 2.0) + Math.pow((b * Math.sin((Math.PI * (angle_m * 0.005555555555555556)))), 2.0);
}
angle_m = math.fabs(angle) def code(a, b, angle_m): return math.pow(a, 2.0) + math.pow((b * math.sin((math.pi * (angle_m * 0.005555555555555556)))), 2.0)
angle_m = abs(angle) function code(a, b, angle_m) return Float64((a ^ 2.0) + (Float64(b * sin(Float64(pi * Float64(angle_m * 0.005555555555555556)))) ^ 2.0)) end
angle_m = abs(angle); function tmp = code(a, b, angle_m) tmp = (a ^ 2.0) + ((b * sin((pi * (angle_m * 0.005555555555555556)))) ^ 2.0); end
angle_m = N[Abs[angle], $MachinePrecision] code[a_, b_, angle$95$m_] := N[(N[Power[a, 2.0], $MachinePrecision] + N[Power[N[(b * N[Sin[N[(Pi * N[(angle$95$m * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
angle_m = \left|angle\right|
\\
{a}^{2} + {\left(b \cdot \sin \left(\pi \cdot \left(angle\_m \cdot 0.005555555555555556\right)\right)\right)}^{2}
\end{array}
Initial program 82.6%
Simplified82.6%
Taylor expanded in angle around 0 82.5%
Final simplification82.5%
angle_m = (fabs.f64 angle) (FPCore (a b angle_m) :precision binary64 (+ (pow a 2.0) (pow (* b (sin (* 0.005555555555555556 (* angle_m PI)))) 2.0)))
angle_m = fabs(angle);
double code(double a, double b, double angle_m) {
return pow(a, 2.0) + pow((b * sin((0.005555555555555556 * (angle_m * ((double) M_PI))))), 2.0);
}
angle_m = Math.abs(angle);
public static double code(double a, double b, double angle_m) {
return Math.pow(a, 2.0) + Math.pow((b * Math.sin((0.005555555555555556 * (angle_m * Math.PI)))), 2.0);
}
angle_m = math.fabs(angle) def code(a, b, angle_m): return math.pow(a, 2.0) + math.pow((b * math.sin((0.005555555555555556 * (angle_m * math.pi)))), 2.0)
angle_m = abs(angle) function code(a, b, angle_m) return Float64((a ^ 2.0) + (Float64(b * sin(Float64(0.005555555555555556 * Float64(angle_m * pi)))) ^ 2.0)) end
angle_m = abs(angle); function tmp = code(a, b, angle_m) tmp = (a ^ 2.0) + ((b * sin((0.005555555555555556 * (angle_m * pi)))) ^ 2.0); end
angle_m = N[Abs[angle], $MachinePrecision] code[a_, b_, angle$95$m_] := N[(N[Power[a, 2.0], $MachinePrecision] + N[Power[N[(b * N[Sin[N[(0.005555555555555556 * N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
angle_m = \left|angle\right|
\\
{a}^{2} + {\left(b \cdot \sin \left(0.005555555555555556 \cdot \left(angle\_m \cdot \pi\right)\right)\right)}^{2}
\end{array}
Initial program 82.6%
Simplified82.6%
Taylor expanded in angle around 0 82.5%
Taylor expanded in angle around inf 82.5%
Final simplification82.5%
angle_m = (fabs.f64 angle)
(FPCore (a b angle_m)
:precision binary64
(if (<= b 2.8e-234)
(+
(pow a 2.0)
(*
angle_m
(*
(* 0.005555555555555556 PI)
(* angle_m (* b (* PI (* 0.005555555555555556 b)))))))
(+ (pow a 2.0) (pow (* b (* 0.005555555555555556 (* angle_m PI))) 2.0))))angle_m = fabs(angle);
double code(double a, double b, double angle_m) {
double tmp;
if (b <= 2.8e-234) {
tmp = pow(a, 2.0) + (angle_m * ((0.005555555555555556 * ((double) M_PI)) * (angle_m * (b * (((double) M_PI) * (0.005555555555555556 * b))))));
} else {
tmp = pow(a, 2.0) + pow((b * (0.005555555555555556 * (angle_m * ((double) M_PI)))), 2.0);
}
return tmp;
}
angle_m = Math.abs(angle);
public static double code(double a, double b, double angle_m) {
double tmp;
if (b <= 2.8e-234) {
tmp = Math.pow(a, 2.0) + (angle_m * ((0.005555555555555556 * Math.PI) * (angle_m * (b * (Math.PI * (0.005555555555555556 * b))))));
} else {
tmp = Math.pow(a, 2.0) + Math.pow((b * (0.005555555555555556 * (angle_m * Math.PI))), 2.0);
}
return tmp;
}
angle_m = math.fabs(angle) def code(a, b, angle_m): tmp = 0 if b <= 2.8e-234: tmp = math.pow(a, 2.0) + (angle_m * ((0.005555555555555556 * math.pi) * (angle_m * (b * (math.pi * (0.005555555555555556 * b)))))) else: tmp = math.pow(a, 2.0) + math.pow((b * (0.005555555555555556 * (angle_m * math.pi))), 2.0) return tmp
angle_m = abs(angle) function code(a, b, angle_m) tmp = 0.0 if (b <= 2.8e-234) tmp = Float64((a ^ 2.0) + Float64(angle_m * Float64(Float64(0.005555555555555556 * pi) * Float64(angle_m * Float64(b * Float64(pi * Float64(0.005555555555555556 * b))))))); else tmp = Float64((a ^ 2.0) + (Float64(b * Float64(0.005555555555555556 * Float64(angle_m * pi))) ^ 2.0)); end return tmp end
angle_m = abs(angle); function tmp_2 = code(a, b, angle_m) tmp = 0.0; if (b <= 2.8e-234) tmp = (a ^ 2.0) + (angle_m * ((0.005555555555555556 * pi) * (angle_m * (b * (pi * (0.005555555555555556 * b)))))); else tmp = (a ^ 2.0) + ((b * (0.005555555555555556 * (angle_m * pi))) ^ 2.0); end tmp_2 = tmp; end
angle_m = N[Abs[angle], $MachinePrecision] code[a_, b_, angle$95$m_] := If[LessEqual[b, 2.8e-234], N[(N[Power[a, 2.0], $MachinePrecision] + N[(angle$95$m * N[(N[(0.005555555555555556 * Pi), $MachinePrecision] * N[(angle$95$m * N[(b * N[(Pi * N[(0.005555555555555556 * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Power[a, 2.0], $MachinePrecision] + N[Power[N[(b * N[(0.005555555555555556 * N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
angle_m = \left|angle\right|
\\
\begin{array}{l}
\mathbf{if}\;b \leq 2.8 \cdot 10^{-234}:\\
\;\;\;\;{a}^{2} + angle\_m \cdot \left(\left(0.005555555555555556 \cdot \pi\right) \cdot \left(angle\_m \cdot \left(b \cdot \left(\pi \cdot \left(0.005555555555555556 \cdot b\right)\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;{a}^{2} + {\left(b \cdot \left(0.005555555555555556 \cdot \left(angle\_m \cdot \pi\right)\right)\right)}^{2}\\
\end{array}
\end{array}
if b < 2.7999999999999999e-234Initial program 83.3%
Simplified83.3%
Taylor expanded in angle around 0 83.2%
Taylor expanded in angle around 0 75.5%
unpow275.5%
*-commutative75.5%
associate-*l*76.3%
associate-*r*76.3%
*-commutative76.3%
associate-*l*76.3%
associate-*r*76.3%
*-commutative76.3%
associate-*r*76.3%
*-commutative76.3%
Applied egg-rr76.3%
associate-*l*76.3%
*-commutative76.3%
associate-*r*75.8%
*-commutative75.8%
*-commutative75.8%
Simplified75.8%
if 2.7999999999999999e-234 < b Initial program 81.5%
Simplified81.4%
Taylor expanded in angle around 0 81.3%
Taylor expanded in angle around 0 77.9%
Final simplification76.6%
angle_m = (fabs.f64 angle)
(FPCore (a b angle_m)
:precision binary64
(if (<= b 2.8e-234)
(+
(pow a 2.0)
(*
angle_m
(*
(* 0.005555555555555556 PI)
(* angle_m (* b (* PI (* 0.005555555555555556 b)))))))
(+ (pow a 2.0) (* 3.08641975308642e-5 (pow (* angle_m (* PI b)) 2.0)))))angle_m = fabs(angle);
double code(double a, double b, double angle_m) {
double tmp;
if (b <= 2.8e-234) {
tmp = pow(a, 2.0) + (angle_m * ((0.005555555555555556 * ((double) M_PI)) * (angle_m * (b * (((double) M_PI) * (0.005555555555555556 * b))))));
} else {
tmp = pow(a, 2.0) + (3.08641975308642e-5 * pow((angle_m * (((double) M_PI) * b)), 2.0));
}
return tmp;
}
angle_m = Math.abs(angle);
public static double code(double a, double b, double angle_m) {
double tmp;
if (b <= 2.8e-234) {
tmp = Math.pow(a, 2.0) + (angle_m * ((0.005555555555555556 * Math.PI) * (angle_m * (b * (Math.PI * (0.005555555555555556 * b))))));
} else {
tmp = Math.pow(a, 2.0) + (3.08641975308642e-5 * Math.pow((angle_m * (Math.PI * b)), 2.0));
}
return tmp;
}
angle_m = math.fabs(angle) def code(a, b, angle_m): tmp = 0 if b <= 2.8e-234: tmp = math.pow(a, 2.0) + (angle_m * ((0.005555555555555556 * math.pi) * (angle_m * (b * (math.pi * (0.005555555555555556 * b)))))) else: tmp = math.pow(a, 2.0) + (3.08641975308642e-5 * math.pow((angle_m * (math.pi * b)), 2.0)) return tmp
angle_m = abs(angle) function code(a, b, angle_m) tmp = 0.0 if (b <= 2.8e-234) tmp = Float64((a ^ 2.0) + Float64(angle_m * Float64(Float64(0.005555555555555556 * pi) * Float64(angle_m * Float64(b * Float64(pi * Float64(0.005555555555555556 * b))))))); else tmp = Float64((a ^ 2.0) + Float64(3.08641975308642e-5 * (Float64(angle_m * Float64(pi * b)) ^ 2.0))); end return tmp end
angle_m = abs(angle); function tmp_2 = code(a, b, angle_m) tmp = 0.0; if (b <= 2.8e-234) tmp = (a ^ 2.0) + (angle_m * ((0.005555555555555556 * pi) * (angle_m * (b * (pi * (0.005555555555555556 * b)))))); else tmp = (a ^ 2.0) + (3.08641975308642e-5 * ((angle_m * (pi * b)) ^ 2.0)); end tmp_2 = tmp; end
angle_m = N[Abs[angle], $MachinePrecision] code[a_, b_, angle$95$m_] := If[LessEqual[b, 2.8e-234], N[(N[Power[a, 2.0], $MachinePrecision] + N[(angle$95$m * N[(N[(0.005555555555555556 * Pi), $MachinePrecision] * N[(angle$95$m * N[(b * N[(Pi * N[(0.005555555555555556 * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Power[a, 2.0], $MachinePrecision] + N[(3.08641975308642e-5 * N[Power[N[(angle$95$m * N[(Pi * b), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
angle_m = \left|angle\right|
\\
\begin{array}{l}
\mathbf{if}\;b \leq 2.8 \cdot 10^{-234}:\\
\;\;\;\;{a}^{2} + angle\_m \cdot \left(\left(0.005555555555555556 \cdot \pi\right) \cdot \left(angle\_m \cdot \left(b \cdot \left(\pi \cdot \left(0.005555555555555556 \cdot b\right)\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;{a}^{2} + 3.08641975308642 \cdot 10^{-5} \cdot {\left(angle\_m \cdot \left(\pi \cdot b\right)\right)}^{2}\\
\end{array}
\end{array}
if b < 2.7999999999999999e-234Initial program 83.3%
Simplified83.3%
Taylor expanded in angle around 0 83.2%
Taylor expanded in angle around 0 75.5%
unpow275.5%
*-commutative75.5%
associate-*l*76.3%
associate-*r*76.3%
*-commutative76.3%
associate-*l*76.3%
associate-*r*76.3%
*-commutative76.3%
associate-*r*76.3%
*-commutative76.3%
Applied egg-rr76.3%
associate-*l*76.3%
*-commutative76.3%
associate-*r*75.8%
*-commutative75.8%
*-commutative75.8%
Simplified75.8%
if 2.7999999999999999e-234 < b Initial program 81.5%
Simplified81.4%
Taylor expanded in angle around 0 81.3%
Taylor expanded in angle around 0 77.9%
unpow277.9%
*-commutative77.9%
associate-*l*75.1%
associate-*r*75.1%
*-commutative75.1%
associate-*l*75.1%
associate-*r*75.1%
*-commutative75.1%
associate-*r*75.1%
*-commutative75.1%
Applied egg-rr75.1%
associate-*l*75.1%
*-commutative75.1%
*-commutative75.1%
*-commutative75.1%
Simplified75.1%
Taylor expanded in b around 0 75.1%
*-commutative75.1%
associate-*l*75.1%
Simplified75.1%
Taylor expanded in angle around 0 75.1%
Taylor expanded in angle around 0 64.9%
associate-*r*64.9%
unpow264.9%
unpow264.9%
unswap-sqr77.9%
*-commutative77.9%
unpow277.9%
swap-sqr77.9%
unpow277.9%
associate-*r*77.9%
*-commutative77.9%
associate-*l*77.9%
Simplified77.9%
Final simplification76.6%
angle_m = (fabs.f64 angle)
(FPCore (a b angle_m)
:precision binary64
(let* ((t_0 (* PI (* 0.005555555555555556 b))) (t_1 (* angle_m t_0)))
(if (<= b 2e-235)
(+
(pow a 2.0)
(* angle_m (* (* 0.005555555555555556 PI) (* angle_m (* b t_0)))))
(+ (pow a 2.0) (* t_1 t_1)))))angle_m = fabs(angle);
double code(double a, double b, double angle_m) {
double t_0 = ((double) M_PI) * (0.005555555555555556 * b);
double t_1 = angle_m * t_0;
double tmp;
if (b <= 2e-235) {
tmp = pow(a, 2.0) + (angle_m * ((0.005555555555555556 * ((double) M_PI)) * (angle_m * (b * t_0))));
} else {
tmp = pow(a, 2.0) + (t_1 * t_1);
}
return tmp;
}
angle_m = Math.abs(angle);
public static double code(double a, double b, double angle_m) {
double t_0 = Math.PI * (0.005555555555555556 * b);
double t_1 = angle_m * t_0;
double tmp;
if (b <= 2e-235) {
tmp = Math.pow(a, 2.0) + (angle_m * ((0.005555555555555556 * Math.PI) * (angle_m * (b * t_0))));
} else {
tmp = Math.pow(a, 2.0) + (t_1 * t_1);
}
return tmp;
}
angle_m = math.fabs(angle) def code(a, b, angle_m): t_0 = math.pi * (0.005555555555555556 * b) t_1 = angle_m * t_0 tmp = 0 if b <= 2e-235: tmp = math.pow(a, 2.0) + (angle_m * ((0.005555555555555556 * math.pi) * (angle_m * (b * t_0)))) else: tmp = math.pow(a, 2.0) + (t_1 * t_1) return tmp
angle_m = abs(angle) function code(a, b, angle_m) t_0 = Float64(pi * Float64(0.005555555555555556 * b)) t_1 = Float64(angle_m * t_0) tmp = 0.0 if (b <= 2e-235) tmp = Float64((a ^ 2.0) + Float64(angle_m * Float64(Float64(0.005555555555555556 * pi) * Float64(angle_m * Float64(b * t_0))))); else tmp = Float64((a ^ 2.0) + Float64(t_1 * t_1)); end return tmp end
angle_m = abs(angle); function tmp_2 = code(a, b, angle_m) t_0 = pi * (0.005555555555555556 * b); t_1 = angle_m * t_0; tmp = 0.0; if (b <= 2e-235) tmp = (a ^ 2.0) + (angle_m * ((0.005555555555555556 * pi) * (angle_m * (b * t_0)))); else tmp = (a ^ 2.0) + (t_1 * t_1); end tmp_2 = tmp; end
angle_m = N[Abs[angle], $MachinePrecision]
code[a_, b_, angle$95$m_] := Block[{t$95$0 = N[(Pi * N[(0.005555555555555556 * b), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(angle$95$m * t$95$0), $MachinePrecision]}, If[LessEqual[b, 2e-235], N[(N[Power[a, 2.0], $MachinePrecision] + N[(angle$95$m * N[(N[(0.005555555555555556 * Pi), $MachinePrecision] * N[(angle$95$m * N[(b * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Power[a, 2.0], $MachinePrecision] + N[(t$95$1 * t$95$1), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
angle_m = \left|angle\right|
\\
\begin{array}{l}
t_0 := \pi \cdot \left(0.005555555555555556 \cdot b\right)\\
t_1 := angle\_m \cdot t\_0\\
\mathbf{if}\;b \leq 2 \cdot 10^{-235}:\\
\;\;\;\;{a}^{2} + angle\_m \cdot \left(\left(0.005555555555555556 \cdot \pi\right) \cdot \left(angle\_m \cdot \left(b \cdot t\_0\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;{a}^{2} + t\_1 \cdot t\_1\\
\end{array}
\end{array}
if b < 1.9999999999999999e-235Initial program 83.3%
Simplified83.3%
Taylor expanded in angle around 0 83.2%
Taylor expanded in angle around 0 75.5%
unpow275.5%
*-commutative75.5%
associate-*l*76.3%
associate-*r*76.3%
*-commutative76.3%
associate-*l*76.3%
associate-*r*76.3%
*-commutative76.3%
associate-*r*76.3%
*-commutative76.3%
Applied egg-rr76.3%
associate-*l*76.3%
*-commutative76.3%
associate-*r*75.8%
*-commutative75.8%
*-commutative75.8%
Simplified75.8%
if 1.9999999999999999e-235 < b Initial program 81.5%
Simplified81.4%
Taylor expanded in angle around 0 81.3%
Taylor expanded in angle around 0 77.9%
unpow277.9%
associate-*r*77.9%
associate-*r*77.8%
*-commutative77.8%
associate-*r*77.8%
*-commutative77.8%
*-commutative77.8%
associate-*r*77.8%
*-commutative77.8%
Applied egg-rr77.8%
Final simplification76.6%
angle_m = (fabs.f64 angle)
(FPCore (a b angle_m)
:precision binary64
(let* ((t_0 (* PI (* 0.005555555555555556 b))))
(if (<= b 3.8e-222)
(+
(pow a 2.0)
(* angle_m (* (* 0.005555555555555556 PI) (* angle_m (* b t_0)))))
(+ (pow a 2.0) (* b (* angle_m (* t_0 (/ angle_m (/ 180.0 PI)))))))))angle_m = fabs(angle);
double code(double a, double b, double angle_m) {
double t_0 = ((double) M_PI) * (0.005555555555555556 * b);
double tmp;
if (b <= 3.8e-222) {
tmp = pow(a, 2.0) + (angle_m * ((0.005555555555555556 * ((double) M_PI)) * (angle_m * (b * t_0))));
} else {
tmp = pow(a, 2.0) + (b * (angle_m * (t_0 * (angle_m / (180.0 / ((double) M_PI))))));
}
return tmp;
}
angle_m = Math.abs(angle);
public static double code(double a, double b, double angle_m) {
double t_0 = Math.PI * (0.005555555555555556 * b);
double tmp;
if (b <= 3.8e-222) {
tmp = Math.pow(a, 2.0) + (angle_m * ((0.005555555555555556 * Math.PI) * (angle_m * (b * t_0))));
} else {
tmp = Math.pow(a, 2.0) + (b * (angle_m * (t_0 * (angle_m / (180.0 / Math.PI)))));
}
return tmp;
}
angle_m = math.fabs(angle) def code(a, b, angle_m): t_0 = math.pi * (0.005555555555555556 * b) tmp = 0 if b <= 3.8e-222: tmp = math.pow(a, 2.0) + (angle_m * ((0.005555555555555556 * math.pi) * (angle_m * (b * t_0)))) else: tmp = math.pow(a, 2.0) + (b * (angle_m * (t_0 * (angle_m / (180.0 / math.pi))))) return tmp
angle_m = abs(angle) function code(a, b, angle_m) t_0 = Float64(pi * Float64(0.005555555555555556 * b)) tmp = 0.0 if (b <= 3.8e-222) tmp = Float64((a ^ 2.0) + Float64(angle_m * Float64(Float64(0.005555555555555556 * pi) * Float64(angle_m * Float64(b * t_0))))); else tmp = Float64((a ^ 2.0) + Float64(b * Float64(angle_m * Float64(t_0 * Float64(angle_m / Float64(180.0 / pi)))))); end return tmp end
angle_m = abs(angle); function tmp_2 = code(a, b, angle_m) t_0 = pi * (0.005555555555555556 * b); tmp = 0.0; if (b <= 3.8e-222) tmp = (a ^ 2.0) + (angle_m * ((0.005555555555555556 * pi) * (angle_m * (b * t_0)))); else tmp = (a ^ 2.0) + (b * (angle_m * (t_0 * (angle_m / (180.0 / pi))))); end tmp_2 = tmp; end
angle_m = N[Abs[angle], $MachinePrecision]
code[a_, b_, angle$95$m_] := Block[{t$95$0 = N[(Pi * N[(0.005555555555555556 * b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, 3.8e-222], N[(N[Power[a, 2.0], $MachinePrecision] + N[(angle$95$m * N[(N[(0.005555555555555556 * Pi), $MachinePrecision] * N[(angle$95$m * N[(b * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Power[a, 2.0], $MachinePrecision] + N[(b * N[(angle$95$m * N[(t$95$0 * N[(angle$95$m / N[(180.0 / Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
angle_m = \left|angle\right|
\\
\begin{array}{l}
t_0 := \pi \cdot \left(0.005555555555555556 \cdot b\right)\\
\mathbf{if}\;b \leq 3.8 \cdot 10^{-222}:\\
\;\;\;\;{a}^{2} + angle\_m \cdot \left(\left(0.005555555555555556 \cdot \pi\right) \cdot \left(angle\_m \cdot \left(b \cdot t\_0\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;{a}^{2} + b \cdot \left(angle\_m \cdot \left(t\_0 \cdot \frac{angle\_m}{\frac{180}{\pi}}\right)\right)\\
\end{array}
\end{array}
if b < 3.79999999999999997e-222Initial program 82.9%
Simplified82.9%
Taylor expanded in angle around 0 82.8%
Taylor expanded in angle around 0 75.2%
unpow275.2%
*-commutative75.2%
associate-*l*75.9%
associate-*r*75.9%
*-commutative75.9%
associate-*l*75.9%
associate-*r*75.9%
*-commutative75.9%
associate-*r*75.9%
*-commutative75.9%
Applied egg-rr75.9%
associate-*l*75.9%
*-commutative75.9%
associate-*r*75.4%
*-commutative75.4%
*-commutative75.4%
Simplified75.4%
if 3.79999999999999997e-222 < b Initial program 82.1%
Simplified82.0%
Taylor expanded in angle around 0 82.0%
Taylor expanded in angle around 0 78.5%
unpow278.5%
*-commutative78.5%
associate-*l*75.7%
associate-*r*75.7%
*-commutative75.7%
associate-*l*75.7%
associate-*r*75.7%
*-commutative75.7%
associate-*r*75.7%
*-commutative75.7%
Applied egg-rr75.7%
associate-*r*78.6%
*-commutative78.6%
associate-*r*76.6%
associate-*r*76.6%
*-commutative76.6%
*-commutative76.6%
metadata-eval76.6%
associate-/r/76.6%
associate-*l/76.6%
*-lft-identity76.6%
*-commutative76.6%
Simplified76.6%
Final simplification75.9%
angle_m = (fabs.f64 angle)
(FPCore (a b angle_m)
:precision binary64
(let* ((t_0 (* PI (* 0.005555555555555556 b))))
(if (<= angle_m 4.5e-73)
(+
(pow a 2.0)
(* angle_m (* (* 0.005555555555555556 PI) (* b (* angle_m t_0)))))
(+
(pow a 2.0)
(* angle_m (* (* 0.005555555555555556 PI) (* angle_m (* b t_0))))))))angle_m = fabs(angle);
double code(double a, double b, double angle_m) {
double t_0 = ((double) M_PI) * (0.005555555555555556 * b);
double tmp;
if (angle_m <= 4.5e-73) {
tmp = pow(a, 2.0) + (angle_m * ((0.005555555555555556 * ((double) M_PI)) * (b * (angle_m * t_0))));
} else {
tmp = pow(a, 2.0) + (angle_m * ((0.005555555555555556 * ((double) M_PI)) * (angle_m * (b * t_0))));
}
return tmp;
}
angle_m = Math.abs(angle);
public static double code(double a, double b, double angle_m) {
double t_0 = Math.PI * (0.005555555555555556 * b);
double tmp;
if (angle_m <= 4.5e-73) {
tmp = Math.pow(a, 2.0) + (angle_m * ((0.005555555555555556 * Math.PI) * (b * (angle_m * t_0))));
} else {
tmp = Math.pow(a, 2.0) + (angle_m * ((0.005555555555555556 * Math.PI) * (angle_m * (b * t_0))));
}
return tmp;
}
angle_m = math.fabs(angle) def code(a, b, angle_m): t_0 = math.pi * (0.005555555555555556 * b) tmp = 0 if angle_m <= 4.5e-73: tmp = math.pow(a, 2.0) + (angle_m * ((0.005555555555555556 * math.pi) * (b * (angle_m * t_0)))) else: tmp = math.pow(a, 2.0) + (angle_m * ((0.005555555555555556 * math.pi) * (angle_m * (b * t_0)))) return tmp
angle_m = abs(angle) function code(a, b, angle_m) t_0 = Float64(pi * Float64(0.005555555555555556 * b)) tmp = 0.0 if (angle_m <= 4.5e-73) tmp = Float64((a ^ 2.0) + Float64(angle_m * Float64(Float64(0.005555555555555556 * pi) * Float64(b * Float64(angle_m * t_0))))); else tmp = Float64((a ^ 2.0) + Float64(angle_m * Float64(Float64(0.005555555555555556 * pi) * Float64(angle_m * Float64(b * t_0))))); end return tmp end
angle_m = abs(angle); function tmp_2 = code(a, b, angle_m) t_0 = pi * (0.005555555555555556 * b); tmp = 0.0; if (angle_m <= 4.5e-73) tmp = (a ^ 2.0) + (angle_m * ((0.005555555555555556 * pi) * (b * (angle_m * t_0)))); else tmp = (a ^ 2.0) + (angle_m * ((0.005555555555555556 * pi) * (angle_m * (b * t_0)))); end tmp_2 = tmp; end
angle_m = N[Abs[angle], $MachinePrecision]
code[a_, b_, angle$95$m_] := Block[{t$95$0 = N[(Pi * N[(0.005555555555555556 * b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[angle$95$m, 4.5e-73], N[(N[Power[a, 2.0], $MachinePrecision] + N[(angle$95$m * N[(N[(0.005555555555555556 * Pi), $MachinePrecision] * N[(b * N[(angle$95$m * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Power[a, 2.0], $MachinePrecision] + N[(angle$95$m * N[(N[(0.005555555555555556 * Pi), $MachinePrecision] * N[(angle$95$m * N[(b * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
angle_m = \left|angle\right|
\\
\begin{array}{l}
t_0 := \pi \cdot \left(0.005555555555555556 \cdot b\right)\\
\mathbf{if}\;angle\_m \leq 4.5 \cdot 10^{-73}:\\
\;\;\;\;{a}^{2} + angle\_m \cdot \left(\left(0.005555555555555556 \cdot \pi\right) \cdot \left(b \cdot \left(angle\_m \cdot t\_0\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;{a}^{2} + angle\_m \cdot \left(\left(0.005555555555555556 \cdot \pi\right) \cdot \left(angle\_m \cdot \left(b \cdot t\_0\right)\right)\right)\\
\end{array}
\end{array}
if angle < 4.5e-73Initial program 88.2%
Simplified88.2%
Taylor expanded in angle around 0 88.2%
Taylor expanded in angle around 0 83.9%
unpow283.9%
*-commutative83.9%
associate-*l*82.6%
associate-*r*82.6%
*-commutative82.6%
associate-*l*82.6%
associate-*r*82.6%
*-commutative82.6%
associate-*r*82.6%
*-commutative82.6%
Applied egg-rr82.6%
associate-*l*82.6%
*-commutative82.6%
*-commutative82.6%
*-commutative82.6%
Simplified82.6%
if 4.5e-73 < angle Initial program 68.9%
Simplified68.6%
Taylor expanded in angle around 0 68.6%
Taylor expanded in angle around 0 58.0%
unpow258.0%
*-commutative58.0%
associate-*l*59.2%
associate-*r*59.2%
*-commutative59.2%
associate-*l*59.2%
associate-*r*59.2%
*-commutative59.2%
associate-*r*59.2%
*-commutative59.2%
Applied egg-rr59.2%
associate-*l*59.2%
*-commutative59.2%
associate-*r*63.4%
*-commutative63.4%
*-commutative63.4%
Simplified63.4%
Final simplification77.0%
angle_m = (fabs.f64 angle)
(FPCore (a b angle_m)
:precision binary64
(if (<= angle_m 2.1e-141)
(+
(pow a 2.0)
(*
angle_m
(*
(* 0.005555555555555556 PI)
(* b (* 0.005555555555555556 (* angle_m (* PI b)))))))
(+
(pow a 2.0)
(*
angle_m
(*
(* 0.005555555555555556 PI)
(* angle_m (* b (* PI (* 0.005555555555555556 b)))))))))angle_m = fabs(angle);
double code(double a, double b, double angle_m) {
double tmp;
if (angle_m <= 2.1e-141) {
tmp = pow(a, 2.0) + (angle_m * ((0.005555555555555556 * ((double) M_PI)) * (b * (0.005555555555555556 * (angle_m * (((double) M_PI) * b))))));
} else {
tmp = pow(a, 2.0) + (angle_m * ((0.005555555555555556 * ((double) M_PI)) * (angle_m * (b * (((double) M_PI) * (0.005555555555555556 * b))))));
}
return tmp;
}
angle_m = Math.abs(angle);
public static double code(double a, double b, double angle_m) {
double tmp;
if (angle_m <= 2.1e-141) {
tmp = Math.pow(a, 2.0) + (angle_m * ((0.005555555555555556 * Math.PI) * (b * (0.005555555555555556 * (angle_m * (Math.PI * b))))));
} else {
tmp = Math.pow(a, 2.0) + (angle_m * ((0.005555555555555556 * Math.PI) * (angle_m * (b * (Math.PI * (0.005555555555555556 * b))))));
}
return tmp;
}
angle_m = math.fabs(angle) def code(a, b, angle_m): tmp = 0 if angle_m <= 2.1e-141: tmp = math.pow(a, 2.0) + (angle_m * ((0.005555555555555556 * math.pi) * (b * (0.005555555555555556 * (angle_m * (math.pi * b)))))) else: tmp = math.pow(a, 2.0) + (angle_m * ((0.005555555555555556 * math.pi) * (angle_m * (b * (math.pi * (0.005555555555555556 * b)))))) return tmp
angle_m = abs(angle) function code(a, b, angle_m) tmp = 0.0 if (angle_m <= 2.1e-141) tmp = Float64((a ^ 2.0) + Float64(angle_m * Float64(Float64(0.005555555555555556 * pi) * Float64(b * Float64(0.005555555555555556 * Float64(angle_m * Float64(pi * b))))))); else tmp = Float64((a ^ 2.0) + Float64(angle_m * Float64(Float64(0.005555555555555556 * pi) * Float64(angle_m * Float64(b * Float64(pi * Float64(0.005555555555555556 * b))))))); end return tmp end
angle_m = abs(angle); function tmp_2 = code(a, b, angle_m) tmp = 0.0; if (angle_m <= 2.1e-141) tmp = (a ^ 2.0) + (angle_m * ((0.005555555555555556 * pi) * (b * (0.005555555555555556 * (angle_m * (pi * b)))))); else tmp = (a ^ 2.0) + (angle_m * ((0.005555555555555556 * pi) * (angle_m * (b * (pi * (0.005555555555555556 * b)))))); end tmp_2 = tmp; end
angle_m = N[Abs[angle], $MachinePrecision] code[a_, b_, angle$95$m_] := If[LessEqual[angle$95$m, 2.1e-141], N[(N[Power[a, 2.0], $MachinePrecision] + N[(angle$95$m * N[(N[(0.005555555555555556 * Pi), $MachinePrecision] * N[(b * N[(0.005555555555555556 * N[(angle$95$m * N[(Pi * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Power[a, 2.0], $MachinePrecision] + N[(angle$95$m * N[(N[(0.005555555555555556 * Pi), $MachinePrecision] * N[(angle$95$m * N[(b * N[(Pi * N[(0.005555555555555556 * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
angle_m = \left|angle\right|
\\
\begin{array}{l}
\mathbf{if}\;angle\_m \leq 2.1 \cdot 10^{-141}:\\
\;\;\;\;{a}^{2} + angle\_m \cdot \left(\left(0.005555555555555556 \cdot \pi\right) \cdot \left(b \cdot \left(0.005555555555555556 \cdot \left(angle\_m \cdot \left(\pi \cdot b\right)\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;{a}^{2} + angle\_m \cdot \left(\left(0.005555555555555556 \cdot \pi\right) \cdot \left(angle\_m \cdot \left(b \cdot \left(\pi \cdot \left(0.005555555555555556 \cdot b\right)\right)\right)\right)\right)\\
\end{array}
\end{array}
if angle < 2.0999999999999999e-141Initial program 87.6%
Simplified87.6%
Taylor expanded in angle around 0 87.6%
Taylor expanded in angle around 0 83.1%
unpow283.1%
*-commutative83.1%
associate-*l*82.2%
associate-*r*82.2%
*-commutative82.2%
associate-*l*82.2%
associate-*r*82.2%
*-commutative82.2%
associate-*r*82.2%
*-commutative82.2%
Applied egg-rr82.2%
associate-*l*82.2%
*-commutative82.2%
*-commutative82.2%
*-commutative82.2%
Simplified82.2%
Taylor expanded in b around 0 82.2%
*-commutative82.2%
associate-*l*82.2%
Simplified82.2%
Taylor expanded in angle around 0 82.2%
if 2.0999999999999999e-141 < angle Initial program 72.3%
Simplified72.0%
Taylor expanded in angle around 0 72.0%
Taylor expanded in angle around 0 62.5%
unpow262.5%
*-commutative62.5%
associate-*l*62.6%
associate-*r*62.6%
*-commutative62.6%
associate-*l*62.6%
associate-*r*62.6%
*-commutative62.6%
associate-*r*62.6%
*-commutative62.6%
Applied egg-rr62.6%
associate-*l*62.6%
*-commutative62.6%
associate-*r*66.3%
*-commutative66.3%
*-commutative66.3%
Simplified66.3%
Final simplification77.0%
angle_m = (fabs.f64 angle)
(FPCore (a b angle_m)
:precision binary64
(+
(pow a 2.0)
(*
angle_m
(*
(* 0.005555555555555556 PI)
(* angle_m (* b (* PI (* 0.005555555555555556 b))))))))angle_m = fabs(angle);
double code(double a, double b, double angle_m) {
return pow(a, 2.0) + (angle_m * ((0.005555555555555556 * ((double) M_PI)) * (angle_m * (b * (((double) M_PI) * (0.005555555555555556 * b))))));
}
angle_m = Math.abs(angle);
public static double code(double a, double b, double angle_m) {
return Math.pow(a, 2.0) + (angle_m * ((0.005555555555555556 * Math.PI) * (angle_m * (b * (Math.PI * (0.005555555555555556 * b))))));
}
angle_m = math.fabs(angle) def code(a, b, angle_m): return math.pow(a, 2.0) + (angle_m * ((0.005555555555555556 * math.pi) * (angle_m * (b * (math.pi * (0.005555555555555556 * b))))))
angle_m = abs(angle) function code(a, b, angle_m) return Float64((a ^ 2.0) + Float64(angle_m * Float64(Float64(0.005555555555555556 * pi) * Float64(angle_m * Float64(b * Float64(pi * Float64(0.005555555555555556 * b))))))) end
angle_m = abs(angle); function tmp = code(a, b, angle_m) tmp = (a ^ 2.0) + (angle_m * ((0.005555555555555556 * pi) * (angle_m * (b * (pi * (0.005555555555555556 * b)))))); end
angle_m = N[Abs[angle], $MachinePrecision] code[a_, b_, angle$95$m_] := N[(N[Power[a, 2.0], $MachinePrecision] + N[(angle$95$m * N[(N[(0.005555555555555556 * Pi), $MachinePrecision] * N[(angle$95$m * N[(b * N[(Pi * N[(0.005555555555555556 * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
angle_m = \left|angle\right|
\\
{a}^{2} + angle\_m \cdot \left(\left(0.005555555555555556 \cdot \pi\right) \cdot \left(angle\_m \cdot \left(b \cdot \left(\pi \cdot \left(0.005555555555555556 \cdot b\right)\right)\right)\right)\right)
\end{array}
Initial program 82.6%
Simplified82.6%
Taylor expanded in angle around 0 82.5%
Taylor expanded in angle around 0 76.4%
unpow276.4%
*-commutative76.4%
associate-*l*75.8%
associate-*r*75.8%
*-commutative75.8%
associate-*l*75.8%
associate-*r*75.8%
*-commutative75.8%
associate-*r*75.8%
*-commutative75.8%
Applied egg-rr75.8%
associate-*l*75.8%
*-commutative75.8%
associate-*r*72.9%
*-commutative72.9%
*-commutative72.9%
Simplified72.9%
Final simplification72.9%
herbie shell --seed 2024107
(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)))