
(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 19 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}
angle_m = (fabs.f64 angle)
angle_s = (copysign.f64 1 angle)
(FPCore (angle_s a b angle_m)
:precision binary64
(let* ((t_0 (sqrt (* angle_m PI)))
(t_1 (* (+ a b) (- b a)))
(t_2 (* 2.0 t_1))
(t_3 (sin (* PI (* angle_m 0.005555555555555556))))
(t_4 (cbrt (* angle_m PI)))
(t_5 (* (/ angle_m 180.0) PI))
(t_6 (* angle_m (* PI 0.005555555555555556)))
(t_7 (cos t_5)))
(*
angle_s
(if (<= (/ angle_m 180.0) 1e-33)
(* 0.011111111111111112 (* (* (+ a b) (* angle_m PI)) (- b a)))
(if (<= (/ angle_m 180.0) 2e+52)
(* (cos (pow (cbrt t_6) 3.0)) (* t_2 t_3))
(if (<= (/ angle_m 180.0) 1e+86)
(* 2.0 (* t_7 (* t_1 (sqrt (pow t_3 2.0)))))
(if (<= (/ angle_m 180.0) 4e+132)
(* t_2 (sin (/ (pow t_4 2.0) (/ 180.0 t_4))))
(if (<= (/ angle_m 180.0) 5e+194)
(* (* t_2 (sin t_5)) (cos (/ t_0 (/ 180.0 t_0))))
(* t_7 (* t_2 (sin (pow (sqrt t_6) 2.0))))))))))))angle_m = fabs(angle);
angle_s = copysign(1.0, angle);
double code(double angle_s, double a, double b, double angle_m) {
double t_0 = sqrt((angle_m * ((double) M_PI)));
double t_1 = (a + b) * (b - a);
double t_2 = 2.0 * t_1;
double t_3 = sin((((double) M_PI) * (angle_m * 0.005555555555555556)));
double t_4 = cbrt((angle_m * ((double) M_PI)));
double t_5 = (angle_m / 180.0) * ((double) M_PI);
double t_6 = angle_m * (((double) M_PI) * 0.005555555555555556);
double t_7 = cos(t_5);
double tmp;
if ((angle_m / 180.0) <= 1e-33) {
tmp = 0.011111111111111112 * (((a + b) * (angle_m * ((double) M_PI))) * (b - a));
} else if ((angle_m / 180.0) <= 2e+52) {
tmp = cos(pow(cbrt(t_6), 3.0)) * (t_2 * t_3);
} else if ((angle_m / 180.0) <= 1e+86) {
tmp = 2.0 * (t_7 * (t_1 * sqrt(pow(t_3, 2.0))));
} else if ((angle_m / 180.0) <= 4e+132) {
tmp = t_2 * sin((pow(t_4, 2.0) / (180.0 / t_4)));
} else if ((angle_m / 180.0) <= 5e+194) {
tmp = (t_2 * sin(t_5)) * cos((t_0 / (180.0 / t_0)));
} else {
tmp = t_7 * (t_2 * sin(pow(sqrt(t_6), 2.0)));
}
return angle_s * tmp;
}
angle_m = Math.abs(angle);
angle_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b, double angle_m) {
double t_0 = Math.sqrt((angle_m * Math.PI));
double t_1 = (a + b) * (b - a);
double t_2 = 2.0 * t_1;
double t_3 = Math.sin((Math.PI * (angle_m * 0.005555555555555556)));
double t_4 = Math.cbrt((angle_m * Math.PI));
double t_5 = (angle_m / 180.0) * Math.PI;
double t_6 = angle_m * (Math.PI * 0.005555555555555556);
double t_7 = Math.cos(t_5);
double tmp;
if ((angle_m / 180.0) <= 1e-33) {
tmp = 0.011111111111111112 * (((a + b) * (angle_m * Math.PI)) * (b - a));
} else if ((angle_m / 180.0) <= 2e+52) {
tmp = Math.cos(Math.pow(Math.cbrt(t_6), 3.0)) * (t_2 * t_3);
} else if ((angle_m / 180.0) <= 1e+86) {
tmp = 2.0 * (t_7 * (t_1 * Math.sqrt(Math.pow(t_3, 2.0))));
} else if ((angle_m / 180.0) <= 4e+132) {
tmp = t_2 * Math.sin((Math.pow(t_4, 2.0) / (180.0 / t_4)));
} else if ((angle_m / 180.0) <= 5e+194) {
tmp = (t_2 * Math.sin(t_5)) * Math.cos((t_0 / (180.0 / t_0)));
} else {
tmp = t_7 * (t_2 * Math.sin(Math.pow(Math.sqrt(t_6), 2.0)));
}
return angle_s * tmp;
}
angle_m = abs(angle) angle_s = copysign(1.0, angle) function code(angle_s, a, b, angle_m) t_0 = sqrt(Float64(angle_m * pi)) t_1 = Float64(Float64(a + b) * Float64(b - a)) t_2 = Float64(2.0 * t_1) t_3 = sin(Float64(pi * Float64(angle_m * 0.005555555555555556))) t_4 = cbrt(Float64(angle_m * pi)) t_5 = Float64(Float64(angle_m / 180.0) * pi) t_6 = Float64(angle_m * Float64(pi * 0.005555555555555556)) t_7 = cos(t_5) tmp = 0.0 if (Float64(angle_m / 180.0) <= 1e-33) tmp = Float64(0.011111111111111112 * Float64(Float64(Float64(a + b) * Float64(angle_m * pi)) * Float64(b - a))); elseif (Float64(angle_m / 180.0) <= 2e+52) tmp = Float64(cos((cbrt(t_6) ^ 3.0)) * Float64(t_2 * t_3)); elseif (Float64(angle_m / 180.0) <= 1e+86) tmp = Float64(2.0 * Float64(t_7 * Float64(t_1 * sqrt((t_3 ^ 2.0))))); elseif (Float64(angle_m / 180.0) <= 4e+132) tmp = Float64(t_2 * sin(Float64((t_4 ^ 2.0) / Float64(180.0 / t_4)))); elseif (Float64(angle_m / 180.0) <= 5e+194) tmp = Float64(Float64(t_2 * sin(t_5)) * cos(Float64(t_0 / Float64(180.0 / t_0)))); else tmp = Float64(t_7 * Float64(t_2 * sin((sqrt(t_6) ^ 2.0)))); end return Float64(angle_s * tmp) end
angle_m = N[Abs[angle], $MachinePrecision]
angle_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a_, b_, angle$95$m_] := Block[{t$95$0 = N[Sqrt[N[(angle$95$m * Pi), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(N[(a + b), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(2.0 * t$95$1), $MachinePrecision]}, Block[{t$95$3 = N[Sin[N[(Pi * N[(angle$95$m * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$4 = N[Power[N[(angle$95$m * Pi), $MachinePrecision], 1/3], $MachinePrecision]}, Block[{t$95$5 = N[(N[(angle$95$m / 180.0), $MachinePrecision] * Pi), $MachinePrecision]}, Block[{t$95$6 = N[(angle$95$m * N[(Pi * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$7 = N[Cos[t$95$5], $MachinePrecision]}, N[(angle$95$s * If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 1e-33], N[(0.011111111111111112 * N[(N[(N[(a + b), $MachinePrecision] * N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 2e+52], N[(N[Cos[N[Power[N[Power[t$95$6, 1/3], $MachinePrecision], 3.0], $MachinePrecision]], $MachinePrecision] * N[(t$95$2 * t$95$3), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 1e+86], N[(2.0 * N[(t$95$7 * N[(t$95$1 * N[Sqrt[N[Power[t$95$3, 2.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 4e+132], N[(t$95$2 * N[Sin[N[(N[Power[t$95$4, 2.0], $MachinePrecision] / N[(180.0 / t$95$4), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 5e+194], N[(N[(t$95$2 * N[Sin[t$95$5], $MachinePrecision]), $MachinePrecision] * N[Cos[N[(t$95$0 / N[(180.0 / t$95$0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(t$95$7 * N[(t$95$2 * N[Sin[N[Power[N[Sqrt[t$95$6], $MachinePrecision], 2.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]), $MachinePrecision]]]]]]]]]
\begin{array}{l}
angle_m = \left|angle\right|
\\
angle_s = \mathsf{copysign}\left(1, angle\right)
\\
\begin{array}{l}
t_0 := \sqrt{angle_m \cdot \pi}\\
t_1 := \left(a + b\right) \cdot \left(b - a\right)\\
t_2 := 2 \cdot t_1\\
t_3 := \sin \left(\pi \cdot \left(angle_m \cdot 0.005555555555555556\right)\right)\\
t_4 := \sqrt[3]{angle_m \cdot \pi}\\
t_5 := \frac{angle_m}{180} \cdot \pi\\
t_6 := angle_m \cdot \left(\pi \cdot 0.005555555555555556\right)\\
t_7 := \cos t_5\\
angle_s \cdot \begin{array}{l}
\mathbf{if}\;\frac{angle_m}{180} \leq 10^{-33}:\\
\;\;\;\;0.011111111111111112 \cdot \left(\left(\left(a + b\right) \cdot \left(angle_m \cdot \pi\right)\right) \cdot \left(b - a\right)\right)\\
\mathbf{elif}\;\frac{angle_m}{180} \leq 2 \cdot 10^{+52}:\\
\;\;\;\;\cos \left({\left(\sqrt[3]{t_6}\right)}^{3}\right) \cdot \left(t_2 \cdot t_3\right)\\
\mathbf{elif}\;\frac{angle_m}{180} \leq 10^{+86}:\\
\;\;\;\;2 \cdot \left(t_7 \cdot \left(t_1 \cdot \sqrt{{t_3}^{2}}\right)\right)\\
\mathbf{elif}\;\frac{angle_m}{180} \leq 4 \cdot 10^{+132}:\\
\;\;\;\;t_2 \cdot \sin \left(\frac{{t_4}^{2}}{\frac{180}{t_4}}\right)\\
\mathbf{elif}\;\frac{angle_m}{180} \leq 5 \cdot 10^{+194}:\\
\;\;\;\;\left(t_2 \cdot \sin t_5\right) \cdot \cos \left(\frac{t_0}{\frac{180}{t_0}}\right)\\
\mathbf{else}:\\
\;\;\;\;t_7 \cdot \left(t_2 \cdot \sin \left({\left(\sqrt{t_6}\right)}^{2}\right)\right)\\
\end{array}
\end{array}
\end{array}
if (/.f64 angle 180) < 1.0000000000000001e-33Initial program 57.0%
unpow257.0%
unpow257.0%
difference-of-squares59.6%
Applied egg-rr59.6%
Taylor expanded in angle around 0 57.7%
Taylor expanded in angle around 0 56.7%
expm1-log1p-u46.2%
expm1-udef33.1%
associate-*r*33.1%
+-commutative33.1%
Applied egg-rr33.1%
expm1-def46.1%
expm1-log1p56.7%
associate-*r*74.1%
+-commutative74.1%
Simplified74.1%
if 1.0000000000000001e-33 < (/.f64 angle 180) < 2e52Initial program 74.2%
unpow274.2%
unpow274.2%
difference-of-squares74.2%
Applied egg-rr74.2%
div-inv74.2%
metadata-eval74.2%
add-cube-cbrt74.3%
pow374.3%
associate-*r*74.1%
*-commutative74.1%
*-commutative74.1%
associate-*r*74.3%
*-commutative74.3%
associate-*l*74.3%
Applied egg-rr74.3%
Taylor expanded in angle around inf 72.4%
associate-*r*74.3%
*-commutative74.3%
Simplified74.3%
if 2e52 < (/.f64 angle 180) < 1e86Initial program 33.8%
associate-*l*33.8%
associate-*l*33.8%
Simplified33.8%
unpow233.8%
unpow233.8%
difference-of-squares43.8%
Applied egg-rr43.8%
add-sqr-sqrt41.8%
sqrt-unprod72.6%
pow272.6%
div-inv72.5%
metadata-eval72.5%
Applied egg-rr72.5%
if 1e86 < (/.f64 angle 180) < 3.99999999999999996e132Initial program 30.0%
unpow230.0%
unpow230.0%
difference-of-squares53.0%
Applied egg-rr53.0%
Taylor expanded in angle around 0 53.6%
associate-*r/44.8%
*-commutative44.8%
add-cube-cbrt46.2%
associate-/l*54.3%
pow254.3%
*-commutative54.3%
*-commutative54.3%
Applied egg-rr54.3%
if 3.99999999999999996e132 < (/.f64 angle 180) < 4.99999999999999989e194Initial program 33.9%
unpow233.9%
unpow233.9%
difference-of-squares33.9%
Applied egg-rr33.9%
associate-*r/5.6%
*-commutative5.6%
add-sqr-sqrt34.3%
associate-/l*50.9%
*-commutative50.9%
*-commutative50.9%
Applied egg-rr50.9%
if 4.99999999999999989e194 < (/.f64 angle 180) Initial program 25.0%
unpow225.0%
unpow225.0%
difference-of-squares30.5%
Applied egg-rr30.5%
div-inv29.4%
metadata-eval29.4%
add-sqr-sqrt30.3%
pow230.3%
associate-*r*35.1%
*-commutative35.1%
*-commutative35.1%
associate-*r*30.3%
*-commutative30.3%
associate-*l*30.3%
Applied egg-rr30.3%
Final simplification69.4%
angle_m = (fabs.f64 angle)
angle_s = (copysign.f64 1 angle)
(FPCore (angle_s a b angle_m)
:precision binary64
(let* ((t_0 (cbrt (* angle_m PI)))
(t_1 (/ (pow t_0 2.0) (/ 180.0 t_0)))
(t_2 (* 2.0 (* (+ a b) (- b a))))
(t_3
(pow
(cbrt (* angle_m (* 0.005555555555555556 (cbrt (pow PI 3.0)))))
3.0)))
(*
angle_s
(if (<= (/ angle_m 180.0) 2e-35)
(* 0.011111111111111112 (* (* (+ a b) (* angle_m PI)) (- b a)))
(if (<= (/ angle_m 180.0) 2.2e+119)
(*
(* t_2 (sin t_3))
(cos (pow (cbrt (* angle_m (* PI 0.005555555555555556))) 3.0)))
(if (<= (/ angle_m 180.0) 1e+228)
(* (* t_2 (sin (* (/ angle_m 180.0) PI))) (cos t_3))
(* (cos t_1) (* t_2 (sin t_1)))))))))angle_m = fabs(angle);
angle_s = copysign(1.0, angle);
double code(double angle_s, double a, double b, double angle_m) {
double t_0 = cbrt((angle_m * ((double) M_PI)));
double t_1 = pow(t_0, 2.0) / (180.0 / t_0);
double t_2 = 2.0 * ((a + b) * (b - a));
double t_3 = pow(cbrt((angle_m * (0.005555555555555556 * cbrt(pow(((double) M_PI), 3.0))))), 3.0);
double tmp;
if ((angle_m / 180.0) <= 2e-35) {
tmp = 0.011111111111111112 * (((a + b) * (angle_m * ((double) M_PI))) * (b - a));
} else if ((angle_m / 180.0) <= 2.2e+119) {
tmp = (t_2 * sin(t_3)) * cos(pow(cbrt((angle_m * (((double) M_PI) * 0.005555555555555556))), 3.0));
} else if ((angle_m / 180.0) <= 1e+228) {
tmp = (t_2 * sin(((angle_m / 180.0) * ((double) M_PI)))) * cos(t_3);
} else {
tmp = cos(t_1) * (t_2 * sin(t_1));
}
return angle_s * tmp;
}
angle_m = Math.abs(angle);
angle_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b, double angle_m) {
double t_0 = Math.cbrt((angle_m * Math.PI));
double t_1 = Math.pow(t_0, 2.0) / (180.0 / t_0);
double t_2 = 2.0 * ((a + b) * (b - a));
double t_3 = Math.pow(Math.cbrt((angle_m * (0.005555555555555556 * Math.cbrt(Math.pow(Math.PI, 3.0))))), 3.0);
double tmp;
if ((angle_m / 180.0) <= 2e-35) {
tmp = 0.011111111111111112 * (((a + b) * (angle_m * Math.PI)) * (b - a));
} else if ((angle_m / 180.0) <= 2.2e+119) {
tmp = (t_2 * Math.sin(t_3)) * Math.cos(Math.pow(Math.cbrt((angle_m * (Math.PI * 0.005555555555555556))), 3.0));
} else if ((angle_m / 180.0) <= 1e+228) {
tmp = (t_2 * Math.sin(((angle_m / 180.0) * Math.PI))) * Math.cos(t_3);
} else {
tmp = Math.cos(t_1) * (t_2 * Math.sin(t_1));
}
return angle_s * tmp;
}
angle_m = abs(angle) angle_s = copysign(1.0, angle) function code(angle_s, a, b, angle_m) t_0 = cbrt(Float64(angle_m * pi)) t_1 = Float64((t_0 ^ 2.0) / Float64(180.0 / t_0)) t_2 = Float64(2.0 * Float64(Float64(a + b) * Float64(b - a))) t_3 = cbrt(Float64(angle_m * Float64(0.005555555555555556 * cbrt((pi ^ 3.0))))) ^ 3.0 tmp = 0.0 if (Float64(angle_m / 180.0) <= 2e-35) tmp = Float64(0.011111111111111112 * Float64(Float64(Float64(a + b) * Float64(angle_m * pi)) * Float64(b - a))); elseif (Float64(angle_m / 180.0) <= 2.2e+119) tmp = Float64(Float64(t_2 * sin(t_3)) * cos((cbrt(Float64(angle_m * Float64(pi * 0.005555555555555556))) ^ 3.0))); elseif (Float64(angle_m / 180.0) <= 1e+228) tmp = Float64(Float64(t_2 * sin(Float64(Float64(angle_m / 180.0) * pi))) * cos(t_3)); else tmp = Float64(cos(t_1) * Float64(t_2 * sin(t_1))); end return Float64(angle_s * tmp) end
angle_m = N[Abs[angle], $MachinePrecision]
angle_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a_, b_, angle$95$m_] := Block[{t$95$0 = N[Power[N[(angle$95$m * Pi), $MachinePrecision], 1/3], $MachinePrecision]}, Block[{t$95$1 = N[(N[Power[t$95$0, 2.0], $MachinePrecision] / N[(180.0 / t$95$0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(2.0 * N[(N[(a + b), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[Power[N[Power[N[(angle$95$m * N[(0.005555555555555556 * N[Power[N[Power[Pi, 3.0], $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision], 3.0], $MachinePrecision]}, N[(angle$95$s * If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 2e-35], N[(0.011111111111111112 * N[(N[(N[(a + b), $MachinePrecision] * N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 2.2e+119], N[(N[(t$95$2 * N[Sin[t$95$3], $MachinePrecision]), $MachinePrecision] * N[Cos[N[Power[N[Power[N[(angle$95$m * N[(Pi * 0.005555555555555556), $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision], 3.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 1e+228], N[(N[(t$95$2 * N[Sin[N[(N[(angle$95$m / 180.0), $MachinePrecision] * Pi), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[Cos[t$95$3], $MachinePrecision]), $MachinePrecision], N[(N[Cos[t$95$1], $MachinePrecision] * N[(t$95$2 * N[Sin[t$95$1], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]), $MachinePrecision]]]]]
\begin{array}{l}
angle_m = \left|angle\right|
\\
angle_s = \mathsf{copysign}\left(1, angle\right)
\\
\begin{array}{l}
t_0 := \sqrt[3]{angle_m \cdot \pi}\\
t_1 := \frac{{t_0}^{2}}{\frac{180}{t_0}}\\
t_2 := 2 \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)\\
t_3 := {\left(\sqrt[3]{angle_m \cdot \left(0.005555555555555556 \cdot \sqrt[3]{{\pi}^{3}}\right)}\right)}^{3}\\
angle_s \cdot \begin{array}{l}
\mathbf{if}\;\frac{angle_m}{180} \leq 2 \cdot 10^{-35}:\\
\;\;\;\;0.011111111111111112 \cdot \left(\left(\left(a + b\right) \cdot \left(angle_m \cdot \pi\right)\right) \cdot \left(b - a\right)\right)\\
\mathbf{elif}\;\frac{angle_m}{180} \leq 2.2 \cdot 10^{+119}:\\
\;\;\;\;\left(t_2 \cdot \sin t_3\right) \cdot \cos \left({\left(\sqrt[3]{angle_m \cdot \left(\pi \cdot 0.005555555555555556\right)}\right)}^{3}\right)\\
\mathbf{elif}\;\frac{angle_m}{180} \leq 10^{+228}:\\
\;\;\;\;\left(t_2 \cdot \sin \left(\frac{angle_m}{180} \cdot \pi\right)\right) \cdot \cos t_3\\
\mathbf{else}:\\
\;\;\;\;\cos t_1 \cdot \left(t_2 \cdot \sin t_1\right)\\
\end{array}
\end{array}
\end{array}
if (/.f64 angle 180) < 2.00000000000000002e-35Initial program 56.8%
unpow256.8%
unpow256.8%
difference-of-squares59.4%
Applied egg-rr59.4%
Taylor expanded in angle around 0 57.5%
Taylor expanded in angle around 0 56.5%
expm1-log1p-u46.0%
expm1-udef32.8%
associate-*r*32.8%
+-commutative32.8%
Applied egg-rr32.8%
expm1-def45.9%
expm1-log1p56.5%
associate-*r*74.0%
+-commutative74.0%
Simplified74.0%
if 2.00000000000000002e-35 < (/.f64 angle 180) < 2.2000000000000001e119Initial program 47.1%
unpow247.1%
unpow247.1%
difference-of-squares57.5%
Applied egg-rr57.5%
div-inv57.0%
metadata-eval57.0%
add-cube-cbrt52.1%
pow352.0%
associate-*r*52.0%
*-commutative52.0%
*-commutative52.0%
associate-*r*52.0%
*-commutative52.0%
associate-*l*52.6%
Applied egg-rr52.6%
div-inv57.0%
metadata-eval57.0%
add-cube-cbrt52.1%
pow352.0%
associate-*r*52.0%
*-commutative52.0%
*-commutative52.0%
associate-*r*52.0%
*-commutative52.0%
associate-*l*52.6%
Applied egg-rr59.4%
add-cbrt-cube63.4%
pow363.4%
Applied egg-rr63.4%
if 2.2000000000000001e119 < (/.f64 angle 180) < 9.9999999999999992e227Initial program 32.4%
unpow232.4%
unpow232.4%
difference-of-squares43.5%
Applied egg-rr43.5%
div-inv32.4%
metadata-eval32.4%
add-cube-cbrt25.8%
pow323.7%
associate-*r*30.0%
*-commutative30.0%
*-commutative30.0%
associate-*r*23.7%
*-commutative23.7%
associate-*l*29.2%
Applied egg-rr29.2%
add-cbrt-cube30.0%
pow330.0%
Applied egg-rr42.1%
if 9.9999999999999992e227 < (/.f64 angle 180) Initial program 25.4%
unpow225.4%
unpow225.4%
difference-of-squares25.4%
Applied egg-rr25.4%
associate-*r/42.5%
*-commutative42.5%
add-cube-cbrt31.6%
associate-/l*32.7%
pow232.7%
*-commutative32.7%
*-commutative32.7%
Applied egg-rr24.1%
associate-*r/42.5%
*-commutative42.5%
add-cube-cbrt31.6%
associate-/l*32.7%
pow232.7%
*-commutative32.7%
*-commutative32.7%
Applied egg-rr42.2%
Final simplification69.1%
angle_m = (fabs.f64 angle)
angle_s = (copysign.f64 1 angle)
(FPCore (angle_s a b angle_m)
:precision binary64
(let* ((t_0 (pow (cbrt (* angle_m (* PI 0.005555555555555556))) 3.0))
(t_1 (cos t_0))
(t_2 (* 2.0 (* (+ a b) (- b a))))
(t_3
(pow
(cbrt (* angle_m (* 0.005555555555555556 (cbrt (pow PI 3.0)))))
3.0)))
(*
angle_s
(if (<= (/ angle_m 180.0) 2e-35)
(* 0.011111111111111112 (* (* (+ a b) (* angle_m PI)) (- b a)))
(if (<= (/ angle_m 180.0) 2.2e+119)
(* (* t_2 (sin t_3)) t_1)
(if (<= (/ angle_m 180.0) 1e+228)
(* (* t_2 (sin (* (/ angle_m 180.0) PI))) (cos t_3))
(* t_1 (* t_2 (sin t_0)))))))))angle_m = fabs(angle);
angle_s = copysign(1.0, angle);
double code(double angle_s, double a, double b, double angle_m) {
double t_0 = pow(cbrt((angle_m * (((double) M_PI) * 0.005555555555555556))), 3.0);
double t_1 = cos(t_0);
double t_2 = 2.0 * ((a + b) * (b - a));
double t_3 = pow(cbrt((angle_m * (0.005555555555555556 * cbrt(pow(((double) M_PI), 3.0))))), 3.0);
double tmp;
if ((angle_m / 180.0) <= 2e-35) {
tmp = 0.011111111111111112 * (((a + b) * (angle_m * ((double) M_PI))) * (b - a));
} else if ((angle_m / 180.0) <= 2.2e+119) {
tmp = (t_2 * sin(t_3)) * t_1;
} else if ((angle_m / 180.0) <= 1e+228) {
tmp = (t_2 * sin(((angle_m / 180.0) * ((double) M_PI)))) * cos(t_3);
} else {
tmp = t_1 * (t_2 * sin(t_0));
}
return angle_s * tmp;
}
angle_m = Math.abs(angle);
angle_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b, double angle_m) {
double t_0 = Math.pow(Math.cbrt((angle_m * (Math.PI * 0.005555555555555556))), 3.0);
double t_1 = Math.cos(t_0);
double t_2 = 2.0 * ((a + b) * (b - a));
double t_3 = Math.pow(Math.cbrt((angle_m * (0.005555555555555556 * Math.cbrt(Math.pow(Math.PI, 3.0))))), 3.0);
double tmp;
if ((angle_m / 180.0) <= 2e-35) {
tmp = 0.011111111111111112 * (((a + b) * (angle_m * Math.PI)) * (b - a));
} else if ((angle_m / 180.0) <= 2.2e+119) {
tmp = (t_2 * Math.sin(t_3)) * t_1;
} else if ((angle_m / 180.0) <= 1e+228) {
tmp = (t_2 * Math.sin(((angle_m / 180.0) * Math.PI))) * Math.cos(t_3);
} else {
tmp = t_1 * (t_2 * Math.sin(t_0));
}
return angle_s * tmp;
}
angle_m = abs(angle) angle_s = copysign(1.0, angle) function code(angle_s, a, b, angle_m) t_0 = cbrt(Float64(angle_m * Float64(pi * 0.005555555555555556))) ^ 3.0 t_1 = cos(t_0) t_2 = Float64(2.0 * Float64(Float64(a + b) * Float64(b - a))) t_3 = cbrt(Float64(angle_m * Float64(0.005555555555555556 * cbrt((pi ^ 3.0))))) ^ 3.0 tmp = 0.0 if (Float64(angle_m / 180.0) <= 2e-35) tmp = Float64(0.011111111111111112 * Float64(Float64(Float64(a + b) * Float64(angle_m * pi)) * Float64(b - a))); elseif (Float64(angle_m / 180.0) <= 2.2e+119) tmp = Float64(Float64(t_2 * sin(t_3)) * t_1); elseif (Float64(angle_m / 180.0) <= 1e+228) tmp = Float64(Float64(t_2 * sin(Float64(Float64(angle_m / 180.0) * pi))) * cos(t_3)); else tmp = Float64(t_1 * Float64(t_2 * sin(t_0))); end return Float64(angle_s * tmp) end
angle_m = N[Abs[angle], $MachinePrecision]
angle_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a_, b_, angle$95$m_] := Block[{t$95$0 = N[Power[N[Power[N[(angle$95$m * N[(Pi * 0.005555555555555556), $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision], 3.0], $MachinePrecision]}, Block[{t$95$1 = N[Cos[t$95$0], $MachinePrecision]}, Block[{t$95$2 = N[(2.0 * N[(N[(a + b), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[Power[N[Power[N[(angle$95$m * N[(0.005555555555555556 * N[Power[N[Power[Pi, 3.0], $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision], 3.0], $MachinePrecision]}, N[(angle$95$s * If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 2e-35], N[(0.011111111111111112 * N[(N[(N[(a + b), $MachinePrecision] * N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 2.2e+119], N[(N[(t$95$2 * N[Sin[t$95$3], $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 1e+228], N[(N[(t$95$2 * N[Sin[N[(N[(angle$95$m / 180.0), $MachinePrecision] * Pi), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[Cos[t$95$3], $MachinePrecision]), $MachinePrecision], N[(t$95$1 * N[(t$95$2 * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]), $MachinePrecision]]]]]
\begin{array}{l}
angle_m = \left|angle\right|
\\
angle_s = \mathsf{copysign}\left(1, angle\right)
\\
\begin{array}{l}
t_0 := {\left(\sqrt[3]{angle_m \cdot \left(\pi \cdot 0.005555555555555556\right)}\right)}^{3}\\
t_1 := \cos t_0\\
t_2 := 2 \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)\\
t_3 := {\left(\sqrt[3]{angle_m \cdot \left(0.005555555555555556 \cdot \sqrt[3]{{\pi}^{3}}\right)}\right)}^{3}\\
angle_s \cdot \begin{array}{l}
\mathbf{if}\;\frac{angle_m}{180} \leq 2 \cdot 10^{-35}:\\
\;\;\;\;0.011111111111111112 \cdot \left(\left(\left(a + b\right) \cdot \left(angle_m \cdot \pi\right)\right) \cdot \left(b - a\right)\right)\\
\mathbf{elif}\;\frac{angle_m}{180} \leq 2.2 \cdot 10^{+119}:\\
\;\;\;\;\left(t_2 \cdot \sin t_3\right) \cdot t_1\\
\mathbf{elif}\;\frac{angle_m}{180} \leq 10^{+228}:\\
\;\;\;\;\left(t_2 \cdot \sin \left(\frac{angle_m}{180} \cdot \pi\right)\right) \cdot \cos t_3\\
\mathbf{else}:\\
\;\;\;\;t_1 \cdot \left(t_2 \cdot \sin t_0\right)\\
\end{array}
\end{array}
\end{array}
if (/.f64 angle 180) < 2.00000000000000002e-35Initial program 56.8%
unpow256.8%
unpow256.8%
difference-of-squares59.4%
Applied egg-rr59.4%
Taylor expanded in angle around 0 57.5%
Taylor expanded in angle around 0 56.5%
expm1-log1p-u46.0%
expm1-udef32.8%
associate-*r*32.8%
+-commutative32.8%
Applied egg-rr32.8%
expm1-def45.9%
expm1-log1p56.5%
associate-*r*74.0%
+-commutative74.0%
Simplified74.0%
if 2.00000000000000002e-35 < (/.f64 angle 180) < 2.2000000000000001e119Initial program 47.1%
unpow247.1%
unpow247.1%
difference-of-squares57.5%
Applied egg-rr57.5%
div-inv57.0%
metadata-eval57.0%
add-cube-cbrt52.1%
pow352.0%
associate-*r*52.0%
*-commutative52.0%
*-commutative52.0%
associate-*r*52.0%
*-commutative52.0%
associate-*l*52.6%
Applied egg-rr52.6%
div-inv57.0%
metadata-eval57.0%
add-cube-cbrt52.1%
pow352.0%
associate-*r*52.0%
*-commutative52.0%
*-commutative52.0%
associate-*r*52.0%
*-commutative52.0%
associate-*l*52.6%
Applied egg-rr59.4%
add-cbrt-cube63.4%
pow363.4%
Applied egg-rr63.4%
if 2.2000000000000001e119 < (/.f64 angle 180) < 9.9999999999999992e227Initial program 32.4%
unpow232.4%
unpow232.4%
difference-of-squares43.5%
Applied egg-rr43.5%
div-inv32.4%
metadata-eval32.4%
add-cube-cbrt25.8%
pow323.7%
associate-*r*30.0%
*-commutative30.0%
*-commutative30.0%
associate-*r*23.7%
*-commutative23.7%
associate-*l*29.2%
Applied egg-rr29.2%
add-cbrt-cube30.0%
pow330.0%
Applied egg-rr42.1%
if 9.9999999999999992e227 < (/.f64 angle 180) Initial program 25.4%
unpow225.4%
unpow225.4%
difference-of-squares25.4%
Applied egg-rr25.4%
div-inv24.5%
metadata-eval24.5%
add-cube-cbrt26.5%
pow324.6%
associate-*r*23.7%
*-commutative23.7%
*-commutative23.7%
associate-*r*24.6%
*-commutative24.6%
associate-*l*23.8%
Applied egg-rr23.8%
div-inv24.5%
metadata-eval24.5%
add-cube-cbrt26.5%
pow324.6%
associate-*r*23.7%
*-commutative23.7%
*-commutative23.7%
associate-*r*24.6%
*-commutative24.6%
associate-*l*23.8%
Applied egg-rr44.2%
Final simplification69.2%
angle_m = (fabs.f64 angle)
angle_s = (copysign.f64 1 angle)
(FPCore (angle_s a b angle_m)
:precision binary64
(let* ((t_0 (* 2.0 (* (+ a b) (- b a))))
(t_1 (sqrt (* angle_m PI)))
(t_2 (pow (cbrt (* angle_m (* PI 0.005555555555555556))) 3.0))
(t_3 (cbrt (* angle_m PI))))
(*
angle_s
(if (<= (/ angle_m 180.0) 2e-35)
(* 0.011111111111111112 (* (* (+ a b) (* angle_m PI)) (- b a)))
(if (<= (/ angle_m 180.0) 2e+60)
(* (cos t_2) (* t_0 (sin t_2)))
(if (<= (/ angle_m 180.0) 4e+132)
(* t_0 (sin (/ (pow t_3 2.0) (/ 180.0 t_3))))
(*
(* t_0 (sin (/ t_1 (/ 180.0 t_1))))
(cos (* (/ angle_m 180.0) PI)))))))))angle_m = fabs(angle);
angle_s = copysign(1.0, angle);
double code(double angle_s, double a, double b, double angle_m) {
double t_0 = 2.0 * ((a + b) * (b - a));
double t_1 = sqrt((angle_m * ((double) M_PI)));
double t_2 = pow(cbrt((angle_m * (((double) M_PI) * 0.005555555555555556))), 3.0);
double t_3 = cbrt((angle_m * ((double) M_PI)));
double tmp;
if ((angle_m / 180.0) <= 2e-35) {
tmp = 0.011111111111111112 * (((a + b) * (angle_m * ((double) M_PI))) * (b - a));
} else if ((angle_m / 180.0) <= 2e+60) {
tmp = cos(t_2) * (t_0 * sin(t_2));
} else if ((angle_m / 180.0) <= 4e+132) {
tmp = t_0 * sin((pow(t_3, 2.0) / (180.0 / t_3)));
} else {
tmp = (t_0 * sin((t_1 / (180.0 / t_1)))) * cos(((angle_m / 180.0) * ((double) M_PI)));
}
return angle_s * tmp;
}
angle_m = Math.abs(angle);
angle_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b, double angle_m) {
double t_0 = 2.0 * ((a + b) * (b - a));
double t_1 = Math.sqrt((angle_m * Math.PI));
double t_2 = Math.pow(Math.cbrt((angle_m * (Math.PI * 0.005555555555555556))), 3.0);
double t_3 = Math.cbrt((angle_m * Math.PI));
double tmp;
if ((angle_m / 180.0) <= 2e-35) {
tmp = 0.011111111111111112 * (((a + b) * (angle_m * Math.PI)) * (b - a));
} else if ((angle_m / 180.0) <= 2e+60) {
tmp = Math.cos(t_2) * (t_0 * Math.sin(t_2));
} else if ((angle_m / 180.0) <= 4e+132) {
tmp = t_0 * Math.sin((Math.pow(t_3, 2.0) / (180.0 / t_3)));
} else {
tmp = (t_0 * Math.sin((t_1 / (180.0 / t_1)))) * Math.cos(((angle_m / 180.0) * Math.PI));
}
return angle_s * tmp;
}
angle_m = abs(angle) angle_s = copysign(1.0, angle) function code(angle_s, a, b, angle_m) t_0 = Float64(2.0 * Float64(Float64(a + b) * Float64(b - a))) t_1 = sqrt(Float64(angle_m * pi)) t_2 = cbrt(Float64(angle_m * Float64(pi * 0.005555555555555556))) ^ 3.0 t_3 = cbrt(Float64(angle_m * pi)) tmp = 0.0 if (Float64(angle_m / 180.0) <= 2e-35) tmp = Float64(0.011111111111111112 * Float64(Float64(Float64(a + b) * Float64(angle_m * pi)) * Float64(b - a))); elseif (Float64(angle_m / 180.0) <= 2e+60) tmp = Float64(cos(t_2) * Float64(t_0 * sin(t_2))); elseif (Float64(angle_m / 180.0) <= 4e+132) tmp = Float64(t_0 * sin(Float64((t_3 ^ 2.0) / Float64(180.0 / t_3)))); else tmp = Float64(Float64(t_0 * sin(Float64(t_1 / Float64(180.0 / t_1)))) * cos(Float64(Float64(angle_m / 180.0) * pi))); end return Float64(angle_s * tmp) end
angle_m = N[Abs[angle], $MachinePrecision]
angle_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a_, b_, angle$95$m_] := Block[{t$95$0 = N[(2.0 * N[(N[(a + b), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Sqrt[N[(angle$95$m * Pi), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Power[N[Power[N[(angle$95$m * N[(Pi * 0.005555555555555556), $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision], 3.0], $MachinePrecision]}, Block[{t$95$3 = N[Power[N[(angle$95$m * Pi), $MachinePrecision], 1/3], $MachinePrecision]}, N[(angle$95$s * If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 2e-35], N[(0.011111111111111112 * N[(N[(N[(a + b), $MachinePrecision] * N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 2e+60], N[(N[Cos[t$95$2], $MachinePrecision] * N[(t$95$0 * N[Sin[t$95$2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 4e+132], N[(t$95$0 * N[Sin[N[(N[Power[t$95$3, 2.0], $MachinePrecision] / N[(180.0 / t$95$3), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[(t$95$0 * N[Sin[N[(t$95$1 / N[(180.0 / t$95$1), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[Cos[N[(N[(angle$95$m / 180.0), $MachinePrecision] * Pi), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]), $MachinePrecision]]]]]
\begin{array}{l}
angle_m = \left|angle\right|
\\
angle_s = \mathsf{copysign}\left(1, angle\right)
\\
\begin{array}{l}
t_0 := 2 \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)\\
t_1 := \sqrt{angle_m \cdot \pi}\\
t_2 := {\left(\sqrt[3]{angle_m \cdot \left(\pi \cdot 0.005555555555555556\right)}\right)}^{3}\\
t_3 := \sqrt[3]{angle_m \cdot \pi}\\
angle_s \cdot \begin{array}{l}
\mathbf{if}\;\frac{angle_m}{180} \leq 2 \cdot 10^{-35}:\\
\;\;\;\;0.011111111111111112 \cdot \left(\left(\left(a + b\right) \cdot \left(angle_m \cdot \pi\right)\right) \cdot \left(b - a\right)\right)\\
\mathbf{elif}\;\frac{angle_m}{180} \leq 2 \cdot 10^{+60}:\\
\;\;\;\;\cos t_2 \cdot \left(t_0 \cdot \sin t_2\right)\\
\mathbf{elif}\;\frac{angle_m}{180} \leq 4 \cdot 10^{+132}:\\
\;\;\;\;t_0 \cdot \sin \left(\frac{{t_3}^{2}}{\frac{180}{t_3}}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(t_0 \cdot \sin \left(\frac{t_1}{\frac{180}{t_1}}\right)\right) \cdot \cos \left(\frac{angle_m}{180} \cdot \pi\right)\\
\end{array}
\end{array}
\end{array}
if (/.f64 angle 180) < 2.00000000000000002e-35Initial program 56.8%
unpow256.8%
unpow256.8%
difference-of-squares59.4%
Applied egg-rr59.4%
Taylor expanded in angle around 0 57.5%
Taylor expanded in angle around 0 56.5%
expm1-log1p-u46.0%
expm1-udef32.8%
associate-*r*32.8%
+-commutative32.8%
Applied egg-rr32.8%
expm1-def45.9%
expm1-log1p56.5%
associate-*r*74.0%
+-commutative74.0%
Simplified74.0%
if 2.00000000000000002e-35 < (/.f64 angle 180) < 1.9999999999999999e60Initial program 67.2%
unpow267.2%
unpow267.2%
difference-of-squares74.3%
Applied egg-rr74.3%
div-inv74.3%
metadata-eval74.3%
add-cube-cbrt67.2%
pow360.1%
associate-*r*60.0%
*-commutative60.0%
*-commutative60.0%
associate-*r*60.1%
*-commutative60.1%
associate-*l*60.1%
Applied egg-rr60.1%
div-inv74.3%
metadata-eval74.3%
add-cube-cbrt67.2%
pow360.1%
associate-*r*60.0%
*-commutative60.0%
*-commutative60.0%
associate-*r*60.1%
*-commutative60.1%
associate-*l*60.1%
Applied egg-rr82.0%
if 1.9999999999999999e60 < (/.f64 angle 180) < 3.99999999999999996e132Initial program 31.4%
unpow231.4%
unpow231.4%
difference-of-squares46.4%
Applied egg-rr46.4%
Taylor expanded in angle around 0 56.7%
associate-*r/46.0%
*-commutative46.0%
add-cube-cbrt41.4%
associate-/l*50.8%
pow250.8%
*-commutative50.8%
*-commutative50.8%
Applied egg-rr50.8%
if 3.99999999999999996e132 < (/.f64 angle 180) Initial program 27.5%
unpow227.5%
unpow227.5%
difference-of-squares31.5%
Applied egg-rr31.5%
associate-*r/22.8%
*-commutative22.8%
add-sqr-sqrt32.4%
associate-/l*33.1%
*-commutative33.1%
*-commutative33.1%
Applied egg-rr39.6%
Final simplification69.3%
angle_m = (fabs.f64 angle)
angle_s = (copysign.f64 1 angle)
(FPCore (angle_s a b angle_m)
:precision binary64
(let* ((t_0 (* (+ a b) (- b a)))
(t_1 (* 2.0 t_0))
(t_2 (sin (* PI (* angle_m 0.005555555555555556))))
(t_3 (cbrt (* angle_m PI)))
(t_4 (* (/ angle_m 180.0) PI)))
(*
angle_s
(if (<= (/ angle_m 180.0) 1e-33)
(* 0.011111111111111112 (* (* (+ a b) (* angle_m PI)) (- b a)))
(if (<= (/ angle_m 180.0) 2e+52)
(*
(cos (pow (cbrt (* angle_m (* PI 0.005555555555555556))) 3.0))
(* t_1 t_2))
(if (<= (/ angle_m 180.0) 1e+86)
(* 2.0 (* (cos t_4) (* t_0 (sqrt (pow t_2 2.0)))))
(if (<= (/ angle_m 180.0) 2e+145)
(* t_1 (sin (/ (pow t_3 2.0) (/ 180.0 t_3))))
(if (<= (/ angle_m 180.0) 1e+210)
(*
2.0
(*
(/ (- (pow b 2.0) (pow a 2.0)) (/ 1.0 t_2))
(cos (/ PI (/ 180.0 angle_m)))))
(*
(* t_1 (sin t_4))
(cos (/ 1.0 (/ 180.0 (* angle_m PI)))))))))))))angle_m = fabs(angle);
angle_s = copysign(1.0, angle);
double code(double angle_s, double a, double b, double angle_m) {
double t_0 = (a + b) * (b - a);
double t_1 = 2.0 * t_0;
double t_2 = sin((((double) M_PI) * (angle_m * 0.005555555555555556)));
double t_3 = cbrt((angle_m * ((double) M_PI)));
double t_4 = (angle_m / 180.0) * ((double) M_PI);
double tmp;
if ((angle_m / 180.0) <= 1e-33) {
tmp = 0.011111111111111112 * (((a + b) * (angle_m * ((double) M_PI))) * (b - a));
} else if ((angle_m / 180.0) <= 2e+52) {
tmp = cos(pow(cbrt((angle_m * (((double) M_PI) * 0.005555555555555556))), 3.0)) * (t_1 * t_2);
} else if ((angle_m / 180.0) <= 1e+86) {
tmp = 2.0 * (cos(t_4) * (t_0 * sqrt(pow(t_2, 2.0))));
} else if ((angle_m / 180.0) <= 2e+145) {
tmp = t_1 * sin((pow(t_3, 2.0) / (180.0 / t_3)));
} else if ((angle_m / 180.0) <= 1e+210) {
tmp = 2.0 * (((pow(b, 2.0) - pow(a, 2.0)) / (1.0 / t_2)) * cos((((double) M_PI) / (180.0 / angle_m))));
} else {
tmp = (t_1 * sin(t_4)) * cos((1.0 / (180.0 / (angle_m * ((double) M_PI)))));
}
return angle_s * tmp;
}
angle_m = Math.abs(angle);
angle_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b, double angle_m) {
double t_0 = (a + b) * (b - a);
double t_1 = 2.0 * t_0;
double t_2 = Math.sin((Math.PI * (angle_m * 0.005555555555555556)));
double t_3 = Math.cbrt((angle_m * Math.PI));
double t_4 = (angle_m / 180.0) * Math.PI;
double tmp;
if ((angle_m / 180.0) <= 1e-33) {
tmp = 0.011111111111111112 * (((a + b) * (angle_m * Math.PI)) * (b - a));
} else if ((angle_m / 180.0) <= 2e+52) {
tmp = Math.cos(Math.pow(Math.cbrt((angle_m * (Math.PI * 0.005555555555555556))), 3.0)) * (t_1 * t_2);
} else if ((angle_m / 180.0) <= 1e+86) {
tmp = 2.0 * (Math.cos(t_4) * (t_0 * Math.sqrt(Math.pow(t_2, 2.0))));
} else if ((angle_m / 180.0) <= 2e+145) {
tmp = t_1 * Math.sin((Math.pow(t_3, 2.0) / (180.0 / t_3)));
} else if ((angle_m / 180.0) <= 1e+210) {
tmp = 2.0 * (((Math.pow(b, 2.0) - Math.pow(a, 2.0)) / (1.0 / t_2)) * Math.cos((Math.PI / (180.0 / angle_m))));
} else {
tmp = (t_1 * Math.sin(t_4)) * Math.cos((1.0 / (180.0 / (angle_m * Math.PI))));
}
return angle_s * tmp;
}
angle_m = abs(angle) angle_s = copysign(1.0, angle) function code(angle_s, a, b, angle_m) t_0 = Float64(Float64(a + b) * Float64(b - a)) t_1 = Float64(2.0 * t_0) t_2 = sin(Float64(pi * Float64(angle_m * 0.005555555555555556))) t_3 = cbrt(Float64(angle_m * pi)) t_4 = Float64(Float64(angle_m / 180.0) * pi) tmp = 0.0 if (Float64(angle_m / 180.0) <= 1e-33) tmp = Float64(0.011111111111111112 * Float64(Float64(Float64(a + b) * Float64(angle_m * pi)) * Float64(b - a))); elseif (Float64(angle_m / 180.0) <= 2e+52) tmp = Float64(cos((cbrt(Float64(angle_m * Float64(pi * 0.005555555555555556))) ^ 3.0)) * Float64(t_1 * t_2)); elseif (Float64(angle_m / 180.0) <= 1e+86) tmp = Float64(2.0 * Float64(cos(t_4) * Float64(t_0 * sqrt((t_2 ^ 2.0))))); elseif (Float64(angle_m / 180.0) <= 2e+145) tmp = Float64(t_1 * sin(Float64((t_3 ^ 2.0) / Float64(180.0 / t_3)))); elseif (Float64(angle_m / 180.0) <= 1e+210) tmp = Float64(2.0 * Float64(Float64(Float64((b ^ 2.0) - (a ^ 2.0)) / Float64(1.0 / t_2)) * cos(Float64(pi / Float64(180.0 / angle_m))))); else tmp = Float64(Float64(t_1 * sin(t_4)) * cos(Float64(1.0 / Float64(180.0 / Float64(angle_m * pi))))); end return Float64(angle_s * tmp) end
angle_m = N[Abs[angle], $MachinePrecision]
angle_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a_, b_, angle$95$m_] := Block[{t$95$0 = N[(N[(a + b), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(2.0 * t$95$0), $MachinePrecision]}, Block[{t$95$2 = N[Sin[N[(Pi * N[(angle$95$m * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[Power[N[(angle$95$m * Pi), $MachinePrecision], 1/3], $MachinePrecision]}, Block[{t$95$4 = N[(N[(angle$95$m / 180.0), $MachinePrecision] * Pi), $MachinePrecision]}, N[(angle$95$s * If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 1e-33], N[(0.011111111111111112 * N[(N[(N[(a + b), $MachinePrecision] * N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 2e+52], N[(N[Cos[N[Power[N[Power[N[(angle$95$m * N[(Pi * 0.005555555555555556), $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision], 3.0], $MachinePrecision]], $MachinePrecision] * N[(t$95$1 * t$95$2), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 1e+86], N[(2.0 * N[(N[Cos[t$95$4], $MachinePrecision] * N[(t$95$0 * N[Sqrt[N[Power[t$95$2, 2.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 2e+145], N[(t$95$1 * N[Sin[N[(N[Power[t$95$3, 2.0], $MachinePrecision] / N[(180.0 / t$95$3), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 1e+210], N[(2.0 * N[(N[(N[(N[Power[b, 2.0], $MachinePrecision] - N[Power[a, 2.0], $MachinePrecision]), $MachinePrecision] / N[(1.0 / t$95$2), $MachinePrecision]), $MachinePrecision] * N[Cos[N[(Pi / N[(180.0 / angle$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(t$95$1 * N[Sin[t$95$4], $MachinePrecision]), $MachinePrecision] * N[Cos[N[(1.0 / N[(180.0 / N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]]), $MachinePrecision]]]]]]
\begin{array}{l}
angle_m = \left|angle\right|
\\
angle_s = \mathsf{copysign}\left(1, angle\right)
\\
\begin{array}{l}
t_0 := \left(a + b\right) \cdot \left(b - a\right)\\
t_1 := 2 \cdot t_0\\
t_2 := \sin \left(\pi \cdot \left(angle_m \cdot 0.005555555555555556\right)\right)\\
t_3 := \sqrt[3]{angle_m \cdot \pi}\\
t_4 := \frac{angle_m}{180} \cdot \pi\\
angle_s \cdot \begin{array}{l}
\mathbf{if}\;\frac{angle_m}{180} \leq 10^{-33}:\\
\;\;\;\;0.011111111111111112 \cdot \left(\left(\left(a + b\right) \cdot \left(angle_m \cdot \pi\right)\right) \cdot \left(b - a\right)\right)\\
\mathbf{elif}\;\frac{angle_m}{180} \leq 2 \cdot 10^{+52}:\\
\;\;\;\;\cos \left({\left(\sqrt[3]{angle_m \cdot \left(\pi \cdot 0.005555555555555556\right)}\right)}^{3}\right) \cdot \left(t_1 \cdot t_2\right)\\
\mathbf{elif}\;\frac{angle_m}{180} \leq 10^{+86}:\\
\;\;\;\;2 \cdot \left(\cos t_4 \cdot \left(t_0 \cdot \sqrt{{t_2}^{2}}\right)\right)\\
\mathbf{elif}\;\frac{angle_m}{180} \leq 2 \cdot 10^{+145}:\\
\;\;\;\;t_1 \cdot \sin \left(\frac{{t_3}^{2}}{\frac{180}{t_3}}\right)\\
\mathbf{elif}\;\frac{angle_m}{180} \leq 10^{+210}:\\
\;\;\;\;2 \cdot \left(\frac{{b}^{2} - {a}^{2}}{\frac{1}{t_2}} \cdot \cos \left(\frac{\pi}{\frac{180}{angle_m}}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(t_1 \cdot \sin t_4\right) \cdot \cos \left(\frac{1}{\frac{180}{angle_m \cdot \pi}}\right)\\
\end{array}
\end{array}
\end{array}
if (/.f64 angle 180) < 1.0000000000000001e-33Initial program 57.0%
unpow257.0%
unpow257.0%
difference-of-squares59.6%
Applied egg-rr59.6%
Taylor expanded in angle around 0 57.7%
Taylor expanded in angle around 0 56.7%
expm1-log1p-u46.2%
expm1-udef33.1%
associate-*r*33.1%
+-commutative33.1%
Applied egg-rr33.1%
expm1-def46.1%
expm1-log1p56.7%
associate-*r*74.1%
+-commutative74.1%
Simplified74.1%
if 1.0000000000000001e-33 < (/.f64 angle 180) < 2e52Initial program 74.2%
unpow274.2%
unpow274.2%
difference-of-squares74.2%
Applied egg-rr74.2%
div-inv74.2%
metadata-eval74.2%
add-cube-cbrt74.3%
pow374.3%
associate-*r*74.1%
*-commutative74.1%
*-commutative74.1%
associate-*r*74.3%
*-commutative74.3%
associate-*l*74.3%
Applied egg-rr74.3%
Taylor expanded in angle around inf 72.4%
associate-*r*74.3%
*-commutative74.3%
Simplified74.3%
if 2e52 < (/.f64 angle 180) < 1e86Initial program 33.8%
associate-*l*33.8%
associate-*l*33.8%
Simplified33.8%
unpow233.8%
unpow233.8%
difference-of-squares43.8%
Applied egg-rr43.8%
add-sqr-sqrt41.8%
sqrt-unprod72.6%
pow272.6%
div-inv72.5%
metadata-eval72.5%
Applied egg-rr72.5%
if 1e86 < (/.f64 angle 180) < 2e145Initial program 28.0%
unpow228.0%
unpow228.0%
difference-of-squares49.4%
Applied egg-rr49.4%
Taylor expanded in angle around 0 49.9%
associate-*r/41.7%
*-commutative41.7%
add-cube-cbrt43.0%
associate-/l*50.6%
pow250.6%
*-commutative50.6%
*-commutative50.6%
Applied egg-rr50.6%
if 2e145 < (/.f64 angle 180) < 9.99999999999999927e209Initial program 28.7%
associate-*l*28.7%
associate-*l*28.7%
Simplified28.7%
unpow228.7%
unpow228.7%
difference-of-squares28.7%
Applied egg-rr28.7%
associate-*l*28.7%
flip-+28.7%
unpow228.7%
unpow228.7%
associate-*l/25.8%
*-commutative25.8%
div-inv37.0%
metadata-eval37.0%
associate-*l*35.5%
Applied egg-rr35.5%
associate-/l*38.0%
associate-/r*38.0%
*-inverses38.0%
*-commutative38.0%
*-commutative38.0%
associate-*l*39.8%
Simplified39.8%
associate-*r/17.7%
associate-/l*51.2%
Applied egg-rr51.2%
if 9.99999999999999927e209 < (/.f64 angle 180) Initial program 28.5%
unpow228.5%
unpow228.5%
difference-of-squares35.1%
Applied egg-rr35.1%
associate-*r/34.0%
*-commutative34.0%
clear-num42.2%
*-commutative42.2%
Applied egg-rr42.2%
Final simplification70.1%
angle_m = (fabs.f64 angle)
angle_s = (copysign.f64 1 angle)
(FPCore (angle_s a b angle_m)
:precision binary64
(let* ((t_0 (* (+ a b) (- b a)))
(t_1 (* 2.0 t_0))
(t_2 (sin (* PI (* angle_m 0.005555555555555556))))
(t_3 (cbrt (* angle_m PI)))
(t_4 (* angle_m (* PI 0.005555555555555556)))
(t_5 (cos (* (/ angle_m 180.0) PI))))
(*
angle_s
(if (<= (/ angle_m 180.0) 1e-33)
(* 0.011111111111111112 (* (* (+ a b) (* angle_m PI)) (- b a)))
(if (<= (/ angle_m 180.0) 2e+52)
(* (cos (pow (cbrt t_4) 3.0)) (* t_1 t_2))
(if (<= (/ angle_m 180.0) 1e+86)
(* 2.0 (* t_5 (* t_0 (sqrt (pow t_2 2.0)))))
(if (<= (/ angle_m 180.0) 2e+145)
(* t_1 (sin (/ (pow t_3 2.0) (/ 180.0 t_3))))
(* t_5 (* t_1 (sin (pow (sqrt t_4) 2.0)))))))))))angle_m = fabs(angle);
angle_s = copysign(1.0, angle);
double code(double angle_s, double a, double b, double angle_m) {
double t_0 = (a + b) * (b - a);
double t_1 = 2.0 * t_0;
double t_2 = sin((((double) M_PI) * (angle_m * 0.005555555555555556)));
double t_3 = cbrt((angle_m * ((double) M_PI)));
double t_4 = angle_m * (((double) M_PI) * 0.005555555555555556);
double t_5 = cos(((angle_m / 180.0) * ((double) M_PI)));
double tmp;
if ((angle_m / 180.0) <= 1e-33) {
tmp = 0.011111111111111112 * (((a + b) * (angle_m * ((double) M_PI))) * (b - a));
} else if ((angle_m / 180.0) <= 2e+52) {
tmp = cos(pow(cbrt(t_4), 3.0)) * (t_1 * t_2);
} else if ((angle_m / 180.0) <= 1e+86) {
tmp = 2.0 * (t_5 * (t_0 * sqrt(pow(t_2, 2.0))));
} else if ((angle_m / 180.0) <= 2e+145) {
tmp = t_1 * sin((pow(t_3, 2.0) / (180.0 / t_3)));
} else {
tmp = t_5 * (t_1 * sin(pow(sqrt(t_4), 2.0)));
}
return angle_s * tmp;
}
angle_m = Math.abs(angle);
angle_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b, double angle_m) {
double t_0 = (a + b) * (b - a);
double t_1 = 2.0 * t_0;
double t_2 = Math.sin((Math.PI * (angle_m * 0.005555555555555556)));
double t_3 = Math.cbrt((angle_m * Math.PI));
double t_4 = angle_m * (Math.PI * 0.005555555555555556);
double t_5 = Math.cos(((angle_m / 180.0) * Math.PI));
double tmp;
if ((angle_m / 180.0) <= 1e-33) {
tmp = 0.011111111111111112 * (((a + b) * (angle_m * Math.PI)) * (b - a));
} else if ((angle_m / 180.0) <= 2e+52) {
tmp = Math.cos(Math.pow(Math.cbrt(t_4), 3.0)) * (t_1 * t_2);
} else if ((angle_m / 180.0) <= 1e+86) {
tmp = 2.0 * (t_5 * (t_0 * Math.sqrt(Math.pow(t_2, 2.0))));
} else if ((angle_m / 180.0) <= 2e+145) {
tmp = t_1 * Math.sin((Math.pow(t_3, 2.0) / (180.0 / t_3)));
} else {
tmp = t_5 * (t_1 * Math.sin(Math.pow(Math.sqrt(t_4), 2.0)));
}
return angle_s * tmp;
}
angle_m = abs(angle) angle_s = copysign(1.0, angle) function code(angle_s, a, b, angle_m) t_0 = Float64(Float64(a + b) * Float64(b - a)) t_1 = Float64(2.0 * t_0) t_2 = sin(Float64(pi * Float64(angle_m * 0.005555555555555556))) t_3 = cbrt(Float64(angle_m * pi)) t_4 = Float64(angle_m * Float64(pi * 0.005555555555555556)) t_5 = cos(Float64(Float64(angle_m / 180.0) * pi)) tmp = 0.0 if (Float64(angle_m / 180.0) <= 1e-33) tmp = Float64(0.011111111111111112 * Float64(Float64(Float64(a + b) * Float64(angle_m * pi)) * Float64(b - a))); elseif (Float64(angle_m / 180.0) <= 2e+52) tmp = Float64(cos((cbrt(t_4) ^ 3.0)) * Float64(t_1 * t_2)); elseif (Float64(angle_m / 180.0) <= 1e+86) tmp = Float64(2.0 * Float64(t_5 * Float64(t_0 * sqrt((t_2 ^ 2.0))))); elseif (Float64(angle_m / 180.0) <= 2e+145) tmp = Float64(t_1 * sin(Float64((t_3 ^ 2.0) / Float64(180.0 / t_3)))); else tmp = Float64(t_5 * Float64(t_1 * sin((sqrt(t_4) ^ 2.0)))); end return Float64(angle_s * tmp) end
angle_m = N[Abs[angle], $MachinePrecision]
angle_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a_, b_, angle$95$m_] := Block[{t$95$0 = N[(N[(a + b), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(2.0 * t$95$0), $MachinePrecision]}, Block[{t$95$2 = N[Sin[N[(Pi * N[(angle$95$m * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[Power[N[(angle$95$m * Pi), $MachinePrecision], 1/3], $MachinePrecision]}, Block[{t$95$4 = N[(angle$95$m * N[(Pi * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$5 = N[Cos[N[(N[(angle$95$m / 180.0), $MachinePrecision] * Pi), $MachinePrecision]], $MachinePrecision]}, N[(angle$95$s * If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 1e-33], N[(0.011111111111111112 * N[(N[(N[(a + b), $MachinePrecision] * N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 2e+52], N[(N[Cos[N[Power[N[Power[t$95$4, 1/3], $MachinePrecision], 3.0], $MachinePrecision]], $MachinePrecision] * N[(t$95$1 * t$95$2), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 1e+86], N[(2.0 * N[(t$95$5 * N[(t$95$0 * N[Sqrt[N[Power[t$95$2, 2.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 2e+145], N[(t$95$1 * N[Sin[N[(N[Power[t$95$3, 2.0], $MachinePrecision] / N[(180.0 / t$95$3), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(t$95$5 * N[(t$95$1 * N[Sin[N[Power[N[Sqrt[t$95$4], $MachinePrecision], 2.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]), $MachinePrecision]]]]]]]
\begin{array}{l}
angle_m = \left|angle\right|
\\
angle_s = \mathsf{copysign}\left(1, angle\right)
\\
\begin{array}{l}
t_0 := \left(a + b\right) \cdot \left(b - a\right)\\
t_1 := 2 \cdot t_0\\
t_2 := \sin \left(\pi \cdot \left(angle_m \cdot 0.005555555555555556\right)\right)\\
t_3 := \sqrt[3]{angle_m \cdot \pi}\\
t_4 := angle_m \cdot \left(\pi \cdot 0.005555555555555556\right)\\
t_5 := \cos \left(\frac{angle_m}{180} \cdot \pi\right)\\
angle_s \cdot \begin{array}{l}
\mathbf{if}\;\frac{angle_m}{180} \leq 10^{-33}:\\
\;\;\;\;0.011111111111111112 \cdot \left(\left(\left(a + b\right) \cdot \left(angle_m \cdot \pi\right)\right) \cdot \left(b - a\right)\right)\\
\mathbf{elif}\;\frac{angle_m}{180} \leq 2 \cdot 10^{+52}:\\
\;\;\;\;\cos \left({\left(\sqrt[3]{t_4}\right)}^{3}\right) \cdot \left(t_1 \cdot t_2\right)\\
\mathbf{elif}\;\frac{angle_m}{180} \leq 10^{+86}:\\
\;\;\;\;2 \cdot \left(t_5 \cdot \left(t_0 \cdot \sqrt{{t_2}^{2}}\right)\right)\\
\mathbf{elif}\;\frac{angle_m}{180} \leq 2 \cdot 10^{+145}:\\
\;\;\;\;t_1 \cdot \sin \left(\frac{{t_3}^{2}}{\frac{180}{t_3}}\right)\\
\mathbf{else}:\\
\;\;\;\;t_5 \cdot \left(t_1 \cdot \sin \left({\left(\sqrt{t_4}\right)}^{2}\right)\right)\\
\end{array}
\end{array}
\end{array}
if (/.f64 angle 180) < 1.0000000000000001e-33Initial program 57.0%
unpow257.0%
unpow257.0%
difference-of-squares59.6%
Applied egg-rr59.6%
Taylor expanded in angle around 0 57.7%
Taylor expanded in angle around 0 56.7%
expm1-log1p-u46.2%
expm1-udef33.1%
associate-*r*33.1%
+-commutative33.1%
Applied egg-rr33.1%
expm1-def46.1%
expm1-log1p56.7%
associate-*r*74.1%
+-commutative74.1%
Simplified74.1%
if 1.0000000000000001e-33 < (/.f64 angle 180) < 2e52Initial program 74.2%
unpow274.2%
unpow274.2%
difference-of-squares74.2%
Applied egg-rr74.2%
div-inv74.2%
metadata-eval74.2%
add-cube-cbrt74.3%
pow374.3%
associate-*r*74.1%
*-commutative74.1%
*-commutative74.1%
associate-*r*74.3%
*-commutative74.3%
associate-*l*74.3%
Applied egg-rr74.3%
Taylor expanded in angle around inf 72.4%
associate-*r*74.3%
*-commutative74.3%
Simplified74.3%
if 2e52 < (/.f64 angle 180) < 1e86Initial program 33.8%
associate-*l*33.8%
associate-*l*33.8%
Simplified33.8%
unpow233.8%
unpow233.8%
difference-of-squares43.8%
Applied egg-rr43.8%
add-sqr-sqrt41.8%
sqrt-unprod72.6%
pow272.6%
div-inv72.5%
metadata-eval72.5%
Applied egg-rr72.5%
if 1e86 < (/.f64 angle 180) < 2e145Initial program 28.0%
unpow228.0%
unpow228.0%
difference-of-squares49.4%
Applied egg-rr49.4%
Taylor expanded in angle around 0 49.9%
associate-*r/41.7%
*-commutative41.7%
add-cube-cbrt43.0%
associate-/l*50.6%
pow250.6%
*-commutative50.6%
*-commutative50.6%
Applied egg-rr50.6%
if 2e145 < (/.f64 angle 180) Initial program 28.5%
unpow228.5%
unpow228.5%
difference-of-squares32.7%
Applied egg-rr32.7%
div-inv36.0%
metadata-eval36.0%
add-sqr-sqrt32.7%
pow232.7%
associate-*r*36.3%
*-commutative36.3%
*-commutative36.3%
associate-*r*32.7%
*-commutative32.7%
associate-*l*32.7%
Applied egg-rr32.7%
Final simplification68.9%
angle_m = (fabs.f64 angle)
angle_s = (copysign.f64 1 angle)
(FPCore (angle_s a b angle_m)
:precision binary64
(let* ((t_0 (* (+ a b) (- b a)))
(t_1 (sin (* PI (* angle_m 0.005555555555555556))))
(t_2 (* (* 2.0 t_0) t_1))
(t_3 (cos (* (/ angle_m 180.0) PI))))
(*
angle_s
(if (<= (/ angle_m 180.0) 1e-33)
(* 0.011111111111111112 (* (* (+ a b) (* angle_m PI)) (- b a)))
(if (<= (/ angle_m 180.0) 2e+52)
(* (cos (pow (cbrt (* angle_m (* PI 0.005555555555555556))) 3.0)) t_2)
(if (<= (/ angle_m 180.0) 5e+92)
(* 2.0 (* t_3 (* t_0 (sqrt (pow t_1 2.0)))))
(* t_3 t_2)))))))angle_m = fabs(angle);
angle_s = copysign(1.0, angle);
double code(double angle_s, double a, double b, double angle_m) {
double t_0 = (a + b) * (b - a);
double t_1 = sin((((double) M_PI) * (angle_m * 0.005555555555555556)));
double t_2 = (2.0 * t_0) * t_1;
double t_3 = cos(((angle_m / 180.0) * ((double) M_PI)));
double tmp;
if ((angle_m / 180.0) <= 1e-33) {
tmp = 0.011111111111111112 * (((a + b) * (angle_m * ((double) M_PI))) * (b - a));
} else if ((angle_m / 180.0) <= 2e+52) {
tmp = cos(pow(cbrt((angle_m * (((double) M_PI) * 0.005555555555555556))), 3.0)) * t_2;
} else if ((angle_m / 180.0) <= 5e+92) {
tmp = 2.0 * (t_3 * (t_0 * sqrt(pow(t_1, 2.0))));
} else {
tmp = t_3 * t_2;
}
return angle_s * tmp;
}
angle_m = Math.abs(angle);
angle_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b, double angle_m) {
double t_0 = (a + b) * (b - a);
double t_1 = Math.sin((Math.PI * (angle_m * 0.005555555555555556)));
double t_2 = (2.0 * t_0) * t_1;
double t_3 = Math.cos(((angle_m / 180.0) * Math.PI));
double tmp;
if ((angle_m / 180.0) <= 1e-33) {
tmp = 0.011111111111111112 * (((a + b) * (angle_m * Math.PI)) * (b - a));
} else if ((angle_m / 180.0) <= 2e+52) {
tmp = Math.cos(Math.pow(Math.cbrt((angle_m * (Math.PI * 0.005555555555555556))), 3.0)) * t_2;
} else if ((angle_m / 180.0) <= 5e+92) {
tmp = 2.0 * (t_3 * (t_0 * Math.sqrt(Math.pow(t_1, 2.0))));
} else {
tmp = t_3 * t_2;
}
return angle_s * tmp;
}
angle_m = abs(angle) angle_s = copysign(1.0, angle) function code(angle_s, a, b, angle_m) t_0 = Float64(Float64(a + b) * Float64(b - a)) t_1 = sin(Float64(pi * Float64(angle_m * 0.005555555555555556))) t_2 = Float64(Float64(2.0 * t_0) * t_1) t_3 = cos(Float64(Float64(angle_m / 180.0) * pi)) tmp = 0.0 if (Float64(angle_m / 180.0) <= 1e-33) tmp = Float64(0.011111111111111112 * Float64(Float64(Float64(a + b) * Float64(angle_m * pi)) * Float64(b - a))); elseif (Float64(angle_m / 180.0) <= 2e+52) tmp = Float64(cos((cbrt(Float64(angle_m * Float64(pi * 0.005555555555555556))) ^ 3.0)) * t_2); elseif (Float64(angle_m / 180.0) <= 5e+92) tmp = Float64(2.0 * Float64(t_3 * Float64(t_0 * sqrt((t_1 ^ 2.0))))); else tmp = Float64(t_3 * t_2); end return Float64(angle_s * tmp) end
angle_m = N[Abs[angle], $MachinePrecision]
angle_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a_, b_, angle$95$m_] := Block[{t$95$0 = N[(N[(a + b), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Sin[N[(Pi * N[(angle$95$m * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[(N[(2.0 * t$95$0), $MachinePrecision] * t$95$1), $MachinePrecision]}, Block[{t$95$3 = N[Cos[N[(N[(angle$95$m / 180.0), $MachinePrecision] * Pi), $MachinePrecision]], $MachinePrecision]}, N[(angle$95$s * If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 1e-33], N[(0.011111111111111112 * N[(N[(N[(a + b), $MachinePrecision] * N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 2e+52], N[(N[Cos[N[Power[N[Power[N[(angle$95$m * N[(Pi * 0.005555555555555556), $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision], 3.0], $MachinePrecision]], $MachinePrecision] * t$95$2), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 5e+92], N[(2.0 * N[(t$95$3 * N[(t$95$0 * N[Sqrt[N[Power[t$95$1, 2.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$3 * t$95$2), $MachinePrecision]]]]), $MachinePrecision]]]]]
\begin{array}{l}
angle_m = \left|angle\right|
\\
angle_s = \mathsf{copysign}\left(1, angle\right)
\\
\begin{array}{l}
t_0 := \left(a + b\right) \cdot \left(b - a\right)\\
t_1 := \sin \left(\pi \cdot \left(angle_m \cdot 0.005555555555555556\right)\right)\\
t_2 := \left(2 \cdot t_0\right) \cdot t_1\\
t_3 := \cos \left(\frac{angle_m}{180} \cdot \pi\right)\\
angle_s \cdot \begin{array}{l}
\mathbf{if}\;\frac{angle_m}{180} \leq 10^{-33}:\\
\;\;\;\;0.011111111111111112 \cdot \left(\left(\left(a + b\right) \cdot \left(angle_m \cdot \pi\right)\right) \cdot \left(b - a\right)\right)\\
\mathbf{elif}\;\frac{angle_m}{180} \leq 2 \cdot 10^{+52}:\\
\;\;\;\;\cos \left({\left(\sqrt[3]{angle_m \cdot \left(\pi \cdot 0.005555555555555556\right)}\right)}^{3}\right) \cdot t_2\\
\mathbf{elif}\;\frac{angle_m}{180} \leq 5 \cdot 10^{+92}:\\
\;\;\;\;2 \cdot \left(t_3 \cdot \left(t_0 \cdot \sqrt{{t_1}^{2}}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t_3 \cdot t_2\\
\end{array}
\end{array}
\end{array}
if (/.f64 angle 180) < 1.0000000000000001e-33Initial program 57.0%
unpow257.0%
unpow257.0%
difference-of-squares59.6%
Applied egg-rr59.6%
Taylor expanded in angle around 0 57.7%
Taylor expanded in angle around 0 56.7%
expm1-log1p-u46.2%
expm1-udef33.1%
associate-*r*33.1%
+-commutative33.1%
Applied egg-rr33.1%
expm1-def46.1%
expm1-log1p56.7%
associate-*r*74.1%
+-commutative74.1%
Simplified74.1%
if 1.0000000000000001e-33 < (/.f64 angle 180) < 2e52Initial program 74.2%
unpow274.2%
unpow274.2%
difference-of-squares74.2%
Applied egg-rr74.2%
div-inv74.2%
metadata-eval74.2%
add-cube-cbrt74.3%
pow374.3%
associate-*r*74.1%
*-commutative74.1%
*-commutative74.1%
associate-*r*74.3%
*-commutative74.3%
associate-*l*74.3%
Applied egg-rr74.3%
Taylor expanded in angle around inf 72.4%
associate-*r*74.3%
*-commutative74.3%
Simplified74.3%
if 2e52 < (/.f64 angle 180) < 5.00000000000000022e92Initial program 33.8%
associate-*l*33.8%
associate-*l*33.8%
Simplified33.8%
unpow233.8%
unpow233.8%
difference-of-squares43.8%
Applied egg-rr43.8%
add-sqr-sqrt41.8%
sqrt-unprod72.6%
pow272.6%
div-inv72.5%
metadata-eval72.5%
Applied egg-rr72.5%
if 5.00000000000000022e92 < (/.f64 angle 180) Initial program 28.3%
unpow228.3%
unpow228.3%
difference-of-squares38.9%
Applied egg-rr38.9%
Taylor expanded in angle around 0 32.3%
*-commutative32.3%
*-commutative32.3%
associate-*l*38.3%
*-commutative38.3%
Simplified38.3%
Final simplification68.8%
angle_m = (fabs.f64 angle)
angle_s = (copysign.f64 1 angle)
(FPCore (angle_s a b angle_m)
:precision binary64
(let* ((t_0 (* 0.005555555555555556 (* angle_m PI)))
(t_1 (* (/ angle_m 180.0) PI))
(t_2 (* (* 2.0 (* (+ a b) (- b a))) (sin t_1))))
(*
angle_s
(if (<= (/ angle_m 180.0) 1e-33)
(* 0.011111111111111112 (* (* (+ a b) (* angle_m PI)) (- b a)))
(if (<= (/ angle_m 180.0) 1e+17)
(* t_2 (cos t_0))
(if (<= (/ angle_m 180.0) 5e+133)
t_2
(if (<= (/ angle_m 180.0) 1e+183)
(* (cos t_1) (* (pow a 2.0) (* (sin t_0) -2.0)))
(* t_2 (cos (/ 1.0 (/ 180.0 (* angle_m PI))))))))))))angle_m = fabs(angle);
angle_s = copysign(1.0, angle);
double code(double angle_s, double a, double b, double angle_m) {
double t_0 = 0.005555555555555556 * (angle_m * ((double) M_PI));
double t_1 = (angle_m / 180.0) * ((double) M_PI);
double t_2 = (2.0 * ((a + b) * (b - a))) * sin(t_1);
double tmp;
if ((angle_m / 180.0) <= 1e-33) {
tmp = 0.011111111111111112 * (((a + b) * (angle_m * ((double) M_PI))) * (b - a));
} else if ((angle_m / 180.0) <= 1e+17) {
tmp = t_2 * cos(t_0);
} else if ((angle_m / 180.0) <= 5e+133) {
tmp = t_2;
} else if ((angle_m / 180.0) <= 1e+183) {
tmp = cos(t_1) * (pow(a, 2.0) * (sin(t_0) * -2.0));
} else {
tmp = t_2 * cos((1.0 / (180.0 / (angle_m * ((double) M_PI)))));
}
return angle_s * tmp;
}
angle_m = Math.abs(angle);
angle_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b, double angle_m) {
double t_0 = 0.005555555555555556 * (angle_m * Math.PI);
double t_1 = (angle_m / 180.0) * Math.PI;
double t_2 = (2.0 * ((a + b) * (b - a))) * Math.sin(t_1);
double tmp;
if ((angle_m / 180.0) <= 1e-33) {
tmp = 0.011111111111111112 * (((a + b) * (angle_m * Math.PI)) * (b - a));
} else if ((angle_m / 180.0) <= 1e+17) {
tmp = t_2 * Math.cos(t_0);
} else if ((angle_m / 180.0) <= 5e+133) {
tmp = t_2;
} else if ((angle_m / 180.0) <= 1e+183) {
tmp = Math.cos(t_1) * (Math.pow(a, 2.0) * (Math.sin(t_0) * -2.0));
} else {
tmp = t_2 * Math.cos((1.0 / (180.0 / (angle_m * Math.PI))));
}
return angle_s * tmp;
}
angle_m = math.fabs(angle) angle_s = math.copysign(1.0, angle) def code(angle_s, a, b, angle_m): t_0 = 0.005555555555555556 * (angle_m * math.pi) t_1 = (angle_m / 180.0) * math.pi t_2 = (2.0 * ((a + b) * (b - a))) * math.sin(t_1) tmp = 0 if (angle_m / 180.0) <= 1e-33: tmp = 0.011111111111111112 * (((a + b) * (angle_m * math.pi)) * (b - a)) elif (angle_m / 180.0) <= 1e+17: tmp = t_2 * math.cos(t_0) elif (angle_m / 180.0) <= 5e+133: tmp = t_2 elif (angle_m / 180.0) <= 1e+183: tmp = math.cos(t_1) * (math.pow(a, 2.0) * (math.sin(t_0) * -2.0)) else: tmp = t_2 * math.cos((1.0 / (180.0 / (angle_m * math.pi)))) return angle_s * tmp
angle_m = abs(angle) angle_s = copysign(1.0, angle) function code(angle_s, a, b, angle_m) t_0 = Float64(0.005555555555555556 * Float64(angle_m * pi)) t_1 = Float64(Float64(angle_m / 180.0) * pi) t_2 = Float64(Float64(2.0 * Float64(Float64(a + b) * Float64(b - a))) * sin(t_1)) tmp = 0.0 if (Float64(angle_m / 180.0) <= 1e-33) tmp = Float64(0.011111111111111112 * Float64(Float64(Float64(a + b) * Float64(angle_m * pi)) * Float64(b - a))); elseif (Float64(angle_m / 180.0) <= 1e+17) tmp = Float64(t_2 * cos(t_0)); elseif (Float64(angle_m / 180.0) <= 5e+133) tmp = t_2; elseif (Float64(angle_m / 180.0) <= 1e+183) tmp = Float64(cos(t_1) * Float64((a ^ 2.0) * Float64(sin(t_0) * -2.0))); else tmp = Float64(t_2 * cos(Float64(1.0 / Float64(180.0 / Float64(angle_m * pi))))); end return Float64(angle_s * tmp) end
angle_m = abs(angle); angle_s = sign(angle) * abs(1.0); function tmp_2 = code(angle_s, a, b, angle_m) t_0 = 0.005555555555555556 * (angle_m * pi); t_1 = (angle_m / 180.0) * pi; t_2 = (2.0 * ((a + b) * (b - a))) * sin(t_1); tmp = 0.0; if ((angle_m / 180.0) <= 1e-33) tmp = 0.011111111111111112 * (((a + b) * (angle_m * pi)) * (b - a)); elseif ((angle_m / 180.0) <= 1e+17) tmp = t_2 * cos(t_0); elseif ((angle_m / 180.0) <= 5e+133) tmp = t_2; elseif ((angle_m / 180.0) <= 1e+183) tmp = cos(t_1) * ((a ^ 2.0) * (sin(t_0) * -2.0)); else tmp = t_2 * cos((1.0 / (180.0 / (angle_m * pi)))); end tmp_2 = angle_s * tmp; end
angle_m = N[Abs[angle], $MachinePrecision]
angle_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a_, b_, angle$95$m_] := Block[{t$95$0 = N[(0.005555555555555556 * N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(angle$95$m / 180.0), $MachinePrecision] * Pi), $MachinePrecision]}, Block[{t$95$2 = N[(N[(2.0 * N[(N[(a + b), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sin[t$95$1], $MachinePrecision]), $MachinePrecision]}, N[(angle$95$s * If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 1e-33], N[(0.011111111111111112 * N[(N[(N[(a + b), $MachinePrecision] * N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 1e+17], N[(t$95$2 * N[Cos[t$95$0], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 5e+133], t$95$2, If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 1e+183], N[(N[Cos[t$95$1], $MachinePrecision] * N[(N[Power[a, 2.0], $MachinePrecision] * N[(N[Sin[t$95$0], $MachinePrecision] * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$2 * N[Cos[N[(1.0 / N[(180.0 / N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]), $MachinePrecision]]]]
\begin{array}{l}
angle_m = \left|angle\right|
\\
angle_s = \mathsf{copysign}\left(1, angle\right)
\\
\begin{array}{l}
t_0 := 0.005555555555555556 \cdot \left(angle_m \cdot \pi\right)\\
t_1 := \frac{angle_m}{180} \cdot \pi\\
t_2 := \left(2 \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)\right) \cdot \sin t_1\\
angle_s \cdot \begin{array}{l}
\mathbf{if}\;\frac{angle_m}{180} \leq 10^{-33}:\\
\;\;\;\;0.011111111111111112 \cdot \left(\left(\left(a + b\right) \cdot \left(angle_m \cdot \pi\right)\right) \cdot \left(b - a\right)\right)\\
\mathbf{elif}\;\frac{angle_m}{180} \leq 10^{+17}:\\
\;\;\;\;t_2 \cdot \cos t_0\\
\mathbf{elif}\;\frac{angle_m}{180} \leq 5 \cdot 10^{+133}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;\frac{angle_m}{180} \leq 10^{+183}:\\
\;\;\;\;\cos t_1 \cdot \left({a}^{2} \cdot \left(\sin t_0 \cdot -2\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t_2 \cdot \cos \left(\frac{1}{\frac{180}{angle_m \cdot \pi}}\right)\\
\end{array}
\end{array}
\end{array}
if (/.f64 angle 180) < 1.0000000000000001e-33Initial program 57.0%
unpow257.0%
unpow257.0%
difference-of-squares59.6%
Applied egg-rr59.6%
Taylor expanded in angle around 0 57.7%
Taylor expanded in angle around 0 56.7%
expm1-log1p-u46.2%
expm1-udef33.1%
associate-*r*33.1%
+-commutative33.1%
Applied egg-rr33.1%
expm1-def46.1%
expm1-log1p56.7%
associate-*r*74.1%
+-commutative74.1%
Simplified74.1%
if 1.0000000000000001e-33 < (/.f64 angle 180) < 1e17Initial program 99.7%
unpow299.7%
unpow299.7%
difference-of-squares99.7%
Applied egg-rr99.7%
Taylor expanded in angle around 0 99.7%
if 1e17 < (/.f64 angle 180) < 4.99999999999999961e133Initial program 32.3%
unpow232.3%
unpow232.3%
difference-of-squares47.1%
Applied egg-rr47.1%
Taylor expanded in angle around 0 51.0%
if 4.99999999999999961e133 < (/.f64 angle 180) < 9.99999999999999947e182Initial program 33.9%
Taylor expanded in b around 0 60.2%
*-commutative60.2%
*-commutative60.2%
*-commutative60.2%
associate-*r*59.6%
associate-*l*59.6%
associate-*r*60.2%
*-commutative60.2%
*-commutative60.2%
Simplified60.2%
if 9.99999999999999947e182 < (/.f64 angle 180) Initial program 25.0%
unpow225.0%
unpow225.0%
difference-of-squares30.5%
Applied egg-rr30.5%
associate-*r/29.6%
*-commutative29.6%
clear-num35.3%
*-commutative35.3%
Applied egg-rr35.3%
Final simplification69.2%
angle_m = (fabs.f64 angle)
angle_s = (copysign.f64 1 angle)
(FPCore (angle_s a b angle_m)
:precision binary64
(let* ((t_0 (* (/ angle_m 180.0) PI))
(t_1 (cos t_0))
(t_2 (* (+ a b) (- b a)))
(t_3 (* PI t_2)))
(*
angle_s
(if (<= (/ angle_m 180.0) 1000.0)
(* 0.011111111111111112 (* (* (+ a b) (* angle_m PI)) (- b a)))
(if (<= (/ angle_m 180.0) 2e+52)
(* 0.011111111111111112 (* angle_m (sqrt (pow t_3 2.0))))
(if (<= (/ angle_m 180.0) 5e+82)
(* t_1 (* 0.011111111111111112 (* angle_m t_3)))
(* 2.0 (* t_1 (* t_2 (sin t_0))))))))))angle_m = fabs(angle);
angle_s = copysign(1.0, angle);
double code(double angle_s, double a, double b, double angle_m) {
double t_0 = (angle_m / 180.0) * ((double) M_PI);
double t_1 = cos(t_0);
double t_2 = (a + b) * (b - a);
double t_3 = ((double) M_PI) * t_2;
double tmp;
if ((angle_m / 180.0) <= 1000.0) {
tmp = 0.011111111111111112 * (((a + b) * (angle_m * ((double) M_PI))) * (b - a));
} else if ((angle_m / 180.0) <= 2e+52) {
tmp = 0.011111111111111112 * (angle_m * sqrt(pow(t_3, 2.0)));
} else if ((angle_m / 180.0) <= 5e+82) {
tmp = t_1 * (0.011111111111111112 * (angle_m * t_3));
} else {
tmp = 2.0 * (t_1 * (t_2 * sin(t_0)));
}
return angle_s * tmp;
}
angle_m = Math.abs(angle);
angle_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b, double angle_m) {
double t_0 = (angle_m / 180.0) * Math.PI;
double t_1 = Math.cos(t_0);
double t_2 = (a + b) * (b - a);
double t_3 = Math.PI * t_2;
double tmp;
if ((angle_m / 180.0) <= 1000.0) {
tmp = 0.011111111111111112 * (((a + b) * (angle_m * Math.PI)) * (b - a));
} else if ((angle_m / 180.0) <= 2e+52) {
tmp = 0.011111111111111112 * (angle_m * Math.sqrt(Math.pow(t_3, 2.0)));
} else if ((angle_m / 180.0) <= 5e+82) {
tmp = t_1 * (0.011111111111111112 * (angle_m * t_3));
} else {
tmp = 2.0 * (t_1 * (t_2 * Math.sin(t_0)));
}
return angle_s * tmp;
}
angle_m = math.fabs(angle) angle_s = math.copysign(1.0, angle) def code(angle_s, a, b, angle_m): t_0 = (angle_m / 180.0) * math.pi t_1 = math.cos(t_0) t_2 = (a + b) * (b - a) t_3 = math.pi * t_2 tmp = 0 if (angle_m / 180.0) <= 1000.0: tmp = 0.011111111111111112 * (((a + b) * (angle_m * math.pi)) * (b - a)) elif (angle_m / 180.0) <= 2e+52: tmp = 0.011111111111111112 * (angle_m * math.sqrt(math.pow(t_3, 2.0))) elif (angle_m / 180.0) <= 5e+82: tmp = t_1 * (0.011111111111111112 * (angle_m * t_3)) else: tmp = 2.0 * (t_1 * (t_2 * math.sin(t_0))) return angle_s * tmp
angle_m = abs(angle) angle_s = copysign(1.0, angle) function code(angle_s, a, b, angle_m) t_0 = Float64(Float64(angle_m / 180.0) * pi) t_1 = cos(t_0) t_2 = Float64(Float64(a + b) * Float64(b - a)) t_3 = Float64(pi * t_2) tmp = 0.0 if (Float64(angle_m / 180.0) <= 1000.0) tmp = Float64(0.011111111111111112 * Float64(Float64(Float64(a + b) * Float64(angle_m * pi)) * Float64(b - a))); elseif (Float64(angle_m / 180.0) <= 2e+52) tmp = Float64(0.011111111111111112 * Float64(angle_m * sqrt((t_3 ^ 2.0)))); elseif (Float64(angle_m / 180.0) <= 5e+82) tmp = Float64(t_1 * Float64(0.011111111111111112 * Float64(angle_m * t_3))); else tmp = Float64(2.0 * Float64(t_1 * Float64(t_2 * sin(t_0)))); end return Float64(angle_s * tmp) end
angle_m = abs(angle); angle_s = sign(angle) * abs(1.0); function tmp_2 = code(angle_s, a, b, angle_m) t_0 = (angle_m / 180.0) * pi; t_1 = cos(t_0); t_2 = (a + b) * (b - a); t_3 = pi * t_2; tmp = 0.0; if ((angle_m / 180.0) <= 1000.0) tmp = 0.011111111111111112 * (((a + b) * (angle_m * pi)) * (b - a)); elseif ((angle_m / 180.0) <= 2e+52) tmp = 0.011111111111111112 * (angle_m * sqrt((t_3 ^ 2.0))); elseif ((angle_m / 180.0) <= 5e+82) tmp = t_1 * (0.011111111111111112 * (angle_m * t_3)); else tmp = 2.0 * (t_1 * (t_2 * sin(t_0))); end tmp_2 = angle_s * tmp; end
angle_m = N[Abs[angle], $MachinePrecision]
angle_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a_, b_, angle$95$m_] := Block[{t$95$0 = N[(N[(angle$95$m / 180.0), $MachinePrecision] * Pi), $MachinePrecision]}, Block[{t$95$1 = N[Cos[t$95$0], $MachinePrecision]}, Block[{t$95$2 = N[(N[(a + b), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(Pi * t$95$2), $MachinePrecision]}, N[(angle$95$s * If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 1000.0], N[(0.011111111111111112 * N[(N[(N[(a + b), $MachinePrecision] * N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 2e+52], N[(0.011111111111111112 * N[(angle$95$m * N[Sqrt[N[Power[t$95$3, 2.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 5e+82], N[(t$95$1 * N[(0.011111111111111112 * N[(angle$95$m * t$95$3), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(t$95$1 * N[(t$95$2 * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]), $MachinePrecision]]]]]
\begin{array}{l}
angle_m = \left|angle\right|
\\
angle_s = \mathsf{copysign}\left(1, angle\right)
\\
\begin{array}{l}
t_0 := \frac{angle_m}{180} \cdot \pi\\
t_1 := \cos t_0\\
t_2 := \left(a + b\right) \cdot \left(b - a\right)\\
t_3 := \pi \cdot t_2\\
angle_s \cdot \begin{array}{l}
\mathbf{if}\;\frac{angle_m}{180} \leq 1000:\\
\;\;\;\;0.011111111111111112 \cdot \left(\left(\left(a + b\right) \cdot \left(angle_m \cdot \pi\right)\right) \cdot \left(b - a\right)\right)\\
\mathbf{elif}\;\frac{angle_m}{180} \leq 2 \cdot 10^{+52}:\\
\;\;\;\;0.011111111111111112 \cdot \left(angle_m \cdot \sqrt{{t_3}^{2}}\right)\\
\mathbf{elif}\;\frac{angle_m}{180} \leq 5 \cdot 10^{+82}:\\
\;\;\;\;t_1 \cdot \left(0.011111111111111112 \cdot \left(angle_m \cdot t_3\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(t_1 \cdot \left(t_2 \cdot \sin t_0\right)\right)\\
\end{array}
\end{array}
\end{array}
if (/.f64 angle 180) < 1e3Initial program 58.0%
unpow258.0%
unpow258.0%
difference-of-squares60.6%
Applied egg-rr60.6%
Taylor expanded in angle around 0 58.6%
Taylor expanded in angle around 0 57.7%
expm1-log1p-u46.4%
expm1-udef33.6%
associate-*r*33.6%
+-commutative33.6%
Applied egg-rr33.6%
expm1-def46.4%
expm1-log1p57.6%
associate-*r*74.6%
+-commutative74.6%
Simplified74.6%
if 1e3 < (/.f64 angle 180) < 2e52Initial program 48.7%
unpow248.7%
unpow248.7%
difference-of-squares48.7%
Applied egg-rr48.7%
Taylor expanded in angle around 0 48.4%
Taylor expanded in angle around 0 24.5%
add-sqr-sqrt24.5%
sqrt-unprod43.9%
pow243.9%
*-commutative43.9%
+-commutative43.9%
Applied egg-rr43.9%
if 2e52 < (/.f64 angle 180) < 5.00000000000000015e82Initial program 31.7%
unpow231.7%
unpow231.7%
difference-of-squares46.0%
Applied egg-rr46.0%
Taylor expanded in angle around 0 72.5%
if 5.00000000000000015e82 < (/.f64 angle 180) Initial program 29.1%
associate-*l*29.1%
associate-*l*29.1%
Simplified29.1%
unpow229.1%
unpow229.1%
difference-of-squares38.9%
Applied egg-rr38.9%
Final simplification68.2%
angle_m = (fabs.f64 angle)
angle_s = (copysign.f64 1 angle)
(FPCore (angle_s a b angle_m)
:precision binary64
(let* ((t_0 (* (/ angle_m 180.0) PI))
(t_1 (sin t_0))
(t_2 (cos t_0))
(t_3 (* (+ a b) (- b a)))
(t_4 (* 2.0 t_3)))
(*
angle_s
(if (<= (/ angle_m 180.0) 2e-75)
(* 0.011111111111111112 (* (* (+ a b) (* angle_m PI)) (- b a)))
(if (<= (/ angle_m 180.0) 2e+66)
(* t_2 (* t_4 (sin (* 0.005555555555555556 (* angle_m PI)))))
(if (<= (/ angle_m 180.0) 5e+83)
(* t_4 t_1)
(* 2.0 (* t_2 (* t_3 t_1)))))))))angle_m = fabs(angle);
angle_s = copysign(1.0, angle);
double code(double angle_s, double a, double b, double angle_m) {
double t_0 = (angle_m / 180.0) * ((double) M_PI);
double t_1 = sin(t_0);
double t_2 = cos(t_0);
double t_3 = (a + b) * (b - a);
double t_4 = 2.0 * t_3;
double tmp;
if ((angle_m / 180.0) <= 2e-75) {
tmp = 0.011111111111111112 * (((a + b) * (angle_m * ((double) M_PI))) * (b - a));
} else if ((angle_m / 180.0) <= 2e+66) {
tmp = t_2 * (t_4 * sin((0.005555555555555556 * (angle_m * ((double) M_PI)))));
} else if ((angle_m / 180.0) <= 5e+83) {
tmp = t_4 * t_1;
} else {
tmp = 2.0 * (t_2 * (t_3 * t_1));
}
return angle_s * tmp;
}
angle_m = Math.abs(angle);
angle_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b, double angle_m) {
double t_0 = (angle_m / 180.0) * Math.PI;
double t_1 = Math.sin(t_0);
double t_2 = Math.cos(t_0);
double t_3 = (a + b) * (b - a);
double t_4 = 2.0 * t_3;
double tmp;
if ((angle_m / 180.0) <= 2e-75) {
tmp = 0.011111111111111112 * (((a + b) * (angle_m * Math.PI)) * (b - a));
} else if ((angle_m / 180.0) <= 2e+66) {
tmp = t_2 * (t_4 * Math.sin((0.005555555555555556 * (angle_m * Math.PI))));
} else if ((angle_m / 180.0) <= 5e+83) {
tmp = t_4 * t_1;
} else {
tmp = 2.0 * (t_2 * (t_3 * t_1));
}
return angle_s * tmp;
}
angle_m = math.fabs(angle) angle_s = math.copysign(1.0, angle) def code(angle_s, a, b, angle_m): t_0 = (angle_m / 180.0) * math.pi t_1 = math.sin(t_0) t_2 = math.cos(t_0) t_3 = (a + b) * (b - a) t_4 = 2.0 * t_3 tmp = 0 if (angle_m / 180.0) <= 2e-75: tmp = 0.011111111111111112 * (((a + b) * (angle_m * math.pi)) * (b - a)) elif (angle_m / 180.0) <= 2e+66: tmp = t_2 * (t_4 * math.sin((0.005555555555555556 * (angle_m * math.pi)))) elif (angle_m / 180.0) <= 5e+83: tmp = t_4 * t_1 else: tmp = 2.0 * (t_2 * (t_3 * t_1)) return angle_s * tmp
angle_m = abs(angle) angle_s = copysign(1.0, angle) function code(angle_s, a, b, angle_m) t_0 = Float64(Float64(angle_m / 180.0) * pi) t_1 = sin(t_0) t_2 = cos(t_0) t_3 = Float64(Float64(a + b) * Float64(b - a)) t_4 = Float64(2.0 * t_3) tmp = 0.0 if (Float64(angle_m / 180.0) <= 2e-75) tmp = Float64(0.011111111111111112 * Float64(Float64(Float64(a + b) * Float64(angle_m * pi)) * Float64(b - a))); elseif (Float64(angle_m / 180.0) <= 2e+66) tmp = Float64(t_2 * Float64(t_4 * sin(Float64(0.005555555555555556 * Float64(angle_m * pi))))); elseif (Float64(angle_m / 180.0) <= 5e+83) tmp = Float64(t_4 * t_1); else tmp = Float64(2.0 * Float64(t_2 * Float64(t_3 * t_1))); end return Float64(angle_s * tmp) end
angle_m = abs(angle); angle_s = sign(angle) * abs(1.0); function tmp_2 = code(angle_s, a, b, angle_m) t_0 = (angle_m / 180.0) * pi; t_1 = sin(t_0); t_2 = cos(t_0); t_3 = (a + b) * (b - a); t_4 = 2.0 * t_3; tmp = 0.0; if ((angle_m / 180.0) <= 2e-75) tmp = 0.011111111111111112 * (((a + b) * (angle_m * pi)) * (b - a)); elseif ((angle_m / 180.0) <= 2e+66) tmp = t_2 * (t_4 * sin((0.005555555555555556 * (angle_m * pi)))); elseif ((angle_m / 180.0) <= 5e+83) tmp = t_4 * t_1; else tmp = 2.0 * (t_2 * (t_3 * t_1)); end tmp_2 = angle_s * tmp; end
angle_m = N[Abs[angle], $MachinePrecision]
angle_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a_, b_, 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[Cos[t$95$0], $MachinePrecision]}, Block[{t$95$3 = N[(N[(a + b), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(2.0 * t$95$3), $MachinePrecision]}, N[(angle$95$s * If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 2e-75], N[(0.011111111111111112 * N[(N[(N[(a + b), $MachinePrecision] * N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 2e+66], N[(t$95$2 * N[(t$95$4 * N[Sin[N[(0.005555555555555556 * N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 5e+83], N[(t$95$4 * t$95$1), $MachinePrecision], N[(2.0 * N[(t$95$2 * N[(t$95$3 * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]), $MachinePrecision]]]]]]
\begin{array}{l}
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 := \cos t_0\\
t_3 := \left(a + b\right) \cdot \left(b - a\right)\\
t_4 := 2 \cdot t_3\\
angle_s \cdot \begin{array}{l}
\mathbf{if}\;\frac{angle_m}{180} \leq 2 \cdot 10^{-75}:\\
\;\;\;\;0.011111111111111112 \cdot \left(\left(\left(a + b\right) \cdot \left(angle_m \cdot \pi\right)\right) \cdot \left(b - a\right)\right)\\
\mathbf{elif}\;\frac{angle_m}{180} \leq 2 \cdot 10^{+66}:\\
\;\;\;\;t_2 \cdot \left(t_4 \cdot \sin \left(0.005555555555555556 \cdot \left(angle_m \cdot \pi\right)\right)\right)\\
\mathbf{elif}\;\frac{angle_m}{180} \leq 5 \cdot 10^{+83}:\\
\;\;\;\;t_4 \cdot t_1\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(t_2 \cdot \left(t_3 \cdot t_1\right)\right)\\
\end{array}
\end{array}
\end{array}
if (/.f64 angle 180) < 1.9999999999999999e-75Initial program 56.2%
unpow256.2%
unpow256.2%
difference-of-squares58.3%
Applied egg-rr58.3%
Taylor expanded in angle around 0 56.4%
Taylor expanded in angle around 0 55.4%
expm1-log1p-u45.1%
expm1-udef32.1%
associate-*r*32.1%
+-commutative32.1%
Applied egg-rr32.1%
expm1-def45.1%
expm1-log1p55.4%
associate-*r*73.3%
+-commutative73.3%
Simplified73.3%
if 1.9999999999999999e-75 < (/.f64 angle 180) < 1.99999999999999989e66Initial program 70.5%
unpow270.5%
unpow270.5%
difference-of-squares81.0%
Applied egg-rr81.0%
Taylor expanded in angle around 0 80.1%
if 1.99999999999999989e66 < (/.f64 angle 180) < 5.00000000000000029e83Initial program 30.5%
unpow230.5%
unpow230.5%
difference-of-squares30.5%
Applied egg-rr30.5%
Taylor expanded in angle around 0 59.1%
if 5.00000000000000029e83 < (/.f64 angle 180) Initial program 29.1%
associate-*l*29.1%
associate-*l*29.1%
Simplified29.1%
unpow229.1%
unpow229.1%
difference-of-squares38.9%
Applied egg-rr38.9%
Final simplification68.1%
angle_m = (fabs.f64 angle)
angle_s = (copysign.f64 1 angle)
(FPCore (angle_s a b angle_m)
:precision binary64
(let* ((t_0 (* (/ angle_m 180.0) PI))
(t_1 (cos t_0))
(t_2 (* 2.0 (* (+ a b) (- b a)))))
(*
angle_s
(if (<= (/ angle_m 180.0) 2e-75)
(* 0.011111111111111112 (* (* (+ a b) (* angle_m PI)) (- b a)))
(if (<= (/ angle_m 180.0) 2e+66)
(* t_1 (* t_2 (sin (* 0.005555555555555556 (* angle_m PI)))))
(if (<= (/ angle_m 180.0) 5e+83)
(* t_2 (sin t_0))
(* t_1 (* t_2 (sin (* PI (* angle_m 0.005555555555555556)))))))))))angle_m = fabs(angle);
angle_s = copysign(1.0, angle);
double code(double angle_s, double a, double b, double angle_m) {
double t_0 = (angle_m / 180.0) * ((double) M_PI);
double t_1 = cos(t_0);
double t_2 = 2.0 * ((a + b) * (b - a));
double tmp;
if ((angle_m / 180.0) <= 2e-75) {
tmp = 0.011111111111111112 * (((a + b) * (angle_m * ((double) M_PI))) * (b - a));
} else if ((angle_m / 180.0) <= 2e+66) {
tmp = t_1 * (t_2 * sin((0.005555555555555556 * (angle_m * ((double) M_PI)))));
} else if ((angle_m / 180.0) <= 5e+83) {
tmp = t_2 * sin(t_0);
} else {
tmp = t_1 * (t_2 * sin((((double) M_PI) * (angle_m * 0.005555555555555556))));
}
return angle_s * tmp;
}
angle_m = Math.abs(angle);
angle_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b, double angle_m) {
double t_0 = (angle_m / 180.0) * Math.PI;
double t_1 = Math.cos(t_0);
double t_2 = 2.0 * ((a + b) * (b - a));
double tmp;
if ((angle_m / 180.0) <= 2e-75) {
tmp = 0.011111111111111112 * (((a + b) * (angle_m * Math.PI)) * (b - a));
} else if ((angle_m / 180.0) <= 2e+66) {
tmp = t_1 * (t_2 * Math.sin((0.005555555555555556 * (angle_m * Math.PI))));
} else if ((angle_m / 180.0) <= 5e+83) {
tmp = t_2 * Math.sin(t_0);
} else {
tmp = t_1 * (t_2 * Math.sin((Math.PI * (angle_m * 0.005555555555555556))));
}
return angle_s * tmp;
}
angle_m = math.fabs(angle) angle_s = math.copysign(1.0, angle) def code(angle_s, a, b, angle_m): t_0 = (angle_m / 180.0) * math.pi t_1 = math.cos(t_0) t_2 = 2.0 * ((a + b) * (b - a)) tmp = 0 if (angle_m / 180.0) <= 2e-75: tmp = 0.011111111111111112 * (((a + b) * (angle_m * math.pi)) * (b - a)) elif (angle_m / 180.0) <= 2e+66: tmp = t_1 * (t_2 * math.sin((0.005555555555555556 * (angle_m * math.pi)))) elif (angle_m / 180.0) <= 5e+83: tmp = t_2 * math.sin(t_0) else: tmp = t_1 * (t_2 * math.sin((math.pi * (angle_m * 0.005555555555555556)))) return angle_s * tmp
angle_m = abs(angle) angle_s = copysign(1.0, angle) function code(angle_s, a, b, angle_m) t_0 = Float64(Float64(angle_m / 180.0) * pi) t_1 = cos(t_0) t_2 = Float64(2.0 * Float64(Float64(a + b) * Float64(b - a))) tmp = 0.0 if (Float64(angle_m / 180.0) <= 2e-75) tmp = Float64(0.011111111111111112 * Float64(Float64(Float64(a + b) * Float64(angle_m * pi)) * Float64(b - a))); elseif (Float64(angle_m / 180.0) <= 2e+66) tmp = Float64(t_1 * Float64(t_2 * sin(Float64(0.005555555555555556 * Float64(angle_m * pi))))); elseif (Float64(angle_m / 180.0) <= 5e+83) tmp = Float64(t_2 * sin(t_0)); else tmp = Float64(t_1 * Float64(t_2 * sin(Float64(pi * Float64(angle_m * 0.005555555555555556))))); end return Float64(angle_s * tmp) end
angle_m = abs(angle); angle_s = sign(angle) * abs(1.0); function tmp_2 = code(angle_s, a, b, angle_m) t_0 = (angle_m / 180.0) * pi; t_1 = cos(t_0); t_2 = 2.0 * ((a + b) * (b - a)); tmp = 0.0; if ((angle_m / 180.0) <= 2e-75) tmp = 0.011111111111111112 * (((a + b) * (angle_m * pi)) * (b - a)); elseif ((angle_m / 180.0) <= 2e+66) tmp = t_1 * (t_2 * sin((0.005555555555555556 * (angle_m * pi)))); elseif ((angle_m / 180.0) <= 5e+83) tmp = t_2 * sin(t_0); else tmp = t_1 * (t_2 * sin((pi * (angle_m * 0.005555555555555556)))); end tmp_2 = angle_s * tmp; end
angle_m = N[Abs[angle], $MachinePrecision]
angle_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a_, b_, angle$95$m_] := Block[{t$95$0 = N[(N[(angle$95$m / 180.0), $MachinePrecision] * Pi), $MachinePrecision]}, Block[{t$95$1 = N[Cos[t$95$0], $MachinePrecision]}, Block[{t$95$2 = N[(2.0 * N[(N[(a + b), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, N[(angle$95$s * If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 2e-75], N[(0.011111111111111112 * N[(N[(N[(a + b), $MachinePrecision] * N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 2e+66], N[(t$95$1 * N[(t$95$2 * N[Sin[N[(0.005555555555555556 * N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 5e+83], N[(t$95$2 * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision], N[(t$95$1 * N[(t$95$2 * N[Sin[N[(Pi * N[(angle$95$m * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]), $MachinePrecision]]]]
\begin{array}{l}
angle_m = \left|angle\right|
\\
angle_s = \mathsf{copysign}\left(1, angle\right)
\\
\begin{array}{l}
t_0 := \frac{angle_m}{180} \cdot \pi\\
t_1 := \cos t_0\\
t_2 := 2 \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)\\
angle_s \cdot \begin{array}{l}
\mathbf{if}\;\frac{angle_m}{180} \leq 2 \cdot 10^{-75}:\\
\;\;\;\;0.011111111111111112 \cdot \left(\left(\left(a + b\right) \cdot \left(angle_m \cdot \pi\right)\right) \cdot \left(b - a\right)\right)\\
\mathbf{elif}\;\frac{angle_m}{180} \leq 2 \cdot 10^{+66}:\\
\;\;\;\;t_1 \cdot \left(t_2 \cdot \sin \left(0.005555555555555556 \cdot \left(angle_m \cdot \pi\right)\right)\right)\\
\mathbf{elif}\;\frac{angle_m}{180} \leq 5 \cdot 10^{+83}:\\
\;\;\;\;t_2 \cdot \sin t_0\\
\mathbf{else}:\\
\;\;\;\;t_1 \cdot \left(t_2 \cdot \sin \left(\pi \cdot \left(angle_m \cdot 0.005555555555555556\right)\right)\right)\\
\end{array}
\end{array}
\end{array}
if (/.f64 angle 180) < 1.9999999999999999e-75Initial program 56.2%
unpow256.2%
unpow256.2%
difference-of-squares58.3%
Applied egg-rr58.3%
Taylor expanded in angle around 0 56.4%
Taylor expanded in angle around 0 55.4%
expm1-log1p-u45.1%
expm1-udef32.1%
associate-*r*32.1%
+-commutative32.1%
Applied egg-rr32.1%
expm1-def45.1%
expm1-log1p55.4%
associate-*r*73.3%
+-commutative73.3%
Simplified73.3%
if 1.9999999999999999e-75 < (/.f64 angle 180) < 1.99999999999999989e66Initial program 70.5%
unpow270.5%
unpow270.5%
difference-of-squares81.0%
Applied egg-rr81.0%
Taylor expanded in angle around 0 80.1%
if 1.99999999999999989e66 < (/.f64 angle 180) < 5.00000000000000029e83Initial program 30.5%
unpow230.5%
unpow230.5%
difference-of-squares30.5%
Applied egg-rr30.5%
Taylor expanded in angle around 0 59.1%
if 5.00000000000000029e83 < (/.f64 angle 180) Initial program 29.1%
unpow229.1%
unpow229.1%
difference-of-squares38.9%
Applied egg-rr38.9%
Taylor expanded in angle around 0 30.3%
*-commutative30.3%
*-commutative30.3%
associate-*l*38.3%
*-commutative38.3%
Simplified38.3%
Final simplification68.0%
angle_m = (fabs.f64 angle)
angle_s = (copysign.f64 1 angle)
(FPCore (angle_s a b angle_m)
:precision binary64
(let* ((t_0 (* (+ a b) (- b a)))
(t_1 (* 2.0 t_0))
(t_2 (* (/ angle_m 180.0) PI))
(t_3 (cos t_2)))
(*
angle_s
(if (<= (/ angle_m 180.0) 1e-33)
(* 0.011111111111111112 (* (* (+ a b) (* angle_m PI)) (- b a)))
(if (<= (/ angle_m 180.0) 1e+17)
(* (* t_1 (sin t_2)) (cos (* 0.005555555555555556 (* angle_m PI))))
(if (<= (/ angle_m 180.0) 7e+85)
(* t_3 (* 0.011111111111111112 (* angle_m (* PI t_0))))
(* t_3 (* t_1 (sin (* PI (* angle_m 0.005555555555555556)))))))))))angle_m = fabs(angle);
angle_s = copysign(1.0, angle);
double code(double angle_s, double a, double b, double angle_m) {
double t_0 = (a + b) * (b - a);
double t_1 = 2.0 * t_0;
double t_2 = (angle_m / 180.0) * ((double) M_PI);
double t_3 = cos(t_2);
double tmp;
if ((angle_m / 180.0) <= 1e-33) {
tmp = 0.011111111111111112 * (((a + b) * (angle_m * ((double) M_PI))) * (b - a));
} else if ((angle_m / 180.0) <= 1e+17) {
tmp = (t_1 * sin(t_2)) * cos((0.005555555555555556 * (angle_m * ((double) M_PI))));
} else if ((angle_m / 180.0) <= 7e+85) {
tmp = t_3 * (0.011111111111111112 * (angle_m * (((double) M_PI) * t_0)));
} else {
tmp = t_3 * (t_1 * sin((((double) M_PI) * (angle_m * 0.005555555555555556))));
}
return angle_s * tmp;
}
angle_m = Math.abs(angle);
angle_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b, double angle_m) {
double t_0 = (a + b) * (b - a);
double t_1 = 2.0 * t_0;
double t_2 = (angle_m / 180.0) * Math.PI;
double t_3 = Math.cos(t_2);
double tmp;
if ((angle_m / 180.0) <= 1e-33) {
tmp = 0.011111111111111112 * (((a + b) * (angle_m * Math.PI)) * (b - a));
} else if ((angle_m / 180.0) <= 1e+17) {
tmp = (t_1 * Math.sin(t_2)) * Math.cos((0.005555555555555556 * (angle_m * Math.PI)));
} else if ((angle_m / 180.0) <= 7e+85) {
tmp = t_3 * (0.011111111111111112 * (angle_m * (Math.PI * t_0)));
} else {
tmp = t_3 * (t_1 * Math.sin((Math.PI * (angle_m * 0.005555555555555556))));
}
return angle_s * tmp;
}
angle_m = math.fabs(angle) angle_s = math.copysign(1.0, angle) def code(angle_s, a, b, angle_m): t_0 = (a + b) * (b - a) t_1 = 2.0 * t_0 t_2 = (angle_m / 180.0) * math.pi t_3 = math.cos(t_2) tmp = 0 if (angle_m / 180.0) <= 1e-33: tmp = 0.011111111111111112 * (((a + b) * (angle_m * math.pi)) * (b - a)) elif (angle_m / 180.0) <= 1e+17: tmp = (t_1 * math.sin(t_2)) * math.cos((0.005555555555555556 * (angle_m * math.pi))) elif (angle_m / 180.0) <= 7e+85: tmp = t_3 * (0.011111111111111112 * (angle_m * (math.pi * t_0))) else: tmp = t_3 * (t_1 * math.sin((math.pi * (angle_m * 0.005555555555555556)))) return angle_s * tmp
angle_m = abs(angle) angle_s = copysign(1.0, angle) function code(angle_s, a, b, angle_m) t_0 = Float64(Float64(a + b) * Float64(b - a)) t_1 = Float64(2.0 * t_0) t_2 = Float64(Float64(angle_m / 180.0) * pi) t_3 = cos(t_2) tmp = 0.0 if (Float64(angle_m / 180.0) <= 1e-33) tmp = Float64(0.011111111111111112 * Float64(Float64(Float64(a + b) * Float64(angle_m * pi)) * Float64(b - a))); elseif (Float64(angle_m / 180.0) <= 1e+17) tmp = Float64(Float64(t_1 * sin(t_2)) * cos(Float64(0.005555555555555556 * Float64(angle_m * pi)))); elseif (Float64(angle_m / 180.0) <= 7e+85) tmp = Float64(t_3 * Float64(0.011111111111111112 * Float64(angle_m * Float64(pi * t_0)))); else tmp = Float64(t_3 * Float64(t_1 * sin(Float64(pi * Float64(angle_m * 0.005555555555555556))))); end return Float64(angle_s * tmp) end
angle_m = abs(angle); angle_s = sign(angle) * abs(1.0); function tmp_2 = code(angle_s, a, b, angle_m) t_0 = (a + b) * (b - a); t_1 = 2.0 * t_0; t_2 = (angle_m / 180.0) * pi; t_3 = cos(t_2); tmp = 0.0; if ((angle_m / 180.0) <= 1e-33) tmp = 0.011111111111111112 * (((a + b) * (angle_m * pi)) * (b - a)); elseif ((angle_m / 180.0) <= 1e+17) tmp = (t_1 * sin(t_2)) * cos((0.005555555555555556 * (angle_m * pi))); elseif ((angle_m / 180.0) <= 7e+85) tmp = t_3 * (0.011111111111111112 * (angle_m * (pi * t_0))); else tmp = t_3 * (t_1 * sin((pi * (angle_m * 0.005555555555555556)))); end tmp_2 = angle_s * tmp; end
angle_m = N[Abs[angle], $MachinePrecision]
angle_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a_, b_, angle$95$m_] := Block[{t$95$0 = N[(N[(a + b), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(2.0 * t$95$0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(angle$95$m / 180.0), $MachinePrecision] * Pi), $MachinePrecision]}, Block[{t$95$3 = N[Cos[t$95$2], $MachinePrecision]}, N[(angle$95$s * If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 1e-33], N[(0.011111111111111112 * N[(N[(N[(a + b), $MachinePrecision] * N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 1e+17], N[(N[(t$95$1 * N[Sin[t$95$2], $MachinePrecision]), $MachinePrecision] * N[Cos[N[(0.005555555555555556 * N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 7e+85], N[(t$95$3 * N[(0.011111111111111112 * N[(angle$95$m * N[(Pi * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$3 * N[(t$95$1 * N[Sin[N[(Pi * N[(angle$95$m * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]), $MachinePrecision]]]]]
\begin{array}{l}
angle_m = \left|angle\right|
\\
angle_s = \mathsf{copysign}\left(1, angle\right)
\\
\begin{array}{l}
t_0 := \left(a + b\right) \cdot \left(b - a\right)\\
t_1 := 2 \cdot t_0\\
t_2 := \frac{angle_m}{180} \cdot \pi\\
t_3 := \cos t_2\\
angle_s \cdot \begin{array}{l}
\mathbf{if}\;\frac{angle_m}{180} \leq 10^{-33}:\\
\;\;\;\;0.011111111111111112 \cdot \left(\left(\left(a + b\right) \cdot \left(angle_m \cdot \pi\right)\right) \cdot \left(b - a\right)\right)\\
\mathbf{elif}\;\frac{angle_m}{180} \leq 10^{+17}:\\
\;\;\;\;\left(t_1 \cdot \sin t_2\right) \cdot \cos \left(0.005555555555555556 \cdot \left(angle_m \cdot \pi\right)\right)\\
\mathbf{elif}\;\frac{angle_m}{180} \leq 7 \cdot 10^{+85}:\\
\;\;\;\;t_3 \cdot \left(0.011111111111111112 \cdot \left(angle_m \cdot \left(\pi \cdot t_0\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t_3 \cdot \left(t_1 \cdot \sin \left(\pi \cdot \left(angle_m \cdot 0.005555555555555556\right)\right)\right)\\
\end{array}
\end{array}
\end{array}
if (/.f64 angle 180) < 1.0000000000000001e-33Initial program 57.0%
unpow257.0%
unpow257.0%
difference-of-squares59.6%
Applied egg-rr59.6%
Taylor expanded in angle around 0 57.7%
Taylor expanded in angle around 0 56.7%
expm1-log1p-u46.2%
expm1-udef33.1%
associate-*r*33.1%
+-commutative33.1%
Applied egg-rr33.1%
expm1-def46.1%
expm1-log1p56.7%
associate-*r*74.1%
+-commutative74.1%
Simplified74.1%
if 1.0000000000000001e-33 < (/.f64 angle 180) < 1e17Initial program 99.7%
unpow299.7%
unpow299.7%
difference-of-squares99.7%
Applied egg-rr99.7%
Taylor expanded in angle around 0 99.7%
if 1e17 < (/.f64 angle 180) < 7.0000000000000001e85Initial program 35.8%
unpow235.8%
unpow235.8%
difference-of-squares43.5%
Applied egg-rr43.5%
Taylor expanded in angle around 0 62.8%
if 7.0000000000000001e85 < (/.f64 angle 180) Initial program 28.0%
unpow228.0%
unpow228.0%
difference-of-squares38.3%
Applied egg-rr38.3%
Taylor expanded in angle around 0 31.8%
*-commutative31.8%
*-commutative31.8%
associate-*l*37.7%
*-commutative37.7%
Simplified37.7%
Final simplification68.6%
angle_m = (fabs.f64 angle)
angle_s = (copysign.f64 1 angle)
(FPCore (angle_s a b angle_m)
:precision binary64
(let* ((t_0 (* (+ a b) (- b a))) (t_1 (* PI t_0)))
(*
angle_s
(if (<= (/ angle_m 180.0) 1000.0)
(* 0.011111111111111112 (* (* (+ a b) (* angle_m PI)) (- b a)))
(if (<= (/ angle_m 180.0) 2e+52)
(* 0.011111111111111112 (* angle_m (sqrt (pow t_1 2.0))))
(if (<= (/ angle_m 180.0) 5e+82)
(*
(cos (* (/ angle_m 180.0) PI))
(* 0.011111111111111112 (* angle_m t_1)))
(* (* 2.0 t_0) (sin (/ angle_m (/ 180.0 PI))))))))))angle_m = fabs(angle);
angle_s = copysign(1.0, angle);
double code(double angle_s, double a, double b, double angle_m) {
double t_0 = (a + b) * (b - a);
double t_1 = ((double) M_PI) * t_0;
double tmp;
if ((angle_m / 180.0) <= 1000.0) {
tmp = 0.011111111111111112 * (((a + b) * (angle_m * ((double) M_PI))) * (b - a));
} else if ((angle_m / 180.0) <= 2e+52) {
tmp = 0.011111111111111112 * (angle_m * sqrt(pow(t_1, 2.0)));
} else if ((angle_m / 180.0) <= 5e+82) {
tmp = cos(((angle_m / 180.0) * ((double) M_PI))) * (0.011111111111111112 * (angle_m * t_1));
} else {
tmp = (2.0 * t_0) * sin((angle_m / (180.0 / ((double) M_PI))));
}
return angle_s * tmp;
}
angle_m = Math.abs(angle);
angle_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b, double angle_m) {
double t_0 = (a + b) * (b - a);
double t_1 = Math.PI * t_0;
double tmp;
if ((angle_m / 180.0) <= 1000.0) {
tmp = 0.011111111111111112 * (((a + b) * (angle_m * Math.PI)) * (b - a));
} else if ((angle_m / 180.0) <= 2e+52) {
tmp = 0.011111111111111112 * (angle_m * Math.sqrt(Math.pow(t_1, 2.0)));
} else if ((angle_m / 180.0) <= 5e+82) {
tmp = Math.cos(((angle_m / 180.0) * Math.PI)) * (0.011111111111111112 * (angle_m * t_1));
} else {
tmp = (2.0 * t_0) * Math.sin((angle_m / (180.0 / Math.PI)));
}
return angle_s * tmp;
}
angle_m = math.fabs(angle) angle_s = math.copysign(1.0, angle) def code(angle_s, a, b, angle_m): t_0 = (a + b) * (b - a) t_1 = math.pi * t_0 tmp = 0 if (angle_m / 180.0) <= 1000.0: tmp = 0.011111111111111112 * (((a + b) * (angle_m * math.pi)) * (b - a)) elif (angle_m / 180.0) <= 2e+52: tmp = 0.011111111111111112 * (angle_m * math.sqrt(math.pow(t_1, 2.0))) elif (angle_m / 180.0) <= 5e+82: tmp = math.cos(((angle_m / 180.0) * math.pi)) * (0.011111111111111112 * (angle_m * t_1)) else: tmp = (2.0 * t_0) * math.sin((angle_m / (180.0 / math.pi))) return angle_s * tmp
angle_m = abs(angle) angle_s = copysign(1.0, angle) function code(angle_s, a, b, angle_m) t_0 = Float64(Float64(a + b) * Float64(b - a)) t_1 = Float64(pi * t_0) tmp = 0.0 if (Float64(angle_m / 180.0) <= 1000.0) tmp = Float64(0.011111111111111112 * Float64(Float64(Float64(a + b) * Float64(angle_m * pi)) * Float64(b - a))); elseif (Float64(angle_m / 180.0) <= 2e+52) tmp = Float64(0.011111111111111112 * Float64(angle_m * sqrt((t_1 ^ 2.0)))); elseif (Float64(angle_m / 180.0) <= 5e+82) tmp = Float64(cos(Float64(Float64(angle_m / 180.0) * pi)) * Float64(0.011111111111111112 * Float64(angle_m * t_1))); else tmp = Float64(Float64(2.0 * t_0) * sin(Float64(angle_m / Float64(180.0 / pi)))); end return Float64(angle_s * tmp) end
angle_m = abs(angle); angle_s = sign(angle) * abs(1.0); function tmp_2 = code(angle_s, a, b, angle_m) t_0 = (a + b) * (b - a); t_1 = pi * t_0; tmp = 0.0; if ((angle_m / 180.0) <= 1000.0) tmp = 0.011111111111111112 * (((a + b) * (angle_m * pi)) * (b - a)); elseif ((angle_m / 180.0) <= 2e+52) tmp = 0.011111111111111112 * (angle_m * sqrt((t_1 ^ 2.0))); elseif ((angle_m / 180.0) <= 5e+82) tmp = cos(((angle_m / 180.0) * pi)) * (0.011111111111111112 * (angle_m * t_1)); else tmp = (2.0 * t_0) * sin((angle_m / (180.0 / pi))); end tmp_2 = angle_s * tmp; end
angle_m = N[Abs[angle], $MachinePrecision]
angle_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a_, b_, angle$95$m_] := Block[{t$95$0 = N[(N[(a + b), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(Pi * t$95$0), $MachinePrecision]}, N[(angle$95$s * If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 1000.0], N[(0.011111111111111112 * N[(N[(N[(a + b), $MachinePrecision] * N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 2e+52], N[(0.011111111111111112 * N[(angle$95$m * N[Sqrt[N[Power[t$95$1, 2.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 5e+82], N[(N[Cos[N[(N[(angle$95$m / 180.0), $MachinePrecision] * Pi), $MachinePrecision]], $MachinePrecision] * N[(0.011111111111111112 * N[(angle$95$m * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(2.0 * t$95$0), $MachinePrecision] * N[Sin[N[(angle$95$m / N[(180.0 / Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]), $MachinePrecision]]]
\begin{array}{l}
angle_m = \left|angle\right|
\\
angle_s = \mathsf{copysign}\left(1, angle\right)
\\
\begin{array}{l}
t_0 := \left(a + b\right) \cdot \left(b - a\right)\\
t_1 := \pi \cdot t_0\\
angle_s \cdot \begin{array}{l}
\mathbf{if}\;\frac{angle_m}{180} \leq 1000:\\
\;\;\;\;0.011111111111111112 \cdot \left(\left(\left(a + b\right) \cdot \left(angle_m \cdot \pi\right)\right) \cdot \left(b - a\right)\right)\\
\mathbf{elif}\;\frac{angle_m}{180} \leq 2 \cdot 10^{+52}:\\
\;\;\;\;0.011111111111111112 \cdot \left(angle_m \cdot \sqrt{{t_1}^{2}}\right)\\
\mathbf{elif}\;\frac{angle_m}{180} \leq 5 \cdot 10^{+82}:\\
\;\;\;\;\cos \left(\frac{angle_m}{180} \cdot \pi\right) \cdot \left(0.011111111111111112 \cdot \left(angle_m \cdot t_1\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(2 \cdot t_0\right) \cdot \sin \left(\frac{angle_m}{\frac{180}{\pi}}\right)\\
\end{array}
\end{array}
\end{array}
if (/.f64 angle 180) < 1e3Initial program 58.0%
unpow258.0%
unpow258.0%
difference-of-squares60.6%
Applied egg-rr60.6%
Taylor expanded in angle around 0 58.6%
Taylor expanded in angle around 0 57.7%
expm1-log1p-u46.4%
expm1-udef33.6%
associate-*r*33.6%
+-commutative33.6%
Applied egg-rr33.6%
expm1-def46.4%
expm1-log1p57.6%
associate-*r*74.6%
+-commutative74.6%
Simplified74.6%
if 1e3 < (/.f64 angle 180) < 2e52Initial program 48.7%
unpow248.7%
unpow248.7%
difference-of-squares48.7%
Applied egg-rr48.7%
Taylor expanded in angle around 0 48.4%
Taylor expanded in angle around 0 24.5%
add-sqr-sqrt24.5%
sqrt-unprod43.9%
pow243.9%
*-commutative43.9%
+-commutative43.9%
Applied egg-rr43.9%
if 2e52 < (/.f64 angle 180) < 5.00000000000000015e82Initial program 31.7%
unpow231.7%
unpow231.7%
difference-of-squares46.0%
Applied egg-rr46.0%
Taylor expanded in angle around 0 72.5%
if 5.00000000000000015e82 < (/.f64 angle 180) Initial program 29.1%
unpow229.1%
unpow229.1%
difference-of-squares38.9%
Applied egg-rr38.9%
Taylor expanded in angle around 0 40.1%
associate-*r/39.8%
*-commutative39.8%
associate-/l*40.1%
Applied egg-rr40.1%
Final simplification68.5%
angle_m = (fabs.f64 angle)
angle_s = (copysign.f64 1 angle)
(FPCore (angle_s a b angle_m)
:precision binary64
(*
angle_s
(if (<= (/ angle_m 180.0) 1e-33)
(* 0.011111111111111112 (* (* (+ a b) (* angle_m PI)) (- b a)))
(* (* 2.0 (* (+ a b) (- b a))) (sin (* (/ angle_m 180.0) PI))))))angle_m = fabs(angle);
angle_s = copysign(1.0, angle);
double code(double angle_s, double a, double b, double angle_m) {
double tmp;
if ((angle_m / 180.0) <= 1e-33) {
tmp = 0.011111111111111112 * (((a + b) * (angle_m * ((double) M_PI))) * (b - a));
} else {
tmp = (2.0 * ((a + b) * (b - a))) * sin(((angle_m / 180.0) * ((double) M_PI)));
}
return angle_s * tmp;
}
angle_m = Math.abs(angle);
angle_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b, double angle_m) {
double tmp;
if ((angle_m / 180.0) <= 1e-33) {
tmp = 0.011111111111111112 * (((a + b) * (angle_m * Math.PI)) * (b - a));
} else {
tmp = (2.0 * ((a + b) * (b - a))) * Math.sin(((angle_m / 180.0) * Math.PI));
}
return angle_s * tmp;
}
angle_m = math.fabs(angle) angle_s = math.copysign(1.0, angle) def code(angle_s, a, b, angle_m): tmp = 0 if (angle_m / 180.0) <= 1e-33: tmp = 0.011111111111111112 * (((a + b) * (angle_m * math.pi)) * (b - a)) else: tmp = (2.0 * ((a + b) * (b - a))) * math.sin(((angle_m / 180.0) * math.pi)) return angle_s * tmp
angle_m = abs(angle) angle_s = copysign(1.0, angle) function code(angle_s, a, b, angle_m) tmp = 0.0 if (Float64(angle_m / 180.0) <= 1e-33) tmp = Float64(0.011111111111111112 * Float64(Float64(Float64(a + b) * Float64(angle_m * pi)) * Float64(b - a))); else tmp = Float64(Float64(2.0 * Float64(Float64(a + b) * Float64(b - a))) * sin(Float64(Float64(angle_m / 180.0) * pi))); end return Float64(angle_s * tmp) end
angle_m = abs(angle); angle_s = sign(angle) * abs(1.0); function tmp_2 = code(angle_s, a, b, angle_m) tmp = 0.0; if ((angle_m / 180.0) <= 1e-33) tmp = 0.011111111111111112 * (((a + b) * (angle_m * pi)) * (b - a)); else tmp = (2.0 * ((a + b) * (b - a))) * sin(((angle_m / 180.0) * pi)); end tmp_2 = angle_s * tmp; end
angle_m = N[Abs[angle], $MachinePrecision]
angle_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a_, b_, angle$95$m_] := N[(angle$95$s * If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 1e-33], N[(0.011111111111111112 * N[(N[(N[(a + b), $MachinePrecision] * N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(2.0 * N[(N[(a + b), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sin[N[(N[(angle$95$m / 180.0), $MachinePrecision] * Pi), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
angle_m = \left|angle\right|
\\
angle_s = \mathsf{copysign}\left(1, angle\right)
\\
angle_s \cdot \begin{array}{l}
\mathbf{if}\;\frac{angle_m}{180} \leq 10^{-33}:\\
\;\;\;\;0.011111111111111112 \cdot \left(\left(\left(a + b\right) \cdot \left(angle_m \cdot \pi\right)\right) \cdot \left(b - a\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(2 \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left(\frac{angle_m}{180} \cdot \pi\right)\\
\end{array}
\end{array}
if (/.f64 angle 180) < 1.0000000000000001e-33Initial program 57.0%
unpow257.0%
unpow257.0%
difference-of-squares59.6%
Applied egg-rr59.6%
Taylor expanded in angle around 0 57.7%
Taylor expanded in angle around 0 56.7%
expm1-log1p-u46.2%
expm1-udef33.1%
associate-*r*33.1%
+-commutative33.1%
Applied egg-rr33.1%
expm1-def46.1%
expm1-log1p56.7%
associate-*r*74.1%
+-commutative74.1%
Simplified74.1%
if 1.0000000000000001e-33 < (/.f64 angle 180) Initial program 37.2%
unpow237.2%
unpow237.2%
difference-of-squares45.8%
Applied egg-rr45.8%
Taylor expanded in angle around 0 46.5%
Final simplification67.9%
angle_m = (fabs.f64 angle)
angle_s = (copysign.f64 1 angle)
(FPCore (angle_s a b angle_m)
:precision binary64
(*
angle_s
(if (<= (/ angle_m 180.0) 2e-50)
(* 0.011111111111111112 (* (* (+ a b) (* angle_m PI)) (- b a)))
(* (* 2.0 (* (+ a b) (- b a))) (sin (/ angle_m (/ 180.0 PI)))))))angle_m = fabs(angle);
angle_s = copysign(1.0, angle);
double code(double angle_s, double a, double b, double angle_m) {
double tmp;
if ((angle_m / 180.0) <= 2e-50) {
tmp = 0.011111111111111112 * (((a + b) * (angle_m * ((double) M_PI))) * (b - a));
} else {
tmp = (2.0 * ((a + b) * (b - a))) * sin((angle_m / (180.0 / ((double) M_PI))));
}
return angle_s * tmp;
}
angle_m = Math.abs(angle);
angle_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b, double angle_m) {
double tmp;
if ((angle_m / 180.0) <= 2e-50) {
tmp = 0.011111111111111112 * (((a + b) * (angle_m * Math.PI)) * (b - a));
} else {
tmp = (2.0 * ((a + b) * (b - a))) * Math.sin((angle_m / (180.0 / Math.PI)));
}
return angle_s * tmp;
}
angle_m = math.fabs(angle) angle_s = math.copysign(1.0, angle) def code(angle_s, a, b, angle_m): tmp = 0 if (angle_m / 180.0) <= 2e-50: tmp = 0.011111111111111112 * (((a + b) * (angle_m * math.pi)) * (b - a)) else: tmp = (2.0 * ((a + b) * (b - a))) * math.sin((angle_m / (180.0 / math.pi))) return angle_s * tmp
angle_m = abs(angle) angle_s = copysign(1.0, angle) function code(angle_s, a, b, angle_m) tmp = 0.0 if (Float64(angle_m / 180.0) <= 2e-50) tmp = Float64(0.011111111111111112 * Float64(Float64(Float64(a + b) * Float64(angle_m * pi)) * Float64(b - a))); else tmp = Float64(Float64(2.0 * Float64(Float64(a + b) * Float64(b - a))) * sin(Float64(angle_m / Float64(180.0 / pi)))); end return Float64(angle_s * tmp) end
angle_m = abs(angle); angle_s = sign(angle) * abs(1.0); function tmp_2 = code(angle_s, a, b, angle_m) tmp = 0.0; if ((angle_m / 180.0) <= 2e-50) tmp = 0.011111111111111112 * (((a + b) * (angle_m * pi)) * (b - a)); else tmp = (2.0 * ((a + b) * (b - a))) * sin((angle_m / (180.0 / pi))); end tmp_2 = angle_s * tmp; end
angle_m = N[Abs[angle], $MachinePrecision]
angle_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a_, b_, angle$95$m_] := N[(angle$95$s * If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 2e-50], N[(0.011111111111111112 * N[(N[(N[(a + b), $MachinePrecision] * N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(2.0 * N[(N[(a + b), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sin[N[(angle$95$m / N[(180.0 / Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
angle_m = \left|angle\right|
\\
angle_s = \mathsf{copysign}\left(1, angle\right)
\\
angle_s \cdot \begin{array}{l}
\mathbf{if}\;\frac{angle_m}{180} \leq 2 \cdot 10^{-50}:\\
\;\;\;\;0.011111111111111112 \cdot \left(\left(\left(a + b\right) \cdot \left(angle_m \cdot \pi\right)\right) \cdot \left(b - a\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(2 \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left(\frac{angle_m}{\frac{180}{\pi}}\right)\\
\end{array}
\end{array}
if (/.f64 angle 180) < 2.00000000000000002e-50Initial program 56.3%
unpow256.3%
unpow256.3%
difference-of-squares59.0%
Applied egg-rr59.0%
Taylor expanded in angle around 0 57.1%
Taylor expanded in angle around 0 56.1%
expm1-log1p-u45.4%
expm1-udef32.6%
associate-*r*32.6%
+-commutative32.6%
Applied egg-rr32.6%
expm1-def45.4%
expm1-log1p56.1%
associate-*r*73.7%
+-commutative73.7%
Simplified73.7%
if 2.00000000000000002e-50 < (/.f64 angle 180) Initial program 40.2%
unpow240.2%
unpow240.2%
difference-of-squares48.4%
Applied egg-rr48.4%
Taylor expanded in angle around 0 49.0%
associate-*r/47.3%
*-commutative47.3%
associate-/l*47.5%
Applied egg-rr47.5%
Final simplification67.5%
angle_m = (fabs.f64 angle)
angle_s = (copysign.f64 1 angle)
(FPCore (angle_s a b angle_m)
:precision binary64
(*
angle_s
(if (<= angle_m 3.7e-73)
(* 0.011111111111111112 (* (* (+ a b) (* angle_m PI)) (- b a)))
(*
(* 2.0 (* (+ a b) (- b a)))
(sin (* 0.005555555555555556 (* angle_m PI)))))))angle_m = fabs(angle);
angle_s = copysign(1.0, angle);
double code(double angle_s, double a, double b, double angle_m) {
double tmp;
if (angle_m <= 3.7e-73) {
tmp = 0.011111111111111112 * (((a + b) * (angle_m * ((double) M_PI))) * (b - a));
} else {
tmp = (2.0 * ((a + b) * (b - a))) * sin((0.005555555555555556 * (angle_m * ((double) M_PI))));
}
return angle_s * tmp;
}
angle_m = Math.abs(angle);
angle_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b, double angle_m) {
double tmp;
if (angle_m <= 3.7e-73) {
tmp = 0.011111111111111112 * (((a + b) * (angle_m * Math.PI)) * (b - a));
} else {
tmp = (2.0 * ((a + b) * (b - a))) * Math.sin((0.005555555555555556 * (angle_m * Math.PI)));
}
return angle_s * tmp;
}
angle_m = math.fabs(angle) angle_s = math.copysign(1.0, angle) def code(angle_s, a, b, angle_m): tmp = 0 if angle_m <= 3.7e-73: tmp = 0.011111111111111112 * (((a + b) * (angle_m * math.pi)) * (b - a)) else: tmp = (2.0 * ((a + b) * (b - a))) * math.sin((0.005555555555555556 * (angle_m * math.pi))) return angle_s * tmp
angle_m = abs(angle) angle_s = copysign(1.0, angle) function code(angle_s, a, b, angle_m) tmp = 0.0 if (angle_m <= 3.7e-73) tmp = Float64(0.011111111111111112 * Float64(Float64(Float64(a + b) * Float64(angle_m * pi)) * Float64(b - a))); else tmp = Float64(Float64(2.0 * Float64(Float64(a + b) * Float64(b - a))) * sin(Float64(0.005555555555555556 * Float64(angle_m * pi)))); end return Float64(angle_s * tmp) end
angle_m = abs(angle); angle_s = sign(angle) * abs(1.0); function tmp_2 = code(angle_s, a, b, angle_m) tmp = 0.0; if (angle_m <= 3.7e-73) tmp = 0.011111111111111112 * (((a + b) * (angle_m * pi)) * (b - a)); else tmp = (2.0 * ((a + b) * (b - a))) * sin((0.005555555555555556 * (angle_m * pi))); end tmp_2 = angle_s * tmp; end
angle_m = N[Abs[angle], $MachinePrecision]
angle_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a_, b_, angle$95$m_] := N[(angle$95$s * If[LessEqual[angle$95$m, 3.7e-73], N[(0.011111111111111112 * N[(N[(N[(a + b), $MachinePrecision] * N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(2.0 * N[(N[(a + b), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sin[N[(0.005555555555555556 * N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
angle_m = \left|angle\right|
\\
angle_s = \mathsf{copysign}\left(1, angle\right)
\\
angle_s \cdot \begin{array}{l}
\mathbf{if}\;angle_m \leq 3.7 \cdot 10^{-73}:\\
\;\;\;\;0.011111111111111112 \cdot \left(\left(\left(a + b\right) \cdot \left(angle_m \cdot \pi\right)\right) \cdot \left(b - a\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(2 \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left(0.005555555555555556 \cdot \left(angle_m \cdot \pi\right)\right)\\
\end{array}
\end{array}
if angle < 3.7000000000000001e-73Initial program 56.2%
unpow256.2%
unpow256.2%
difference-of-squares58.3%
Applied egg-rr58.3%
Taylor expanded in angle around 0 56.4%
Taylor expanded in angle around 0 55.4%
expm1-log1p-u45.1%
expm1-udef32.1%
associate-*r*32.1%
+-commutative32.1%
Applied egg-rr32.1%
expm1-def45.1%
expm1-log1p55.4%
associate-*r*73.3%
+-commutative73.3%
Simplified73.3%
if 3.7000000000000001e-73 < angle Initial program 41.5%
unpow241.5%
unpow241.5%
difference-of-squares50.8%
Applied egg-rr50.8%
Taylor expanded in angle around 0 51.4%
Taylor expanded in angle around inf 45.4%
Final simplification66.3%
angle_m = (fabs.f64 angle)
angle_s = (copysign.f64 1 angle)
(FPCore (angle_s a b angle_m)
:precision binary64
(*
angle_s
(if (<= angle_m 2e-22)
(* 0.011111111111111112 (* (* (+ a b) (* angle_m PI)) (- b a)))
(*
(* 2.0 (* (+ a b) (- b a)))
(sin (* PI (* angle_m 0.005555555555555556)))))))angle_m = fabs(angle);
angle_s = copysign(1.0, angle);
double code(double angle_s, double a, double b, double angle_m) {
double tmp;
if (angle_m <= 2e-22) {
tmp = 0.011111111111111112 * (((a + b) * (angle_m * ((double) M_PI))) * (b - a));
} else {
tmp = (2.0 * ((a + b) * (b - a))) * sin((((double) M_PI) * (angle_m * 0.005555555555555556)));
}
return angle_s * tmp;
}
angle_m = Math.abs(angle);
angle_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b, double angle_m) {
double tmp;
if (angle_m <= 2e-22) {
tmp = 0.011111111111111112 * (((a + b) * (angle_m * Math.PI)) * (b - a));
} else {
tmp = (2.0 * ((a + b) * (b - a))) * Math.sin((Math.PI * (angle_m * 0.005555555555555556)));
}
return angle_s * tmp;
}
angle_m = math.fabs(angle) angle_s = math.copysign(1.0, angle) def code(angle_s, a, b, angle_m): tmp = 0 if angle_m <= 2e-22: tmp = 0.011111111111111112 * (((a + b) * (angle_m * math.pi)) * (b - a)) else: tmp = (2.0 * ((a + b) * (b - a))) * math.sin((math.pi * (angle_m * 0.005555555555555556))) return angle_s * tmp
angle_m = abs(angle) angle_s = copysign(1.0, angle) function code(angle_s, a, b, angle_m) tmp = 0.0 if (angle_m <= 2e-22) tmp = Float64(0.011111111111111112 * Float64(Float64(Float64(a + b) * Float64(angle_m * pi)) * Float64(b - a))); else tmp = Float64(Float64(2.0 * Float64(Float64(a + b) * Float64(b - a))) * sin(Float64(pi * Float64(angle_m * 0.005555555555555556)))); end return Float64(angle_s * tmp) end
angle_m = abs(angle); angle_s = sign(angle) * abs(1.0); function tmp_2 = code(angle_s, a, b, angle_m) tmp = 0.0; if (angle_m <= 2e-22) tmp = 0.011111111111111112 * (((a + b) * (angle_m * pi)) * (b - a)); else tmp = (2.0 * ((a + b) * (b - a))) * sin((pi * (angle_m * 0.005555555555555556))); end tmp_2 = angle_s * tmp; end
angle_m = N[Abs[angle], $MachinePrecision]
angle_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a_, b_, angle$95$m_] := N[(angle$95$s * If[LessEqual[angle$95$m, 2e-22], N[(0.011111111111111112 * N[(N[(N[(a + b), $MachinePrecision] * N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(2.0 * N[(N[(a + b), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sin[N[(Pi * N[(angle$95$m * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
angle_m = \left|angle\right|
\\
angle_s = \mathsf{copysign}\left(1, angle\right)
\\
angle_s \cdot \begin{array}{l}
\mathbf{if}\;angle_m \leq 2 \cdot 10^{-22}:\\
\;\;\;\;0.011111111111111112 \cdot \left(\left(\left(a + b\right) \cdot \left(angle_m \cdot \pi\right)\right) \cdot \left(b - a\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(2 \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left(\pi \cdot \left(angle_m \cdot 0.005555555555555556\right)\right)\\
\end{array}
\end{array}
if angle < 2.0000000000000001e-22Initial program 57.0%
unpow257.0%
unpow257.0%
difference-of-squares59.6%
Applied egg-rr59.6%
Taylor expanded in angle around 0 57.7%
Taylor expanded in angle around 0 56.7%
expm1-log1p-u46.2%
expm1-udef33.1%
associate-*r*33.1%
+-commutative33.1%
Applied egg-rr33.1%
expm1-def46.1%
expm1-log1p56.7%
associate-*r*74.1%
+-commutative74.1%
Simplified74.1%
if 2.0000000000000001e-22 < angle Initial program 37.2%
unpow237.2%
unpow237.2%
difference-of-squares45.8%
Applied egg-rr45.8%
Taylor expanded in angle around 0 46.5%
Taylor expanded in angle around inf 39.7%
associate-*r*36.9%
*-commutative36.9%
Simplified41.3%
Final simplification66.7%
angle_m = (fabs.f64 angle) angle_s = (copysign.f64 1 angle) (FPCore (angle_s a b angle_m) :precision binary64 (* angle_s (* 0.011111111111111112 (* angle_m (* PI (* (+ a b) (- b a)))))))
angle_m = fabs(angle);
angle_s = copysign(1.0, angle);
double code(double angle_s, double a, double b, double angle_m) {
return angle_s * (0.011111111111111112 * (angle_m * (((double) M_PI) * ((a + b) * (b - a)))));
}
angle_m = Math.abs(angle);
angle_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b, double angle_m) {
return angle_s * (0.011111111111111112 * (angle_m * (Math.PI * ((a + b) * (b - a)))));
}
angle_m = math.fabs(angle) angle_s = math.copysign(1.0, angle) def code(angle_s, a, b, angle_m): return angle_s * (0.011111111111111112 * (angle_m * (math.pi * ((a + b) * (b - a)))))
angle_m = abs(angle) angle_s = copysign(1.0, angle) function code(angle_s, a, b, angle_m) return Float64(angle_s * Float64(0.011111111111111112 * Float64(angle_m * Float64(pi * Float64(Float64(a + b) * Float64(b - a)))))) end
angle_m = abs(angle); angle_s = sign(angle) * abs(1.0); function tmp = code(angle_s, a, b, angle_m) tmp = angle_s * (0.011111111111111112 * (angle_m * (pi * ((a + b) * (b - a))))); end
angle_m = N[Abs[angle], $MachinePrecision]
angle_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a_, b_, angle$95$m_] := N[(angle$95$s * N[(0.011111111111111112 * N[(angle$95$m * N[(Pi * N[(N[(a + b), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
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(a + b\right) \cdot \left(b - a\right)\right)\right)\right)\right)
\end{array}
Initial program 52.5%
unpow252.5%
unpow252.5%
difference-of-squares56.5%
Applied egg-rr56.5%
Taylor expanded in angle around 0 55.2%
Taylor expanded in angle around 0 51.7%
Final simplification51.7%
angle_m = (fabs.f64 angle) angle_s = (copysign.f64 1 angle) (FPCore (angle_s a b angle_m) :precision binary64 (* angle_s (* 0.011111111111111112 (* (* (+ a b) (* angle_m PI)) (- b a)))))
angle_m = fabs(angle);
angle_s = copysign(1.0, angle);
double code(double angle_s, double a, double b, double angle_m) {
return angle_s * (0.011111111111111112 * (((a + b) * (angle_m * ((double) M_PI))) * (b - a)));
}
angle_m = Math.abs(angle);
angle_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b, double angle_m) {
return angle_s * (0.011111111111111112 * (((a + b) * (angle_m * Math.PI)) * (b - a)));
}
angle_m = math.fabs(angle) angle_s = math.copysign(1.0, angle) def code(angle_s, a, b, angle_m): return angle_s * (0.011111111111111112 * (((a + b) * (angle_m * math.pi)) * (b - a)))
angle_m = abs(angle) angle_s = copysign(1.0, angle) function code(angle_s, a, b, angle_m) return Float64(angle_s * Float64(0.011111111111111112 * Float64(Float64(Float64(a + b) * Float64(angle_m * pi)) * Float64(b - a)))) end
angle_m = abs(angle); angle_s = sign(angle) * abs(1.0); function tmp = code(angle_s, a, b, angle_m) tmp = angle_s * (0.011111111111111112 * (((a + b) * (angle_m * pi)) * (b - a))); end
angle_m = N[Abs[angle], $MachinePrecision]
angle_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a_, b_, angle$95$m_] := N[(angle$95$s * N[(0.011111111111111112 * N[(N[(N[(a + b), $MachinePrecision] * N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
angle_m = \left|angle\right|
\\
angle_s = \mathsf{copysign}\left(1, angle\right)
\\
angle_s \cdot \left(0.011111111111111112 \cdot \left(\left(\left(a + b\right) \cdot \left(angle_m \cdot \pi\right)\right) \cdot \left(b - a\right)\right)\right)
\end{array}
Initial program 52.5%
unpow252.5%
unpow252.5%
difference-of-squares56.5%
Applied egg-rr56.5%
Taylor expanded in angle around 0 55.2%
Taylor expanded in angle around 0 51.7%
expm1-log1p-u40.2%
expm1-udef30.2%
associate-*r*30.2%
+-commutative30.2%
Applied egg-rr30.2%
expm1-def40.2%
expm1-log1p51.7%
associate-*r*64.5%
+-commutative64.5%
Simplified64.5%
Final simplification64.5%
herbie shell --seed 2024021
(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)))))