
(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 14 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}
b_m = (fabs.f64 b)
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a b_m angle_m)
:precision binary64
(let* ((t_0 (* PI (/ angle_m 180.0)))
(t_1 (cos t_0))
(t_2 (* PI (* angle_m 0.005555555555555556)))
(t_3 (cos t_2))
(t_4 (sin t_2))
(t_5 (sqrt (pow (* (- (pow b_m 2.0) (pow a 2.0)) t_4) 2.0)))
(t_6 (* 0.005555555555555556 (* PI angle_m))))
(*
angle_s
(if (<= (/ angle_m 180.0) 1e+49)
(* 2.0 (* t_1 (* (- b_m a) (* t_4 (+ b_m a)))))
(if (<= (/ angle_m 180.0) 5e+157)
(* 2.0 (* t_5 (cos t_6)))
(if (<= (/ angle_m 180.0) 4e+262)
(fma
a
(fma (* a -2.0) (* t_3 t_6) 0.0)
(*
2.0
(*
(pow b_m 2.0)
(*
t_3
(sin
(* (* angle_m 0.005555555555555556) (cbrt (pow PI 3.0))))))))
(if (<= (/ angle_m 180.0) 2e+276)
(*
(* (- b_m a) (+ b_m a))
(*
2.0
(* (sin t_0) (cos (* (/ angle_m 180.0) (pow (sqrt PI) 2.0))))))
(* 2.0 (* t_1 t_5)))))))))b_m = fabs(b);
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a, double b_m, double angle_m) {
double t_0 = ((double) M_PI) * (angle_m / 180.0);
double t_1 = cos(t_0);
double t_2 = ((double) M_PI) * (angle_m * 0.005555555555555556);
double t_3 = cos(t_2);
double t_4 = sin(t_2);
double t_5 = sqrt(pow(((pow(b_m, 2.0) - pow(a, 2.0)) * t_4), 2.0));
double t_6 = 0.005555555555555556 * (((double) M_PI) * angle_m);
double tmp;
if ((angle_m / 180.0) <= 1e+49) {
tmp = 2.0 * (t_1 * ((b_m - a) * (t_4 * (b_m + a))));
} else if ((angle_m / 180.0) <= 5e+157) {
tmp = 2.0 * (t_5 * cos(t_6));
} else if ((angle_m / 180.0) <= 4e+262) {
tmp = fma(a, fma((a * -2.0), (t_3 * t_6), 0.0), (2.0 * (pow(b_m, 2.0) * (t_3 * sin(((angle_m * 0.005555555555555556) * cbrt(pow(((double) M_PI), 3.0))))))));
} else if ((angle_m / 180.0) <= 2e+276) {
tmp = ((b_m - a) * (b_m + a)) * (2.0 * (sin(t_0) * cos(((angle_m / 180.0) * pow(sqrt(((double) M_PI)), 2.0)))));
} else {
tmp = 2.0 * (t_1 * t_5);
}
return angle_s * tmp;
}
b_m = abs(b) angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a, b_m, angle_m) t_0 = Float64(pi * Float64(angle_m / 180.0)) t_1 = cos(t_0) t_2 = Float64(pi * Float64(angle_m * 0.005555555555555556)) t_3 = cos(t_2) t_4 = sin(t_2) t_5 = sqrt((Float64(Float64((b_m ^ 2.0) - (a ^ 2.0)) * t_4) ^ 2.0)) t_6 = Float64(0.005555555555555556 * Float64(pi * angle_m)) tmp = 0.0 if (Float64(angle_m / 180.0) <= 1e+49) tmp = Float64(2.0 * Float64(t_1 * Float64(Float64(b_m - a) * Float64(t_4 * Float64(b_m + a))))); elseif (Float64(angle_m / 180.0) <= 5e+157) tmp = Float64(2.0 * Float64(t_5 * cos(t_6))); elseif (Float64(angle_m / 180.0) <= 4e+262) tmp = fma(a, fma(Float64(a * -2.0), Float64(t_3 * t_6), 0.0), Float64(2.0 * Float64((b_m ^ 2.0) * Float64(t_3 * sin(Float64(Float64(angle_m * 0.005555555555555556) * cbrt((pi ^ 3.0)))))))); elseif (Float64(angle_m / 180.0) <= 2e+276) tmp = Float64(Float64(Float64(b_m - a) * Float64(b_m + a)) * Float64(2.0 * Float64(sin(t_0) * cos(Float64(Float64(angle_m / 180.0) * (sqrt(pi) ^ 2.0)))))); else tmp = Float64(2.0 * Float64(t_1 * t_5)); end return Float64(angle_s * tmp) end
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_, b$95$m_, angle$95$m_] := Block[{t$95$0 = N[(Pi * N[(angle$95$m / 180.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Cos[t$95$0], $MachinePrecision]}, Block[{t$95$2 = N[(Pi * N[(angle$95$m * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[Cos[t$95$2], $MachinePrecision]}, Block[{t$95$4 = N[Sin[t$95$2], $MachinePrecision]}, Block[{t$95$5 = N[Sqrt[N[Power[N[(N[(N[Power[b$95$m, 2.0], $MachinePrecision] - N[Power[a, 2.0], $MachinePrecision]), $MachinePrecision] * t$95$4), $MachinePrecision], 2.0], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$6 = N[(0.005555555555555556 * N[(Pi * angle$95$m), $MachinePrecision]), $MachinePrecision]}, N[(angle$95$s * If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 1e+49], N[(2.0 * N[(t$95$1 * N[(N[(b$95$m - a), $MachinePrecision] * N[(t$95$4 * N[(b$95$m + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 5e+157], N[(2.0 * N[(t$95$5 * N[Cos[t$95$6], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 4e+262], N[(a * N[(N[(a * -2.0), $MachinePrecision] * N[(t$95$3 * t$95$6), $MachinePrecision] + 0.0), $MachinePrecision] + N[(2.0 * N[(N[Power[b$95$m, 2.0], $MachinePrecision] * N[(t$95$3 * N[Sin[N[(N[(angle$95$m * 0.005555555555555556), $MachinePrecision] * N[Power[N[Power[Pi, 3.0], $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 2e+276], N[(N[(N[(b$95$m - a), $MachinePrecision] * N[(b$95$m + a), $MachinePrecision]), $MachinePrecision] * N[(2.0 * N[(N[Sin[t$95$0], $MachinePrecision] * N[Cos[N[(N[(angle$95$m / 180.0), $MachinePrecision] * N[Power[N[Sqrt[Pi], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(t$95$1 * t$95$5), $MachinePrecision]), $MachinePrecision]]]]]), $MachinePrecision]]]]]]]]
\begin{array}{l}
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 \frac{angle\_m}{180}\\
t_1 := \cos t\_0\\
t_2 := \pi \cdot \left(angle\_m \cdot 0.005555555555555556\right)\\
t_3 := \cos t\_2\\
t_4 := \sin t\_2\\
t_5 := \sqrt{{\left(\left({b\_m}^{2} - {a}^{2}\right) \cdot t\_4\right)}^{2}}\\
t_6 := 0.005555555555555556 \cdot \left(\pi \cdot angle\_m\right)\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;\frac{angle\_m}{180} \leq 10^{+49}:\\
\;\;\;\;2 \cdot \left(t\_1 \cdot \left(\left(b\_m - a\right) \cdot \left(t\_4 \cdot \left(b\_m + a\right)\right)\right)\right)\\
\mathbf{elif}\;\frac{angle\_m}{180} \leq 5 \cdot 10^{+157}:\\
\;\;\;\;2 \cdot \left(t\_5 \cdot \cos t\_6\right)\\
\mathbf{elif}\;\frac{angle\_m}{180} \leq 4 \cdot 10^{+262}:\\
\;\;\;\;\mathsf{fma}\left(a, \mathsf{fma}\left(a \cdot -2, t\_3 \cdot t\_6, 0\right), 2 \cdot \left({b\_m}^{2} \cdot \left(t\_3 \cdot \sin \left(\left(angle\_m \cdot 0.005555555555555556\right) \cdot \sqrt[3]{{\pi}^{3}}\right)\right)\right)\right)\\
\mathbf{elif}\;\frac{angle\_m}{180} \leq 2 \cdot 10^{+276}:\\
\;\;\;\;\left(\left(b\_m - a\right) \cdot \left(b\_m + a\right)\right) \cdot \left(2 \cdot \left(\sin t\_0 \cdot \cos \left(\frac{angle\_m}{180} \cdot {\left(\sqrt{\pi}\right)}^{2}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(t\_1 \cdot t\_5\right)\\
\end{array}
\end{array}
\end{array}
if (/.f64 angle #s(literal 180 binary64)) < 9.99999999999999946e48Initial program 58.7%
associate-*l*59.1%
associate-*l*59.1%
Simplified59.1%
add-sqr-sqrt33.1%
sqrt-unprod36.2%
pow236.2%
*-commutative36.2%
div-inv36.2%
metadata-eval36.2%
Applied egg-rr36.2%
unpow236.2%
unpow236.2%
difference-of-squares37.3%
Applied egg-rr37.3%
sqrt-pow162.8%
metadata-eval62.8%
pow162.8%
*-commutative62.8%
*-commutative62.8%
associate-*l*74.6%
associate-*r*72.7%
*-commutative72.7%
*-commutative72.7%
associate-*r*74.6%
*-commutative74.6%
Applied egg-rr74.6%
if 9.99999999999999946e48 < (/.f64 angle #s(literal 180 binary64)) < 4.99999999999999976e157Initial program 32.6%
associate-*l*32.6%
associate-*l*32.6%
Simplified32.6%
add-sqr-sqrt18.2%
sqrt-unprod35.2%
pow235.2%
*-commutative35.2%
div-inv35.2%
metadata-eval35.2%
Applied egg-rr35.2%
Taylor expanded in angle around inf 40.3%
if 4.99999999999999976e157 < (/.f64 angle #s(literal 180 binary64)) < 4.0000000000000001e262Initial program 16.8%
associate-*l*16.8%
*-commutative16.8%
associate-*l*16.8%
Simplified16.8%
unpow216.2%
unpow216.2%
difference-of-squares16.2%
Applied egg-rr16.8%
Taylor expanded in a around 0 17.6%
+-commutative17.6%
fma-define17.6%
Simplified23.9%
add-cbrt-cube24.1%
pow324.1%
Applied egg-rr24.1%
Taylor expanded in angle around 0 40.6%
if 4.0000000000000001e262 < (/.f64 angle #s(literal 180 binary64)) < 2.0000000000000001e276Initial program 24.4%
associate-*l*24.4%
*-commutative24.4%
associate-*l*24.4%
Simplified24.4%
unpow219.0%
unpow219.0%
difference-of-squares35.7%
Applied egg-rr24.4%
add-sqr-sqrt39.4%
pow239.4%
Applied egg-rr39.4%
if 2.0000000000000001e276 < (/.f64 angle #s(literal 180 binary64)) Initial program 19.0%
associate-*l*19.0%
associate-*l*19.0%
Simplified19.0%
add-sqr-sqrt17.6%
sqrt-unprod50.3%
pow250.3%
*-commutative50.3%
div-inv50.3%
metadata-eval50.3%
Applied egg-rr50.3%
Final simplification66.7%
b_m = (fabs.f64 b)
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a b_m angle_m)
:precision binary64
(let* ((t_0 (* PI (* angle_m 0.005555555555555556)))
(t_1 (* PI (/ angle_m 180.0)))
(t_2 (cos t_1))
(t_3 (sin t_0)))
(*
angle_s
(if (<= (* (* (* 2.0 (- (pow b_m 2.0) (pow a 2.0))) (sin t_1)) t_2) 1e+107)
(fma
a
(fma (* a -2.0) (* (cos t_0) t_3) 0.0)
(*
2.0
(*
(pow b_m 2.0)
(*
(cos (* (* angle_m 0.005555555555555556) (pow (sqrt PI) 2.0)))
(sin (* (* angle_m 0.005555555555555556) (cbrt (pow PI 3.0))))))))
(* 2.0 (* t_2 (* (hypot b_m a) (* t_3 (hypot b_m a)))))))))b_m = fabs(b);
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a, double b_m, double angle_m) {
double t_0 = ((double) M_PI) * (angle_m * 0.005555555555555556);
double t_1 = ((double) M_PI) * (angle_m / 180.0);
double t_2 = cos(t_1);
double t_3 = sin(t_0);
double tmp;
if ((((2.0 * (pow(b_m, 2.0) - pow(a, 2.0))) * sin(t_1)) * t_2) <= 1e+107) {
tmp = fma(a, fma((a * -2.0), (cos(t_0) * t_3), 0.0), (2.0 * (pow(b_m, 2.0) * (cos(((angle_m * 0.005555555555555556) * pow(sqrt(((double) M_PI)), 2.0))) * sin(((angle_m * 0.005555555555555556) * cbrt(pow(((double) M_PI), 3.0))))))));
} else {
tmp = 2.0 * (t_2 * (hypot(b_m, a) * (t_3 * hypot(b_m, a))));
}
return angle_s * tmp;
}
b_m = abs(b) angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a, b_m, angle_m) t_0 = Float64(pi * Float64(angle_m * 0.005555555555555556)) t_1 = Float64(pi * Float64(angle_m / 180.0)) t_2 = cos(t_1) t_3 = sin(t_0) tmp = 0.0 if (Float64(Float64(Float64(2.0 * Float64((b_m ^ 2.0) - (a ^ 2.0))) * sin(t_1)) * t_2) <= 1e+107) tmp = fma(a, fma(Float64(a * -2.0), Float64(cos(t_0) * t_3), 0.0), Float64(2.0 * Float64((b_m ^ 2.0) * Float64(cos(Float64(Float64(angle_m * 0.005555555555555556) * (sqrt(pi) ^ 2.0))) * sin(Float64(Float64(angle_m * 0.005555555555555556) * cbrt((pi ^ 3.0)))))))); else tmp = Float64(2.0 * Float64(t_2 * Float64(hypot(b_m, a) * Float64(t_3 * hypot(b_m, a))))); end return Float64(angle_s * tmp) end
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_, 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[(Pi * N[(angle$95$m / 180.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Cos[t$95$1], $MachinePrecision]}, Block[{t$95$3 = N[Sin[t$95$0], $MachinePrecision]}, N[(angle$95$s * If[LessEqual[N[(N[(N[(2.0 * N[(N[Power[b$95$m, 2.0], $MachinePrecision] - N[Power[a, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sin[t$95$1], $MachinePrecision]), $MachinePrecision] * t$95$2), $MachinePrecision], 1e+107], N[(a * N[(N[(a * -2.0), $MachinePrecision] * N[(N[Cos[t$95$0], $MachinePrecision] * t$95$3), $MachinePrecision] + 0.0), $MachinePrecision] + N[(2.0 * N[(N[Power[b$95$m, 2.0], $MachinePrecision] * N[(N[Cos[N[(N[(angle$95$m * 0.005555555555555556), $MachinePrecision] * N[Power[N[Sqrt[Pi], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sin[N[(N[(angle$95$m * 0.005555555555555556), $MachinePrecision] * N[Power[N[Power[Pi, 3.0], $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(t$95$2 * N[(N[Sqrt[b$95$m ^ 2 + a ^ 2], $MachinePrecision] * N[(t$95$3 * N[Sqrt[b$95$m ^ 2 + a ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]]]]]
\begin{array}{l}
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 := \pi \cdot \frac{angle\_m}{180}\\
t_2 := \cos t\_1\\
t_3 := \sin t\_0\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;\left(\left(2 \cdot \left({b\_m}^{2} - {a}^{2}\right)\right) \cdot \sin t\_1\right) \cdot t\_2 \leq 10^{+107}:\\
\;\;\;\;\mathsf{fma}\left(a, \mathsf{fma}\left(a \cdot -2, \cos t\_0 \cdot t\_3, 0\right), 2 \cdot \left({b\_m}^{2} \cdot \left(\cos \left(\left(angle\_m \cdot 0.005555555555555556\right) \cdot {\left(\sqrt{\pi}\right)}^{2}\right) \cdot \sin \left(\left(angle\_m \cdot 0.005555555555555556\right) \cdot \sqrt[3]{{\pi}^{3}}\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(t\_2 \cdot \left(\mathsf{hypot}\left(b\_m, a\right) \cdot \left(t\_3 \cdot \mathsf{hypot}\left(b\_m, a\right)\right)\right)\right)\\
\end{array}
\end{array}
\end{array}
if (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64)))) (sin.f64 (*.f64 (PI.f64) (/.f64 angle #s(literal 180 binary64))))) (cos.f64 (*.f64 (PI.f64) (/.f64 angle #s(literal 180 binary64))))) < 9.9999999999999997e106Initial program 55.0%
associate-*l*55.0%
*-commutative55.0%
associate-*l*55.0%
Simplified55.0%
unpow232.5%
unpow232.5%
difference-of-squares32.5%
Applied egg-rr55.0%
Taylor expanded in a around 0 60.2%
+-commutative60.2%
fma-define60.2%
Simplified59.4%
add-cbrt-cube59.2%
pow359.2%
Applied egg-rr59.2%
add-sqr-sqrt57.2%
pow257.2%
Applied egg-rr59.5%
if 9.9999999999999997e106 < (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64)))) (sin.f64 (*.f64 (PI.f64) (/.f64 angle #s(literal 180 binary64))))) (cos.f64 (*.f64 (PI.f64) (/.f64 angle #s(literal 180 binary64))))) Initial program 40.4%
associate-*l*41.6%
associate-*l*41.6%
Simplified41.6%
add-sqr-sqrt29.5%
sqrt-unprod38.6%
pow238.6%
*-commutative38.6%
div-inv38.5%
metadata-eval38.5%
Applied egg-rr38.5%
sqrt-pow144.6%
metadata-eval44.6%
pow144.6%
add-sqr-sqrt27.2%
associate-*r*27.2%
Applied egg-rr47.2%
Final simplification55.8%
b_m = (fabs.f64 b)
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a b_m angle_m)
:precision binary64
(let* ((t_0 (* PI (/ angle_m 180.0)))
(t_1 (- (pow b_m 2.0) (pow a 2.0)))
(t_2 (sin (* PI (* angle_m 0.005555555555555556))))
(t_3 (sqrt (pow (* t_1 t_2) 2.0)))
(t_4 (cos t_0)))
(*
angle_s
(if (<= (/ angle_m 180.0) 1e+49)
(* 2.0 (* t_4 (* (- b_m a) (* t_2 (+ b_m a)))))
(if (<= (/ angle_m 180.0) 1e+160)
(* 2.0 (* t_3 (cos (* 0.005555555555555556 (* PI angle_m)))))
(if (<= (/ angle_m 180.0) 2e+253)
(* (sqrt (pow t_1 2.0)) (* 2.0 (* (sin t_0) t_4)))
(if (<= (/ angle_m 180.0) 1e+281)
(*
(* (- b_m a) (+ b_m a))
(*
2.0
(*
(log1p (expm1 t_2))
(cos (* (/ angle_m 180.0) (cbrt (pow PI 3.0)))))))
(* 2.0 (* t_4 t_3)))))))))b_m = fabs(b);
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a, double b_m, double angle_m) {
double t_0 = ((double) M_PI) * (angle_m / 180.0);
double t_1 = pow(b_m, 2.0) - pow(a, 2.0);
double t_2 = sin((((double) M_PI) * (angle_m * 0.005555555555555556)));
double t_3 = sqrt(pow((t_1 * t_2), 2.0));
double t_4 = cos(t_0);
double tmp;
if ((angle_m / 180.0) <= 1e+49) {
tmp = 2.0 * (t_4 * ((b_m - a) * (t_2 * (b_m + a))));
} else if ((angle_m / 180.0) <= 1e+160) {
tmp = 2.0 * (t_3 * cos((0.005555555555555556 * (((double) M_PI) * angle_m))));
} else if ((angle_m / 180.0) <= 2e+253) {
tmp = sqrt(pow(t_1, 2.0)) * (2.0 * (sin(t_0) * t_4));
} else if ((angle_m / 180.0) <= 1e+281) {
tmp = ((b_m - a) * (b_m + a)) * (2.0 * (log1p(expm1(t_2)) * cos(((angle_m / 180.0) * cbrt(pow(((double) M_PI), 3.0))))));
} else {
tmp = 2.0 * (t_4 * t_3);
}
return angle_s * tmp;
}
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, double b_m, double angle_m) {
double t_0 = Math.PI * (angle_m / 180.0);
double t_1 = Math.pow(b_m, 2.0) - Math.pow(a, 2.0);
double t_2 = Math.sin((Math.PI * (angle_m * 0.005555555555555556)));
double t_3 = Math.sqrt(Math.pow((t_1 * t_2), 2.0));
double t_4 = Math.cos(t_0);
double tmp;
if ((angle_m / 180.0) <= 1e+49) {
tmp = 2.0 * (t_4 * ((b_m - a) * (t_2 * (b_m + a))));
} else if ((angle_m / 180.0) <= 1e+160) {
tmp = 2.0 * (t_3 * Math.cos((0.005555555555555556 * (Math.PI * angle_m))));
} else if ((angle_m / 180.0) <= 2e+253) {
tmp = Math.sqrt(Math.pow(t_1, 2.0)) * (2.0 * (Math.sin(t_0) * t_4));
} else if ((angle_m / 180.0) <= 1e+281) {
tmp = ((b_m - a) * (b_m + a)) * (2.0 * (Math.log1p(Math.expm1(t_2)) * Math.cos(((angle_m / 180.0) * Math.cbrt(Math.pow(Math.PI, 3.0))))));
} else {
tmp = 2.0 * (t_4 * t_3);
}
return angle_s * tmp;
}
b_m = abs(b) angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a, b_m, angle_m) t_0 = Float64(pi * Float64(angle_m / 180.0)) t_1 = Float64((b_m ^ 2.0) - (a ^ 2.0)) t_2 = sin(Float64(pi * Float64(angle_m * 0.005555555555555556))) t_3 = sqrt((Float64(t_1 * t_2) ^ 2.0)) t_4 = cos(t_0) tmp = 0.0 if (Float64(angle_m / 180.0) <= 1e+49) tmp = Float64(2.0 * Float64(t_4 * Float64(Float64(b_m - a) * Float64(t_2 * Float64(b_m + a))))); elseif (Float64(angle_m / 180.0) <= 1e+160) tmp = Float64(2.0 * Float64(t_3 * cos(Float64(0.005555555555555556 * Float64(pi * angle_m))))); elseif (Float64(angle_m / 180.0) <= 2e+253) tmp = Float64(sqrt((t_1 ^ 2.0)) * Float64(2.0 * Float64(sin(t_0) * t_4))); elseif (Float64(angle_m / 180.0) <= 1e+281) tmp = Float64(Float64(Float64(b_m - a) * Float64(b_m + a)) * Float64(2.0 * Float64(log1p(expm1(t_2)) * cos(Float64(Float64(angle_m / 180.0) * cbrt((pi ^ 3.0))))))); else tmp = Float64(2.0 * Float64(t_4 * t_3)); end return Float64(angle_s * tmp) end
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_, b$95$m_, angle$95$m_] := Block[{t$95$0 = N[(Pi * N[(angle$95$m / 180.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[Power[b$95$m, 2.0], $MachinePrecision] - N[Power[a, 2.0], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Sin[N[(Pi * N[(angle$95$m * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[Sqrt[N[Power[N[(t$95$1 * t$95$2), $MachinePrecision], 2.0], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$4 = N[Cos[t$95$0], $MachinePrecision]}, N[(angle$95$s * If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 1e+49], N[(2.0 * N[(t$95$4 * N[(N[(b$95$m - a), $MachinePrecision] * N[(t$95$2 * N[(b$95$m + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 1e+160], N[(2.0 * N[(t$95$3 * N[Cos[N[(0.005555555555555556 * N[(Pi * angle$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 2e+253], N[(N[Sqrt[N[Power[t$95$1, 2.0], $MachinePrecision]], $MachinePrecision] * N[(2.0 * N[(N[Sin[t$95$0], $MachinePrecision] * t$95$4), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 1e+281], N[(N[(N[(b$95$m - a), $MachinePrecision] * N[(b$95$m + a), $MachinePrecision]), $MachinePrecision] * N[(2.0 * N[(N[Log[1 + N[(Exp[t$95$2] - 1), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(N[(angle$95$m / 180.0), $MachinePrecision] * N[Power[N[Power[Pi, 3.0], $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(t$95$4 * t$95$3), $MachinePrecision]), $MachinePrecision]]]]]), $MachinePrecision]]]]]]
\begin{array}{l}
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 \frac{angle\_m}{180}\\
t_1 := {b\_m}^{2} - {a}^{2}\\
t_2 := \sin \left(\pi \cdot \left(angle\_m \cdot 0.005555555555555556\right)\right)\\
t_3 := \sqrt{{\left(t\_1 \cdot t\_2\right)}^{2}}\\
t_4 := \cos t\_0\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;\frac{angle\_m}{180} \leq 10^{+49}:\\
\;\;\;\;2 \cdot \left(t\_4 \cdot \left(\left(b\_m - a\right) \cdot \left(t\_2 \cdot \left(b\_m + a\right)\right)\right)\right)\\
\mathbf{elif}\;\frac{angle\_m}{180} \leq 10^{+160}:\\
\;\;\;\;2 \cdot \left(t\_3 \cdot \cos \left(0.005555555555555556 \cdot \left(\pi \cdot angle\_m\right)\right)\right)\\
\mathbf{elif}\;\frac{angle\_m}{180} \leq 2 \cdot 10^{+253}:\\
\;\;\;\;\sqrt{{t\_1}^{2}} \cdot \left(2 \cdot \left(\sin t\_0 \cdot t\_4\right)\right)\\
\mathbf{elif}\;\frac{angle\_m}{180} \leq 10^{+281}:\\
\;\;\;\;\left(\left(b\_m - a\right) \cdot \left(b\_m + a\right)\right) \cdot \left(2 \cdot \left(\mathsf{log1p}\left(\mathsf{expm1}\left(t\_2\right)\right) \cdot \cos \left(\frac{angle\_m}{180} \cdot \sqrt[3]{{\pi}^{3}}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(t\_4 \cdot t\_3\right)\\
\end{array}
\end{array}
\end{array}
if (/.f64 angle #s(literal 180 binary64)) < 9.99999999999999946e48Initial program 58.7%
associate-*l*59.1%
associate-*l*59.1%
Simplified59.1%
add-sqr-sqrt33.1%
sqrt-unprod36.2%
pow236.2%
*-commutative36.2%
div-inv36.2%
metadata-eval36.2%
Applied egg-rr36.2%
unpow236.2%
unpow236.2%
difference-of-squares37.3%
Applied egg-rr37.3%
sqrt-pow162.8%
metadata-eval62.8%
pow162.8%
*-commutative62.8%
*-commutative62.8%
associate-*l*74.6%
associate-*r*72.7%
*-commutative72.7%
*-commutative72.7%
associate-*r*74.6%
*-commutative74.6%
Applied egg-rr74.6%
if 9.99999999999999946e48 < (/.f64 angle #s(literal 180 binary64)) < 1.00000000000000001e160Initial program 31.4%
associate-*l*31.4%
associate-*l*31.4%
Simplified31.4%
add-sqr-sqrt17.6%
sqrt-unprod34.0%
pow234.0%
*-commutative34.0%
div-inv34.0%
metadata-eval34.0%
Applied egg-rr34.0%
Taylor expanded in angle around inf 39.4%
if 1.00000000000000001e160 < (/.f64 angle #s(literal 180 binary64)) < 1.9999999999999999e253Initial program 14.1%
associate-*l*14.1%
*-commutative14.1%
associate-*l*14.1%
Simplified14.1%
add-sqr-sqrt13.0%
sqrt-unprod46.1%
pow246.1%
Applied egg-rr46.1%
if 1.9999999999999999e253 < (/.f64 angle #s(literal 180 binary64)) < 1e281Initial program 30.8%
associate-*l*30.8%
*-commutative30.8%
associate-*l*30.8%
Simplified30.8%
unpow214.3%
unpow214.3%
difference-of-squares26.8%
Applied egg-rr30.8%
log1p-expm1-u30.8%
div-inv30.8%
metadata-eval30.8%
Applied egg-rr30.8%
add-cbrt-cube32.8%
pow332.8%
Applied egg-rr42.6%
if 1e281 < (/.f64 angle #s(literal 180 binary64)) Initial program 19.0%
associate-*l*19.0%
associate-*l*19.0%
Simplified19.0%
add-sqr-sqrt17.6%
sqrt-unprod50.3%
pow250.3%
*-commutative50.3%
div-inv50.3%
metadata-eval50.3%
Applied egg-rr50.3%
Final simplification67.1%
b_m = (fabs.f64 b)
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a b_m angle_m)
:precision binary64
(let* ((t_0 (* PI (/ angle_m 180.0)))
(t_1 (sin t_0))
(t_2 (- (pow b_m 2.0) (pow a 2.0)))
(t_3 (sin (* PI (* angle_m 0.005555555555555556))))
(t_4 (cos t_0)))
(*
angle_s
(if (<= (/ angle_m 180.0) 1e+49)
(* 2.0 (* t_4 (* (- b_m a) (* t_3 (+ b_m a)))))
(if (<= (/ angle_m 180.0) 1e+160)
(*
2.0
(*
(sqrt (pow (* t_2 t_3) 2.0))
(cos (* 0.005555555555555556 (* PI angle_m)))))
(if (<= (/ angle_m 180.0) 4e+253)
(* (sqrt (pow t_2 2.0)) (* 2.0 (* t_1 t_4)))
(*
(* (- b_m a) (+ b_m a))
(*
2.0
(*
t_1
(cos
(*
0.005555555555555556
(* angle_m (cbrt (pow PI 3.0))))))))))))))b_m = fabs(b);
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a, double b_m, double angle_m) {
double t_0 = ((double) M_PI) * (angle_m / 180.0);
double t_1 = sin(t_0);
double t_2 = pow(b_m, 2.0) - pow(a, 2.0);
double t_3 = sin((((double) M_PI) * (angle_m * 0.005555555555555556)));
double t_4 = cos(t_0);
double tmp;
if ((angle_m / 180.0) <= 1e+49) {
tmp = 2.0 * (t_4 * ((b_m - a) * (t_3 * (b_m + a))));
} else if ((angle_m / 180.0) <= 1e+160) {
tmp = 2.0 * (sqrt(pow((t_2 * t_3), 2.0)) * cos((0.005555555555555556 * (((double) M_PI) * angle_m))));
} else if ((angle_m / 180.0) <= 4e+253) {
tmp = sqrt(pow(t_2, 2.0)) * (2.0 * (t_1 * t_4));
} else {
tmp = ((b_m - a) * (b_m + a)) * (2.0 * (t_1 * cos((0.005555555555555556 * (angle_m * cbrt(pow(((double) M_PI), 3.0)))))));
}
return angle_s * tmp;
}
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, double b_m, double angle_m) {
double t_0 = Math.PI * (angle_m / 180.0);
double t_1 = Math.sin(t_0);
double t_2 = Math.pow(b_m, 2.0) - Math.pow(a, 2.0);
double t_3 = Math.sin((Math.PI * (angle_m * 0.005555555555555556)));
double t_4 = Math.cos(t_0);
double tmp;
if ((angle_m / 180.0) <= 1e+49) {
tmp = 2.0 * (t_4 * ((b_m - a) * (t_3 * (b_m + a))));
} else if ((angle_m / 180.0) <= 1e+160) {
tmp = 2.0 * (Math.sqrt(Math.pow((t_2 * t_3), 2.0)) * Math.cos((0.005555555555555556 * (Math.PI * angle_m))));
} else if ((angle_m / 180.0) <= 4e+253) {
tmp = Math.sqrt(Math.pow(t_2, 2.0)) * (2.0 * (t_1 * t_4));
} else {
tmp = ((b_m - a) * (b_m + a)) * (2.0 * (t_1 * Math.cos((0.005555555555555556 * (angle_m * Math.cbrt(Math.pow(Math.PI, 3.0)))))));
}
return angle_s * tmp;
}
b_m = abs(b) angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a, b_m, angle_m) t_0 = Float64(pi * Float64(angle_m / 180.0)) t_1 = sin(t_0) t_2 = Float64((b_m ^ 2.0) - (a ^ 2.0)) t_3 = sin(Float64(pi * Float64(angle_m * 0.005555555555555556))) t_4 = cos(t_0) tmp = 0.0 if (Float64(angle_m / 180.0) <= 1e+49) tmp = Float64(2.0 * Float64(t_4 * Float64(Float64(b_m - a) * Float64(t_3 * Float64(b_m + a))))); elseif (Float64(angle_m / 180.0) <= 1e+160) tmp = Float64(2.0 * Float64(sqrt((Float64(t_2 * t_3) ^ 2.0)) * cos(Float64(0.005555555555555556 * Float64(pi * angle_m))))); elseif (Float64(angle_m / 180.0) <= 4e+253) tmp = Float64(sqrt((t_2 ^ 2.0)) * Float64(2.0 * Float64(t_1 * t_4))); else tmp = Float64(Float64(Float64(b_m - a) * Float64(b_m + a)) * Float64(2.0 * Float64(t_1 * cos(Float64(0.005555555555555556 * Float64(angle_m * cbrt((pi ^ 3.0)))))))); end return Float64(angle_s * tmp) end
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_, b$95$m_, angle$95$m_] := Block[{t$95$0 = N[(Pi * N[(angle$95$m / 180.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Sin[t$95$0], $MachinePrecision]}, Block[{t$95$2 = N[(N[Power[b$95$m, 2.0], $MachinePrecision] - N[Power[a, 2.0], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[Sin[N[(Pi * N[(angle$95$m * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$4 = N[Cos[t$95$0], $MachinePrecision]}, N[(angle$95$s * If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 1e+49], N[(2.0 * N[(t$95$4 * N[(N[(b$95$m - a), $MachinePrecision] * N[(t$95$3 * N[(b$95$m + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 1e+160], N[(2.0 * N[(N[Sqrt[N[Power[N[(t$95$2 * t$95$3), $MachinePrecision], 2.0], $MachinePrecision]], $MachinePrecision] * N[Cos[N[(0.005555555555555556 * N[(Pi * angle$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 4e+253], N[(N[Sqrt[N[Power[t$95$2, 2.0], $MachinePrecision]], $MachinePrecision] * N[(2.0 * N[(t$95$1 * t$95$4), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(b$95$m - a), $MachinePrecision] * N[(b$95$m + a), $MachinePrecision]), $MachinePrecision] * N[(2.0 * N[(t$95$1 * N[Cos[N[(0.005555555555555556 * N[(angle$95$m * N[Power[N[Power[Pi, 3.0], $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]), $MachinePrecision]]]]]]
\begin{array}{l}
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 \frac{angle\_m}{180}\\
t_1 := \sin t\_0\\
t_2 := {b\_m}^{2} - {a}^{2}\\
t_3 := \sin \left(\pi \cdot \left(angle\_m \cdot 0.005555555555555556\right)\right)\\
t_4 := \cos t\_0\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;\frac{angle\_m}{180} \leq 10^{+49}:\\
\;\;\;\;2 \cdot \left(t\_4 \cdot \left(\left(b\_m - a\right) \cdot \left(t\_3 \cdot \left(b\_m + a\right)\right)\right)\right)\\
\mathbf{elif}\;\frac{angle\_m}{180} \leq 10^{+160}:\\
\;\;\;\;2 \cdot \left(\sqrt{{\left(t\_2 \cdot t\_3\right)}^{2}} \cdot \cos \left(0.005555555555555556 \cdot \left(\pi \cdot angle\_m\right)\right)\right)\\
\mathbf{elif}\;\frac{angle\_m}{180} \leq 4 \cdot 10^{+253}:\\
\;\;\;\;\sqrt{{t\_2}^{2}} \cdot \left(2 \cdot \left(t\_1 \cdot t\_4\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(b\_m - a\right) \cdot \left(b\_m + a\right)\right) \cdot \left(2 \cdot \left(t\_1 \cdot \cos \left(0.005555555555555556 \cdot \left(angle\_m \cdot \sqrt[3]{{\pi}^{3}}\right)\right)\right)\right)\\
\end{array}
\end{array}
\end{array}
if (/.f64 angle #s(literal 180 binary64)) < 9.99999999999999946e48Initial program 58.7%
associate-*l*59.1%
associate-*l*59.1%
Simplified59.1%
add-sqr-sqrt33.1%
sqrt-unprod36.2%
pow236.2%
*-commutative36.2%
div-inv36.2%
metadata-eval36.2%
Applied egg-rr36.2%
unpow236.2%
unpow236.2%
difference-of-squares37.3%
Applied egg-rr37.3%
sqrt-pow162.8%
metadata-eval62.8%
pow162.8%
*-commutative62.8%
*-commutative62.8%
associate-*l*74.6%
associate-*r*72.7%
*-commutative72.7%
*-commutative72.7%
associate-*r*74.6%
*-commutative74.6%
Applied egg-rr74.6%
if 9.99999999999999946e48 < (/.f64 angle #s(literal 180 binary64)) < 1.00000000000000001e160Initial program 31.4%
associate-*l*31.4%
associate-*l*31.4%
Simplified31.4%
add-sqr-sqrt17.6%
sqrt-unprod34.0%
pow234.0%
*-commutative34.0%
div-inv34.0%
metadata-eval34.0%
Applied egg-rr34.0%
Taylor expanded in angle around inf 39.4%
if 1.00000000000000001e160 < (/.f64 angle #s(literal 180 binary64)) < 3.9999999999999997e253Initial program 14.1%
associate-*l*14.1%
*-commutative14.1%
associate-*l*14.1%
Simplified14.1%
add-sqr-sqrt13.0%
sqrt-unprod46.1%
pow246.1%
Applied egg-rr46.1%
if 3.9999999999999997e253 < (/.f64 angle #s(literal 180 binary64)) Initial program 25.3%
associate-*l*25.3%
*-commutative25.3%
associate-*l*25.3%
Simplified25.3%
unpow231.1%
unpow231.1%
difference-of-squares37.7%
Applied egg-rr25.3%
Taylor expanded in angle around inf 31.5%
add-cbrt-cube27.6%
pow327.6%
Applied egg-rr46.7%
Final simplification67.2%
b_m = (fabs.f64 b)
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a b_m angle_m)
:precision binary64
(let* ((t_0 (- (pow b_m 2.0) (pow a 2.0))))
(*
angle_s
(if (<= t_0 -5e+273)
(*
0.011111111111111112
(- (* angle_m (* (pow b_m 2.0) PI)) (* a (* a (* PI angle_m)))))
(if (<= t_0 5e+279)
(*
2.0
(*
(cos (* PI (/ angle_m 180.0)))
(*
(* (- b_m a) (+ b_m a))
(sin (* 0.005555555555555556 (* PI angle_m))))))
(fma
b_m
(* (* angle_m 0.011111111111111112) (* b_m PI))
(* -0.011111111111111112 (* (pow a 2.0) (* PI angle_m)))))))))b_m = fabs(b);
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a, double b_m, double angle_m) {
double t_0 = pow(b_m, 2.0) - pow(a, 2.0);
double tmp;
if (t_0 <= -5e+273) {
tmp = 0.011111111111111112 * ((angle_m * (pow(b_m, 2.0) * ((double) M_PI))) - (a * (a * (((double) M_PI) * angle_m))));
} else if (t_0 <= 5e+279) {
tmp = 2.0 * (cos((((double) M_PI) * (angle_m / 180.0))) * (((b_m - a) * (b_m + a)) * sin((0.005555555555555556 * (((double) M_PI) * angle_m)))));
} else {
tmp = fma(b_m, ((angle_m * 0.011111111111111112) * (b_m * ((double) M_PI))), (-0.011111111111111112 * (pow(a, 2.0) * (((double) M_PI) * angle_m))));
}
return angle_s * tmp;
}
b_m = abs(b) angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a, b_m, angle_m) t_0 = Float64((b_m ^ 2.0) - (a ^ 2.0)) tmp = 0.0 if (t_0 <= -5e+273) tmp = Float64(0.011111111111111112 * Float64(Float64(angle_m * Float64((b_m ^ 2.0) * pi)) - Float64(a * Float64(a * Float64(pi * angle_m))))); elseif (t_0 <= 5e+279) tmp = Float64(2.0 * Float64(cos(Float64(pi * Float64(angle_m / 180.0))) * Float64(Float64(Float64(b_m - a) * Float64(b_m + a)) * sin(Float64(0.005555555555555556 * Float64(pi * angle_m)))))); else tmp = fma(b_m, Float64(Float64(angle_m * 0.011111111111111112) * Float64(b_m * pi)), Float64(-0.011111111111111112 * Float64((a ^ 2.0) * Float64(pi * angle_m)))); end return Float64(angle_s * tmp) end
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_, b$95$m_, angle$95$m_] := Block[{t$95$0 = N[(N[Power[b$95$m, 2.0], $MachinePrecision] - N[Power[a, 2.0], $MachinePrecision]), $MachinePrecision]}, N[(angle$95$s * If[LessEqual[t$95$0, -5e+273], N[(0.011111111111111112 * N[(N[(angle$95$m * N[(N[Power[b$95$m, 2.0], $MachinePrecision] * Pi), $MachinePrecision]), $MachinePrecision] - N[(a * N[(a * N[(Pi * angle$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 5e+279], N[(2.0 * N[(N[Cos[N[(Pi * N[(angle$95$m / 180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(N[(N[(b$95$m - a), $MachinePrecision] * N[(b$95$m + a), $MachinePrecision]), $MachinePrecision] * N[Sin[N[(0.005555555555555556 * N[(Pi * angle$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(b$95$m * N[(N[(angle$95$m * 0.011111111111111112), $MachinePrecision] * N[(b$95$m * Pi), $MachinePrecision]), $MachinePrecision] + N[(-0.011111111111111112 * N[(N[Power[a, 2.0], $MachinePrecision] * N[(Pi * angle$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]]
\begin{array}{l}
b_m = \left|b\right|
\\
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
\begin{array}{l}
t_0 := {b\_m}^{2} - {a}^{2}\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_0 \leq -5 \cdot 10^{+273}:\\
\;\;\;\;0.011111111111111112 \cdot \left(angle\_m \cdot \left({b\_m}^{2} \cdot \pi\right) - a \cdot \left(a \cdot \left(\pi \cdot angle\_m\right)\right)\right)\\
\mathbf{elif}\;t\_0 \leq 5 \cdot 10^{+279}:\\
\;\;\;\;2 \cdot \left(\cos \left(\pi \cdot \frac{angle\_m}{180}\right) \cdot \left(\left(\left(b\_m - a\right) \cdot \left(b\_m + a\right)\right) \cdot \sin \left(0.005555555555555556 \cdot \left(\pi \cdot angle\_m\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(b\_m, \left(angle\_m \cdot 0.011111111111111112\right) \cdot \left(b\_m \cdot \pi\right), -0.011111111111111112 \cdot \left({a}^{2} \cdot \left(\pi \cdot angle\_m\right)\right)\right)\\
\end{array}
\end{array}
\end{array}
if (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) < -4.99999999999999961e273Initial program 45.1%
associate-*l*45.1%
*-commutative45.1%
associate-*l*46.8%
Simplified46.8%
Taylor expanded in angle around 0 54.5%
unpow226.2%
unpow226.2%
difference-of-squares26.2%
Applied egg-rr54.5%
Taylor expanded in a around 0 69.3%
+-commutative69.3%
*-commutative69.3%
+-commutative69.3%
associate-*r*69.3%
fma-define69.3%
distribute-rgt1-in69.3%
metadata-eval69.3%
mul0-lft69.3%
mul-1-neg69.3%
fma-neg69.3%
mul0-rgt69.3%
neg-sub069.3%
mul-1-neg69.3%
Simplified69.3%
if -4.99999999999999961e273 < (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) < 5.0000000000000002e279Initial program 56.6%
associate-*l*56.6%
associate-*l*56.6%
Simplified56.6%
add-sqr-sqrt36.3%
sqrt-unprod36.1%
pow236.1%
*-commutative36.1%
div-inv36.1%
metadata-eval36.1%
Applied egg-rr36.1%
unpow236.1%
unpow236.1%
difference-of-squares36.1%
Applied egg-rr36.1%
Taylor expanded in angle around inf 56.9%
+-commutative56.9%
*-commutative56.9%
Simplified56.9%
if 5.0000000000000002e279 < (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) Initial program 42.8%
associate-*l*42.8%
*-commutative42.8%
associate-*l*42.8%
Simplified42.8%
Taylor expanded in angle around 0 45.9%
unpow237.7%
unpow237.7%
difference-of-squares42.5%
Applied egg-rr53.7%
Taylor expanded in b around 0 62.8%
+-commutative62.8%
fma-define62.8%
associate-*r*62.9%
associate-*r*62.9%
distribute-lft-out62.9%
*-commutative62.9%
*-commutative62.9%
distribute-rgt1-in62.9%
metadata-eval62.9%
mul0-lft62.9%
distribute-rgt-out62.9%
+-rgt-identity62.9%
*-commutative62.9%
*-commutative62.9%
Simplified62.9%
Final simplification61.1%
b_m = (fabs.f64 b)
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a b_m angle_m)
:precision binary64
(let* ((t_0 (- (pow b_m 2.0) (pow a 2.0))))
(*
angle_s
(if (<= t_0 -5e+273)
(*
0.011111111111111112
(- (* angle_m (* (pow b_m 2.0) PI)) (* a (* a (* PI angle_m)))))
(if (<= t_0 5e+292)
(*
(* (- b_m a) (+ b_m a))
(sin (* (* PI angle_m) 0.011111111111111112)))
(fma
b_m
(* (* angle_m 0.011111111111111112) (* b_m PI))
(* -0.011111111111111112 (* (pow a 2.0) (* PI angle_m)))))))))b_m = fabs(b);
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a, double b_m, double angle_m) {
double t_0 = pow(b_m, 2.0) - pow(a, 2.0);
double tmp;
if (t_0 <= -5e+273) {
tmp = 0.011111111111111112 * ((angle_m * (pow(b_m, 2.0) * ((double) M_PI))) - (a * (a * (((double) M_PI) * angle_m))));
} else if (t_0 <= 5e+292) {
tmp = ((b_m - a) * (b_m + a)) * sin(((((double) M_PI) * angle_m) * 0.011111111111111112));
} else {
tmp = fma(b_m, ((angle_m * 0.011111111111111112) * (b_m * ((double) M_PI))), (-0.011111111111111112 * (pow(a, 2.0) * (((double) M_PI) * angle_m))));
}
return angle_s * tmp;
}
b_m = abs(b) angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a, b_m, angle_m) t_0 = Float64((b_m ^ 2.0) - (a ^ 2.0)) tmp = 0.0 if (t_0 <= -5e+273) tmp = Float64(0.011111111111111112 * Float64(Float64(angle_m * Float64((b_m ^ 2.0) * pi)) - Float64(a * Float64(a * Float64(pi * angle_m))))); elseif (t_0 <= 5e+292) tmp = Float64(Float64(Float64(b_m - a) * Float64(b_m + a)) * sin(Float64(Float64(pi * angle_m) * 0.011111111111111112))); else tmp = fma(b_m, Float64(Float64(angle_m * 0.011111111111111112) * Float64(b_m * pi)), Float64(-0.011111111111111112 * Float64((a ^ 2.0) * Float64(pi * angle_m)))); end return Float64(angle_s * tmp) end
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_, b$95$m_, angle$95$m_] := Block[{t$95$0 = N[(N[Power[b$95$m, 2.0], $MachinePrecision] - N[Power[a, 2.0], $MachinePrecision]), $MachinePrecision]}, N[(angle$95$s * If[LessEqual[t$95$0, -5e+273], N[(0.011111111111111112 * N[(N[(angle$95$m * N[(N[Power[b$95$m, 2.0], $MachinePrecision] * Pi), $MachinePrecision]), $MachinePrecision] - N[(a * N[(a * N[(Pi * angle$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 5e+292], N[(N[(N[(b$95$m - a), $MachinePrecision] * N[(b$95$m + a), $MachinePrecision]), $MachinePrecision] * N[Sin[N[(N[(Pi * angle$95$m), $MachinePrecision] * 0.011111111111111112), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(b$95$m * N[(N[(angle$95$m * 0.011111111111111112), $MachinePrecision] * N[(b$95$m * Pi), $MachinePrecision]), $MachinePrecision] + N[(-0.011111111111111112 * N[(N[Power[a, 2.0], $MachinePrecision] * N[(Pi * angle$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]]
\begin{array}{l}
b_m = \left|b\right|
\\
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
\begin{array}{l}
t_0 := {b\_m}^{2} - {a}^{2}\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_0 \leq -5 \cdot 10^{+273}:\\
\;\;\;\;0.011111111111111112 \cdot \left(angle\_m \cdot \left({b\_m}^{2} \cdot \pi\right) - a \cdot \left(a \cdot \left(\pi \cdot angle\_m\right)\right)\right)\\
\mathbf{elif}\;t\_0 \leq 5 \cdot 10^{+292}:\\
\;\;\;\;\left(\left(b\_m - a\right) \cdot \left(b\_m + a\right)\right) \cdot \sin \left(\left(\pi \cdot angle\_m\right) \cdot 0.011111111111111112\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(b\_m, \left(angle\_m \cdot 0.011111111111111112\right) \cdot \left(b\_m \cdot \pi\right), -0.011111111111111112 \cdot \left({a}^{2} \cdot \left(\pi \cdot angle\_m\right)\right)\right)\\
\end{array}
\end{array}
\end{array}
if (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) < -4.99999999999999961e273Initial program 45.1%
associate-*l*45.1%
*-commutative45.1%
associate-*l*46.8%
Simplified46.8%
Taylor expanded in angle around 0 54.5%
unpow226.2%
unpow226.2%
difference-of-squares26.2%
Applied egg-rr54.5%
Taylor expanded in a around 0 69.3%
+-commutative69.3%
*-commutative69.3%
+-commutative69.3%
associate-*r*69.3%
fma-define69.3%
distribute-rgt1-in69.3%
metadata-eval69.3%
mul0-lft69.3%
mul-1-neg69.3%
fma-neg69.3%
mul0-rgt69.3%
neg-sub069.3%
mul-1-neg69.3%
Simplified69.3%
if -4.99999999999999961e273 < (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) < 4.9999999999999996e292Initial program 56.5%
associate-*l*56.5%
*-commutative56.5%
associate-*l*56.5%
Simplified56.5%
*-commutative56.5%
sub-neg56.5%
distribute-lft-in56.5%
2-sin56.5%
associate-*r*56.5%
div-inv56.9%
metadata-eval56.9%
Applied egg-rr57.0%
distribute-lft-out57.0%
sub-neg57.0%
*-commutative57.0%
associate-*r*57.0%
associate-*r*56.7%
*-commutative56.7%
*-commutative56.7%
associate-*r*56.7%
metadata-eval56.7%
Simplified56.7%
unpow235.5%
unpow235.5%
difference-of-squares35.5%
Applied egg-rr56.7%
if 4.9999999999999996e292 < (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) Initial program 42.6%
associate-*l*42.6%
*-commutative42.6%
associate-*l*42.6%
Simplified42.6%
Taylor expanded in angle around 0 45.6%
unpow238.8%
unpow238.8%
difference-of-squares43.7%
Applied egg-rr53.7%
Taylor expanded in b around 0 63.1%
+-commutative63.1%
fma-define63.1%
associate-*r*63.1%
associate-*r*63.1%
distribute-lft-out63.1%
*-commutative63.1%
*-commutative63.1%
distribute-rgt1-in63.1%
metadata-eval63.1%
mul0-lft63.1%
distribute-rgt-out63.1%
+-rgt-identity63.1%
*-commutative63.1%
*-commutative63.1%
Simplified63.1%
Final simplification61.1%
b_m = (fabs.f64 b)
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a b_m angle_m)
:precision binary64
(let* ((t_0 (- (pow b_m 2.0) (pow a 2.0))))
(*
angle_s
(if (<= t_0 -5e+273)
(*
0.011111111111111112
(- (* angle_m (* (pow b_m 2.0) PI)) (* a (* a (* PI angle_m)))))
(if (<= t_0 5e+292)
(*
(* (- b_m a) (+ b_m a))
(sin (* (* PI angle_m) 0.011111111111111112)))
(+
(* -0.011111111111111112 (* (pow a 2.0) (* PI angle_m)))
(*
b_m
(+
(* 0.011111111111111112 (* angle_m (* b_m PI)))
(* 0.011111111111111112 (* angle_m (* PI (- a a))))))))))))b_m = fabs(b);
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a, double b_m, double angle_m) {
double t_0 = pow(b_m, 2.0) - pow(a, 2.0);
double tmp;
if (t_0 <= -5e+273) {
tmp = 0.011111111111111112 * ((angle_m * (pow(b_m, 2.0) * ((double) M_PI))) - (a * (a * (((double) M_PI) * angle_m))));
} else if (t_0 <= 5e+292) {
tmp = ((b_m - a) * (b_m + a)) * sin(((((double) M_PI) * angle_m) * 0.011111111111111112));
} else {
tmp = (-0.011111111111111112 * (pow(a, 2.0) * (((double) M_PI) * angle_m))) + (b_m * ((0.011111111111111112 * (angle_m * (b_m * ((double) M_PI)))) + (0.011111111111111112 * (angle_m * (((double) M_PI) * (a - a))))));
}
return angle_s * tmp;
}
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, double b_m, double angle_m) {
double t_0 = Math.pow(b_m, 2.0) - Math.pow(a, 2.0);
double tmp;
if (t_0 <= -5e+273) {
tmp = 0.011111111111111112 * ((angle_m * (Math.pow(b_m, 2.0) * Math.PI)) - (a * (a * (Math.PI * angle_m))));
} else if (t_0 <= 5e+292) {
tmp = ((b_m - a) * (b_m + a)) * Math.sin(((Math.PI * angle_m) * 0.011111111111111112));
} else {
tmp = (-0.011111111111111112 * (Math.pow(a, 2.0) * (Math.PI * angle_m))) + (b_m * ((0.011111111111111112 * (angle_m * (b_m * Math.PI))) + (0.011111111111111112 * (angle_m * (Math.PI * (a - a))))));
}
return angle_s * tmp;
}
b_m = math.fabs(b) angle\_m = math.fabs(angle) angle\_s = math.copysign(1.0, angle) def code(angle_s, a, b_m, angle_m): t_0 = math.pow(b_m, 2.0) - math.pow(a, 2.0) tmp = 0 if t_0 <= -5e+273: tmp = 0.011111111111111112 * ((angle_m * (math.pow(b_m, 2.0) * math.pi)) - (a * (a * (math.pi * angle_m)))) elif t_0 <= 5e+292: tmp = ((b_m - a) * (b_m + a)) * math.sin(((math.pi * angle_m) * 0.011111111111111112)) else: tmp = (-0.011111111111111112 * (math.pow(a, 2.0) * (math.pi * angle_m))) + (b_m * ((0.011111111111111112 * (angle_m * (b_m * math.pi))) + (0.011111111111111112 * (angle_m * (math.pi * (a - a)))))) return angle_s * tmp
b_m = abs(b) angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a, b_m, angle_m) t_0 = Float64((b_m ^ 2.0) - (a ^ 2.0)) tmp = 0.0 if (t_0 <= -5e+273) tmp = Float64(0.011111111111111112 * Float64(Float64(angle_m * Float64((b_m ^ 2.0) * pi)) - Float64(a * Float64(a * Float64(pi * angle_m))))); elseif (t_0 <= 5e+292) tmp = Float64(Float64(Float64(b_m - a) * Float64(b_m + a)) * sin(Float64(Float64(pi * angle_m) * 0.011111111111111112))); else tmp = Float64(Float64(-0.011111111111111112 * Float64((a ^ 2.0) * Float64(pi * angle_m))) + Float64(b_m * Float64(Float64(0.011111111111111112 * Float64(angle_m * Float64(b_m * pi))) + Float64(0.011111111111111112 * Float64(angle_m * Float64(pi * Float64(a - a))))))); end return Float64(angle_s * tmp) end
b_m = abs(b); angle\_m = abs(angle); angle\_s = sign(angle) * abs(1.0); function tmp_2 = code(angle_s, a, b_m, angle_m) t_0 = (b_m ^ 2.0) - (a ^ 2.0); tmp = 0.0; if (t_0 <= -5e+273) tmp = 0.011111111111111112 * ((angle_m * ((b_m ^ 2.0) * pi)) - (a * (a * (pi * angle_m)))); elseif (t_0 <= 5e+292) tmp = ((b_m - a) * (b_m + a)) * sin(((pi * angle_m) * 0.011111111111111112)); else tmp = (-0.011111111111111112 * ((a ^ 2.0) * (pi * angle_m))) + (b_m * ((0.011111111111111112 * (angle_m * (b_m * pi))) + (0.011111111111111112 * (angle_m * (pi * (a - a)))))); end tmp_2 = angle_s * tmp; end
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_, b$95$m_, angle$95$m_] := Block[{t$95$0 = N[(N[Power[b$95$m, 2.0], $MachinePrecision] - N[Power[a, 2.0], $MachinePrecision]), $MachinePrecision]}, N[(angle$95$s * If[LessEqual[t$95$0, -5e+273], N[(0.011111111111111112 * N[(N[(angle$95$m * N[(N[Power[b$95$m, 2.0], $MachinePrecision] * Pi), $MachinePrecision]), $MachinePrecision] - N[(a * N[(a * N[(Pi * angle$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 5e+292], N[(N[(N[(b$95$m - a), $MachinePrecision] * N[(b$95$m + a), $MachinePrecision]), $MachinePrecision] * N[Sin[N[(N[(Pi * angle$95$m), $MachinePrecision] * 0.011111111111111112), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[(-0.011111111111111112 * N[(N[Power[a, 2.0], $MachinePrecision] * N[(Pi * angle$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(b$95$m * N[(N[(0.011111111111111112 * N[(angle$95$m * N[(b$95$m * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(0.011111111111111112 * N[(angle$95$m * N[(Pi * N[(a - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]]
\begin{array}{l}
b_m = \left|b\right|
\\
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
\begin{array}{l}
t_0 := {b\_m}^{2} - {a}^{2}\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_0 \leq -5 \cdot 10^{+273}:\\
\;\;\;\;0.011111111111111112 \cdot \left(angle\_m \cdot \left({b\_m}^{2} \cdot \pi\right) - a \cdot \left(a \cdot \left(\pi \cdot angle\_m\right)\right)\right)\\
\mathbf{elif}\;t\_0 \leq 5 \cdot 10^{+292}:\\
\;\;\;\;\left(\left(b\_m - a\right) \cdot \left(b\_m + a\right)\right) \cdot \sin \left(\left(\pi \cdot angle\_m\right) \cdot 0.011111111111111112\right)\\
\mathbf{else}:\\
\;\;\;\;-0.011111111111111112 \cdot \left({a}^{2} \cdot \left(\pi \cdot angle\_m\right)\right) + b\_m \cdot \left(0.011111111111111112 \cdot \left(angle\_m \cdot \left(b\_m \cdot \pi\right)\right) + 0.011111111111111112 \cdot \left(angle\_m \cdot \left(\pi \cdot \left(a - a\right)\right)\right)\right)\\
\end{array}
\end{array}
\end{array}
if (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) < -4.99999999999999961e273Initial program 45.1%
associate-*l*45.1%
*-commutative45.1%
associate-*l*46.8%
Simplified46.8%
Taylor expanded in angle around 0 54.5%
unpow226.2%
unpow226.2%
difference-of-squares26.2%
Applied egg-rr54.5%
Taylor expanded in a around 0 69.3%
+-commutative69.3%
*-commutative69.3%
+-commutative69.3%
associate-*r*69.3%
fma-define69.3%
distribute-rgt1-in69.3%
metadata-eval69.3%
mul0-lft69.3%
mul-1-neg69.3%
fma-neg69.3%
mul0-rgt69.3%
neg-sub069.3%
mul-1-neg69.3%
Simplified69.3%
if -4.99999999999999961e273 < (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) < 4.9999999999999996e292Initial program 56.5%
associate-*l*56.5%
*-commutative56.5%
associate-*l*56.5%
Simplified56.5%
*-commutative56.5%
sub-neg56.5%
distribute-lft-in56.5%
2-sin56.5%
associate-*r*56.5%
div-inv56.9%
metadata-eval56.9%
Applied egg-rr57.0%
distribute-lft-out57.0%
sub-neg57.0%
*-commutative57.0%
associate-*r*57.0%
associate-*r*56.7%
*-commutative56.7%
*-commutative56.7%
associate-*r*56.7%
metadata-eval56.7%
Simplified56.7%
unpow235.5%
unpow235.5%
difference-of-squares35.5%
Applied egg-rr56.7%
if 4.9999999999999996e292 < (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) Initial program 42.6%
associate-*l*42.6%
*-commutative42.6%
associate-*l*42.6%
Simplified42.6%
Taylor expanded in angle around 0 45.6%
unpow238.8%
unpow238.8%
difference-of-squares43.7%
Applied egg-rr53.7%
Taylor expanded in b around 0 63.1%
Final simplification61.0%
b_m = (fabs.f64 b)
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a b_m angle_m)
:precision binary64
(*
angle_s
(*
2.0
(*
(cos (* PI (/ angle_m 180.0)))
(*
(- b_m a)
(* (sin (* PI (* angle_m 0.005555555555555556))) (+ b_m a)))))))b_m = fabs(b);
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a, double b_m, double angle_m) {
return angle_s * (2.0 * (cos((((double) M_PI) * (angle_m / 180.0))) * ((b_m - a) * (sin((((double) M_PI) * (angle_m * 0.005555555555555556))) * (b_m + 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, double b_m, double angle_m) {
return angle_s * (2.0 * (Math.cos((Math.PI * (angle_m / 180.0))) * ((b_m - a) * (Math.sin((Math.PI * (angle_m * 0.005555555555555556))) * (b_m + a)))));
}
b_m = math.fabs(b) angle\_m = math.fabs(angle) angle\_s = math.copysign(1.0, angle) def code(angle_s, a, b_m, angle_m): return angle_s * (2.0 * (math.cos((math.pi * (angle_m / 180.0))) * ((b_m - a) * (math.sin((math.pi * (angle_m * 0.005555555555555556))) * (b_m + a)))))
b_m = abs(b) angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a, b_m, angle_m) return Float64(angle_s * Float64(2.0 * Float64(cos(Float64(pi * Float64(angle_m / 180.0))) * Float64(Float64(b_m - a) * Float64(sin(Float64(pi * Float64(angle_m * 0.005555555555555556))) * Float64(b_m + a)))))) end
b_m = abs(b); angle\_m = abs(angle); angle\_s = sign(angle) * abs(1.0); function tmp = code(angle_s, a, b_m, angle_m) tmp = angle_s * (2.0 * (cos((pi * (angle_m / 180.0))) * ((b_m - a) * (sin((pi * (angle_m * 0.005555555555555556))) * (b_m + a))))); end
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_, b$95$m_, angle$95$m_] := N[(angle$95$s * N[(2.0 * N[(N[Cos[N[(Pi * N[(angle$95$m / 180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(N[(b$95$m - a), $MachinePrecision] * N[(N[Sin[N[(Pi * N[(angle$95$m * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(b$95$m + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
b_m = \left|b\right|
\\
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
angle\_s \cdot \left(2 \cdot \left(\cos \left(\pi \cdot \frac{angle\_m}{180}\right) \cdot \left(\left(b\_m - a\right) \cdot \left(\sin \left(\pi \cdot \left(angle\_m \cdot 0.005555555555555556\right)\right) \cdot \left(b\_m + a\right)\right)\right)\right)\right)
\end{array}
Initial program 50.5%
associate-*l*50.9%
associate-*l*50.9%
Simplified50.9%
add-sqr-sqrt28.5%
sqrt-unprod34.4%
pow234.4%
*-commutative34.4%
div-inv34.4%
metadata-eval34.4%
Applied egg-rr34.4%
unpow234.4%
unpow234.4%
difference-of-squares35.6%
Applied egg-rr35.6%
sqrt-pow154.6%
metadata-eval54.6%
pow154.6%
*-commutative54.6%
*-commutative54.6%
associate-*l*63.7%
associate-*r*61.4%
*-commutative61.4%
*-commutative61.4%
associate-*r*63.7%
*-commutative63.7%
Applied egg-rr63.7%
Final simplification63.7%
b_m = (fabs.f64 b)
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a b_m angle_m)
:precision binary64
(let* ((t_0 (* (- b_m a) (+ b_m a))))
(*
angle_s
(if (<= (/ angle_m 180.0) 2e-272)
(*
0.011111111111111112
(- (* angle_m (* (pow b_m 2.0) PI)) (* a (* a (* PI angle_m)))))
(if (<= (/ angle_m 180.0) 5e-129)
(*
0.011111111111111112
(-
(* b_m (+ (* angle_m (* b_m PI)) (* angle_m (* PI (- a a)))))
(* (pow a 2.0) (* PI angle_m))))
(if (<= (/ angle_m 180.0) 1e+73)
(* t_0 (sin (* (* PI angle_m) 0.011111111111111112)))
(* t_0 (* 2.0 (sin (* PI (/ angle_m 180.0)))))))))))b_m = fabs(b);
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a, double b_m, double angle_m) {
double t_0 = (b_m - a) * (b_m + a);
double tmp;
if ((angle_m / 180.0) <= 2e-272) {
tmp = 0.011111111111111112 * ((angle_m * (pow(b_m, 2.0) * ((double) M_PI))) - (a * (a * (((double) M_PI) * angle_m))));
} else if ((angle_m / 180.0) <= 5e-129) {
tmp = 0.011111111111111112 * ((b_m * ((angle_m * (b_m * ((double) M_PI))) + (angle_m * (((double) M_PI) * (a - a))))) - (pow(a, 2.0) * (((double) M_PI) * angle_m)));
} else if ((angle_m / 180.0) <= 1e+73) {
tmp = t_0 * sin(((((double) M_PI) * angle_m) * 0.011111111111111112));
} else {
tmp = t_0 * (2.0 * sin((((double) M_PI) * (angle_m / 180.0))));
}
return angle_s * tmp;
}
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, double b_m, double angle_m) {
double t_0 = (b_m - a) * (b_m + a);
double tmp;
if ((angle_m / 180.0) <= 2e-272) {
tmp = 0.011111111111111112 * ((angle_m * (Math.pow(b_m, 2.0) * Math.PI)) - (a * (a * (Math.PI * angle_m))));
} else if ((angle_m / 180.0) <= 5e-129) {
tmp = 0.011111111111111112 * ((b_m * ((angle_m * (b_m * Math.PI)) + (angle_m * (Math.PI * (a - a))))) - (Math.pow(a, 2.0) * (Math.PI * angle_m)));
} else if ((angle_m / 180.0) <= 1e+73) {
tmp = t_0 * Math.sin(((Math.PI * angle_m) * 0.011111111111111112));
} else {
tmp = t_0 * (2.0 * Math.sin((Math.PI * (angle_m / 180.0))));
}
return angle_s * tmp;
}
b_m = math.fabs(b) angle\_m = math.fabs(angle) angle\_s = math.copysign(1.0, angle) def code(angle_s, a, b_m, angle_m): t_0 = (b_m - a) * (b_m + a) tmp = 0 if (angle_m / 180.0) <= 2e-272: tmp = 0.011111111111111112 * ((angle_m * (math.pow(b_m, 2.0) * math.pi)) - (a * (a * (math.pi * angle_m)))) elif (angle_m / 180.0) <= 5e-129: tmp = 0.011111111111111112 * ((b_m * ((angle_m * (b_m * math.pi)) + (angle_m * (math.pi * (a - a))))) - (math.pow(a, 2.0) * (math.pi * angle_m))) elif (angle_m / 180.0) <= 1e+73: tmp = t_0 * math.sin(((math.pi * angle_m) * 0.011111111111111112)) else: tmp = t_0 * (2.0 * math.sin((math.pi * (angle_m / 180.0)))) return angle_s * tmp
b_m = abs(b) angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a, b_m, angle_m) t_0 = Float64(Float64(b_m - a) * Float64(b_m + a)) tmp = 0.0 if (Float64(angle_m / 180.0) <= 2e-272) tmp = Float64(0.011111111111111112 * Float64(Float64(angle_m * Float64((b_m ^ 2.0) * pi)) - Float64(a * Float64(a * Float64(pi * angle_m))))); elseif (Float64(angle_m / 180.0) <= 5e-129) tmp = Float64(0.011111111111111112 * Float64(Float64(b_m * Float64(Float64(angle_m * Float64(b_m * pi)) + Float64(angle_m * Float64(pi * Float64(a - a))))) - Float64((a ^ 2.0) * Float64(pi * angle_m)))); elseif (Float64(angle_m / 180.0) <= 1e+73) tmp = Float64(t_0 * sin(Float64(Float64(pi * angle_m) * 0.011111111111111112))); else tmp = Float64(t_0 * Float64(2.0 * sin(Float64(pi * Float64(angle_m / 180.0))))); end return Float64(angle_s * tmp) end
b_m = abs(b); angle\_m = abs(angle); angle\_s = sign(angle) * abs(1.0); function tmp_2 = code(angle_s, a, b_m, angle_m) t_0 = (b_m - a) * (b_m + a); tmp = 0.0; if ((angle_m / 180.0) <= 2e-272) tmp = 0.011111111111111112 * ((angle_m * ((b_m ^ 2.0) * pi)) - (a * (a * (pi * angle_m)))); elseif ((angle_m / 180.0) <= 5e-129) tmp = 0.011111111111111112 * ((b_m * ((angle_m * (b_m * pi)) + (angle_m * (pi * (a - a))))) - ((a ^ 2.0) * (pi * angle_m))); elseif ((angle_m / 180.0) <= 1e+73) tmp = t_0 * sin(((pi * angle_m) * 0.011111111111111112)); else tmp = t_0 * (2.0 * sin((pi * (angle_m / 180.0)))); end tmp_2 = angle_s * tmp; end
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_, b$95$m_, angle$95$m_] := Block[{t$95$0 = N[(N[(b$95$m - a), $MachinePrecision] * N[(b$95$m + a), $MachinePrecision]), $MachinePrecision]}, N[(angle$95$s * If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 2e-272], N[(0.011111111111111112 * N[(N[(angle$95$m * N[(N[Power[b$95$m, 2.0], $MachinePrecision] * Pi), $MachinePrecision]), $MachinePrecision] - N[(a * N[(a * N[(Pi * angle$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 5e-129], N[(0.011111111111111112 * N[(N[(b$95$m * N[(N[(angle$95$m * N[(b$95$m * Pi), $MachinePrecision]), $MachinePrecision] + N[(angle$95$m * N[(Pi * N[(a - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[Power[a, 2.0], $MachinePrecision] * N[(Pi * angle$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 1e+73], N[(t$95$0 * N[Sin[N[(N[(Pi * angle$95$m), $MachinePrecision] * 0.011111111111111112), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(t$95$0 * N[(2.0 * N[Sin[N[(Pi * N[(angle$95$m / 180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]), $MachinePrecision]]
\begin{array}{l}
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\right) \cdot \left(b\_m + a\right)\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;\frac{angle\_m}{180} \leq 2 \cdot 10^{-272}:\\
\;\;\;\;0.011111111111111112 \cdot \left(angle\_m \cdot \left({b\_m}^{2} \cdot \pi\right) - a \cdot \left(a \cdot \left(\pi \cdot angle\_m\right)\right)\right)\\
\mathbf{elif}\;\frac{angle\_m}{180} \leq 5 \cdot 10^{-129}:\\
\;\;\;\;0.011111111111111112 \cdot \left(b\_m \cdot \left(angle\_m \cdot \left(b\_m \cdot \pi\right) + angle\_m \cdot \left(\pi \cdot \left(a - a\right)\right)\right) - {a}^{2} \cdot \left(\pi \cdot angle\_m\right)\right)\\
\mathbf{elif}\;\frac{angle\_m}{180} \leq 10^{+73}:\\
\;\;\;\;t\_0 \cdot \sin \left(\left(\pi \cdot angle\_m\right) \cdot 0.011111111111111112\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0 \cdot \left(2 \cdot \sin \left(\pi \cdot \frac{angle\_m}{180}\right)\right)\\
\end{array}
\end{array}
\end{array}
if (/.f64 angle #s(literal 180 binary64)) < 1.99999999999999986e-272Initial program 47.7%
associate-*l*47.7%
*-commutative47.7%
associate-*l*48.4%
Simplified48.4%
Taylor expanded in angle around 0 50.5%
unpow232.7%
unpow232.7%
difference-of-squares34.3%
Applied egg-rr53.7%
Taylor expanded in a around 0 54.2%
+-commutative54.2%
*-commutative54.2%
+-commutative54.2%
associate-*r*54.2%
fma-define54.2%
distribute-rgt1-in54.2%
metadata-eval54.2%
mul0-lft54.2%
mul-1-neg54.2%
fma-neg54.2%
mul0-rgt54.2%
neg-sub054.2%
mul-1-neg54.2%
Simplified54.2%
if 1.99999999999999986e-272 < (/.f64 angle #s(literal 180 binary64)) < 5.00000000000000027e-129Initial program 71.1%
associate-*l*71.1%
*-commutative71.1%
associate-*l*71.1%
Simplified71.1%
Taylor expanded in angle around 0 71.0%
unpow251.5%
unpow251.5%
difference-of-squares51.9%
Applied egg-rr75.0%
Taylor expanded in b around 0 83.9%
if 5.00000000000000027e-129 < (/.f64 angle #s(literal 180 binary64)) < 9.99999999999999983e72Initial program 77.6%
associate-*l*77.6%
*-commutative77.6%
associate-*l*77.6%
Simplified77.6%
*-commutative77.6%
sub-neg77.6%
distribute-lft-in77.6%
2-sin77.6%
associate-*r*77.6%
div-inv77.6%
metadata-eval77.6%
Applied egg-rr77.7%
distribute-lft-out77.7%
sub-neg77.7%
*-commutative77.7%
associate-*r*77.7%
associate-*r*77.2%
*-commutative77.2%
*-commutative77.2%
associate-*r*77.2%
metadata-eval77.2%
Simplified77.2%
unpow234.1%
unpow234.1%
difference-of-squares34.3%
Applied egg-rr77.4%
if 9.99999999999999983e72 < (/.f64 angle #s(literal 180 binary64)) Initial program 25.1%
associate-*l*25.1%
*-commutative25.1%
associate-*l*25.1%
Simplified25.1%
unpow229.3%
unpow229.3%
difference-of-squares31.0%
Applied egg-rr25.1%
Taylor expanded in angle around 0 30.4%
Final simplification56.3%
b_m = (fabs.f64 b)
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a b_m angle_m)
:precision binary64
(let* ((t_0 (* (- b_m a) (+ b_m a))))
(*
angle_s
(if (<= (/ angle_m 180.0) 5e-56)
(*
0.011111111111111112
(- (* angle_m (* (pow b_m 2.0) PI)) (* a (* a (* PI angle_m)))))
(if (<= (/ angle_m 180.0) 1e+73)
(* t_0 (sin (* (* PI angle_m) 0.011111111111111112)))
(* t_0 (* 2.0 (sin (* PI (/ angle_m 180.0))))))))))b_m = fabs(b);
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a, double b_m, double angle_m) {
double t_0 = (b_m - a) * (b_m + a);
double tmp;
if ((angle_m / 180.0) <= 5e-56) {
tmp = 0.011111111111111112 * ((angle_m * (pow(b_m, 2.0) * ((double) M_PI))) - (a * (a * (((double) M_PI) * angle_m))));
} else if ((angle_m / 180.0) <= 1e+73) {
tmp = t_0 * sin(((((double) M_PI) * angle_m) * 0.011111111111111112));
} else {
tmp = t_0 * (2.0 * sin((((double) M_PI) * (angle_m / 180.0))));
}
return angle_s * tmp;
}
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, double b_m, double angle_m) {
double t_0 = (b_m - a) * (b_m + a);
double tmp;
if ((angle_m / 180.0) <= 5e-56) {
tmp = 0.011111111111111112 * ((angle_m * (Math.pow(b_m, 2.0) * Math.PI)) - (a * (a * (Math.PI * angle_m))));
} else if ((angle_m / 180.0) <= 1e+73) {
tmp = t_0 * Math.sin(((Math.PI * angle_m) * 0.011111111111111112));
} else {
tmp = t_0 * (2.0 * Math.sin((Math.PI * (angle_m / 180.0))));
}
return angle_s * tmp;
}
b_m = math.fabs(b) angle\_m = math.fabs(angle) angle\_s = math.copysign(1.0, angle) def code(angle_s, a, b_m, angle_m): t_0 = (b_m - a) * (b_m + a) tmp = 0 if (angle_m / 180.0) <= 5e-56: tmp = 0.011111111111111112 * ((angle_m * (math.pow(b_m, 2.0) * math.pi)) - (a * (a * (math.pi * angle_m)))) elif (angle_m / 180.0) <= 1e+73: tmp = t_0 * math.sin(((math.pi * angle_m) * 0.011111111111111112)) else: tmp = t_0 * (2.0 * math.sin((math.pi * (angle_m / 180.0)))) return angle_s * tmp
b_m = abs(b) angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a, b_m, angle_m) t_0 = Float64(Float64(b_m - a) * Float64(b_m + a)) tmp = 0.0 if (Float64(angle_m / 180.0) <= 5e-56) tmp = Float64(0.011111111111111112 * Float64(Float64(angle_m * Float64((b_m ^ 2.0) * pi)) - Float64(a * Float64(a * Float64(pi * angle_m))))); elseif (Float64(angle_m / 180.0) <= 1e+73) tmp = Float64(t_0 * sin(Float64(Float64(pi * angle_m) * 0.011111111111111112))); else tmp = Float64(t_0 * Float64(2.0 * sin(Float64(pi * Float64(angle_m / 180.0))))); end return Float64(angle_s * tmp) end
b_m = abs(b); angle\_m = abs(angle); angle\_s = sign(angle) * abs(1.0); function tmp_2 = code(angle_s, a, b_m, angle_m) t_0 = (b_m - a) * (b_m + a); tmp = 0.0; if ((angle_m / 180.0) <= 5e-56) tmp = 0.011111111111111112 * ((angle_m * ((b_m ^ 2.0) * pi)) - (a * (a * (pi * angle_m)))); elseif ((angle_m / 180.0) <= 1e+73) tmp = t_0 * sin(((pi * angle_m) * 0.011111111111111112)); else tmp = t_0 * (2.0 * sin((pi * (angle_m / 180.0)))); end tmp_2 = angle_s * tmp; end
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_, b$95$m_, angle$95$m_] := Block[{t$95$0 = N[(N[(b$95$m - a), $MachinePrecision] * N[(b$95$m + a), $MachinePrecision]), $MachinePrecision]}, N[(angle$95$s * If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 5e-56], N[(0.011111111111111112 * N[(N[(angle$95$m * N[(N[Power[b$95$m, 2.0], $MachinePrecision] * Pi), $MachinePrecision]), $MachinePrecision] - N[(a * N[(a * N[(Pi * angle$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 1e+73], N[(t$95$0 * N[Sin[N[(N[(Pi * angle$95$m), $MachinePrecision] * 0.011111111111111112), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(t$95$0 * N[(2.0 * N[Sin[N[(Pi * N[(angle$95$m / 180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]]
\begin{array}{l}
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\right) \cdot \left(b\_m + a\right)\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;\frac{angle\_m}{180} \leq 5 \cdot 10^{-56}:\\
\;\;\;\;0.011111111111111112 \cdot \left(angle\_m \cdot \left({b\_m}^{2} \cdot \pi\right) - a \cdot \left(a \cdot \left(\pi \cdot angle\_m\right)\right)\right)\\
\mathbf{elif}\;\frac{angle\_m}{180} \leq 10^{+73}:\\
\;\;\;\;t\_0 \cdot \sin \left(\left(\pi \cdot angle\_m\right) \cdot 0.011111111111111112\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0 \cdot \left(2 \cdot \sin \left(\pi \cdot \frac{angle\_m}{180}\right)\right)\\
\end{array}
\end{array}
\end{array}
if (/.f64 angle #s(literal 180 binary64)) < 4.99999999999999997e-56Initial program 57.3%
associate-*l*57.3%
*-commutative57.3%
associate-*l*57.8%
Simplified57.8%
Taylor expanded in angle around 0 59.3%
unpow237.1%
unpow237.1%
difference-of-squares38.4%
Applied egg-rr62.3%
Taylor expanded in a around 0 63.6%
+-commutative63.6%
*-commutative63.6%
+-commutative63.6%
associate-*r*63.6%
fma-define63.6%
distribute-rgt1-in63.6%
metadata-eval63.6%
mul0-lft63.6%
mul-1-neg63.6%
fma-neg63.6%
mul0-rgt63.6%
neg-sub063.6%
mul-1-neg63.6%
Simplified63.6%
if 4.99999999999999997e-56 < (/.f64 angle #s(literal 180 binary64)) < 9.99999999999999983e72Initial program 61.6%
associate-*l*61.7%
*-commutative61.7%
associate-*l*61.7%
Simplified61.7%
*-commutative61.7%
sub-neg61.7%
distribute-lft-in61.7%
2-sin61.7%
associate-*r*61.7%
div-inv61.8%
metadata-eval61.8%
Applied egg-rr61.8%
distribute-lft-out61.8%
sub-neg61.8%
*-commutative61.8%
associate-*r*61.8%
associate-*r*61.1%
*-commutative61.1%
*-commutative61.1%
associate-*r*61.1%
metadata-eval61.1%
Simplified61.1%
unpow225.7%
unpow225.7%
difference-of-squares25.7%
Applied egg-rr61.1%
if 9.99999999999999983e72 < (/.f64 angle #s(literal 180 binary64)) Initial program 25.1%
associate-*l*25.1%
*-commutative25.1%
associate-*l*25.1%
Simplified25.1%
unpow229.3%
unpow229.3%
difference-of-squares31.0%
Applied egg-rr25.1%
Taylor expanded in angle around 0 30.4%
Final simplification56.0%
b_m = (fabs.f64 b)
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a b_m angle_m)
:precision binary64
(let* ((t_0 (* (- b_m a) (+ b_m a))))
(*
angle_s
(if (<= angle_m 8e-51)
(*
0.011111111111111112
(- (* angle_m (* (pow b_m 2.0) PI)) (* a (* a (* PI angle_m)))))
(if (<= angle_m 5.2e+163)
(* t_0 (sin (* (* PI angle_m) 0.011111111111111112)))
(* 0.011111111111111112 (* angle_m (* PI t_0))))))))b_m = fabs(b);
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a, double b_m, double angle_m) {
double t_0 = (b_m - a) * (b_m + a);
double tmp;
if (angle_m <= 8e-51) {
tmp = 0.011111111111111112 * ((angle_m * (pow(b_m, 2.0) * ((double) M_PI))) - (a * (a * (((double) M_PI) * angle_m))));
} else if (angle_m <= 5.2e+163) {
tmp = t_0 * sin(((((double) M_PI) * angle_m) * 0.011111111111111112));
} else {
tmp = 0.011111111111111112 * (angle_m * (((double) M_PI) * t_0));
}
return angle_s * tmp;
}
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, double b_m, double angle_m) {
double t_0 = (b_m - a) * (b_m + a);
double tmp;
if (angle_m <= 8e-51) {
tmp = 0.011111111111111112 * ((angle_m * (Math.pow(b_m, 2.0) * Math.PI)) - (a * (a * (Math.PI * angle_m))));
} else if (angle_m <= 5.2e+163) {
tmp = t_0 * Math.sin(((Math.PI * angle_m) * 0.011111111111111112));
} else {
tmp = 0.011111111111111112 * (angle_m * (Math.PI * t_0));
}
return angle_s * tmp;
}
b_m = math.fabs(b) angle\_m = math.fabs(angle) angle\_s = math.copysign(1.0, angle) def code(angle_s, a, b_m, angle_m): t_0 = (b_m - a) * (b_m + a) tmp = 0 if angle_m <= 8e-51: tmp = 0.011111111111111112 * ((angle_m * (math.pow(b_m, 2.0) * math.pi)) - (a * (a * (math.pi * angle_m)))) elif angle_m <= 5.2e+163: tmp = t_0 * math.sin(((math.pi * angle_m) * 0.011111111111111112)) else: tmp = 0.011111111111111112 * (angle_m * (math.pi * t_0)) return angle_s * tmp
b_m = abs(b) angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a, b_m, angle_m) t_0 = Float64(Float64(b_m - a) * Float64(b_m + a)) tmp = 0.0 if (angle_m <= 8e-51) tmp = Float64(0.011111111111111112 * Float64(Float64(angle_m * Float64((b_m ^ 2.0) * pi)) - Float64(a * Float64(a * Float64(pi * angle_m))))); elseif (angle_m <= 5.2e+163) tmp = Float64(t_0 * sin(Float64(Float64(pi * angle_m) * 0.011111111111111112))); else tmp = Float64(0.011111111111111112 * Float64(angle_m * Float64(pi * t_0))); end return Float64(angle_s * tmp) end
b_m = abs(b); angle\_m = abs(angle); angle\_s = sign(angle) * abs(1.0); function tmp_2 = code(angle_s, a, b_m, angle_m) t_0 = (b_m - a) * (b_m + a); tmp = 0.0; if (angle_m <= 8e-51) tmp = 0.011111111111111112 * ((angle_m * ((b_m ^ 2.0) * pi)) - (a * (a * (pi * angle_m)))); elseif (angle_m <= 5.2e+163) tmp = t_0 * sin(((pi * angle_m) * 0.011111111111111112)); else tmp = 0.011111111111111112 * (angle_m * (pi * t_0)); end tmp_2 = angle_s * tmp; end
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_, b$95$m_, angle$95$m_] := Block[{t$95$0 = N[(N[(b$95$m - a), $MachinePrecision] * N[(b$95$m + a), $MachinePrecision]), $MachinePrecision]}, N[(angle$95$s * If[LessEqual[angle$95$m, 8e-51], N[(0.011111111111111112 * N[(N[(angle$95$m * N[(N[Power[b$95$m, 2.0], $MachinePrecision] * Pi), $MachinePrecision]), $MachinePrecision] - N[(a * N[(a * N[(Pi * angle$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[angle$95$m, 5.2e+163], N[(t$95$0 * N[Sin[N[(N[(Pi * angle$95$m), $MachinePrecision] * 0.011111111111111112), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(0.011111111111111112 * N[(angle$95$m * N[(Pi * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]]
\begin{array}{l}
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\right) \cdot \left(b\_m + a\right)\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;angle\_m \leq 8 \cdot 10^{-51}:\\
\;\;\;\;0.011111111111111112 \cdot \left(angle\_m \cdot \left({b\_m}^{2} \cdot \pi\right) - a \cdot \left(a \cdot \left(\pi \cdot angle\_m\right)\right)\right)\\
\mathbf{elif}\;angle\_m \leq 5.2 \cdot 10^{+163}:\\
\;\;\;\;t\_0 \cdot \sin \left(\left(\pi \cdot angle\_m\right) \cdot 0.011111111111111112\right)\\
\mathbf{else}:\\
\;\;\;\;0.011111111111111112 \cdot \left(angle\_m \cdot \left(\pi \cdot t\_0\right)\right)\\
\end{array}
\end{array}
\end{array}
if angle < 8.0000000000000001e-51Initial program 57.3%
associate-*l*57.3%
*-commutative57.3%
associate-*l*57.8%
Simplified57.8%
Taylor expanded in angle around 0 59.3%
unpow237.1%
unpow237.1%
difference-of-squares38.4%
Applied egg-rr62.3%
Taylor expanded in a around 0 63.6%
+-commutative63.6%
*-commutative63.6%
+-commutative63.6%
associate-*r*63.6%
fma-define63.6%
distribute-rgt1-in63.6%
metadata-eval63.6%
mul0-lft63.6%
mul-1-neg63.6%
fma-neg63.6%
mul0-rgt63.6%
neg-sub063.6%
mul-1-neg63.6%
Simplified63.6%
if 8.0000000000000001e-51 < angle < 5.2000000000000003e163Initial program 47.8%
associate-*l*47.8%
*-commutative47.8%
associate-*l*47.8%
Simplified47.8%
*-commutative47.8%
sub-neg47.8%
distribute-lft-in47.8%
2-sin47.8%
associate-*r*47.8%
div-inv48.3%
metadata-eval48.3%
Applied egg-rr48.2%
distribute-lft-out48.2%
sub-neg48.2%
*-commutative48.2%
associate-*r*48.2%
associate-*r*48.8%
*-commutative48.8%
*-commutative48.8%
associate-*r*48.8%
metadata-eval48.8%
Simplified48.8%
unpow231.3%
unpow231.3%
difference-of-squares31.3%
Applied egg-rr48.8%
if 5.2000000000000003e163 < angle Initial program 19.0%
associate-*l*19.0%
*-commutative19.0%
associate-*l*19.0%
Simplified19.0%
Taylor expanded in angle around 0 25.2%
unpow224.2%
unpow224.2%
difference-of-squares27.1%
Applied egg-rr25.2%
Final simplification55.8%
b_m = (fabs.f64 b)
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a b_m angle_m)
:precision binary64
(let* ((t_0 (* (- b_m a) (+ b_m a))))
(*
angle_s
(if (<= angle_m 5.2e+163)
(* t_0 (sin (* (* PI angle_m) 0.011111111111111112)))
(* 0.011111111111111112 (* angle_m (* PI t_0)))))))b_m = fabs(b);
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a, double b_m, double angle_m) {
double t_0 = (b_m - a) * (b_m + a);
double tmp;
if (angle_m <= 5.2e+163) {
tmp = t_0 * sin(((((double) M_PI) * angle_m) * 0.011111111111111112));
} else {
tmp = 0.011111111111111112 * (angle_m * (((double) M_PI) * t_0));
}
return angle_s * tmp;
}
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, double b_m, double angle_m) {
double t_0 = (b_m - a) * (b_m + a);
double tmp;
if (angle_m <= 5.2e+163) {
tmp = t_0 * Math.sin(((Math.PI * angle_m) * 0.011111111111111112));
} else {
tmp = 0.011111111111111112 * (angle_m * (Math.PI * t_0));
}
return angle_s * tmp;
}
b_m = math.fabs(b) angle\_m = math.fabs(angle) angle\_s = math.copysign(1.0, angle) def code(angle_s, a, b_m, angle_m): t_0 = (b_m - a) * (b_m + a) tmp = 0 if angle_m <= 5.2e+163: tmp = t_0 * math.sin(((math.pi * angle_m) * 0.011111111111111112)) else: tmp = 0.011111111111111112 * (angle_m * (math.pi * t_0)) return angle_s * tmp
b_m = abs(b) angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a, b_m, angle_m) t_0 = Float64(Float64(b_m - a) * Float64(b_m + a)) tmp = 0.0 if (angle_m <= 5.2e+163) tmp = Float64(t_0 * sin(Float64(Float64(pi * angle_m) * 0.011111111111111112))); else tmp = Float64(0.011111111111111112 * Float64(angle_m * Float64(pi * t_0))); end return Float64(angle_s * tmp) end
b_m = abs(b); angle\_m = abs(angle); angle\_s = sign(angle) * abs(1.0); function tmp_2 = code(angle_s, a, b_m, angle_m) t_0 = (b_m - a) * (b_m + a); tmp = 0.0; if (angle_m <= 5.2e+163) tmp = t_0 * sin(((pi * angle_m) * 0.011111111111111112)); else tmp = 0.011111111111111112 * (angle_m * (pi * t_0)); end tmp_2 = angle_s * tmp; end
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_, b$95$m_, angle$95$m_] := Block[{t$95$0 = N[(N[(b$95$m - a), $MachinePrecision] * N[(b$95$m + a), $MachinePrecision]), $MachinePrecision]}, N[(angle$95$s * If[LessEqual[angle$95$m, 5.2e+163], N[(t$95$0 * N[Sin[N[(N[(Pi * angle$95$m), $MachinePrecision] * 0.011111111111111112), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(0.011111111111111112 * N[(angle$95$m * N[(Pi * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]]
\begin{array}{l}
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\right) \cdot \left(b\_m + a\right)\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;angle\_m \leq 5.2 \cdot 10^{+163}:\\
\;\;\;\;t\_0 \cdot \sin \left(\left(\pi \cdot angle\_m\right) \cdot 0.011111111111111112\right)\\
\mathbf{else}:\\
\;\;\;\;0.011111111111111112 \cdot \left(angle\_m \cdot \left(\pi \cdot t\_0\right)\right)\\
\end{array}
\end{array}
\end{array}
if angle < 5.2000000000000003e163Initial program 55.3%
associate-*l*55.4%
*-commutative55.4%
associate-*l*55.8%
Simplified55.8%
*-commutative55.8%
sub-neg55.8%
distribute-lft-in55.8%
2-sin55.8%
associate-*r*55.8%
div-inv56.3%
metadata-eval56.3%
Applied egg-rr56.3%
distribute-lft-out56.3%
sub-neg56.3%
*-commutative56.3%
associate-*r*56.3%
associate-*r*56.4%
*-commutative56.4%
*-commutative56.4%
associate-*r*56.4%
metadata-eval56.4%
Simplified56.4%
unpow235.9%
unpow235.9%
difference-of-squares36.9%
Applied egg-rr58.3%
if 5.2000000000000003e163 < angle Initial program 19.0%
associate-*l*19.0%
*-commutative19.0%
associate-*l*19.0%
Simplified19.0%
Taylor expanded in angle around 0 25.2%
unpow224.2%
unpow224.2%
difference-of-squares27.1%
Applied egg-rr25.2%
Final simplification53.9%
b_m = (fabs.f64 b) angle\_m = (fabs.f64 angle) angle\_s = (copysign.f64 #s(literal 1 binary64) angle) (FPCore (angle_s a b_m angle_m) :precision binary64 (* angle_s (* 0.011111111111111112 (* angle_m (* PI (* (- b_m a) (+ b_m a)))))))
b_m = fabs(b);
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a, double b_m, double angle_m) {
return angle_s * (0.011111111111111112 * (angle_m * (((double) M_PI) * ((b_m - a) * (b_m + 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, double b_m, double angle_m) {
return angle_s * (0.011111111111111112 * (angle_m * (Math.PI * ((b_m - a) * (b_m + a)))));
}
b_m = math.fabs(b) angle\_m = math.fabs(angle) angle\_s = math.copysign(1.0, angle) def code(angle_s, a, b_m, angle_m): return angle_s * (0.011111111111111112 * (angle_m * (math.pi * ((b_m - a) * (b_m + a)))))
b_m = abs(b) angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a, b_m, angle_m) return Float64(angle_s * Float64(0.011111111111111112 * Float64(angle_m * Float64(pi * Float64(Float64(b_m - a) * Float64(b_m + a)))))) end
b_m = abs(b); angle\_m = abs(angle); angle\_s = sign(angle) * abs(1.0); function tmp = code(angle_s, a, b_m, angle_m) tmp = angle_s * (0.011111111111111112 * (angle_m * (pi * ((b_m - a) * (b_m + a))))); end
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_, 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), $MachinePrecision] * N[(b$95$m + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
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\right) \cdot \left(b\_m + a\right)\right)\right)\right)\right)
\end{array}
Initial program 50.5%
associate-*l*50.5%
*-commutative50.5%
associate-*l*50.9%
Simplified50.9%
Taylor expanded in angle around 0 50.0%
unpow234.4%
unpow234.4%
difference-of-squares35.6%
Applied egg-rr52.1%
Final simplification52.1%
b_m = (fabs.f64 b) angle\_m = (fabs.f64 angle) angle\_s = (copysign.f64 #s(literal 1 binary64) angle) (FPCore (angle_s a b_m angle_m) :precision binary64 (* angle_s (* (* angle_m 0.011111111111111112) (* PI (* (- b_m a) (+ b_m a))))))
b_m = fabs(b);
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a, double b_m, double angle_m) {
return angle_s * ((angle_m * 0.011111111111111112) * (((double) M_PI) * ((b_m - a) * (b_m + 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, double b_m, double angle_m) {
return angle_s * ((angle_m * 0.011111111111111112) * (Math.PI * ((b_m - a) * (b_m + a))));
}
b_m = math.fabs(b) angle\_m = math.fabs(angle) angle\_s = math.copysign(1.0, angle) def code(angle_s, a, b_m, angle_m): return angle_s * ((angle_m * 0.011111111111111112) * (math.pi * ((b_m - a) * (b_m + a))))
b_m = abs(b) angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a, b_m, angle_m) return Float64(angle_s * Float64(Float64(angle_m * 0.011111111111111112) * Float64(pi * Float64(Float64(b_m - a) * Float64(b_m + a))))) end
b_m = abs(b); angle\_m = abs(angle); angle\_s = sign(angle) * abs(1.0); function tmp = code(angle_s, a, b_m, angle_m) tmp = angle_s * ((angle_m * 0.011111111111111112) * (pi * ((b_m - a) * (b_m + a)))); end
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_, b$95$m_, angle$95$m_] := N[(angle$95$s * N[(N[(angle$95$m * 0.011111111111111112), $MachinePrecision] * N[(Pi * N[(N[(b$95$m - a), $MachinePrecision] * N[(b$95$m + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
b_m = \left|b\right|
\\
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
angle\_s \cdot \left(\left(angle\_m \cdot 0.011111111111111112\right) \cdot \left(\pi \cdot \left(\left(b\_m - a\right) \cdot \left(b\_m + a\right)\right)\right)\right)
\end{array}
Initial program 50.5%
associate-*l*50.5%
*-commutative50.5%
associate-*l*50.9%
Simplified50.9%
Taylor expanded in angle around 0 50.0%
unpow234.4%
unpow234.4%
difference-of-squares35.6%
Applied egg-rr52.1%
Taylor expanded in angle around 0 52.1%
associate-*r*52.1%
*-commutative52.1%
+-commutative52.1%
Simplified52.1%
Final simplification52.1%
herbie shell --seed 2024080
(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)))))