
(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 21 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 1 angle)
(FPCore (angle_s a_m b_m angle_m)
:precision binary64
(let* ((t_0 (* PI (* angle_m (- b_m a_m))))
(t_1 (* PI (* angle_m 0.005555555555555556)))
(t_2 (* (- b_m a_m) (+ b_m a_m)))
(t_3 (* t_2 (cos (* angle_m (/ PI -180.0))))))
(*
angle_s
(if (<= (/ angle_m 180.0) 4e-30)
(* (+ (* b_m t_0) (* a_m t_0)) 0.011111111111111112)
(if (<= (/ angle_m 180.0) 5e+60)
(* 2.0 (* t_3 (cbrt (pow (sin t_1) 3.0))))
(if (<= (/ angle_m 180.0) 2e+134)
(* 2.0 (* (log1p (expm1 (sin (/ (* angle_m PI) -180.0)))) t_3))
(if (<= (/ angle_m 180.0) 5e+193)
(*
2.0
(*
(cos (* PI (* angle_m -0.005555555555555556)))
(* t_2 (sin (* 0.005555555555555556 (* angle_m PI))))))
(if (<= (/ angle_m 180.0) 5e+289)
(*
2.0
(*
(sin (* (/ angle_m 180.0) (* (cbrt PI) (pow (cbrt PI) 2.0))))
t_3))
(*
2.0
(*
(sin (* (/ angle_m 180.0) PI))
(* t_2 (fabs (cos t_1)))))))))))))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 * (b_m - a_m));
double t_1 = ((double) M_PI) * (angle_m * 0.005555555555555556);
double t_2 = (b_m - a_m) * (b_m + a_m);
double t_3 = t_2 * cos((angle_m * (((double) M_PI) / -180.0)));
double tmp;
if ((angle_m / 180.0) <= 4e-30) {
tmp = ((b_m * t_0) + (a_m * t_0)) * 0.011111111111111112;
} else if ((angle_m / 180.0) <= 5e+60) {
tmp = 2.0 * (t_3 * cbrt(pow(sin(t_1), 3.0)));
} else if ((angle_m / 180.0) <= 2e+134) {
tmp = 2.0 * (log1p(expm1(sin(((angle_m * ((double) M_PI)) / -180.0)))) * t_3);
} else if ((angle_m / 180.0) <= 5e+193) {
tmp = 2.0 * (cos((((double) M_PI) * (angle_m * -0.005555555555555556))) * (t_2 * sin((0.005555555555555556 * (angle_m * ((double) M_PI))))));
} else if ((angle_m / 180.0) <= 5e+289) {
tmp = 2.0 * (sin(((angle_m / 180.0) * (cbrt(((double) M_PI)) * pow(cbrt(((double) M_PI)), 2.0)))) * t_3);
} else {
tmp = 2.0 * (sin(((angle_m / 180.0) * ((double) M_PI))) * (t_2 * fabs(cos(t_1))));
}
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 * (b_m - a_m));
double t_1 = Math.PI * (angle_m * 0.005555555555555556);
double t_2 = (b_m - a_m) * (b_m + a_m);
double t_3 = t_2 * Math.cos((angle_m * (Math.PI / -180.0)));
double tmp;
if ((angle_m / 180.0) <= 4e-30) {
tmp = ((b_m * t_0) + (a_m * t_0)) * 0.011111111111111112;
} else if ((angle_m / 180.0) <= 5e+60) {
tmp = 2.0 * (t_3 * Math.cbrt(Math.pow(Math.sin(t_1), 3.0)));
} else if ((angle_m / 180.0) <= 2e+134) {
tmp = 2.0 * (Math.log1p(Math.expm1(Math.sin(((angle_m * Math.PI) / -180.0)))) * t_3);
} else if ((angle_m / 180.0) <= 5e+193) {
tmp = 2.0 * (Math.cos((Math.PI * (angle_m * -0.005555555555555556))) * (t_2 * Math.sin((0.005555555555555556 * (angle_m * Math.PI)))));
} else if ((angle_m / 180.0) <= 5e+289) {
tmp = 2.0 * (Math.sin(((angle_m / 180.0) * (Math.cbrt(Math.PI) * Math.pow(Math.cbrt(Math.PI), 2.0)))) * t_3);
} else {
tmp = 2.0 * (Math.sin(((angle_m / 180.0) * Math.PI)) * (t_2 * Math.abs(Math.cos(t_1))));
}
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 * Float64(b_m - a_m))) t_1 = Float64(pi * Float64(angle_m * 0.005555555555555556)) t_2 = Float64(Float64(b_m - a_m) * Float64(b_m + a_m)) t_3 = Float64(t_2 * cos(Float64(angle_m * Float64(pi / -180.0)))) tmp = 0.0 if (Float64(angle_m / 180.0) <= 4e-30) tmp = Float64(Float64(Float64(b_m * t_0) + Float64(a_m * t_0)) * 0.011111111111111112); elseif (Float64(angle_m / 180.0) <= 5e+60) tmp = Float64(2.0 * Float64(t_3 * cbrt((sin(t_1) ^ 3.0)))); elseif (Float64(angle_m / 180.0) <= 2e+134) tmp = Float64(2.0 * Float64(log1p(expm1(sin(Float64(Float64(angle_m * pi) / -180.0)))) * t_3)); elseif (Float64(angle_m / 180.0) <= 5e+193) tmp = Float64(2.0 * Float64(cos(Float64(pi * Float64(angle_m * -0.005555555555555556))) * Float64(t_2 * sin(Float64(0.005555555555555556 * Float64(angle_m * pi)))))); elseif (Float64(angle_m / 180.0) <= 5e+289) tmp = Float64(2.0 * Float64(sin(Float64(Float64(angle_m / 180.0) * Float64(cbrt(pi) * (cbrt(pi) ^ 2.0)))) * t_3)); else tmp = Float64(2.0 * Float64(sin(Float64(Float64(angle_m / 180.0) * pi)) * Float64(t_2 * abs(cos(t_1))))); 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 * N[(b$95$m - a$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(Pi * N[(angle$95$m * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(b$95$m - a$95$m), $MachinePrecision] * N[(b$95$m + a$95$m), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(t$95$2 * N[Cos[N[(angle$95$m * N[(Pi / -180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, N[(angle$95$s * If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 4e-30], N[(N[(N[(b$95$m * t$95$0), $MachinePrecision] + N[(a$95$m * t$95$0), $MachinePrecision]), $MachinePrecision] * 0.011111111111111112), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 5e+60], N[(2.0 * N[(t$95$3 * N[Power[N[Power[N[Sin[t$95$1], $MachinePrecision], 3.0], $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 2e+134], N[(2.0 * N[(N[Log[1 + N[(Exp[N[Sin[N[(N[(angle$95$m * Pi), $MachinePrecision] / -180.0), $MachinePrecision]], $MachinePrecision]] - 1), $MachinePrecision]], $MachinePrecision] * t$95$3), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 5e+193], N[(2.0 * N[(N[Cos[N[(Pi * N[(angle$95$m * -0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(t$95$2 * N[Sin[N[(0.005555555555555556 * N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 5e+289], N[(2.0 * N[(N[Sin[N[(N[(angle$95$m / 180.0), $MachinePrecision] * N[(N[Power[Pi, 1/3], $MachinePrecision] * N[Power[N[Power[Pi, 1/3], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * t$95$3), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[Sin[N[(N[(angle$95$m / 180.0), $MachinePrecision] * Pi), $MachinePrecision]], $MachinePrecision] * N[(t$95$2 * N[Abs[N[Cos[t$95$1], $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 := \pi \cdot \left(angle_m \cdot \left(b_m - a_m\right)\right)\\
t_1 := \pi \cdot \left(angle_m \cdot 0.005555555555555556\right)\\
t_2 := \left(b_m - a_m\right) \cdot \left(b_m + a_m\right)\\
t_3 := t_2 \cdot \cos \left(angle_m \cdot \frac{\pi}{-180}\right)\\
angle_s \cdot \begin{array}{l}
\mathbf{if}\;\frac{angle_m}{180} \leq 4 \cdot 10^{-30}:\\
\;\;\;\;\left(b_m \cdot t_0 + a_m \cdot t_0\right) \cdot 0.011111111111111112\\
\mathbf{elif}\;\frac{angle_m}{180} \leq 5 \cdot 10^{+60}:\\
\;\;\;\;2 \cdot \left(t_3 \cdot \sqrt[3]{{\sin t_1}^{3}}\right)\\
\mathbf{elif}\;\frac{angle_m}{180} \leq 2 \cdot 10^{+134}:\\
\;\;\;\;2 \cdot \left(\mathsf{log1p}\left(\mathsf{expm1}\left(\sin \left(\frac{angle_m \cdot \pi}{-180}\right)\right)\right) \cdot t_3\right)\\
\mathbf{elif}\;\frac{angle_m}{180} \leq 5 \cdot 10^{+193}:\\
\;\;\;\;2 \cdot \left(\cos \left(\pi \cdot \left(angle_m \cdot -0.005555555555555556\right)\right) \cdot \left(t_2 \cdot \sin \left(0.005555555555555556 \cdot \left(angle_m \cdot \pi\right)\right)\right)\right)\\
\mathbf{elif}\;\frac{angle_m}{180} \leq 5 \cdot 10^{+289}:\\
\;\;\;\;2 \cdot \left(\sin \left(\frac{angle_m}{180} \cdot \left(\sqrt[3]{\pi} \cdot {\left(\sqrt[3]{\pi}\right)}^{2}\right)\right) \cdot t_3\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(\sin \left(\frac{angle_m}{180} \cdot \pi\right) \cdot \left(t_2 \cdot \left|\cos t_1\right|\right)\right)\\
\end{array}
\end{array}
\end{array}
if (/.f64 angle 180) < 4e-30Initial program 62.5%
associate-*l*62.5%
Simplified62.5%
Taylor expanded in angle around 0 59.4%
unpow259.4%
unpow259.4%
difference-of-squares63.8%
Applied egg-rr63.8%
Taylor expanded in angle around 0 63.8%
*-commutative63.8%
associate-*r*63.9%
*-commutative63.9%
associate-*l*63.8%
+-commutative63.8%
difference-of-squares59.4%
unpow259.4%
unpow259.4%
associate-*l*59.4%
*-commutative59.4%
unpow259.4%
unpow259.4%
difference-of-squares63.9%
*-commutative63.9%
+-commutative63.9%
Simplified63.9%
associate-*r*75.0%
+-commutative75.0%
distribute-lft-in71.0%
*-commutative71.0%
associate-*l*71.0%
*-commutative71.0%
associate-*l*71.1%
Applied egg-rr71.1%
if 4e-30 < (/.f64 angle 180) < 4.99999999999999975e60Initial program 70.6%
Simplified70.5%
unpow248.1%
unpow248.1%
difference-of-squares52.3%
Applied egg-rr74.7%
add-sqr-sqrt74.6%
sqrt-unprod74.7%
associate-*r/78.9%
associate-*r/78.1%
frac-times78.0%
metadata-eval78.0%
metadata-eval78.0%
frac-times78.1%
associate-*l/78.7%
associate-*l/70.3%
sqrt-unprod0.0%
add-sqr-sqrt22.8%
add-cbrt-cube22.8%
pow322.8%
Applied egg-rr75.3%
if 4.99999999999999975e60 < (/.f64 angle 180) < 1.99999999999999984e134Initial program 19.3%
Simplified20.6%
unpow231.3%
unpow231.3%
difference-of-squares31.3%
Applied egg-rr20.6%
add-sqr-sqrt28.5%
sqrt-unprod20.6%
associate-*r/20.7%
associate-*r/22.1%
frac-times21.0%
metadata-eval21.0%
metadata-eval21.0%
frac-times22.1%
associate-*l/20.0%
associate-*l/20.0%
sqrt-unprod0.0%
add-sqr-sqrt41.4%
log1p-expm1-u41.4%
add-sqr-sqrt0.0%
sqrt-unprod20.0%
Applied egg-rr20.6%
metadata-eval20.6%
div-inv20.6%
add-sqr-sqrt28.5%
sqrt-unprod20.6%
associate-*r/20.7%
associate-*r/22.1%
frac-times21.0%
metadata-eval21.0%
metadata-eval21.0%
frac-times22.1%
associate-*l/20.0%
associate-*l/20.0%
sqrt-unprod0.0%
add-sqr-sqrt41.4%
associate-*l/39.3%
Applied egg-rr39.3%
if 1.99999999999999984e134 < (/.f64 angle 180) < 4.99999999999999972e193Initial program 39.3%
Simplified44.8%
unpow237.3%
unpow237.3%
difference-of-squares37.3%
Applied egg-rr44.8%
Taylor expanded in angle around inf 46.4%
associate-*r*47.7%
associate-*r*46.4%
*-commutative46.4%
*-commutative46.4%
*-commutative46.4%
*-commutative46.4%
*-commutative46.4%
associate-*r*47.7%
Simplified47.7%
if 4.99999999999999972e193 < (/.f64 angle 180) < 5.00000000000000031e289Initial program 24.7%
Simplified30.5%
unpow225.5%
unpow225.5%
difference-of-squares25.5%
Applied egg-rr30.5%
add-cube-cbrt53.4%
pow253.4%
Applied egg-rr53.4%
if 5.00000000000000031e289 < (/.f64 angle 180) Initial program 22.4%
Simplified5.6%
unpow23.1%
unpow23.1%
difference-of-squares17.4%
Applied egg-rr5.6%
add-sqr-sqrt0.0%
sqrt-unprod0.0%
associate-*l/0.0%
associate-*l/0.0%
frac-times0.0%
metadata-eval0.0%
metadata-eval0.0%
frac-times0.0%
associate-*r/0.0%
associate-*r/0.0%
sqrt-unprod48.6%
add-sqr-sqrt22.4%
add-sqr-sqrt19.7%
sqrt-unprod37.2%
pow237.2%
Applied egg-rr37.2%
unpow237.2%
rem-sqrt-square37.2%
Simplified37.2%
Final simplification66.4%
a_m = (fabs.f64 a)
b_m = (fabs.f64 b)
angle_m = (fabs.f64 angle)
angle_s = (copysign.f64 1 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 (* t_0 (cos (* angle_m (/ PI -180.0)))))
(t_2 (* PI (* angle_m (- b_m a_m))))
(t_3 (sin (* (/ angle_m 180.0) (* (cbrt PI) (pow (cbrt PI) 2.0))))))
(*
angle_s
(if (<= (/ angle_m 180.0) 1e-14)
(* (+ (* b_m t_2) (* a_m t_2)) 0.011111111111111112)
(if (<= (/ angle_m 180.0) 1e+55)
(* (* 2.0 t_0) (* t_3 (cos (* (/ angle_m 180.0) PI))))
(if (<= (/ angle_m 180.0) 2e+134)
(* 2.0 (* (log1p (expm1 (sin (/ (* angle_m PI) -180.0)))) t_1))
(if (<= (/ angle_m 180.0) 2e+226)
(*
2.0
(*
t_1
(log1p
(expm1
(sin
(pow (sqrt (* PI (* angle_m 0.005555555555555556))) 2.0))))))
(*
2.0
(*
t_3
(*
t_0
(pow
(cbrt
(cos
(* (* angle_m 0.005555555555555556) (cbrt (pow PI 3.0)))))
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 = t_0 * cos((angle_m * (((double) M_PI) / -180.0)));
double t_2 = ((double) M_PI) * (angle_m * (b_m - a_m));
double t_3 = sin(((angle_m / 180.0) * (cbrt(((double) M_PI)) * pow(cbrt(((double) M_PI)), 2.0))));
double tmp;
if ((angle_m / 180.0) <= 1e-14) {
tmp = ((b_m * t_2) + (a_m * t_2)) * 0.011111111111111112;
} else if ((angle_m / 180.0) <= 1e+55) {
tmp = (2.0 * t_0) * (t_3 * cos(((angle_m / 180.0) * ((double) M_PI))));
} else if ((angle_m / 180.0) <= 2e+134) {
tmp = 2.0 * (log1p(expm1(sin(((angle_m * ((double) M_PI)) / -180.0)))) * t_1);
} else if ((angle_m / 180.0) <= 2e+226) {
tmp = 2.0 * (t_1 * log1p(expm1(sin(pow(sqrt((((double) M_PI) * (angle_m * 0.005555555555555556))), 2.0)))));
} else {
tmp = 2.0 * (t_3 * (t_0 * pow(cbrt(cos(((angle_m * 0.005555555555555556) * cbrt(pow(((double) M_PI), 3.0))))), 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 = t_0 * Math.cos((angle_m * (Math.PI / -180.0)));
double t_2 = Math.PI * (angle_m * (b_m - a_m));
double t_3 = Math.sin(((angle_m / 180.0) * (Math.cbrt(Math.PI) * Math.pow(Math.cbrt(Math.PI), 2.0))));
double tmp;
if ((angle_m / 180.0) <= 1e-14) {
tmp = ((b_m * t_2) + (a_m * t_2)) * 0.011111111111111112;
} else if ((angle_m / 180.0) <= 1e+55) {
tmp = (2.0 * t_0) * (t_3 * Math.cos(((angle_m / 180.0) * Math.PI)));
} else if ((angle_m / 180.0) <= 2e+134) {
tmp = 2.0 * (Math.log1p(Math.expm1(Math.sin(((angle_m * Math.PI) / -180.0)))) * t_1);
} else if ((angle_m / 180.0) <= 2e+226) {
tmp = 2.0 * (t_1 * Math.log1p(Math.expm1(Math.sin(Math.pow(Math.sqrt((Math.PI * (angle_m * 0.005555555555555556))), 2.0)))));
} else {
tmp = 2.0 * (t_3 * (t_0 * Math.pow(Math.cbrt(Math.cos(((angle_m * 0.005555555555555556) * Math.cbrt(Math.pow(Math.PI, 3.0))))), 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 = Float64(t_0 * cos(Float64(angle_m * Float64(pi / -180.0)))) t_2 = Float64(pi * Float64(angle_m * Float64(b_m - a_m))) t_3 = sin(Float64(Float64(angle_m / 180.0) * Float64(cbrt(pi) * (cbrt(pi) ^ 2.0)))) tmp = 0.0 if (Float64(angle_m / 180.0) <= 1e-14) tmp = Float64(Float64(Float64(b_m * t_2) + Float64(a_m * t_2)) * 0.011111111111111112); elseif (Float64(angle_m / 180.0) <= 1e+55) tmp = Float64(Float64(2.0 * t_0) * Float64(t_3 * cos(Float64(Float64(angle_m / 180.0) * pi)))); elseif (Float64(angle_m / 180.0) <= 2e+134) tmp = Float64(2.0 * Float64(log1p(expm1(sin(Float64(Float64(angle_m * pi) / -180.0)))) * t_1)); elseif (Float64(angle_m / 180.0) <= 2e+226) tmp = Float64(2.0 * Float64(t_1 * log1p(expm1(sin((sqrt(Float64(pi * Float64(angle_m * 0.005555555555555556))) ^ 2.0)))))); else tmp = Float64(2.0 * Float64(t_3 * Float64(t_0 * (cbrt(cos(Float64(Float64(angle_m * 0.005555555555555556) * cbrt((pi ^ 3.0))))) ^ 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[(t$95$0 * N[Cos[N[(angle$95$m * N[(Pi / -180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(Pi * N[(angle$95$m * N[(b$95$m - a$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[Sin[N[(N[(angle$95$m / 180.0), $MachinePrecision] * N[(N[Power[Pi, 1/3], $MachinePrecision] * N[Power[N[Power[Pi, 1/3], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, N[(angle$95$s * If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 1e-14], N[(N[(N[(b$95$m * t$95$2), $MachinePrecision] + N[(a$95$m * t$95$2), $MachinePrecision]), $MachinePrecision] * 0.011111111111111112), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 1e+55], N[(N[(2.0 * t$95$0), $MachinePrecision] * N[(t$95$3 * N[Cos[N[(N[(angle$95$m / 180.0), $MachinePrecision] * Pi), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 2e+134], N[(2.0 * N[(N[Log[1 + N[(Exp[N[Sin[N[(N[(angle$95$m * Pi), $MachinePrecision] / -180.0), $MachinePrecision]], $MachinePrecision]] - 1), $MachinePrecision]], $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 2e+226], N[(2.0 * N[(t$95$1 * N[Log[1 + N[(Exp[N[Sin[N[Power[N[Sqrt[N[(Pi * N[(angle$95$m * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], 2.0], $MachinePrecision]], $MachinePrecision]] - 1), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(t$95$3 * N[(t$95$0 * N[Power[N[Power[N[Cos[N[(N[(angle$95$m * 0.005555555555555556), $MachinePrecision] * N[Power[N[Power[Pi, 3.0], $MachinePrecision], 1/3], $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 := t_0 \cdot \cos \left(angle_m \cdot \frac{\pi}{-180}\right)\\
t_2 := \pi \cdot \left(angle_m \cdot \left(b_m - a_m\right)\right)\\
t_3 := \sin \left(\frac{angle_m}{180} \cdot \left(\sqrt[3]{\pi} \cdot {\left(\sqrt[3]{\pi}\right)}^{2}\right)\right)\\
angle_s \cdot \begin{array}{l}
\mathbf{if}\;\frac{angle_m}{180} \leq 10^{-14}:\\
\;\;\;\;\left(b_m \cdot t_2 + a_m \cdot t_2\right) \cdot 0.011111111111111112\\
\mathbf{elif}\;\frac{angle_m}{180} \leq 10^{+55}:\\
\;\;\;\;\left(2 \cdot t_0\right) \cdot \left(t_3 \cdot \cos \left(\frac{angle_m}{180} \cdot \pi\right)\right)\\
\mathbf{elif}\;\frac{angle_m}{180} \leq 2 \cdot 10^{+134}:\\
\;\;\;\;2 \cdot \left(\mathsf{log1p}\left(\mathsf{expm1}\left(\sin \left(\frac{angle_m \cdot \pi}{-180}\right)\right)\right) \cdot t_1\right)\\
\mathbf{elif}\;\frac{angle_m}{180} \leq 2 \cdot 10^{+226}:\\
\;\;\;\;2 \cdot \left(t_1 \cdot \mathsf{log1p}\left(\mathsf{expm1}\left(\sin \left({\left(\sqrt{\pi \cdot \left(angle_m \cdot 0.005555555555555556\right)}\right)}^{2}\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(t_3 \cdot \left(t_0 \cdot {\left(\sqrt[3]{\cos \left(\left(angle_m \cdot 0.005555555555555556\right) \cdot \sqrt[3]{{\pi}^{3}}\right)}\right)}^{3}\right)\right)\\
\end{array}
\end{array}
\end{array}
if (/.f64 angle 180) < 9.99999999999999999e-15Initial program 63.3%
associate-*l*63.3%
Simplified63.3%
Taylor expanded in angle around 0 60.2%
unpow260.2%
unpow260.2%
difference-of-squares64.6%
Applied egg-rr64.6%
Taylor expanded in angle around 0 64.6%
*-commutative64.6%
associate-*r*64.6%
*-commutative64.6%
associate-*l*64.6%
+-commutative64.6%
difference-of-squares60.2%
unpow260.2%
unpow260.2%
associate-*l*60.3%
*-commutative60.3%
unpow260.3%
unpow260.3%
difference-of-squares64.6%
*-commutative64.6%
+-commutative64.6%
Simplified64.6%
associate-*r*75.5%
+-commutative75.5%
distribute-lft-in71.6%
*-commutative71.6%
associate-*l*71.6%
*-commutative71.6%
associate-*l*71.7%
Applied egg-rr71.7%
if 9.99999999999999999e-15 < (/.f64 angle 180) < 1.00000000000000001e55Initial program 65.4%
associate-*l*65.4%
Simplified65.4%
unpow236.4%
unpow236.4%
difference-of-squares42.0%
Applied egg-rr71.0%
add-cube-cbrt77.3%
pow277.3%
Applied egg-rr77.4%
if 1.00000000000000001e55 < (/.f64 angle 180) < 1.99999999999999984e134Initial program 24.3%
Simplified25.4%
unpow233.7%
unpow233.7%
difference-of-squares33.7%
Applied egg-rr25.4%
add-sqr-sqrt31.2%
sqrt-unprod25.4%
associate-*r/25.5%
associate-*r/25.6%
frac-times24.7%
metadata-eval24.7%
metadata-eval24.7%
frac-times25.6%
associate-*l/24.8%
associate-*l/24.8%
sqrt-unprod0.0%
add-sqr-sqrt42.5%
log1p-expm1-u42.5%
add-sqr-sqrt0.0%
sqrt-unprod24.8%
Applied egg-rr25.4%
metadata-eval25.4%
div-inv25.4%
add-sqr-sqrt31.2%
sqrt-unprod25.4%
associate-*r/25.5%
associate-*r/25.6%
frac-times24.7%
metadata-eval24.7%
metadata-eval24.7%
frac-times25.6%
associate-*l/24.8%
associate-*l/24.8%
sqrt-unprod0.0%
add-sqr-sqrt42.5%
associate-*l/41.6%
Applied egg-rr41.6%
if 1.99999999999999984e134 < (/.f64 angle 180) < 1.99999999999999992e226Initial program 36.1%
Simplified40.4%
unpow234.6%
unpow234.6%
difference-of-squares34.6%
Applied egg-rr40.4%
add-sqr-sqrt49.6%
sqrt-unprod11.2%
associate-*r/11.2%
associate-*r/11.2%
frac-times11.2%
metadata-eval11.2%
metadata-eval11.2%
frac-times11.2%
associate-*l/11.2%
associate-*l/11.2%
sqrt-unprod0.0%
add-sqr-sqrt28.0%
log1p-expm1-u28.0%
add-sqr-sqrt0.0%
sqrt-unprod11.2%
Applied egg-rr40.4%
metadata-eval40.4%
div-inv40.4%
add-sqr-sqrt49.6%
sqrt-unprod11.2%
associate-*r/11.2%
associate-*r/11.2%
frac-times11.2%
metadata-eval11.2%
metadata-eval11.2%
frac-times11.2%
associate-*l/11.2%
associate-*l/11.2%
sqrt-unprod0.0%
pow20.0%
Applied egg-rr55.2%
if 1.99999999999999992e226 < (/.f64 angle 180) Initial program 23.8%
Simplified22.5%
unpow217.4%
unpow217.4%
difference-of-squares22.6%
Applied egg-rr22.5%
add-cube-cbrt35.7%
pow235.7%
Applied egg-rr35.7%
add-sqr-sqrt0.0%
sqrt-unprod0.0%
associate-*l/0.0%
associate-*l/0.0%
frac-times0.0%
metadata-eval0.0%
metadata-eval0.0%
frac-times0.0%
associate-*r/0.0%
associate-*r/0.0%
sqrt-unprod54.3%
add-sqr-sqrt36.1%
add-cube-cbrt36.1%
pow336.1%
Applied egg-rr30.8%
add-cbrt-cube49.1%
pow349.1%
Applied egg-rr49.1%
Final simplification67.4%
a_m = (fabs.f64 a)
b_m = (fabs.f64 b)
angle_m = (fabs.f64 angle)
angle_s = (copysign.f64 1 angle)
(FPCore (angle_s a_m b_m angle_m)
:precision binary64
(let* ((t_0 (* PI (* angle_m (- b_m a_m))))
(t_1 (* (- b_m a_m) (+ b_m a_m)))
(t_2 (* t_1 (cos (* angle_m (/ PI -180.0)))))
(t_3
(*
(* 2.0 t_1)
(*
(sin (* (/ angle_m 180.0) (* (cbrt PI) (pow (cbrt PI) 2.0))))
(cos (* (/ angle_m 180.0) PI))))))
(*
angle_s
(if (<= (/ angle_m 180.0) 1e-14)
(* (+ (* b_m t_0) (* a_m t_0)) 0.011111111111111112)
(if (<= (/ angle_m 180.0) 1e+55)
t_3
(if (<= (/ angle_m 180.0) 2e+134)
(* 2.0 (* (log1p (expm1 (sin (/ (* angle_m PI) -180.0)))) t_2))
(if (<= (/ angle_m 180.0) 4e+190)
(*
2.0
(*
t_2
(log1p
(expm1
(sin
(pow (sqrt (* PI (* angle_m 0.005555555555555556))) 2.0))))))
t_3)))))))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 * (b_m - a_m));
double t_1 = (b_m - a_m) * (b_m + a_m);
double t_2 = t_1 * cos((angle_m * (((double) M_PI) / -180.0)));
double t_3 = (2.0 * t_1) * (sin(((angle_m / 180.0) * (cbrt(((double) M_PI)) * pow(cbrt(((double) M_PI)), 2.0)))) * cos(((angle_m / 180.0) * ((double) M_PI))));
double tmp;
if ((angle_m / 180.0) <= 1e-14) {
tmp = ((b_m * t_0) + (a_m * t_0)) * 0.011111111111111112;
} else if ((angle_m / 180.0) <= 1e+55) {
tmp = t_3;
} else if ((angle_m / 180.0) <= 2e+134) {
tmp = 2.0 * (log1p(expm1(sin(((angle_m * ((double) M_PI)) / -180.0)))) * t_2);
} else if ((angle_m / 180.0) <= 4e+190) {
tmp = 2.0 * (t_2 * log1p(expm1(sin(pow(sqrt((((double) M_PI) * (angle_m * 0.005555555555555556))), 2.0)))));
} else {
tmp = t_3;
}
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 * (b_m - a_m));
double t_1 = (b_m - a_m) * (b_m + a_m);
double t_2 = t_1 * Math.cos((angle_m * (Math.PI / -180.0)));
double t_3 = (2.0 * t_1) * (Math.sin(((angle_m / 180.0) * (Math.cbrt(Math.PI) * Math.pow(Math.cbrt(Math.PI), 2.0)))) * Math.cos(((angle_m / 180.0) * Math.PI)));
double tmp;
if ((angle_m / 180.0) <= 1e-14) {
tmp = ((b_m * t_0) + (a_m * t_0)) * 0.011111111111111112;
} else if ((angle_m / 180.0) <= 1e+55) {
tmp = t_3;
} else if ((angle_m / 180.0) <= 2e+134) {
tmp = 2.0 * (Math.log1p(Math.expm1(Math.sin(((angle_m * Math.PI) / -180.0)))) * t_2);
} else if ((angle_m / 180.0) <= 4e+190) {
tmp = 2.0 * (t_2 * Math.log1p(Math.expm1(Math.sin(Math.pow(Math.sqrt((Math.PI * (angle_m * 0.005555555555555556))), 2.0)))));
} else {
tmp = t_3;
}
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 * Float64(b_m - a_m))) t_1 = Float64(Float64(b_m - a_m) * Float64(b_m + a_m)) t_2 = Float64(t_1 * cos(Float64(angle_m * Float64(pi / -180.0)))) t_3 = Float64(Float64(2.0 * t_1) * Float64(sin(Float64(Float64(angle_m / 180.0) * Float64(cbrt(pi) * (cbrt(pi) ^ 2.0)))) * cos(Float64(Float64(angle_m / 180.0) * pi)))) tmp = 0.0 if (Float64(angle_m / 180.0) <= 1e-14) tmp = Float64(Float64(Float64(b_m * t_0) + Float64(a_m * t_0)) * 0.011111111111111112); elseif (Float64(angle_m / 180.0) <= 1e+55) tmp = t_3; elseif (Float64(angle_m / 180.0) <= 2e+134) tmp = Float64(2.0 * Float64(log1p(expm1(sin(Float64(Float64(angle_m * pi) / -180.0)))) * t_2)); elseif (Float64(angle_m / 180.0) <= 4e+190) tmp = Float64(2.0 * Float64(t_2 * log1p(expm1(sin((sqrt(Float64(pi * Float64(angle_m * 0.005555555555555556))) ^ 2.0)))))); else tmp = t_3; 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 * N[(b$95$m - a$95$m), $MachinePrecision]), $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[(t$95$1 * N[Cos[N[(angle$95$m * N[(Pi / -180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(2.0 * t$95$1), $MachinePrecision] * N[(N[Sin[N[(N[(angle$95$m / 180.0), $MachinePrecision] * N[(N[Power[Pi, 1/3], $MachinePrecision] * N[Power[N[Power[Pi, 1/3], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(N[(angle$95$m / 180.0), $MachinePrecision] * Pi), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, N[(angle$95$s * If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 1e-14], N[(N[(N[(b$95$m * t$95$0), $MachinePrecision] + N[(a$95$m * t$95$0), $MachinePrecision]), $MachinePrecision] * 0.011111111111111112), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 1e+55], t$95$3, If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 2e+134], N[(2.0 * N[(N[Log[1 + N[(Exp[N[Sin[N[(N[(angle$95$m * Pi), $MachinePrecision] / -180.0), $MachinePrecision]], $MachinePrecision]] - 1), $MachinePrecision]], $MachinePrecision] * t$95$2), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 4e+190], N[(2.0 * N[(t$95$2 * N[Log[1 + N[(Exp[N[Sin[N[Power[N[Sqrt[N[(Pi * N[(angle$95$m * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], 2.0], $MachinePrecision]], $MachinePrecision]] - 1), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$3]]]]), $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 \left(b_m - a_m\right)\right)\\
t_1 := \left(b_m - a_m\right) \cdot \left(b_m + a_m\right)\\
t_2 := t_1 \cdot \cos \left(angle_m \cdot \frac{\pi}{-180}\right)\\
t_3 := \left(2 \cdot t_1\right) \cdot \left(\sin \left(\frac{angle_m}{180} \cdot \left(\sqrt[3]{\pi} \cdot {\left(\sqrt[3]{\pi}\right)}^{2}\right)\right) \cdot \cos \left(\frac{angle_m}{180} \cdot \pi\right)\right)\\
angle_s \cdot \begin{array}{l}
\mathbf{if}\;\frac{angle_m}{180} \leq 10^{-14}:\\
\;\;\;\;\left(b_m \cdot t_0 + a_m \cdot t_0\right) \cdot 0.011111111111111112\\
\mathbf{elif}\;\frac{angle_m}{180} \leq 10^{+55}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;\frac{angle_m}{180} \leq 2 \cdot 10^{+134}:\\
\;\;\;\;2 \cdot \left(\mathsf{log1p}\left(\mathsf{expm1}\left(\sin \left(\frac{angle_m \cdot \pi}{-180}\right)\right)\right) \cdot t_2\right)\\
\mathbf{elif}\;\frac{angle_m}{180} \leq 4 \cdot 10^{+190}:\\
\;\;\;\;2 \cdot \left(t_2 \cdot \mathsf{log1p}\left(\mathsf{expm1}\left(\sin \left({\left(\sqrt{\pi \cdot \left(angle_m \cdot 0.005555555555555556\right)}\right)}^{2}\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t_3\\
\end{array}
\end{array}
\end{array}
if (/.f64 angle 180) < 9.99999999999999999e-15Initial program 63.3%
associate-*l*63.3%
Simplified63.3%
Taylor expanded in angle around 0 60.2%
unpow260.2%
unpow260.2%
difference-of-squares64.6%
Applied egg-rr64.6%
Taylor expanded in angle around 0 64.6%
*-commutative64.6%
associate-*r*64.6%
*-commutative64.6%
associate-*l*64.6%
+-commutative64.6%
difference-of-squares60.2%
unpow260.2%
unpow260.2%
associate-*l*60.3%
*-commutative60.3%
unpow260.3%
unpow260.3%
difference-of-squares64.6%
*-commutative64.6%
+-commutative64.6%
Simplified64.6%
associate-*r*75.5%
+-commutative75.5%
distribute-lft-in71.6%
*-commutative71.6%
associate-*l*71.6%
*-commutative71.6%
associate-*l*71.7%
Applied egg-rr71.7%
if 9.99999999999999999e-15 < (/.f64 angle 180) < 1.00000000000000001e55 or 4.0000000000000003e190 < (/.f64 angle 180) Initial program 41.6%
associate-*l*41.6%
Simplified41.6%
unpow226.0%
unpow226.0%
difference-of-squares30.8%
Applied egg-rr44.0%
add-cube-cbrt54.0%
pow254.0%
Applied egg-rr54.7%
if 1.00000000000000001e55 < (/.f64 angle 180) < 1.99999999999999984e134Initial program 24.3%
Simplified25.4%
unpow233.7%
unpow233.7%
difference-of-squares33.7%
Applied egg-rr25.4%
add-sqr-sqrt31.2%
sqrt-unprod25.4%
associate-*r/25.5%
associate-*r/25.6%
frac-times24.7%
metadata-eval24.7%
metadata-eval24.7%
frac-times25.6%
associate-*l/24.8%
associate-*l/24.8%
sqrt-unprod0.0%
add-sqr-sqrt42.5%
log1p-expm1-u42.5%
add-sqr-sqrt0.0%
sqrt-unprod24.8%
Applied egg-rr25.4%
metadata-eval25.4%
div-inv25.4%
add-sqr-sqrt31.2%
sqrt-unprod25.4%
associate-*r/25.5%
associate-*r/25.6%
frac-times24.7%
metadata-eval24.7%
metadata-eval24.7%
frac-times25.6%
associate-*l/24.8%
associate-*l/24.8%
sqrt-unprod0.0%
add-sqr-sqrt42.5%
associate-*l/41.6%
Applied egg-rr41.6%
if 1.99999999999999984e134 < (/.f64 angle 180) < 4.0000000000000003e190Initial program 40.7%
Simplified48.3%
unpow239.6%
unpow239.6%
difference-of-squares39.6%
Applied egg-rr48.3%
add-sqr-sqrt51.9%
sqrt-unprod15.5%
associate-*r/15.5%
associate-*r/15.5%
frac-times15.5%
metadata-eval15.5%
metadata-eval15.5%
frac-times15.5%
associate-*l/15.5%
associate-*l/15.5%
sqrt-unprod0.0%
add-sqr-sqrt15.7%
log1p-expm1-u15.7%
add-sqr-sqrt0.0%
sqrt-unprod15.5%
Applied egg-rr48.3%
metadata-eval48.3%
div-inv48.3%
add-sqr-sqrt51.9%
sqrt-unprod15.5%
associate-*r/15.5%
associate-*r/15.5%
frac-times15.5%
metadata-eval15.5%
metadata-eval15.5%
frac-times15.5%
associate-*l/15.5%
associate-*l/15.5%
sqrt-unprod0.0%
pow20.0%
Applied egg-rr51.9%
Final simplification66.0%
a_m = (fabs.f64 a)
b_m = (fabs.f64 b)
angle_m = (fabs.f64 angle)
angle_s = (copysign.f64 1 angle)
(FPCore (angle_s a_m b_m angle_m)
:precision binary64
(let* ((t_0 (* PI (* angle_m (- b_m a_m))))
(t_1 (* (- b_m a_m) (+ b_m a_m)))
(t_2
(*
(* 2.0 t_1)
(*
(sin (* (/ angle_m 180.0) (* (cbrt PI) (pow (cbrt PI) 2.0))))
(cos (* (/ angle_m 180.0) PI))))))
(*
angle_s
(if (<= (/ angle_m 180.0) 1e-14)
(* (+ (* b_m t_0) (* a_m t_0)) 0.011111111111111112)
(if (<= (/ angle_m 180.0) 1e+55)
t_2
(if (<= (/ angle_m 180.0) 2e+134)
(*
2.0
(*
(log1p (expm1 (sin (/ (* angle_m PI) -180.0))))
(* t_1 (cos (* angle_m (/ PI -180.0))))))
(if (<= (/ angle_m 180.0) 5e+193)
(*
2.0
(*
(cos (* PI (* angle_m -0.005555555555555556)))
(* t_1 (sin (* 0.005555555555555556 (* angle_m PI))))))
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 = ((double) M_PI) * (angle_m * (b_m - a_m));
double t_1 = (b_m - a_m) * (b_m + a_m);
double t_2 = (2.0 * t_1) * (sin(((angle_m / 180.0) * (cbrt(((double) M_PI)) * pow(cbrt(((double) M_PI)), 2.0)))) * cos(((angle_m / 180.0) * ((double) M_PI))));
double tmp;
if ((angle_m / 180.0) <= 1e-14) {
tmp = ((b_m * t_0) + (a_m * t_0)) * 0.011111111111111112;
} else if ((angle_m / 180.0) <= 1e+55) {
tmp = t_2;
} else if ((angle_m / 180.0) <= 2e+134) {
tmp = 2.0 * (log1p(expm1(sin(((angle_m * ((double) M_PI)) / -180.0)))) * (t_1 * cos((angle_m * (((double) M_PI) / -180.0)))));
} else if ((angle_m / 180.0) <= 5e+193) {
tmp = 2.0 * (cos((((double) M_PI) * (angle_m * -0.005555555555555556))) * (t_1 * sin((0.005555555555555556 * (angle_m * ((double) M_PI))))));
} else {
tmp = 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 = Math.PI * (angle_m * (b_m - a_m));
double t_1 = (b_m - a_m) * (b_m + a_m);
double t_2 = (2.0 * t_1) * (Math.sin(((angle_m / 180.0) * (Math.cbrt(Math.PI) * Math.pow(Math.cbrt(Math.PI), 2.0)))) * Math.cos(((angle_m / 180.0) * Math.PI)));
double tmp;
if ((angle_m / 180.0) <= 1e-14) {
tmp = ((b_m * t_0) + (a_m * t_0)) * 0.011111111111111112;
} else if ((angle_m / 180.0) <= 1e+55) {
tmp = t_2;
} else if ((angle_m / 180.0) <= 2e+134) {
tmp = 2.0 * (Math.log1p(Math.expm1(Math.sin(((angle_m * Math.PI) / -180.0)))) * (t_1 * Math.cos((angle_m * (Math.PI / -180.0)))));
} else if ((angle_m / 180.0) <= 5e+193) {
tmp = 2.0 * (Math.cos((Math.PI * (angle_m * -0.005555555555555556))) * (t_1 * Math.sin((0.005555555555555556 * (angle_m * Math.PI)))));
} else {
tmp = 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(pi * Float64(angle_m * Float64(b_m - a_m))) t_1 = Float64(Float64(b_m - a_m) * Float64(b_m + a_m)) t_2 = Float64(Float64(2.0 * t_1) * Float64(sin(Float64(Float64(angle_m / 180.0) * Float64(cbrt(pi) * (cbrt(pi) ^ 2.0)))) * cos(Float64(Float64(angle_m / 180.0) * pi)))) tmp = 0.0 if (Float64(angle_m / 180.0) <= 1e-14) tmp = Float64(Float64(Float64(b_m * t_0) + Float64(a_m * t_0)) * 0.011111111111111112); elseif (Float64(angle_m / 180.0) <= 1e+55) tmp = t_2; elseif (Float64(angle_m / 180.0) <= 2e+134) tmp = Float64(2.0 * Float64(log1p(expm1(sin(Float64(Float64(angle_m * pi) / -180.0)))) * Float64(t_1 * cos(Float64(angle_m * Float64(pi / -180.0)))))); elseif (Float64(angle_m / 180.0) <= 5e+193) tmp = Float64(2.0 * Float64(cos(Float64(pi * Float64(angle_m * -0.005555555555555556))) * Float64(t_1 * sin(Float64(0.005555555555555556 * Float64(angle_m * pi)))))); else tmp = 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[(Pi * N[(angle$95$m * N[(b$95$m - a$95$m), $MachinePrecision]), $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[(N[(2.0 * t$95$1), $MachinePrecision] * N[(N[Sin[N[(N[(angle$95$m / 180.0), $MachinePrecision] * N[(N[Power[Pi, 1/3], $MachinePrecision] * N[Power[N[Power[Pi, 1/3], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(N[(angle$95$m / 180.0), $MachinePrecision] * Pi), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, N[(angle$95$s * If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 1e-14], N[(N[(N[(b$95$m * t$95$0), $MachinePrecision] + N[(a$95$m * t$95$0), $MachinePrecision]), $MachinePrecision] * 0.011111111111111112), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 1e+55], t$95$2, If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 2e+134], N[(2.0 * N[(N[Log[1 + N[(Exp[N[Sin[N[(N[(angle$95$m * Pi), $MachinePrecision] / -180.0), $MachinePrecision]], $MachinePrecision]] - 1), $MachinePrecision]], $MachinePrecision] * N[(t$95$1 * N[Cos[N[(angle$95$m * N[(Pi / -180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 5e+193], N[(2.0 * N[(N[Cos[N[(Pi * N[(angle$95$m * -0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(t$95$1 * N[Sin[N[(0.005555555555555556 * N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$2]]]]), $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 \left(b_m - a_m\right)\right)\\
t_1 := \left(b_m - a_m\right) \cdot \left(b_m + a_m\right)\\
t_2 := \left(2 \cdot t_1\right) \cdot \left(\sin \left(\frac{angle_m}{180} \cdot \left(\sqrt[3]{\pi} \cdot {\left(\sqrt[3]{\pi}\right)}^{2}\right)\right) \cdot \cos \left(\frac{angle_m}{180} \cdot \pi\right)\right)\\
angle_s \cdot \begin{array}{l}
\mathbf{if}\;\frac{angle_m}{180} \leq 10^{-14}:\\
\;\;\;\;\left(b_m \cdot t_0 + a_m \cdot t_0\right) \cdot 0.011111111111111112\\
\mathbf{elif}\;\frac{angle_m}{180} \leq 10^{+55}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;\frac{angle_m}{180} \leq 2 \cdot 10^{+134}:\\
\;\;\;\;2 \cdot \left(\mathsf{log1p}\left(\mathsf{expm1}\left(\sin \left(\frac{angle_m \cdot \pi}{-180}\right)\right)\right) \cdot \left(t_1 \cdot \cos \left(angle_m \cdot \frac{\pi}{-180}\right)\right)\right)\\
\mathbf{elif}\;\frac{angle_m}{180} \leq 5 \cdot 10^{+193}:\\
\;\;\;\;2 \cdot \left(\cos \left(\pi \cdot \left(angle_m \cdot -0.005555555555555556\right)\right) \cdot \left(t_1 \cdot \sin \left(0.005555555555555556 \cdot \left(angle_m \cdot \pi\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
\end{array}
if (/.f64 angle 180) < 9.99999999999999999e-15Initial program 63.3%
associate-*l*63.3%
Simplified63.3%
Taylor expanded in angle around 0 60.2%
unpow260.2%
unpow260.2%
difference-of-squares64.6%
Applied egg-rr64.6%
Taylor expanded in angle around 0 64.6%
*-commutative64.6%
associate-*r*64.6%
*-commutative64.6%
associate-*l*64.6%
+-commutative64.6%
difference-of-squares60.2%
unpow260.2%
unpow260.2%
associate-*l*60.3%
*-commutative60.3%
unpow260.3%
unpow260.3%
difference-of-squares64.6%
*-commutative64.6%
+-commutative64.6%
Simplified64.6%
associate-*r*75.5%
+-commutative75.5%
distribute-lft-in71.6%
*-commutative71.6%
associate-*l*71.6%
*-commutative71.6%
associate-*l*71.7%
Applied egg-rr71.7%
if 9.99999999999999999e-15 < (/.f64 angle 180) < 1.00000000000000001e55 or 4.99999999999999972e193 < (/.f64 angle 180) Initial program 42.2%
associate-*l*42.2%
Simplified42.2%
unpow226.5%
unpow226.5%
difference-of-squares31.4%
Applied egg-rr44.6%
add-cube-cbrt55.4%
pow255.4%
Applied egg-rr55.6%
if 1.00000000000000001e55 < (/.f64 angle 180) < 1.99999999999999984e134Initial program 24.3%
Simplified25.4%
unpow233.7%
unpow233.7%
difference-of-squares33.7%
Applied egg-rr25.4%
add-sqr-sqrt31.2%
sqrt-unprod25.4%
associate-*r/25.5%
associate-*r/25.6%
frac-times24.7%
metadata-eval24.7%
metadata-eval24.7%
frac-times25.6%
associate-*l/24.8%
associate-*l/24.8%
sqrt-unprod0.0%
add-sqr-sqrt42.5%
log1p-expm1-u42.5%
add-sqr-sqrt0.0%
sqrt-unprod24.8%
Applied egg-rr25.4%
metadata-eval25.4%
div-inv25.4%
add-sqr-sqrt31.2%
sqrt-unprod25.4%
associate-*r/25.5%
associate-*r/25.6%
frac-times24.7%
metadata-eval24.7%
metadata-eval24.7%
frac-times25.6%
associate-*l/24.8%
associate-*l/24.8%
sqrt-unprod0.0%
add-sqr-sqrt42.5%
associate-*l/41.6%
Applied egg-rr41.6%
if 1.99999999999999984e134 < (/.f64 angle 180) < 4.99999999999999972e193Initial program 39.3%
Simplified44.8%
unpow237.3%
unpow237.3%
difference-of-squares37.3%
Applied egg-rr44.8%
Taylor expanded in angle around inf 46.4%
associate-*r*47.7%
associate-*r*46.4%
*-commutative46.4%
*-commutative46.4%
*-commutative46.4%
*-commutative46.4%
*-commutative46.4%
associate-*r*47.7%
Simplified47.7%
Final simplification65.9%
a_m = (fabs.f64 a)
b_m = (fabs.f64 b)
angle_m = (fabs.f64 angle)
angle_s = (copysign.f64 1 angle)
(FPCore (angle_s a_m b_m angle_m)
:precision binary64
(let* ((t_0 (* (/ angle_m 180.0) PI))
(t_1 (sin t_0))
(t_2 (* (- b_m a_m) (+ b_m a_m)))
(t_3 (fabs t_2))
(t_4 (* PI (* angle_m (- b_m a_m))))
(t_5 (cos t_0)))
(*
angle_s
(if (<= (/ angle_m 180.0) 4e-30)
(* (+ (* b_m t_4) (* a_m t_4)) 0.011111111111111112)
(if (<= (/ angle_m 180.0) 4e+75)
(* (* 2.0 t_2) (* t_5 t_1))
(if (<= (/ angle_m 180.0) 5e+116)
(* 0.011111111111111112 (* angle_m (* PI t_3)))
(if (<= (/ angle_m 180.0) 5e+196)
(*
2.0
(*
(cos (* PI (* angle_m -0.005555555555555556)))
(* t_2 (sin (* 0.005555555555555556 (* angle_m PI))))))
(if (<= (/ angle_m 180.0) 1e+212)
(*
(sin (* angle_m (/ PI -180.0)))
(* 2.0 (fabs (- (pow a_m 2.0) (pow b_m 2.0)))))
(if (<= (/ angle_m 180.0) 1e+258)
(* t_5 (* t_1 (* 2.0 t_3)))
(*
2.0
(*
t_1
(*
t_2
(fabs
(cos (* 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 = sin(t_0);
double t_2 = (b_m - a_m) * (b_m + a_m);
double t_3 = fabs(t_2);
double t_4 = ((double) M_PI) * (angle_m * (b_m - a_m));
double t_5 = cos(t_0);
double tmp;
if ((angle_m / 180.0) <= 4e-30) {
tmp = ((b_m * t_4) + (a_m * t_4)) * 0.011111111111111112;
} else if ((angle_m / 180.0) <= 4e+75) {
tmp = (2.0 * t_2) * (t_5 * t_1);
} else if ((angle_m / 180.0) <= 5e+116) {
tmp = 0.011111111111111112 * (angle_m * (((double) M_PI) * t_3));
} else if ((angle_m / 180.0) <= 5e+196) {
tmp = 2.0 * (cos((((double) M_PI) * (angle_m * -0.005555555555555556))) * (t_2 * sin((0.005555555555555556 * (angle_m * ((double) M_PI))))));
} else if ((angle_m / 180.0) <= 1e+212) {
tmp = sin((angle_m * (((double) M_PI) / -180.0))) * (2.0 * fabs((pow(a_m, 2.0) - pow(b_m, 2.0))));
} else if ((angle_m / 180.0) <= 1e+258) {
tmp = t_5 * (t_1 * (2.0 * t_3));
} else {
tmp = 2.0 * (t_1 * (t_2 * fabs(cos((((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.sin(t_0);
double t_2 = (b_m - a_m) * (b_m + a_m);
double t_3 = Math.abs(t_2);
double t_4 = Math.PI * (angle_m * (b_m - a_m));
double t_5 = Math.cos(t_0);
double tmp;
if ((angle_m / 180.0) <= 4e-30) {
tmp = ((b_m * t_4) + (a_m * t_4)) * 0.011111111111111112;
} else if ((angle_m / 180.0) <= 4e+75) {
tmp = (2.0 * t_2) * (t_5 * t_1);
} else if ((angle_m / 180.0) <= 5e+116) {
tmp = 0.011111111111111112 * (angle_m * (Math.PI * t_3));
} else if ((angle_m / 180.0) <= 5e+196) {
tmp = 2.0 * (Math.cos((Math.PI * (angle_m * -0.005555555555555556))) * (t_2 * Math.sin((0.005555555555555556 * (angle_m * Math.PI)))));
} else if ((angle_m / 180.0) <= 1e+212) {
tmp = Math.sin((angle_m * (Math.PI / -180.0))) * (2.0 * Math.abs((Math.pow(a_m, 2.0) - Math.pow(b_m, 2.0))));
} else if ((angle_m / 180.0) <= 1e+258) {
tmp = t_5 * (t_1 * (2.0 * t_3));
} else {
tmp = 2.0 * (t_1 * (t_2 * Math.abs(Math.cos((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 / 180.0) * math.pi t_1 = math.sin(t_0) t_2 = (b_m - a_m) * (b_m + a_m) t_3 = math.fabs(t_2) t_4 = math.pi * (angle_m * (b_m - a_m)) t_5 = math.cos(t_0) tmp = 0 if (angle_m / 180.0) <= 4e-30: tmp = ((b_m * t_4) + (a_m * t_4)) * 0.011111111111111112 elif (angle_m / 180.0) <= 4e+75: tmp = (2.0 * t_2) * (t_5 * t_1) elif (angle_m / 180.0) <= 5e+116: tmp = 0.011111111111111112 * (angle_m * (math.pi * t_3)) elif (angle_m / 180.0) <= 5e+196: tmp = 2.0 * (math.cos((math.pi * (angle_m * -0.005555555555555556))) * (t_2 * math.sin((0.005555555555555556 * (angle_m * math.pi))))) elif (angle_m / 180.0) <= 1e+212: tmp = math.sin((angle_m * (math.pi / -180.0))) * (2.0 * math.fabs((math.pow(a_m, 2.0) - math.pow(b_m, 2.0)))) elif (angle_m / 180.0) <= 1e+258: tmp = t_5 * (t_1 * (2.0 * t_3)) else: tmp = 2.0 * (t_1 * (t_2 * math.fabs(math.cos((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 = sin(t_0) t_2 = Float64(Float64(b_m - a_m) * Float64(b_m + a_m)) t_3 = abs(t_2) t_4 = Float64(pi * Float64(angle_m * Float64(b_m - a_m))) t_5 = cos(t_0) tmp = 0.0 if (Float64(angle_m / 180.0) <= 4e-30) tmp = Float64(Float64(Float64(b_m * t_4) + Float64(a_m * t_4)) * 0.011111111111111112); elseif (Float64(angle_m / 180.0) <= 4e+75) tmp = Float64(Float64(2.0 * t_2) * Float64(t_5 * t_1)); elseif (Float64(angle_m / 180.0) <= 5e+116) tmp = Float64(0.011111111111111112 * Float64(angle_m * Float64(pi * t_3))); elseif (Float64(angle_m / 180.0) <= 5e+196) tmp = Float64(2.0 * Float64(cos(Float64(pi * Float64(angle_m * -0.005555555555555556))) * Float64(t_2 * sin(Float64(0.005555555555555556 * Float64(angle_m * pi)))))); elseif (Float64(angle_m / 180.0) <= 1e+212) tmp = Float64(sin(Float64(angle_m * Float64(pi / -180.0))) * Float64(2.0 * abs(Float64((a_m ^ 2.0) - (b_m ^ 2.0))))); elseif (Float64(angle_m / 180.0) <= 1e+258) tmp = Float64(t_5 * Float64(t_1 * Float64(2.0 * t_3))); else tmp = Float64(2.0 * Float64(t_1 * Float64(t_2 * abs(cos(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 / 180.0) * pi; t_1 = sin(t_0); t_2 = (b_m - a_m) * (b_m + a_m); t_3 = abs(t_2); t_4 = pi * (angle_m * (b_m - a_m)); t_5 = cos(t_0); tmp = 0.0; if ((angle_m / 180.0) <= 4e-30) tmp = ((b_m * t_4) + (a_m * t_4)) * 0.011111111111111112; elseif ((angle_m / 180.0) <= 4e+75) tmp = (2.0 * t_2) * (t_5 * t_1); elseif ((angle_m / 180.0) <= 5e+116) tmp = 0.011111111111111112 * (angle_m * (pi * t_3)); elseif ((angle_m / 180.0) <= 5e+196) tmp = 2.0 * (cos((pi * (angle_m * -0.005555555555555556))) * (t_2 * sin((0.005555555555555556 * (angle_m * pi))))); elseif ((angle_m / 180.0) <= 1e+212) tmp = sin((angle_m * (pi / -180.0))) * (2.0 * abs(((a_m ^ 2.0) - (b_m ^ 2.0)))); elseif ((angle_m / 180.0) <= 1e+258) tmp = t_5 * (t_1 * (2.0 * t_3)); else tmp = 2.0 * (t_1 * (t_2 * abs(cos((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[(angle$95$m / 180.0), $MachinePrecision] * Pi), $MachinePrecision]}, Block[{t$95$1 = N[Sin[t$95$0], $MachinePrecision]}, Block[{t$95$2 = N[(N[(b$95$m - a$95$m), $MachinePrecision] * N[(b$95$m + a$95$m), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[Abs[t$95$2], $MachinePrecision]}, Block[{t$95$4 = N[(Pi * N[(angle$95$m * N[(b$95$m - a$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$5 = N[Cos[t$95$0], $MachinePrecision]}, N[(angle$95$s * If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 4e-30], N[(N[(N[(b$95$m * t$95$4), $MachinePrecision] + N[(a$95$m * t$95$4), $MachinePrecision]), $MachinePrecision] * 0.011111111111111112), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 4e+75], N[(N[(2.0 * t$95$2), $MachinePrecision] * N[(t$95$5 * t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 5e+116], N[(0.011111111111111112 * N[(angle$95$m * N[(Pi * t$95$3), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 5e+196], N[(2.0 * N[(N[Cos[N[(Pi * N[(angle$95$m * -0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(t$95$2 * N[Sin[N[(0.005555555555555556 * N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 1e+212], N[(N[Sin[N[(angle$95$m * N[(Pi / -180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(2.0 * N[Abs[N[(N[Power[a$95$m, 2.0], $MachinePrecision] - N[Power[b$95$m, 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 1e+258], N[(t$95$5 * N[(t$95$1 * N[(2.0 * t$95$3), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(t$95$1 * N[(t$95$2 * N[Abs[N[Cos[N[(Pi * N[(angle$95$m * 0.005555555555555556), $MachinePrecision]), $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 := \frac{angle_m}{180} \cdot \pi\\
t_1 := \sin t_0\\
t_2 := \left(b_m - a_m\right) \cdot \left(b_m + a_m\right)\\
t_3 := \left|t_2\right|\\
t_4 := \pi \cdot \left(angle_m \cdot \left(b_m - a_m\right)\right)\\
t_5 := \cos t_0\\
angle_s \cdot \begin{array}{l}
\mathbf{if}\;\frac{angle_m}{180} \leq 4 \cdot 10^{-30}:\\
\;\;\;\;\left(b_m \cdot t_4 + a_m \cdot t_4\right) \cdot 0.011111111111111112\\
\mathbf{elif}\;\frac{angle_m}{180} \leq 4 \cdot 10^{+75}:\\
\;\;\;\;\left(2 \cdot t_2\right) \cdot \left(t_5 \cdot t_1\right)\\
\mathbf{elif}\;\frac{angle_m}{180} \leq 5 \cdot 10^{+116}:\\
\;\;\;\;0.011111111111111112 \cdot \left(angle_m \cdot \left(\pi \cdot t_3\right)\right)\\
\mathbf{elif}\;\frac{angle_m}{180} \leq 5 \cdot 10^{+196}:\\
\;\;\;\;2 \cdot \left(\cos \left(\pi \cdot \left(angle_m \cdot -0.005555555555555556\right)\right) \cdot \left(t_2 \cdot \sin \left(0.005555555555555556 \cdot \left(angle_m \cdot \pi\right)\right)\right)\right)\\
\mathbf{elif}\;\frac{angle_m}{180} \leq 10^{+212}:\\
\;\;\;\;\sin \left(angle_m \cdot \frac{\pi}{-180}\right) \cdot \left(2 \cdot \left|{a_m}^{2} - {b_m}^{2}\right|\right)\\
\mathbf{elif}\;\frac{angle_m}{180} \leq 10^{+258}:\\
\;\;\;\;t_5 \cdot \left(t_1 \cdot \left(2 \cdot t_3\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(t_1 \cdot \left(t_2 \cdot \left|\cos \left(\pi \cdot \left(angle_m \cdot 0.005555555555555556\right)\right)\right|\right)\right)\\
\end{array}
\end{array}
\end{array}
if (/.f64 angle 180) < 4e-30Initial program 62.5%
associate-*l*62.5%
Simplified62.5%
Taylor expanded in angle around 0 59.4%
unpow259.4%
unpow259.4%
difference-of-squares63.8%
Applied egg-rr63.8%
Taylor expanded in angle around 0 63.8%
*-commutative63.8%
associate-*r*63.9%
*-commutative63.9%
associate-*l*63.8%
+-commutative63.8%
difference-of-squares59.4%
unpow259.4%
unpow259.4%
associate-*l*59.4%
*-commutative59.4%
unpow259.4%
unpow259.4%
difference-of-squares63.9%
*-commutative63.9%
+-commutative63.9%
Simplified63.9%
associate-*r*75.0%
+-commutative75.0%
distribute-lft-in71.0%
*-commutative71.0%
associate-*l*71.0%
*-commutative71.0%
associate-*l*71.1%
Applied egg-rr71.1%
if 4e-30 < (/.f64 angle 180) < 3.99999999999999971e75Initial program 65.1%
associate-*l*65.1%
Simplified65.1%
unpow244.8%
unpow244.8%
difference-of-squares48.6%
Applied egg-rr69.0%
if 3.99999999999999971e75 < (/.f64 angle 180) < 5.00000000000000025e116Initial program 27.2%
associate-*l*27.2%
Simplified27.2%
Taylor expanded in angle around 0 39.6%
add-sqr-sqrt38.7%
sqrt-unprod52.5%
pow252.5%
Applied egg-rr52.5%
unpow252.5%
rem-sqrt-square51.5%
Simplified51.5%
unpow239.6%
unpow239.6%
difference-of-squares39.6%
Applied egg-rr51.5%
if 5.00000000000000025e116 < (/.f64 angle 180) < 4.9999999999999998e196Initial program 31.7%
Simplified35.9%
unpow233.4%
unpow233.4%
difference-of-squares33.4%
Applied egg-rr35.9%
Taylor expanded in angle around inf 42.2%
associate-*r*43.2%
associate-*r*37.0%
*-commutative37.0%
*-commutative37.0%
*-commutative37.0%
*-commutative37.0%
*-commutative37.0%
associate-*r*43.2%
Simplified43.2%
if 4.9999999999999998e196 < (/.f64 angle 180) < 9.9999999999999991e211Initial program 0.0%
Simplified0.0%
add-sqr-sqrt0.0%
sqrt-unprod100.0%
pow2100.0%
Applied egg-rr100.0%
unpow2100.0%
rem-sqrt-square100.0%
Simplified100.0%
Taylor expanded in angle around 0 100.0%
if 9.9999999999999991e211 < (/.f64 angle 180) < 1.00000000000000006e258Initial program 27.4%
add-sqr-sqrt0.1%
sqrt-unprod42.2%
pow242.2%
Applied egg-rr67.8%
unpow242.2%
rem-sqrt-square40.8%
Simplified71.2%
unpow20.8%
unpow20.8%
difference-of-squares0.8%
Applied egg-rr71.2%
if 1.00000000000000006e258 < (/.f64 angle 180) Initial program 25.9%
Simplified18.2%
unpow220.4%
unpow220.4%
difference-of-squares26.6%
Applied egg-rr18.2%
add-sqr-sqrt0.0%
sqrt-unprod0.0%
associate-*l/0.0%
associate-*l/0.0%
frac-times0.0%
metadata-eval0.0%
metadata-eval0.0%
frac-times0.0%
associate-*r/0.0%
associate-*r/0.0%
sqrt-unprod37.2%
add-sqr-sqrt25.9%
add-sqr-sqrt23.8%
sqrt-unprod31.4%
pow231.4%
Applied egg-rr31.4%
unpow231.4%
rem-sqrt-square31.4%
Simplified31.4%
Final simplification65.8%
a_m = (fabs.f64 a)
b_m = (fabs.f64 b)
angle_m = (fabs.f64 angle)
angle_s = (copysign.f64 1 angle)
(FPCore (angle_s a_m b_m angle_m)
:precision binary64
(let* ((t_0 (* PI (* angle_m (- b_m a_m))))
(t_1 (* (- b_m a_m) (+ b_m a_m)))
(t_2 (* t_1 (cos (* angle_m (/ PI -180.0))))))
(*
angle_s
(if (<= (/ angle_m 180.0) 2e-42)
(* (+ (* b_m t_0) (* a_m t_0)) 0.011111111111111112)
(if (<= (/ angle_m 180.0) 5e+60)
(* 2.0 (* t_2 (sin (* PI (* angle_m 0.005555555555555556)))))
(if (<= (/ angle_m 180.0) 2e+134)
(* 2.0 (* (log1p (expm1 (sin (/ (* angle_m PI) -180.0)))) t_2))
(*
2.0
(*
(cos (* PI (* angle_m -0.005555555555555556)))
(* t_1 (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 = ((double) M_PI) * (angle_m * (b_m - a_m));
double t_1 = (b_m - a_m) * (b_m + a_m);
double t_2 = t_1 * cos((angle_m * (((double) M_PI) / -180.0)));
double tmp;
if ((angle_m / 180.0) <= 2e-42) {
tmp = ((b_m * t_0) + (a_m * t_0)) * 0.011111111111111112;
} else if ((angle_m / 180.0) <= 5e+60) {
tmp = 2.0 * (t_2 * sin((((double) M_PI) * (angle_m * 0.005555555555555556))));
} else if ((angle_m / 180.0) <= 2e+134) {
tmp = 2.0 * (log1p(expm1(sin(((angle_m * ((double) M_PI)) / -180.0)))) * t_2);
} else {
tmp = 2.0 * (cos((((double) M_PI) * (angle_m * -0.005555555555555556))) * (t_1 * 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 = Math.PI * (angle_m * (b_m - a_m));
double t_1 = (b_m - a_m) * (b_m + a_m);
double t_2 = t_1 * Math.cos((angle_m * (Math.PI / -180.0)));
double tmp;
if ((angle_m / 180.0) <= 2e-42) {
tmp = ((b_m * t_0) + (a_m * t_0)) * 0.011111111111111112;
} else if ((angle_m / 180.0) <= 5e+60) {
tmp = 2.0 * (t_2 * Math.sin((Math.PI * (angle_m * 0.005555555555555556))));
} else if ((angle_m / 180.0) <= 2e+134) {
tmp = 2.0 * (Math.log1p(Math.expm1(Math.sin(((angle_m * Math.PI) / -180.0)))) * t_2);
} else {
tmp = 2.0 * (Math.cos((Math.PI * (angle_m * -0.005555555555555556))) * (t_1 * Math.sin((0.005555555555555556 * (angle_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): t_0 = math.pi * (angle_m * (b_m - a_m)) t_1 = (b_m - a_m) * (b_m + a_m) t_2 = t_1 * math.cos((angle_m * (math.pi / -180.0))) tmp = 0 if (angle_m / 180.0) <= 2e-42: tmp = ((b_m * t_0) + (a_m * t_0)) * 0.011111111111111112 elif (angle_m / 180.0) <= 5e+60: tmp = 2.0 * (t_2 * math.sin((math.pi * (angle_m * 0.005555555555555556)))) elif (angle_m / 180.0) <= 2e+134: tmp = 2.0 * (math.log1p(math.expm1(math.sin(((angle_m * math.pi) / -180.0)))) * t_2) else: tmp = 2.0 * (math.cos((math.pi * (angle_m * -0.005555555555555556))) * (t_1 * 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(pi * Float64(angle_m * Float64(b_m - a_m))) t_1 = Float64(Float64(b_m - a_m) * Float64(b_m + a_m)) t_2 = Float64(t_1 * cos(Float64(angle_m * Float64(pi / -180.0)))) tmp = 0.0 if (Float64(angle_m / 180.0) <= 2e-42) tmp = Float64(Float64(Float64(b_m * t_0) + Float64(a_m * t_0)) * 0.011111111111111112); elseif (Float64(angle_m / 180.0) <= 5e+60) tmp = Float64(2.0 * Float64(t_2 * sin(Float64(pi * Float64(angle_m * 0.005555555555555556))))); elseif (Float64(angle_m / 180.0) <= 2e+134) tmp = Float64(2.0 * Float64(log1p(expm1(sin(Float64(Float64(angle_m * pi) / -180.0)))) * t_2)); else tmp = Float64(2.0 * Float64(cos(Float64(pi * Float64(angle_m * -0.005555555555555556))) * Float64(t_1 * 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[(Pi * N[(angle$95$m * N[(b$95$m - a$95$m), $MachinePrecision]), $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[(t$95$1 * N[Cos[N[(angle$95$m * N[(Pi / -180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, N[(angle$95$s * If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 2e-42], N[(N[(N[(b$95$m * t$95$0), $MachinePrecision] + N[(a$95$m * t$95$0), $MachinePrecision]), $MachinePrecision] * 0.011111111111111112), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 5e+60], N[(2.0 * N[(t$95$2 * N[Sin[N[(Pi * N[(angle$95$m * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 2e+134], N[(2.0 * N[(N[Log[1 + N[(Exp[N[Sin[N[(N[(angle$95$m * Pi), $MachinePrecision] / -180.0), $MachinePrecision]], $MachinePrecision]] - 1), $MachinePrecision]], $MachinePrecision] * t$95$2), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[Cos[N[(Pi * N[(angle$95$m * -0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(t$95$1 * 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 := \pi \cdot \left(angle_m \cdot \left(b_m - a_m\right)\right)\\
t_1 := \left(b_m - a_m\right) \cdot \left(b_m + a_m\right)\\
t_2 := t_1 \cdot \cos \left(angle_m \cdot \frac{\pi}{-180}\right)\\
angle_s \cdot \begin{array}{l}
\mathbf{if}\;\frac{angle_m}{180} \leq 2 \cdot 10^{-42}:\\
\;\;\;\;\left(b_m \cdot t_0 + a_m \cdot t_0\right) \cdot 0.011111111111111112\\
\mathbf{elif}\;\frac{angle_m}{180} \leq 5 \cdot 10^{+60}:\\
\;\;\;\;2 \cdot \left(t_2 \cdot \sin \left(\pi \cdot \left(angle_m \cdot 0.005555555555555556\right)\right)\right)\\
\mathbf{elif}\;\frac{angle_m}{180} \leq 2 \cdot 10^{+134}:\\
\;\;\;\;2 \cdot \left(\mathsf{log1p}\left(\mathsf{expm1}\left(\sin \left(\frac{angle_m \cdot \pi}{-180}\right)\right)\right) \cdot t_2\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(\cos \left(\pi \cdot \left(angle_m \cdot -0.005555555555555556\right)\right) \cdot \left(t_1 \cdot \sin \left(0.005555555555555556 \cdot \left(angle_m \cdot \pi\right)\right)\right)\right)\\
\end{array}
\end{array}
\end{array}
if (/.f64 angle 180) < 2.00000000000000008e-42Initial program 61.9%
associate-*l*61.9%
Simplified61.9%
Taylor expanded in angle around 0 58.7%
unpow258.7%
unpow258.7%
difference-of-squares63.2%
Applied egg-rr63.2%
Taylor expanded in angle around 0 63.2%
*-commutative63.2%
associate-*r*63.3%
*-commutative63.3%
associate-*l*63.2%
+-commutative63.2%
difference-of-squares58.7%
unpow258.7%
unpow258.7%
associate-*l*58.7%
*-commutative58.7%
unpow258.7%
unpow258.7%
difference-of-squares63.3%
*-commutative63.3%
+-commutative63.3%
Simplified63.3%
associate-*r*74.6%
+-commutative74.6%
distribute-lft-in70.5%
*-commutative70.5%
associate-*l*70.5%
*-commutative70.5%
associate-*l*70.6%
Applied egg-rr70.6%
if 2.00000000000000008e-42 < (/.f64 angle 180) < 4.99999999999999975e60Initial program 73.8%
Simplified73.7%
unpow253.8%
unpow253.8%
difference-of-squares57.5%
Applied egg-rr77.4%
Taylor expanded in angle around inf 76.7%
associate-*r*78.0%
*-commutative78.0%
*-commutative78.0%
Simplified78.0%
if 4.99999999999999975e60 < (/.f64 angle 180) < 1.99999999999999984e134Initial program 19.3%
Simplified20.6%
unpow231.3%
unpow231.3%
difference-of-squares31.3%
Applied egg-rr20.6%
add-sqr-sqrt28.5%
sqrt-unprod20.6%
associate-*r/20.7%
associate-*r/22.1%
frac-times21.0%
metadata-eval21.0%
metadata-eval21.0%
frac-times22.1%
associate-*l/20.0%
associate-*l/20.0%
sqrt-unprod0.0%
add-sqr-sqrt41.4%
log1p-expm1-u41.4%
add-sqr-sqrt0.0%
sqrt-unprod20.0%
Applied egg-rr20.6%
metadata-eval20.6%
div-inv20.6%
add-sqr-sqrt28.5%
sqrt-unprod20.6%
associate-*r/20.7%
associate-*r/22.1%
frac-times21.0%
metadata-eval21.0%
metadata-eval21.0%
frac-times22.1%
associate-*l/20.0%
associate-*l/20.0%
sqrt-unprod0.0%
add-sqr-sqrt41.4%
associate-*l/39.3%
Applied egg-rr39.3%
if 1.99999999999999984e134 < (/.f64 angle 180) Initial program 29.8%
Simplified31.2%
unpow225.8%
unpow225.8%
difference-of-squares28.5%
Applied egg-rr31.2%
Taylor expanded in angle around inf 34.2%
associate-*r*38.0%
associate-*r*32.1%
*-commutative32.1%
*-commutative32.1%
*-commutative32.1%
*-commutative32.1%
*-commutative32.1%
associate-*r*38.0%
Simplified38.0%
Final simplification64.9%
a_m = (fabs.f64 a)
b_m = (fabs.f64 b)
angle_m = (fabs.f64 angle)
angle_s = (copysign.f64 1 angle)
(FPCore (angle_s a_m b_m angle_m)
:precision binary64
(let* ((t_0 (* PI (* angle_m (- b_m a_m))))
(t_1 (* (- b_m a_m) (+ b_m a_m)))
(t_2 (* t_1 (cos (* angle_m (/ PI -180.0))))))
(*
angle_s
(if (<= (/ angle_m 180.0) 4e-30)
(* (+ (* b_m t_0) (* a_m t_0)) 0.011111111111111112)
(if (<= (/ angle_m 180.0) 5e+60)
(*
2.0
(*
t_2
(cbrt (pow (sin (* PI (* angle_m 0.005555555555555556))) 3.0))))
(if (<= (/ angle_m 180.0) 2e+134)
(* 2.0 (* (log1p (expm1 (sin (/ (* angle_m PI) -180.0)))) t_2))
(*
2.0
(*
(cos (* PI (* angle_m -0.005555555555555556)))
(* t_1 (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 = ((double) M_PI) * (angle_m * (b_m - a_m));
double t_1 = (b_m - a_m) * (b_m + a_m);
double t_2 = t_1 * cos((angle_m * (((double) M_PI) / -180.0)));
double tmp;
if ((angle_m / 180.0) <= 4e-30) {
tmp = ((b_m * t_0) + (a_m * t_0)) * 0.011111111111111112;
} else if ((angle_m / 180.0) <= 5e+60) {
tmp = 2.0 * (t_2 * cbrt(pow(sin((((double) M_PI) * (angle_m * 0.005555555555555556))), 3.0)));
} else if ((angle_m / 180.0) <= 2e+134) {
tmp = 2.0 * (log1p(expm1(sin(((angle_m * ((double) M_PI)) / -180.0)))) * t_2);
} else {
tmp = 2.0 * (cos((((double) M_PI) * (angle_m * -0.005555555555555556))) * (t_1 * 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 = Math.PI * (angle_m * (b_m - a_m));
double t_1 = (b_m - a_m) * (b_m + a_m);
double t_2 = t_1 * Math.cos((angle_m * (Math.PI / -180.0)));
double tmp;
if ((angle_m / 180.0) <= 4e-30) {
tmp = ((b_m * t_0) + (a_m * t_0)) * 0.011111111111111112;
} else if ((angle_m / 180.0) <= 5e+60) {
tmp = 2.0 * (t_2 * Math.cbrt(Math.pow(Math.sin((Math.PI * (angle_m * 0.005555555555555556))), 3.0)));
} else if ((angle_m / 180.0) <= 2e+134) {
tmp = 2.0 * (Math.log1p(Math.expm1(Math.sin(((angle_m * Math.PI) / -180.0)))) * t_2);
} else {
tmp = 2.0 * (Math.cos((Math.PI * (angle_m * -0.005555555555555556))) * (t_1 * 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(pi * Float64(angle_m * Float64(b_m - a_m))) t_1 = Float64(Float64(b_m - a_m) * Float64(b_m + a_m)) t_2 = Float64(t_1 * cos(Float64(angle_m * Float64(pi / -180.0)))) tmp = 0.0 if (Float64(angle_m / 180.0) <= 4e-30) tmp = Float64(Float64(Float64(b_m * t_0) + Float64(a_m * t_0)) * 0.011111111111111112); elseif (Float64(angle_m / 180.0) <= 5e+60) tmp = Float64(2.0 * Float64(t_2 * cbrt((sin(Float64(pi * Float64(angle_m * 0.005555555555555556))) ^ 3.0)))); elseif (Float64(angle_m / 180.0) <= 2e+134) tmp = Float64(2.0 * Float64(log1p(expm1(sin(Float64(Float64(angle_m * pi) / -180.0)))) * t_2)); else tmp = Float64(2.0 * Float64(cos(Float64(pi * Float64(angle_m * -0.005555555555555556))) * Float64(t_1 * 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[(Pi * N[(angle$95$m * N[(b$95$m - a$95$m), $MachinePrecision]), $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[(t$95$1 * N[Cos[N[(angle$95$m * N[(Pi / -180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, N[(angle$95$s * If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 4e-30], N[(N[(N[(b$95$m * t$95$0), $MachinePrecision] + N[(a$95$m * t$95$0), $MachinePrecision]), $MachinePrecision] * 0.011111111111111112), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 5e+60], N[(2.0 * N[(t$95$2 * N[Power[N[Power[N[Sin[N[(Pi * N[(angle$95$m * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], 3.0], $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 2e+134], N[(2.0 * N[(N[Log[1 + N[(Exp[N[Sin[N[(N[(angle$95$m * Pi), $MachinePrecision] / -180.0), $MachinePrecision]], $MachinePrecision]] - 1), $MachinePrecision]], $MachinePrecision] * t$95$2), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[Cos[N[(Pi * N[(angle$95$m * -0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(t$95$1 * 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 := \pi \cdot \left(angle_m \cdot \left(b_m - a_m\right)\right)\\
t_1 := \left(b_m - a_m\right) \cdot \left(b_m + a_m\right)\\
t_2 := t_1 \cdot \cos \left(angle_m \cdot \frac{\pi}{-180}\right)\\
angle_s \cdot \begin{array}{l}
\mathbf{if}\;\frac{angle_m}{180} \leq 4 \cdot 10^{-30}:\\
\;\;\;\;\left(b_m \cdot t_0 + a_m \cdot t_0\right) \cdot 0.011111111111111112\\
\mathbf{elif}\;\frac{angle_m}{180} \leq 5 \cdot 10^{+60}:\\
\;\;\;\;2 \cdot \left(t_2 \cdot \sqrt[3]{{\sin \left(\pi \cdot \left(angle_m \cdot 0.005555555555555556\right)\right)}^{3}}\right)\\
\mathbf{elif}\;\frac{angle_m}{180} \leq 2 \cdot 10^{+134}:\\
\;\;\;\;2 \cdot \left(\mathsf{log1p}\left(\mathsf{expm1}\left(\sin \left(\frac{angle_m \cdot \pi}{-180}\right)\right)\right) \cdot t_2\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(\cos \left(\pi \cdot \left(angle_m \cdot -0.005555555555555556\right)\right) \cdot \left(t_1 \cdot \sin \left(0.005555555555555556 \cdot \left(angle_m \cdot \pi\right)\right)\right)\right)\\
\end{array}
\end{array}
\end{array}
if (/.f64 angle 180) < 4e-30Initial program 62.5%
associate-*l*62.5%
Simplified62.5%
Taylor expanded in angle around 0 59.4%
unpow259.4%
unpow259.4%
difference-of-squares63.8%
Applied egg-rr63.8%
Taylor expanded in angle around 0 63.8%
*-commutative63.8%
associate-*r*63.9%
*-commutative63.9%
associate-*l*63.8%
+-commutative63.8%
difference-of-squares59.4%
unpow259.4%
unpow259.4%
associate-*l*59.4%
*-commutative59.4%
unpow259.4%
unpow259.4%
difference-of-squares63.9%
*-commutative63.9%
+-commutative63.9%
Simplified63.9%
associate-*r*75.0%
+-commutative75.0%
distribute-lft-in71.0%
*-commutative71.0%
associate-*l*71.0%
*-commutative71.0%
associate-*l*71.1%
Applied egg-rr71.1%
if 4e-30 < (/.f64 angle 180) < 4.99999999999999975e60Initial program 70.6%
Simplified70.5%
unpow248.1%
unpow248.1%
difference-of-squares52.3%
Applied egg-rr74.7%
add-sqr-sqrt74.6%
sqrt-unprod74.7%
associate-*r/78.9%
associate-*r/78.1%
frac-times78.0%
metadata-eval78.0%
metadata-eval78.0%
frac-times78.1%
associate-*l/78.7%
associate-*l/70.3%
sqrt-unprod0.0%
add-sqr-sqrt22.8%
add-cbrt-cube22.8%
pow322.8%
Applied egg-rr75.3%
if 4.99999999999999975e60 < (/.f64 angle 180) < 1.99999999999999984e134Initial program 19.3%
Simplified20.6%
unpow231.3%
unpow231.3%
difference-of-squares31.3%
Applied egg-rr20.6%
add-sqr-sqrt28.5%
sqrt-unprod20.6%
associate-*r/20.7%
associate-*r/22.1%
frac-times21.0%
metadata-eval21.0%
metadata-eval21.0%
frac-times22.1%
associate-*l/20.0%
associate-*l/20.0%
sqrt-unprod0.0%
add-sqr-sqrt41.4%
log1p-expm1-u41.4%
add-sqr-sqrt0.0%
sqrt-unprod20.0%
Applied egg-rr20.6%
metadata-eval20.6%
div-inv20.6%
add-sqr-sqrt28.5%
sqrt-unprod20.6%
associate-*r/20.7%
associate-*r/22.1%
frac-times21.0%
metadata-eval21.0%
metadata-eval21.0%
frac-times22.1%
associate-*l/20.0%
associate-*l/20.0%
sqrt-unprod0.0%
add-sqr-sqrt41.4%
associate-*l/39.3%
Applied egg-rr39.3%
if 1.99999999999999984e134 < (/.f64 angle 180) Initial program 29.8%
Simplified31.2%
unpow225.8%
unpow225.8%
difference-of-squares28.5%
Applied egg-rr31.2%
Taylor expanded in angle around inf 34.2%
associate-*r*38.0%
associate-*r*32.1%
*-commutative32.1%
*-commutative32.1%
*-commutative32.1%
*-commutative32.1%
*-commutative32.1%
associate-*r*38.0%
Simplified38.0%
Final simplification64.9%
a_m = (fabs.f64 a)
b_m = (fabs.f64 b)
angle_m = (fabs.f64 angle)
angle_s = (copysign.f64 1 angle)
(FPCore (angle_s a_m b_m angle_m)
:precision binary64
(let* ((t_0 (* PI (* angle_m (- b_m a_m))))
(t_1 (* PI (* angle_m 0.005555555555555556)))
(t_2 (sin t_1))
(t_3 (* (- b_m a_m) (+ b_m a_m)))
(t_4 (* angle_m (* PI -0.005555555555555556))))
(*
angle_s
(if (<= (/ angle_m 180.0) 2e-42)
(* (+ (* b_m t_0) (* a_m t_0)) 0.011111111111111112)
(if (<= (/ angle_m 180.0) 5e+60)
(* 2.0 (* (* t_3 (cos (* angle_m (/ PI -180.0)))) t_2))
(if (<= (/ angle_m 180.0) 5e+84)
(* 2.0 (* (* (cos t_4) (- (pow b_m 2.0) (pow a_m 2.0))) (sin t_4)))
(if (<= (/ angle_m 180.0) 1e+140)
(* 2.0 (* t_3 (expm1 (log1p t_2))))
(if (<= (/ angle_m 180.0) 2e+226)
(*
2.0
(*
(cos (* PI (* angle_m -0.005555555555555556)))
(* t_3 (sin (* 0.005555555555555556 (* angle_m PI))))))
(*
2.0
(*
(sin (* (/ angle_m 180.0) PI))
(* t_3 (fabs (cos t_1)))))))))))))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 * (b_m - a_m));
double t_1 = ((double) M_PI) * (angle_m * 0.005555555555555556);
double t_2 = sin(t_1);
double t_3 = (b_m - a_m) * (b_m + a_m);
double t_4 = angle_m * (((double) M_PI) * -0.005555555555555556);
double tmp;
if ((angle_m / 180.0) <= 2e-42) {
tmp = ((b_m * t_0) + (a_m * t_0)) * 0.011111111111111112;
} else if ((angle_m / 180.0) <= 5e+60) {
tmp = 2.0 * ((t_3 * cos((angle_m * (((double) M_PI) / -180.0)))) * t_2);
} else if ((angle_m / 180.0) <= 5e+84) {
tmp = 2.0 * ((cos(t_4) * (pow(b_m, 2.0) - pow(a_m, 2.0))) * sin(t_4));
} else if ((angle_m / 180.0) <= 1e+140) {
tmp = 2.0 * (t_3 * expm1(log1p(t_2)));
} else if ((angle_m / 180.0) <= 2e+226) {
tmp = 2.0 * (cos((((double) M_PI) * (angle_m * -0.005555555555555556))) * (t_3 * sin((0.005555555555555556 * (angle_m * ((double) M_PI))))));
} else {
tmp = 2.0 * (sin(((angle_m / 180.0) * ((double) M_PI))) * (t_3 * fabs(cos(t_1))));
}
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 * (b_m - a_m));
double t_1 = Math.PI * (angle_m * 0.005555555555555556);
double t_2 = Math.sin(t_1);
double t_3 = (b_m - a_m) * (b_m + a_m);
double t_4 = angle_m * (Math.PI * -0.005555555555555556);
double tmp;
if ((angle_m / 180.0) <= 2e-42) {
tmp = ((b_m * t_0) + (a_m * t_0)) * 0.011111111111111112;
} else if ((angle_m / 180.0) <= 5e+60) {
tmp = 2.0 * ((t_3 * Math.cos((angle_m * (Math.PI / -180.0)))) * t_2);
} else if ((angle_m / 180.0) <= 5e+84) {
tmp = 2.0 * ((Math.cos(t_4) * (Math.pow(b_m, 2.0) - Math.pow(a_m, 2.0))) * Math.sin(t_4));
} else if ((angle_m / 180.0) <= 1e+140) {
tmp = 2.0 * (t_3 * Math.expm1(Math.log1p(t_2)));
} else if ((angle_m / 180.0) <= 2e+226) {
tmp = 2.0 * (Math.cos((Math.PI * (angle_m * -0.005555555555555556))) * (t_3 * Math.sin((0.005555555555555556 * (angle_m * Math.PI)))));
} else {
tmp = 2.0 * (Math.sin(((angle_m / 180.0) * Math.PI)) * (t_3 * Math.abs(Math.cos(t_1))));
}
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 = math.pi * (angle_m * (b_m - a_m)) t_1 = math.pi * (angle_m * 0.005555555555555556) t_2 = math.sin(t_1) t_3 = (b_m - a_m) * (b_m + a_m) t_4 = angle_m * (math.pi * -0.005555555555555556) tmp = 0 if (angle_m / 180.0) <= 2e-42: tmp = ((b_m * t_0) + (a_m * t_0)) * 0.011111111111111112 elif (angle_m / 180.0) <= 5e+60: tmp = 2.0 * ((t_3 * math.cos((angle_m * (math.pi / -180.0)))) * t_2) elif (angle_m / 180.0) <= 5e+84: tmp = 2.0 * ((math.cos(t_4) * (math.pow(b_m, 2.0) - math.pow(a_m, 2.0))) * math.sin(t_4)) elif (angle_m / 180.0) <= 1e+140: tmp = 2.0 * (t_3 * math.expm1(math.log1p(t_2))) elif (angle_m / 180.0) <= 2e+226: tmp = 2.0 * (math.cos((math.pi * (angle_m * -0.005555555555555556))) * (t_3 * math.sin((0.005555555555555556 * (angle_m * math.pi))))) else: tmp = 2.0 * (math.sin(((angle_m / 180.0) * math.pi)) * (t_3 * math.fabs(math.cos(t_1)))) 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 * Float64(b_m - a_m))) t_1 = Float64(pi * Float64(angle_m * 0.005555555555555556)) t_2 = sin(t_1) t_3 = Float64(Float64(b_m - a_m) * Float64(b_m + a_m)) t_4 = Float64(angle_m * Float64(pi * -0.005555555555555556)) tmp = 0.0 if (Float64(angle_m / 180.0) <= 2e-42) tmp = Float64(Float64(Float64(b_m * t_0) + Float64(a_m * t_0)) * 0.011111111111111112); elseif (Float64(angle_m / 180.0) <= 5e+60) tmp = Float64(2.0 * Float64(Float64(t_3 * cos(Float64(angle_m * Float64(pi / -180.0)))) * t_2)); elseif (Float64(angle_m / 180.0) <= 5e+84) tmp = Float64(2.0 * Float64(Float64(cos(t_4) * Float64((b_m ^ 2.0) - (a_m ^ 2.0))) * sin(t_4))); elseif (Float64(angle_m / 180.0) <= 1e+140) tmp = Float64(2.0 * Float64(t_3 * expm1(log1p(t_2)))); elseif (Float64(angle_m / 180.0) <= 2e+226) tmp = Float64(2.0 * Float64(cos(Float64(pi * Float64(angle_m * -0.005555555555555556))) * Float64(t_3 * sin(Float64(0.005555555555555556 * Float64(angle_m * pi)))))); else tmp = Float64(2.0 * Float64(sin(Float64(Float64(angle_m / 180.0) * pi)) * Float64(t_3 * abs(cos(t_1))))); 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 * N[(b$95$m - a$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(Pi * N[(angle$95$m * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Sin[t$95$1], $MachinePrecision]}, Block[{t$95$3 = N[(N[(b$95$m - a$95$m), $MachinePrecision] * N[(b$95$m + a$95$m), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(angle$95$m * N[(Pi * -0.005555555555555556), $MachinePrecision]), $MachinePrecision]}, N[(angle$95$s * If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 2e-42], N[(N[(N[(b$95$m * t$95$0), $MachinePrecision] + N[(a$95$m * t$95$0), $MachinePrecision]), $MachinePrecision] * 0.011111111111111112), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 5e+60], N[(2.0 * N[(N[(t$95$3 * N[Cos[N[(angle$95$m * N[(Pi / -180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * t$95$2), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 5e+84], N[(2.0 * N[(N[(N[Cos[t$95$4], $MachinePrecision] * N[(N[Power[b$95$m, 2.0], $MachinePrecision] - N[Power[a$95$m, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sin[t$95$4], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 1e+140], N[(2.0 * N[(t$95$3 * N[(Exp[N[Log[1 + t$95$2], $MachinePrecision]] - 1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 2e+226], N[(2.0 * N[(N[Cos[N[(Pi * N[(angle$95$m * -0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(t$95$3 * N[Sin[N[(0.005555555555555556 * N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[Sin[N[(N[(angle$95$m / 180.0), $MachinePrecision] * Pi), $MachinePrecision]], $MachinePrecision] * N[(t$95$3 * N[Abs[N[Cos[t$95$1], $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 := \pi \cdot \left(angle_m \cdot \left(b_m - a_m\right)\right)\\
t_1 := \pi \cdot \left(angle_m \cdot 0.005555555555555556\right)\\
t_2 := \sin t_1\\
t_3 := \left(b_m - a_m\right) \cdot \left(b_m + a_m\right)\\
t_4 := angle_m \cdot \left(\pi \cdot -0.005555555555555556\right)\\
angle_s \cdot \begin{array}{l}
\mathbf{if}\;\frac{angle_m}{180} \leq 2 \cdot 10^{-42}:\\
\;\;\;\;\left(b_m \cdot t_0 + a_m \cdot t_0\right) \cdot 0.011111111111111112\\
\mathbf{elif}\;\frac{angle_m}{180} \leq 5 \cdot 10^{+60}:\\
\;\;\;\;2 \cdot \left(\left(t_3 \cdot \cos \left(angle_m \cdot \frac{\pi}{-180}\right)\right) \cdot t_2\right)\\
\mathbf{elif}\;\frac{angle_m}{180} \leq 5 \cdot 10^{+84}:\\
\;\;\;\;2 \cdot \left(\left(\cos t_4 \cdot \left({b_m}^{2} - {a_m}^{2}\right)\right) \cdot \sin t_4\right)\\
\mathbf{elif}\;\frac{angle_m}{180} \leq 10^{+140}:\\
\;\;\;\;2 \cdot \left(t_3 \cdot \mathsf{expm1}\left(\mathsf{log1p}\left(t_2\right)\right)\right)\\
\mathbf{elif}\;\frac{angle_m}{180} \leq 2 \cdot 10^{+226}:\\
\;\;\;\;2 \cdot \left(\cos \left(\pi \cdot \left(angle_m \cdot -0.005555555555555556\right)\right) \cdot \left(t_3 \cdot \sin \left(0.005555555555555556 \cdot \left(angle_m \cdot \pi\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(\sin \left(\frac{angle_m}{180} \cdot \pi\right) \cdot \left(t_3 \cdot \left|\cos t_1\right|\right)\right)\\
\end{array}
\end{array}
\end{array}
if (/.f64 angle 180) < 2.00000000000000008e-42Initial program 61.9%
associate-*l*61.9%
Simplified61.9%
Taylor expanded in angle around 0 58.7%
unpow258.7%
unpow258.7%
difference-of-squares63.2%
Applied egg-rr63.2%
Taylor expanded in angle around 0 63.2%
*-commutative63.2%
associate-*r*63.3%
*-commutative63.3%
associate-*l*63.2%
+-commutative63.2%
difference-of-squares58.7%
unpow258.7%
unpow258.7%
associate-*l*58.7%
*-commutative58.7%
unpow258.7%
unpow258.7%
difference-of-squares63.3%
*-commutative63.3%
+-commutative63.3%
Simplified63.3%
associate-*r*74.6%
+-commutative74.6%
distribute-lft-in70.5%
*-commutative70.5%
associate-*l*70.5%
*-commutative70.5%
associate-*l*70.6%
Applied egg-rr70.6%
if 2.00000000000000008e-42 < (/.f64 angle 180) < 4.99999999999999975e60Initial program 73.8%
Simplified73.7%
unpow253.8%
unpow253.8%
difference-of-squares57.5%
Applied egg-rr77.4%
Taylor expanded in angle around inf 76.7%
associate-*r*78.0%
*-commutative78.0%
*-commutative78.0%
Simplified78.0%
if 4.99999999999999975e60 < (/.f64 angle 180) < 5.0000000000000001e84Initial program 0.0%
Simplified0.0%
unpow23.3%
unpow23.3%
difference-of-squares3.3%
Applied egg-rr0.0%
add-cube-cbrt33.4%
pow233.4%
Applied egg-rr33.4%
add-sqr-sqrt0.0%
sqrt-unprod33.4%
associate-*l/33.4%
associate-*l/5.5%
frac-times38.8%
metadata-eval38.8%
metadata-eval38.8%
frac-times5.5%
associate-*r/33.4%
associate-*r/33.4%
sqrt-unprod38.8%
add-sqr-sqrt33.4%
add-cube-cbrt33.4%
pow333.4%
Applied egg-rr33.4%
Applied egg-rr0.0%
exp-sum0.0%
rem-exp-log6.4%
rem-exp-log73.1%
Simplified73.1%
if 5.0000000000000001e84 < (/.f64 angle 180) < 1.00000000000000006e140Initial program 28.6%
Simplified30.0%
unpow241.0%
unpow241.0%
difference-of-squares41.0%
Applied egg-rr30.0%
add-sqr-sqrt38.2%
sqrt-unprod30.0%
associate-*r/30.1%
associate-*r/30.1%
frac-times28.9%
metadata-eval28.9%
metadata-eval28.9%
frac-times30.1%
associate-*l/29.3%
associate-*l/29.3%
sqrt-unprod0.0%
add-sqr-sqrt37.2%
expm1-log1p-u37.2%
add-sqr-sqrt0.0%
sqrt-unprod29.3%
Applied egg-rr30.0%
Taylor expanded in angle around 0 39.7%
if 1.00000000000000006e140 < (/.f64 angle 180) < 1.99999999999999992e226Initial program 34.3%
Simplified39.2%
unpow232.4%
unpow232.4%
difference-of-squares32.4%
Applied egg-rr39.2%
Taylor expanded in angle around inf 46.8%
associate-*r*47.9%
associate-*r*40.5%
*-commutative40.5%
*-commutative40.5%
*-commutative40.5%
*-commutative40.5%
*-commutative40.5%
associate-*r*47.9%
Simplified47.9%
if 1.99999999999999992e226 < (/.f64 angle 180) Initial program 23.8%
Simplified22.5%
unpow217.4%
unpow217.4%
difference-of-squares22.6%
Applied egg-rr22.5%
add-sqr-sqrt0.0%
sqrt-unprod0.0%
associate-*l/0.0%
associate-*l/0.0%
frac-times0.0%
metadata-eval0.0%
metadata-eval0.0%
frac-times0.0%
associate-*r/0.0%
associate-*r/0.0%
sqrt-unprod38.5%
add-sqr-sqrt23.8%
add-sqr-sqrt20.0%
sqrt-unprod33.2%
pow233.2%
Applied egg-rr33.2%
unpow233.2%
rem-sqrt-square33.2%
Simplified33.2%
Final simplification65.6%
a_m = (fabs.f64 a)
b_m = (fabs.f64 b)
angle_m = (fabs.f64 angle)
angle_s = (copysign.f64 1 angle)
(FPCore (angle_s a_m b_m angle_m)
:precision binary64
(let* ((t_0 (* PI (* angle_m 0.005555555555555556)))
(t_1 (sin t_0))
(t_2 (* (- b_m a_m) (+ b_m a_m)))
(t_3 (* PI (* angle_m (- b_m a_m))))
(t_4 (cos (* angle_m (/ PI -180.0)))))
(*
angle_s
(if (<= (/ angle_m 180.0) 2e-42)
(* (+ (* b_m t_3) (* a_m t_3)) 0.011111111111111112)
(if (<= (/ angle_m 180.0) 5e+60)
(* 2.0 (* (* t_2 t_4) t_1))
(if (<= (/ angle_m 180.0) 5e+84)
(* t_4 (* (- (pow a_m 2.0) (pow b_m 2.0)) (* 2.0 t_1)))
(if (<= (/ angle_m 180.0) 1e+140)
(* 2.0 (* t_2 (expm1 (log1p t_1))))
(if (<= (/ angle_m 180.0) 2e+226)
(*
2.0
(*
(cos (* PI (* angle_m -0.005555555555555556)))
(* t_2 (sin (* 0.005555555555555556 (* angle_m PI))))))
(*
2.0
(*
(sin (* (/ angle_m 180.0) PI))
(* t_2 (fabs (cos 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 = sin(t_0);
double t_2 = (b_m - a_m) * (b_m + a_m);
double t_3 = ((double) M_PI) * (angle_m * (b_m - a_m));
double t_4 = cos((angle_m * (((double) M_PI) / -180.0)));
double tmp;
if ((angle_m / 180.0) <= 2e-42) {
tmp = ((b_m * t_3) + (a_m * t_3)) * 0.011111111111111112;
} else if ((angle_m / 180.0) <= 5e+60) {
tmp = 2.0 * ((t_2 * t_4) * t_1);
} else if ((angle_m / 180.0) <= 5e+84) {
tmp = t_4 * ((pow(a_m, 2.0) - pow(b_m, 2.0)) * (2.0 * t_1));
} else if ((angle_m / 180.0) <= 1e+140) {
tmp = 2.0 * (t_2 * expm1(log1p(t_1)));
} else if ((angle_m / 180.0) <= 2e+226) {
tmp = 2.0 * (cos((((double) M_PI) * (angle_m * -0.005555555555555556))) * (t_2 * sin((0.005555555555555556 * (angle_m * ((double) M_PI))))));
} else {
tmp = 2.0 * (sin(((angle_m / 180.0) * ((double) M_PI))) * (t_2 * fabs(cos(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 = Math.sin(t_0);
double t_2 = (b_m - a_m) * (b_m + a_m);
double t_3 = Math.PI * (angle_m * (b_m - a_m));
double t_4 = Math.cos((angle_m * (Math.PI / -180.0)));
double tmp;
if ((angle_m / 180.0) <= 2e-42) {
tmp = ((b_m * t_3) + (a_m * t_3)) * 0.011111111111111112;
} else if ((angle_m / 180.0) <= 5e+60) {
tmp = 2.0 * ((t_2 * t_4) * t_1);
} else if ((angle_m / 180.0) <= 5e+84) {
tmp = t_4 * ((Math.pow(a_m, 2.0) - Math.pow(b_m, 2.0)) * (2.0 * t_1));
} else if ((angle_m / 180.0) <= 1e+140) {
tmp = 2.0 * (t_2 * Math.expm1(Math.log1p(t_1)));
} else if ((angle_m / 180.0) <= 2e+226) {
tmp = 2.0 * (Math.cos((Math.PI * (angle_m * -0.005555555555555556))) * (t_2 * Math.sin((0.005555555555555556 * (angle_m * Math.PI)))));
} else {
tmp = 2.0 * (Math.sin(((angle_m / 180.0) * Math.PI)) * (t_2 * Math.abs(Math.cos(t_0))));
}
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 = math.pi * (angle_m * 0.005555555555555556) t_1 = math.sin(t_0) t_2 = (b_m - a_m) * (b_m + a_m) t_3 = math.pi * (angle_m * (b_m - a_m)) t_4 = math.cos((angle_m * (math.pi / -180.0))) tmp = 0 if (angle_m / 180.0) <= 2e-42: tmp = ((b_m * t_3) + (a_m * t_3)) * 0.011111111111111112 elif (angle_m / 180.0) <= 5e+60: tmp = 2.0 * ((t_2 * t_4) * t_1) elif (angle_m / 180.0) <= 5e+84: tmp = t_4 * ((math.pow(a_m, 2.0) - math.pow(b_m, 2.0)) * (2.0 * t_1)) elif (angle_m / 180.0) <= 1e+140: tmp = 2.0 * (t_2 * math.expm1(math.log1p(t_1))) elif (angle_m / 180.0) <= 2e+226: tmp = 2.0 * (math.cos((math.pi * (angle_m * -0.005555555555555556))) * (t_2 * math.sin((0.005555555555555556 * (angle_m * math.pi))))) else: tmp = 2.0 * (math.sin(((angle_m / 180.0) * math.pi)) * (t_2 * math.fabs(math.cos(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 = sin(t_0) t_2 = Float64(Float64(b_m - a_m) * Float64(b_m + a_m)) t_3 = Float64(pi * Float64(angle_m * Float64(b_m - a_m))) t_4 = cos(Float64(angle_m * Float64(pi / -180.0))) tmp = 0.0 if (Float64(angle_m / 180.0) <= 2e-42) tmp = Float64(Float64(Float64(b_m * t_3) + Float64(a_m * t_3)) * 0.011111111111111112); elseif (Float64(angle_m / 180.0) <= 5e+60) tmp = Float64(2.0 * Float64(Float64(t_2 * t_4) * t_1)); elseif (Float64(angle_m / 180.0) <= 5e+84) tmp = Float64(t_4 * Float64(Float64((a_m ^ 2.0) - (b_m ^ 2.0)) * Float64(2.0 * t_1))); elseif (Float64(angle_m / 180.0) <= 1e+140) tmp = Float64(2.0 * Float64(t_2 * expm1(log1p(t_1)))); elseif (Float64(angle_m / 180.0) <= 2e+226) tmp = Float64(2.0 * Float64(cos(Float64(pi * Float64(angle_m * -0.005555555555555556))) * Float64(t_2 * sin(Float64(0.005555555555555556 * Float64(angle_m * pi)))))); else tmp = Float64(2.0 * Float64(sin(Float64(Float64(angle_m / 180.0) * pi)) * Float64(t_2 * abs(cos(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[Sin[t$95$0], $MachinePrecision]}, Block[{t$95$2 = N[(N[(b$95$m - a$95$m), $MachinePrecision] * N[(b$95$m + a$95$m), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(Pi * N[(angle$95$m * N[(b$95$m - a$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[Cos[N[(angle$95$m * N[(Pi / -180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, N[(angle$95$s * If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 2e-42], N[(N[(N[(b$95$m * t$95$3), $MachinePrecision] + N[(a$95$m * t$95$3), $MachinePrecision]), $MachinePrecision] * 0.011111111111111112), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 5e+60], N[(2.0 * N[(N[(t$95$2 * t$95$4), $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 5e+84], N[(t$95$4 * N[(N[(N[Power[a$95$m, 2.0], $MachinePrecision] - N[Power[b$95$m, 2.0], $MachinePrecision]), $MachinePrecision] * N[(2.0 * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 1e+140], N[(2.0 * N[(t$95$2 * N[(Exp[N[Log[1 + t$95$1], $MachinePrecision]] - 1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 2e+226], N[(2.0 * N[(N[Cos[N[(Pi * N[(angle$95$m * -0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(t$95$2 * N[Sin[N[(0.005555555555555556 * N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[Sin[N[(N[(angle$95$m / 180.0), $MachinePrecision] * Pi), $MachinePrecision]], $MachinePrecision] * N[(t$95$2 * N[Abs[N[Cos[t$95$0], $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 := \pi \cdot \left(angle_m \cdot 0.005555555555555556\right)\\
t_1 := \sin t_0\\
t_2 := \left(b_m - a_m\right) \cdot \left(b_m + a_m\right)\\
t_3 := \pi \cdot \left(angle_m \cdot \left(b_m - a_m\right)\right)\\
t_4 := \cos \left(angle_m \cdot \frac{\pi}{-180}\right)\\
angle_s \cdot \begin{array}{l}
\mathbf{if}\;\frac{angle_m}{180} \leq 2 \cdot 10^{-42}:\\
\;\;\;\;\left(b_m \cdot t_3 + a_m \cdot t_3\right) \cdot 0.011111111111111112\\
\mathbf{elif}\;\frac{angle_m}{180} \leq 5 \cdot 10^{+60}:\\
\;\;\;\;2 \cdot \left(\left(t_2 \cdot t_4\right) \cdot t_1\right)\\
\mathbf{elif}\;\frac{angle_m}{180} \leq 5 \cdot 10^{+84}:\\
\;\;\;\;t_4 \cdot \left(\left({a_m}^{2} - {b_m}^{2}\right) \cdot \left(2 \cdot t_1\right)\right)\\
\mathbf{elif}\;\frac{angle_m}{180} \leq 10^{+140}:\\
\;\;\;\;2 \cdot \left(t_2 \cdot \mathsf{expm1}\left(\mathsf{log1p}\left(t_1\right)\right)\right)\\
\mathbf{elif}\;\frac{angle_m}{180} \leq 2 \cdot 10^{+226}:\\
\;\;\;\;2 \cdot \left(\cos \left(\pi \cdot \left(angle_m \cdot -0.005555555555555556\right)\right) \cdot \left(t_2 \cdot \sin \left(0.005555555555555556 \cdot \left(angle_m \cdot \pi\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(\sin \left(\frac{angle_m}{180} \cdot \pi\right) \cdot \left(t_2 \cdot \left|\cos t_0\right|\right)\right)\\
\end{array}
\end{array}
\end{array}
if (/.f64 angle 180) < 2.00000000000000008e-42Initial program 61.9%
associate-*l*61.9%
Simplified61.9%
Taylor expanded in angle around 0 58.7%
unpow258.7%
unpow258.7%
difference-of-squares63.2%
Applied egg-rr63.2%
Taylor expanded in angle around 0 63.2%
*-commutative63.2%
associate-*r*63.3%
*-commutative63.3%
associate-*l*63.2%
+-commutative63.2%
difference-of-squares58.7%
unpow258.7%
unpow258.7%
associate-*l*58.7%
*-commutative58.7%
unpow258.7%
unpow258.7%
difference-of-squares63.3%
*-commutative63.3%
+-commutative63.3%
Simplified63.3%
associate-*r*74.6%
+-commutative74.6%
distribute-lft-in70.5%
*-commutative70.5%
associate-*l*70.5%
*-commutative70.5%
associate-*l*70.6%
Applied egg-rr70.6%
if 2.00000000000000008e-42 < (/.f64 angle 180) < 4.99999999999999975e60Initial program 73.8%
Simplified73.7%
unpow253.8%
unpow253.8%
difference-of-squares57.5%
Applied egg-rr77.4%
Taylor expanded in angle around inf 76.7%
associate-*r*78.0%
*-commutative78.0%
*-commutative78.0%
Simplified78.0%
if 4.99999999999999975e60 < (/.f64 angle 180) < 5.0000000000000001e84Initial program 0.0%
Simplified0.0%
associate-*r*0.0%
sub-neg0.0%
distribute-lft-in0.0%
Applied egg-rr73.1%
distribute-lft-out73.1%
sub-neg73.1%
*-commutative73.1%
*-commutative73.1%
Simplified73.1%
if 5.0000000000000001e84 < (/.f64 angle 180) < 1.00000000000000006e140Initial program 28.6%
Simplified30.0%
unpow241.0%
unpow241.0%
difference-of-squares41.0%
Applied egg-rr30.0%
add-sqr-sqrt38.2%
sqrt-unprod30.0%
associate-*r/30.1%
associate-*r/30.1%
frac-times28.9%
metadata-eval28.9%
metadata-eval28.9%
frac-times30.1%
associate-*l/29.3%
associate-*l/29.3%
sqrt-unprod0.0%
add-sqr-sqrt37.2%
expm1-log1p-u37.2%
add-sqr-sqrt0.0%
sqrt-unprod29.3%
Applied egg-rr30.0%
Taylor expanded in angle around 0 39.7%
if 1.00000000000000006e140 < (/.f64 angle 180) < 1.99999999999999992e226Initial program 34.3%
Simplified39.2%
unpow232.4%
unpow232.4%
difference-of-squares32.4%
Applied egg-rr39.2%
Taylor expanded in angle around inf 46.8%
associate-*r*47.9%
associate-*r*40.5%
*-commutative40.5%
*-commutative40.5%
*-commutative40.5%
*-commutative40.5%
*-commutative40.5%
associate-*r*47.9%
Simplified47.9%
if 1.99999999999999992e226 < (/.f64 angle 180) Initial program 23.8%
Simplified22.5%
unpow217.4%
unpow217.4%
difference-of-squares22.6%
Applied egg-rr22.5%
add-sqr-sqrt0.0%
sqrt-unprod0.0%
associate-*l/0.0%
associate-*l/0.0%
frac-times0.0%
metadata-eval0.0%
metadata-eval0.0%
frac-times0.0%
associate-*r/0.0%
associate-*r/0.0%
sqrt-unprod38.5%
add-sqr-sqrt23.8%
add-sqr-sqrt20.0%
sqrt-unprod33.2%
pow233.2%
Applied egg-rr33.2%
unpow233.2%
rem-sqrt-square33.2%
Simplified33.2%
Final simplification65.6%
a_m = (fabs.f64 a)
b_m = (fabs.f64 b)
angle_m = (fabs.f64 angle)
angle_s = (copysign.f64 1 angle)
(FPCore (angle_s a_m b_m angle_m)
:precision binary64
(let* ((t_0 (* PI (* angle_m (- b_m a_m))))
(t_1 (* (/ angle_m 180.0) PI))
(t_2 (sin t_1))
(t_3 (* (- b_m a_m) (+ b_m a_m))))
(*
angle_s
(if (<= (/ angle_m 180.0) 4e-30)
(* (+ (* b_m t_0) (* a_m t_0)) 0.011111111111111112)
(if (<= (/ angle_m 180.0) 4e+75)
(* (* 2.0 t_3) (* (cos t_1) t_2))
(if (<= (/ angle_m 180.0) 5e+116)
(* 0.011111111111111112 (* angle_m (* PI (fabs t_3))))
(if (<= (/ angle_m 180.0) 1e+258)
(*
2.0
(*
(cos (* PI (* angle_m -0.005555555555555556)))
(* t_3 (sin (* 0.005555555555555556 (* angle_m PI))))))
(*
2.0
(*
t_2
(*
t_3
(fabs (cos (* 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 = ((double) M_PI) * (angle_m * (b_m - a_m));
double t_1 = (angle_m / 180.0) * ((double) M_PI);
double t_2 = sin(t_1);
double t_3 = (b_m - a_m) * (b_m + a_m);
double tmp;
if ((angle_m / 180.0) <= 4e-30) {
tmp = ((b_m * t_0) + (a_m * t_0)) * 0.011111111111111112;
} else if ((angle_m / 180.0) <= 4e+75) {
tmp = (2.0 * t_3) * (cos(t_1) * t_2);
} else if ((angle_m / 180.0) <= 5e+116) {
tmp = 0.011111111111111112 * (angle_m * (((double) M_PI) * fabs(t_3)));
} else if ((angle_m / 180.0) <= 1e+258) {
tmp = 2.0 * (cos((((double) M_PI) * (angle_m * -0.005555555555555556))) * (t_3 * sin((0.005555555555555556 * (angle_m * ((double) M_PI))))));
} else {
tmp = 2.0 * (t_2 * (t_3 * fabs(cos((((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 = Math.PI * (angle_m * (b_m - a_m));
double t_1 = (angle_m / 180.0) * Math.PI;
double t_2 = Math.sin(t_1);
double t_3 = (b_m - a_m) * (b_m + a_m);
double tmp;
if ((angle_m / 180.0) <= 4e-30) {
tmp = ((b_m * t_0) + (a_m * t_0)) * 0.011111111111111112;
} else if ((angle_m / 180.0) <= 4e+75) {
tmp = (2.0 * t_3) * (Math.cos(t_1) * t_2);
} else if ((angle_m / 180.0) <= 5e+116) {
tmp = 0.011111111111111112 * (angle_m * (Math.PI * Math.abs(t_3)));
} else if ((angle_m / 180.0) <= 1e+258) {
tmp = 2.0 * (Math.cos((Math.PI * (angle_m * -0.005555555555555556))) * (t_3 * Math.sin((0.005555555555555556 * (angle_m * Math.PI)))));
} else {
tmp = 2.0 * (t_2 * (t_3 * Math.abs(Math.cos((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 = math.pi * (angle_m * (b_m - a_m)) t_1 = (angle_m / 180.0) * math.pi t_2 = math.sin(t_1) t_3 = (b_m - a_m) * (b_m + a_m) tmp = 0 if (angle_m / 180.0) <= 4e-30: tmp = ((b_m * t_0) + (a_m * t_0)) * 0.011111111111111112 elif (angle_m / 180.0) <= 4e+75: tmp = (2.0 * t_3) * (math.cos(t_1) * t_2) elif (angle_m / 180.0) <= 5e+116: tmp = 0.011111111111111112 * (angle_m * (math.pi * math.fabs(t_3))) elif (angle_m / 180.0) <= 1e+258: tmp = 2.0 * (math.cos((math.pi * (angle_m * -0.005555555555555556))) * (t_3 * math.sin((0.005555555555555556 * (angle_m * math.pi))))) else: tmp = 2.0 * (t_2 * (t_3 * math.fabs(math.cos((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(pi * Float64(angle_m * Float64(b_m - a_m))) t_1 = Float64(Float64(angle_m / 180.0) * pi) t_2 = sin(t_1) t_3 = Float64(Float64(b_m - a_m) * Float64(b_m + a_m)) tmp = 0.0 if (Float64(angle_m / 180.0) <= 4e-30) tmp = Float64(Float64(Float64(b_m * t_0) + Float64(a_m * t_0)) * 0.011111111111111112); elseif (Float64(angle_m / 180.0) <= 4e+75) tmp = Float64(Float64(2.0 * t_3) * Float64(cos(t_1) * t_2)); elseif (Float64(angle_m / 180.0) <= 5e+116) tmp = Float64(0.011111111111111112 * Float64(angle_m * Float64(pi * abs(t_3)))); elseif (Float64(angle_m / 180.0) <= 1e+258) tmp = Float64(2.0 * Float64(cos(Float64(pi * Float64(angle_m * -0.005555555555555556))) * Float64(t_3 * sin(Float64(0.005555555555555556 * Float64(angle_m * pi)))))); else tmp = Float64(2.0 * Float64(t_2 * Float64(t_3 * abs(cos(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 = pi * (angle_m * (b_m - a_m)); t_1 = (angle_m / 180.0) * pi; t_2 = sin(t_1); t_3 = (b_m - a_m) * (b_m + a_m); tmp = 0.0; if ((angle_m / 180.0) <= 4e-30) tmp = ((b_m * t_0) + (a_m * t_0)) * 0.011111111111111112; elseif ((angle_m / 180.0) <= 4e+75) tmp = (2.0 * t_3) * (cos(t_1) * t_2); elseif ((angle_m / 180.0) <= 5e+116) tmp = 0.011111111111111112 * (angle_m * (pi * abs(t_3))); elseif ((angle_m / 180.0) <= 1e+258) tmp = 2.0 * (cos((pi * (angle_m * -0.005555555555555556))) * (t_3 * sin((0.005555555555555556 * (angle_m * pi))))); else tmp = 2.0 * (t_2 * (t_3 * abs(cos((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[(Pi * N[(angle$95$m * N[(b$95$m - a$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(angle$95$m / 180.0), $MachinePrecision] * Pi), $MachinePrecision]}, Block[{t$95$2 = N[Sin[t$95$1], $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-30], N[(N[(N[(b$95$m * t$95$0), $MachinePrecision] + N[(a$95$m * t$95$0), $MachinePrecision]), $MachinePrecision] * 0.011111111111111112), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 4e+75], N[(N[(2.0 * t$95$3), $MachinePrecision] * N[(N[Cos[t$95$1], $MachinePrecision] * t$95$2), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 5e+116], N[(0.011111111111111112 * N[(angle$95$m * N[(Pi * N[Abs[t$95$3], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 1e+258], N[(2.0 * N[(N[Cos[N[(Pi * N[(angle$95$m * -0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(t$95$3 * N[Sin[N[(0.005555555555555556 * N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(t$95$2 * N[(t$95$3 * N[Abs[N[Cos[N[(Pi * N[(angle$95$m * 0.005555555555555556), $MachinePrecision]), $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 := \pi \cdot \left(angle_m \cdot \left(b_m - a_m\right)\right)\\
t_1 := \frac{angle_m}{180} \cdot \pi\\
t_2 := \sin t_1\\
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^{-30}:\\
\;\;\;\;\left(b_m \cdot t_0 + a_m \cdot t_0\right) \cdot 0.011111111111111112\\
\mathbf{elif}\;\frac{angle_m}{180} \leq 4 \cdot 10^{+75}:\\
\;\;\;\;\left(2 \cdot t_3\right) \cdot \left(\cos t_1 \cdot t_2\right)\\
\mathbf{elif}\;\frac{angle_m}{180} \leq 5 \cdot 10^{+116}:\\
\;\;\;\;0.011111111111111112 \cdot \left(angle_m \cdot \left(\pi \cdot \left|t_3\right|\right)\right)\\
\mathbf{elif}\;\frac{angle_m}{180} \leq 10^{+258}:\\
\;\;\;\;2 \cdot \left(\cos \left(\pi \cdot \left(angle_m \cdot -0.005555555555555556\right)\right) \cdot \left(t_3 \cdot \sin \left(0.005555555555555556 \cdot \left(angle_m \cdot \pi\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(t_2 \cdot \left(t_3 \cdot \left|\cos \left(\pi \cdot \left(angle_m \cdot 0.005555555555555556\right)\right)\right|\right)\right)\\
\end{array}
\end{array}
\end{array}
if (/.f64 angle 180) < 4e-30Initial program 62.5%
associate-*l*62.5%
Simplified62.5%
Taylor expanded in angle around 0 59.4%
unpow259.4%
unpow259.4%
difference-of-squares63.8%
Applied egg-rr63.8%
Taylor expanded in angle around 0 63.8%
*-commutative63.8%
associate-*r*63.9%
*-commutative63.9%
associate-*l*63.8%
+-commutative63.8%
difference-of-squares59.4%
unpow259.4%
unpow259.4%
associate-*l*59.4%
*-commutative59.4%
unpow259.4%
unpow259.4%
difference-of-squares63.9%
*-commutative63.9%
+-commutative63.9%
Simplified63.9%
associate-*r*75.0%
+-commutative75.0%
distribute-lft-in71.0%
*-commutative71.0%
associate-*l*71.0%
*-commutative71.0%
associate-*l*71.1%
Applied egg-rr71.1%
if 4e-30 < (/.f64 angle 180) < 3.99999999999999971e75Initial program 65.1%
associate-*l*65.1%
Simplified65.1%
unpow244.8%
unpow244.8%
difference-of-squares48.6%
Applied egg-rr69.0%
if 3.99999999999999971e75 < (/.f64 angle 180) < 5.00000000000000025e116Initial program 27.2%
associate-*l*27.2%
Simplified27.2%
Taylor expanded in angle around 0 39.6%
add-sqr-sqrt38.7%
sqrt-unprod52.5%
pow252.5%
Applied egg-rr52.5%
unpow252.5%
rem-sqrt-square51.5%
Simplified51.5%
unpow239.6%
unpow239.6%
difference-of-squares39.6%
Applied egg-rr51.5%
if 5.00000000000000025e116 < (/.f64 angle 180) < 1.00000000000000006e258Initial program 29.6%
Simplified36.8%
unpow229.5%
unpow229.5%
difference-of-squares29.5%
Applied egg-rr36.8%
Taylor expanded in angle around inf 37.6%
associate-*r*42.3%
associate-*r*33.6%
*-commutative33.6%
*-commutative33.6%
*-commutative33.6%
*-commutative33.6%
*-commutative33.6%
associate-*r*42.3%
Simplified42.3%
if 1.00000000000000006e258 < (/.f64 angle 180) Initial program 25.9%
Simplified18.2%
unpow220.4%
unpow220.4%
difference-of-squares26.6%
Applied egg-rr18.2%
add-sqr-sqrt0.0%
sqrt-unprod0.0%
associate-*l/0.0%
associate-*l/0.0%
frac-times0.0%
metadata-eval0.0%
metadata-eval0.0%
frac-times0.0%
associate-*r/0.0%
associate-*r/0.0%
sqrt-unprod37.2%
add-sqr-sqrt25.9%
add-sqr-sqrt23.8%
sqrt-unprod31.4%
pow231.4%
Applied egg-rr31.4%
unpow231.4%
rem-sqrt-square31.4%
Simplified31.4%
Final simplification65.0%
a_m = (fabs.f64 a)
b_m = (fabs.f64 b)
angle_m = (fabs.f64 angle)
angle_s = (copysign.f64 1 angle)
(FPCore (angle_s a_m b_m angle_m)
:precision binary64
(let* ((t_0 (* PI (* angle_m (- b_m a_m))))
(t_1 (* (- b_m a_m) (+ b_m a_m)))
(t_2
(*
2.0
(*
(* t_1 (sin (* 0.005555555555555556 (* angle_m PI))))
(cos (* -0.005555555555555556 (* angle_m PI)))))))
(*
angle_s
(if (<= (/ angle_m 180.0) 5e-81)
(* (+ (* b_m t_0) (* a_m t_0)) 0.011111111111111112)
(if (<= (/ angle_m 180.0) 5e+60)
t_2
(if (<= (/ angle_m 180.0) 5e+116)
(* 0.011111111111111112 (* angle_m (* PI (fabs t_1))))
(if (<= (/ angle_m 180.0) 2e+221)
t_2
(* 2.0 (* t_1 (sin (* (/ angle_m 180.0) 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 = ((double) M_PI) * (angle_m * (b_m - a_m));
double t_1 = (b_m - a_m) * (b_m + a_m);
double t_2 = 2.0 * ((t_1 * sin((0.005555555555555556 * (angle_m * ((double) M_PI))))) * cos((-0.005555555555555556 * (angle_m * ((double) M_PI)))));
double tmp;
if ((angle_m / 180.0) <= 5e-81) {
tmp = ((b_m * t_0) + (a_m * t_0)) * 0.011111111111111112;
} else if ((angle_m / 180.0) <= 5e+60) {
tmp = t_2;
} else if ((angle_m / 180.0) <= 5e+116) {
tmp = 0.011111111111111112 * (angle_m * (((double) M_PI) * fabs(t_1)));
} else if ((angle_m / 180.0) <= 2e+221) {
tmp = t_2;
} else {
tmp = 2.0 * (t_1 * sin(((angle_m / 180.0) * ((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 = Math.PI * (angle_m * (b_m - a_m));
double t_1 = (b_m - a_m) * (b_m + a_m);
double t_2 = 2.0 * ((t_1 * Math.sin((0.005555555555555556 * (angle_m * Math.PI)))) * Math.cos((-0.005555555555555556 * (angle_m * Math.PI))));
double tmp;
if ((angle_m / 180.0) <= 5e-81) {
tmp = ((b_m * t_0) + (a_m * t_0)) * 0.011111111111111112;
} else if ((angle_m / 180.0) <= 5e+60) {
tmp = t_2;
} else if ((angle_m / 180.0) <= 5e+116) {
tmp = 0.011111111111111112 * (angle_m * (Math.PI * Math.abs(t_1)));
} else if ((angle_m / 180.0) <= 2e+221) {
tmp = t_2;
} else {
tmp = 2.0 * (t_1 * Math.sin(((angle_m / 180.0) * 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): t_0 = math.pi * (angle_m * (b_m - a_m)) t_1 = (b_m - a_m) * (b_m + a_m) t_2 = 2.0 * ((t_1 * math.sin((0.005555555555555556 * (angle_m * math.pi)))) * math.cos((-0.005555555555555556 * (angle_m * math.pi)))) tmp = 0 if (angle_m / 180.0) <= 5e-81: tmp = ((b_m * t_0) + (a_m * t_0)) * 0.011111111111111112 elif (angle_m / 180.0) <= 5e+60: tmp = t_2 elif (angle_m / 180.0) <= 5e+116: tmp = 0.011111111111111112 * (angle_m * (math.pi * math.fabs(t_1))) elif (angle_m / 180.0) <= 2e+221: tmp = t_2 else: tmp = 2.0 * (t_1 * math.sin(((angle_m / 180.0) * 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(pi * Float64(angle_m * Float64(b_m - a_m))) t_1 = Float64(Float64(b_m - a_m) * Float64(b_m + a_m)) t_2 = Float64(2.0 * Float64(Float64(t_1 * sin(Float64(0.005555555555555556 * Float64(angle_m * pi)))) * cos(Float64(-0.005555555555555556 * Float64(angle_m * pi))))) tmp = 0.0 if (Float64(angle_m / 180.0) <= 5e-81) tmp = Float64(Float64(Float64(b_m * t_0) + Float64(a_m * t_0)) * 0.011111111111111112); elseif (Float64(angle_m / 180.0) <= 5e+60) tmp = t_2; elseif (Float64(angle_m / 180.0) <= 5e+116) tmp = Float64(0.011111111111111112 * Float64(angle_m * Float64(pi * abs(t_1)))); elseif (Float64(angle_m / 180.0) <= 2e+221) tmp = t_2; else tmp = Float64(2.0 * Float64(t_1 * sin(Float64(Float64(angle_m / 180.0) * 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) t_0 = pi * (angle_m * (b_m - a_m)); t_1 = (b_m - a_m) * (b_m + a_m); t_2 = 2.0 * ((t_1 * sin((0.005555555555555556 * (angle_m * pi)))) * cos((-0.005555555555555556 * (angle_m * pi)))); tmp = 0.0; if ((angle_m / 180.0) <= 5e-81) tmp = ((b_m * t_0) + (a_m * t_0)) * 0.011111111111111112; elseif ((angle_m / 180.0) <= 5e+60) tmp = t_2; elseif ((angle_m / 180.0) <= 5e+116) tmp = 0.011111111111111112 * (angle_m * (pi * abs(t_1))); elseif ((angle_m / 180.0) <= 2e+221) tmp = t_2; else tmp = 2.0 * (t_1 * sin(((angle_m / 180.0) * 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_] := Block[{t$95$0 = N[(Pi * N[(angle$95$m * N[(b$95$m - a$95$m), $MachinePrecision]), $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[(2.0 * N[(N[(t$95$1 * N[Sin[N[(0.005555555555555556 * N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[Cos[N[(-0.005555555555555556 * N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, N[(angle$95$s * If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 5e-81], N[(N[(N[(b$95$m * t$95$0), $MachinePrecision] + N[(a$95$m * t$95$0), $MachinePrecision]), $MachinePrecision] * 0.011111111111111112), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 5e+60], t$95$2, If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 5e+116], N[(0.011111111111111112 * N[(angle$95$m * N[(Pi * N[Abs[t$95$1], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 2e+221], t$95$2, N[(2.0 * N[(t$95$1 * N[Sin[N[(N[(angle$95$m / 180.0), $MachinePrecision] * 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)
\\
\begin{array}{l}
t_0 := \pi \cdot \left(angle_m \cdot \left(b_m - a_m\right)\right)\\
t_1 := \left(b_m - a_m\right) \cdot \left(b_m + a_m\right)\\
t_2 := 2 \cdot \left(\left(t_1 \cdot \sin \left(0.005555555555555556 \cdot \left(angle_m \cdot \pi\right)\right)\right) \cdot \cos \left(-0.005555555555555556 \cdot \left(angle_m \cdot \pi\right)\right)\right)\\
angle_s \cdot \begin{array}{l}
\mathbf{if}\;\frac{angle_m}{180} \leq 5 \cdot 10^{-81}:\\
\;\;\;\;\left(b_m \cdot t_0 + a_m \cdot t_0\right) \cdot 0.011111111111111112\\
\mathbf{elif}\;\frac{angle_m}{180} \leq 5 \cdot 10^{+60}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;\frac{angle_m}{180} \leq 5 \cdot 10^{+116}:\\
\;\;\;\;0.011111111111111112 \cdot \left(angle_m \cdot \left(\pi \cdot \left|t_1\right|\right)\right)\\
\mathbf{elif}\;\frac{angle_m}{180} \leq 2 \cdot 10^{+221}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(t_1 \cdot \sin \left(\frac{angle_m}{180} \cdot \pi\right)\right)\\
\end{array}
\end{array}
\end{array}
if (/.f64 angle 180) < 4.99999999999999981e-81Initial program 60.3%
associate-*l*60.3%
Simplified60.3%
Taylor expanded in angle around 0 57.0%
unpow257.0%
unpow257.0%
difference-of-squares61.7%
Applied egg-rr61.7%
Taylor expanded in angle around 0 61.7%
*-commutative61.7%
associate-*r*61.8%
*-commutative61.8%
associate-*l*61.7%
+-commutative61.7%
difference-of-squares57.0%
unpow257.0%
unpow257.0%
associate-*l*57.0%
*-commutative57.0%
unpow257.0%
unpow257.0%
difference-of-squares61.8%
*-commutative61.8%
+-commutative61.8%
Simplified61.8%
associate-*r*73.5%
+-commutative73.5%
distribute-lft-in69.4%
*-commutative69.4%
associate-*l*69.4%
*-commutative69.4%
associate-*l*69.4%
Applied egg-rr69.4%
if 4.99999999999999981e-81 < (/.f64 angle 180) < 4.99999999999999975e60 or 5.00000000000000025e116 < (/.f64 angle 180) < 2.0000000000000001e221Initial program 61.7%
Simplified63.1%
unpow252.5%
unpow252.5%
difference-of-squares54.3%
Applied egg-rr64.9%
Taylor expanded in angle around inf 65.3%
if 4.99999999999999975e60 < (/.f64 angle 180) < 5.00000000000000025e116Initial program 21.7%
associate-*l*21.7%
Simplified21.7%
Taylor expanded in angle around 0 32.6%
add-sqr-sqrt30.9%
sqrt-unprod52.0%
pow252.0%
Applied egg-rr52.0%
unpow252.0%
rem-sqrt-square51.2%
Simplified51.2%
unpow232.6%
unpow232.6%
difference-of-squares32.6%
Applied egg-rr51.2%
if 2.0000000000000001e221 < (/.f64 angle 180) Initial program 22.6%
Simplified21.4%
unpow216.5%
unpow216.5%
difference-of-squares21.5%
Applied egg-rr21.4%
Taylor expanded in angle around 0 30.5%
Final simplification64.8%
a_m = (fabs.f64 a)
b_m = (fabs.f64 b)
angle_m = (fabs.f64 angle)
angle_s = (copysign.f64 1 angle)
(FPCore (angle_s a_m b_m angle_m)
:precision binary64
(let* ((t_0 (* PI (* angle_m (- b_m a_m))))
(t_1 (* (- b_m a_m) (+ b_m a_m)))
(t_2 (* t_1 (sin (* 0.005555555555555556 (* angle_m PI))))))
(*
angle_s
(if (<= (/ angle_m 180.0) 5e-81)
(* (+ (* b_m t_0) (* a_m t_0)) 0.011111111111111112)
(if (<= (/ angle_m 180.0) 5e+60)
(* 2.0 (* t_2 (cos (* -0.005555555555555556 (* angle_m PI)))))
(if (<= (/ angle_m 180.0) 5e+116)
(* 0.011111111111111112 (* angle_m (* PI (fabs t_1))))
(* 2.0 (* (cos (* PI (* angle_m -0.005555555555555556))) 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 = ((double) M_PI) * (angle_m * (b_m - a_m));
double t_1 = (b_m - a_m) * (b_m + a_m);
double t_2 = t_1 * sin((0.005555555555555556 * (angle_m * ((double) M_PI))));
double tmp;
if ((angle_m / 180.0) <= 5e-81) {
tmp = ((b_m * t_0) + (a_m * t_0)) * 0.011111111111111112;
} else if ((angle_m / 180.0) <= 5e+60) {
tmp = 2.0 * (t_2 * cos((-0.005555555555555556 * (angle_m * ((double) M_PI)))));
} else if ((angle_m / 180.0) <= 5e+116) {
tmp = 0.011111111111111112 * (angle_m * (((double) M_PI) * fabs(t_1)));
} else {
tmp = 2.0 * (cos((((double) M_PI) * (angle_m * -0.005555555555555556))) * 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 = Math.PI * (angle_m * (b_m - a_m));
double t_1 = (b_m - a_m) * (b_m + a_m);
double t_2 = t_1 * Math.sin((0.005555555555555556 * (angle_m * Math.PI)));
double tmp;
if ((angle_m / 180.0) <= 5e-81) {
tmp = ((b_m * t_0) + (a_m * t_0)) * 0.011111111111111112;
} else if ((angle_m / 180.0) <= 5e+60) {
tmp = 2.0 * (t_2 * Math.cos((-0.005555555555555556 * (angle_m * Math.PI))));
} else if ((angle_m / 180.0) <= 5e+116) {
tmp = 0.011111111111111112 * (angle_m * (Math.PI * Math.abs(t_1)));
} else {
tmp = 2.0 * (Math.cos((Math.PI * (angle_m * -0.005555555555555556))) * t_2);
}
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 = math.pi * (angle_m * (b_m - a_m)) t_1 = (b_m - a_m) * (b_m + a_m) t_2 = t_1 * math.sin((0.005555555555555556 * (angle_m * math.pi))) tmp = 0 if (angle_m / 180.0) <= 5e-81: tmp = ((b_m * t_0) + (a_m * t_0)) * 0.011111111111111112 elif (angle_m / 180.0) <= 5e+60: tmp = 2.0 * (t_2 * math.cos((-0.005555555555555556 * (angle_m * math.pi)))) elif (angle_m / 180.0) <= 5e+116: tmp = 0.011111111111111112 * (angle_m * (math.pi * math.fabs(t_1))) else: tmp = 2.0 * (math.cos((math.pi * (angle_m * -0.005555555555555556))) * 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(pi * Float64(angle_m * Float64(b_m - a_m))) t_1 = Float64(Float64(b_m - a_m) * Float64(b_m + a_m)) t_2 = Float64(t_1 * sin(Float64(0.005555555555555556 * Float64(angle_m * pi)))) tmp = 0.0 if (Float64(angle_m / 180.0) <= 5e-81) tmp = Float64(Float64(Float64(b_m * t_0) + Float64(a_m * t_0)) * 0.011111111111111112); elseif (Float64(angle_m / 180.0) <= 5e+60) tmp = Float64(2.0 * Float64(t_2 * cos(Float64(-0.005555555555555556 * Float64(angle_m * pi))))); elseif (Float64(angle_m / 180.0) <= 5e+116) tmp = Float64(0.011111111111111112 * Float64(angle_m * Float64(pi * abs(t_1)))); else tmp = Float64(2.0 * Float64(cos(Float64(pi * Float64(angle_m * -0.005555555555555556))) * t_2)); 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 = pi * (angle_m * (b_m - a_m)); t_1 = (b_m - a_m) * (b_m + a_m); t_2 = t_1 * sin((0.005555555555555556 * (angle_m * pi))); tmp = 0.0; if ((angle_m / 180.0) <= 5e-81) tmp = ((b_m * t_0) + (a_m * t_0)) * 0.011111111111111112; elseif ((angle_m / 180.0) <= 5e+60) tmp = 2.0 * (t_2 * cos((-0.005555555555555556 * (angle_m * pi)))); elseif ((angle_m / 180.0) <= 5e+116) tmp = 0.011111111111111112 * (angle_m * (pi * abs(t_1))); else tmp = 2.0 * (cos((pi * (angle_m * -0.005555555555555556))) * t_2); 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[(Pi * N[(angle$95$m * N[(b$95$m - a$95$m), $MachinePrecision]), $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[(t$95$1 * N[Sin[N[(0.005555555555555556 * N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, N[(angle$95$s * If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 5e-81], N[(N[(N[(b$95$m * t$95$0), $MachinePrecision] + N[(a$95$m * t$95$0), $MachinePrecision]), $MachinePrecision] * 0.011111111111111112), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 5e+60], N[(2.0 * N[(t$95$2 * N[Cos[N[(-0.005555555555555556 * N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 5e+116], N[(0.011111111111111112 * N[(angle$95$m * N[(Pi * N[Abs[t$95$1], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[Cos[N[(Pi * N[(angle$95$m * -0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * t$95$2), $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 \left(b_m - a_m\right)\right)\\
t_1 := \left(b_m - a_m\right) \cdot \left(b_m + a_m\right)\\
t_2 := t_1 \cdot \sin \left(0.005555555555555556 \cdot \left(angle_m \cdot \pi\right)\right)\\
angle_s \cdot \begin{array}{l}
\mathbf{if}\;\frac{angle_m}{180} \leq 5 \cdot 10^{-81}:\\
\;\;\;\;\left(b_m \cdot t_0 + a_m \cdot t_0\right) \cdot 0.011111111111111112\\
\mathbf{elif}\;\frac{angle_m}{180} \leq 5 \cdot 10^{+60}:\\
\;\;\;\;2 \cdot \left(t_2 \cdot \cos \left(-0.005555555555555556 \cdot \left(angle_m \cdot \pi\right)\right)\right)\\
\mathbf{elif}\;\frac{angle_m}{180} \leq 5 \cdot 10^{+116}:\\
\;\;\;\;0.011111111111111112 \cdot \left(angle_m \cdot \left(\pi \cdot \left|t_1\right|\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(\cos \left(\pi \cdot \left(angle_m \cdot -0.005555555555555556\right)\right) \cdot t_2\right)\\
\end{array}
\end{array}
\end{array}
if (/.f64 angle 180) < 4.99999999999999981e-81Initial program 60.3%
associate-*l*60.3%
Simplified60.3%
Taylor expanded in angle around 0 57.0%
unpow257.0%
unpow257.0%
difference-of-squares61.7%
Applied egg-rr61.7%
Taylor expanded in angle around 0 61.7%
*-commutative61.7%
associate-*r*61.8%
*-commutative61.8%
associate-*l*61.7%
+-commutative61.7%
difference-of-squares57.0%
unpow257.0%
unpow257.0%
associate-*l*57.0%
*-commutative57.0%
unpow257.0%
unpow257.0%
difference-of-squares61.8%
*-commutative61.8%
+-commutative61.8%
Simplified61.8%
associate-*r*73.5%
+-commutative73.5%
distribute-lft-in69.4%
*-commutative69.4%
associate-*l*69.4%
*-commutative69.4%
associate-*l*69.4%
Applied egg-rr69.4%
if 4.99999999999999981e-81 < (/.f64 angle 180) < 4.99999999999999975e60Initial program 79.1%
Simplified79.1%
unpow263.3%
unpow263.3%
difference-of-squares66.2%
Applied egg-rr82.0%
Taylor expanded in angle around inf 79.1%
if 4.99999999999999975e60 < (/.f64 angle 180) < 5.00000000000000025e116Initial program 21.7%
associate-*l*21.7%
Simplified21.7%
Taylor expanded in angle around 0 32.6%
add-sqr-sqrt30.9%
sqrt-unprod52.0%
pow252.0%
Applied egg-rr52.0%
unpow252.0%
rem-sqrt-square51.2%
Simplified51.2%
unpow232.6%
unpow232.6%
difference-of-squares32.6%
Applied egg-rr51.2%
if 5.00000000000000025e116 < (/.f64 angle 180) Initial program 28.2%
Simplified29.5%
unpow226.0%
unpow226.0%
difference-of-squares28.4%
Applied egg-rr29.5%
Taylor expanded in angle around inf 32.1%
associate-*r*35.6%
associate-*r*30.2%
*-commutative30.2%
*-commutative30.2%
*-commutative30.2%
*-commutative30.2%
*-commutative30.2%
associate-*r*35.6%
Simplified35.6%
Final simplification64.6%
a_m = (fabs.f64 a)
b_m = (fabs.f64 b)
angle_m = (fabs.f64 angle)
angle_s = (copysign.f64 1 angle)
(FPCore (angle_s a_m b_m angle_m)
:precision binary64
(let* ((t_0 (* PI (* angle_m (- b_m a_m)))) (t_1 (* (- b_m a_m) (+ b_m a_m))))
(*
angle_s
(if (<= (/ angle_m 180.0) 2e-42)
(* (+ (* b_m t_0) (* a_m t_0)) 0.011111111111111112)
(if (<= (/ angle_m 180.0) 5e+60)
(*
2.0
(*
(* t_1 (cos (* angle_m (/ PI -180.0))))
(sin (* PI (* angle_m 0.005555555555555556)))))
(if (<= (/ angle_m 180.0) 5e+116)
(* 0.011111111111111112 (* angle_m (* PI (fabs t_1))))
(*
2.0
(*
(cos (* PI (* angle_m -0.005555555555555556)))
(* t_1 (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 = ((double) M_PI) * (angle_m * (b_m - a_m));
double t_1 = (b_m - a_m) * (b_m + a_m);
double tmp;
if ((angle_m / 180.0) <= 2e-42) {
tmp = ((b_m * t_0) + (a_m * t_0)) * 0.011111111111111112;
} else if ((angle_m / 180.0) <= 5e+60) {
tmp = 2.0 * ((t_1 * cos((angle_m * (((double) M_PI) / -180.0)))) * sin((((double) M_PI) * (angle_m * 0.005555555555555556))));
} else if ((angle_m / 180.0) <= 5e+116) {
tmp = 0.011111111111111112 * (angle_m * (((double) M_PI) * fabs(t_1)));
} else {
tmp = 2.0 * (cos((((double) M_PI) * (angle_m * -0.005555555555555556))) * (t_1 * 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 = Math.PI * (angle_m * (b_m - a_m));
double t_1 = (b_m - a_m) * (b_m + a_m);
double tmp;
if ((angle_m / 180.0) <= 2e-42) {
tmp = ((b_m * t_0) + (a_m * t_0)) * 0.011111111111111112;
} else if ((angle_m / 180.0) <= 5e+60) {
tmp = 2.0 * ((t_1 * Math.cos((angle_m * (Math.PI / -180.0)))) * Math.sin((Math.PI * (angle_m * 0.005555555555555556))));
} else if ((angle_m / 180.0) <= 5e+116) {
tmp = 0.011111111111111112 * (angle_m * (Math.PI * Math.abs(t_1)));
} else {
tmp = 2.0 * (Math.cos((Math.PI * (angle_m * -0.005555555555555556))) * (t_1 * Math.sin((0.005555555555555556 * (angle_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): t_0 = math.pi * (angle_m * (b_m - a_m)) t_1 = (b_m - a_m) * (b_m + a_m) tmp = 0 if (angle_m / 180.0) <= 2e-42: tmp = ((b_m * t_0) + (a_m * t_0)) * 0.011111111111111112 elif (angle_m / 180.0) <= 5e+60: tmp = 2.0 * ((t_1 * math.cos((angle_m * (math.pi / -180.0)))) * math.sin((math.pi * (angle_m * 0.005555555555555556)))) elif (angle_m / 180.0) <= 5e+116: tmp = 0.011111111111111112 * (angle_m * (math.pi * math.fabs(t_1))) else: tmp = 2.0 * (math.cos((math.pi * (angle_m * -0.005555555555555556))) * (t_1 * 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(pi * Float64(angle_m * Float64(b_m - a_m))) t_1 = Float64(Float64(b_m - a_m) * Float64(b_m + a_m)) tmp = 0.0 if (Float64(angle_m / 180.0) <= 2e-42) tmp = Float64(Float64(Float64(b_m * t_0) + Float64(a_m * t_0)) * 0.011111111111111112); elseif (Float64(angle_m / 180.0) <= 5e+60) tmp = Float64(2.0 * Float64(Float64(t_1 * cos(Float64(angle_m * Float64(pi / -180.0)))) * sin(Float64(pi * Float64(angle_m * 0.005555555555555556))))); elseif (Float64(angle_m / 180.0) <= 5e+116) tmp = Float64(0.011111111111111112 * Float64(angle_m * Float64(pi * abs(t_1)))); else tmp = Float64(2.0 * Float64(cos(Float64(pi * Float64(angle_m * -0.005555555555555556))) * Float64(t_1 * sin(Float64(0.005555555555555556 * Float64(angle_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) t_0 = pi * (angle_m * (b_m - a_m)); t_1 = (b_m - a_m) * (b_m + a_m); tmp = 0.0; if ((angle_m / 180.0) <= 2e-42) tmp = ((b_m * t_0) + (a_m * t_0)) * 0.011111111111111112; elseif ((angle_m / 180.0) <= 5e+60) tmp = 2.0 * ((t_1 * cos((angle_m * (pi / -180.0)))) * sin((pi * (angle_m * 0.005555555555555556)))); elseif ((angle_m / 180.0) <= 5e+116) tmp = 0.011111111111111112 * (angle_m * (pi * abs(t_1))); else tmp = 2.0 * (cos((pi * (angle_m * -0.005555555555555556))) * (t_1 * sin((0.005555555555555556 * (angle_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_] := Block[{t$95$0 = N[(Pi * N[(angle$95$m * N[(b$95$m - a$95$m), $MachinePrecision]), $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], 2e-42], N[(N[(N[(b$95$m * t$95$0), $MachinePrecision] + N[(a$95$m * t$95$0), $MachinePrecision]), $MachinePrecision] * 0.011111111111111112), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 5e+60], N[(2.0 * N[(N[(t$95$1 * N[Cos[N[(angle$95$m * N[(Pi / -180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[Sin[N[(Pi * N[(angle$95$m * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 5e+116], N[(0.011111111111111112 * N[(angle$95$m * N[(Pi * N[Abs[t$95$1], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[Cos[N[(Pi * N[(angle$95$m * -0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(t$95$1 * 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 := \pi \cdot \left(angle_m \cdot \left(b_m - a_m\right)\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 2 \cdot 10^{-42}:\\
\;\;\;\;\left(b_m \cdot t_0 + a_m \cdot t_0\right) \cdot 0.011111111111111112\\
\mathbf{elif}\;\frac{angle_m}{180} \leq 5 \cdot 10^{+60}:\\
\;\;\;\;2 \cdot \left(\left(t_1 \cdot \cos \left(angle_m \cdot \frac{\pi}{-180}\right)\right) \cdot \sin \left(\pi \cdot \left(angle_m \cdot 0.005555555555555556\right)\right)\right)\\
\mathbf{elif}\;\frac{angle_m}{180} \leq 5 \cdot 10^{+116}:\\
\;\;\;\;0.011111111111111112 \cdot \left(angle_m \cdot \left(\pi \cdot \left|t_1\right|\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(\cos \left(\pi \cdot \left(angle_m \cdot -0.005555555555555556\right)\right) \cdot \left(t_1 \cdot \sin \left(0.005555555555555556 \cdot \left(angle_m \cdot \pi\right)\right)\right)\right)\\
\end{array}
\end{array}
\end{array}
if (/.f64 angle 180) < 2.00000000000000008e-42Initial program 61.9%
associate-*l*61.9%
Simplified61.9%
Taylor expanded in angle around 0 58.7%
unpow258.7%
unpow258.7%
difference-of-squares63.2%
Applied egg-rr63.2%
Taylor expanded in angle around 0 63.2%
*-commutative63.2%
associate-*r*63.3%
*-commutative63.3%
associate-*l*63.2%
+-commutative63.2%
difference-of-squares58.7%
unpow258.7%
unpow258.7%
associate-*l*58.7%
*-commutative58.7%
unpow258.7%
unpow258.7%
difference-of-squares63.3%
*-commutative63.3%
+-commutative63.3%
Simplified63.3%
associate-*r*74.6%
+-commutative74.6%
distribute-lft-in70.5%
*-commutative70.5%
associate-*l*70.5%
*-commutative70.5%
associate-*l*70.6%
Applied egg-rr70.6%
if 2.00000000000000008e-42 < (/.f64 angle 180) < 4.99999999999999975e60Initial program 73.8%
Simplified73.7%
unpow253.8%
unpow253.8%
difference-of-squares57.5%
Applied egg-rr77.4%
Taylor expanded in angle around inf 76.7%
associate-*r*78.0%
*-commutative78.0%
*-commutative78.0%
Simplified78.0%
if 4.99999999999999975e60 < (/.f64 angle 180) < 5.00000000000000025e116Initial program 21.7%
associate-*l*21.7%
Simplified21.7%
Taylor expanded in angle around 0 32.6%
add-sqr-sqrt30.9%
sqrt-unprod52.0%
pow252.0%
Applied egg-rr52.0%
unpow252.0%
rem-sqrt-square51.2%
Simplified51.2%
unpow232.6%
unpow232.6%
difference-of-squares32.6%
Applied egg-rr51.2%
if 5.00000000000000025e116 < (/.f64 angle 180) Initial program 28.2%
Simplified29.5%
unpow226.0%
unpow226.0%
difference-of-squares28.4%
Applied egg-rr29.5%
Taylor expanded in angle around inf 32.1%
associate-*r*35.6%
associate-*r*30.2%
*-commutative30.2%
*-commutative30.2%
*-commutative30.2%
*-commutative30.2%
*-commutative30.2%
associate-*r*35.6%
Simplified35.6%
Final simplification65.0%
a_m = (fabs.f64 a)
b_m = (fabs.f64 b)
angle_m = (fabs.f64 angle)
angle_s = (copysign.f64 1 angle)
(FPCore (angle_s a_m b_m angle_m)
:precision binary64
(let* ((t_0 (* PI (* angle_m (- b_m a_m)))) (t_1 (* (- b_m a_m) (+ b_m a_m))))
(*
angle_s
(if (<= (/ angle_m 180.0) 4e-30)
(* (+ (* b_m t_0) (* a_m t_0)) 0.011111111111111112)
(if (<= (/ angle_m 180.0) 2e+78)
(*
2.0
(*
(sin (* (/ angle_m 180.0) PI))
(* t_1 (cos (* -0.005555555555555556 (* angle_m PI))))))
(if (<= (/ angle_m 180.0) 5e+116)
(* 0.011111111111111112 (* angle_m (* PI (fabs t_1))))
(*
2.0
(*
(cos (* PI (* angle_m -0.005555555555555556)))
(* t_1 (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 = ((double) M_PI) * (angle_m * (b_m - a_m));
double t_1 = (b_m - a_m) * (b_m + a_m);
double tmp;
if ((angle_m / 180.0) <= 4e-30) {
tmp = ((b_m * t_0) + (a_m * t_0)) * 0.011111111111111112;
} else if ((angle_m / 180.0) <= 2e+78) {
tmp = 2.0 * (sin(((angle_m / 180.0) * ((double) M_PI))) * (t_1 * cos((-0.005555555555555556 * (angle_m * ((double) M_PI))))));
} else if ((angle_m / 180.0) <= 5e+116) {
tmp = 0.011111111111111112 * (angle_m * (((double) M_PI) * fabs(t_1)));
} else {
tmp = 2.0 * (cos((((double) M_PI) * (angle_m * -0.005555555555555556))) * (t_1 * 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 = Math.PI * (angle_m * (b_m - a_m));
double t_1 = (b_m - a_m) * (b_m + a_m);
double tmp;
if ((angle_m / 180.0) <= 4e-30) {
tmp = ((b_m * t_0) + (a_m * t_0)) * 0.011111111111111112;
} else if ((angle_m / 180.0) <= 2e+78) {
tmp = 2.0 * (Math.sin(((angle_m / 180.0) * Math.PI)) * (t_1 * Math.cos((-0.005555555555555556 * (angle_m * Math.PI)))));
} else if ((angle_m / 180.0) <= 5e+116) {
tmp = 0.011111111111111112 * (angle_m * (Math.PI * Math.abs(t_1)));
} else {
tmp = 2.0 * (Math.cos((Math.PI * (angle_m * -0.005555555555555556))) * (t_1 * Math.sin((0.005555555555555556 * (angle_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): t_0 = math.pi * (angle_m * (b_m - a_m)) t_1 = (b_m - a_m) * (b_m + a_m) tmp = 0 if (angle_m / 180.0) <= 4e-30: tmp = ((b_m * t_0) + (a_m * t_0)) * 0.011111111111111112 elif (angle_m / 180.0) <= 2e+78: tmp = 2.0 * (math.sin(((angle_m / 180.0) * math.pi)) * (t_1 * math.cos((-0.005555555555555556 * (angle_m * math.pi))))) elif (angle_m / 180.0) <= 5e+116: tmp = 0.011111111111111112 * (angle_m * (math.pi * math.fabs(t_1))) else: tmp = 2.0 * (math.cos((math.pi * (angle_m * -0.005555555555555556))) * (t_1 * 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(pi * Float64(angle_m * Float64(b_m - a_m))) t_1 = Float64(Float64(b_m - a_m) * Float64(b_m + a_m)) tmp = 0.0 if (Float64(angle_m / 180.0) <= 4e-30) tmp = Float64(Float64(Float64(b_m * t_0) + Float64(a_m * t_0)) * 0.011111111111111112); elseif (Float64(angle_m / 180.0) <= 2e+78) tmp = Float64(2.0 * Float64(sin(Float64(Float64(angle_m / 180.0) * pi)) * Float64(t_1 * cos(Float64(-0.005555555555555556 * Float64(angle_m * pi)))))); elseif (Float64(angle_m / 180.0) <= 5e+116) tmp = Float64(0.011111111111111112 * Float64(angle_m * Float64(pi * abs(t_1)))); else tmp = Float64(2.0 * Float64(cos(Float64(pi * Float64(angle_m * -0.005555555555555556))) * Float64(t_1 * sin(Float64(0.005555555555555556 * Float64(angle_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) t_0 = pi * (angle_m * (b_m - a_m)); t_1 = (b_m - a_m) * (b_m + a_m); tmp = 0.0; if ((angle_m / 180.0) <= 4e-30) tmp = ((b_m * t_0) + (a_m * t_0)) * 0.011111111111111112; elseif ((angle_m / 180.0) <= 2e+78) tmp = 2.0 * (sin(((angle_m / 180.0) * pi)) * (t_1 * cos((-0.005555555555555556 * (angle_m * pi))))); elseif ((angle_m / 180.0) <= 5e+116) tmp = 0.011111111111111112 * (angle_m * (pi * abs(t_1))); else tmp = 2.0 * (cos((pi * (angle_m * -0.005555555555555556))) * (t_1 * sin((0.005555555555555556 * (angle_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_] := Block[{t$95$0 = N[(Pi * N[(angle$95$m * N[(b$95$m - a$95$m), $MachinePrecision]), $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], 4e-30], N[(N[(N[(b$95$m * t$95$0), $MachinePrecision] + N[(a$95$m * t$95$0), $MachinePrecision]), $MachinePrecision] * 0.011111111111111112), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 2e+78], N[(2.0 * N[(N[Sin[N[(N[(angle$95$m / 180.0), $MachinePrecision] * Pi), $MachinePrecision]], $MachinePrecision] * N[(t$95$1 * N[Cos[N[(-0.005555555555555556 * N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 5e+116], N[(0.011111111111111112 * N[(angle$95$m * N[(Pi * N[Abs[t$95$1], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[Cos[N[(Pi * N[(angle$95$m * -0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(t$95$1 * 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 := \pi \cdot \left(angle_m \cdot \left(b_m - a_m\right)\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 4 \cdot 10^{-30}:\\
\;\;\;\;\left(b_m \cdot t_0 + a_m \cdot t_0\right) \cdot 0.011111111111111112\\
\mathbf{elif}\;\frac{angle_m}{180} \leq 2 \cdot 10^{+78}:\\
\;\;\;\;2 \cdot \left(\sin \left(\frac{angle_m}{180} \cdot \pi\right) \cdot \left(t_1 \cdot \cos \left(-0.005555555555555556 \cdot \left(angle_m \cdot \pi\right)\right)\right)\right)\\
\mathbf{elif}\;\frac{angle_m}{180} \leq 5 \cdot 10^{+116}:\\
\;\;\;\;0.011111111111111112 \cdot \left(angle_m \cdot \left(\pi \cdot \left|t_1\right|\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(\cos \left(\pi \cdot \left(angle_m \cdot -0.005555555555555556\right)\right) \cdot \left(t_1 \cdot \sin \left(0.005555555555555556 \cdot \left(angle_m \cdot \pi\right)\right)\right)\right)\\
\end{array}
\end{array}
\end{array}
if (/.f64 angle 180) < 4e-30Initial program 62.5%
associate-*l*62.5%
Simplified62.5%
Taylor expanded in angle around 0 59.4%
unpow259.4%
unpow259.4%
difference-of-squares63.8%
Applied egg-rr63.8%
Taylor expanded in angle around 0 63.8%
*-commutative63.8%
associate-*r*63.9%
*-commutative63.9%
associate-*l*63.8%
+-commutative63.8%
difference-of-squares59.4%
unpow259.4%
unpow259.4%
associate-*l*59.4%
*-commutative59.4%
unpow259.4%
unpow259.4%
difference-of-squares63.9%
*-commutative63.9%
+-commutative63.9%
Simplified63.9%
associate-*r*75.0%
+-commutative75.0%
distribute-lft-in71.0%
*-commutative71.0%
associate-*l*71.0%
*-commutative71.0%
associate-*l*71.1%
Applied egg-rr71.1%
if 4e-30 < (/.f64 angle 180) < 2.00000000000000002e78Initial program 65.1%
Simplified65.1%
unpow244.8%
unpow244.8%
difference-of-squares48.6%
Applied egg-rr68.9%
Taylor expanded in angle around inf 72.2%
if 2.00000000000000002e78 < (/.f64 angle 180) < 5.00000000000000025e116Initial program 27.2%
associate-*l*27.2%
Simplified27.2%
Taylor expanded in angle around 0 39.6%
add-sqr-sqrt38.7%
sqrt-unprod52.5%
pow252.5%
Applied egg-rr52.5%
unpow252.5%
rem-sqrt-square51.5%
Simplified51.5%
unpow239.6%
unpow239.6%
difference-of-squares39.6%
Applied egg-rr51.5%
if 5.00000000000000025e116 < (/.f64 angle 180) Initial program 28.2%
Simplified29.5%
unpow226.0%
unpow226.0%
difference-of-squares28.4%
Applied egg-rr29.5%
Taylor expanded in angle around inf 32.1%
associate-*r*35.6%
associate-*r*30.2%
*-commutative30.2%
*-commutative30.2%
*-commutative30.2%
*-commutative30.2%
*-commutative30.2%
associate-*r*35.6%
Simplified35.6%
Final simplification64.9%
a_m = (fabs.f64 a)
b_m = (fabs.f64 b)
angle_m = (fabs.f64 angle)
angle_s = (copysign.f64 1 angle)
(FPCore (angle_s a_m b_m angle_m)
:precision binary64
(let* ((t_0 (* PI (* angle_m (- b_m a_m))))
(t_1 (* 0.005555555555555556 (* angle_m PI)))
(t_2 (* (- b_m a_m) (+ b_m a_m))))
(*
angle_s
(if (<= (/ angle_m 180.0) 4e-30)
(* (+ (* b_m t_0) (* a_m t_0)) 0.011111111111111112)
(if (<= (/ angle_m 180.0) 2e+78)
(* (* 2.0 t_2) (* (sin (* (/ angle_m 180.0) PI)) (cos t_1)))
(if (<= (/ angle_m 180.0) 5e+116)
(* 0.011111111111111112 (* angle_m (* PI (fabs t_2))))
(*
2.0
(*
(cos (* PI (* angle_m -0.005555555555555556)))
(* t_2 (sin t_1))))))))))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 * (b_m - a_m));
double t_1 = 0.005555555555555556 * (angle_m * ((double) M_PI));
double t_2 = (b_m - a_m) * (b_m + a_m);
double tmp;
if ((angle_m / 180.0) <= 4e-30) {
tmp = ((b_m * t_0) + (a_m * t_0)) * 0.011111111111111112;
} else if ((angle_m / 180.0) <= 2e+78) {
tmp = (2.0 * t_2) * (sin(((angle_m / 180.0) * ((double) M_PI))) * cos(t_1));
} else if ((angle_m / 180.0) <= 5e+116) {
tmp = 0.011111111111111112 * (angle_m * (((double) M_PI) * fabs(t_2)));
} else {
tmp = 2.0 * (cos((((double) M_PI) * (angle_m * -0.005555555555555556))) * (t_2 * sin(t_1)));
}
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 * (b_m - a_m));
double t_1 = 0.005555555555555556 * (angle_m * Math.PI);
double t_2 = (b_m - a_m) * (b_m + a_m);
double tmp;
if ((angle_m / 180.0) <= 4e-30) {
tmp = ((b_m * t_0) + (a_m * t_0)) * 0.011111111111111112;
} else if ((angle_m / 180.0) <= 2e+78) {
tmp = (2.0 * t_2) * (Math.sin(((angle_m / 180.0) * Math.PI)) * Math.cos(t_1));
} else if ((angle_m / 180.0) <= 5e+116) {
tmp = 0.011111111111111112 * (angle_m * (Math.PI * Math.abs(t_2)));
} else {
tmp = 2.0 * (Math.cos((Math.PI * (angle_m * -0.005555555555555556))) * (t_2 * Math.sin(t_1)));
}
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 = math.pi * (angle_m * (b_m - a_m)) t_1 = 0.005555555555555556 * (angle_m * math.pi) t_2 = (b_m - a_m) * (b_m + a_m) tmp = 0 if (angle_m / 180.0) <= 4e-30: tmp = ((b_m * t_0) + (a_m * t_0)) * 0.011111111111111112 elif (angle_m / 180.0) <= 2e+78: tmp = (2.0 * t_2) * (math.sin(((angle_m / 180.0) * math.pi)) * math.cos(t_1)) elif (angle_m / 180.0) <= 5e+116: tmp = 0.011111111111111112 * (angle_m * (math.pi * math.fabs(t_2))) else: tmp = 2.0 * (math.cos((math.pi * (angle_m * -0.005555555555555556))) * (t_2 * math.sin(t_1))) 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 * Float64(b_m - a_m))) t_1 = Float64(0.005555555555555556 * Float64(angle_m * pi)) t_2 = Float64(Float64(b_m - a_m) * Float64(b_m + a_m)) tmp = 0.0 if (Float64(angle_m / 180.0) <= 4e-30) tmp = Float64(Float64(Float64(b_m * t_0) + Float64(a_m * t_0)) * 0.011111111111111112); elseif (Float64(angle_m / 180.0) <= 2e+78) tmp = Float64(Float64(2.0 * t_2) * Float64(sin(Float64(Float64(angle_m / 180.0) * pi)) * cos(t_1))); elseif (Float64(angle_m / 180.0) <= 5e+116) tmp = Float64(0.011111111111111112 * Float64(angle_m * Float64(pi * abs(t_2)))); else tmp = Float64(2.0 * Float64(cos(Float64(pi * Float64(angle_m * -0.005555555555555556))) * Float64(t_2 * sin(t_1)))); 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 = pi * (angle_m * (b_m - a_m)); t_1 = 0.005555555555555556 * (angle_m * pi); t_2 = (b_m - a_m) * (b_m + a_m); tmp = 0.0; if ((angle_m / 180.0) <= 4e-30) tmp = ((b_m * t_0) + (a_m * t_0)) * 0.011111111111111112; elseif ((angle_m / 180.0) <= 2e+78) tmp = (2.0 * t_2) * (sin(((angle_m / 180.0) * pi)) * cos(t_1)); elseif ((angle_m / 180.0) <= 5e+116) tmp = 0.011111111111111112 * (angle_m * (pi * abs(t_2))); else tmp = 2.0 * (cos((pi * (angle_m * -0.005555555555555556))) * (t_2 * sin(t_1))); 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[(Pi * N[(angle$95$m * N[(b$95$m - a$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(0.005555555555555556 * N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = 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-30], N[(N[(N[(b$95$m * t$95$0), $MachinePrecision] + N[(a$95$m * t$95$0), $MachinePrecision]), $MachinePrecision] * 0.011111111111111112), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 2e+78], N[(N[(2.0 * t$95$2), $MachinePrecision] * N[(N[Sin[N[(N[(angle$95$m / 180.0), $MachinePrecision] * Pi), $MachinePrecision]], $MachinePrecision] * N[Cos[t$95$1], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 5e+116], N[(0.011111111111111112 * N[(angle$95$m * N[(Pi * N[Abs[t$95$2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[Cos[N[(Pi * N[(angle$95$m * -0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(t$95$2 * N[Sin[t$95$1], $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 \left(b_m - a_m\right)\right)\\
t_1 := 0.005555555555555556 \cdot \left(angle_m \cdot \pi\right)\\
t_2 := \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^{-30}:\\
\;\;\;\;\left(b_m \cdot t_0 + a_m \cdot t_0\right) \cdot 0.011111111111111112\\
\mathbf{elif}\;\frac{angle_m}{180} \leq 2 \cdot 10^{+78}:\\
\;\;\;\;\left(2 \cdot t_2\right) \cdot \left(\sin \left(\frac{angle_m}{180} \cdot \pi\right) \cdot \cos t_1\right)\\
\mathbf{elif}\;\frac{angle_m}{180} \leq 5 \cdot 10^{+116}:\\
\;\;\;\;0.011111111111111112 \cdot \left(angle_m \cdot \left(\pi \cdot \left|t_2\right|\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(\cos \left(\pi \cdot \left(angle_m \cdot -0.005555555555555556\right)\right) \cdot \left(t_2 \cdot \sin t_1\right)\right)\\
\end{array}
\end{array}
\end{array}
if (/.f64 angle 180) < 4e-30Initial program 62.5%
associate-*l*62.5%
Simplified62.5%
Taylor expanded in angle around 0 59.4%
unpow259.4%
unpow259.4%
difference-of-squares63.8%
Applied egg-rr63.8%
Taylor expanded in angle around 0 63.8%
*-commutative63.8%
associate-*r*63.9%
*-commutative63.9%
associate-*l*63.8%
+-commutative63.8%
difference-of-squares59.4%
unpow259.4%
unpow259.4%
associate-*l*59.4%
*-commutative59.4%
unpow259.4%
unpow259.4%
difference-of-squares63.9%
*-commutative63.9%
+-commutative63.9%
Simplified63.9%
associate-*r*75.0%
+-commutative75.0%
distribute-lft-in71.0%
*-commutative71.0%
associate-*l*71.0%
*-commutative71.0%
associate-*l*71.1%
Applied egg-rr71.1%
if 4e-30 < (/.f64 angle 180) < 2.00000000000000002e78Initial program 65.1%
associate-*l*65.1%
Simplified65.1%
unpow244.8%
unpow244.8%
difference-of-squares48.6%
Applied egg-rr69.0%
Taylor expanded in angle around inf 72.2%
if 2.00000000000000002e78 < (/.f64 angle 180) < 5.00000000000000025e116Initial program 27.2%
associate-*l*27.2%
Simplified27.2%
Taylor expanded in angle around 0 39.6%
add-sqr-sqrt38.7%
sqrt-unprod52.5%
pow252.5%
Applied egg-rr52.5%
unpow252.5%
rem-sqrt-square51.5%
Simplified51.5%
unpow239.6%
unpow239.6%
difference-of-squares39.6%
Applied egg-rr51.5%
if 5.00000000000000025e116 < (/.f64 angle 180) Initial program 28.2%
Simplified29.5%
unpow226.0%
unpow226.0%
difference-of-squares28.4%
Applied egg-rr29.5%
Taylor expanded in angle around inf 32.1%
associate-*r*35.6%
associate-*r*30.2%
*-commutative30.2%
*-commutative30.2%
*-commutative30.2%
*-commutative30.2%
*-commutative30.2%
associate-*r*35.6%
Simplified35.6%
Final simplification64.9%
a_m = (fabs.f64 a)
b_m = (fabs.f64 b)
angle_m = (fabs.f64 angle)
angle_s = (copysign.f64 1 angle)
(FPCore (angle_s a_m b_m angle_m)
:precision binary64
(let* ((t_0 (* PI (* angle_m (- b_m a_m))))
(t_1 (* (/ angle_m 180.0) PI))
(t_2 (* (- b_m a_m) (+ b_m a_m))))
(*
angle_s
(if (<= (/ angle_m 180.0) 4e-30)
(* (+ (* b_m t_0) (* a_m t_0)) 0.011111111111111112)
(if (<= (/ angle_m 180.0) 4e+75)
(* (* 2.0 t_2) (* (cos t_1) (sin t_1)))
(if (<= (/ angle_m 180.0) 5e+116)
(* 0.011111111111111112 (* angle_m (* PI (fabs t_2))))
(*
2.0
(*
(cos (* PI (* angle_m -0.005555555555555556)))
(* 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 = ((double) M_PI) * (angle_m * (b_m - a_m));
double t_1 = (angle_m / 180.0) * ((double) M_PI);
double t_2 = (b_m - a_m) * (b_m + a_m);
double tmp;
if ((angle_m / 180.0) <= 4e-30) {
tmp = ((b_m * t_0) + (a_m * t_0)) * 0.011111111111111112;
} else if ((angle_m / 180.0) <= 4e+75) {
tmp = (2.0 * t_2) * (cos(t_1) * sin(t_1));
} else if ((angle_m / 180.0) <= 5e+116) {
tmp = 0.011111111111111112 * (angle_m * (((double) M_PI) * fabs(t_2)));
} else {
tmp = 2.0 * (cos((((double) M_PI) * (angle_m * -0.005555555555555556))) * (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 = Math.PI * (angle_m * (b_m - a_m));
double t_1 = (angle_m / 180.0) * Math.PI;
double t_2 = (b_m - a_m) * (b_m + a_m);
double tmp;
if ((angle_m / 180.0) <= 4e-30) {
tmp = ((b_m * t_0) + (a_m * t_0)) * 0.011111111111111112;
} else if ((angle_m / 180.0) <= 4e+75) {
tmp = (2.0 * t_2) * (Math.cos(t_1) * Math.sin(t_1));
} else if ((angle_m / 180.0) <= 5e+116) {
tmp = 0.011111111111111112 * (angle_m * (Math.PI * Math.abs(t_2)));
} else {
tmp = 2.0 * (Math.cos((Math.PI * (angle_m * -0.005555555555555556))) * (t_2 * Math.sin((0.005555555555555556 * (angle_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): t_0 = math.pi * (angle_m * (b_m - a_m)) t_1 = (angle_m / 180.0) * math.pi t_2 = (b_m - a_m) * (b_m + a_m) tmp = 0 if (angle_m / 180.0) <= 4e-30: tmp = ((b_m * t_0) + (a_m * t_0)) * 0.011111111111111112 elif (angle_m / 180.0) <= 4e+75: tmp = (2.0 * t_2) * (math.cos(t_1) * math.sin(t_1)) elif (angle_m / 180.0) <= 5e+116: tmp = 0.011111111111111112 * (angle_m * (math.pi * math.fabs(t_2))) else: tmp = 2.0 * (math.cos((math.pi * (angle_m * -0.005555555555555556))) * (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(pi * Float64(angle_m * Float64(b_m - a_m))) t_1 = Float64(Float64(angle_m / 180.0) * pi) t_2 = Float64(Float64(b_m - a_m) * Float64(b_m + a_m)) tmp = 0.0 if (Float64(angle_m / 180.0) <= 4e-30) tmp = Float64(Float64(Float64(b_m * t_0) + Float64(a_m * t_0)) * 0.011111111111111112); elseif (Float64(angle_m / 180.0) <= 4e+75) tmp = Float64(Float64(2.0 * t_2) * Float64(cos(t_1) * sin(t_1))); elseif (Float64(angle_m / 180.0) <= 5e+116) tmp = Float64(0.011111111111111112 * Float64(angle_m * Float64(pi * abs(t_2)))); else tmp = Float64(2.0 * Float64(cos(Float64(pi * Float64(angle_m * -0.005555555555555556))) * Float64(t_2 * sin(Float64(0.005555555555555556 * Float64(angle_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) t_0 = pi * (angle_m * (b_m - a_m)); t_1 = (angle_m / 180.0) * pi; t_2 = (b_m - a_m) * (b_m + a_m); tmp = 0.0; if ((angle_m / 180.0) <= 4e-30) tmp = ((b_m * t_0) + (a_m * t_0)) * 0.011111111111111112; elseif ((angle_m / 180.0) <= 4e+75) tmp = (2.0 * t_2) * (cos(t_1) * sin(t_1)); elseif ((angle_m / 180.0) <= 5e+116) tmp = 0.011111111111111112 * (angle_m * (pi * abs(t_2))); else tmp = 2.0 * (cos((pi * (angle_m * -0.005555555555555556))) * (t_2 * sin((0.005555555555555556 * (angle_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_] := Block[{t$95$0 = N[(Pi * N[(angle$95$m * N[(b$95$m - a$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(angle$95$m / 180.0), $MachinePrecision] * Pi), $MachinePrecision]}, Block[{t$95$2 = 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-30], N[(N[(N[(b$95$m * t$95$0), $MachinePrecision] + N[(a$95$m * t$95$0), $MachinePrecision]), $MachinePrecision] * 0.011111111111111112), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 4e+75], N[(N[(2.0 * t$95$2), $MachinePrecision] * N[(N[Cos[t$95$1], $MachinePrecision] * N[Sin[t$95$1], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 5e+116], N[(0.011111111111111112 * N[(angle$95$m * N[(Pi * N[Abs[t$95$2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[Cos[N[(Pi * N[(angle$95$m * -0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * 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 := \pi \cdot \left(angle_m \cdot \left(b_m - a_m\right)\right)\\
t_1 := \frac{angle_m}{180} \cdot \pi\\
t_2 := \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^{-30}:\\
\;\;\;\;\left(b_m \cdot t_0 + a_m \cdot t_0\right) \cdot 0.011111111111111112\\
\mathbf{elif}\;\frac{angle_m}{180} \leq 4 \cdot 10^{+75}:\\
\;\;\;\;\left(2 \cdot t_2\right) \cdot \left(\cos t_1 \cdot \sin t_1\right)\\
\mathbf{elif}\;\frac{angle_m}{180} \leq 5 \cdot 10^{+116}:\\
\;\;\;\;0.011111111111111112 \cdot \left(angle_m \cdot \left(\pi \cdot \left|t_2\right|\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(\cos \left(\pi \cdot \left(angle_m \cdot -0.005555555555555556\right)\right) \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 180) < 4e-30Initial program 62.5%
associate-*l*62.5%
Simplified62.5%
Taylor expanded in angle around 0 59.4%
unpow259.4%
unpow259.4%
difference-of-squares63.8%
Applied egg-rr63.8%
Taylor expanded in angle around 0 63.8%
*-commutative63.8%
associate-*r*63.9%
*-commutative63.9%
associate-*l*63.8%
+-commutative63.8%
difference-of-squares59.4%
unpow259.4%
unpow259.4%
associate-*l*59.4%
*-commutative59.4%
unpow259.4%
unpow259.4%
difference-of-squares63.9%
*-commutative63.9%
+-commutative63.9%
Simplified63.9%
associate-*r*75.0%
+-commutative75.0%
distribute-lft-in71.0%
*-commutative71.0%
associate-*l*71.0%
*-commutative71.0%
associate-*l*71.1%
Applied egg-rr71.1%
if 4e-30 < (/.f64 angle 180) < 3.99999999999999971e75Initial program 65.1%
associate-*l*65.1%
Simplified65.1%
unpow244.8%
unpow244.8%
difference-of-squares48.6%
Applied egg-rr69.0%
if 3.99999999999999971e75 < (/.f64 angle 180) < 5.00000000000000025e116Initial program 27.2%
associate-*l*27.2%
Simplified27.2%
Taylor expanded in angle around 0 39.6%
add-sqr-sqrt38.7%
sqrt-unprod52.5%
pow252.5%
Applied egg-rr52.5%
unpow252.5%
rem-sqrt-square51.5%
Simplified51.5%
unpow239.6%
unpow239.6%
difference-of-squares39.6%
Applied egg-rr51.5%
if 5.00000000000000025e116 < (/.f64 angle 180) Initial program 28.2%
Simplified29.5%
unpow226.0%
unpow226.0%
difference-of-squares28.4%
Applied egg-rr29.5%
Taylor expanded in angle around inf 32.1%
associate-*r*35.6%
associate-*r*30.2%
*-commutative30.2%
*-commutative30.2%
*-commutative30.2%
*-commutative30.2%
*-commutative30.2%
associate-*r*35.6%
Simplified35.6%
Final simplification64.6%
a_m = (fabs.f64 a)
b_m = (fabs.f64 b)
angle_m = (fabs.f64 angle)
angle_s = (copysign.f64 1 angle)
(FPCore (angle_s a_m b_m angle_m)
:precision binary64
(let* ((t_0 (* PI (* angle_m (- b_m a_m)))))
(*
angle_s
(if (<= (/ angle_m 180.0) 100.0)
(* (+ (* b_m t_0) (* a_m t_0)) 0.011111111111111112)
(*
2.0
(* (* (- b_m a_m) (+ b_m a_m)) (sin (* (/ angle_m 180.0) 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 = ((double) M_PI) * (angle_m * (b_m - a_m));
double tmp;
if ((angle_m / 180.0) <= 100.0) {
tmp = ((b_m * t_0) + (a_m * t_0)) * 0.011111111111111112;
} else {
tmp = 2.0 * (((b_m - a_m) * (b_m + a_m)) * sin(((angle_m / 180.0) * ((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 = Math.PI * (angle_m * (b_m - a_m));
double tmp;
if ((angle_m / 180.0) <= 100.0) {
tmp = ((b_m * t_0) + (a_m * t_0)) * 0.011111111111111112;
} else {
tmp = 2.0 * (((b_m - a_m) * (b_m + a_m)) * Math.sin(((angle_m / 180.0) * 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): t_0 = math.pi * (angle_m * (b_m - a_m)) tmp = 0 if (angle_m / 180.0) <= 100.0: tmp = ((b_m * t_0) + (a_m * t_0)) * 0.011111111111111112 else: tmp = 2.0 * (((b_m - a_m) * (b_m + a_m)) * math.sin(((angle_m / 180.0) * 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(pi * Float64(angle_m * Float64(b_m - a_m))) tmp = 0.0 if (Float64(angle_m / 180.0) <= 100.0) tmp = Float64(Float64(Float64(b_m * t_0) + Float64(a_m * t_0)) * 0.011111111111111112); else tmp = Float64(2.0 * Float64(Float64(Float64(b_m - a_m) * Float64(b_m + a_m)) * sin(Float64(Float64(angle_m / 180.0) * 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) t_0 = pi * (angle_m * (b_m - a_m)); tmp = 0.0; if ((angle_m / 180.0) <= 100.0) tmp = ((b_m * t_0) + (a_m * t_0)) * 0.011111111111111112; else tmp = 2.0 * (((b_m - a_m) * (b_m + a_m)) * sin(((angle_m / 180.0) * 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_] := Block[{t$95$0 = N[(Pi * N[(angle$95$m * N[(b$95$m - a$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, N[(angle$95$s * If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 100.0], N[(N[(N[(b$95$m * t$95$0), $MachinePrecision] + N[(a$95$m * t$95$0), $MachinePrecision]), $MachinePrecision] * 0.011111111111111112), $MachinePrecision], N[(2.0 * N[(N[(N[(b$95$m - a$95$m), $MachinePrecision] * N[(b$95$m + a$95$m), $MachinePrecision]), $MachinePrecision] * N[Sin[N[(N[(angle$95$m / 180.0), $MachinePrecision] * 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)
\\
\begin{array}{l}
t_0 := \pi \cdot \left(angle_m \cdot \left(b_m - a_m\right)\right)\\
angle_s \cdot \begin{array}{l}
\mathbf{if}\;\frac{angle_m}{180} \leq 100:\\
\;\;\;\;\left(b_m \cdot t_0 + a_m \cdot t_0\right) \cdot 0.011111111111111112\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(\left(\left(b_m - a_m\right) \cdot \left(b_m + a_m\right)\right) \cdot \sin \left(\frac{angle_m}{180} \cdot \pi\right)\right)\\
\end{array}
\end{array}
\end{array}
if (/.f64 angle 180) < 100Initial program 63.9%
associate-*l*63.9%
Simplified63.9%
Taylor expanded in angle around 0 60.6%
unpow260.6%
unpow260.6%
difference-of-squares65.4%
Applied egg-rr65.4%
Taylor expanded in angle around 0 65.4%
*-commutative65.4%
associate-*r*65.4%
*-commutative65.4%
associate-*l*65.4%
+-commutative65.4%
difference-of-squares60.6%
unpow260.6%
unpow260.6%
associate-*l*60.7%
*-commutative60.7%
unpow260.7%
unpow260.7%
difference-of-squares65.4%
*-commutative65.4%
+-commutative65.4%
Simplified65.4%
associate-*r*75.9%
+-commutative75.9%
distribute-lft-in71.7%
*-commutative71.7%
associate-*l*71.7%
*-commutative71.7%
associate-*l*71.7%
Applied egg-rr71.7%
if 100 < (/.f64 angle 180) Initial program 33.4%
Simplified34.5%
unpow226.3%
unpow226.3%
difference-of-squares27.9%
Applied egg-rr34.5%
Taylor expanded in angle around 0 33.5%
Final simplification62.0%
a_m = (fabs.f64 a)
b_m = (fabs.f64 b)
angle_m = (fabs.f64 angle)
angle_s = (copysign.f64 1 angle)
(FPCore (angle_s a_m b_m angle_m)
:precision binary64
(let* ((t_0 (* PI (* angle_m (- b_m a_m)))))
(*
angle_s
(if (<= angle_m 1e+38)
(* (+ (* b_m t_0) (* a_m t_0)) 0.011111111111111112)
(*
0.011111111111111112
(* angle_m (* PI (fabs (* (- 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 = ((double) M_PI) * (angle_m * (b_m - a_m));
double tmp;
if (angle_m <= 1e+38) {
tmp = ((b_m * t_0) + (a_m * t_0)) * 0.011111111111111112;
} else {
tmp = 0.011111111111111112 * (angle_m * (((double) M_PI) * fabs(((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 = Math.PI * (angle_m * (b_m - a_m));
double tmp;
if (angle_m <= 1e+38) {
tmp = ((b_m * t_0) + (a_m * t_0)) * 0.011111111111111112;
} else {
tmp = 0.011111111111111112 * (angle_m * (Math.PI * Math.abs(((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 = math.pi * (angle_m * (b_m - a_m)) tmp = 0 if angle_m <= 1e+38: tmp = ((b_m * t_0) + (a_m * t_0)) * 0.011111111111111112 else: tmp = 0.011111111111111112 * (angle_m * (math.pi * math.fabs(((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(pi * Float64(angle_m * Float64(b_m - a_m))) tmp = 0.0 if (angle_m <= 1e+38) tmp = Float64(Float64(Float64(b_m * t_0) + Float64(a_m * t_0)) * 0.011111111111111112); else tmp = Float64(0.011111111111111112 * Float64(angle_m * Float64(pi * abs(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 = pi * (angle_m * (b_m - a_m)); tmp = 0.0; if (angle_m <= 1e+38) tmp = ((b_m * t_0) + (a_m * t_0)) * 0.011111111111111112; else tmp = 0.011111111111111112 * (angle_m * (pi * abs(((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[(Pi * N[(angle$95$m * N[(b$95$m - a$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, N[(angle$95$s * If[LessEqual[angle$95$m, 1e+38], N[(N[(N[(b$95$m * t$95$0), $MachinePrecision] + N[(a$95$m * t$95$0), $MachinePrecision]), $MachinePrecision] * 0.011111111111111112), $MachinePrecision], N[(0.011111111111111112 * N[(angle$95$m * N[(Pi * N[Abs[N[(N[(b$95$m - a$95$m), $MachinePrecision] * N[(b$95$m + a$95$m), $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 := \pi \cdot \left(angle_m \cdot \left(b_m - a_m\right)\right)\\
angle_s \cdot \begin{array}{l}
\mathbf{if}\;angle_m \leq 10^{+38}:\\
\;\;\;\;\left(b_m \cdot t_0 + a_m \cdot t_0\right) \cdot 0.011111111111111112\\
\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 < 9.99999999999999977e37Initial program 63.3%
associate-*l*63.3%
Simplified63.3%
Taylor expanded in angle around 0 59.4%
unpow259.4%
unpow259.4%
difference-of-squares64.0%
Applied egg-rr64.0%
Taylor expanded in angle around 0 64.0%
*-commutative64.0%
associate-*r*64.0%
*-commutative64.0%
associate-*l*64.0%
+-commutative64.0%
difference-of-squares59.4%
unpow259.4%
unpow259.4%
associate-*l*59.4%
*-commutative59.4%
unpow259.4%
unpow259.4%
difference-of-squares64.0%
*-commutative64.0%
+-commutative64.0%
Simplified64.0%
associate-*r*74.2%
+-commutative74.2%
distribute-lft-in70.1%
*-commutative70.1%
associate-*l*70.1%
*-commutative70.1%
associate-*l*70.1%
Applied egg-rr70.1%
if 9.99999999999999977e37 < angle Initial program 32.4%
associate-*l*32.4%
Simplified32.4%
Taylor expanded in angle around 0 27.0%
add-sqr-sqrt14.5%
sqrt-unprod30.7%
pow230.7%
Applied egg-rr30.7%
unpow230.7%
rem-sqrt-square30.4%
Simplified30.4%
unpow227.0%
unpow227.0%
difference-of-squares28.7%
Applied egg-rr32.1%
Final simplification61.4%
a_m = (fabs.f64 a) b_m = (fabs.f64 b) angle_m = (fabs.f64 angle) angle_s = (copysign.f64 1 angle) (FPCore (angle_s a_m b_m angle_m) :precision binary64 (let* ((t_0 (* PI (* angle_m (- b_m a_m))))) (* angle_s (* (+ (* b_m t_0) (* a_m t_0)) 0.011111111111111112))))
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 * (b_m - a_m));
return angle_s * (((b_m * t_0) + (a_m * t_0)) * 0.011111111111111112);
}
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 * (b_m - a_m));
return angle_s * (((b_m * t_0) + (a_m * t_0)) * 0.011111111111111112);
}
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 = math.pi * (angle_m * (b_m - a_m)) return angle_s * (((b_m * t_0) + (a_m * t_0)) * 0.011111111111111112)
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 * Float64(b_m - a_m))) return Float64(angle_s * Float64(Float64(Float64(b_m * t_0) + Float64(a_m * t_0)) * 0.011111111111111112)) 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) t_0 = pi * (angle_m * (b_m - a_m)); tmp = angle_s * (((b_m * t_0) + (a_m * t_0)) * 0.011111111111111112); 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 * N[(b$95$m - a$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, N[(angle$95$s * N[(N[(N[(b$95$m * t$95$0), $MachinePrecision] + N[(a$95$m * t$95$0), $MachinePrecision]), $MachinePrecision] * 0.011111111111111112), $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 \left(b_m - a_m\right)\right)\\
angle_s \cdot \left(\left(b_m \cdot t_0 + a_m \cdot t_0\right) \cdot 0.011111111111111112\right)
\end{array}
\end{array}
Initial program 56.2%
associate-*l*56.2%
Simplified56.2%
Taylor expanded in angle around 0 51.9%
unpow251.9%
unpow251.9%
difference-of-squares55.9%
Applied egg-rr55.9%
Taylor expanded in angle around 0 55.9%
*-commutative55.9%
associate-*r*55.9%
*-commutative55.9%
associate-*l*55.8%
+-commutative55.8%
difference-of-squares51.9%
unpow251.9%
unpow251.9%
associate-*l*51.9%
*-commutative51.9%
unpow251.9%
unpow251.9%
difference-of-squares55.9%
*-commutative55.9%
+-commutative55.9%
Simplified55.9%
associate-*r*63.4%
+-commutative63.4%
distribute-lft-in57.8%
*-commutative57.8%
associate-*l*57.8%
*-commutative57.8%
associate-*l*57.8%
Applied egg-rr57.8%
Final simplification57.8%
a_m = (fabs.f64 a) b_m = (fabs.f64 b) angle_m = (fabs.f64 angle) angle_s = (copysign.f64 1 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 56.2%
associate-*l*56.2%
Simplified56.2%
Taylor expanded in angle around 0 51.9%
unpow251.9%
unpow251.9%
difference-of-squares55.9%
Applied egg-rr55.9%
Final simplification55.9%
a_m = (fabs.f64 a) b_m = (fabs.f64 b) angle_m = (fabs.f64 angle) angle_s = (copysign.f64 1 angle) (FPCore (angle_s a_m b_m angle_m) :precision binary64 (* angle_s (* 0.011111111111111112 (* (* (- b_m a_m) (+ b_m a_m)) (* 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) {
return angle_s * (0.011111111111111112 * (((b_m - a_m) * (b_m + a_m)) * (angle_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 * (((b_m - a_m) * (b_m + a_m)) * (angle_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 * (((b_m - a_m) * (b_m + a_m)) * (angle_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(Float64(Float64(b_m - a_m) * Float64(b_m + a_m)) * Float64(angle_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 * (((b_m - a_m) * (b_m + a_m)) * (angle_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[(N[(N[(b$95$m - a$95$m), $MachinePrecision] * N[(b$95$m + a$95$m), $MachinePrecision]), $MachinePrecision] * N[(angle$95$m * Pi), $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(\left(\left(b_m - a_m\right) \cdot \left(b_m + a_m\right)\right) \cdot \left(angle_m \cdot \pi\right)\right)\right)
\end{array}
Initial program 56.2%
associate-*l*56.2%
Simplified56.2%
Taylor expanded in angle around 0 51.9%
unpow251.9%
unpow251.9%
difference-of-squares55.9%
Applied egg-rr55.9%
Taylor expanded in angle around 0 55.9%
*-commutative55.9%
associate-*r*55.9%
*-commutative55.9%
associate-*l*55.8%
+-commutative55.8%
difference-of-squares51.9%
unpow251.9%
unpow251.9%
associate-*l*51.9%
*-commutative51.9%
unpow251.9%
unpow251.9%
difference-of-squares55.9%
*-commutative55.9%
+-commutative55.9%
Simplified55.9%
Final simplification55.9%
herbie shell --seed 2023336
(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)))))