
(FPCore (a b angle) :precision binary64 (let* ((t_0 (* PI (/ angle 180.0)))) (* (* (* 2.0 (- (pow b 2.0) (pow a 2.0))) (sin t_0)) (cos t_0))))
double code(double a, double b, double angle) {
double t_0 = ((double) M_PI) * (angle / 180.0);
return ((2.0 * (pow(b, 2.0) - pow(a, 2.0))) * sin(t_0)) * cos(t_0);
}
public static double code(double a, double b, double angle) {
double t_0 = Math.PI * (angle / 180.0);
return ((2.0 * (Math.pow(b, 2.0) - Math.pow(a, 2.0))) * Math.sin(t_0)) * Math.cos(t_0);
}
def code(a, b, angle): t_0 = math.pi * (angle / 180.0) return ((2.0 * (math.pow(b, 2.0) - math.pow(a, 2.0))) * math.sin(t_0)) * math.cos(t_0)
function code(a, b, angle) t_0 = Float64(pi * Float64(angle / 180.0)) return Float64(Float64(Float64(2.0 * Float64((b ^ 2.0) - (a ^ 2.0))) * sin(t_0)) * cos(t_0)) end
function tmp = code(a, b, angle) t_0 = pi * (angle / 180.0); tmp = ((2.0 * ((b ^ 2.0) - (a ^ 2.0))) * sin(t_0)) * cos(t_0); end
code[a_, b_, angle_] := Block[{t$95$0 = N[(Pi * N[(angle / 180.0), $MachinePrecision]), $MachinePrecision]}, N[(N[(N[(2.0 * N[(N[Power[b, 2.0], $MachinePrecision] - N[Power[a, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision] * N[Cos[t$95$0], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \pi \cdot \frac{angle}{180}\\
\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin t\_0\right) \cdot \cos t\_0
\end{array}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 16 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (a b angle) :precision binary64 (let* ((t_0 (* PI (/ angle 180.0)))) (* (* (* 2.0 (- (pow b 2.0) (pow a 2.0))) (sin t_0)) (cos t_0))))
double code(double a, double b, double angle) {
double t_0 = ((double) M_PI) * (angle / 180.0);
return ((2.0 * (pow(b, 2.0) - pow(a, 2.0))) * sin(t_0)) * cos(t_0);
}
public static double code(double a, double b, double angle) {
double t_0 = Math.PI * (angle / 180.0);
return ((2.0 * (Math.pow(b, 2.0) - Math.pow(a, 2.0))) * Math.sin(t_0)) * Math.cos(t_0);
}
def code(a, b, angle): t_0 = math.pi * (angle / 180.0) return ((2.0 * (math.pow(b, 2.0) - math.pow(a, 2.0))) * math.sin(t_0)) * math.cos(t_0)
function code(a, b, angle) t_0 = Float64(pi * Float64(angle / 180.0)) return Float64(Float64(Float64(2.0 * Float64((b ^ 2.0) - (a ^ 2.0))) * sin(t_0)) * cos(t_0)) end
function tmp = code(a, b, angle) t_0 = pi * (angle / 180.0); tmp = ((2.0 * ((b ^ 2.0) - (a ^ 2.0))) * sin(t_0)) * cos(t_0); end
code[a_, b_, angle_] := Block[{t$95$0 = N[(Pi * N[(angle / 180.0), $MachinePrecision]), $MachinePrecision]}, N[(N[(N[(2.0 * N[(N[Power[b, 2.0], $MachinePrecision] - N[Power[a, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision] * N[Cos[t$95$0], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \pi \cdot \frac{angle}{180}\\
\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin t\_0\right) \cdot \cos t\_0
\end{array}
\end{array}
a_m = (fabs.f64 a)
b_m = (fabs.f64 b)
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a_m b_m angle_m)
:precision binary64
(let* ((t_0 (* (+ b_m a_m) (- b_m a_m)))
(t_1 (sin (* (/ angle_m 180.0) (cbrt (pow PI 3.0)))))
(t_2 (cos (* (/ angle_m 180.0) PI))))
(*
angle_s
(if (<= (/ angle_m 180.0) 4e+98)
(pow
(*
(cbrt (+ b_m a_m))
(cbrt
(*
(- b_m a_m)
(sin (* PI (* 2.0 (* angle_m 0.005555555555555556)))))))
3.0)
(if (<= (/ angle_m 180.0) 2e+151)
(* t_0 (* 2.0 (* t_1 t_2)))
(if (<= (/ angle_m 180.0) 1e+264)
(*
t_0
(*
2.0
(*
t_1
(sqrt (pow (cos (* PI (* angle_m 0.005555555555555556))) 2.0)))))
(*
t_0
(*
2.0
(*
t_2
(pow
(cbrt (sin (* 0.005555555555555556 (* angle_m PI))))
3.0))))))))))a_m = fabs(a);
b_m = fabs(b);
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a_m, double b_m, double angle_m) {
double t_0 = (b_m + a_m) * (b_m - a_m);
double t_1 = sin(((angle_m / 180.0) * cbrt(pow(((double) M_PI), 3.0))));
double t_2 = cos(((angle_m / 180.0) * ((double) M_PI)));
double tmp;
if ((angle_m / 180.0) <= 4e+98) {
tmp = pow((cbrt((b_m + a_m)) * cbrt(((b_m - a_m) * sin((((double) M_PI) * (2.0 * (angle_m * 0.005555555555555556))))))), 3.0);
} else if ((angle_m / 180.0) <= 2e+151) {
tmp = t_0 * (2.0 * (t_1 * t_2));
} else if ((angle_m / 180.0) <= 1e+264) {
tmp = t_0 * (2.0 * (t_1 * sqrt(pow(cos((((double) M_PI) * (angle_m * 0.005555555555555556))), 2.0))));
} else {
tmp = t_0 * (2.0 * (t_2 * pow(cbrt(sin((0.005555555555555556 * (angle_m * ((double) M_PI))))), 3.0)));
}
return angle_s * tmp;
}
a_m = Math.abs(a);
b_m = Math.abs(b);
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a_m, double b_m, double angle_m) {
double t_0 = (b_m + a_m) * (b_m - a_m);
double t_1 = Math.sin(((angle_m / 180.0) * Math.cbrt(Math.pow(Math.PI, 3.0))));
double t_2 = Math.cos(((angle_m / 180.0) * Math.PI));
double tmp;
if ((angle_m / 180.0) <= 4e+98) {
tmp = Math.pow((Math.cbrt((b_m + a_m)) * Math.cbrt(((b_m - a_m) * Math.sin((Math.PI * (2.0 * (angle_m * 0.005555555555555556))))))), 3.0);
} else if ((angle_m / 180.0) <= 2e+151) {
tmp = t_0 * (2.0 * (t_1 * t_2));
} else if ((angle_m / 180.0) <= 1e+264) {
tmp = t_0 * (2.0 * (t_1 * Math.sqrt(Math.pow(Math.cos((Math.PI * (angle_m * 0.005555555555555556))), 2.0))));
} else {
tmp = t_0 * (2.0 * (t_2 * Math.pow(Math.cbrt(Math.sin((0.005555555555555556 * (angle_m * Math.PI)))), 3.0)));
}
return angle_s * tmp;
}
a_m = abs(a) b_m = abs(b) angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a_m, b_m, angle_m) t_0 = Float64(Float64(b_m + a_m) * Float64(b_m - a_m)) t_1 = sin(Float64(Float64(angle_m / 180.0) * cbrt((pi ^ 3.0)))) t_2 = cos(Float64(Float64(angle_m / 180.0) * pi)) tmp = 0.0 if (Float64(angle_m / 180.0) <= 4e+98) tmp = Float64(cbrt(Float64(b_m + a_m)) * cbrt(Float64(Float64(b_m - a_m) * sin(Float64(pi * Float64(2.0 * Float64(angle_m * 0.005555555555555556))))))) ^ 3.0; elseif (Float64(angle_m / 180.0) <= 2e+151) tmp = Float64(t_0 * Float64(2.0 * Float64(t_1 * t_2))); elseif (Float64(angle_m / 180.0) <= 1e+264) tmp = Float64(t_0 * Float64(2.0 * Float64(t_1 * sqrt((cos(Float64(pi * Float64(angle_m * 0.005555555555555556))) ^ 2.0))))); else tmp = Float64(t_0 * Float64(2.0 * Float64(t_2 * (cbrt(sin(Float64(0.005555555555555556 * Float64(angle_m * pi)))) ^ 3.0)))); end return Float64(angle_s * tmp) end
a_m = N[Abs[a], $MachinePrecision]
b_m = N[Abs[b], $MachinePrecision]
angle\_m = N[Abs[angle], $MachinePrecision]
angle\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a$95$m_, b$95$m_, angle$95$m_] := Block[{t$95$0 = N[(N[(b$95$m + a$95$m), $MachinePrecision] * N[(b$95$m - a$95$m), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Sin[N[(N[(angle$95$m / 180.0), $MachinePrecision] * N[Power[N[Power[Pi, 3.0], $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Cos[N[(N[(angle$95$m / 180.0), $MachinePrecision] * Pi), $MachinePrecision]], $MachinePrecision]}, N[(angle$95$s * If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 4e+98], N[Power[N[(N[Power[N[(b$95$m + a$95$m), $MachinePrecision], 1/3], $MachinePrecision] * N[Power[N[(N[(b$95$m - a$95$m), $MachinePrecision] * N[Sin[N[(Pi * N[(2.0 * N[(angle$95$m * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision], 3.0], $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 2e+151], N[(t$95$0 * N[(2.0 * N[(t$95$1 * t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 1e+264], N[(t$95$0 * N[(2.0 * N[(t$95$1 * N[Sqrt[N[Power[N[Cos[N[(Pi * N[(angle$95$m * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], 2.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$0 * N[(2.0 * N[(t$95$2 * N[Power[N[Power[N[Sin[N[(0.005555555555555556 * N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], 1/3], $MachinePrecision], 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]), $MachinePrecision]]]]
\begin{array}{l}
a_m = \left|a\right|
\\
b_m = \left|b\right|
\\
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
\begin{array}{l}
t_0 := \left(b\_m + a\_m\right) \cdot \left(b\_m - a\_m\right)\\
t_1 := \sin \left(\frac{angle\_m}{180} \cdot \sqrt[3]{{\pi}^{3}}\right)\\
t_2 := \cos \left(\frac{angle\_m}{180} \cdot \pi\right)\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;\frac{angle\_m}{180} \leq 4 \cdot 10^{+98}:\\
\;\;\;\;{\left(\sqrt[3]{b\_m + a\_m} \cdot \sqrt[3]{\left(b\_m - a\_m\right) \cdot \sin \left(\pi \cdot \left(2 \cdot \left(angle\_m \cdot 0.005555555555555556\right)\right)\right)}\right)}^{3}\\
\mathbf{elif}\;\frac{angle\_m}{180} \leq 2 \cdot 10^{+151}:\\
\;\;\;\;t\_0 \cdot \left(2 \cdot \left(t\_1 \cdot t\_2\right)\right)\\
\mathbf{elif}\;\frac{angle\_m}{180} \leq 10^{+264}:\\
\;\;\;\;t\_0 \cdot \left(2 \cdot \left(t\_1 \cdot \sqrt{{\cos \left(\pi \cdot \left(angle\_m \cdot 0.005555555555555556\right)\right)}^{2}}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0 \cdot \left(2 \cdot \left(t\_2 \cdot {\left(\sqrt[3]{\sin \left(0.005555555555555556 \cdot \left(angle\_m \cdot \pi\right)\right)}\right)}^{3}\right)\right)\\
\end{array}
\end{array}
\end{array}
if (/.f64 angle #s(literal 180 binary64)) < 3.99999999999999999e98Initial program 62.4%
associate-*l*62.4%
*-commutative62.4%
associate-*l*62.9%
Simplified62.9%
add-cube-cbrt62.5%
pow362.5%
2-sin62.5%
associate-*r*62.5%
div-inv62.1%
metadata-eval62.1%
Applied egg-rr62.1%
unpow262.1%
unpow262.1%
difference-of-squares66.0%
metadata-eval66.0%
div-inv66.8%
associate-*l*66.8%
2-sin66.8%
associate-*l*76.1%
cbrt-prod76.1%
Applied egg-rr75.3%
if 3.99999999999999999e98 < (/.f64 angle #s(literal 180 binary64)) < 2.00000000000000003e151Initial program 32.0%
associate-*l*32.0%
*-commutative32.0%
associate-*l*32.0%
Simplified32.0%
unpow232.0%
unpow232.0%
difference-of-squares32.0%
Applied egg-rr32.0%
add-cbrt-cube65.2%
pow365.2%
Applied egg-rr65.2%
if 2.00000000000000003e151 < (/.f64 angle #s(literal 180 binary64)) < 1.00000000000000004e264Initial program 42.7%
associate-*l*42.7%
*-commutative42.7%
associate-*l*42.7%
Simplified42.7%
unpow242.7%
unpow242.7%
difference-of-squares57.0%
Applied egg-rr57.0%
add-cbrt-cube45.6%
pow345.6%
Applied egg-rr45.6%
add-sqr-sqrt19.1%
sqrt-unprod51.8%
pow251.8%
div-inv51.8%
metadata-eval51.8%
Applied egg-rr51.8%
if 1.00000000000000004e264 < (/.f64 angle #s(literal 180 binary64)) Initial program 36.9%
associate-*l*36.9%
*-commutative36.9%
associate-*l*36.9%
Simplified36.9%
unpow236.9%
unpow236.9%
difference-of-squares36.9%
Applied egg-rr36.9%
add-cbrt-cube48.2%
pow348.2%
Applied egg-rr48.2%
rem-cbrt-cube36.9%
div-inv36.8%
metadata-eval36.8%
add-cube-cbrt36.8%
pow336.8%
metadata-eval36.8%
div-inv36.9%
rem-cbrt-cube48.2%
rem-cbrt-cube36.9%
associate-*r/50.9%
div-inv50.6%
metadata-eval50.6%
Applied egg-rr50.6%
Final simplification72.2%
a_m = (fabs.f64 a)
b_m = (fabs.f64 b)
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a_m b_m angle_m)
:precision binary64
(let* ((t_0 (* (+ b_m a_m) (- b_m a_m)))
(t_1 (sin (* (/ angle_m 180.0) (cbrt (pow PI 3.0)))))
(t_2 (cos (* (/ angle_m 180.0) PI))))
(*
angle_s
(if (<= (/ angle_m 180.0) 4e+98)
(pow
(*
(cbrt (+ b_m a_m))
(cbrt
(*
(- b_m a_m)
(sin (* PI (* 2.0 (* angle_m 0.005555555555555556)))))))
3.0)
(if (<= (/ angle_m 180.0) 2e+155)
(* t_0 (* 2.0 (* t_1 t_2)))
(if (<= (/ angle_m 180.0) 1e+264)
(* t_0 (* 2.0 t_1))
(*
t_0
(*
2.0
(*
t_2
(pow
(cbrt (sin (* 0.005555555555555556 (* angle_m PI))))
3.0))))))))))a_m = fabs(a);
b_m = fabs(b);
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a_m, double b_m, double angle_m) {
double t_0 = (b_m + a_m) * (b_m - a_m);
double t_1 = sin(((angle_m / 180.0) * cbrt(pow(((double) M_PI), 3.0))));
double t_2 = cos(((angle_m / 180.0) * ((double) M_PI)));
double tmp;
if ((angle_m / 180.0) <= 4e+98) {
tmp = pow((cbrt((b_m + a_m)) * cbrt(((b_m - a_m) * sin((((double) M_PI) * (2.0 * (angle_m * 0.005555555555555556))))))), 3.0);
} else if ((angle_m / 180.0) <= 2e+155) {
tmp = t_0 * (2.0 * (t_1 * t_2));
} else if ((angle_m / 180.0) <= 1e+264) {
tmp = t_0 * (2.0 * t_1);
} else {
tmp = t_0 * (2.0 * (t_2 * pow(cbrt(sin((0.005555555555555556 * (angle_m * ((double) M_PI))))), 3.0)));
}
return angle_s * tmp;
}
a_m = Math.abs(a);
b_m = Math.abs(b);
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a_m, double b_m, double angle_m) {
double t_0 = (b_m + a_m) * (b_m - a_m);
double t_1 = Math.sin(((angle_m / 180.0) * Math.cbrt(Math.pow(Math.PI, 3.0))));
double t_2 = Math.cos(((angle_m / 180.0) * Math.PI));
double tmp;
if ((angle_m / 180.0) <= 4e+98) {
tmp = Math.pow((Math.cbrt((b_m + a_m)) * Math.cbrt(((b_m - a_m) * Math.sin((Math.PI * (2.0 * (angle_m * 0.005555555555555556))))))), 3.0);
} else if ((angle_m / 180.0) <= 2e+155) {
tmp = t_0 * (2.0 * (t_1 * t_2));
} else if ((angle_m / 180.0) <= 1e+264) {
tmp = t_0 * (2.0 * t_1);
} else {
tmp = t_0 * (2.0 * (t_2 * Math.pow(Math.cbrt(Math.sin((0.005555555555555556 * (angle_m * Math.PI)))), 3.0)));
}
return angle_s * tmp;
}
a_m = abs(a) b_m = abs(b) angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a_m, b_m, angle_m) t_0 = Float64(Float64(b_m + a_m) * Float64(b_m - a_m)) t_1 = sin(Float64(Float64(angle_m / 180.0) * cbrt((pi ^ 3.0)))) t_2 = cos(Float64(Float64(angle_m / 180.0) * pi)) tmp = 0.0 if (Float64(angle_m / 180.0) <= 4e+98) tmp = Float64(cbrt(Float64(b_m + a_m)) * cbrt(Float64(Float64(b_m - a_m) * sin(Float64(pi * Float64(2.0 * Float64(angle_m * 0.005555555555555556))))))) ^ 3.0; elseif (Float64(angle_m / 180.0) <= 2e+155) tmp = Float64(t_0 * Float64(2.0 * Float64(t_1 * t_2))); elseif (Float64(angle_m / 180.0) <= 1e+264) tmp = Float64(t_0 * Float64(2.0 * t_1)); else tmp = Float64(t_0 * Float64(2.0 * Float64(t_2 * (cbrt(sin(Float64(0.005555555555555556 * Float64(angle_m * pi)))) ^ 3.0)))); end return Float64(angle_s * tmp) end
a_m = N[Abs[a], $MachinePrecision]
b_m = N[Abs[b], $MachinePrecision]
angle\_m = N[Abs[angle], $MachinePrecision]
angle\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a$95$m_, b$95$m_, angle$95$m_] := Block[{t$95$0 = N[(N[(b$95$m + a$95$m), $MachinePrecision] * N[(b$95$m - a$95$m), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Sin[N[(N[(angle$95$m / 180.0), $MachinePrecision] * N[Power[N[Power[Pi, 3.0], $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Cos[N[(N[(angle$95$m / 180.0), $MachinePrecision] * Pi), $MachinePrecision]], $MachinePrecision]}, N[(angle$95$s * If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 4e+98], N[Power[N[(N[Power[N[(b$95$m + a$95$m), $MachinePrecision], 1/3], $MachinePrecision] * N[Power[N[(N[(b$95$m - a$95$m), $MachinePrecision] * N[Sin[N[(Pi * N[(2.0 * N[(angle$95$m * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision], 3.0], $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 2e+155], N[(t$95$0 * N[(2.0 * N[(t$95$1 * t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 1e+264], N[(t$95$0 * N[(2.0 * t$95$1), $MachinePrecision]), $MachinePrecision], N[(t$95$0 * N[(2.0 * N[(t$95$2 * N[Power[N[Power[N[Sin[N[(0.005555555555555556 * N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], 1/3], $MachinePrecision], 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]), $MachinePrecision]]]]
\begin{array}{l}
a_m = \left|a\right|
\\
b_m = \left|b\right|
\\
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
\begin{array}{l}
t_0 := \left(b\_m + a\_m\right) \cdot \left(b\_m - a\_m\right)\\
t_1 := \sin \left(\frac{angle\_m}{180} \cdot \sqrt[3]{{\pi}^{3}}\right)\\
t_2 := \cos \left(\frac{angle\_m}{180} \cdot \pi\right)\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;\frac{angle\_m}{180} \leq 4 \cdot 10^{+98}:\\
\;\;\;\;{\left(\sqrt[3]{b\_m + a\_m} \cdot \sqrt[3]{\left(b\_m - a\_m\right) \cdot \sin \left(\pi \cdot \left(2 \cdot \left(angle\_m \cdot 0.005555555555555556\right)\right)\right)}\right)}^{3}\\
\mathbf{elif}\;\frac{angle\_m}{180} \leq 2 \cdot 10^{+155}:\\
\;\;\;\;t\_0 \cdot \left(2 \cdot \left(t\_1 \cdot t\_2\right)\right)\\
\mathbf{elif}\;\frac{angle\_m}{180} \leq 10^{+264}:\\
\;\;\;\;t\_0 \cdot \left(2 \cdot t\_1\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0 \cdot \left(2 \cdot \left(t\_2 \cdot {\left(\sqrt[3]{\sin \left(0.005555555555555556 \cdot \left(angle\_m \cdot \pi\right)\right)}\right)}^{3}\right)\right)\\
\end{array}
\end{array}
\end{array}
if (/.f64 angle #s(literal 180 binary64)) < 3.99999999999999999e98Initial program 62.4%
associate-*l*62.4%
*-commutative62.4%
associate-*l*62.9%
Simplified62.9%
add-cube-cbrt62.5%
pow362.5%
2-sin62.5%
associate-*r*62.5%
div-inv62.1%
metadata-eval62.1%
Applied egg-rr62.1%
unpow262.1%
unpow262.1%
difference-of-squares66.0%
metadata-eval66.0%
div-inv66.8%
associate-*l*66.8%
2-sin66.8%
associate-*l*76.1%
cbrt-prod76.1%
Applied egg-rr75.3%
if 3.99999999999999999e98 < (/.f64 angle #s(literal 180 binary64)) < 2.00000000000000001e155Initial program 29.7%
associate-*l*29.7%
*-commutative29.7%
associate-*l*29.7%
Simplified29.7%
unpow229.7%
unpow229.7%
difference-of-squares29.7%
Applied egg-rr29.7%
add-cbrt-cube60.5%
pow360.5%
Applied egg-rr60.5%
if 2.00000000000000001e155 < (/.f64 angle #s(literal 180 binary64)) < 1.00000000000000004e264Initial program 44.9%
associate-*l*44.9%
*-commutative44.9%
associate-*l*44.9%
Simplified44.9%
unpow244.9%
unpow244.9%
difference-of-squares59.9%
Applied egg-rr59.9%
add-cbrt-cube47.8%
pow347.8%
Applied egg-rr47.8%
Taylor expanded in angle around 0 54.1%
if 1.00000000000000004e264 < (/.f64 angle #s(literal 180 binary64)) Initial program 36.9%
associate-*l*36.9%
*-commutative36.9%
associate-*l*36.9%
Simplified36.9%
unpow236.9%
unpow236.9%
difference-of-squares36.9%
Applied egg-rr36.9%
add-cbrt-cube48.2%
pow348.2%
Applied egg-rr48.2%
rem-cbrt-cube36.9%
div-inv36.8%
metadata-eval36.8%
add-cube-cbrt36.8%
pow336.8%
metadata-eval36.8%
div-inv36.9%
rem-cbrt-cube48.2%
rem-cbrt-cube36.9%
associate-*r/50.9%
div-inv50.6%
metadata-eval50.6%
Applied egg-rr50.6%
Final simplification72.2%
a_m = (fabs.f64 a)
b_m = (fabs.f64 b)
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a_m b_m angle_m)
:precision binary64
(let* ((t_0 (* (+ b_m a_m) (- b_m a_m)))
(t_1 (* PI (* angle_m 0.005555555555555556)))
(t_2 (* (/ angle_m 180.0) PI))
(t_3 (cos t_2)))
(*
angle_s
(if (<= (/ angle_m 180.0) 2e+86)
(pow
(*
(cbrt (+ b_m a_m))
(cbrt
(*
(- b_m a_m)
(sin (* PI (* 2.0 (* angle_m 0.005555555555555556)))))))
3.0)
(if (<= (/ angle_m 180.0) 1e+222)
(*
t_0
(*
2.0
(*
t_3
(sin (* (cbrt (pow PI 3.0)) (* angle_m 0.005555555555555556))))))
(if (<= (/ angle_m 180.0) 5e+281)
(* t_0 (* 2.0 (* (sqrt (pow (cos t_1) 2.0)) (sin t_1))))
(* t_0 (* 2.0 (* t_3 (sin t_2))))))))))a_m = fabs(a);
b_m = fabs(b);
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a_m, double b_m, double angle_m) {
double t_0 = (b_m + a_m) * (b_m - a_m);
double t_1 = ((double) M_PI) * (angle_m * 0.005555555555555556);
double t_2 = (angle_m / 180.0) * ((double) M_PI);
double t_3 = cos(t_2);
double tmp;
if ((angle_m / 180.0) <= 2e+86) {
tmp = pow((cbrt((b_m + a_m)) * cbrt(((b_m - a_m) * sin((((double) M_PI) * (2.0 * (angle_m * 0.005555555555555556))))))), 3.0);
} else if ((angle_m / 180.0) <= 1e+222) {
tmp = t_0 * (2.0 * (t_3 * sin((cbrt(pow(((double) M_PI), 3.0)) * (angle_m * 0.005555555555555556)))));
} else if ((angle_m / 180.0) <= 5e+281) {
tmp = t_0 * (2.0 * (sqrt(pow(cos(t_1), 2.0)) * sin(t_1)));
} else {
tmp = t_0 * (2.0 * (t_3 * sin(t_2)));
}
return angle_s * tmp;
}
a_m = Math.abs(a);
b_m = Math.abs(b);
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a_m, double b_m, double angle_m) {
double t_0 = (b_m + a_m) * (b_m - a_m);
double t_1 = Math.PI * (angle_m * 0.005555555555555556);
double t_2 = (angle_m / 180.0) * Math.PI;
double t_3 = Math.cos(t_2);
double tmp;
if ((angle_m / 180.0) <= 2e+86) {
tmp = Math.pow((Math.cbrt((b_m + a_m)) * Math.cbrt(((b_m - a_m) * Math.sin((Math.PI * (2.0 * (angle_m * 0.005555555555555556))))))), 3.0);
} else if ((angle_m / 180.0) <= 1e+222) {
tmp = t_0 * (2.0 * (t_3 * Math.sin((Math.cbrt(Math.pow(Math.PI, 3.0)) * (angle_m * 0.005555555555555556)))));
} else if ((angle_m / 180.0) <= 5e+281) {
tmp = t_0 * (2.0 * (Math.sqrt(Math.pow(Math.cos(t_1), 2.0)) * Math.sin(t_1)));
} else {
tmp = t_0 * (2.0 * (t_3 * Math.sin(t_2)));
}
return angle_s * tmp;
}
a_m = abs(a) b_m = abs(b) angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a_m, b_m, angle_m) t_0 = Float64(Float64(b_m + a_m) * Float64(b_m - a_m)) t_1 = Float64(pi * Float64(angle_m * 0.005555555555555556)) t_2 = Float64(Float64(angle_m / 180.0) * pi) t_3 = cos(t_2) tmp = 0.0 if (Float64(angle_m / 180.0) <= 2e+86) tmp = Float64(cbrt(Float64(b_m + a_m)) * cbrt(Float64(Float64(b_m - a_m) * sin(Float64(pi * Float64(2.0 * Float64(angle_m * 0.005555555555555556))))))) ^ 3.0; elseif (Float64(angle_m / 180.0) <= 1e+222) tmp = Float64(t_0 * Float64(2.0 * Float64(t_3 * sin(Float64(cbrt((pi ^ 3.0)) * Float64(angle_m * 0.005555555555555556)))))); elseif (Float64(angle_m / 180.0) <= 5e+281) tmp = Float64(t_0 * Float64(2.0 * Float64(sqrt((cos(t_1) ^ 2.0)) * sin(t_1)))); else tmp = Float64(t_0 * Float64(2.0 * Float64(t_3 * sin(t_2)))); end return Float64(angle_s * tmp) end
a_m = N[Abs[a], $MachinePrecision]
b_m = N[Abs[b], $MachinePrecision]
angle\_m = N[Abs[angle], $MachinePrecision]
angle\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a$95$m_, b$95$m_, angle$95$m_] := Block[{t$95$0 = N[(N[(b$95$m + a$95$m), $MachinePrecision] * N[(b$95$m - a$95$m), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(Pi * N[(angle$95$m * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(angle$95$m / 180.0), $MachinePrecision] * Pi), $MachinePrecision]}, Block[{t$95$3 = N[Cos[t$95$2], $MachinePrecision]}, N[(angle$95$s * If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 2e+86], N[Power[N[(N[Power[N[(b$95$m + a$95$m), $MachinePrecision], 1/3], $MachinePrecision] * N[Power[N[(N[(b$95$m - a$95$m), $MachinePrecision] * N[Sin[N[(Pi * N[(2.0 * N[(angle$95$m * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision], 3.0], $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 1e+222], N[(t$95$0 * N[(2.0 * N[(t$95$3 * N[Sin[N[(N[Power[N[Power[Pi, 3.0], $MachinePrecision], 1/3], $MachinePrecision] * N[(angle$95$m * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 5e+281], N[(t$95$0 * N[(2.0 * N[(N[Sqrt[N[Power[N[Cos[t$95$1], $MachinePrecision], 2.0], $MachinePrecision]], $MachinePrecision] * N[Sin[t$95$1], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$0 * N[(2.0 * N[(t$95$3 * N[Sin[t$95$2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]), $MachinePrecision]]]]]
\begin{array}{l}
a_m = \left|a\right|
\\
b_m = \left|b\right|
\\
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
\begin{array}{l}
t_0 := \left(b\_m + a\_m\right) \cdot \left(b\_m - a\_m\right)\\
t_1 := \pi \cdot \left(angle\_m \cdot 0.005555555555555556\right)\\
t_2 := \frac{angle\_m}{180} \cdot \pi\\
t_3 := \cos t\_2\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;\frac{angle\_m}{180} \leq 2 \cdot 10^{+86}:\\
\;\;\;\;{\left(\sqrt[3]{b\_m + a\_m} \cdot \sqrt[3]{\left(b\_m - a\_m\right) \cdot \sin \left(\pi \cdot \left(2 \cdot \left(angle\_m \cdot 0.005555555555555556\right)\right)\right)}\right)}^{3}\\
\mathbf{elif}\;\frac{angle\_m}{180} \leq 10^{+222}:\\
\;\;\;\;t\_0 \cdot \left(2 \cdot \left(t\_3 \cdot \sin \left(\sqrt[3]{{\pi}^{3}} \cdot \left(angle\_m \cdot 0.005555555555555556\right)\right)\right)\right)\\
\mathbf{elif}\;\frac{angle\_m}{180} \leq 5 \cdot 10^{+281}:\\
\;\;\;\;t\_0 \cdot \left(2 \cdot \left(\sqrt{{\cos t\_1}^{2}} \cdot \sin t\_1\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0 \cdot \left(2 \cdot \left(t\_3 \cdot \sin t\_2\right)\right)\\
\end{array}
\end{array}
\end{array}
if (/.f64 angle #s(literal 180 binary64)) < 2e86Initial program 63.2%
associate-*l*63.2%
*-commutative63.2%
associate-*l*63.7%
Simplified63.7%
add-cube-cbrt63.3%
pow363.3%
2-sin63.3%
associate-*r*63.3%
div-inv62.9%
metadata-eval62.9%
Applied egg-rr62.9%
unpow262.9%
unpow262.9%
difference-of-squares66.8%
metadata-eval66.8%
div-inv67.6%
associate-*l*67.6%
2-sin67.7%
associate-*l*77.1%
cbrt-prod77.1%
Applied egg-rr76.3%
if 2e86 < (/.f64 angle #s(literal 180 binary64)) < 1e222Initial program 31.9%
associate-*l*31.9%
*-commutative31.9%
associate-*l*31.9%
Simplified31.9%
unpow231.9%
unpow231.9%
difference-of-squares42.3%
Applied egg-rr42.3%
Taylor expanded in angle around inf 49.5%
associate-*r*41.5%
*-commutative41.5%
*-commutative41.5%
*-commutative41.5%
Simplified41.5%
add-cbrt-cube51.7%
pow351.7%
Applied egg-rr51.7%
if 1e222 < (/.f64 angle #s(literal 180 binary64)) < 5.00000000000000016e281Initial program 39.2%
associate-*l*39.2%
*-commutative39.2%
associate-*l*39.2%
Simplified39.2%
unpow239.2%
unpow239.2%
difference-of-squares39.2%
Applied egg-rr39.2%
Taylor expanded in angle around inf 38.9%
associate-*r*30.1%
*-commutative30.1%
*-commutative30.1%
*-commutative30.1%
Simplified30.1%
add-sqr-sqrt11.1%
sqrt-unprod51.7%
pow251.7%
div-inv51.7%
metadata-eval51.7%
Applied egg-rr51.7%
if 5.00000000000000016e281 < (/.f64 angle #s(literal 180 binary64)) Initial program 59.1%
associate-*l*59.1%
*-commutative59.1%
associate-*l*59.1%
Simplified59.1%
unpow259.1%
unpow259.1%
difference-of-squares59.1%
Applied egg-rr59.1%
Final simplification72.2%
a_m = (fabs.f64 a)
b_m = (fabs.f64 b)
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a_m b_m angle_m)
:precision binary64
(let* ((t_0 (* PI (* angle_m 0.005555555555555556)))
(t_1 (* (+ b_m a_m) (- b_m a_m))))
(*
angle_s
(if (<= (/ angle_m 180.0) 5e+81)
(pow
(*
(cbrt (+ b_m a_m))
(cbrt
(*
(- b_m a_m)
(sin (* PI (* 2.0 (* angle_m 0.005555555555555556)))))))
3.0)
(if (<= (/ angle_m 180.0) 2.5e+123)
(fabs
(*
(sin (* PI (* angle_m 0.011111111111111112)))
(- (pow b_m 2.0) (pow a_m 2.0))))
(if (<= (/ angle_m 180.0) 1e+140)
(*
t_1
(*
2.0
(*
(cos (* (/ angle_m 180.0) PI))
(sin (* 0.005555555555555556 (* angle_m PI))))))
(* t_1 (* 2.0 (* (sqrt (pow (cos t_0) 2.0)) (sin t_0))))))))))a_m = fabs(a);
b_m = fabs(b);
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a_m, double b_m, double angle_m) {
double t_0 = ((double) M_PI) * (angle_m * 0.005555555555555556);
double t_1 = (b_m + a_m) * (b_m - a_m);
double tmp;
if ((angle_m / 180.0) <= 5e+81) {
tmp = pow((cbrt((b_m + a_m)) * cbrt(((b_m - a_m) * sin((((double) M_PI) * (2.0 * (angle_m * 0.005555555555555556))))))), 3.0);
} else if ((angle_m / 180.0) <= 2.5e+123) {
tmp = fabs((sin((((double) M_PI) * (angle_m * 0.011111111111111112))) * (pow(b_m, 2.0) - pow(a_m, 2.0))));
} else if ((angle_m / 180.0) <= 1e+140) {
tmp = t_1 * (2.0 * (cos(((angle_m / 180.0) * ((double) M_PI))) * sin((0.005555555555555556 * (angle_m * ((double) M_PI))))));
} else {
tmp = t_1 * (2.0 * (sqrt(pow(cos(t_0), 2.0)) * sin(t_0)));
}
return angle_s * tmp;
}
a_m = Math.abs(a);
b_m = Math.abs(b);
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a_m, double b_m, double angle_m) {
double t_0 = Math.PI * (angle_m * 0.005555555555555556);
double t_1 = (b_m + a_m) * (b_m - a_m);
double tmp;
if ((angle_m / 180.0) <= 5e+81) {
tmp = Math.pow((Math.cbrt((b_m + a_m)) * Math.cbrt(((b_m - a_m) * Math.sin((Math.PI * (2.0 * (angle_m * 0.005555555555555556))))))), 3.0);
} else if ((angle_m / 180.0) <= 2.5e+123) {
tmp = Math.abs((Math.sin((Math.PI * (angle_m * 0.011111111111111112))) * (Math.pow(b_m, 2.0) - Math.pow(a_m, 2.0))));
} else if ((angle_m / 180.0) <= 1e+140) {
tmp = t_1 * (2.0 * (Math.cos(((angle_m / 180.0) * Math.PI)) * Math.sin((0.005555555555555556 * (angle_m * Math.PI)))));
} else {
tmp = t_1 * (2.0 * (Math.sqrt(Math.pow(Math.cos(t_0), 2.0)) * Math.sin(t_0)));
}
return angle_s * tmp;
}
a_m = abs(a) b_m = abs(b) angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a_m, b_m, angle_m) t_0 = Float64(pi * Float64(angle_m * 0.005555555555555556)) t_1 = Float64(Float64(b_m + a_m) * Float64(b_m - a_m)) tmp = 0.0 if (Float64(angle_m / 180.0) <= 5e+81) tmp = Float64(cbrt(Float64(b_m + a_m)) * cbrt(Float64(Float64(b_m - a_m) * sin(Float64(pi * Float64(2.0 * Float64(angle_m * 0.005555555555555556))))))) ^ 3.0; elseif (Float64(angle_m / 180.0) <= 2.5e+123) tmp = abs(Float64(sin(Float64(pi * Float64(angle_m * 0.011111111111111112))) * Float64((b_m ^ 2.0) - (a_m ^ 2.0)))); elseif (Float64(angle_m / 180.0) <= 1e+140) tmp = Float64(t_1 * Float64(2.0 * Float64(cos(Float64(Float64(angle_m / 180.0) * pi)) * sin(Float64(0.005555555555555556 * Float64(angle_m * pi)))))); else tmp = Float64(t_1 * Float64(2.0 * Float64(sqrt((cos(t_0) ^ 2.0)) * sin(t_0)))); end return Float64(angle_s * tmp) end
a_m = N[Abs[a], $MachinePrecision]
b_m = N[Abs[b], $MachinePrecision]
angle\_m = N[Abs[angle], $MachinePrecision]
angle\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a$95$m_, b$95$m_, angle$95$m_] := Block[{t$95$0 = N[(Pi * N[(angle$95$m * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(b$95$m + a$95$m), $MachinePrecision] * N[(b$95$m - a$95$m), $MachinePrecision]), $MachinePrecision]}, N[(angle$95$s * If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 5e+81], N[Power[N[(N[Power[N[(b$95$m + a$95$m), $MachinePrecision], 1/3], $MachinePrecision] * N[Power[N[(N[(b$95$m - a$95$m), $MachinePrecision] * N[Sin[N[(Pi * N[(2.0 * N[(angle$95$m * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision], 3.0], $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 2.5e+123], N[Abs[N[(N[Sin[N[(Pi * N[(angle$95$m * 0.011111111111111112), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(N[Power[b$95$m, 2.0], $MachinePrecision] - N[Power[a$95$m, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 1e+140], N[(t$95$1 * N[(2.0 * N[(N[Cos[N[(N[(angle$95$m / 180.0), $MachinePrecision] * Pi), $MachinePrecision]], $MachinePrecision] * N[Sin[N[(0.005555555555555556 * N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$1 * N[(2.0 * N[(N[Sqrt[N[Power[N[Cos[t$95$0], $MachinePrecision], 2.0], $MachinePrecision]], $MachinePrecision] * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]), $MachinePrecision]]]
\begin{array}{l}
a_m = \left|a\right|
\\
b_m = \left|b\right|
\\
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
\begin{array}{l}
t_0 := \pi \cdot \left(angle\_m \cdot 0.005555555555555556\right)\\
t_1 := \left(b\_m + a\_m\right) \cdot \left(b\_m - a\_m\right)\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;\frac{angle\_m}{180} \leq 5 \cdot 10^{+81}:\\
\;\;\;\;{\left(\sqrt[3]{b\_m + a\_m} \cdot \sqrt[3]{\left(b\_m - a\_m\right) \cdot \sin \left(\pi \cdot \left(2 \cdot \left(angle\_m \cdot 0.005555555555555556\right)\right)\right)}\right)}^{3}\\
\mathbf{elif}\;\frac{angle\_m}{180} \leq 2.5 \cdot 10^{+123}:\\
\;\;\;\;\left|\sin \left(\pi \cdot \left(angle\_m \cdot 0.011111111111111112\right)\right) \cdot \left({b\_m}^{2} - {a\_m}^{2}\right)\right|\\
\mathbf{elif}\;\frac{angle\_m}{180} \leq 10^{+140}:\\
\;\;\;\;t\_1 \cdot \left(2 \cdot \left(\cos \left(\frac{angle\_m}{180} \cdot \pi\right) \cdot \sin \left(0.005555555555555556 \cdot \left(angle\_m \cdot \pi\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1 \cdot \left(2 \cdot \left(\sqrt{{\cos t\_0}^{2}} \cdot \sin t\_0\right)\right)\\
\end{array}
\end{array}
\end{array}
if (/.f64 angle #s(literal 180 binary64)) < 4.9999999999999998e81Initial program 62.9%
associate-*l*62.9%
*-commutative62.9%
associate-*l*63.3%
Simplified63.3%
add-cube-cbrt62.9%
pow362.9%
2-sin62.9%
associate-*r*62.9%
div-inv62.6%
metadata-eval62.6%
Applied egg-rr62.6%
unpow262.6%
unpow262.6%
difference-of-squares66.5%
metadata-eval66.5%
div-inv67.3%
associate-*l*67.3%
2-sin67.3%
associate-*l*76.9%
cbrt-prod76.9%
Applied egg-rr76.0%
if 4.9999999999999998e81 < (/.f64 angle #s(literal 180 binary64)) < 2.49999999999999987e123Initial program 36.4%
associate-*l*36.4%
*-commutative36.4%
associate-*l*36.4%
Simplified36.4%
unpow236.4%
unpow236.4%
difference-of-squares36.6%
Applied egg-rr36.6%
Taylor expanded in angle around inf 40.2%
associate-*r*47.7%
*-commutative47.7%
*-commutative47.7%
*-commutative47.7%
Simplified47.7%
Applied egg-rr50.2%
unpow250.2%
rem-sqrt-square51.7%
Simplified51.7%
if 2.49999999999999987e123 < (/.f64 angle #s(literal 180 binary64)) < 1.00000000000000006e140Initial program 60.6%
associate-*l*60.6%
*-commutative60.6%
associate-*l*60.6%
Simplified60.6%
unpow260.6%
unpow260.6%
difference-of-squares60.6%
Applied egg-rr60.6%
Taylor expanded in angle around inf 80.6%
if 1.00000000000000006e140 < (/.f64 angle #s(literal 180 binary64)) Initial program 36.3%
associate-*l*36.3%
*-commutative36.3%
associate-*l*36.3%
Simplified36.3%
unpow236.3%
unpow236.3%
difference-of-squares45.7%
Applied egg-rr45.7%
Taylor expanded in angle around inf 48.3%
associate-*r*38.7%
*-commutative38.7%
*-commutative38.7%
*-commutative38.7%
Simplified38.7%
add-sqr-sqrt17.4%
sqrt-unprod52.8%
pow252.8%
div-inv52.8%
metadata-eval52.8%
Applied egg-rr52.8%
Final simplification72.4%
a_m = (fabs.f64 a)
b_m = (fabs.f64 b)
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a_m b_m angle_m)
:precision binary64
(let* ((t_0 (* (+ b_m a_m) (- b_m a_m)))
(t_1 (sin (* (/ angle_m 180.0) (cbrt (pow PI 3.0)))))
(t_2 (cos (* (/ angle_m 180.0) PI))))
(*
angle_s
(if (<= (/ angle_m 180.0) 4e+98)
(pow
(*
(cbrt (+ b_m a_m))
(cbrt
(*
(- b_m a_m)
(sin (* PI (* 2.0 (* angle_m 0.005555555555555556)))))))
3.0)
(if (<= (/ angle_m 180.0) 2e+155)
(* t_0 (* 2.0 (* t_1 t_2)))
(if (<= (/ angle_m 180.0) 1e+264)
(* t_0 (* 2.0 t_1))
(*
t_0
(* 2.0 (* t_2 (sin (* 0.005555555555555556 (* angle_m PI))))))))))))a_m = fabs(a);
b_m = fabs(b);
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a_m, double b_m, double angle_m) {
double t_0 = (b_m + a_m) * (b_m - a_m);
double t_1 = sin(((angle_m / 180.0) * cbrt(pow(((double) M_PI), 3.0))));
double t_2 = cos(((angle_m / 180.0) * ((double) M_PI)));
double tmp;
if ((angle_m / 180.0) <= 4e+98) {
tmp = pow((cbrt((b_m + a_m)) * cbrt(((b_m - a_m) * sin((((double) M_PI) * (2.0 * (angle_m * 0.005555555555555556))))))), 3.0);
} else if ((angle_m / 180.0) <= 2e+155) {
tmp = t_0 * (2.0 * (t_1 * t_2));
} else if ((angle_m / 180.0) <= 1e+264) {
tmp = t_0 * (2.0 * t_1);
} else {
tmp = t_0 * (2.0 * (t_2 * sin((0.005555555555555556 * (angle_m * ((double) M_PI))))));
}
return angle_s * tmp;
}
a_m = Math.abs(a);
b_m = Math.abs(b);
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a_m, double b_m, double angle_m) {
double t_0 = (b_m + a_m) * (b_m - a_m);
double t_1 = Math.sin(((angle_m / 180.0) * Math.cbrt(Math.pow(Math.PI, 3.0))));
double t_2 = Math.cos(((angle_m / 180.0) * Math.PI));
double tmp;
if ((angle_m / 180.0) <= 4e+98) {
tmp = Math.pow((Math.cbrt((b_m + a_m)) * Math.cbrt(((b_m - a_m) * Math.sin((Math.PI * (2.0 * (angle_m * 0.005555555555555556))))))), 3.0);
} else if ((angle_m / 180.0) <= 2e+155) {
tmp = t_0 * (2.0 * (t_1 * t_2));
} else if ((angle_m / 180.0) <= 1e+264) {
tmp = t_0 * (2.0 * t_1);
} else {
tmp = t_0 * (2.0 * (t_2 * Math.sin((0.005555555555555556 * (angle_m * Math.PI)))));
}
return angle_s * tmp;
}
a_m = abs(a) b_m = abs(b) angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a_m, b_m, angle_m) t_0 = Float64(Float64(b_m + a_m) * Float64(b_m - a_m)) t_1 = sin(Float64(Float64(angle_m / 180.0) * cbrt((pi ^ 3.0)))) t_2 = cos(Float64(Float64(angle_m / 180.0) * pi)) tmp = 0.0 if (Float64(angle_m / 180.0) <= 4e+98) tmp = Float64(cbrt(Float64(b_m + a_m)) * cbrt(Float64(Float64(b_m - a_m) * sin(Float64(pi * Float64(2.0 * Float64(angle_m * 0.005555555555555556))))))) ^ 3.0; elseif (Float64(angle_m / 180.0) <= 2e+155) tmp = Float64(t_0 * Float64(2.0 * Float64(t_1 * t_2))); elseif (Float64(angle_m / 180.0) <= 1e+264) tmp = Float64(t_0 * Float64(2.0 * t_1)); else tmp = Float64(t_0 * Float64(2.0 * Float64(t_2 * sin(Float64(0.005555555555555556 * Float64(angle_m * pi)))))); end return Float64(angle_s * tmp) end
a_m = N[Abs[a], $MachinePrecision]
b_m = N[Abs[b], $MachinePrecision]
angle\_m = N[Abs[angle], $MachinePrecision]
angle\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a$95$m_, b$95$m_, angle$95$m_] := Block[{t$95$0 = N[(N[(b$95$m + a$95$m), $MachinePrecision] * N[(b$95$m - a$95$m), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Sin[N[(N[(angle$95$m / 180.0), $MachinePrecision] * N[Power[N[Power[Pi, 3.0], $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Cos[N[(N[(angle$95$m / 180.0), $MachinePrecision] * Pi), $MachinePrecision]], $MachinePrecision]}, N[(angle$95$s * If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 4e+98], N[Power[N[(N[Power[N[(b$95$m + a$95$m), $MachinePrecision], 1/3], $MachinePrecision] * N[Power[N[(N[(b$95$m - a$95$m), $MachinePrecision] * N[Sin[N[(Pi * N[(2.0 * N[(angle$95$m * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision], 3.0], $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 2e+155], N[(t$95$0 * N[(2.0 * N[(t$95$1 * t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 1e+264], N[(t$95$0 * N[(2.0 * t$95$1), $MachinePrecision]), $MachinePrecision], N[(t$95$0 * N[(2.0 * N[(t$95$2 * N[Sin[N[(0.005555555555555556 * N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]), $MachinePrecision]]]]
\begin{array}{l}
a_m = \left|a\right|
\\
b_m = \left|b\right|
\\
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
\begin{array}{l}
t_0 := \left(b\_m + a\_m\right) \cdot \left(b\_m - a\_m\right)\\
t_1 := \sin \left(\frac{angle\_m}{180} \cdot \sqrt[3]{{\pi}^{3}}\right)\\
t_2 := \cos \left(\frac{angle\_m}{180} \cdot \pi\right)\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;\frac{angle\_m}{180} \leq 4 \cdot 10^{+98}:\\
\;\;\;\;{\left(\sqrt[3]{b\_m + a\_m} \cdot \sqrt[3]{\left(b\_m - a\_m\right) \cdot \sin \left(\pi \cdot \left(2 \cdot \left(angle\_m \cdot 0.005555555555555556\right)\right)\right)}\right)}^{3}\\
\mathbf{elif}\;\frac{angle\_m}{180} \leq 2 \cdot 10^{+155}:\\
\;\;\;\;t\_0 \cdot \left(2 \cdot \left(t\_1 \cdot t\_2\right)\right)\\
\mathbf{elif}\;\frac{angle\_m}{180} \leq 10^{+264}:\\
\;\;\;\;t\_0 \cdot \left(2 \cdot t\_1\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0 \cdot \left(2 \cdot \left(t\_2 \cdot \sin \left(0.005555555555555556 \cdot \left(angle\_m \cdot \pi\right)\right)\right)\right)\\
\end{array}
\end{array}
\end{array}
if (/.f64 angle #s(literal 180 binary64)) < 3.99999999999999999e98Initial program 62.4%
associate-*l*62.4%
*-commutative62.4%
associate-*l*62.9%
Simplified62.9%
add-cube-cbrt62.5%
pow362.5%
2-sin62.5%
associate-*r*62.5%
div-inv62.1%
metadata-eval62.1%
Applied egg-rr62.1%
unpow262.1%
unpow262.1%
difference-of-squares66.0%
metadata-eval66.0%
div-inv66.8%
associate-*l*66.8%
2-sin66.8%
associate-*l*76.1%
cbrt-prod76.1%
Applied egg-rr75.3%
if 3.99999999999999999e98 < (/.f64 angle #s(literal 180 binary64)) < 2.00000000000000001e155Initial program 29.7%
associate-*l*29.7%
*-commutative29.7%
associate-*l*29.7%
Simplified29.7%
unpow229.7%
unpow229.7%
difference-of-squares29.7%
Applied egg-rr29.7%
add-cbrt-cube60.5%
pow360.5%
Applied egg-rr60.5%
if 2.00000000000000001e155 < (/.f64 angle #s(literal 180 binary64)) < 1.00000000000000004e264Initial program 44.9%
associate-*l*44.9%
*-commutative44.9%
associate-*l*44.9%
Simplified44.9%
unpow244.9%
unpow244.9%
difference-of-squares59.9%
Applied egg-rr59.9%
add-cbrt-cube47.8%
pow347.8%
Applied egg-rr47.8%
Taylor expanded in angle around 0 54.1%
if 1.00000000000000004e264 < (/.f64 angle #s(literal 180 binary64)) Initial program 36.9%
associate-*l*36.9%
*-commutative36.9%
associate-*l*36.9%
Simplified36.9%
unpow236.9%
unpow236.9%
difference-of-squares36.9%
Applied egg-rr36.9%
Taylor expanded in angle around inf 50.6%
Final simplification72.2%
a_m = (fabs.f64 a)
b_m = (fabs.f64 b)
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a_m b_m angle_m)
:precision binary64
(let* ((t_0 (* (/ angle_m 180.0) PI))
(t_1 (cos t_0))
(t_2 (* PI (* angle_m 0.011111111111111112)))
(t_3 (* (+ b_m a_m) (- b_m a_m))))
(*
angle_s
(if (<= (/ angle_m 180.0) 4e-56)
(pow (* (cbrt (+ b_m a_m)) (cbrt (* (- b_m a_m) t_2))) 3.0)
(if (<= (/ angle_m 180.0) 2e+86)
(* t_3 (* 2.0 (* t_1 (sin t_0))))
(if (<= (/ angle_m 180.0) 2.5e+123)
(fabs (* (sin t_2) (- (pow b_m 2.0) (pow a_m 2.0))))
(if (<= (/ angle_m 180.0) 5e+140)
(*
t_3
(* 2.0 (* t_1 (sin (* 0.005555555555555556 (* angle_m PI))))))
(*
t_3
(* 2.0 (sin (* PI (* angle_m 0.005555555555555556))))))))))))a_m = fabs(a);
b_m = fabs(b);
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a_m, double b_m, double angle_m) {
double t_0 = (angle_m / 180.0) * ((double) M_PI);
double t_1 = cos(t_0);
double t_2 = ((double) M_PI) * (angle_m * 0.011111111111111112);
double t_3 = (b_m + a_m) * (b_m - a_m);
double tmp;
if ((angle_m / 180.0) <= 4e-56) {
tmp = pow((cbrt((b_m + a_m)) * cbrt(((b_m - a_m) * t_2))), 3.0);
} else if ((angle_m / 180.0) <= 2e+86) {
tmp = t_3 * (2.0 * (t_1 * sin(t_0)));
} else if ((angle_m / 180.0) <= 2.5e+123) {
tmp = fabs((sin(t_2) * (pow(b_m, 2.0) - pow(a_m, 2.0))));
} else if ((angle_m / 180.0) <= 5e+140) {
tmp = t_3 * (2.0 * (t_1 * sin((0.005555555555555556 * (angle_m * ((double) M_PI))))));
} else {
tmp = t_3 * (2.0 * sin((((double) M_PI) * (angle_m * 0.005555555555555556))));
}
return angle_s * tmp;
}
a_m = Math.abs(a);
b_m = Math.abs(b);
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a_m, double b_m, double angle_m) {
double t_0 = (angle_m / 180.0) * Math.PI;
double t_1 = Math.cos(t_0);
double t_2 = Math.PI * (angle_m * 0.011111111111111112);
double t_3 = (b_m + a_m) * (b_m - a_m);
double tmp;
if ((angle_m / 180.0) <= 4e-56) {
tmp = Math.pow((Math.cbrt((b_m + a_m)) * Math.cbrt(((b_m - a_m) * t_2))), 3.0);
} else if ((angle_m / 180.0) <= 2e+86) {
tmp = t_3 * (2.0 * (t_1 * Math.sin(t_0)));
} else if ((angle_m / 180.0) <= 2.5e+123) {
tmp = Math.abs((Math.sin(t_2) * (Math.pow(b_m, 2.0) - Math.pow(a_m, 2.0))));
} else if ((angle_m / 180.0) <= 5e+140) {
tmp = t_3 * (2.0 * (t_1 * Math.sin((0.005555555555555556 * (angle_m * Math.PI)))));
} else {
tmp = t_3 * (2.0 * Math.sin((Math.PI * (angle_m * 0.005555555555555556))));
}
return angle_s * tmp;
}
a_m = abs(a) b_m = abs(b) angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a_m, b_m, angle_m) t_0 = Float64(Float64(angle_m / 180.0) * pi) t_1 = cos(t_0) t_2 = Float64(pi * Float64(angle_m * 0.011111111111111112)) t_3 = Float64(Float64(b_m + a_m) * Float64(b_m - a_m)) tmp = 0.0 if (Float64(angle_m / 180.0) <= 4e-56) tmp = Float64(cbrt(Float64(b_m + a_m)) * cbrt(Float64(Float64(b_m - a_m) * t_2))) ^ 3.0; elseif (Float64(angle_m / 180.0) <= 2e+86) tmp = Float64(t_3 * Float64(2.0 * Float64(t_1 * sin(t_0)))); elseif (Float64(angle_m / 180.0) <= 2.5e+123) tmp = abs(Float64(sin(t_2) * Float64((b_m ^ 2.0) - (a_m ^ 2.0)))); elseif (Float64(angle_m / 180.0) <= 5e+140) tmp = Float64(t_3 * Float64(2.0 * Float64(t_1 * sin(Float64(0.005555555555555556 * Float64(angle_m * pi)))))); else tmp = Float64(t_3 * Float64(2.0 * sin(Float64(pi * Float64(angle_m * 0.005555555555555556))))); end return Float64(angle_s * tmp) end
a_m = N[Abs[a], $MachinePrecision]
b_m = N[Abs[b], $MachinePrecision]
angle\_m = N[Abs[angle], $MachinePrecision]
angle\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a$95$m_, b$95$m_, angle$95$m_] := Block[{t$95$0 = N[(N[(angle$95$m / 180.0), $MachinePrecision] * Pi), $MachinePrecision]}, Block[{t$95$1 = N[Cos[t$95$0], $MachinePrecision]}, Block[{t$95$2 = N[(Pi * N[(angle$95$m * 0.011111111111111112), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(b$95$m + a$95$m), $MachinePrecision] * N[(b$95$m - a$95$m), $MachinePrecision]), $MachinePrecision]}, N[(angle$95$s * If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 4e-56], N[Power[N[(N[Power[N[(b$95$m + a$95$m), $MachinePrecision], 1/3], $MachinePrecision] * N[Power[N[(N[(b$95$m - a$95$m), $MachinePrecision] * t$95$2), $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision], 3.0], $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 2e+86], N[(t$95$3 * N[(2.0 * N[(t$95$1 * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 2.5e+123], N[Abs[N[(N[Sin[t$95$2], $MachinePrecision] * N[(N[Power[b$95$m, 2.0], $MachinePrecision] - N[Power[a$95$m, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 5e+140], N[(t$95$3 * N[(2.0 * N[(t$95$1 * N[Sin[N[(0.005555555555555556 * N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$3 * N[(2.0 * N[Sin[N[(Pi * N[(angle$95$m * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]), $MachinePrecision]]]]]
\begin{array}{l}
a_m = \left|a\right|
\\
b_m = \left|b\right|
\\
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
\begin{array}{l}
t_0 := \frac{angle\_m}{180} \cdot \pi\\
t_1 := \cos t\_0\\
t_2 := \pi \cdot \left(angle\_m \cdot 0.011111111111111112\right)\\
t_3 := \left(b\_m + a\_m\right) \cdot \left(b\_m - a\_m\right)\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;\frac{angle\_m}{180} \leq 4 \cdot 10^{-56}:\\
\;\;\;\;{\left(\sqrt[3]{b\_m + a\_m} \cdot \sqrt[3]{\left(b\_m - a\_m\right) \cdot t\_2}\right)}^{3}\\
\mathbf{elif}\;\frac{angle\_m}{180} \leq 2 \cdot 10^{+86}:\\
\;\;\;\;t\_3 \cdot \left(2 \cdot \left(t\_1 \cdot \sin t\_0\right)\right)\\
\mathbf{elif}\;\frac{angle\_m}{180} \leq 2.5 \cdot 10^{+123}:\\
\;\;\;\;\left|\sin t\_2 \cdot \left({b\_m}^{2} - {a\_m}^{2}\right)\right|\\
\mathbf{elif}\;\frac{angle\_m}{180} \leq 5 \cdot 10^{+140}:\\
\;\;\;\;t\_3 \cdot \left(2 \cdot \left(t\_1 \cdot \sin \left(0.005555555555555556 \cdot \left(angle\_m \cdot \pi\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_3 \cdot \left(2 \cdot \sin \left(\pi \cdot \left(angle\_m \cdot 0.005555555555555556\right)\right)\right)\\
\end{array}
\end{array}
\end{array}
if (/.f64 angle #s(literal 180 binary64)) < 4.0000000000000002e-56Initial program 62.1%
associate-*l*62.1%
*-commutative62.1%
associate-*l*62.6%
Simplified62.6%
add-cube-cbrt62.2%
pow362.2%
2-sin62.2%
associate-*r*62.2%
div-inv61.6%
metadata-eval61.6%
Applied egg-rr61.6%
unpow261.6%
unpow261.6%
difference-of-squares66.0%
metadata-eval66.0%
div-inv67.2%
associate-*l*67.2%
2-sin67.2%
associate-*l*77.8%
cbrt-prod77.8%
Applied egg-rr76.6%
Taylor expanded in angle around 0 75.9%
associate-*r*75.9%
*-commutative75.9%
Simplified75.9%
if 4.0000000000000002e-56 < (/.f64 angle #s(literal 180 binary64)) < 2e86Initial program 71.9%
associate-*l*71.9%
*-commutative71.9%
associate-*l*71.9%
Simplified71.9%
unpow271.9%
unpow271.9%
difference-of-squares71.9%
Applied egg-rr71.9%
if 2e86 < (/.f64 angle #s(literal 180 binary64)) < 2.49999999999999987e123Initial program 18.2%
associate-*l*18.2%
*-commutative18.2%
associate-*l*18.2%
Simplified18.2%
unpow218.2%
unpow218.2%
difference-of-squares18.5%
Applied egg-rr18.5%
Taylor expanded in angle around inf 23.2%
associate-*r*32.8%
*-commutative32.8%
*-commutative32.8%
*-commutative32.8%
Simplified32.8%
Applied egg-rr36.0%
unpow236.0%
rem-sqrt-square37.9%
Simplified37.9%
if 2.49999999999999987e123 < (/.f64 angle #s(literal 180 binary64)) < 5.00000000000000008e140Initial program 60.6%
associate-*l*60.6%
*-commutative60.6%
associate-*l*60.6%
Simplified60.6%
unpow260.6%
unpow260.6%
difference-of-squares60.6%
Applied egg-rr60.6%
Taylor expanded in angle around inf 80.6%
if 5.00000000000000008e140 < (/.f64 angle #s(literal 180 binary64)) Initial program 36.3%
associate-*l*36.3%
*-commutative36.3%
associate-*l*36.3%
Simplified36.3%
unpow236.3%
unpow236.3%
difference-of-squares45.7%
Applied egg-rr45.7%
Taylor expanded in angle around inf 48.3%
associate-*r*38.7%
*-commutative38.7%
*-commutative38.7%
*-commutative38.7%
Simplified38.7%
Taylor expanded in angle around 0 52.4%
Final simplification71.7%
a_m = (fabs.f64 a)
b_m = (fabs.f64 b)
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a_m b_m angle_m)
:precision binary64
(let* ((t_0 (* (+ b_m a_m) (- b_m a_m))))
(*
angle_s
(if (<= (/ angle_m 180.0) 5e+81)
(pow
(*
(cbrt (+ b_m a_m))
(cbrt
(*
(- b_m a_m)
(sin (* PI (* 2.0 (* angle_m 0.005555555555555556)))))))
3.0)
(if (<= (/ angle_m 180.0) 2.5e+123)
(fabs
(*
(sin (* PI (* angle_m 0.011111111111111112)))
(- (pow b_m 2.0) (pow a_m 2.0))))
(if (<= (/ angle_m 180.0) 5e+140)
(*
t_0
(*
2.0
(*
(cos (* (/ angle_m 180.0) PI))
(sin (* 0.005555555555555556 (* angle_m PI))))))
(* t_0 (* 2.0 (sin (* PI (* angle_m 0.005555555555555556)))))))))))a_m = fabs(a);
b_m = fabs(b);
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a_m, double b_m, double angle_m) {
double t_0 = (b_m + a_m) * (b_m - a_m);
double tmp;
if ((angle_m / 180.0) <= 5e+81) {
tmp = pow((cbrt((b_m + a_m)) * cbrt(((b_m - a_m) * sin((((double) M_PI) * (2.0 * (angle_m * 0.005555555555555556))))))), 3.0);
} else if ((angle_m / 180.0) <= 2.5e+123) {
tmp = fabs((sin((((double) M_PI) * (angle_m * 0.011111111111111112))) * (pow(b_m, 2.0) - pow(a_m, 2.0))));
} else if ((angle_m / 180.0) <= 5e+140) {
tmp = t_0 * (2.0 * (cos(((angle_m / 180.0) * ((double) M_PI))) * sin((0.005555555555555556 * (angle_m * ((double) M_PI))))));
} else {
tmp = t_0 * (2.0 * sin((((double) M_PI) * (angle_m * 0.005555555555555556))));
}
return angle_s * tmp;
}
a_m = Math.abs(a);
b_m = Math.abs(b);
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a_m, double b_m, double angle_m) {
double t_0 = (b_m + a_m) * (b_m - a_m);
double tmp;
if ((angle_m / 180.0) <= 5e+81) {
tmp = Math.pow((Math.cbrt((b_m + a_m)) * Math.cbrt(((b_m - a_m) * Math.sin((Math.PI * (2.0 * (angle_m * 0.005555555555555556))))))), 3.0);
} else if ((angle_m / 180.0) <= 2.5e+123) {
tmp = Math.abs((Math.sin((Math.PI * (angle_m * 0.011111111111111112))) * (Math.pow(b_m, 2.0) - Math.pow(a_m, 2.0))));
} else if ((angle_m / 180.0) <= 5e+140) {
tmp = t_0 * (2.0 * (Math.cos(((angle_m / 180.0) * Math.PI)) * Math.sin((0.005555555555555556 * (angle_m * Math.PI)))));
} else {
tmp = t_0 * (2.0 * Math.sin((Math.PI * (angle_m * 0.005555555555555556))));
}
return angle_s * tmp;
}
a_m = abs(a) b_m = abs(b) angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a_m, b_m, angle_m) t_0 = Float64(Float64(b_m + a_m) * Float64(b_m - a_m)) tmp = 0.0 if (Float64(angle_m / 180.0) <= 5e+81) tmp = Float64(cbrt(Float64(b_m + a_m)) * cbrt(Float64(Float64(b_m - a_m) * sin(Float64(pi * Float64(2.0 * Float64(angle_m * 0.005555555555555556))))))) ^ 3.0; elseif (Float64(angle_m / 180.0) <= 2.5e+123) tmp = abs(Float64(sin(Float64(pi * Float64(angle_m * 0.011111111111111112))) * Float64((b_m ^ 2.0) - (a_m ^ 2.0)))); elseif (Float64(angle_m / 180.0) <= 5e+140) tmp = Float64(t_0 * Float64(2.0 * Float64(cos(Float64(Float64(angle_m / 180.0) * pi)) * sin(Float64(0.005555555555555556 * Float64(angle_m * pi)))))); else tmp = Float64(t_0 * Float64(2.0 * sin(Float64(pi * Float64(angle_m * 0.005555555555555556))))); end return Float64(angle_s * tmp) end
a_m = N[Abs[a], $MachinePrecision]
b_m = N[Abs[b], $MachinePrecision]
angle\_m = N[Abs[angle], $MachinePrecision]
angle\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a$95$m_, b$95$m_, angle$95$m_] := Block[{t$95$0 = N[(N[(b$95$m + a$95$m), $MachinePrecision] * N[(b$95$m - a$95$m), $MachinePrecision]), $MachinePrecision]}, N[(angle$95$s * If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 5e+81], N[Power[N[(N[Power[N[(b$95$m + a$95$m), $MachinePrecision], 1/3], $MachinePrecision] * N[Power[N[(N[(b$95$m - a$95$m), $MachinePrecision] * N[Sin[N[(Pi * N[(2.0 * N[(angle$95$m * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision], 3.0], $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 2.5e+123], N[Abs[N[(N[Sin[N[(Pi * N[(angle$95$m * 0.011111111111111112), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(N[Power[b$95$m, 2.0], $MachinePrecision] - N[Power[a$95$m, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 5e+140], N[(t$95$0 * N[(2.0 * N[(N[Cos[N[(N[(angle$95$m / 180.0), $MachinePrecision] * Pi), $MachinePrecision]], $MachinePrecision] * N[Sin[N[(0.005555555555555556 * N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$0 * N[(2.0 * N[Sin[N[(Pi * N[(angle$95$m * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]), $MachinePrecision]]
\begin{array}{l}
a_m = \left|a\right|
\\
b_m = \left|b\right|
\\
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
\begin{array}{l}
t_0 := \left(b\_m + a\_m\right) \cdot \left(b\_m - a\_m\right)\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;\frac{angle\_m}{180} \leq 5 \cdot 10^{+81}:\\
\;\;\;\;{\left(\sqrt[3]{b\_m + a\_m} \cdot \sqrt[3]{\left(b\_m - a\_m\right) \cdot \sin \left(\pi \cdot \left(2 \cdot \left(angle\_m \cdot 0.005555555555555556\right)\right)\right)}\right)}^{3}\\
\mathbf{elif}\;\frac{angle\_m}{180} \leq 2.5 \cdot 10^{+123}:\\
\;\;\;\;\left|\sin \left(\pi \cdot \left(angle\_m \cdot 0.011111111111111112\right)\right) \cdot \left({b\_m}^{2} - {a\_m}^{2}\right)\right|\\
\mathbf{elif}\;\frac{angle\_m}{180} \leq 5 \cdot 10^{+140}:\\
\;\;\;\;t\_0 \cdot \left(2 \cdot \left(\cos \left(\frac{angle\_m}{180} \cdot \pi\right) \cdot \sin \left(0.005555555555555556 \cdot \left(angle\_m \cdot \pi\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0 \cdot \left(2 \cdot \sin \left(\pi \cdot \left(angle\_m \cdot 0.005555555555555556\right)\right)\right)\\
\end{array}
\end{array}
\end{array}
if (/.f64 angle #s(literal 180 binary64)) < 4.9999999999999998e81Initial program 62.9%
associate-*l*62.9%
*-commutative62.9%
associate-*l*63.3%
Simplified63.3%
add-cube-cbrt62.9%
pow362.9%
2-sin62.9%
associate-*r*62.9%
div-inv62.6%
metadata-eval62.6%
Applied egg-rr62.6%
unpow262.6%
unpow262.6%
difference-of-squares66.5%
metadata-eval66.5%
div-inv67.3%
associate-*l*67.3%
2-sin67.3%
associate-*l*76.9%
cbrt-prod76.9%
Applied egg-rr76.0%
if 4.9999999999999998e81 < (/.f64 angle #s(literal 180 binary64)) < 2.49999999999999987e123Initial program 36.4%
associate-*l*36.4%
*-commutative36.4%
associate-*l*36.4%
Simplified36.4%
unpow236.4%
unpow236.4%
difference-of-squares36.6%
Applied egg-rr36.6%
Taylor expanded in angle around inf 40.2%
associate-*r*47.7%
*-commutative47.7%
*-commutative47.7%
*-commutative47.7%
Simplified47.7%
Applied egg-rr50.2%
unpow250.2%
rem-sqrt-square51.7%
Simplified51.7%
if 2.49999999999999987e123 < (/.f64 angle #s(literal 180 binary64)) < 5.00000000000000008e140Initial program 60.6%
associate-*l*60.6%
*-commutative60.6%
associate-*l*60.6%
Simplified60.6%
unpow260.6%
unpow260.6%
difference-of-squares60.6%
Applied egg-rr60.6%
Taylor expanded in angle around inf 80.6%
if 5.00000000000000008e140 < (/.f64 angle #s(literal 180 binary64)) Initial program 36.3%
associate-*l*36.3%
*-commutative36.3%
associate-*l*36.3%
Simplified36.3%
unpow236.3%
unpow236.3%
difference-of-squares45.7%
Applied egg-rr45.7%
Taylor expanded in angle around inf 48.3%
associate-*r*38.7%
*-commutative38.7%
*-commutative38.7%
*-commutative38.7%
Simplified38.7%
Taylor expanded in angle around 0 52.4%
Final simplification72.3%
a_m = (fabs.f64 a)
b_m = (fabs.f64 b)
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a_m b_m angle_m)
:precision binary64
(let* ((t_0 (* (/ angle_m 180.0) PI)) (t_1 (* (+ b_m a_m) (- b_m a_m))))
(*
angle_s
(if (<= (/ angle_m 180.0) 4e-56)
(pow
(*
(cbrt (+ b_m a_m))
(cbrt (* (- b_m a_m) (* PI (* angle_m 0.011111111111111112)))))
3.0)
(if (<= (/ angle_m 180.0) 5e+140)
(* t_1 (* 2.0 (* (cos t_0) (sin t_0))))
(* t_1 (* 2.0 (sin (* PI (* angle_m 0.005555555555555556))))))))))a_m = fabs(a);
b_m = fabs(b);
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a_m, double b_m, double angle_m) {
double t_0 = (angle_m / 180.0) * ((double) M_PI);
double t_1 = (b_m + a_m) * (b_m - a_m);
double tmp;
if ((angle_m / 180.0) <= 4e-56) {
tmp = pow((cbrt((b_m + a_m)) * cbrt(((b_m - a_m) * (((double) M_PI) * (angle_m * 0.011111111111111112))))), 3.0);
} else if ((angle_m / 180.0) <= 5e+140) {
tmp = t_1 * (2.0 * (cos(t_0) * sin(t_0)));
} else {
tmp = t_1 * (2.0 * sin((((double) M_PI) * (angle_m * 0.005555555555555556))));
}
return angle_s * tmp;
}
a_m = Math.abs(a);
b_m = Math.abs(b);
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a_m, double b_m, double angle_m) {
double t_0 = (angle_m / 180.0) * Math.PI;
double t_1 = (b_m + a_m) * (b_m - a_m);
double tmp;
if ((angle_m / 180.0) <= 4e-56) {
tmp = Math.pow((Math.cbrt((b_m + a_m)) * Math.cbrt(((b_m - a_m) * (Math.PI * (angle_m * 0.011111111111111112))))), 3.0);
} else if ((angle_m / 180.0) <= 5e+140) {
tmp = t_1 * (2.0 * (Math.cos(t_0) * Math.sin(t_0)));
} else {
tmp = t_1 * (2.0 * Math.sin((Math.PI * (angle_m * 0.005555555555555556))));
}
return angle_s * tmp;
}
a_m = abs(a) b_m = abs(b) angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a_m, b_m, angle_m) t_0 = Float64(Float64(angle_m / 180.0) * pi) t_1 = Float64(Float64(b_m + a_m) * Float64(b_m - a_m)) tmp = 0.0 if (Float64(angle_m / 180.0) <= 4e-56) tmp = Float64(cbrt(Float64(b_m + a_m)) * cbrt(Float64(Float64(b_m - a_m) * Float64(pi * Float64(angle_m * 0.011111111111111112))))) ^ 3.0; elseif (Float64(angle_m / 180.0) <= 5e+140) tmp = Float64(t_1 * Float64(2.0 * Float64(cos(t_0) * sin(t_0)))); else tmp = Float64(t_1 * Float64(2.0 * sin(Float64(pi * Float64(angle_m * 0.005555555555555556))))); end return Float64(angle_s * tmp) end
a_m = N[Abs[a], $MachinePrecision]
b_m = N[Abs[b], $MachinePrecision]
angle\_m = N[Abs[angle], $MachinePrecision]
angle\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a$95$m_, b$95$m_, angle$95$m_] := Block[{t$95$0 = N[(N[(angle$95$m / 180.0), $MachinePrecision] * Pi), $MachinePrecision]}, Block[{t$95$1 = N[(N[(b$95$m + a$95$m), $MachinePrecision] * N[(b$95$m - a$95$m), $MachinePrecision]), $MachinePrecision]}, N[(angle$95$s * If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 4e-56], N[Power[N[(N[Power[N[(b$95$m + a$95$m), $MachinePrecision], 1/3], $MachinePrecision] * N[Power[N[(N[(b$95$m - a$95$m), $MachinePrecision] * N[(Pi * N[(angle$95$m * 0.011111111111111112), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision], 3.0], $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 5e+140], N[(t$95$1 * N[(2.0 * N[(N[Cos[t$95$0], $MachinePrecision] * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$1 * N[(2.0 * N[Sin[N[(Pi * N[(angle$95$m * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]]]
\begin{array}{l}
a_m = \left|a\right|
\\
b_m = \left|b\right|
\\
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
\begin{array}{l}
t_0 := \frac{angle\_m}{180} \cdot \pi\\
t_1 := \left(b\_m + a\_m\right) \cdot \left(b\_m - a\_m\right)\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;\frac{angle\_m}{180} \leq 4 \cdot 10^{-56}:\\
\;\;\;\;{\left(\sqrt[3]{b\_m + a\_m} \cdot \sqrt[3]{\left(b\_m - a\_m\right) \cdot \left(\pi \cdot \left(angle\_m \cdot 0.011111111111111112\right)\right)}\right)}^{3}\\
\mathbf{elif}\;\frac{angle\_m}{180} \leq 5 \cdot 10^{+140}:\\
\;\;\;\;t\_1 \cdot \left(2 \cdot \left(\cos t\_0 \cdot \sin t\_0\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1 \cdot \left(2 \cdot \sin \left(\pi \cdot \left(angle\_m \cdot 0.005555555555555556\right)\right)\right)\\
\end{array}
\end{array}
\end{array}
if (/.f64 angle #s(literal 180 binary64)) < 4.0000000000000002e-56Initial program 62.1%
associate-*l*62.1%
*-commutative62.1%
associate-*l*62.6%
Simplified62.6%
add-cube-cbrt62.2%
pow362.2%
2-sin62.2%
associate-*r*62.2%
div-inv61.6%
metadata-eval61.6%
Applied egg-rr61.6%
unpow261.6%
unpow261.6%
difference-of-squares66.0%
metadata-eval66.0%
div-inv67.2%
associate-*l*67.2%
2-sin67.2%
associate-*l*77.8%
cbrt-prod77.8%
Applied egg-rr76.6%
Taylor expanded in angle around 0 75.9%
associate-*r*75.9%
*-commutative75.9%
Simplified75.9%
if 4.0000000000000002e-56 < (/.f64 angle #s(literal 180 binary64)) < 5.00000000000000008e140Initial program 59.9%
associate-*l*59.9%
*-commutative59.9%
associate-*l*59.9%
Simplified59.9%
unpow259.9%
unpow259.9%
difference-of-squares59.9%
Applied egg-rr59.9%
if 5.00000000000000008e140 < (/.f64 angle #s(literal 180 binary64)) Initial program 36.3%
associate-*l*36.3%
*-commutative36.3%
associate-*l*36.3%
Simplified36.3%
unpow236.3%
unpow236.3%
difference-of-squares45.7%
Applied egg-rr45.7%
Taylor expanded in angle around inf 48.3%
associate-*r*38.7%
*-commutative38.7%
*-commutative38.7%
*-commutative38.7%
Simplified38.7%
Taylor expanded in angle around 0 52.4%
Final simplification70.8%
a_m = (fabs.f64 a)
b_m = (fabs.f64 b)
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a_m b_m angle_m)
:precision binary64
(let* ((t_0 (* (+ b_m a_m) (- b_m a_m)))
(t_1 (* angle_m (* (+ b_m a_m) PI)))
(t_2 (* (/ angle_m 180.0) PI)))
(*
angle_s
(if (<= (/ angle_m 180.0) 5e-29)
(* 0.011111111111111112 (- (* b_m t_1) (* a_m t_1)))
(if (<= (/ angle_m 180.0) 5e+140)
(* t_0 (* 2.0 (* (cos t_2) (sin t_2))))
(* t_0 (* 2.0 (sin (* PI (* angle_m 0.005555555555555556))))))))))a_m = fabs(a);
b_m = fabs(b);
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a_m, double b_m, double angle_m) {
double t_0 = (b_m + a_m) * (b_m - a_m);
double t_1 = angle_m * ((b_m + a_m) * ((double) M_PI));
double t_2 = (angle_m / 180.0) * ((double) M_PI);
double tmp;
if ((angle_m / 180.0) <= 5e-29) {
tmp = 0.011111111111111112 * ((b_m * t_1) - (a_m * t_1));
} else if ((angle_m / 180.0) <= 5e+140) {
tmp = t_0 * (2.0 * (cos(t_2) * sin(t_2)));
} else {
tmp = t_0 * (2.0 * sin((((double) M_PI) * (angle_m * 0.005555555555555556))));
}
return angle_s * tmp;
}
a_m = Math.abs(a);
b_m = Math.abs(b);
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a_m, double b_m, double angle_m) {
double t_0 = (b_m + a_m) * (b_m - a_m);
double t_1 = angle_m * ((b_m + a_m) * Math.PI);
double t_2 = (angle_m / 180.0) * Math.PI;
double tmp;
if ((angle_m / 180.0) <= 5e-29) {
tmp = 0.011111111111111112 * ((b_m * t_1) - (a_m * t_1));
} else if ((angle_m / 180.0) <= 5e+140) {
tmp = t_0 * (2.0 * (Math.cos(t_2) * Math.sin(t_2)));
} else {
tmp = t_0 * (2.0 * Math.sin((Math.PI * (angle_m * 0.005555555555555556))));
}
return angle_s * tmp;
}
a_m = math.fabs(a) b_m = math.fabs(b) angle\_m = math.fabs(angle) angle\_s = math.copysign(1.0, angle) def code(angle_s, a_m, b_m, angle_m): t_0 = (b_m + a_m) * (b_m - a_m) t_1 = angle_m * ((b_m + a_m) * math.pi) t_2 = (angle_m / 180.0) * math.pi tmp = 0 if (angle_m / 180.0) <= 5e-29: tmp = 0.011111111111111112 * ((b_m * t_1) - (a_m * t_1)) elif (angle_m / 180.0) <= 5e+140: tmp = t_0 * (2.0 * (math.cos(t_2) * math.sin(t_2))) else: tmp = t_0 * (2.0 * math.sin((math.pi * (angle_m * 0.005555555555555556)))) return angle_s * tmp
a_m = abs(a) b_m = abs(b) angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a_m, b_m, angle_m) t_0 = Float64(Float64(b_m + a_m) * Float64(b_m - a_m)) t_1 = Float64(angle_m * Float64(Float64(b_m + a_m) * pi)) t_2 = Float64(Float64(angle_m / 180.0) * pi) tmp = 0.0 if (Float64(angle_m / 180.0) <= 5e-29) tmp = Float64(0.011111111111111112 * Float64(Float64(b_m * t_1) - Float64(a_m * t_1))); elseif (Float64(angle_m / 180.0) <= 5e+140) tmp = Float64(t_0 * Float64(2.0 * Float64(cos(t_2) * sin(t_2)))); else tmp = Float64(t_0 * Float64(2.0 * sin(Float64(pi * Float64(angle_m * 0.005555555555555556))))); end return Float64(angle_s * tmp) end
a_m = abs(a); b_m = abs(b); angle\_m = abs(angle); angle\_s = sign(angle) * abs(1.0); function tmp_2 = code(angle_s, a_m, b_m, angle_m) t_0 = (b_m + a_m) * (b_m - a_m); t_1 = angle_m * ((b_m + a_m) * pi); t_2 = (angle_m / 180.0) * pi; tmp = 0.0; if ((angle_m / 180.0) <= 5e-29) tmp = 0.011111111111111112 * ((b_m * t_1) - (a_m * t_1)); elseif ((angle_m / 180.0) <= 5e+140) tmp = t_0 * (2.0 * (cos(t_2) * sin(t_2))); else tmp = t_0 * (2.0 * sin((pi * (angle_m * 0.005555555555555556)))); end tmp_2 = angle_s * tmp; end
a_m = N[Abs[a], $MachinePrecision]
b_m = N[Abs[b], $MachinePrecision]
angle\_m = N[Abs[angle], $MachinePrecision]
angle\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a$95$m_, b$95$m_, angle$95$m_] := Block[{t$95$0 = N[(N[(b$95$m + a$95$m), $MachinePrecision] * N[(b$95$m - a$95$m), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(angle$95$m * N[(N[(b$95$m + a$95$m), $MachinePrecision] * Pi), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(angle$95$m / 180.0), $MachinePrecision] * Pi), $MachinePrecision]}, N[(angle$95$s * If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 5e-29], N[(0.011111111111111112 * N[(N[(b$95$m * t$95$1), $MachinePrecision] - N[(a$95$m * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 5e+140], N[(t$95$0 * N[(2.0 * N[(N[Cos[t$95$2], $MachinePrecision] * N[Sin[t$95$2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$0 * N[(2.0 * N[Sin[N[(Pi * N[(angle$95$m * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]]]]
\begin{array}{l}
a_m = \left|a\right|
\\
b_m = \left|b\right|
\\
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
\begin{array}{l}
t_0 := \left(b\_m + a\_m\right) \cdot \left(b\_m - a\_m\right)\\
t_1 := angle\_m \cdot \left(\left(b\_m + a\_m\right) \cdot \pi\right)\\
t_2 := \frac{angle\_m}{180} \cdot \pi\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;\frac{angle\_m}{180} \leq 5 \cdot 10^{-29}:\\
\;\;\;\;0.011111111111111112 \cdot \left(b\_m \cdot t\_1 - a\_m \cdot t\_1\right)\\
\mathbf{elif}\;\frac{angle\_m}{180} \leq 5 \cdot 10^{+140}:\\
\;\;\;\;t\_0 \cdot \left(2 \cdot \left(\cos t\_2 \cdot \sin t\_2\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0 \cdot \left(2 \cdot \sin \left(\pi \cdot \left(angle\_m \cdot 0.005555555555555556\right)\right)\right)\\
\end{array}
\end{array}
\end{array}
if (/.f64 angle #s(literal 180 binary64)) < 4.99999999999999986e-29Initial program 62.9%
associate-*l*62.9%
*-commutative62.9%
associate-*l*63.4%
Simplified63.4%
Taylor expanded in angle around 0 62.1%
unpow262.1%
unpow262.1%
difference-of-squares67.5%
Applied egg-rr67.5%
Taylor expanded in angle around 0 67.5%
associate-*r*67.4%
Simplified67.4%
associate-*r*76.6%
sub-neg76.6%
distribute-lft-in73.4%
+-commutative73.4%
+-commutative73.4%
Applied egg-rr73.4%
if 4.99999999999999986e-29 < (/.f64 angle #s(literal 180 binary64)) < 5.00000000000000008e140Initial program 54.9%
associate-*l*55.0%
*-commutative55.0%
associate-*l*55.0%
Simplified55.0%
unpow255.0%
unpow255.0%
difference-of-squares55.0%
Applied egg-rr55.0%
if 5.00000000000000008e140 < (/.f64 angle #s(literal 180 binary64)) Initial program 36.3%
associate-*l*36.3%
*-commutative36.3%
associate-*l*36.3%
Simplified36.3%
unpow236.3%
unpow236.3%
difference-of-squares45.7%
Applied egg-rr45.7%
Taylor expanded in angle around inf 48.3%
associate-*r*38.7%
*-commutative38.7%
*-commutative38.7%
*-commutative38.7%
Simplified38.7%
Taylor expanded in angle around 0 52.4%
Final simplification68.5%
a_m = (fabs.f64 a)
b_m = (fabs.f64 b)
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a_m b_m angle_m)
:precision binary64
(let* ((t_0 (* (+ b_m a_m) (- b_m a_m)))
(t_1 (* angle_m (* (+ b_m a_m) PI)))
(t_2 (* (/ angle_m 180.0) PI)))
(*
angle_s
(if (<= (/ angle_m 180.0) 5e-29)
(* 0.011111111111111112 (- (* b_m t_1) (* a_m t_1)))
(if (<= (/ angle_m 180.0) 5e+140)
(* 2.0 (* (cos t_2) (* t_0 (sin t_2))))
(* t_0 (* 2.0 (sin (* PI (* angle_m 0.005555555555555556))))))))))a_m = fabs(a);
b_m = fabs(b);
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a_m, double b_m, double angle_m) {
double t_0 = (b_m + a_m) * (b_m - a_m);
double t_1 = angle_m * ((b_m + a_m) * ((double) M_PI));
double t_2 = (angle_m / 180.0) * ((double) M_PI);
double tmp;
if ((angle_m / 180.0) <= 5e-29) {
tmp = 0.011111111111111112 * ((b_m * t_1) - (a_m * t_1));
} else if ((angle_m / 180.0) <= 5e+140) {
tmp = 2.0 * (cos(t_2) * (t_0 * sin(t_2)));
} else {
tmp = t_0 * (2.0 * sin((((double) M_PI) * (angle_m * 0.005555555555555556))));
}
return angle_s * tmp;
}
a_m = Math.abs(a);
b_m = Math.abs(b);
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a_m, double b_m, double angle_m) {
double t_0 = (b_m + a_m) * (b_m - a_m);
double t_1 = angle_m * ((b_m + a_m) * Math.PI);
double t_2 = (angle_m / 180.0) * Math.PI;
double tmp;
if ((angle_m / 180.0) <= 5e-29) {
tmp = 0.011111111111111112 * ((b_m * t_1) - (a_m * t_1));
} else if ((angle_m / 180.0) <= 5e+140) {
tmp = 2.0 * (Math.cos(t_2) * (t_0 * Math.sin(t_2)));
} else {
tmp = t_0 * (2.0 * Math.sin((Math.PI * (angle_m * 0.005555555555555556))));
}
return angle_s * tmp;
}
a_m = math.fabs(a) b_m = math.fabs(b) angle\_m = math.fabs(angle) angle\_s = math.copysign(1.0, angle) def code(angle_s, a_m, b_m, angle_m): t_0 = (b_m + a_m) * (b_m - a_m) t_1 = angle_m * ((b_m + a_m) * math.pi) t_2 = (angle_m / 180.0) * math.pi tmp = 0 if (angle_m / 180.0) <= 5e-29: tmp = 0.011111111111111112 * ((b_m * t_1) - (a_m * t_1)) elif (angle_m / 180.0) <= 5e+140: tmp = 2.0 * (math.cos(t_2) * (t_0 * math.sin(t_2))) else: tmp = t_0 * (2.0 * math.sin((math.pi * (angle_m * 0.005555555555555556)))) return angle_s * tmp
a_m = abs(a) b_m = abs(b) angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a_m, b_m, angle_m) t_0 = Float64(Float64(b_m + a_m) * Float64(b_m - a_m)) t_1 = Float64(angle_m * Float64(Float64(b_m + a_m) * pi)) t_2 = Float64(Float64(angle_m / 180.0) * pi) tmp = 0.0 if (Float64(angle_m / 180.0) <= 5e-29) tmp = Float64(0.011111111111111112 * Float64(Float64(b_m * t_1) - Float64(a_m * t_1))); elseif (Float64(angle_m / 180.0) <= 5e+140) tmp = Float64(2.0 * Float64(cos(t_2) * Float64(t_0 * sin(t_2)))); else tmp = Float64(t_0 * Float64(2.0 * sin(Float64(pi * Float64(angle_m * 0.005555555555555556))))); end return Float64(angle_s * tmp) end
a_m = abs(a); b_m = abs(b); angle\_m = abs(angle); angle\_s = sign(angle) * abs(1.0); function tmp_2 = code(angle_s, a_m, b_m, angle_m) t_0 = (b_m + a_m) * (b_m - a_m); t_1 = angle_m * ((b_m + a_m) * pi); t_2 = (angle_m / 180.0) * pi; tmp = 0.0; if ((angle_m / 180.0) <= 5e-29) tmp = 0.011111111111111112 * ((b_m * t_1) - (a_m * t_1)); elseif ((angle_m / 180.0) <= 5e+140) tmp = 2.0 * (cos(t_2) * (t_0 * sin(t_2))); else tmp = t_0 * (2.0 * sin((pi * (angle_m * 0.005555555555555556)))); end tmp_2 = angle_s * tmp; end
a_m = N[Abs[a], $MachinePrecision]
b_m = N[Abs[b], $MachinePrecision]
angle\_m = N[Abs[angle], $MachinePrecision]
angle\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a$95$m_, b$95$m_, angle$95$m_] := Block[{t$95$0 = N[(N[(b$95$m + a$95$m), $MachinePrecision] * N[(b$95$m - a$95$m), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(angle$95$m * N[(N[(b$95$m + a$95$m), $MachinePrecision] * Pi), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(angle$95$m / 180.0), $MachinePrecision] * Pi), $MachinePrecision]}, N[(angle$95$s * If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 5e-29], N[(0.011111111111111112 * N[(N[(b$95$m * t$95$1), $MachinePrecision] - N[(a$95$m * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 5e+140], N[(2.0 * N[(N[Cos[t$95$2], $MachinePrecision] * N[(t$95$0 * N[Sin[t$95$2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$0 * N[(2.0 * N[Sin[N[(Pi * N[(angle$95$m * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]]]]
\begin{array}{l}
a_m = \left|a\right|
\\
b_m = \left|b\right|
\\
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
\begin{array}{l}
t_0 := \left(b\_m + a\_m\right) \cdot \left(b\_m - a\_m\right)\\
t_1 := angle\_m \cdot \left(\left(b\_m + a\_m\right) \cdot \pi\right)\\
t_2 := \frac{angle\_m}{180} \cdot \pi\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;\frac{angle\_m}{180} \leq 5 \cdot 10^{-29}:\\
\;\;\;\;0.011111111111111112 \cdot \left(b\_m \cdot t\_1 - a\_m \cdot t\_1\right)\\
\mathbf{elif}\;\frac{angle\_m}{180} \leq 5 \cdot 10^{+140}:\\
\;\;\;\;2 \cdot \left(\cos t\_2 \cdot \left(t\_0 \cdot \sin t\_2\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0 \cdot \left(2 \cdot \sin \left(\pi \cdot \left(angle\_m \cdot 0.005555555555555556\right)\right)\right)\\
\end{array}
\end{array}
\end{array}
if (/.f64 angle #s(literal 180 binary64)) < 4.99999999999999986e-29Initial program 62.9%
associate-*l*62.9%
*-commutative62.9%
associate-*l*63.4%
Simplified63.4%
Taylor expanded in angle around 0 62.1%
unpow262.1%
unpow262.1%
difference-of-squares67.5%
Applied egg-rr67.5%
Taylor expanded in angle around 0 67.5%
associate-*r*67.4%
Simplified67.4%
associate-*r*76.6%
sub-neg76.6%
distribute-lft-in73.4%
+-commutative73.4%
+-commutative73.4%
Applied egg-rr73.4%
if 4.99999999999999986e-29 < (/.f64 angle #s(literal 180 binary64)) < 5.00000000000000008e140Initial program 54.9%
associate-*l*54.9%
associate-*l*54.9%
Simplified54.9%
unpow254.9%
unpow254.9%
difference-of-squares55.0%
Applied egg-rr55.0%
if 5.00000000000000008e140 < (/.f64 angle #s(literal 180 binary64)) Initial program 36.3%
associate-*l*36.3%
*-commutative36.3%
associate-*l*36.3%
Simplified36.3%
unpow236.3%
unpow236.3%
difference-of-squares45.7%
Applied egg-rr45.7%
Taylor expanded in angle around inf 48.3%
associate-*r*38.7%
*-commutative38.7%
*-commutative38.7%
*-commutative38.7%
Simplified38.7%
Taylor expanded in angle around 0 52.4%
Final simplification68.5%
a_m = (fabs.f64 a)
b_m = (fabs.f64 b)
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a_m b_m angle_m)
:precision binary64
(let* ((t_0 (* angle_m (* (+ b_m a_m) PI)))
(t_1 (* (+ b_m a_m) (- b_m a_m)))
(t_2 (* 0.005555555555555556 (* angle_m PI))))
(*
angle_s
(if (<= (/ angle_m 180.0) 5e-29)
(* 0.011111111111111112 (- (* b_m t_0) (* a_m t_0)))
(if (<= (/ angle_m 180.0) 2e+28)
(* 2.0 (* (cos t_2) (* t_1 (sin t_2))))
(* t_1 (* 2.0 (sin (* PI (* angle_m 0.005555555555555556))))))))))a_m = fabs(a);
b_m = fabs(b);
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a_m, double b_m, double angle_m) {
double t_0 = angle_m * ((b_m + a_m) * ((double) M_PI));
double t_1 = (b_m + a_m) * (b_m - a_m);
double t_2 = 0.005555555555555556 * (angle_m * ((double) M_PI));
double tmp;
if ((angle_m / 180.0) <= 5e-29) {
tmp = 0.011111111111111112 * ((b_m * t_0) - (a_m * t_0));
} else if ((angle_m / 180.0) <= 2e+28) {
tmp = 2.0 * (cos(t_2) * (t_1 * sin(t_2)));
} else {
tmp = t_1 * (2.0 * sin((((double) M_PI) * (angle_m * 0.005555555555555556))));
}
return angle_s * tmp;
}
a_m = Math.abs(a);
b_m = Math.abs(b);
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a_m, double b_m, double angle_m) {
double t_0 = angle_m * ((b_m + a_m) * Math.PI);
double t_1 = (b_m + a_m) * (b_m - a_m);
double t_2 = 0.005555555555555556 * (angle_m * Math.PI);
double tmp;
if ((angle_m / 180.0) <= 5e-29) {
tmp = 0.011111111111111112 * ((b_m * t_0) - (a_m * t_0));
} else if ((angle_m / 180.0) <= 2e+28) {
tmp = 2.0 * (Math.cos(t_2) * (t_1 * Math.sin(t_2)));
} else {
tmp = t_1 * (2.0 * Math.sin((Math.PI * (angle_m * 0.005555555555555556))));
}
return angle_s * tmp;
}
a_m = math.fabs(a) b_m = math.fabs(b) angle\_m = math.fabs(angle) angle\_s = math.copysign(1.0, angle) def code(angle_s, a_m, b_m, angle_m): t_0 = angle_m * ((b_m + a_m) * math.pi) t_1 = (b_m + a_m) * (b_m - a_m) t_2 = 0.005555555555555556 * (angle_m * math.pi) tmp = 0 if (angle_m / 180.0) <= 5e-29: tmp = 0.011111111111111112 * ((b_m * t_0) - (a_m * t_0)) elif (angle_m / 180.0) <= 2e+28: tmp = 2.0 * (math.cos(t_2) * (t_1 * math.sin(t_2))) else: tmp = t_1 * (2.0 * math.sin((math.pi * (angle_m * 0.005555555555555556)))) return angle_s * tmp
a_m = abs(a) b_m = abs(b) angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a_m, b_m, angle_m) t_0 = Float64(angle_m * Float64(Float64(b_m + a_m) * pi)) t_1 = Float64(Float64(b_m + a_m) * Float64(b_m - a_m)) t_2 = Float64(0.005555555555555556 * Float64(angle_m * pi)) tmp = 0.0 if (Float64(angle_m / 180.0) <= 5e-29) tmp = Float64(0.011111111111111112 * Float64(Float64(b_m * t_0) - Float64(a_m * t_0))); elseif (Float64(angle_m / 180.0) <= 2e+28) tmp = Float64(2.0 * Float64(cos(t_2) * Float64(t_1 * sin(t_2)))); else tmp = Float64(t_1 * Float64(2.0 * sin(Float64(pi * Float64(angle_m * 0.005555555555555556))))); end return Float64(angle_s * tmp) end
a_m = abs(a); b_m = abs(b); angle\_m = abs(angle); angle\_s = sign(angle) * abs(1.0); function tmp_2 = code(angle_s, a_m, b_m, angle_m) t_0 = angle_m * ((b_m + a_m) * pi); t_1 = (b_m + a_m) * (b_m - a_m); t_2 = 0.005555555555555556 * (angle_m * pi); tmp = 0.0; if ((angle_m / 180.0) <= 5e-29) tmp = 0.011111111111111112 * ((b_m * t_0) - (a_m * t_0)); elseif ((angle_m / 180.0) <= 2e+28) tmp = 2.0 * (cos(t_2) * (t_1 * sin(t_2))); else tmp = t_1 * (2.0 * sin((pi * (angle_m * 0.005555555555555556)))); end tmp_2 = angle_s * tmp; end
a_m = N[Abs[a], $MachinePrecision]
b_m = N[Abs[b], $MachinePrecision]
angle\_m = N[Abs[angle], $MachinePrecision]
angle\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a$95$m_, b$95$m_, angle$95$m_] := Block[{t$95$0 = N[(angle$95$m * N[(N[(b$95$m + a$95$m), $MachinePrecision] * Pi), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(b$95$m + a$95$m), $MachinePrecision] * N[(b$95$m - a$95$m), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(0.005555555555555556 * N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision]}, N[(angle$95$s * If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 5e-29], N[(0.011111111111111112 * N[(N[(b$95$m * t$95$0), $MachinePrecision] - N[(a$95$m * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 2e+28], N[(2.0 * N[(N[Cos[t$95$2], $MachinePrecision] * N[(t$95$1 * N[Sin[t$95$2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$1 * N[(2.0 * N[Sin[N[(Pi * N[(angle$95$m * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]]]]
\begin{array}{l}
a_m = \left|a\right|
\\
b_m = \left|b\right|
\\
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
\begin{array}{l}
t_0 := angle\_m \cdot \left(\left(b\_m + a\_m\right) \cdot \pi\right)\\
t_1 := \left(b\_m + a\_m\right) \cdot \left(b\_m - a\_m\right)\\
t_2 := 0.005555555555555556 \cdot \left(angle\_m \cdot \pi\right)\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;\frac{angle\_m}{180} \leq 5 \cdot 10^{-29}:\\
\;\;\;\;0.011111111111111112 \cdot \left(b\_m \cdot t\_0 - a\_m \cdot t\_0\right)\\
\mathbf{elif}\;\frac{angle\_m}{180} \leq 2 \cdot 10^{+28}:\\
\;\;\;\;2 \cdot \left(\cos t\_2 \cdot \left(t\_1 \cdot \sin t\_2\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1 \cdot \left(2 \cdot \sin \left(\pi \cdot \left(angle\_m \cdot 0.005555555555555556\right)\right)\right)\\
\end{array}
\end{array}
\end{array}
if (/.f64 angle #s(literal 180 binary64)) < 4.99999999999999986e-29Initial program 62.9%
associate-*l*62.9%
*-commutative62.9%
associate-*l*63.4%
Simplified63.4%
Taylor expanded in angle around 0 62.1%
unpow262.1%
unpow262.1%
difference-of-squares67.5%
Applied egg-rr67.5%
Taylor expanded in angle around 0 67.5%
associate-*r*67.4%
Simplified67.4%
associate-*r*76.6%
sub-neg76.6%
distribute-lft-in73.4%
+-commutative73.4%
+-commutative73.4%
Applied egg-rr73.4%
if 4.99999999999999986e-29 < (/.f64 angle #s(literal 180 binary64)) < 1.99999999999999992e28Initial program 92.0%
associate-*l*92.2%
*-commutative92.2%
associate-*l*92.2%
Simplified92.2%
unpow292.2%
unpow292.2%
difference-of-squares92.2%
Applied egg-rr92.2%
Taylor expanded in angle around inf 92.0%
if 1.99999999999999992e28 < (/.f64 angle #s(literal 180 binary64)) Initial program 39.0%
associate-*l*39.0%
*-commutative39.0%
associate-*l*39.0%
Simplified39.0%
unpow239.0%
unpow239.0%
difference-of-squares44.4%
Applied egg-rr44.4%
Taylor expanded in angle around inf 46.3%
associate-*r*42.0%
*-commutative42.0%
*-commutative42.0%
*-commutative42.0%
Simplified42.0%
Taylor expanded in angle around 0 42.2%
Final simplification67.1%
a_m = (fabs.f64 a)
b_m = (fabs.f64 b)
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a_m b_m angle_m)
:precision binary64
(let* ((t_0 (* angle_m (* (+ b_m a_m) PI))))
(*
angle_s
(if (<= (/ angle_m 180.0) 5e-29)
(* 0.011111111111111112 (- (* b_m t_0) (* a_m t_0)))
(*
(* (+ b_m a_m) (- b_m a_m))
(* 2.0 (sin (* PI (* angle_m 0.005555555555555556)))))))))a_m = fabs(a);
b_m = fabs(b);
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a_m, double b_m, double angle_m) {
double t_0 = angle_m * ((b_m + a_m) * ((double) M_PI));
double tmp;
if ((angle_m / 180.0) <= 5e-29) {
tmp = 0.011111111111111112 * ((b_m * t_0) - (a_m * t_0));
} else {
tmp = ((b_m + a_m) * (b_m - a_m)) * (2.0 * sin((((double) M_PI) * (angle_m * 0.005555555555555556))));
}
return angle_s * tmp;
}
a_m = Math.abs(a);
b_m = Math.abs(b);
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a_m, double b_m, double angle_m) {
double t_0 = angle_m * ((b_m + a_m) * Math.PI);
double tmp;
if ((angle_m / 180.0) <= 5e-29) {
tmp = 0.011111111111111112 * ((b_m * t_0) - (a_m * t_0));
} else {
tmp = ((b_m + a_m) * (b_m - a_m)) * (2.0 * Math.sin((Math.PI * (angle_m * 0.005555555555555556))));
}
return angle_s * tmp;
}
a_m = math.fabs(a) b_m = math.fabs(b) angle\_m = math.fabs(angle) angle\_s = math.copysign(1.0, angle) def code(angle_s, a_m, b_m, angle_m): t_0 = angle_m * ((b_m + a_m) * math.pi) tmp = 0 if (angle_m / 180.0) <= 5e-29: tmp = 0.011111111111111112 * ((b_m * t_0) - (a_m * t_0)) else: tmp = ((b_m + a_m) * (b_m - a_m)) * (2.0 * math.sin((math.pi * (angle_m * 0.005555555555555556)))) return angle_s * tmp
a_m = abs(a) b_m = abs(b) angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a_m, b_m, angle_m) t_0 = Float64(angle_m * Float64(Float64(b_m + a_m) * pi)) tmp = 0.0 if (Float64(angle_m / 180.0) <= 5e-29) tmp = Float64(0.011111111111111112 * Float64(Float64(b_m * t_0) - Float64(a_m * t_0))); else tmp = Float64(Float64(Float64(b_m + a_m) * Float64(b_m - a_m)) * Float64(2.0 * sin(Float64(pi * Float64(angle_m * 0.005555555555555556))))); end return Float64(angle_s * tmp) end
a_m = abs(a); b_m = abs(b); angle\_m = abs(angle); angle\_s = sign(angle) * abs(1.0); function tmp_2 = code(angle_s, a_m, b_m, angle_m) t_0 = angle_m * ((b_m + a_m) * pi); tmp = 0.0; if ((angle_m / 180.0) <= 5e-29) tmp = 0.011111111111111112 * ((b_m * t_0) - (a_m * t_0)); else tmp = ((b_m + a_m) * (b_m - a_m)) * (2.0 * sin((pi * (angle_m * 0.005555555555555556)))); end tmp_2 = angle_s * tmp; end
a_m = N[Abs[a], $MachinePrecision]
b_m = N[Abs[b], $MachinePrecision]
angle\_m = N[Abs[angle], $MachinePrecision]
angle\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a$95$m_, b$95$m_, angle$95$m_] := Block[{t$95$0 = N[(angle$95$m * N[(N[(b$95$m + a$95$m), $MachinePrecision] * Pi), $MachinePrecision]), $MachinePrecision]}, N[(angle$95$s * If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 5e-29], N[(0.011111111111111112 * N[(N[(b$95$m * t$95$0), $MachinePrecision] - N[(a$95$m * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(b$95$m + a$95$m), $MachinePrecision] * N[(b$95$m - a$95$m), $MachinePrecision]), $MachinePrecision] * N[(2.0 * N[Sin[N[(Pi * N[(angle$95$m * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]]
\begin{array}{l}
a_m = \left|a\right|
\\
b_m = \left|b\right|
\\
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
\begin{array}{l}
t_0 := angle\_m \cdot \left(\left(b\_m + a\_m\right) \cdot \pi\right)\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;\frac{angle\_m}{180} \leq 5 \cdot 10^{-29}:\\
\;\;\;\;0.011111111111111112 \cdot \left(b\_m \cdot t\_0 - a\_m \cdot t\_0\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(b\_m + a\_m\right) \cdot \left(b\_m - a\_m\right)\right) \cdot \left(2 \cdot \sin \left(\pi \cdot \left(angle\_m \cdot 0.005555555555555556\right)\right)\right)\\
\end{array}
\end{array}
\end{array}
if (/.f64 angle #s(literal 180 binary64)) < 4.99999999999999986e-29Initial program 62.9%
associate-*l*62.9%
*-commutative62.9%
associate-*l*63.4%
Simplified63.4%
Taylor expanded in angle around 0 62.1%
unpow262.1%
unpow262.1%
difference-of-squares67.5%
Applied egg-rr67.5%
Taylor expanded in angle around 0 67.5%
associate-*r*67.4%
Simplified67.4%
associate-*r*76.6%
sub-neg76.6%
distribute-lft-in73.4%
+-commutative73.4%
+-commutative73.4%
Applied egg-rr73.4%
if 4.99999999999999986e-29 < (/.f64 angle #s(literal 180 binary64)) Initial program 45.6%
associate-*l*45.6%
*-commutative45.6%
associate-*l*45.6%
Simplified45.6%
unpow245.6%
unpow245.6%
difference-of-squares50.3%
Applied egg-rr50.3%
Taylor expanded in angle around inf 52.1%
associate-*r*48.3%
*-commutative48.3%
*-commutative48.3%
*-commutative48.3%
Simplified48.3%
Taylor expanded in angle around 0 43.8%
Final simplification66.0%
a_m = (fabs.f64 a)
b_m = (fabs.f64 b)
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a_m b_m angle_m)
:precision binary64
(let* ((t_0 (* angle_m (* (+ b_m a_m) PI))))
(*
angle_s
(if (<= angle_m 2.7e-51)
(* 0.011111111111111112 (- (* b_m t_0) (* a_m t_0)))
(*
0.011111111111111112
(* angle_m (* PI (* (+ b_m a_m) (- b_m a_m)))))))))a_m = fabs(a);
b_m = fabs(b);
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a_m, double b_m, double angle_m) {
double t_0 = angle_m * ((b_m + a_m) * ((double) M_PI));
double tmp;
if (angle_m <= 2.7e-51) {
tmp = 0.011111111111111112 * ((b_m * t_0) - (a_m * t_0));
} else {
tmp = 0.011111111111111112 * (angle_m * (((double) M_PI) * ((b_m + a_m) * (b_m - a_m))));
}
return angle_s * tmp;
}
a_m = Math.abs(a);
b_m = Math.abs(b);
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a_m, double b_m, double angle_m) {
double t_0 = angle_m * ((b_m + a_m) * Math.PI);
double tmp;
if (angle_m <= 2.7e-51) {
tmp = 0.011111111111111112 * ((b_m * t_0) - (a_m * t_0));
} else {
tmp = 0.011111111111111112 * (angle_m * (Math.PI * ((b_m + a_m) * (b_m - a_m))));
}
return angle_s * tmp;
}
a_m = math.fabs(a) b_m = math.fabs(b) angle\_m = math.fabs(angle) angle\_s = math.copysign(1.0, angle) def code(angle_s, a_m, b_m, angle_m): t_0 = angle_m * ((b_m + a_m) * math.pi) tmp = 0 if angle_m <= 2.7e-51: tmp = 0.011111111111111112 * ((b_m * t_0) - (a_m * t_0)) else: tmp = 0.011111111111111112 * (angle_m * (math.pi * ((b_m + a_m) * (b_m - a_m)))) return angle_s * tmp
a_m = abs(a) b_m = abs(b) angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a_m, b_m, angle_m) t_0 = Float64(angle_m * Float64(Float64(b_m + a_m) * pi)) tmp = 0.0 if (angle_m <= 2.7e-51) tmp = Float64(0.011111111111111112 * Float64(Float64(b_m * t_0) - Float64(a_m * t_0))); else tmp = Float64(0.011111111111111112 * Float64(angle_m * Float64(pi * Float64(Float64(b_m + a_m) * Float64(b_m - a_m))))); end return Float64(angle_s * tmp) end
a_m = abs(a); b_m = abs(b); angle\_m = abs(angle); angle\_s = sign(angle) * abs(1.0); function tmp_2 = code(angle_s, a_m, b_m, angle_m) t_0 = angle_m * ((b_m + a_m) * pi); tmp = 0.0; if (angle_m <= 2.7e-51) tmp = 0.011111111111111112 * ((b_m * t_0) - (a_m * t_0)); else tmp = 0.011111111111111112 * (angle_m * (pi * ((b_m + a_m) * (b_m - a_m)))); end tmp_2 = angle_s * tmp; end
a_m = N[Abs[a], $MachinePrecision]
b_m = N[Abs[b], $MachinePrecision]
angle\_m = N[Abs[angle], $MachinePrecision]
angle\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a$95$m_, b$95$m_, angle$95$m_] := Block[{t$95$0 = N[(angle$95$m * N[(N[(b$95$m + a$95$m), $MachinePrecision] * Pi), $MachinePrecision]), $MachinePrecision]}, N[(angle$95$s * If[LessEqual[angle$95$m, 2.7e-51], N[(0.011111111111111112 * N[(N[(b$95$m * t$95$0), $MachinePrecision] - N[(a$95$m * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.011111111111111112 * N[(angle$95$m * N[(Pi * N[(N[(b$95$m + a$95$m), $MachinePrecision] * N[(b$95$m - a$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]]
\begin{array}{l}
a_m = \left|a\right|
\\
b_m = \left|b\right|
\\
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
\begin{array}{l}
t_0 := angle\_m \cdot \left(\left(b\_m + a\_m\right) \cdot \pi\right)\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;angle\_m \leq 2.7 \cdot 10^{-51}:\\
\;\;\;\;0.011111111111111112 \cdot \left(b\_m \cdot t\_0 - a\_m \cdot t\_0\right)\\
\mathbf{else}:\\
\;\;\;\;0.011111111111111112 \cdot \left(angle\_m \cdot \left(\pi \cdot \left(\left(b\_m + a\_m\right) \cdot \left(b\_m - a\_m\right)\right)\right)\right)\\
\end{array}
\end{array}
\end{array}
if angle < 2.6999999999999997e-51Initial program 62.1%
associate-*l*62.1%
*-commutative62.1%
associate-*l*62.6%
Simplified62.6%
Taylor expanded in angle around 0 61.3%
unpow261.3%
unpow261.3%
difference-of-squares66.8%
Applied egg-rr66.8%
Taylor expanded in angle around 0 66.8%
associate-*r*66.8%
Simplified66.8%
associate-*r*76.1%
sub-neg76.1%
distribute-lft-in72.8%
+-commutative72.8%
+-commutative72.8%
Applied egg-rr72.8%
if 2.6999999999999997e-51 < angle Initial program 48.8%
associate-*l*48.8%
*-commutative48.8%
associate-*l*48.8%
Simplified48.8%
Taylor expanded in angle around 0 38.2%
unpow238.2%
unpow238.2%
difference-of-squares39.7%
Applied egg-rr39.7%
Final simplification64.0%
a_m = (fabs.f64 a)
b_m = (fabs.f64 b)
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a_m b_m angle_m)
:precision binary64
(*
angle_s
(if (<= a_m 8.5e-16)
(* 0.011111111111111112 (* angle_m (* (- b_m a_m) (* b_m PI))))
(* 0.011111111111111112 (* angle_m (* (- b_m a_m) (* a_m PI)))))))a_m = fabs(a);
b_m = fabs(b);
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a_m, double b_m, double angle_m) {
double tmp;
if (a_m <= 8.5e-16) {
tmp = 0.011111111111111112 * (angle_m * ((b_m - a_m) * (b_m * ((double) M_PI))));
} else {
tmp = 0.011111111111111112 * (angle_m * ((b_m - a_m) * (a_m * ((double) M_PI))));
}
return angle_s * tmp;
}
a_m = Math.abs(a);
b_m = Math.abs(b);
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a_m, double b_m, double angle_m) {
double tmp;
if (a_m <= 8.5e-16) {
tmp = 0.011111111111111112 * (angle_m * ((b_m - a_m) * (b_m * Math.PI)));
} else {
tmp = 0.011111111111111112 * (angle_m * ((b_m - a_m) * (a_m * Math.PI)));
}
return angle_s * tmp;
}
a_m = math.fabs(a) b_m = math.fabs(b) angle\_m = math.fabs(angle) angle\_s = math.copysign(1.0, angle) def code(angle_s, a_m, b_m, angle_m): tmp = 0 if a_m <= 8.5e-16: tmp = 0.011111111111111112 * (angle_m * ((b_m - a_m) * (b_m * math.pi))) else: tmp = 0.011111111111111112 * (angle_m * ((b_m - a_m) * (a_m * math.pi))) return angle_s * tmp
a_m = abs(a) b_m = abs(b) angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a_m, b_m, angle_m) tmp = 0.0 if (a_m <= 8.5e-16) tmp = Float64(0.011111111111111112 * Float64(angle_m * Float64(Float64(b_m - a_m) * Float64(b_m * pi)))); else tmp = Float64(0.011111111111111112 * Float64(angle_m * Float64(Float64(b_m - a_m) * Float64(a_m * pi)))); end return Float64(angle_s * tmp) end
a_m = abs(a); b_m = abs(b); angle\_m = abs(angle); angle\_s = sign(angle) * abs(1.0); function tmp_2 = code(angle_s, a_m, b_m, angle_m) tmp = 0.0; if (a_m <= 8.5e-16) tmp = 0.011111111111111112 * (angle_m * ((b_m - a_m) * (b_m * pi))); else tmp = 0.011111111111111112 * (angle_m * ((b_m - a_m) * (a_m * pi))); end tmp_2 = angle_s * tmp; end
a_m = N[Abs[a], $MachinePrecision]
b_m = N[Abs[b], $MachinePrecision]
angle\_m = N[Abs[angle], $MachinePrecision]
angle\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a$95$m_, b$95$m_, angle$95$m_] := N[(angle$95$s * If[LessEqual[a$95$m, 8.5e-16], N[(0.011111111111111112 * N[(angle$95$m * N[(N[(b$95$m - a$95$m), $MachinePrecision] * N[(b$95$m * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.011111111111111112 * N[(angle$95$m * N[(N[(b$95$m - a$95$m), $MachinePrecision] * N[(a$95$m * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
a_m = \left|a\right|
\\
b_m = \left|b\right|
\\
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;a\_m \leq 8.5 \cdot 10^{-16}:\\
\;\;\;\;0.011111111111111112 \cdot \left(angle\_m \cdot \left(\left(b\_m - a\_m\right) \cdot \left(b\_m \cdot \pi\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;0.011111111111111112 \cdot \left(angle\_m \cdot \left(\left(b\_m - a\_m\right) \cdot \left(a\_m \cdot \pi\right)\right)\right)\\
\end{array}
\end{array}
if a < 8.5000000000000001e-16Initial program 61.7%
associate-*l*61.7%
*-commutative61.7%
associate-*l*62.2%
Simplified62.2%
Taylor expanded in angle around 0 58.5%
unpow258.5%
unpow258.5%
difference-of-squares60.7%
Applied egg-rr60.7%
Taylor expanded in angle around 0 60.7%
associate-*r*60.7%
Simplified60.7%
Taylor expanded in a around 0 46.1%
*-commutative46.1%
Simplified46.1%
if 8.5000000000000001e-16 < a Initial program 48.9%
associate-*l*48.9%
*-commutative48.9%
associate-*l*48.9%
Simplified48.9%
Taylor expanded in angle around 0 44.8%
unpow244.8%
unpow244.8%
difference-of-squares56.1%
Applied egg-rr56.1%
Taylor expanded in angle around 0 56.1%
associate-*r*56.1%
Simplified56.1%
Taylor expanded in a around inf 44.7%
*-commutative44.7%
Simplified44.7%
Final simplification45.8%
a_m = (fabs.f64 a) b_m = (fabs.f64 b) angle\_m = (fabs.f64 angle) angle\_s = (copysign.f64 #s(literal 1 binary64) angle) (FPCore (angle_s a_m b_m angle_m) :precision binary64 (* angle_s (* 0.011111111111111112 (* angle_m (* PI (* (+ b_m a_m) (- b_m a_m)))))))
a_m = fabs(a);
b_m = fabs(b);
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a_m, double b_m, double angle_m) {
return angle_s * (0.011111111111111112 * (angle_m * (((double) M_PI) * ((b_m + a_m) * (b_m - a_m)))));
}
a_m = Math.abs(a);
b_m = Math.abs(b);
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a_m, double b_m, double angle_m) {
return angle_s * (0.011111111111111112 * (angle_m * (Math.PI * ((b_m + a_m) * (b_m - a_m)))));
}
a_m = math.fabs(a) b_m = math.fabs(b) angle\_m = math.fabs(angle) angle\_s = math.copysign(1.0, angle) def code(angle_s, a_m, b_m, angle_m): return angle_s * (0.011111111111111112 * (angle_m * (math.pi * ((b_m + a_m) * (b_m - a_m)))))
a_m = abs(a) b_m = abs(b) angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a_m, b_m, angle_m) return Float64(angle_s * Float64(0.011111111111111112 * Float64(angle_m * Float64(pi * Float64(Float64(b_m + a_m) * Float64(b_m - a_m)))))) end
a_m = abs(a); b_m = abs(b); angle\_m = abs(angle); angle\_s = sign(angle) * abs(1.0); function tmp = code(angle_s, a_m, b_m, angle_m) tmp = angle_s * (0.011111111111111112 * (angle_m * (pi * ((b_m + a_m) * (b_m - a_m))))); end
a_m = N[Abs[a], $MachinePrecision]
b_m = N[Abs[b], $MachinePrecision]
angle\_m = N[Abs[angle], $MachinePrecision]
angle\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a$95$m_, b$95$m_, angle$95$m_] := N[(angle$95$s * N[(0.011111111111111112 * N[(angle$95$m * N[(Pi * N[(N[(b$95$m + a$95$m), $MachinePrecision] * N[(b$95$m - a$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
a_m = \left|a\right|
\\
b_m = \left|b\right|
\\
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
angle\_s \cdot \left(0.011111111111111112 \cdot \left(angle\_m \cdot \left(\pi \cdot \left(\left(b\_m + a\_m\right) \cdot \left(b\_m - a\_m\right)\right)\right)\right)\right)
\end{array}
Initial program 58.6%
associate-*l*58.6%
*-commutative58.6%
associate-*l*58.9%
Simplified58.9%
Taylor expanded in angle around 0 55.2%
unpow255.2%
unpow255.2%
difference-of-squares59.6%
Applied egg-rr59.6%
a_m = (fabs.f64 a) b_m = (fabs.f64 b) angle\_m = (fabs.f64 angle) angle\_s = (copysign.f64 #s(literal 1 binary64) angle) (FPCore (angle_s a_m b_m angle_m) :precision binary64 (* angle_s (* 0.011111111111111112 (* angle_m (* (- b_m a_m) (* a_m PI))))))
a_m = fabs(a);
b_m = fabs(b);
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a_m, double b_m, double angle_m) {
return angle_s * (0.011111111111111112 * (angle_m * ((b_m - a_m) * (a_m * ((double) M_PI)))));
}
a_m = Math.abs(a);
b_m = Math.abs(b);
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a_m, double b_m, double angle_m) {
return angle_s * (0.011111111111111112 * (angle_m * ((b_m - a_m) * (a_m * Math.PI))));
}
a_m = math.fabs(a) b_m = math.fabs(b) angle\_m = math.fabs(angle) angle\_s = math.copysign(1.0, angle) def code(angle_s, a_m, b_m, angle_m): return angle_s * (0.011111111111111112 * (angle_m * ((b_m - a_m) * (a_m * math.pi))))
a_m = abs(a) b_m = abs(b) angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a_m, b_m, angle_m) return Float64(angle_s * Float64(0.011111111111111112 * Float64(angle_m * Float64(Float64(b_m - a_m) * Float64(a_m * pi))))) end
a_m = abs(a); b_m = abs(b); angle\_m = abs(angle); angle\_s = sign(angle) * abs(1.0); function tmp = code(angle_s, a_m, b_m, angle_m) tmp = angle_s * (0.011111111111111112 * (angle_m * ((b_m - a_m) * (a_m * pi)))); end
a_m = N[Abs[a], $MachinePrecision]
b_m = N[Abs[b], $MachinePrecision]
angle\_m = N[Abs[angle], $MachinePrecision]
angle\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a$95$m_, b$95$m_, angle$95$m_] := N[(angle$95$s * N[(0.011111111111111112 * N[(angle$95$m * N[(N[(b$95$m - a$95$m), $MachinePrecision] * N[(a$95$m * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
a_m = \left|a\right|
\\
b_m = \left|b\right|
\\
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
angle\_s \cdot \left(0.011111111111111112 \cdot \left(angle\_m \cdot \left(\left(b\_m - a\_m\right) \cdot \left(a\_m \cdot \pi\right)\right)\right)\right)
\end{array}
Initial program 58.6%
associate-*l*58.6%
*-commutative58.6%
associate-*l*58.9%
Simplified58.9%
Taylor expanded in angle around 0 55.2%
unpow255.2%
unpow255.2%
difference-of-squares59.6%
Applied egg-rr59.6%
Taylor expanded in angle around 0 59.6%
associate-*r*59.6%
Simplified59.6%
Taylor expanded in a around inf 41.3%
*-commutative41.3%
Simplified41.3%
Final simplification41.3%
herbie shell --seed 2024101
(FPCore (a b angle)
:name "ab-angle->ABCF B"
:precision binary64
(* (* (* 2.0 (- (pow b 2.0) (pow a 2.0))) (sin (* PI (/ angle 180.0)))) (cos (* PI (/ angle 180.0)))))