
(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 22 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 #s(literal 1 binary64) angle)
(FPCore (angle_s a b angle_m)
:precision binary64
(let* ((t_0 (* PI (* angle_m 0.005555555555555556)))
(t_1 (sin t_0))
(t_2 (sqrt (pow t_1 2.0)))
(t_3 (* (+ a b) (- b a))))
(*
angle_s
(if (<= (/ angle_m 180.0) 1e-73)
(*
(fma a (* -2.0 (* a t_1)) (* 2.0 (pow (* b (sqrt t_1)) 2.0)))
(cos (* (/ angle_m 180.0) PI)))
(if (<= (/ angle_m 180.0) 2e+121)
(*
t_3
(*
2.0
(*
(sin (* (/ angle_m 180.0) (cbrt (pow PI 3.0))))
(log (exp (cos t_0))))))
(if (<= (/ angle_m 180.0) 5e+171)
(*
(* (* 2.0 t_3) t_2)
(cos (* (/ angle_m 180.0) (pow (sqrt PI) 2.0))))
(* t_3 (* 2.0 (* t_2 (cos (expm1 (log1p 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 = ((double) M_PI) * (angle_m * 0.005555555555555556);
double t_1 = sin(t_0);
double t_2 = sqrt(pow(t_1, 2.0));
double t_3 = (a + b) * (b - a);
double tmp;
if ((angle_m / 180.0) <= 1e-73) {
tmp = fma(a, (-2.0 * (a * t_1)), (2.0 * pow((b * sqrt(t_1)), 2.0))) * cos(((angle_m / 180.0) * ((double) M_PI)));
} else if ((angle_m / 180.0) <= 2e+121) {
tmp = t_3 * (2.0 * (sin(((angle_m / 180.0) * cbrt(pow(((double) M_PI), 3.0)))) * log(exp(cos(t_0)))));
} else if ((angle_m / 180.0) <= 5e+171) {
tmp = ((2.0 * t_3) * t_2) * cos(((angle_m / 180.0) * pow(sqrt(((double) M_PI)), 2.0)));
} else {
tmp = t_3 * (2.0 * (t_2 * cos(expm1(log1p(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(pi * Float64(angle_m * 0.005555555555555556)) t_1 = sin(t_0) t_2 = sqrt((t_1 ^ 2.0)) t_3 = Float64(Float64(a + b) * Float64(b - a)) tmp = 0.0 if (Float64(angle_m / 180.0) <= 1e-73) tmp = Float64(fma(a, Float64(-2.0 * Float64(a * t_1)), Float64(2.0 * (Float64(b * sqrt(t_1)) ^ 2.0))) * cos(Float64(Float64(angle_m / 180.0) * pi))); elseif (Float64(angle_m / 180.0) <= 2e+121) tmp = Float64(t_3 * Float64(2.0 * Float64(sin(Float64(Float64(angle_m / 180.0) * cbrt((pi ^ 3.0)))) * log(exp(cos(t_0)))))); elseif (Float64(angle_m / 180.0) <= 5e+171) tmp = Float64(Float64(Float64(2.0 * t_3) * t_2) * cos(Float64(Float64(angle_m / 180.0) * (sqrt(pi) ^ 2.0)))); else tmp = Float64(t_3 * Float64(2.0 * Float64(t_2 * cos(expm1(log1p(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[(Pi * N[(angle$95$m * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Sin[t$95$0], $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[Power[t$95$1, 2.0], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[(N[(a + b), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision]}, N[(angle$95$s * If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 1e-73], N[(N[(a * N[(-2.0 * N[(a * t$95$1), $MachinePrecision]), $MachinePrecision] + N[(2.0 * N[Power[N[(b * N[Sqrt[t$95$1], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Cos[N[(N[(angle$95$m / 180.0), $MachinePrecision] * Pi), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 2e+121], N[(t$95$3 * N[(2.0 * N[(N[Sin[N[(N[(angle$95$m / 180.0), $MachinePrecision] * N[Power[N[Power[Pi, 3.0], $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Log[N[Exp[N[Cos[t$95$0], $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 5e+171], N[(N[(N[(2.0 * t$95$3), $MachinePrecision] * t$95$2), $MachinePrecision] * N[Cos[N[(N[(angle$95$m / 180.0), $MachinePrecision] * N[Power[N[Sqrt[Pi], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(t$95$3 * N[(2.0 * N[(t$95$2 * N[Cos[N[(Exp[N[Log[1 + t$95$0], $MachinePrecision]] - 1), $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 := \pi \cdot \left(angle\_m \cdot 0.005555555555555556\right)\\
t_1 := \sin t\_0\\
t_2 := \sqrt{{t\_1}^{2}}\\
t_3 := \left(a + b\right) \cdot \left(b - a\right)\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;\frac{angle\_m}{180} \leq 10^{-73}:\\
\;\;\;\;\mathsf{fma}\left(a, -2 \cdot \left(a \cdot t\_1\right), 2 \cdot {\left(b \cdot \sqrt{t\_1}\right)}^{2}\right) \cdot \cos \left(\frac{angle\_m}{180} \cdot \pi\right)\\
\mathbf{elif}\;\frac{angle\_m}{180} \leq 2 \cdot 10^{+121}:\\
\;\;\;\;t\_3 \cdot \left(2 \cdot \left(\sin \left(\frac{angle\_m}{180} \cdot \sqrt[3]{{\pi}^{3}}\right) \cdot \log \left(e^{\cos t\_0}\right)\right)\right)\\
\mathbf{elif}\;\frac{angle\_m}{180} \leq 5 \cdot 10^{+171}:\\
\;\;\;\;\left(\left(2 \cdot t\_3\right) \cdot t\_2\right) \cdot \cos \left(\frac{angle\_m}{180} \cdot {\left(\sqrt{\pi}\right)}^{2}\right)\\
\mathbf{else}:\\
\;\;\;\;t\_3 \cdot \left(2 \cdot \left(t\_2 \cdot \cos \left(\mathsf{expm1}\left(\mathsf{log1p}\left(t\_0\right)\right)\right)\right)\right)\\
\end{array}
\end{array}
\end{array}
if (/.f64 angle #s(literal 180 binary64)) < 9.99999999999999997e-74Initial program 62.5%
unpow262.5%
unpow262.5%
difference-of-squares65.4%
Applied egg-rr65.4%
Taylor expanded in a around 0 67.7%
+-commutative67.7%
associate-*r*67.7%
associate-*r*69.7%
*-commutative69.7%
*-commutative69.7%
associate-*r*69.7%
fma-define69.7%
Simplified68.5%
add-sqr-sqrt47.0%
pow247.0%
Applied egg-rr38.1%
if 9.99999999999999997e-74 < (/.f64 angle #s(literal 180 binary64)) < 2.00000000000000007e121Initial program 64.3%
associate-*l*64.3%
*-commutative64.3%
associate-*l*64.3%
Simplified64.3%
unpow264.3%
unpow264.3%
difference-of-squares66.9%
Applied egg-rr66.9%
add-cbrt-cube69.1%
pow369.1%
Applied egg-rr69.1%
add-log-exp69.1%
div-inv72.2%
metadata-eval72.2%
Applied egg-rr72.2%
if 2.00000000000000007e121 < (/.f64 angle #s(literal 180 binary64)) < 5.0000000000000004e171Initial program 17.8%
unpow217.8%
unpow217.8%
difference-of-squares17.8%
Applied egg-rr17.8%
add-sqr-sqrt14.7%
sqrt-unprod50.9%
pow250.9%
div-inv51.4%
metadata-eval51.4%
Applied egg-rr51.4%
add-sqr-sqrt52.4%
pow252.4%
Applied egg-rr52.4%
if 5.0000000000000004e171 < (/.f64 angle #s(literal 180 binary64)) Initial program 34.7%
associate-*l*34.7%
*-commutative34.7%
associate-*l*34.7%
Simplified34.7%
unpow234.7%
unpow234.7%
difference-of-squares38.4%
Applied egg-rr38.4%
add-cbrt-cube38.4%
pow338.4%
div-inv41.6%
metadata-eval41.6%
Applied egg-rr41.6%
div-inv38.5%
metadata-eval38.5%
expm1-log1p-u48.1%
Applied egg-rr48.1%
rem-cbrt-cube48.1%
*-commutative48.1%
*-commutative48.1%
metadata-eval48.1%
div-inv44.9%
*-rgt-identity44.9%
add-sqr-sqrt24.3%
sqrt-unprod46.1%
pow246.1%
*-rgt-identity46.1%
div-inv46.2%
metadata-eval46.2%
*-commutative46.2%
*-commutative46.2%
Applied egg-rr46.2%
Final simplification45.0%
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) 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 (* t_1 (* (* 2.0 (- (pow b 2.0) (pow a 2.0))) (sin t_0))))
(t_3 (sin (* 0.005555555555555556 (* angle_m PI)))))
(*
angle_s
(if (<= t_2 4e+97)
(*
t_1
(+
(* 2.0 (* (pow b 2.0) t_3))
(* a (+ (* -2.0 (* a t_3)) (* 2.0 (* t_3 (- b b)))))))
(if (<= t_2 INFINITY)
(+
(* -2.0 (* (pow a 2.0) t_3))
(* b (+ (* 2.0 (* b t_3)) (* 2.0 (* t_3 (- a a))))))
(*
(* (+ a b) (- b a))
(*
2.0
(sin (pow (sqrt (* PI (* angle_m 0.005555555555555556))) 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 = (angle_m / 180.0) * ((double) M_PI);
double t_1 = cos(t_0);
double t_2 = t_1 * ((2.0 * (pow(b, 2.0) - pow(a, 2.0))) * sin(t_0));
double t_3 = sin((0.005555555555555556 * (angle_m * ((double) M_PI))));
double tmp;
if (t_2 <= 4e+97) {
tmp = t_1 * ((2.0 * (pow(b, 2.0) * t_3)) + (a * ((-2.0 * (a * t_3)) + (2.0 * (t_3 * (b - b))))));
} else if (t_2 <= ((double) INFINITY)) {
tmp = (-2.0 * (pow(a, 2.0) * t_3)) + (b * ((2.0 * (b * t_3)) + (2.0 * (t_3 * (a - a)))));
} else {
tmp = ((a + b) * (b - a)) * (2.0 * sin(pow(sqrt((((double) M_PI) * (angle_m * 0.005555555555555556))), 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 = (angle_m / 180.0) * Math.PI;
double t_1 = Math.cos(t_0);
double t_2 = t_1 * ((2.0 * (Math.pow(b, 2.0) - Math.pow(a, 2.0))) * Math.sin(t_0));
double t_3 = Math.sin((0.005555555555555556 * (angle_m * Math.PI)));
double tmp;
if (t_2 <= 4e+97) {
tmp = t_1 * ((2.0 * (Math.pow(b, 2.0) * t_3)) + (a * ((-2.0 * (a * t_3)) + (2.0 * (t_3 * (b - b))))));
} else if (t_2 <= Double.POSITIVE_INFINITY) {
tmp = (-2.0 * (Math.pow(a, 2.0) * t_3)) + (b * ((2.0 * (b * t_3)) + (2.0 * (t_3 * (a - a)))));
} else {
tmp = ((a + b) * (b - a)) * (2.0 * Math.sin(Math.pow(Math.sqrt((Math.PI * (angle_m * 0.005555555555555556))), 2.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 = t_1 * ((2.0 * (math.pow(b, 2.0) - math.pow(a, 2.0))) * math.sin(t_0)) t_3 = math.sin((0.005555555555555556 * (angle_m * math.pi))) tmp = 0 if t_2 <= 4e+97: tmp = t_1 * ((2.0 * (math.pow(b, 2.0) * t_3)) + (a * ((-2.0 * (a * t_3)) + (2.0 * (t_3 * (b - b)))))) elif t_2 <= math.inf: tmp = (-2.0 * (math.pow(a, 2.0) * t_3)) + (b * ((2.0 * (b * t_3)) + (2.0 * (t_3 * (a - a))))) else: tmp = ((a + b) * (b - a)) * (2.0 * math.sin(math.pow(math.sqrt((math.pi * (angle_m * 0.005555555555555556))), 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(angle_m / 180.0) * pi) t_1 = cos(t_0) t_2 = Float64(t_1 * Float64(Float64(2.0 * Float64((b ^ 2.0) - (a ^ 2.0))) * sin(t_0))) t_3 = sin(Float64(0.005555555555555556 * Float64(angle_m * pi))) tmp = 0.0 if (t_2 <= 4e+97) tmp = Float64(t_1 * Float64(Float64(2.0 * Float64((b ^ 2.0) * t_3)) + Float64(a * Float64(Float64(-2.0 * Float64(a * t_3)) + Float64(2.0 * Float64(t_3 * Float64(b - b))))))); elseif (t_2 <= Inf) tmp = Float64(Float64(-2.0 * Float64((a ^ 2.0) * t_3)) + Float64(b * Float64(Float64(2.0 * Float64(b * t_3)) + Float64(2.0 * Float64(t_3 * Float64(a - a)))))); else tmp = Float64(Float64(Float64(a + b) * Float64(b - a)) * Float64(2.0 * sin((sqrt(Float64(pi * Float64(angle_m * 0.005555555555555556))) ^ 2.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 = t_1 * ((2.0 * ((b ^ 2.0) - (a ^ 2.0))) * sin(t_0)); t_3 = sin((0.005555555555555556 * (angle_m * pi))); tmp = 0.0; if (t_2 <= 4e+97) tmp = t_1 * ((2.0 * ((b ^ 2.0) * t_3)) + (a * ((-2.0 * (a * t_3)) + (2.0 * (t_3 * (b - b)))))); elseif (t_2 <= Inf) tmp = (-2.0 * ((a ^ 2.0) * t_3)) + (b * ((2.0 * (b * t_3)) + (2.0 * (t_3 * (a - a))))); else tmp = ((a + b) * (b - a)) * (2.0 * sin((sqrt((pi * (angle_m * 0.005555555555555556))) ^ 2.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[(t$95$1 * 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]), $MachinePrecision]}, Block[{t$95$3 = N[Sin[N[(0.005555555555555556 * N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, N[(angle$95$s * If[LessEqual[t$95$2, 4e+97], N[(t$95$1 * N[(N[(2.0 * N[(N[Power[b, 2.0], $MachinePrecision] * t$95$3), $MachinePrecision]), $MachinePrecision] + N[(a * N[(N[(-2.0 * N[(a * t$95$3), $MachinePrecision]), $MachinePrecision] + N[(2.0 * N[(t$95$3 * N[(b - b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, Infinity], N[(N[(-2.0 * N[(N[Power[a, 2.0], $MachinePrecision] * t$95$3), $MachinePrecision]), $MachinePrecision] + N[(b * N[(N[(2.0 * N[(b * t$95$3), $MachinePrecision]), $MachinePrecision] + N[(2.0 * N[(t$95$3 * N[(a - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(a + b), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision] * N[(2.0 * N[Sin[N[Power[N[Sqrt[N[(Pi * N[(angle$95$m * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $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 := \frac{angle\_m}{180} \cdot \pi\\
t_1 := \cos t\_0\\
t_2 := t\_1 \cdot \left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin t\_0\right)\\
t_3 := \sin \left(0.005555555555555556 \cdot \left(angle\_m \cdot \pi\right)\right)\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_2 \leq 4 \cdot 10^{+97}:\\
\;\;\;\;t\_1 \cdot \left(2 \cdot \left({b}^{2} \cdot t\_3\right) + a \cdot \left(-2 \cdot \left(a \cdot t\_3\right) + 2 \cdot \left(t\_3 \cdot \left(b - b\right)\right)\right)\right)\\
\mathbf{elif}\;t\_2 \leq \infty:\\
\;\;\;\;-2 \cdot \left({a}^{2} \cdot t\_3\right) + b \cdot \left(2 \cdot \left(b \cdot t\_3\right) + 2 \cdot \left(t\_3 \cdot \left(a - a\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(a + b\right) \cdot \left(b - a\right)\right) \cdot \left(2 \cdot \sin \left({\left(\sqrt{\pi \cdot \left(angle\_m \cdot 0.005555555555555556\right)}\right)}^{2}\right)\right)\\
\end{array}
\end{array}
\end{array}
if (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64)))) (sin.f64 (*.f64 (PI.f64) (/.f64 angle #s(literal 180 binary64))))) (cos.f64 (*.f64 (PI.f64) (/.f64 angle #s(literal 180 binary64))))) < 4.0000000000000003e97Initial program 65.5%
unpow265.5%
unpow265.5%
difference-of-squares65.5%
Applied egg-rr65.5%
Taylor expanded in a around 0 69.4%
if 4.0000000000000003e97 < (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64)))) (sin.f64 (*.f64 (PI.f64) (/.f64 angle #s(literal 180 binary64))))) (cos.f64 (*.f64 (PI.f64) (/.f64 angle #s(literal 180 binary64))))) < +inf.0Initial program 48.4%
associate-*l*48.4%
*-commutative48.4%
associate-*l*48.4%
Simplified48.4%
unpow248.4%
unpow248.4%
difference-of-squares48.4%
Applied egg-rr48.4%
Taylor expanded in angle around 0 51.0%
Taylor expanded in b around 0 62.3%
if +inf.0 < (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64)))) (sin.f64 (*.f64 (PI.f64) (/.f64 angle #s(literal 180 binary64))))) (cos.f64 (*.f64 (PI.f64) (/.f64 angle #s(literal 180 binary64))))) Initial program 0.0%
associate-*l*0.0%
*-commutative0.0%
associate-*l*0.0%
Simplified0.0%
unpow20.0%
unpow20.0%
difference-of-squares48.2%
Applied egg-rr48.2%
Taylor expanded in angle around 0 68.2%
add-sqr-sqrt47.2%
pow247.2%
div-inv47.2%
metadata-eval47.2%
*-commutative47.2%
*-commutative47.2%
Applied egg-rr47.2%
Final simplification66.2%
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a b angle_m)
:precision binary64
(let* ((t_0 (* PI (* angle_m 0.005555555555555556)))
(t_1 (sin t_0))
(t_2 (* (/ angle_m 180.0) PI))
(t_3 (cos t_2))
(t_4 (* t_3 (* (* 2.0 (- (pow b 2.0) (pow a 2.0))) (sin t_2))))
(t_5 (sin (* 0.005555555555555556 (* angle_m PI)))))
(*
angle_s
(if (<= t_4 5e+223)
(* t_3 (fma a (* -2.0 (* a t_1)) (* 2.0 (* t_1 (pow b 2.0)))))
(if (<= t_4 INFINITY)
(+
(* -2.0 (* (pow a 2.0) t_5))
(* b (+ (* 2.0 (* b t_5)) (* 2.0 (* t_5 (- a a))))))
(* (* (+ a b) (- b a)) (* 2.0 (sin (pow (sqrt t_0) 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 = ((double) M_PI) * (angle_m * 0.005555555555555556);
double t_1 = sin(t_0);
double t_2 = (angle_m / 180.0) * ((double) M_PI);
double t_3 = cos(t_2);
double t_4 = t_3 * ((2.0 * (pow(b, 2.0) - pow(a, 2.0))) * sin(t_2));
double t_5 = sin((0.005555555555555556 * (angle_m * ((double) M_PI))));
double tmp;
if (t_4 <= 5e+223) {
tmp = t_3 * fma(a, (-2.0 * (a * t_1)), (2.0 * (t_1 * pow(b, 2.0))));
} else if (t_4 <= ((double) INFINITY)) {
tmp = (-2.0 * (pow(a, 2.0) * t_5)) + (b * ((2.0 * (b * t_5)) + (2.0 * (t_5 * (a - a)))));
} else {
tmp = ((a + b) * (b - a)) * (2.0 * sin(pow(sqrt(t_0), 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(pi * Float64(angle_m * 0.005555555555555556)) t_1 = sin(t_0) t_2 = Float64(Float64(angle_m / 180.0) * pi) t_3 = cos(t_2) t_4 = Float64(t_3 * Float64(Float64(2.0 * Float64((b ^ 2.0) - (a ^ 2.0))) * sin(t_2))) t_5 = sin(Float64(0.005555555555555556 * Float64(angle_m * pi))) tmp = 0.0 if (t_4 <= 5e+223) tmp = Float64(t_3 * fma(a, Float64(-2.0 * Float64(a * t_1)), Float64(2.0 * Float64(t_1 * (b ^ 2.0))))); elseif (t_4 <= Inf) tmp = Float64(Float64(-2.0 * Float64((a ^ 2.0) * t_5)) + Float64(b * Float64(Float64(2.0 * Float64(b * t_5)) + Float64(2.0 * Float64(t_5 * Float64(a - a)))))); else tmp = Float64(Float64(Float64(a + b) * Float64(b - a)) * Float64(2.0 * sin((sqrt(t_0) ^ 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[(Pi * N[(angle$95$m * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Sin[t$95$0], $MachinePrecision]}, Block[{t$95$2 = N[(N[(angle$95$m / 180.0), $MachinePrecision] * Pi), $MachinePrecision]}, Block[{t$95$3 = N[Cos[t$95$2], $MachinePrecision]}, Block[{t$95$4 = N[(t$95$3 * N[(N[(2.0 * N[(N[Power[b, 2.0], $MachinePrecision] - N[Power[a, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sin[t$95$2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$5 = N[Sin[N[(0.005555555555555556 * N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, N[(angle$95$s * If[LessEqual[t$95$4, 5e+223], N[(t$95$3 * N[(a * N[(-2.0 * N[(a * t$95$1), $MachinePrecision]), $MachinePrecision] + N[(2.0 * N[(t$95$1 * N[Power[b, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$4, Infinity], N[(N[(-2.0 * N[(N[Power[a, 2.0], $MachinePrecision] * t$95$5), $MachinePrecision]), $MachinePrecision] + N[(b * N[(N[(2.0 * N[(b * t$95$5), $MachinePrecision]), $MachinePrecision] + N[(2.0 * N[(t$95$5 * N[(a - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(a + b), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision] * N[(2.0 * N[Sin[N[Power[N[Sqrt[t$95$0], $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 := \pi \cdot \left(angle\_m \cdot 0.005555555555555556\right)\\
t_1 := \sin t\_0\\
t_2 := \frac{angle\_m}{180} \cdot \pi\\
t_3 := \cos t\_2\\
t_4 := t\_3 \cdot \left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin t\_2\right)\\
t_5 := \sin \left(0.005555555555555556 \cdot \left(angle\_m \cdot \pi\right)\right)\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_4 \leq 5 \cdot 10^{+223}:\\
\;\;\;\;t\_3 \cdot \mathsf{fma}\left(a, -2 \cdot \left(a \cdot t\_1\right), 2 \cdot \left(t\_1 \cdot {b}^{2}\right)\right)\\
\mathbf{elif}\;t\_4 \leq \infty:\\
\;\;\;\;-2 \cdot \left({a}^{2} \cdot t\_5\right) + b \cdot \left(2 \cdot \left(b \cdot t\_5\right) + 2 \cdot \left(t\_5 \cdot \left(a - a\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(a + b\right) \cdot \left(b - a\right)\right) \cdot \left(2 \cdot \sin \left({\left(\sqrt{t\_0}\right)}^{2}\right)\right)\\
\end{array}
\end{array}
\end{array}
if (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64)))) (sin.f64 (*.f64 (PI.f64) (/.f64 angle #s(literal 180 binary64))))) (cos.f64 (*.f64 (PI.f64) (/.f64 angle #s(literal 180 binary64))))) < 4.99999999999999985e223Initial program 64.4%
unpow264.4%
unpow264.4%
difference-of-squares64.4%
Applied egg-rr64.4%
Taylor expanded in a around 0 68.0%
+-commutative68.0%
associate-*r*68.0%
associate-*r*68.2%
*-commutative68.2%
*-commutative68.2%
associate-*r*68.2%
fma-define68.2%
Simplified67.9%
if 4.99999999999999985e223 < (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64)))) (sin.f64 (*.f64 (PI.f64) (/.f64 angle #s(literal 180 binary64))))) (cos.f64 (*.f64 (PI.f64) (/.f64 angle #s(literal 180 binary64))))) < +inf.0Initial program 47.8%
associate-*l*47.8%
*-commutative47.8%
associate-*l*47.8%
Simplified47.8%
unpow247.8%
unpow247.8%
difference-of-squares47.8%
Applied egg-rr47.8%
Taylor expanded in angle around 0 51.5%
Taylor expanded in b around 0 65.8%
if +inf.0 < (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64)))) (sin.f64 (*.f64 (PI.f64) (/.f64 angle #s(literal 180 binary64))))) (cos.f64 (*.f64 (PI.f64) (/.f64 angle #s(literal 180 binary64))))) Initial program 0.0%
associate-*l*0.0%
*-commutative0.0%
associate-*l*0.0%
Simplified0.0%
unpow20.0%
unpow20.0%
difference-of-squares48.2%
Applied egg-rr48.2%
Taylor expanded in angle around 0 68.2%
add-sqr-sqrt47.2%
pow247.2%
div-inv47.2%
metadata-eval47.2%
*-commutative47.2%
*-commutative47.2%
Applied egg-rr47.2%
Final simplification66.3%
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a b angle_m)
:precision binary64
(let* ((t_0 (sin (* 0.005555555555555556 (* angle_m PI))))
(t_1 (* (/ angle_m 180.0) PI))
(t_2 (* (cos t_1) (* (* 2.0 (- (pow b 2.0) (pow a 2.0))) (sin t_1))))
(t_3 (* PI (* angle_m 0.005555555555555556)))
(t_4 (sin t_3)))
(*
angle_s
(if (<= t_2 2e-186)
(fma a (* -2.0 (* a t_4)) (* 2.0 (* t_4 (pow b 2.0))))
(if (<= t_2 INFINITY)
(+
(* -2.0 (* (pow a 2.0) t_0))
(* b (+ (* 2.0 (* b t_0)) (* 2.0 (* t_0 (- a a))))))
(* (* (+ a b) (- b a)) (* 2.0 (sin (pow (sqrt t_3) 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 = sin((0.005555555555555556 * (angle_m * ((double) M_PI))));
double t_1 = (angle_m / 180.0) * ((double) M_PI);
double t_2 = cos(t_1) * ((2.0 * (pow(b, 2.0) - pow(a, 2.0))) * sin(t_1));
double t_3 = ((double) M_PI) * (angle_m * 0.005555555555555556);
double t_4 = sin(t_3);
double tmp;
if (t_2 <= 2e-186) {
tmp = fma(a, (-2.0 * (a * t_4)), (2.0 * (t_4 * pow(b, 2.0))));
} else if (t_2 <= ((double) INFINITY)) {
tmp = (-2.0 * (pow(a, 2.0) * t_0)) + (b * ((2.0 * (b * t_0)) + (2.0 * (t_0 * (a - a)))));
} else {
tmp = ((a + b) * (b - a)) * (2.0 * sin(pow(sqrt(t_3), 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 = sin(Float64(0.005555555555555556 * Float64(angle_m * pi))) t_1 = Float64(Float64(angle_m / 180.0) * pi) t_2 = Float64(cos(t_1) * Float64(Float64(2.0 * Float64((b ^ 2.0) - (a ^ 2.0))) * sin(t_1))) t_3 = Float64(pi * Float64(angle_m * 0.005555555555555556)) t_4 = sin(t_3) tmp = 0.0 if (t_2 <= 2e-186) tmp = fma(a, Float64(-2.0 * Float64(a * t_4)), Float64(2.0 * Float64(t_4 * (b ^ 2.0)))); elseif (t_2 <= Inf) tmp = Float64(Float64(-2.0 * Float64((a ^ 2.0) * t_0)) + Float64(b * Float64(Float64(2.0 * Float64(b * t_0)) + Float64(2.0 * Float64(t_0 * Float64(a - a)))))); else tmp = Float64(Float64(Float64(a + b) * Float64(b - a)) * Float64(2.0 * sin((sqrt(t_3) ^ 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[Sin[N[(0.005555555555555556 * N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(N[(angle$95$m / 180.0), $MachinePrecision] * Pi), $MachinePrecision]}, Block[{t$95$2 = N[(N[Cos[t$95$1], $MachinePrecision] * N[(N[(2.0 * N[(N[Power[b, 2.0], $MachinePrecision] - N[Power[a, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sin[t$95$1], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(Pi * N[(angle$95$m * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[Sin[t$95$3], $MachinePrecision]}, N[(angle$95$s * If[LessEqual[t$95$2, 2e-186], N[(a * N[(-2.0 * N[(a * t$95$4), $MachinePrecision]), $MachinePrecision] + N[(2.0 * N[(t$95$4 * N[Power[b, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, Infinity], N[(N[(-2.0 * N[(N[Power[a, 2.0], $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision] + N[(b * N[(N[(2.0 * N[(b * t$95$0), $MachinePrecision]), $MachinePrecision] + N[(2.0 * N[(t$95$0 * N[(a - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(a + b), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision] * N[(2.0 * N[Sin[N[Power[N[Sqrt[t$95$3], $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 := \sin \left(0.005555555555555556 \cdot \left(angle\_m \cdot \pi\right)\right)\\
t_1 := \frac{angle\_m}{180} \cdot \pi\\
t_2 := \cos t\_1 \cdot \left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin t\_1\right)\\
t_3 := \pi \cdot \left(angle\_m \cdot 0.005555555555555556\right)\\
t_4 := \sin t\_3\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_2 \leq 2 \cdot 10^{-186}:\\
\;\;\;\;\mathsf{fma}\left(a, -2 \cdot \left(a \cdot t\_4\right), 2 \cdot \left(t\_4 \cdot {b}^{2}\right)\right)\\
\mathbf{elif}\;t\_2 \leq \infty:\\
\;\;\;\;-2 \cdot \left({a}^{2} \cdot t\_0\right) + b \cdot \left(2 \cdot \left(b \cdot t\_0\right) + 2 \cdot \left(t\_0 \cdot \left(a - a\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(a + b\right) \cdot \left(b - a\right)\right) \cdot \left(2 \cdot \sin \left({\left(\sqrt{t\_3}\right)}^{2}\right)\right)\\
\end{array}
\end{array}
\end{array}
if (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64)))) (sin.f64 (*.f64 (PI.f64) (/.f64 angle #s(literal 180 binary64))))) (cos.f64 (*.f64 (PI.f64) (/.f64 angle #s(literal 180 binary64))))) < 1.9999999999999998e-186Initial program 65.3%
unpow265.3%
unpow265.3%
difference-of-squares65.3%
Applied egg-rr65.3%
Taylor expanded in a around 0 70.2%
+-commutative70.2%
associate-*r*70.2%
associate-*r*70.3%
*-commutative70.3%
*-commutative70.3%
associate-*r*70.3%
fma-define70.3%
Simplified70.1%
Taylor expanded in angle around 0 66.9%
if 1.9999999999999998e-186 < (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64)))) (sin.f64 (*.f64 (PI.f64) (/.f64 angle #s(literal 180 binary64))))) (cos.f64 (*.f64 (PI.f64) (/.f64 angle #s(literal 180 binary64))))) < +inf.0Initial program 55.3%
associate-*l*55.3%
*-commutative55.3%
associate-*l*55.3%
Simplified55.3%
unpow255.3%
unpow255.3%
difference-of-squares55.3%
Applied egg-rr55.3%
Taylor expanded in angle around 0 56.2%
Taylor expanded in b around 0 63.0%
if +inf.0 < (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64)))) (sin.f64 (*.f64 (PI.f64) (/.f64 angle #s(literal 180 binary64))))) (cos.f64 (*.f64 (PI.f64) (/.f64 angle #s(literal 180 binary64))))) Initial program 0.0%
associate-*l*0.0%
*-commutative0.0%
associate-*l*0.0%
Simplified0.0%
unpow20.0%
unpow20.0%
difference-of-squares48.2%
Applied egg-rr48.2%
Taylor expanded in angle around 0 68.2%
add-sqr-sqrt47.2%
pow247.2%
div-inv47.2%
metadata-eval47.2%
*-commutative47.2%
*-commutative47.2%
Applied egg-rr47.2%
Final simplification64.1%
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a b angle_m)
:precision binary64
(let* ((t_0 (sin (* 0.005555555555555556 (* angle_m PI))))
(t_1 (- (pow b 2.0) (pow a 2.0)))
(t_2 (* PI (* angle_m 0.005555555555555556)))
(t_3 (sin t_2)))
(*
angle_s
(if (<= t_1 -2e+200)
(+
(* 2.0 (* (pow b 2.0) t_0))
(* a (+ (* -2.0 (* a t_0)) (* 2.0 (* t_0 (- b b))))))
(if (<= t_1 INFINITY)
(*
(cos (* (/ angle_m 180.0) PI))
(fma b (* t_3 (* 2.0 b)) (* t_3 (* -2.0 (pow a 2.0)))))
(* (* (+ a b) (- b a)) (* 2.0 (sin (pow (sqrt t_2) 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 = sin((0.005555555555555556 * (angle_m * ((double) M_PI))));
double t_1 = pow(b, 2.0) - pow(a, 2.0);
double t_2 = ((double) M_PI) * (angle_m * 0.005555555555555556);
double t_3 = sin(t_2);
double tmp;
if (t_1 <= -2e+200) {
tmp = (2.0 * (pow(b, 2.0) * t_0)) + (a * ((-2.0 * (a * t_0)) + (2.0 * (t_0 * (b - b)))));
} else if (t_1 <= ((double) INFINITY)) {
tmp = cos(((angle_m / 180.0) * ((double) M_PI))) * fma(b, (t_3 * (2.0 * b)), (t_3 * (-2.0 * pow(a, 2.0))));
} else {
tmp = ((a + b) * (b - a)) * (2.0 * sin(pow(sqrt(t_2), 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 = sin(Float64(0.005555555555555556 * Float64(angle_m * pi))) t_1 = Float64((b ^ 2.0) - (a ^ 2.0)) t_2 = Float64(pi * Float64(angle_m * 0.005555555555555556)) t_3 = sin(t_2) tmp = 0.0 if (t_1 <= -2e+200) tmp = Float64(Float64(2.0 * Float64((b ^ 2.0) * t_0)) + Float64(a * Float64(Float64(-2.0 * Float64(a * t_0)) + Float64(2.0 * Float64(t_0 * Float64(b - b)))))); elseif (t_1 <= Inf) tmp = Float64(cos(Float64(Float64(angle_m / 180.0) * pi)) * fma(b, Float64(t_3 * Float64(2.0 * b)), Float64(t_3 * Float64(-2.0 * (a ^ 2.0))))); else tmp = Float64(Float64(Float64(a + b) * Float64(b - a)) * Float64(2.0 * sin((sqrt(t_2) ^ 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[Sin[N[(0.005555555555555556 * N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(N[Power[b, 2.0], $MachinePrecision] - N[Power[a, 2.0], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(Pi * N[(angle$95$m * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[Sin[t$95$2], $MachinePrecision]}, N[(angle$95$s * If[LessEqual[t$95$1, -2e+200], N[(N[(2.0 * N[(N[Power[b, 2.0], $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision] + N[(a * N[(N[(-2.0 * N[(a * t$95$0), $MachinePrecision]), $MachinePrecision] + N[(2.0 * N[(t$95$0 * N[(b - b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, Infinity], N[(N[Cos[N[(N[(angle$95$m / 180.0), $MachinePrecision] * Pi), $MachinePrecision]], $MachinePrecision] * N[(b * N[(t$95$3 * N[(2.0 * b), $MachinePrecision]), $MachinePrecision] + N[(t$95$3 * N[(-2.0 * N[Power[a, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(a + b), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision] * N[(2.0 * N[Sin[N[Power[N[Sqrt[t$95$2], $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 := \sin \left(0.005555555555555556 \cdot \left(angle\_m \cdot \pi\right)\right)\\
t_1 := {b}^{2} - {a}^{2}\\
t_2 := \pi \cdot \left(angle\_m \cdot 0.005555555555555556\right)\\
t_3 := \sin t\_2\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_1 \leq -2 \cdot 10^{+200}:\\
\;\;\;\;2 \cdot \left({b}^{2} \cdot t\_0\right) + a \cdot \left(-2 \cdot \left(a \cdot t\_0\right) + 2 \cdot \left(t\_0 \cdot \left(b - b\right)\right)\right)\\
\mathbf{elif}\;t\_1 \leq \infty:\\
\;\;\;\;\cos \left(\frac{angle\_m}{180} \cdot \pi\right) \cdot \mathsf{fma}\left(b, t\_3 \cdot \left(2 \cdot b\right), t\_3 \cdot \left(-2 \cdot {a}^{2}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(a + b\right) \cdot \left(b - a\right)\right) \cdot \left(2 \cdot \sin \left({\left(\sqrt{t\_2}\right)}^{2}\right)\right)\\
\end{array}
\end{array}
\end{array}
if (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) < -1.9999999999999999e200Initial program 50.8%
associate-*l*50.8%
*-commutative50.8%
associate-*l*50.8%
Simplified50.8%
unpow250.8%
unpow250.8%
difference-of-squares50.8%
Applied egg-rr50.8%
Taylor expanded in angle around 0 50.5%
Taylor expanded in a around 0 73.0%
if -1.9999999999999999e200 < (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) < +inf.0Initial program 64.3%
unpow264.3%
unpow264.3%
difference-of-squares64.3%
Applied egg-rr64.3%
Taylor expanded in b around 0 68.0%
+-commutative68.0%
fma-define68.0%
Simplified68.5%
if +inf.0 < (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) Initial program 0.0%
associate-*l*0.0%
*-commutative0.0%
associate-*l*0.0%
Simplified0.0%
unpow20.0%
unpow20.0%
difference-of-squares48.2%
Applied egg-rr48.2%
Taylor expanded in angle around 0 68.2%
add-sqr-sqrt47.2%
pow247.2%
div-inv47.2%
metadata-eval47.2%
*-commutative47.2%
*-commutative47.2%
Applied egg-rr47.2%
Final simplification68.4%
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a b angle_m)
:precision binary64
(let* ((t_0 (* PI (* angle_m 0.005555555555555556)))
(t_1 (- (pow b 2.0) (pow a 2.0))))
(*
angle_s
(if (<= t_1 -5e+279)
(+
(* 0.011111111111111112 (* angle_m (* PI (pow b 2.0))))
(*
a
(+
(* -0.011111111111111112 (* a (* angle_m PI)))
(* 0.011111111111111112 (* angle_m (* PI (- b b)))))))
(if (<= t_1 1e+277)
(* t_1 (sin (* 2.0 t_0)))
(if (<= t_1 INFINITY)
(+
(* -0.011111111111111112 (* (pow a 2.0) (* angle_m PI)))
(*
b
(+
(* 0.011111111111111112 (* angle_m (* PI b)))
(* 0.011111111111111112 (* angle_m (* PI (- a a)))))))
(* (* (+ a b) (- b a)) (* 2.0 (sin (pow (sqrt t_0) 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 = ((double) M_PI) * (angle_m * 0.005555555555555556);
double t_1 = pow(b, 2.0) - pow(a, 2.0);
double tmp;
if (t_1 <= -5e+279) {
tmp = (0.011111111111111112 * (angle_m * (((double) M_PI) * pow(b, 2.0)))) + (a * ((-0.011111111111111112 * (a * (angle_m * ((double) M_PI)))) + (0.011111111111111112 * (angle_m * (((double) M_PI) * (b - b))))));
} else if (t_1 <= 1e+277) {
tmp = t_1 * sin((2.0 * t_0));
} else if (t_1 <= ((double) INFINITY)) {
tmp = (-0.011111111111111112 * (pow(a, 2.0) * (angle_m * ((double) M_PI)))) + (b * ((0.011111111111111112 * (angle_m * (((double) M_PI) * b))) + (0.011111111111111112 * (angle_m * (((double) M_PI) * (a - a))))));
} else {
tmp = ((a + b) * (b - a)) * (2.0 * sin(pow(sqrt(t_0), 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.PI * (angle_m * 0.005555555555555556);
double t_1 = Math.pow(b, 2.0) - Math.pow(a, 2.0);
double tmp;
if (t_1 <= -5e+279) {
tmp = (0.011111111111111112 * (angle_m * (Math.PI * Math.pow(b, 2.0)))) + (a * ((-0.011111111111111112 * (a * (angle_m * Math.PI))) + (0.011111111111111112 * (angle_m * (Math.PI * (b - b))))));
} else if (t_1 <= 1e+277) {
tmp = t_1 * Math.sin((2.0 * t_0));
} else if (t_1 <= Double.POSITIVE_INFINITY) {
tmp = (-0.011111111111111112 * (Math.pow(a, 2.0) * (angle_m * Math.PI))) + (b * ((0.011111111111111112 * (angle_m * (Math.PI * b))) + (0.011111111111111112 * (angle_m * (Math.PI * (a - a))))));
} else {
tmp = ((a + b) * (b - a)) * (2.0 * Math.sin(Math.pow(Math.sqrt(t_0), 2.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 = math.pi * (angle_m * 0.005555555555555556) t_1 = math.pow(b, 2.0) - math.pow(a, 2.0) tmp = 0 if t_1 <= -5e+279: tmp = (0.011111111111111112 * (angle_m * (math.pi * math.pow(b, 2.0)))) + (a * ((-0.011111111111111112 * (a * (angle_m * math.pi))) + (0.011111111111111112 * (angle_m * (math.pi * (b - b)))))) elif t_1 <= 1e+277: tmp = t_1 * math.sin((2.0 * t_0)) elif t_1 <= math.inf: tmp = (-0.011111111111111112 * (math.pow(a, 2.0) * (angle_m * math.pi))) + (b * ((0.011111111111111112 * (angle_m * (math.pi * b))) + (0.011111111111111112 * (angle_m * (math.pi * (a - a)))))) else: tmp = ((a + b) * (b - a)) * (2.0 * math.sin(math.pow(math.sqrt(t_0), 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(pi * Float64(angle_m * 0.005555555555555556)) t_1 = Float64((b ^ 2.0) - (a ^ 2.0)) tmp = 0.0 if (t_1 <= -5e+279) tmp = Float64(Float64(0.011111111111111112 * Float64(angle_m * Float64(pi * (b ^ 2.0)))) + Float64(a * Float64(Float64(-0.011111111111111112 * Float64(a * Float64(angle_m * pi))) + Float64(0.011111111111111112 * Float64(angle_m * Float64(pi * Float64(b - b))))))); elseif (t_1 <= 1e+277) tmp = Float64(t_1 * sin(Float64(2.0 * t_0))); elseif (t_1 <= Inf) tmp = Float64(Float64(-0.011111111111111112 * Float64((a ^ 2.0) * Float64(angle_m * pi))) + Float64(b * Float64(Float64(0.011111111111111112 * Float64(angle_m * Float64(pi * b))) + Float64(0.011111111111111112 * Float64(angle_m * Float64(pi * Float64(a - a))))))); else tmp = Float64(Float64(Float64(a + b) * Float64(b - a)) * Float64(2.0 * sin((sqrt(t_0) ^ 2.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 = pi * (angle_m * 0.005555555555555556); t_1 = (b ^ 2.0) - (a ^ 2.0); tmp = 0.0; if (t_1 <= -5e+279) tmp = (0.011111111111111112 * (angle_m * (pi * (b ^ 2.0)))) + (a * ((-0.011111111111111112 * (a * (angle_m * pi))) + (0.011111111111111112 * (angle_m * (pi * (b - b)))))); elseif (t_1 <= 1e+277) tmp = t_1 * sin((2.0 * t_0)); elseif (t_1 <= Inf) tmp = (-0.011111111111111112 * ((a ^ 2.0) * (angle_m * pi))) + (b * ((0.011111111111111112 * (angle_m * (pi * b))) + (0.011111111111111112 * (angle_m * (pi * (a - a)))))); else tmp = ((a + b) * (b - a)) * (2.0 * sin((sqrt(t_0) ^ 2.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[(Pi * N[(angle$95$m * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[Power[b, 2.0], $MachinePrecision] - N[Power[a, 2.0], $MachinePrecision]), $MachinePrecision]}, N[(angle$95$s * If[LessEqual[t$95$1, -5e+279], N[(N[(0.011111111111111112 * N[(angle$95$m * N[(Pi * N[Power[b, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(a * N[(N[(-0.011111111111111112 * N[(a * N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(0.011111111111111112 * N[(angle$95$m * N[(Pi * N[(b - b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 1e+277], N[(t$95$1 * N[Sin[N[(2.0 * t$95$0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, Infinity], N[(N[(-0.011111111111111112 * N[(N[Power[a, 2.0], $MachinePrecision] * N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(b * N[(N[(0.011111111111111112 * N[(angle$95$m * N[(Pi * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(0.011111111111111112 * N[(angle$95$m * N[(Pi * N[(a - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(a + b), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision] * N[(2.0 * N[Sin[N[Power[N[Sqrt[t$95$0], $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 := \pi \cdot \left(angle\_m \cdot 0.005555555555555556\right)\\
t_1 := {b}^{2} - {a}^{2}\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_1 \leq -5 \cdot 10^{+279}:\\
\;\;\;\;0.011111111111111112 \cdot \left(angle\_m \cdot \left(\pi \cdot {b}^{2}\right)\right) + a \cdot \left(-0.011111111111111112 \cdot \left(a \cdot \left(angle\_m \cdot \pi\right)\right) + 0.011111111111111112 \cdot \left(angle\_m \cdot \left(\pi \cdot \left(b - b\right)\right)\right)\right)\\
\mathbf{elif}\;t\_1 \leq 10^{+277}:\\
\;\;\;\;t\_1 \cdot \sin \left(2 \cdot t\_0\right)\\
\mathbf{elif}\;t\_1 \leq \infty:\\
\;\;\;\;-0.011111111111111112 \cdot \left({a}^{2} \cdot \left(angle\_m \cdot \pi\right)\right) + b \cdot \left(0.011111111111111112 \cdot \left(angle\_m \cdot \left(\pi \cdot b\right)\right) + 0.011111111111111112 \cdot \left(angle\_m \cdot \left(\pi \cdot \left(a - a\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(a + b\right) \cdot \left(b - a\right)\right) \cdot \left(2 \cdot \sin \left({\left(\sqrt{t\_0}\right)}^{2}\right)\right)\\
\end{array}
\end{array}
\end{array}
if (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) < -5.0000000000000002e279Initial program 45.3%
associate-*l*45.3%
*-commutative45.3%
associate-*l*45.3%
Simplified45.3%
unpow245.3%
unpow245.3%
difference-of-squares45.3%
Applied egg-rr45.3%
add-cbrt-cube51.4%
pow351.4%
Applied egg-rr51.4%
Taylor expanded in angle around 0 49.9%
Taylor expanded in a around 0 66.9%
if -5.0000000000000002e279 < (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) < 1e277Initial program 66.5%
associate-*l*66.5%
*-commutative66.5%
associate-*l*66.5%
Simplified66.5%
*-commutative66.5%
sub-neg66.5%
distribute-lft-in66.5%
2-sin66.5%
associate-*r*66.5%
div-inv66.7%
metadata-eval66.7%
Applied egg-rr66.7%
distribute-lft-out66.7%
sub-neg66.7%
*-commutative66.7%
associate-*r*66.7%
Simplified66.7%
if 1e277 < (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) < +inf.0Initial program 60.4%
associate-*l*60.4%
*-commutative60.4%
associate-*l*60.4%
Simplified60.4%
unpow260.4%
unpow260.4%
difference-of-squares60.4%
Applied egg-rr60.4%
add-cbrt-cube63.8%
pow363.8%
Applied egg-rr63.8%
Taylor expanded in angle around 0 63.8%
Taylor expanded in b around 0 72.8%
if +inf.0 < (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) Initial program 0.0%
associate-*l*0.0%
*-commutative0.0%
associate-*l*0.0%
Simplified0.0%
unpow20.0%
unpow20.0%
difference-of-squares48.2%
Applied egg-rr48.2%
Taylor expanded in angle around 0 68.2%
add-sqr-sqrt47.2%
pow247.2%
div-inv47.2%
metadata-eval47.2%
*-commutative47.2%
*-commutative47.2%
Applied egg-rr47.2%
Final simplification67.0%
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a b angle_m)
:precision binary64
(let* ((t_0 (* PI (* angle_m 0.005555555555555556)))
(t_1 (sin t_0))
(t_2 (- (pow b 2.0) (pow a 2.0))))
(*
angle_s
(if (<= t_2 -5e+281)
(+
(* 0.011111111111111112 (* angle_m (* PI (pow b 2.0))))
(*
a
(+
(* -0.011111111111111112 (* a (* angle_m PI)))
(* 0.011111111111111112 (* angle_m (* PI (- b b)))))))
(if (<= t_2 INFINITY)
(fma -2.0 (* t_1 (pow a 2.0)) (* b (* t_1 (* 2.0 b))))
(* (* (+ a b) (- b a)) (* 2.0 (sin (pow (sqrt t_0) 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 = ((double) M_PI) * (angle_m * 0.005555555555555556);
double t_1 = sin(t_0);
double t_2 = pow(b, 2.0) - pow(a, 2.0);
double tmp;
if (t_2 <= -5e+281) {
tmp = (0.011111111111111112 * (angle_m * (((double) M_PI) * pow(b, 2.0)))) + (a * ((-0.011111111111111112 * (a * (angle_m * ((double) M_PI)))) + (0.011111111111111112 * (angle_m * (((double) M_PI) * (b - b))))));
} else if (t_2 <= ((double) INFINITY)) {
tmp = fma(-2.0, (t_1 * pow(a, 2.0)), (b * (t_1 * (2.0 * b))));
} else {
tmp = ((a + b) * (b - a)) * (2.0 * sin(pow(sqrt(t_0), 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(pi * Float64(angle_m * 0.005555555555555556)) t_1 = sin(t_0) t_2 = Float64((b ^ 2.0) - (a ^ 2.0)) tmp = 0.0 if (t_2 <= -5e+281) tmp = Float64(Float64(0.011111111111111112 * Float64(angle_m * Float64(pi * (b ^ 2.0)))) + Float64(a * Float64(Float64(-0.011111111111111112 * Float64(a * Float64(angle_m * pi))) + Float64(0.011111111111111112 * Float64(angle_m * Float64(pi * Float64(b - b))))))); elseif (t_2 <= Inf) tmp = fma(-2.0, Float64(t_1 * (a ^ 2.0)), Float64(b * Float64(t_1 * Float64(2.0 * b)))); else tmp = Float64(Float64(Float64(a + b) * Float64(b - a)) * Float64(2.0 * sin((sqrt(t_0) ^ 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[(Pi * N[(angle$95$m * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Sin[t$95$0], $MachinePrecision]}, Block[{t$95$2 = N[(N[Power[b, 2.0], $MachinePrecision] - N[Power[a, 2.0], $MachinePrecision]), $MachinePrecision]}, N[(angle$95$s * If[LessEqual[t$95$2, -5e+281], N[(N[(0.011111111111111112 * N[(angle$95$m * N[(Pi * N[Power[b, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(a * N[(N[(-0.011111111111111112 * N[(a * N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(0.011111111111111112 * N[(angle$95$m * N[(Pi * N[(b - b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, Infinity], N[(-2.0 * N[(t$95$1 * N[Power[a, 2.0], $MachinePrecision]), $MachinePrecision] + N[(b * N[(t$95$1 * N[(2.0 * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(a + b), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision] * N[(2.0 * N[Sin[N[Power[N[Sqrt[t$95$0], $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 := \pi \cdot \left(angle\_m \cdot 0.005555555555555556\right)\\
t_1 := \sin t\_0\\
t_2 := {b}^{2} - {a}^{2}\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_2 \leq -5 \cdot 10^{+281}:\\
\;\;\;\;0.011111111111111112 \cdot \left(angle\_m \cdot \left(\pi \cdot {b}^{2}\right)\right) + a \cdot \left(-0.011111111111111112 \cdot \left(a \cdot \left(angle\_m \cdot \pi\right)\right) + 0.011111111111111112 \cdot \left(angle\_m \cdot \left(\pi \cdot \left(b - b\right)\right)\right)\right)\\
\mathbf{elif}\;t\_2 \leq \infty:\\
\;\;\;\;\mathsf{fma}\left(-2, t\_1 \cdot {a}^{2}, b \cdot \left(t\_1 \cdot \left(2 \cdot b\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(a + b\right) \cdot \left(b - a\right)\right) \cdot \left(2 \cdot \sin \left({\left(\sqrt{t\_0}\right)}^{2}\right)\right)\\
\end{array}
\end{array}
\end{array}
if (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) < -5.00000000000000016e281Initial program 46.2%
associate-*l*46.2%
*-commutative46.2%
associate-*l*46.2%
Simplified46.2%
unpow246.2%
unpow246.2%
difference-of-squares46.2%
Applied egg-rr46.2%
add-cbrt-cube52.5%
pow352.5%
Applied egg-rr52.5%
Taylor expanded in angle around 0 50.7%
Taylor expanded in a around 0 68.2%
if -5.00000000000000016e281 < (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) < +inf.0Initial program 64.3%
associate-*l*64.3%
*-commutative64.3%
associate-*l*64.3%
Simplified64.3%
unpow264.3%
unpow264.3%
difference-of-squares64.3%
Applied egg-rr64.3%
Taylor expanded in angle around 0 63.3%
Taylor expanded in b around 0 67.3%
fma-define67.3%
*-commutative67.3%
*-commutative67.3%
associate-*r*67.3%
*-commutative67.3%
Simplified66.8%
if +inf.0 < (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) Initial program 0.0%
associate-*l*0.0%
*-commutative0.0%
associate-*l*0.0%
Simplified0.0%
unpow20.0%
unpow20.0%
difference-of-squares48.2%
Applied egg-rr48.2%
Taylor expanded in angle around 0 68.2%
add-sqr-sqrt47.2%
pow247.2%
div-inv47.2%
metadata-eval47.2%
*-commutative47.2%
*-commutative47.2%
Applied egg-rr47.2%
Final simplification65.9%
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a b angle_m)
:precision binary64
(let* ((t_0 (- (pow b 2.0) (pow a 2.0))))
(*
angle_s
(if (<= t_0 -1e+305)
(+
(* 0.011111111111111112 (* angle_m (* PI (pow b 2.0))))
(*
a
(+
(* -0.011111111111111112 (* a (* angle_m PI)))
(* 0.011111111111111112 (* angle_m (* PI (- b b)))))))
(if (or (<= t_0 2e+260) (not (<= t_0 INFINITY)))
(* (* (+ a b) (- b a)) (* 2.0 (sin (* (/ angle_m 180.0) PI))))
(+
(* -0.011111111111111112 (* (pow a 2.0) (* angle_m PI)))
(*
b
(+
(* 0.011111111111111112 (* angle_m (* PI b)))
(* 0.011111111111111112 (* angle_m (* PI (- a a))))))))))))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(b, 2.0) - pow(a, 2.0);
double tmp;
if (t_0 <= -1e+305) {
tmp = (0.011111111111111112 * (angle_m * (((double) M_PI) * pow(b, 2.0)))) + (a * ((-0.011111111111111112 * (a * (angle_m * ((double) M_PI)))) + (0.011111111111111112 * (angle_m * (((double) M_PI) * (b - b))))));
} else if ((t_0 <= 2e+260) || !(t_0 <= ((double) INFINITY))) {
tmp = ((a + b) * (b - a)) * (2.0 * sin(((angle_m / 180.0) * ((double) M_PI))));
} else {
tmp = (-0.011111111111111112 * (pow(a, 2.0) * (angle_m * ((double) M_PI)))) + (b * ((0.011111111111111112 * (angle_m * (((double) M_PI) * b))) + (0.011111111111111112 * (angle_m * (((double) M_PI) * (a - a))))));
}
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(b, 2.0) - Math.pow(a, 2.0);
double tmp;
if (t_0 <= -1e+305) {
tmp = (0.011111111111111112 * (angle_m * (Math.PI * Math.pow(b, 2.0)))) + (a * ((-0.011111111111111112 * (a * (angle_m * Math.PI))) + (0.011111111111111112 * (angle_m * (Math.PI * (b - b))))));
} else if ((t_0 <= 2e+260) || !(t_0 <= Double.POSITIVE_INFINITY)) {
tmp = ((a + b) * (b - a)) * (2.0 * Math.sin(((angle_m / 180.0) * Math.PI)));
} else {
tmp = (-0.011111111111111112 * (Math.pow(a, 2.0) * (angle_m * Math.PI))) + (b * ((0.011111111111111112 * (angle_m * (Math.PI * b))) + (0.011111111111111112 * (angle_m * (Math.PI * (a - a))))));
}
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 = math.pow(b, 2.0) - math.pow(a, 2.0) tmp = 0 if t_0 <= -1e+305: tmp = (0.011111111111111112 * (angle_m * (math.pi * math.pow(b, 2.0)))) + (a * ((-0.011111111111111112 * (a * (angle_m * math.pi))) + (0.011111111111111112 * (angle_m * (math.pi * (b - b)))))) elif (t_0 <= 2e+260) or not (t_0 <= math.inf): tmp = ((a + b) * (b - a)) * (2.0 * math.sin(((angle_m / 180.0) * math.pi))) else: tmp = (-0.011111111111111112 * (math.pow(a, 2.0) * (angle_m * math.pi))) + (b * ((0.011111111111111112 * (angle_m * (math.pi * b))) + (0.011111111111111112 * (angle_m * (math.pi * (a - a)))))) 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((b ^ 2.0) - (a ^ 2.0)) tmp = 0.0 if (t_0 <= -1e+305) tmp = Float64(Float64(0.011111111111111112 * Float64(angle_m * Float64(pi * (b ^ 2.0)))) + Float64(a * Float64(Float64(-0.011111111111111112 * Float64(a * Float64(angle_m * pi))) + Float64(0.011111111111111112 * Float64(angle_m * Float64(pi * Float64(b - b))))))); elseif ((t_0 <= 2e+260) || !(t_0 <= Inf)) tmp = Float64(Float64(Float64(a + b) * Float64(b - a)) * Float64(2.0 * sin(Float64(Float64(angle_m / 180.0) * pi)))); else tmp = Float64(Float64(-0.011111111111111112 * Float64((a ^ 2.0) * Float64(angle_m * pi))) + Float64(b * Float64(Float64(0.011111111111111112 * Float64(angle_m * Float64(pi * b))) + Float64(0.011111111111111112 * Float64(angle_m * Float64(pi * Float64(a - a))))))); 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 = (b ^ 2.0) - (a ^ 2.0); tmp = 0.0; if (t_0 <= -1e+305) tmp = (0.011111111111111112 * (angle_m * (pi * (b ^ 2.0)))) + (a * ((-0.011111111111111112 * (a * (angle_m * pi))) + (0.011111111111111112 * (angle_m * (pi * (b - b)))))); elseif ((t_0 <= 2e+260) || ~((t_0 <= Inf))) tmp = ((a + b) * (b - a)) * (2.0 * sin(((angle_m / 180.0) * pi))); else tmp = (-0.011111111111111112 * ((a ^ 2.0) * (angle_m * pi))) + (b * ((0.011111111111111112 * (angle_m * (pi * b))) + (0.011111111111111112 * (angle_m * (pi * (a - a)))))); 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[Power[b, 2.0], $MachinePrecision] - N[Power[a, 2.0], $MachinePrecision]), $MachinePrecision]}, N[(angle$95$s * If[LessEqual[t$95$0, -1e+305], N[(N[(0.011111111111111112 * N[(angle$95$m * N[(Pi * N[Power[b, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(a * N[(N[(-0.011111111111111112 * N[(a * N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(0.011111111111111112 * N[(angle$95$m * N[(Pi * N[(b - b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[t$95$0, 2e+260], N[Not[LessEqual[t$95$0, Infinity]], $MachinePrecision]], N[(N[(N[(a + b), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision] * N[(2.0 * N[Sin[N[(N[(angle$95$m / 180.0), $MachinePrecision] * Pi), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(-0.011111111111111112 * N[(N[Power[a, 2.0], $MachinePrecision] * N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(b * N[(N[(0.011111111111111112 * N[(angle$95$m * N[(Pi * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(0.011111111111111112 * N[(angle$95$m * N[(Pi * N[(a - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]]
\begin{array}{l}
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
\begin{array}{l}
t_0 := {b}^{2} - {a}^{2}\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_0 \leq -1 \cdot 10^{+305}:\\
\;\;\;\;0.011111111111111112 \cdot \left(angle\_m \cdot \left(\pi \cdot {b}^{2}\right)\right) + a \cdot \left(-0.011111111111111112 \cdot \left(a \cdot \left(angle\_m \cdot \pi\right)\right) + 0.011111111111111112 \cdot \left(angle\_m \cdot \left(\pi \cdot \left(b - b\right)\right)\right)\right)\\
\mathbf{elif}\;t\_0 \leq 2 \cdot 10^{+260} \lor \neg \left(t\_0 \leq \infty\right):\\
\;\;\;\;\left(\left(a + b\right) \cdot \left(b - a\right)\right) \cdot \left(2 \cdot \sin \left(\frac{angle\_m}{180} \cdot \pi\right)\right)\\
\mathbf{else}:\\
\;\;\;\;-0.011111111111111112 \cdot \left({a}^{2} \cdot \left(angle\_m \cdot \pi\right)\right) + b \cdot \left(0.011111111111111112 \cdot \left(angle\_m \cdot \left(\pi \cdot b\right)\right) + 0.011111111111111112 \cdot \left(angle\_m \cdot \left(\pi \cdot \left(a - a\right)\right)\right)\right)\\
\end{array}
\end{array}
\end{array}
if (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) < -9.9999999999999994e304Initial program 41.2%
associate-*l*41.2%
*-commutative41.2%
associate-*l*41.2%
Simplified41.2%
unpow241.2%
unpow241.2%
difference-of-squares41.2%
Applied egg-rr41.2%
add-cbrt-cube48.2%
pow348.2%
Applied egg-rr48.2%
Taylor expanded in angle around 0 46.2%
Taylor expanded in a around 0 65.3%
if -9.9999999999999994e304 < (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) < 2.00000000000000013e260 or +inf.0 < (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) Initial program 60.4%
associate-*l*60.4%
*-commutative60.4%
associate-*l*60.4%
Simplified60.4%
unpow260.4%
unpow260.4%
difference-of-squares65.2%
Applied egg-rr65.2%
Taylor expanded in angle around 0 66.7%
if 2.00000000000000013e260 < (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) < +inf.0Initial program 60.3%
associate-*l*60.3%
*-commutative60.3%
associate-*l*60.3%
Simplified60.3%
unpow260.3%
unpow260.3%
difference-of-squares60.3%
Applied egg-rr60.3%
add-cbrt-cube63.3%
pow363.3%
Applied egg-rr63.3%
Taylor expanded in angle around 0 63.4%
Taylor expanded in b around 0 72.2%
Final simplification67.8%
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a b angle_m)
:precision binary64
(let* ((t_0 (* (+ a b) (- b a)))
(t_1 (- (pow b 2.0) (pow a 2.0)))
(t_2 (* 0.005555555555555556 (* angle_m PI))))
(*
angle_s
(if (<= t_1 -2e+275)
(+
(* 0.011111111111111112 (* angle_m (* PI (pow b 2.0))))
(*
a
(+
(* -0.011111111111111112 (* a (* angle_m PI)))
(* 0.011111111111111112 (* angle_m (* PI (- b b)))))))
(if (<= t_1 1e+277)
(* 2.0 (* (* t_0 (sin t_2)) (cos t_2)))
(if (<= t_1 INFINITY)
(+
(* -0.011111111111111112 (* (pow a 2.0) (* angle_m PI)))
(*
b
(+
(* 0.011111111111111112 (* angle_m (* PI b)))
(* 0.011111111111111112 (* angle_m (* PI (- a a)))))))
(* t_0 (* 2.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 = pow(b, 2.0) - pow(a, 2.0);
double t_2 = 0.005555555555555556 * (angle_m * ((double) M_PI));
double tmp;
if (t_1 <= -2e+275) {
tmp = (0.011111111111111112 * (angle_m * (((double) M_PI) * pow(b, 2.0)))) + (a * ((-0.011111111111111112 * (a * (angle_m * ((double) M_PI)))) + (0.011111111111111112 * (angle_m * (((double) M_PI) * (b - b))))));
} else if (t_1 <= 1e+277) {
tmp = 2.0 * ((t_0 * sin(t_2)) * cos(t_2));
} else if (t_1 <= ((double) INFINITY)) {
tmp = (-0.011111111111111112 * (pow(a, 2.0) * (angle_m * ((double) M_PI)))) + (b * ((0.011111111111111112 * (angle_m * (((double) M_PI) * b))) + (0.011111111111111112 * (angle_m * (((double) M_PI) * (a - a))))));
} else {
tmp = t_0 * (2.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.pow(b, 2.0) - Math.pow(a, 2.0);
double t_2 = 0.005555555555555556 * (angle_m * Math.PI);
double tmp;
if (t_1 <= -2e+275) {
tmp = (0.011111111111111112 * (angle_m * (Math.PI * Math.pow(b, 2.0)))) + (a * ((-0.011111111111111112 * (a * (angle_m * Math.PI))) + (0.011111111111111112 * (angle_m * (Math.PI * (b - b))))));
} else if (t_1 <= 1e+277) {
tmp = 2.0 * ((t_0 * Math.sin(t_2)) * Math.cos(t_2));
} else if (t_1 <= Double.POSITIVE_INFINITY) {
tmp = (-0.011111111111111112 * (Math.pow(a, 2.0) * (angle_m * Math.PI))) + (b * ((0.011111111111111112 * (angle_m * (Math.PI * b))) + (0.011111111111111112 * (angle_m * (Math.PI * (a - a))))));
} else {
tmp = t_0 * (2.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.pow(b, 2.0) - math.pow(a, 2.0) t_2 = 0.005555555555555556 * (angle_m * math.pi) tmp = 0 if t_1 <= -2e+275: tmp = (0.011111111111111112 * (angle_m * (math.pi * math.pow(b, 2.0)))) + (a * ((-0.011111111111111112 * (a * (angle_m * math.pi))) + (0.011111111111111112 * (angle_m * (math.pi * (b - b)))))) elif t_1 <= 1e+277: tmp = 2.0 * ((t_0 * math.sin(t_2)) * math.cos(t_2)) elif t_1 <= math.inf: tmp = (-0.011111111111111112 * (math.pow(a, 2.0) * (angle_m * math.pi))) + (b * ((0.011111111111111112 * (angle_m * (math.pi * b))) + (0.011111111111111112 * (angle_m * (math.pi * (a - a)))))) else: tmp = t_0 * (2.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((b ^ 2.0) - (a ^ 2.0)) t_2 = Float64(0.005555555555555556 * Float64(angle_m * pi)) tmp = 0.0 if (t_1 <= -2e+275) tmp = Float64(Float64(0.011111111111111112 * Float64(angle_m * Float64(pi * (b ^ 2.0)))) + Float64(a * Float64(Float64(-0.011111111111111112 * Float64(a * Float64(angle_m * pi))) + Float64(0.011111111111111112 * Float64(angle_m * Float64(pi * Float64(b - b))))))); elseif (t_1 <= 1e+277) tmp = Float64(2.0 * Float64(Float64(t_0 * sin(t_2)) * cos(t_2))); elseif (t_1 <= Inf) tmp = Float64(Float64(-0.011111111111111112 * Float64((a ^ 2.0) * Float64(angle_m * pi))) + Float64(b * Float64(Float64(0.011111111111111112 * Float64(angle_m * Float64(pi * b))) + Float64(0.011111111111111112 * Float64(angle_m * Float64(pi * Float64(a - a))))))); else tmp = Float64(t_0 * Float64(2.0 * 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) t_0 = (a + b) * (b - a); t_1 = (b ^ 2.0) - (a ^ 2.0); t_2 = 0.005555555555555556 * (angle_m * pi); tmp = 0.0; if (t_1 <= -2e+275) tmp = (0.011111111111111112 * (angle_m * (pi * (b ^ 2.0)))) + (a * ((-0.011111111111111112 * (a * (angle_m * pi))) + (0.011111111111111112 * (angle_m * (pi * (b - b)))))); elseif (t_1 <= 1e+277) tmp = 2.0 * ((t_0 * sin(t_2)) * cos(t_2)); elseif (t_1 <= Inf) tmp = (-0.011111111111111112 * ((a ^ 2.0) * (angle_m * pi))) + (b * ((0.011111111111111112 * (angle_m * (pi * b))) + (0.011111111111111112 * (angle_m * (pi * (a - a)))))); else tmp = t_0 * (2.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[(N[Power[b, 2.0], $MachinePrecision] - N[Power[a, 2.0], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(0.005555555555555556 * N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision]}, N[(angle$95$s * If[LessEqual[t$95$1, -2e+275], N[(N[(0.011111111111111112 * N[(angle$95$m * N[(Pi * N[Power[b, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(a * N[(N[(-0.011111111111111112 * N[(a * N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(0.011111111111111112 * N[(angle$95$m * N[(Pi * N[(b - b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 1e+277], N[(2.0 * N[(N[(t$95$0 * N[Sin[t$95$2], $MachinePrecision]), $MachinePrecision] * N[Cos[t$95$2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, Infinity], N[(N[(-0.011111111111111112 * N[(N[Power[a, 2.0], $MachinePrecision] * N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(b * N[(N[(0.011111111111111112 * N[(angle$95$m * N[(Pi * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(0.011111111111111112 * N[(angle$95$m * N[(Pi * N[(a - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$0 * N[(2.0 * N[Sin[N[(N[(angle$95$m / 180.0), $MachinePrecision] * 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 := {b}^{2} - {a}^{2}\\
t_2 := 0.005555555555555556 \cdot \left(angle\_m \cdot \pi\right)\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_1 \leq -2 \cdot 10^{+275}:\\
\;\;\;\;0.011111111111111112 \cdot \left(angle\_m \cdot \left(\pi \cdot {b}^{2}\right)\right) + a \cdot \left(-0.011111111111111112 \cdot \left(a \cdot \left(angle\_m \cdot \pi\right)\right) + 0.011111111111111112 \cdot \left(angle\_m \cdot \left(\pi \cdot \left(b - b\right)\right)\right)\right)\\
\mathbf{elif}\;t\_1 \leq 10^{+277}:\\
\;\;\;\;2 \cdot \left(\left(t\_0 \cdot \sin t\_2\right) \cdot \cos t\_2\right)\\
\mathbf{elif}\;t\_1 \leq \infty:\\
\;\;\;\;-0.011111111111111112 \cdot \left({a}^{2} \cdot \left(angle\_m \cdot \pi\right)\right) + b \cdot \left(0.011111111111111112 \cdot \left(angle\_m \cdot \left(\pi \cdot b\right)\right) + 0.011111111111111112 \cdot \left(angle\_m \cdot \left(\pi \cdot \left(a - a\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0 \cdot \left(2 \cdot \sin \left(\frac{angle\_m}{180} \cdot \pi\right)\right)\\
\end{array}
\end{array}
\end{array}
if (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) < -1.99999999999999992e275Initial program 46.4%
associate-*l*46.4%
*-commutative46.4%
associate-*l*46.4%
Simplified46.4%
unpow246.4%
unpow246.4%
difference-of-squares46.4%
Applied egg-rr46.4%
add-cbrt-cube52.3%
pow352.3%
Applied egg-rr52.3%
Taylor expanded in angle around 0 50.9%
Taylor expanded in a around 0 67.6%
if -1.99999999999999992e275 < (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) < 1e277Initial program 66.2%
associate-*l*66.2%
*-commutative66.2%
associate-*l*66.2%
Simplified66.2%
unpow266.2%
unpow266.2%
difference-of-squares66.2%
Applied egg-rr66.2%
Taylor expanded in angle around inf 66.5%
*-commutative66.5%
Simplified66.5%
if 1e277 < (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) < +inf.0Initial program 60.4%
associate-*l*60.4%
*-commutative60.4%
associate-*l*60.4%
Simplified60.4%
unpow260.4%
unpow260.4%
difference-of-squares60.4%
Applied egg-rr60.4%
add-cbrt-cube63.8%
pow363.8%
Applied egg-rr63.8%
Taylor expanded in angle around 0 63.8%
Taylor expanded in b around 0 72.8%
if +inf.0 < (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) Initial program 0.0%
associate-*l*0.0%
*-commutative0.0%
associate-*l*0.0%
Simplified0.0%
unpow20.0%
unpow20.0%
difference-of-squares48.2%
Applied egg-rr48.2%
Taylor expanded in angle around 0 68.2%
Final simplification68.2%
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a b angle_m)
:precision binary64
(let* ((t_0 (sin (* 0.005555555555555556 (* angle_m PI)))))
(*
angle_s
(if (<= (- (pow b 2.0) (pow a 2.0)) -2e-51)
(+
(* 2.0 (* (pow b 2.0) t_0))
(* a (+ (* -2.0 (* a t_0)) (* 2.0 (* t_0 (- b b))))))
(*
(* (+ a b) (- b a))
(*
2.0
(*
(cos (* (/ angle_m 180.0) PI))
(sin (* (/ angle_m 180.0) (cbrt (pow PI 3.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 = sin((0.005555555555555556 * (angle_m * ((double) M_PI))));
double tmp;
if ((pow(b, 2.0) - pow(a, 2.0)) <= -2e-51) {
tmp = (2.0 * (pow(b, 2.0) * t_0)) + (a * ((-2.0 * (a * t_0)) + (2.0 * (t_0 * (b - b)))));
} else {
tmp = ((a + b) * (b - a)) * (2.0 * (cos(((angle_m / 180.0) * ((double) M_PI))) * sin(((angle_m / 180.0) * cbrt(pow(((double) M_PI), 3.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.sin((0.005555555555555556 * (angle_m * Math.PI)));
double tmp;
if ((Math.pow(b, 2.0) - Math.pow(a, 2.0)) <= -2e-51) {
tmp = (2.0 * (Math.pow(b, 2.0) * t_0)) + (a * ((-2.0 * (a * t_0)) + (2.0 * (t_0 * (b - b)))));
} else {
tmp = ((a + b) * (b - a)) * (2.0 * (Math.cos(((angle_m / 180.0) * Math.PI)) * Math.sin(((angle_m / 180.0) * Math.cbrt(Math.pow(Math.PI, 3.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 = sin(Float64(0.005555555555555556 * Float64(angle_m * pi))) tmp = 0.0 if (Float64((b ^ 2.0) - (a ^ 2.0)) <= -2e-51) tmp = Float64(Float64(2.0 * Float64((b ^ 2.0) * t_0)) + Float64(a * Float64(Float64(-2.0 * Float64(a * t_0)) + Float64(2.0 * Float64(t_0 * Float64(b - b)))))); else tmp = Float64(Float64(Float64(a + b) * Float64(b - a)) * Float64(2.0 * Float64(cos(Float64(Float64(angle_m / 180.0) * pi)) * sin(Float64(Float64(angle_m / 180.0) * cbrt((pi ^ 3.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[Sin[N[(0.005555555555555556 * N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, N[(angle$95$s * If[LessEqual[N[(N[Power[b, 2.0], $MachinePrecision] - N[Power[a, 2.0], $MachinePrecision]), $MachinePrecision], -2e-51], N[(N[(2.0 * N[(N[Power[b, 2.0], $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision] + N[(a * N[(N[(-2.0 * N[(a * t$95$0), $MachinePrecision]), $MachinePrecision] + N[(2.0 * N[(t$95$0 * N[(b - b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(a + b), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision] * N[(2.0 * N[(N[Cos[N[(N[(angle$95$m / 180.0), $MachinePrecision] * Pi), $MachinePrecision]], $MachinePrecision] * N[Sin[N[(N[(angle$95$m / 180.0), $MachinePrecision] * N[Power[N[Power[Pi, 3.0], $MachinePrecision], 1/3], $MachinePrecision]), $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 := \sin \left(0.005555555555555556 \cdot \left(angle\_m \cdot \pi\right)\right)\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;{b}^{2} - {a}^{2} \leq -2 \cdot 10^{-51}:\\
\;\;\;\;2 \cdot \left({b}^{2} \cdot t\_0\right) + a \cdot \left(-2 \cdot \left(a \cdot t\_0\right) + 2 \cdot \left(t\_0 \cdot \left(b - b\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(a + b\right) \cdot \left(b - a\right)\right) \cdot \left(2 \cdot \left(\cos \left(\frac{angle\_m}{180} \cdot \pi\right) \cdot \sin \left(\frac{angle\_m}{180} \cdot \sqrt[3]{{\pi}^{3}}\right)\right)\right)\\
\end{array}
\end{array}
\end{array}
if (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) < -2e-51Initial program 52.9%
associate-*l*52.9%
*-commutative52.9%
associate-*l*52.9%
Simplified52.9%
unpow252.9%
unpow252.9%
difference-of-squares52.9%
Applied egg-rr52.9%
Taylor expanded in angle around 0 52.6%
Taylor expanded in a around 0 67.7%
if -2e-51 < (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) Initial program 59.7%
associate-*l*59.7%
*-commutative59.7%
associate-*l*59.7%
Simplified59.7%
unpow259.7%
unpow259.7%
difference-of-squares64.2%
Applied egg-rr64.2%
add-cbrt-cube67.6%
pow367.6%
Applied egg-rr67.6%
Final simplification67.7%
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a b angle_m)
:precision binary64
(let* ((t_0 (* (+ a b) (- b a)))
(t_1 (* PI (* angle_m 0.005555555555555556)))
(t_2 (cos (* (/ angle_m 180.0) PI)))
(t_3 (sin (* (/ angle_m 180.0) (cbrt (pow PI 3.0))))))
(*
angle_s
(if (<= (/ angle_m 180.0) 1e-46)
(+
(* 0.011111111111111112 (* angle_m (* PI (pow b 2.0))))
(*
a
(+
(* -0.011111111111111112 (* a (* angle_m PI)))
(* 0.011111111111111112 (* angle_m (* PI (- b b)))))))
(if (<= (/ angle_m 180.0) 1e+121)
(* t_0 (* 2.0 (* t_2 t_3)))
(if (<= (/ angle_m 180.0) 1e+165)
(* t_2 (* (* 2.0 t_0) (fabs (sin t_1))))
(if (<= (/ angle_m 180.0) 5e+230)
(* t_0 (* 2.0 (* t_3 (cos (/ PI (/ 180.0 angle_m))))))
(* t_0 (* 2.0 (sin (pow (sqrt t_1) 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 = ((double) M_PI) * (angle_m * 0.005555555555555556);
double t_2 = cos(((angle_m / 180.0) * ((double) M_PI)));
double t_3 = sin(((angle_m / 180.0) * cbrt(pow(((double) M_PI), 3.0))));
double tmp;
if ((angle_m / 180.0) <= 1e-46) {
tmp = (0.011111111111111112 * (angle_m * (((double) M_PI) * pow(b, 2.0)))) + (a * ((-0.011111111111111112 * (a * (angle_m * ((double) M_PI)))) + (0.011111111111111112 * (angle_m * (((double) M_PI) * (b - b))))));
} else if ((angle_m / 180.0) <= 1e+121) {
tmp = t_0 * (2.0 * (t_2 * t_3));
} else if ((angle_m / 180.0) <= 1e+165) {
tmp = t_2 * ((2.0 * t_0) * fabs(sin(t_1)));
} else if ((angle_m / 180.0) <= 5e+230) {
tmp = t_0 * (2.0 * (t_3 * cos((((double) M_PI) / (180.0 / angle_m)))));
} else {
tmp = t_0 * (2.0 * sin(pow(sqrt(t_1), 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 = Math.PI * (angle_m * 0.005555555555555556);
double t_2 = Math.cos(((angle_m / 180.0) * Math.PI));
double t_3 = Math.sin(((angle_m / 180.0) * Math.cbrt(Math.pow(Math.PI, 3.0))));
double tmp;
if ((angle_m / 180.0) <= 1e-46) {
tmp = (0.011111111111111112 * (angle_m * (Math.PI * Math.pow(b, 2.0)))) + (a * ((-0.011111111111111112 * (a * (angle_m * Math.PI))) + (0.011111111111111112 * (angle_m * (Math.PI * (b - b))))));
} else if ((angle_m / 180.0) <= 1e+121) {
tmp = t_0 * (2.0 * (t_2 * t_3));
} else if ((angle_m / 180.0) <= 1e+165) {
tmp = t_2 * ((2.0 * t_0) * Math.abs(Math.sin(t_1)));
} else if ((angle_m / 180.0) <= 5e+230) {
tmp = t_0 * (2.0 * (t_3 * Math.cos((Math.PI / (180.0 / angle_m)))));
} else {
tmp = t_0 * (2.0 * Math.sin(Math.pow(Math.sqrt(t_1), 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(pi * Float64(angle_m * 0.005555555555555556)) t_2 = cos(Float64(Float64(angle_m / 180.0) * pi)) t_3 = sin(Float64(Float64(angle_m / 180.0) * cbrt((pi ^ 3.0)))) tmp = 0.0 if (Float64(angle_m / 180.0) <= 1e-46) tmp = Float64(Float64(0.011111111111111112 * Float64(angle_m * Float64(pi * (b ^ 2.0)))) + Float64(a * Float64(Float64(-0.011111111111111112 * Float64(a * Float64(angle_m * pi))) + Float64(0.011111111111111112 * Float64(angle_m * Float64(pi * Float64(b - b))))))); elseif (Float64(angle_m / 180.0) <= 1e+121) tmp = Float64(t_0 * Float64(2.0 * Float64(t_2 * t_3))); elseif (Float64(angle_m / 180.0) <= 1e+165) tmp = Float64(t_2 * Float64(Float64(2.0 * t_0) * abs(sin(t_1)))); elseif (Float64(angle_m / 180.0) <= 5e+230) tmp = Float64(t_0 * Float64(2.0 * Float64(t_3 * cos(Float64(pi / Float64(180.0 / angle_m)))))); else tmp = Float64(t_0 * Float64(2.0 * sin((sqrt(t_1) ^ 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[(Pi * N[(angle$95$m * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Cos[N[(N[(angle$95$m / 180.0), $MachinePrecision] * Pi), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[Sin[N[(N[(angle$95$m / 180.0), $MachinePrecision] * N[Power[N[Power[Pi, 3.0], $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, N[(angle$95$s * If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 1e-46], N[(N[(0.011111111111111112 * N[(angle$95$m * N[(Pi * N[Power[b, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(a * N[(N[(-0.011111111111111112 * N[(a * N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(0.011111111111111112 * N[(angle$95$m * N[(Pi * N[(b - b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 1e+121], N[(t$95$0 * N[(2.0 * N[(t$95$2 * t$95$3), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 1e+165], N[(t$95$2 * N[(N[(2.0 * t$95$0), $MachinePrecision] * N[Abs[N[Sin[t$95$1], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 5e+230], N[(t$95$0 * N[(2.0 * N[(t$95$3 * N[Cos[N[(Pi / N[(180.0 / angle$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$0 * N[(2.0 * N[Sin[N[Power[N[Sqrt[t$95$1], $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 := \pi \cdot \left(angle\_m \cdot 0.005555555555555556\right)\\
t_2 := \cos \left(\frac{angle\_m}{180} \cdot \pi\right)\\
t_3 := \sin \left(\frac{angle\_m}{180} \cdot \sqrt[3]{{\pi}^{3}}\right)\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;\frac{angle\_m}{180} \leq 10^{-46}:\\
\;\;\;\;0.011111111111111112 \cdot \left(angle\_m \cdot \left(\pi \cdot {b}^{2}\right)\right) + a \cdot \left(-0.011111111111111112 \cdot \left(a \cdot \left(angle\_m \cdot \pi\right)\right) + 0.011111111111111112 \cdot \left(angle\_m \cdot \left(\pi \cdot \left(b - b\right)\right)\right)\right)\\
\mathbf{elif}\;\frac{angle\_m}{180} \leq 10^{+121}:\\
\;\;\;\;t\_0 \cdot \left(2 \cdot \left(t\_2 \cdot t\_3\right)\right)\\
\mathbf{elif}\;\frac{angle\_m}{180} \leq 10^{+165}:\\
\;\;\;\;t\_2 \cdot \left(\left(2 \cdot t\_0\right) \cdot \left|\sin t\_1\right|\right)\\
\mathbf{elif}\;\frac{angle\_m}{180} \leq 5 \cdot 10^{+230}:\\
\;\;\;\;t\_0 \cdot \left(2 \cdot \left(t\_3 \cdot \cos \left(\frac{\pi}{\frac{180}{angle\_m}}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0 \cdot \left(2 \cdot \sin \left({\left(\sqrt{t\_1}\right)}^{2}\right)\right)\\
\end{array}
\end{array}
\end{array}
if (/.f64 angle #s(literal 180 binary64)) < 1.00000000000000002e-46Initial program 63.7%
associate-*l*63.7%
*-commutative63.7%
associate-*l*63.7%
Simplified63.7%
unpow263.7%
unpow263.7%
difference-of-squares66.6%
Applied egg-rr66.6%
add-cbrt-cube68.8%
pow368.8%
Applied egg-rr68.8%
Taylor expanded in angle around 0 65.7%
Taylor expanded in a around 0 68.6%
if 1.00000000000000002e-46 < (/.f64 angle #s(literal 180 binary64)) < 1.00000000000000004e121Initial program 59.6%
associate-*l*59.6%
*-commutative59.6%
associate-*l*59.6%
Simplified59.6%
unpow259.6%
unpow259.6%
difference-of-squares62.7%
Applied egg-rr62.7%
add-cbrt-cube62.4%
pow362.4%
Applied egg-rr62.4%
if 1.00000000000000004e121 < (/.f64 angle #s(literal 180 binary64)) < 9.99999999999999899e164Initial program 17.8%
unpow217.8%
unpow217.8%
difference-of-squares17.8%
Applied egg-rr17.8%
add-sqr-sqrt14.7%
sqrt-unprod57.6%
pow257.6%
div-inv58.1%
metadata-eval58.1%
Applied egg-rr58.1%
unpow258.1%
rem-sqrt-square58.1%
Applied egg-rr58.1%
if 9.99999999999999899e164 < (/.f64 angle #s(literal 180 binary64)) < 5.0000000000000003e230Initial program 45.0%
associate-*l*45.0%
*-commutative45.0%
associate-*l*45.0%
Simplified45.0%
unpow245.0%
unpow245.0%
difference-of-squares45.0%
Applied egg-rr45.0%
add-cbrt-cube46.3%
pow346.3%
Applied egg-rr46.3%
clear-num46.3%
un-div-inv54.7%
Applied egg-rr54.7%
if 5.0000000000000003e230 < (/.f64 angle #s(literal 180 binary64)) Initial program 27.1%
associate-*l*27.1%
*-commutative27.1%
associate-*l*27.1%
Simplified27.1%
unpow227.1%
unpow227.1%
difference-of-squares32.7%
Applied egg-rr32.7%
Taylor expanded in angle around 0 40.8%
add-sqr-sqrt48.8%
pow248.8%
div-inv48.8%
metadata-eval48.8%
*-commutative48.8%
*-commutative48.8%
Applied egg-rr48.8%
Final simplification65.3%
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a b angle_m)
:precision binary64
(let* ((t_0 (* (+ a b) (- b a)))
(t_1 (* PI (* angle_m 0.005555555555555556)))
(t_2 (cos (* (/ angle_m 180.0) PI)))
(t_3 (* 2.0 t_0)))
(*
angle_s
(if (<= (/ angle_m 180.0) 1e-46)
(+
(* 0.011111111111111112 (* angle_m (* PI (pow b 2.0))))
(*
a
(+
(* -0.011111111111111112 (* a (* angle_m PI)))
(* 0.011111111111111112 (* angle_m (* PI (- b b)))))))
(if (<= (/ angle_m 180.0) 1e+121)
(* t_0 (* 2.0 (* t_2 (sin (* (/ angle_m 180.0) (cbrt (pow PI 3.0)))))))
(if (<= (/ angle_m 180.0) 5e+169)
(* (cos t_1) (* t_3 (sqrt (pow (sin t_1) 2.0))))
(if (<= (/ angle_m 180.0) 5e+230)
(* t_2 (* t_3 (sin (* angle_m (* PI 0.005555555555555556)))))
(* t_0 (* 2.0 (sin (pow (sqrt t_1) 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 = ((double) M_PI) * (angle_m * 0.005555555555555556);
double t_2 = cos(((angle_m / 180.0) * ((double) M_PI)));
double t_3 = 2.0 * t_0;
double tmp;
if ((angle_m / 180.0) <= 1e-46) {
tmp = (0.011111111111111112 * (angle_m * (((double) M_PI) * pow(b, 2.0)))) + (a * ((-0.011111111111111112 * (a * (angle_m * ((double) M_PI)))) + (0.011111111111111112 * (angle_m * (((double) M_PI) * (b - b))))));
} else if ((angle_m / 180.0) <= 1e+121) {
tmp = t_0 * (2.0 * (t_2 * sin(((angle_m / 180.0) * cbrt(pow(((double) M_PI), 3.0))))));
} else if ((angle_m / 180.0) <= 5e+169) {
tmp = cos(t_1) * (t_3 * sqrt(pow(sin(t_1), 2.0)));
} else if ((angle_m / 180.0) <= 5e+230) {
tmp = t_2 * (t_3 * sin((angle_m * (((double) M_PI) * 0.005555555555555556))));
} else {
tmp = t_0 * (2.0 * sin(pow(sqrt(t_1), 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 = Math.PI * (angle_m * 0.005555555555555556);
double t_2 = Math.cos(((angle_m / 180.0) * Math.PI));
double t_3 = 2.0 * t_0;
double tmp;
if ((angle_m / 180.0) <= 1e-46) {
tmp = (0.011111111111111112 * (angle_m * (Math.PI * Math.pow(b, 2.0)))) + (a * ((-0.011111111111111112 * (a * (angle_m * Math.PI))) + (0.011111111111111112 * (angle_m * (Math.PI * (b - b))))));
} else if ((angle_m / 180.0) <= 1e+121) {
tmp = t_0 * (2.0 * (t_2 * Math.sin(((angle_m / 180.0) * Math.cbrt(Math.pow(Math.PI, 3.0))))));
} else if ((angle_m / 180.0) <= 5e+169) {
tmp = Math.cos(t_1) * (t_3 * Math.sqrt(Math.pow(Math.sin(t_1), 2.0)));
} else if ((angle_m / 180.0) <= 5e+230) {
tmp = t_2 * (t_3 * Math.sin((angle_m * (Math.PI * 0.005555555555555556))));
} else {
tmp = t_0 * (2.0 * Math.sin(Math.pow(Math.sqrt(t_1), 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(pi * Float64(angle_m * 0.005555555555555556)) t_2 = cos(Float64(Float64(angle_m / 180.0) * pi)) t_3 = Float64(2.0 * t_0) tmp = 0.0 if (Float64(angle_m / 180.0) <= 1e-46) tmp = Float64(Float64(0.011111111111111112 * Float64(angle_m * Float64(pi * (b ^ 2.0)))) + Float64(a * Float64(Float64(-0.011111111111111112 * Float64(a * Float64(angle_m * pi))) + Float64(0.011111111111111112 * Float64(angle_m * Float64(pi * Float64(b - b))))))); elseif (Float64(angle_m / 180.0) <= 1e+121) tmp = Float64(t_0 * Float64(2.0 * Float64(t_2 * sin(Float64(Float64(angle_m / 180.0) * cbrt((pi ^ 3.0))))))); elseif (Float64(angle_m / 180.0) <= 5e+169) tmp = Float64(cos(t_1) * Float64(t_3 * sqrt((sin(t_1) ^ 2.0)))); elseif (Float64(angle_m / 180.0) <= 5e+230) tmp = Float64(t_2 * Float64(t_3 * sin(Float64(angle_m * Float64(pi * 0.005555555555555556))))); else tmp = Float64(t_0 * Float64(2.0 * sin((sqrt(t_1) ^ 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[(Pi * N[(angle$95$m * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Cos[N[(N[(angle$95$m / 180.0), $MachinePrecision] * Pi), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[(2.0 * t$95$0), $MachinePrecision]}, N[(angle$95$s * If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 1e-46], N[(N[(0.011111111111111112 * N[(angle$95$m * N[(Pi * N[Power[b, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(a * N[(N[(-0.011111111111111112 * N[(a * N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(0.011111111111111112 * N[(angle$95$m * N[(Pi * N[(b - b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 1e+121], N[(t$95$0 * N[(2.0 * N[(t$95$2 * N[Sin[N[(N[(angle$95$m / 180.0), $MachinePrecision] * N[Power[N[Power[Pi, 3.0], $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 5e+169], N[(N[Cos[t$95$1], $MachinePrecision] * N[(t$95$3 * N[Sqrt[N[Power[N[Sin[t$95$1], $MachinePrecision], 2.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 5e+230], N[(t$95$2 * N[(t$95$3 * N[Sin[N[(angle$95$m * N[(Pi * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$0 * N[(2.0 * N[Sin[N[Power[N[Sqrt[t$95$1], $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 := \pi \cdot \left(angle\_m \cdot 0.005555555555555556\right)\\
t_2 := \cos \left(\frac{angle\_m}{180} \cdot \pi\right)\\
t_3 := 2 \cdot t\_0\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;\frac{angle\_m}{180} \leq 10^{-46}:\\
\;\;\;\;0.011111111111111112 \cdot \left(angle\_m \cdot \left(\pi \cdot {b}^{2}\right)\right) + a \cdot \left(-0.011111111111111112 \cdot \left(a \cdot \left(angle\_m \cdot \pi\right)\right) + 0.011111111111111112 \cdot \left(angle\_m \cdot \left(\pi \cdot \left(b - b\right)\right)\right)\right)\\
\mathbf{elif}\;\frac{angle\_m}{180} \leq 10^{+121}:\\
\;\;\;\;t\_0 \cdot \left(2 \cdot \left(t\_2 \cdot \sin \left(\frac{angle\_m}{180} \cdot \sqrt[3]{{\pi}^{3}}\right)\right)\right)\\
\mathbf{elif}\;\frac{angle\_m}{180} \leq 5 \cdot 10^{+169}:\\
\;\;\;\;\cos t\_1 \cdot \left(t\_3 \cdot \sqrt{{\sin t\_1}^{2}}\right)\\
\mathbf{elif}\;\frac{angle\_m}{180} \leq 5 \cdot 10^{+230}:\\
\;\;\;\;t\_2 \cdot \left(t\_3 \cdot \sin \left(angle\_m \cdot \left(\pi \cdot 0.005555555555555556\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0 \cdot \left(2 \cdot \sin \left({\left(\sqrt{t\_1}\right)}^{2}\right)\right)\\
\end{array}
\end{array}
\end{array}
if (/.f64 angle #s(literal 180 binary64)) < 1.00000000000000002e-46Initial program 63.7%
associate-*l*63.7%
*-commutative63.7%
associate-*l*63.7%
Simplified63.7%
unpow263.7%
unpow263.7%
difference-of-squares66.6%
Applied egg-rr66.6%
add-cbrt-cube68.8%
pow368.8%
Applied egg-rr68.8%
Taylor expanded in angle around 0 65.7%
Taylor expanded in a around 0 68.6%
if 1.00000000000000002e-46 < (/.f64 angle #s(literal 180 binary64)) < 1.00000000000000004e121Initial program 59.6%
associate-*l*59.6%
*-commutative59.6%
associate-*l*59.6%
Simplified59.6%
unpow259.6%
unpow259.6%
difference-of-squares62.7%
Applied egg-rr62.7%
add-cbrt-cube62.4%
pow362.4%
Applied egg-rr62.4%
if 1.00000000000000004e121 < (/.f64 angle #s(literal 180 binary64)) < 5.00000000000000017e169Initial program 16.7%
unpow216.7%
unpow216.7%
difference-of-squares16.7%
Applied egg-rr16.7%
add-sqr-sqrt13.8%
sqrt-unprod54.0%
pow254.0%
div-inv54.5%
metadata-eval54.5%
Applied egg-rr54.5%
Taylor expanded in angle around inf 59.2%
*-commutative59.2%
*-commutative59.2%
associate-*r*59.1%
Simplified59.1%
if 5.00000000000000017e169 < (/.f64 angle #s(literal 180 binary64)) < 5.0000000000000003e230Initial program 50.0%
unpow250.0%
unpow250.0%
difference-of-squares50.0%
Applied egg-rr50.0%
Taylor expanded in angle around inf 50.0%
*-commutative50.0%
associate-*r*49.9%
Simplified49.9%
if 5.0000000000000003e230 < (/.f64 angle #s(literal 180 binary64)) Initial program 27.1%
associate-*l*27.1%
*-commutative27.1%
associate-*l*27.1%
Simplified27.1%
unpow227.1%
unpow227.1%
difference-of-squares32.7%
Applied egg-rr32.7%
Taylor expanded in angle around 0 40.8%
add-sqr-sqrt48.8%
pow248.8%
div-inv48.8%
metadata-eval48.8%
*-commutative48.8%
*-commutative48.8%
Applied egg-rr48.8%
Final simplification65.2%
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a b angle_m)
:precision binary64
(let* ((t_0 (cos (* (/ angle_m 180.0) PI)))
(t_1 (* PI (* angle_m 0.005555555555555556)))
(t_2 (* (+ a b) (- b a)))
(t_3 (* 2.0 t_2)))
(*
angle_s
(if (<= (/ angle_m 180.0) 1e-46)
(+
(* 0.011111111111111112 (* angle_m (* PI (pow b 2.0))))
(*
a
(+
(* -0.011111111111111112 (* a (* angle_m PI)))
(* 0.011111111111111112 (* angle_m (* PI (- b b)))))))
(if (<= (/ angle_m 180.0) 1e+121)
(* t_0 (* (sin (* (/ angle_m 180.0) (cbrt (pow PI 3.0)))) t_3))
(if (<= (/ angle_m 180.0) 5e+169)
(* (cos t_1) (* t_3 (sqrt (pow (sin t_1) 2.0))))
(if (<= (/ angle_m 180.0) 5e+230)
(* t_0 (* t_3 (sin (* angle_m (* PI 0.005555555555555556)))))
(* t_2 (* 2.0 (sin (pow (sqrt t_1) 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 = cos(((angle_m / 180.0) * ((double) M_PI)));
double t_1 = ((double) M_PI) * (angle_m * 0.005555555555555556);
double t_2 = (a + b) * (b - a);
double t_3 = 2.0 * t_2;
double tmp;
if ((angle_m / 180.0) <= 1e-46) {
tmp = (0.011111111111111112 * (angle_m * (((double) M_PI) * pow(b, 2.0)))) + (a * ((-0.011111111111111112 * (a * (angle_m * ((double) M_PI)))) + (0.011111111111111112 * (angle_m * (((double) M_PI) * (b - b))))));
} else if ((angle_m / 180.0) <= 1e+121) {
tmp = t_0 * (sin(((angle_m / 180.0) * cbrt(pow(((double) M_PI), 3.0)))) * t_3);
} else if ((angle_m / 180.0) <= 5e+169) {
tmp = cos(t_1) * (t_3 * sqrt(pow(sin(t_1), 2.0)));
} else if ((angle_m / 180.0) <= 5e+230) {
tmp = t_0 * (t_3 * sin((angle_m * (((double) M_PI) * 0.005555555555555556))));
} else {
tmp = t_2 * (2.0 * sin(pow(sqrt(t_1), 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.cos(((angle_m / 180.0) * Math.PI));
double t_1 = Math.PI * (angle_m * 0.005555555555555556);
double t_2 = (a + b) * (b - a);
double t_3 = 2.0 * t_2;
double tmp;
if ((angle_m / 180.0) <= 1e-46) {
tmp = (0.011111111111111112 * (angle_m * (Math.PI * Math.pow(b, 2.0)))) + (a * ((-0.011111111111111112 * (a * (angle_m * Math.PI))) + (0.011111111111111112 * (angle_m * (Math.PI * (b - b))))));
} else if ((angle_m / 180.0) <= 1e+121) {
tmp = t_0 * (Math.sin(((angle_m / 180.0) * Math.cbrt(Math.pow(Math.PI, 3.0)))) * t_3);
} else if ((angle_m / 180.0) <= 5e+169) {
tmp = Math.cos(t_1) * (t_3 * Math.sqrt(Math.pow(Math.sin(t_1), 2.0)));
} else if ((angle_m / 180.0) <= 5e+230) {
tmp = t_0 * (t_3 * Math.sin((angle_m * (Math.PI * 0.005555555555555556))));
} else {
tmp = t_2 * (2.0 * Math.sin(Math.pow(Math.sqrt(t_1), 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 = cos(Float64(Float64(angle_m / 180.0) * pi)) t_1 = Float64(pi * Float64(angle_m * 0.005555555555555556)) t_2 = Float64(Float64(a + b) * Float64(b - a)) t_3 = Float64(2.0 * t_2) tmp = 0.0 if (Float64(angle_m / 180.0) <= 1e-46) tmp = Float64(Float64(0.011111111111111112 * Float64(angle_m * Float64(pi * (b ^ 2.0)))) + Float64(a * Float64(Float64(-0.011111111111111112 * Float64(a * Float64(angle_m * pi))) + Float64(0.011111111111111112 * Float64(angle_m * Float64(pi * Float64(b - b))))))); elseif (Float64(angle_m / 180.0) <= 1e+121) tmp = Float64(t_0 * Float64(sin(Float64(Float64(angle_m / 180.0) * cbrt((pi ^ 3.0)))) * t_3)); elseif (Float64(angle_m / 180.0) <= 5e+169) tmp = Float64(cos(t_1) * Float64(t_3 * sqrt((sin(t_1) ^ 2.0)))); elseif (Float64(angle_m / 180.0) <= 5e+230) tmp = Float64(t_0 * Float64(t_3 * sin(Float64(angle_m * Float64(pi * 0.005555555555555556))))); else tmp = Float64(t_2 * Float64(2.0 * sin((sqrt(t_1) ^ 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[Cos[N[(N[(angle$95$m / 180.0), $MachinePrecision] * Pi), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(Pi * N[(angle$95$m * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(a + b), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(2.0 * t$95$2), $MachinePrecision]}, N[(angle$95$s * If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 1e-46], N[(N[(0.011111111111111112 * N[(angle$95$m * N[(Pi * N[Power[b, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(a * N[(N[(-0.011111111111111112 * N[(a * N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(0.011111111111111112 * N[(angle$95$m * N[(Pi * N[(b - b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 1e+121], N[(t$95$0 * N[(N[Sin[N[(N[(angle$95$m / 180.0), $MachinePrecision] * N[Power[N[Power[Pi, 3.0], $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * t$95$3), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 5e+169], N[(N[Cos[t$95$1], $MachinePrecision] * N[(t$95$3 * N[Sqrt[N[Power[N[Sin[t$95$1], $MachinePrecision], 2.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 5e+230], N[(t$95$0 * N[(t$95$3 * N[Sin[N[(angle$95$m * N[(Pi * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$2 * N[(2.0 * N[Sin[N[Power[N[Sqrt[t$95$1], $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 := \cos \left(\frac{angle\_m}{180} \cdot \pi\right)\\
t_1 := \pi \cdot \left(angle\_m \cdot 0.005555555555555556\right)\\
t_2 := \left(a + b\right) \cdot \left(b - a\right)\\
t_3 := 2 \cdot t\_2\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;\frac{angle\_m}{180} \leq 10^{-46}:\\
\;\;\;\;0.011111111111111112 \cdot \left(angle\_m \cdot \left(\pi \cdot {b}^{2}\right)\right) + a \cdot \left(-0.011111111111111112 \cdot \left(a \cdot \left(angle\_m \cdot \pi\right)\right) + 0.011111111111111112 \cdot \left(angle\_m \cdot \left(\pi \cdot \left(b - b\right)\right)\right)\right)\\
\mathbf{elif}\;\frac{angle\_m}{180} \leq 10^{+121}:\\
\;\;\;\;t\_0 \cdot \left(\sin \left(\frac{angle\_m}{180} \cdot \sqrt[3]{{\pi}^{3}}\right) \cdot t\_3\right)\\
\mathbf{elif}\;\frac{angle\_m}{180} \leq 5 \cdot 10^{+169}:\\
\;\;\;\;\cos t\_1 \cdot \left(t\_3 \cdot \sqrt{{\sin t\_1}^{2}}\right)\\
\mathbf{elif}\;\frac{angle\_m}{180} \leq 5 \cdot 10^{+230}:\\
\;\;\;\;t\_0 \cdot \left(t\_3 \cdot \sin \left(angle\_m \cdot \left(\pi \cdot 0.005555555555555556\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_2 \cdot \left(2 \cdot \sin \left({\left(\sqrt{t\_1}\right)}^{2}\right)\right)\\
\end{array}
\end{array}
\end{array}
if (/.f64 angle #s(literal 180 binary64)) < 1.00000000000000002e-46Initial program 63.7%
associate-*l*63.7%
*-commutative63.7%
associate-*l*63.7%
Simplified63.7%
unpow263.7%
unpow263.7%
difference-of-squares66.6%
Applied egg-rr66.6%
add-cbrt-cube68.8%
pow368.8%
Applied egg-rr68.8%
Taylor expanded in angle around 0 65.7%
Taylor expanded in a around 0 68.6%
if 1.00000000000000002e-46 < (/.f64 angle #s(literal 180 binary64)) < 1.00000000000000004e121Initial program 59.6%
unpow259.6%
unpow259.6%
difference-of-squares62.7%
Applied egg-rr62.7%
add-cbrt-cube62.4%
pow362.4%
Applied egg-rr62.4%
if 1.00000000000000004e121 < (/.f64 angle #s(literal 180 binary64)) < 5.00000000000000017e169Initial program 16.7%
unpow216.7%
unpow216.7%
difference-of-squares16.7%
Applied egg-rr16.7%
add-sqr-sqrt13.8%
sqrt-unprod54.0%
pow254.0%
div-inv54.5%
metadata-eval54.5%
Applied egg-rr54.5%
Taylor expanded in angle around inf 59.2%
*-commutative59.2%
*-commutative59.2%
associate-*r*59.1%
Simplified59.1%
if 5.00000000000000017e169 < (/.f64 angle #s(literal 180 binary64)) < 5.0000000000000003e230Initial program 50.0%
unpow250.0%
unpow250.0%
difference-of-squares50.0%
Applied egg-rr50.0%
Taylor expanded in angle around inf 50.0%
*-commutative50.0%
associate-*r*49.9%
Simplified49.9%
if 5.0000000000000003e230 < (/.f64 angle #s(literal 180 binary64)) Initial program 27.1%
associate-*l*27.1%
*-commutative27.1%
associate-*l*27.1%
Simplified27.1%
unpow227.1%
unpow227.1%
difference-of-squares32.7%
Applied egg-rr32.7%
Taylor expanded in angle around 0 40.8%
add-sqr-sqrt48.8%
pow248.8%
div-inv48.8%
metadata-eval48.8%
*-commutative48.8%
*-commutative48.8%
Applied egg-rr48.8%
Final simplification65.2%
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a b angle_m)
:precision binary64
(let* ((t_0 (cos (* (/ angle_m 180.0) PI)))
(t_1 (* (+ a b) (- b a)))
(t_2 (* 2.0 t_1))
(t_3 (sin (* (/ angle_m 180.0) (cbrt (pow PI 3.0)))))
(t_4 (* PI (* angle_m 0.005555555555555556))))
(*
angle_s
(if (<= (/ angle_m 180.0) 1e-46)
(+
(* 0.011111111111111112 (* angle_m (* PI (pow b 2.0))))
(*
a
(+
(* -0.011111111111111112 (* a (* angle_m PI)))
(* 0.011111111111111112 (* angle_m (* PI (- b b)))))))
(if (<= (/ angle_m 180.0) 1e+121)
(* t_0 (* t_3 t_2))
(if (<= (/ angle_m 180.0) 1e+165)
(* t_0 (* t_2 (fabs (sin t_4))))
(if (<= (/ angle_m 180.0) 1e+242)
(* t_1 (* 2.0 t_3))
(* t_1 (* 2.0 (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 = cos(((angle_m / 180.0) * ((double) M_PI)));
double t_1 = (a + b) * (b - a);
double t_2 = 2.0 * t_1;
double t_3 = sin(((angle_m / 180.0) * cbrt(pow(((double) M_PI), 3.0))));
double t_4 = ((double) M_PI) * (angle_m * 0.005555555555555556);
double tmp;
if ((angle_m / 180.0) <= 1e-46) {
tmp = (0.011111111111111112 * (angle_m * (((double) M_PI) * pow(b, 2.0)))) + (a * ((-0.011111111111111112 * (a * (angle_m * ((double) M_PI)))) + (0.011111111111111112 * (angle_m * (((double) M_PI) * (b - b))))));
} else if ((angle_m / 180.0) <= 1e+121) {
tmp = t_0 * (t_3 * t_2);
} else if ((angle_m / 180.0) <= 1e+165) {
tmp = t_0 * (t_2 * fabs(sin(t_4)));
} else if ((angle_m / 180.0) <= 1e+242) {
tmp = t_1 * (2.0 * t_3);
} else {
tmp = t_1 * (2.0 * 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 = Math.cos(((angle_m / 180.0) * Math.PI));
double t_1 = (a + b) * (b - a);
double t_2 = 2.0 * t_1;
double t_3 = Math.sin(((angle_m / 180.0) * Math.cbrt(Math.pow(Math.PI, 3.0))));
double t_4 = Math.PI * (angle_m * 0.005555555555555556);
double tmp;
if ((angle_m / 180.0) <= 1e-46) {
tmp = (0.011111111111111112 * (angle_m * (Math.PI * Math.pow(b, 2.0)))) + (a * ((-0.011111111111111112 * (a * (angle_m * Math.PI))) + (0.011111111111111112 * (angle_m * (Math.PI * (b - b))))));
} else if ((angle_m / 180.0) <= 1e+121) {
tmp = t_0 * (t_3 * t_2);
} else if ((angle_m / 180.0) <= 1e+165) {
tmp = t_0 * (t_2 * Math.abs(Math.sin(t_4)));
} else if ((angle_m / 180.0) <= 1e+242) {
tmp = t_1 * (2.0 * t_3);
} else {
tmp = t_1 * (2.0 * 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 = cos(Float64(Float64(angle_m / 180.0) * pi)) t_1 = Float64(Float64(a + b) * Float64(b - a)) t_2 = Float64(2.0 * t_1) t_3 = sin(Float64(Float64(angle_m / 180.0) * cbrt((pi ^ 3.0)))) t_4 = Float64(pi * Float64(angle_m * 0.005555555555555556)) tmp = 0.0 if (Float64(angle_m / 180.0) <= 1e-46) tmp = Float64(Float64(0.011111111111111112 * Float64(angle_m * Float64(pi * (b ^ 2.0)))) + Float64(a * Float64(Float64(-0.011111111111111112 * Float64(a * Float64(angle_m * pi))) + Float64(0.011111111111111112 * Float64(angle_m * Float64(pi * Float64(b - b))))))); elseif (Float64(angle_m / 180.0) <= 1e+121) tmp = Float64(t_0 * Float64(t_3 * t_2)); elseif (Float64(angle_m / 180.0) <= 1e+165) tmp = Float64(t_0 * Float64(t_2 * abs(sin(t_4)))); elseif (Float64(angle_m / 180.0) <= 1e+242) tmp = Float64(t_1 * Float64(2.0 * t_3)); else tmp = Float64(t_1 * Float64(2.0 * 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[Cos[N[(N[(angle$95$m / 180.0), $MachinePrecision] * 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[(N[(angle$95$m / 180.0), $MachinePrecision] * N[Power[N[Power[Pi, 3.0], $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$4 = N[(Pi * N[(angle$95$m * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]}, N[(angle$95$s * If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 1e-46], N[(N[(0.011111111111111112 * N[(angle$95$m * N[(Pi * N[Power[b, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(a * N[(N[(-0.011111111111111112 * N[(a * N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(0.011111111111111112 * N[(angle$95$m * N[(Pi * N[(b - b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 1e+121], N[(t$95$0 * N[(t$95$3 * t$95$2), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 1e+165], N[(t$95$0 * N[(t$95$2 * N[Abs[N[Sin[t$95$4], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 1e+242], N[(t$95$1 * N[(2.0 * t$95$3), $MachinePrecision]), $MachinePrecision], N[(t$95$1 * N[(2.0 * 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 := \cos \left(\frac{angle\_m}{180} \cdot \pi\right)\\
t_1 := \left(a + b\right) \cdot \left(b - a\right)\\
t_2 := 2 \cdot t\_1\\
t_3 := \sin \left(\frac{angle\_m}{180} \cdot \sqrt[3]{{\pi}^{3}}\right)\\
t_4 := \pi \cdot \left(angle\_m \cdot 0.005555555555555556\right)\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;\frac{angle\_m}{180} \leq 10^{-46}:\\
\;\;\;\;0.011111111111111112 \cdot \left(angle\_m \cdot \left(\pi \cdot {b}^{2}\right)\right) + a \cdot \left(-0.011111111111111112 \cdot \left(a \cdot \left(angle\_m \cdot \pi\right)\right) + 0.011111111111111112 \cdot \left(angle\_m \cdot \left(\pi \cdot \left(b - b\right)\right)\right)\right)\\
\mathbf{elif}\;\frac{angle\_m}{180} \leq 10^{+121}:\\
\;\;\;\;t\_0 \cdot \left(t\_3 \cdot t\_2\right)\\
\mathbf{elif}\;\frac{angle\_m}{180} \leq 10^{+165}:\\
\;\;\;\;t\_0 \cdot \left(t\_2 \cdot \left|\sin t\_4\right|\right)\\
\mathbf{elif}\;\frac{angle\_m}{180} \leq 10^{+242}:\\
\;\;\;\;t\_1 \cdot \left(2 \cdot t\_3\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1 \cdot \left(2 \cdot \sin \left({\left(\sqrt{t\_4}\right)}^{2}\right)\right)\\
\end{array}
\end{array}
\end{array}
if (/.f64 angle #s(literal 180 binary64)) < 1.00000000000000002e-46Initial program 63.7%
associate-*l*63.7%
*-commutative63.7%
associate-*l*63.7%
Simplified63.7%
unpow263.7%
unpow263.7%
difference-of-squares66.6%
Applied egg-rr66.6%
add-cbrt-cube68.8%
pow368.8%
Applied egg-rr68.8%
Taylor expanded in angle around 0 65.7%
Taylor expanded in a around 0 68.6%
if 1.00000000000000002e-46 < (/.f64 angle #s(literal 180 binary64)) < 1.00000000000000004e121Initial program 59.6%
unpow259.6%
unpow259.6%
difference-of-squares62.7%
Applied egg-rr62.7%
add-cbrt-cube62.4%
pow362.4%
Applied egg-rr62.4%
if 1.00000000000000004e121 < (/.f64 angle #s(literal 180 binary64)) < 9.99999999999999899e164Initial program 17.8%
unpow217.8%
unpow217.8%
difference-of-squares17.8%
Applied egg-rr17.8%
add-sqr-sqrt14.7%
sqrt-unprod57.6%
pow257.6%
div-inv58.1%
metadata-eval58.1%
Applied egg-rr58.1%
unpow258.1%
rem-sqrt-square58.1%
Applied egg-rr58.1%
if 9.99999999999999899e164 < (/.f64 angle #s(literal 180 binary64)) < 1.00000000000000005e242Initial program 36.0%
associate-*l*36.0%
*-commutative36.0%
associate-*l*36.0%
Simplified36.0%
unpow236.0%
unpow236.0%
difference-of-squares36.0%
Applied egg-rr36.0%
Taylor expanded in angle around 0 23.6%
add-cbrt-cube43.3%
pow343.3%
Applied egg-rr49.1%
if 1.00000000000000005e242 < (/.f64 angle #s(literal 180 binary64)) Initial program 31.3%
associate-*l*31.3%
*-commutative31.3%
associate-*l*31.3%
Simplified31.3%
unpow231.3%
unpow231.3%
difference-of-squares37.9%
Applied egg-rr37.9%
Taylor expanded in angle around 0 42.3%
add-sqr-sqrt50.8%
pow250.8%
div-inv50.8%
metadata-eval50.8%
*-commutative50.8%
*-commutative50.8%
Applied egg-rr50.8%
Final simplification65.2%
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a b angle_m)
:precision binary64
(let* ((t_0 (* (+ a b) (- b a)))
(t_1 (* (/ angle_m 180.0) PI))
(t_2 (* (* 2.0 t_0) (sin t_1))))
(*
angle_s
(if (<= (/ angle_m 180.0) 1e-73)
(+
(* 0.011111111111111112 (* angle_m (* PI (pow b 2.0))))
(*
a
(+
(* -0.011111111111111112 (* a (* angle_m PI)))
(* 0.011111111111111112 (* angle_m (* PI (- b b)))))))
(if (<= (/ angle_m 180.0) 1e+121)
(* t_2 (cos (* angle_m (* PI 0.005555555555555556))))
(if (<= (/ angle_m 180.0) 1e+164)
(* (cos t_1) (* 0.011111111111111112 (* angle_m (* PI t_0))))
(* (cos (* PI (* angle_m 0.005555555555555556))) 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 = (angle_m / 180.0) * ((double) M_PI);
double t_2 = (2.0 * t_0) * sin(t_1);
double tmp;
if ((angle_m / 180.0) <= 1e-73) {
tmp = (0.011111111111111112 * (angle_m * (((double) M_PI) * pow(b, 2.0)))) + (a * ((-0.011111111111111112 * (a * (angle_m * ((double) M_PI)))) + (0.011111111111111112 * (angle_m * (((double) M_PI) * (b - b))))));
} else if ((angle_m / 180.0) <= 1e+121) {
tmp = t_2 * cos((angle_m * (((double) M_PI) * 0.005555555555555556)));
} else if ((angle_m / 180.0) <= 1e+164) {
tmp = cos(t_1) * (0.011111111111111112 * (angle_m * (((double) M_PI) * t_0)));
} else {
tmp = cos((((double) M_PI) * (angle_m * 0.005555555555555556))) * 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 = (angle_m / 180.0) * Math.PI;
double t_2 = (2.0 * t_0) * Math.sin(t_1);
double tmp;
if ((angle_m / 180.0) <= 1e-73) {
tmp = (0.011111111111111112 * (angle_m * (Math.PI * Math.pow(b, 2.0)))) + (a * ((-0.011111111111111112 * (a * (angle_m * Math.PI))) + (0.011111111111111112 * (angle_m * (Math.PI * (b - b))))));
} else if ((angle_m / 180.0) <= 1e+121) {
tmp = t_2 * Math.cos((angle_m * (Math.PI * 0.005555555555555556)));
} else if ((angle_m / 180.0) <= 1e+164) {
tmp = Math.cos(t_1) * (0.011111111111111112 * (angle_m * (Math.PI * t_0)));
} else {
tmp = Math.cos((Math.PI * (angle_m * 0.005555555555555556))) * t_2;
}
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 = (angle_m / 180.0) * math.pi t_2 = (2.0 * t_0) * math.sin(t_1) tmp = 0 if (angle_m / 180.0) <= 1e-73: tmp = (0.011111111111111112 * (angle_m * (math.pi * math.pow(b, 2.0)))) + (a * ((-0.011111111111111112 * (a * (angle_m * math.pi))) + (0.011111111111111112 * (angle_m * (math.pi * (b - b)))))) elif (angle_m / 180.0) <= 1e+121: tmp = t_2 * math.cos((angle_m * (math.pi * 0.005555555555555556))) elif (angle_m / 180.0) <= 1e+164: tmp = math.cos(t_1) * (0.011111111111111112 * (angle_m * (math.pi * t_0))) else: tmp = math.cos((math.pi * (angle_m * 0.005555555555555556))) * 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 = Float64(Float64(angle_m / 180.0) * pi) t_2 = Float64(Float64(2.0 * t_0) * sin(t_1)) tmp = 0.0 if (Float64(angle_m / 180.0) <= 1e-73) tmp = Float64(Float64(0.011111111111111112 * Float64(angle_m * Float64(pi * (b ^ 2.0)))) + Float64(a * Float64(Float64(-0.011111111111111112 * Float64(a * Float64(angle_m * pi))) + Float64(0.011111111111111112 * Float64(angle_m * Float64(pi * Float64(b - b))))))); elseif (Float64(angle_m / 180.0) <= 1e+121) tmp = Float64(t_2 * cos(Float64(angle_m * Float64(pi * 0.005555555555555556)))); elseif (Float64(angle_m / 180.0) <= 1e+164) tmp = Float64(cos(t_1) * Float64(0.011111111111111112 * Float64(angle_m * Float64(pi * t_0)))); else tmp = Float64(cos(Float64(pi * Float64(angle_m * 0.005555555555555556))) * t_2); 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 = (angle_m / 180.0) * pi; t_2 = (2.0 * t_0) * sin(t_1); tmp = 0.0; if ((angle_m / 180.0) <= 1e-73) tmp = (0.011111111111111112 * (angle_m * (pi * (b ^ 2.0)))) + (a * ((-0.011111111111111112 * (a * (angle_m * pi))) + (0.011111111111111112 * (angle_m * (pi * (b - b)))))); elseif ((angle_m / 180.0) <= 1e+121) tmp = t_2 * cos((angle_m * (pi * 0.005555555555555556))); elseif ((angle_m / 180.0) <= 1e+164) tmp = cos(t_1) * (0.011111111111111112 * (angle_m * (pi * t_0))); else tmp = cos((pi * (angle_m * 0.005555555555555556))) * t_2; 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[(N[(angle$95$m / 180.0), $MachinePrecision] * Pi), $MachinePrecision]}, Block[{t$95$2 = N[(N[(2.0 * t$95$0), $MachinePrecision] * N[Sin[t$95$1], $MachinePrecision]), $MachinePrecision]}, N[(angle$95$s * If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 1e-73], N[(N[(0.011111111111111112 * N[(angle$95$m * N[(Pi * N[Power[b, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(a * N[(N[(-0.011111111111111112 * N[(a * N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(0.011111111111111112 * N[(angle$95$m * N[(Pi * N[(b - b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 1e+121], N[(t$95$2 * N[Cos[N[(angle$95$m * N[(Pi * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 1e+164], N[(N[Cos[t$95$1], $MachinePrecision] * N[(0.011111111111111112 * N[(angle$95$m * N[(Pi * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Cos[N[(Pi * N[(angle$95$m * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * 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 := \frac{angle\_m}{180} \cdot \pi\\
t_2 := \left(2 \cdot t\_0\right) \cdot \sin t\_1\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;\frac{angle\_m}{180} \leq 10^{-73}:\\
\;\;\;\;0.011111111111111112 \cdot \left(angle\_m \cdot \left(\pi \cdot {b}^{2}\right)\right) + a \cdot \left(-0.011111111111111112 \cdot \left(a \cdot \left(angle\_m \cdot \pi\right)\right) + 0.011111111111111112 \cdot \left(angle\_m \cdot \left(\pi \cdot \left(b - b\right)\right)\right)\right)\\
\mathbf{elif}\;\frac{angle\_m}{180} \leq 10^{+121}:\\
\;\;\;\;t\_2 \cdot \cos \left(angle\_m \cdot \left(\pi \cdot 0.005555555555555556\right)\right)\\
\mathbf{elif}\;\frac{angle\_m}{180} \leq 10^{+164}:\\
\;\;\;\;\cos t\_1 \cdot \left(0.011111111111111112 \cdot \left(angle\_m \cdot \left(\pi \cdot t\_0\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\cos \left(\pi \cdot \left(angle\_m \cdot 0.005555555555555556\right)\right) \cdot t\_2\\
\end{array}
\end{array}
\end{array}
if (/.f64 angle #s(literal 180 binary64)) < 9.99999999999999997e-74Initial program 62.5%
associate-*l*62.5%
*-commutative62.5%
associate-*l*62.5%
Simplified62.5%
unpow262.5%
unpow262.5%
difference-of-squares65.4%
Applied egg-rr65.4%
add-cbrt-cube67.7%
pow367.7%
Applied egg-rr67.7%
Taylor expanded in angle around 0 64.5%
Taylor expanded in a around 0 67.5%
if 9.99999999999999997e-74 < (/.f64 angle #s(literal 180 binary64)) < 1.00000000000000004e121Initial program 66.0%
unpow266.0%
unpow266.0%
difference-of-squares68.6%
Applied egg-rr68.6%
Taylor expanded in angle around inf 62.9%
*-commutative62.9%
associate-*r*65.3%
Simplified65.3%
if 1.00000000000000004e121 < (/.f64 angle #s(literal 180 binary64)) < 1e164Initial program 17.8%
unpow217.8%
unpow217.8%
difference-of-squares17.8%
Applied egg-rr17.8%
Taylor expanded in angle around 0 54.6%
if 1e164 < (/.f64 angle #s(literal 180 binary64)) Initial program 33.5%
unpow233.5%
unpow233.5%
difference-of-squares37.0%
Applied egg-rr37.0%
Taylor expanded in angle around inf 44.2%
*-commutative43.0%
*-commutative43.0%
associate-*r*36.5%
Simplified43.7%
Final simplification63.8%
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a b angle_m)
:precision binary64
(let* ((t_0 (* 0.005555555555555556 (* angle_m PI)))
(t_1 (* (+ a b) (- b a))))
(*
angle_s
(if (<= (pow b 2.0) 1e-12)
(* 2.0 (* t_1 (sin t_0)))
(* t_1 (* 2.0 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 = 0.005555555555555556 * (angle_m * ((double) M_PI));
double t_1 = (a + b) * (b - a);
double tmp;
if (pow(b, 2.0) <= 1e-12) {
tmp = 2.0 * (t_1 * sin(t_0));
} else {
tmp = t_1 * (2.0 * 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 = 0.005555555555555556 * (angle_m * Math.PI);
double t_1 = (a + b) * (b - a);
double tmp;
if (Math.pow(b, 2.0) <= 1e-12) {
tmp = 2.0 * (t_1 * Math.sin(t_0));
} else {
tmp = t_1 * (2.0 * 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 = 0.005555555555555556 * (angle_m * math.pi) t_1 = (a + b) * (b - a) tmp = 0 if math.pow(b, 2.0) <= 1e-12: tmp = 2.0 * (t_1 * math.sin(t_0)) else: tmp = t_1 * (2.0 * 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(0.005555555555555556 * Float64(angle_m * pi)) t_1 = Float64(Float64(a + b) * Float64(b - a)) tmp = 0.0 if ((b ^ 2.0) <= 1e-12) tmp = Float64(2.0 * Float64(t_1 * sin(t_0))); else tmp = Float64(t_1 * Float64(2.0 * 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 = 0.005555555555555556 * (angle_m * pi); t_1 = (a + b) * (b - a); tmp = 0.0; if ((b ^ 2.0) <= 1e-12) tmp = 2.0 * (t_1 * sin(t_0)); else tmp = t_1 * (2.0 * 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[(0.005555555555555556 * N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(a + b), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision]}, N[(angle$95$s * If[LessEqual[N[Power[b, 2.0], $MachinePrecision], 1e-12], N[(2.0 * N[(t$95$1 * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$1 * N[(2.0 * t$95$0), $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 := \left(a + b\right) \cdot \left(b - a\right)\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;{b}^{2} \leq 10^{-12}:\\
\;\;\;\;2 \cdot \left(t\_1 \cdot \sin t\_0\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1 \cdot \left(2 \cdot t\_0\right)\\
\end{array}
\end{array}
\end{array}
if (pow.f64 b #s(literal 2 binary64)) < 9.9999999999999998e-13Initial program 62.6%
associate-*l*62.6%
*-commutative62.6%
associate-*l*62.6%
Simplified62.6%
unpow262.6%
unpow262.6%
difference-of-squares62.6%
Applied egg-rr62.6%
Taylor expanded in angle around 0 63.4%
Taylor expanded in angle around inf 66.6%
if 9.9999999999999998e-13 < (pow.f64 b #s(literal 2 binary64)) Initial program 51.8%
associate-*l*51.8%
*-commutative51.8%
associate-*l*51.8%
Simplified51.8%
unpow251.8%
unpow251.8%
difference-of-squares57.4%
Applied egg-rr57.4%
Taylor expanded in angle around 0 56.7%
Taylor expanded in angle around 0 57.3%
Final simplification61.9%
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a b angle_m)
:precision binary64
(let* ((t_0 (* (+ a b) (- b a))))
(*
angle_s
(if (<= (/ angle_m 180.0) 1e-73)
(*
0.011111111111111112
(+
(* angle_m (* PI (pow b 2.0)))
(* a (- (* angle_m (* PI (- b b))) (* a (* angle_m PI))))))
(if (<= (/ angle_m 180.0) 4e+69)
(*
(cos (* (/ angle_m 180.0) PI))
(* 0.011111111111111112 (* angle_m (* PI t_0))))
(if (or (<= (/ angle_m 180.0) 2e+99)
(not (<= (/ angle_m 180.0) 3e+280)))
(+
-1.0
(+ 1.0 (* t_0 (sin (* (* angle_m PI) 0.011111111111111112)))))
(* 2.0 (* t_0 (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 t_0 = (a + b) * (b - a);
double tmp;
if ((angle_m / 180.0) <= 1e-73) {
tmp = 0.011111111111111112 * ((angle_m * (((double) M_PI) * pow(b, 2.0))) + (a * ((angle_m * (((double) M_PI) * (b - b))) - (a * (angle_m * ((double) M_PI))))));
} else if ((angle_m / 180.0) <= 4e+69) {
tmp = cos(((angle_m / 180.0) * ((double) M_PI))) * (0.011111111111111112 * (angle_m * (((double) M_PI) * t_0)));
} else if (((angle_m / 180.0) <= 2e+99) || !((angle_m / 180.0) <= 3e+280)) {
tmp = -1.0 + (1.0 + (t_0 * sin(((angle_m * ((double) M_PI)) * 0.011111111111111112))));
} else {
tmp = 2.0 * (t_0 * 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 t_0 = (a + b) * (b - a);
double tmp;
if ((angle_m / 180.0) <= 1e-73) {
tmp = 0.011111111111111112 * ((angle_m * (Math.PI * Math.pow(b, 2.0))) + (a * ((angle_m * (Math.PI * (b - b))) - (a * (angle_m * Math.PI)))));
} else if ((angle_m / 180.0) <= 4e+69) {
tmp = Math.cos(((angle_m / 180.0) * Math.PI)) * (0.011111111111111112 * (angle_m * (Math.PI * t_0)));
} else if (((angle_m / 180.0) <= 2e+99) || !((angle_m / 180.0) <= 3e+280)) {
tmp = -1.0 + (1.0 + (t_0 * Math.sin(((angle_m * Math.PI) * 0.011111111111111112))));
} else {
tmp = 2.0 * (t_0 * 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): t_0 = (a + b) * (b - a) tmp = 0 if (angle_m / 180.0) <= 1e-73: tmp = 0.011111111111111112 * ((angle_m * (math.pi * math.pow(b, 2.0))) + (a * ((angle_m * (math.pi * (b - b))) - (a * (angle_m * math.pi))))) elif (angle_m / 180.0) <= 4e+69: tmp = math.cos(((angle_m / 180.0) * math.pi)) * (0.011111111111111112 * (angle_m * (math.pi * t_0))) elif ((angle_m / 180.0) <= 2e+99) or not ((angle_m / 180.0) <= 3e+280): tmp = -1.0 + (1.0 + (t_0 * math.sin(((angle_m * math.pi) * 0.011111111111111112)))) else: tmp = 2.0 * (t_0 * 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) t_0 = Float64(Float64(a + b) * Float64(b - a)) tmp = 0.0 if (Float64(angle_m / 180.0) <= 1e-73) tmp = Float64(0.011111111111111112 * Float64(Float64(angle_m * Float64(pi * (b ^ 2.0))) + Float64(a * Float64(Float64(angle_m * Float64(pi * Float64(b - b))) - Float64(a * Float64(angle_m * pi)))))); elseif (Float64(angle_m / 180.0) <= 4e+69) tmp = Float64(cos(Float64(Float64(angle_m / 180.0) * pi)) * Float64(0.011111111111111112 * Float64(angle_m * Float64(pi * t_0)))); elseif ((Float64(angle_m / 180.0) <= 2e+99) || !(Float64(angle_m / 180.0) <= 3e+280)) tmp = Float64(-1.0 + Float64(1.0 + Float64(t_0 * sin(Float64(Float64(angle_m * pi) * 0.011111111111111112))))); else tmp = Float64(2.0 * Float64(t_0 * 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) t_0 = (a + b) * (b - a); tmp = 0.0; if ((angle_m / 180.0) <= 1e-73) tmp = 0.011111111111111112 * ((angle_m * (pi * (b ^ 2.0))) + (a * ((angle_m * (pi * (b - b))) - (a * (angle_m * pi))))); elseif ((angle_m / 180.0) <= 4e+69) tmp = cos(((angle_m / 180.0) * pi)) * (0.011111111111111112 * (angle_m * (pi * t_0))); elseif (((angle_m / 180.0) <= 2e+99) || ~(((angle_m / 180.0) <= 3e+280))) tmp = -1.0 + (1.0 + (t_0 * sin(((angle_m * pi) * 0.011111111111111112)))); else tmp = 2.0 * (t_0 * 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_] := Block[{t$95$0 = N[(N[(a + b), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision]}, N[(angle$95$s * If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 1e-73], N[(0.011111111111111112 * N[(N[(angle$95$m * N[(Pi * N[Power[b, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(a * N[(N[(angle$95$m * N[(Pi * N[(b - b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(a * N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 4e+69], N[(N[Cos[N[(N[(angle$95$m / 180.0), $MachinePrecision] * Pi), $MachinePrecision]], $MachinePrecision] * N[(0.011111111111111112 * N[(angle$95$m * N[(Pi * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 2e+99], N[Not[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 3e+280]], $MachinePrecision]], N[(-1.0 + N[(1.0 + N[(t$95$0 * N[Sin[N[(N[(angle$95$m * Pi), $MachinePrecision] * 0.011111111111111112), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(t$95$0 * N[Sin[N[(0.005555555555555556 * 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)\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;\frac{angle\_m}{180} \leq 10^{-73}:\\
\;\;\;\;0.011111111111111112 \cdot \left(angle\_m \cdot \left(\pi \cdot {b}^{2}\right) + a \cdot \left(angle\_m \cdot \left(\pi \cdot \left(b - b\right)\right) - a \cdot \left(angle\_m \cdot \pi\right)\right)\right)\\
\mathbf{elif}\;\frac{angle\_m}{180} \leq 4 \cdot 10^{+69}:\\
\;\;\;\;\cos \left(\frac{angle\_m}{180} \cdot \pi\right) \cdot \left(0.011111111111111112 \cdot \left(angle\_m \cdot \left(\pi \cdot t\_0\right)\right)\right)\\
\mathbf{elif}\;\frac{angle\_m}{180} \leq 2 \cdot 10^{+99} \lor \neg \left(\frac{angle\_m}{180} \leq 3 \cdot 10^{+280}\right):\\
\;\;\;\;-1 + \left(1 + t\_0 \cdot \sin \left(\left(angle\_m \cdot \pi\right) \cdot 0.011111111111111112\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(t\_0 \cdot \sin \left(0.005555555555555556 \cdot \left(angle\_m \cdot \pi\right)\right)\right)\\
\end{array}
\end{array}
\end{array}
if (/.f64 angle #s(literal 180 binary64)) < 9.99999999999999997e-74Initial program 62.5%
associate-*l*62.5%
*-commutative62.5%
associate-*l*62.5%
Simplified62.5%
unpow262.5%
unpow262.5%
difference-of-squares65.4%
Applied egg-rr65.4%
add-cbrt-cube67.7%
pow367.7%
Applied egg-rr67.7%
Taylor expanded in angle around 0 64.5%
Taylor expanded in a around 0 67.0%
if 9.99999999999999997e-74 < (/.f64 angle #s(literal 180 binary64)) < 4.0000000000000003e69Initial program 63.0%
unpow263.0%
unpow263.0%
difference-of-squares66.4%
Applied egg-rr66.4%
Taylor expanded in angle around 0 68.3%
if 4.0000000000000003e69 < (/.f64 angle #s(literal 180 binary64)) < 1.9999999999999999e99 or 3.0000000000000001e280 < (/.f64 angle #s(literal 180 binary64)) Initial program 52.8%
associate-*l*52.8%
*-commutative52.8%
associate-*l*52.8%
Simplified52.8%
unpow252.8%
unpow252.8%
difference-of-squares52.8%
Applied egg-rr52.8%
Applied egg-rr51.9%
unpow252.8%
unpow252.8%
difference-of-squares52.8%
Applied egg-rr51.9%
if 1.9999999999999999e99 < (/.f64 angle #s(literal 180 binary64)) < 3.0000000000000001e280Initial program 30.5%
associate-*l*30.5%
*-commutative30.5%
associate-*l*30.5%
Simplified30.5%
unpow230.5%
unpow230.5%
difference-of-squares33.0%
Applied egg-rr33.0%
Taylor expanded in angle around 0 36.4%
Taylor expanded in angle around inf 43.8%
Final simplification62.9%
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a b angle_m)
:precision binary64
(let* ((t_0 (* 0.005555555555555556 (* angle_m PI)))
(t_1 (* (+ a b) (- b a)))
(t_2 (* (/ angle_m 180.0) PI)))
(*
angle_s
(if (<= b 5.2e-6)
(* 2.0 (* t_1 (sin t_0)))
(if (<= b 4e+201)
(* t_1 (* 2.0 (* (cos t_2) t_0)))
(* t_1 (* 2.0 (sin 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 = 0.005555555555555556 * (angle_m * ((double) M_PI));
double t_1 = (a + b) * (b - a);
double t_2 = (angle_m / 180.0) * ((double) M_PI);
double tmp;
if (b <= 5.2e-6) {
tmp = 2.0 * (t_1 * sin(t_0));
} else if (b <= 4e+201) {
tmp = t_1 * (2.0 * (cos(t_2) * t_0));
} else {
tmp = t_1 * (2.0 * sin(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 = 0.005555555555555556 * (angle_m * Math.PI);
double t_1 = (a + b) * (b - a);
double t_2 = (angle_m / 180.0) * Math.PI;
double tmp;
if (b <= 5.2e-6) {
tmp = 2.0 * (t_1 * Math.sin(t_0));
} else if (b <= 4e+201) {
tmp = t_1 * (2.0 * (Math.cos(t_2) * t_0));
} else {
tmp = t_1 * (2.0 * Math.sin(t_2));
}
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 = (a + b) * (b - a) t_2 = (angle_m / 180.0) * math.pi tmp = 0 if b <= 5.2e-6: tmp = 2.0 * (t_1 * math.sin(t_0)) elif b <= 4e+201: tmp = t_1 * (2.0 * (math.cos(t_2) * t_0)) else: tmp = t_1 * (2.0 * math.sin(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(0.005555555555555556 * Float64(angle_m * pi)) t_1 = Float64(Float64(a + b) * Float64(b - a)) t_2 = Float64(Float64(angle_m / 180.0) * pi) tmp = 0.0 if (b <= 5.2e-6) tmp = Float64(2.0 * Float64(t_1 * sin(t_0))); elseif (b <= 4e+201) tmp = Float64(t_1 * Float64(2.0 * Float64(cos(t_2) * t_0))); else tmp = Float64(t_1 * Float64(2.0 * sin(t_2))); 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 = (a + b) * (b - a); t_2 = (angle_m / 180.0) * pi; tmp = 0.0; if (b <= 5.2e-6) tmp = 2.0 * (t_1 * sin(t_0)); elseif (b <= 4e+201) tmp = t_1 * (2.0 * (cos(t_2) * t_0)); else tmp = t_1 * (2.0 * sin(t_2)); 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[(a + b), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(angle$95$m / 180.0), $MachinePrecision] * Pi), $MachinePrecision]}, N[(angle$95$s * If[LessEqual[b, 5.2e-6], N[(2.0 * N[(t$95$1 * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 4e+201], N[(t$95$1 * N[(2.0 * N[(N[Cos[t$95$2], $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$1 * N[(2.0 * N[Sin[t$95$2], $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 := \left(a + b\right) \cdot \left(b - a\right)\\
t_2 := \frac{angle\_m}{180} \cdot \pi\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;b \leq 5.2 \cdot 10^{-6}:\\
\;\;\;\;2 \cdot \left(t\_1 \cdot \sin t\_0\right)\\
\mathbf{elif}\;b \leq 4 \cdot 10^{+201}:\\
\;\;\;\;t\_1 \cdot \left(2 \cdot \left(\cos t\_2 \cdot t\_0\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1 \cdot \left(2 \cdot \sin t\_2\right)\\
\end{array}
\end{array}
\end{array}
if b < 5.20000000000000019e-6Initial program 59.2%
associate-*l*59.2%
*-commutative59.2%
associate-*l*59.2%
Simplified59.2%
unpow259.2%
unpow259.2%
difference-of-squares60.8%
Applied egg-rr60.8%
Taylor expanded in angle around 0 60.9%
Taylor expanded in angle around inf 61.2%
if 5.20000000000000019e-6 < b < 4.00000000000000015e201Initial program 54.5%
associate-*l*54.5%
*-commutative54.5%
associate-*l*54.5%
Simplified54.5%
unpow254.5%
unpow254.5%
difference-of-squares57.7%
Applied egg-rr57.7%
Taylor expanded in angle around 0 55.7%
if 4.00000000000000015e201 < b Initial program 45.7%
associate-*l*45.7%
*-commutative45.7%
associate-*l*45.7%
Simplified45.7%
unpow245.7%
unpow245.7%
difference-of-squares57.4%
Applied egg-rr57.4%
Taylor expanded in angle around 0 64.8%
Final simplification60.9%
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a b angle_m)
:precision binary64
(let* ((t_0 (* (+ a b) (- b a))))
(*
angle_s
(if (<= (/ angle_m 180.0) 1e+66)
(*
0.011111111111111112
(- (* b (* angle_m (* PI b))) (* (pow a 2.0) (* angle_m PI))))
(if (<= (/ angle_m 180.0) 3e+280)
(* 2.0 (* t_0 (sin (* 0.005555555555555556 (* angle_m PI)))))
(+
-1.0
(+ 1.0 (* t_0 (sin (* (* angle_m PI) 0.011111111111111112))))))))))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 tmp;
if ((angle_m / 180.0) <= 1e+66) {
tmp = 0.011111111111111112 * ((b * (angle_m * (((double) M_PI) * b))) - (pow(a, 2.0) * (angle_m * ((double) M_PI))));
} else if ((angle_m / 180.0) <= 3e+280) {
tmp = 2.0 * (t_0 * sin((0.005555555555555556 * (angle_m * ((double) M_PI)))));
} else {
tmp = -1.0 + (1.0 + (t_0 * sin(((angle_m * ((double) M_PI)) * 0.011111111111111112))));
}
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 tmp;
if ((angle_m / 180.0) <= 1e+66) {
tmp = 0.011111111111111112 * ((b * (angle_m * (Math.PI * b))) - (Math.pow(a, 2.0) * (angle_m * Math.PI)));
} else if ((angle_m / 180.0) <= 3e+280) {
tmp = 2.0 * (t_0 * Math.sin((0.005555555555555556 * (angle_m * Math.PI))));
} else {
tmp = -1.0 + (1.0 + (t_0 * Math.sin(((angle_m * Math.PI) * 0.011111111111111112))));
}
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) tmp = 0 if (angle_m / 180.0) <= 1e+66: tmp = 0.011111111111111112 * ((b * (angle_m * (math.pi * b))) - (math.pow(a, 2.0) * (angle_m * math.pi))) elif (angle_m / 180.0) <= 3e+280: tmp = 2.0 * (t_0 * math.sin((0.005555555555555556 * (angle_m * math.pi)))) else: tmp = -1.0 + (1.0 + (t_0 * math.sin(((angle_m * math.pi) * 0.011111111111111112)))) 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)) tmp = 0.0 if (Float64(angle_m / 180.0) <= 1e+66) tmp = Float64(0.011111111111111112 * Float64(Float64(b * Float64(angle_m * Float64(pi * b))) - Float64((a ^ 2.0) * Float64(angle_m * pi)))); elseif (Float64(angle_m / 180.0) <= 3e+280) tmp = Float64(2.0 * Float64(t_0 * sin(Float64(0.005555555555555556 * Float64(angle_m * pi))))); else tmp = Float64(-1.0 + Float64(1.0 + Float64(t_0 * sin(Float64(Float64(angle_m * pi) * 0.011111111111111112))))); 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); tmp = 0.0; if ((angle_m / 180.0) <= 1e+66) tmp = 0.011111111111111112 * ((b * (angle_m * (pi * b))) - ((a ^ 2.0) * (angle_m * pi))); elseif ((angle_m / 180.0) <= 3e+280) tmp = 2.0 * (t_0 * sin((0.005555555555555556 * (angle_m * pi)))); else tmp = -1.0 + (1.0 + (t_0 * sin(((angle_m * pi) * 0.011111111111111112)))); 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]}, N[(angle$95$s * If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 1e+66], N[(0.011111111111111112 * N[(N[(b * N[(angle$95$m * N[(Pi * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[Power[a, 2.0], $MachinePrecision] * N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 3e+280], N[(2.0 * N[(t$95$0 * N[Sin[N[(0.005555555555555556 * N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-1.0 + N[(1.0 + N[(t$95$0 * N[Sin[N[(N[(angle$95$m * Pi), $MachinePrecision] * 0.011111111111111112), $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)\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;\frac{angle\_m}{180} \leq 10^{+66}:\\
\;\;\;\;0.011111111111111112 \cdot \left(b \cdot \left(angle\_m \cdot \left(\pi \cdot b\right)\right) - {a}^{2} \cdot \left(angle\_m \cdot \pi\right)\right)\\
\mathbf{elif}\;\frac{angle\_m}{180} \leq 3 \cdot 10^{+280}:\\
\;\;\;\;2 \cdot \left(t\_0 \cdot \sin \left(0.005555555555555556 \cdot \left(angle\_m \cdot \pi\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;-1 + \left(1 + t\_0 \cdot \sin \left(\left(angle\_m \cdot \pi\right) \cdot 0.011111111111111112\right)\right)\\
\end{array}
\end{array}
\end{array}
if (/.f64 angle #s(literal 180 binary64)) < 9.99999999999999945e65Initial program 62.5%
associate-*l*62.5%
*-commutative62.5%
associate-*l*62.5%
Simplified62.5%
unpow262.5%
unpow262.5%
difference-of-squares65.6%
Applied egg-rr65.6%
add-cbrt-cube67.9%
pow367.9%
Applied egg-rr67.9%
Taylor expanded in angle around 0 64.6%
Taylor expanded in b around 0 65.2%
+-commutative65.2%
mul-1-neg65.2%
unsub-neg65.2%
distribute-lft-out65.2%
*-commutative65.2%
distribute-rgt1-in65.2%
metadata-eval65.2%
mul0-lft65.2%
distribute-rgt-out65.2%
*-commutative65.2%
Simplified65.2%
if 9.99999999999999945e65 < (/.f64 angle #s(literal 180 binary64)) < 3.0000000000000001e280Initial program 34.6%
associate-*l*34.6%
*-commutative34.6%
associate-*l*34.6%
Simplified34.6%
unpow234.6%
unpow234.6%
difference-of-squares37.0%
Applied egg-rr37.0%
Taylor expanded in angle around 0 38.2%
Taylor expanded in angle around inf 44.8%
if 3.0000000000000001e280 < (/.f64 angle #s(literal 180 binary64)) Initial program 41.6%
associate-*l*41.6%
*-commutative41.6%
associate-*l*41.6%
Simplified41.6%
unpow241.6%
unpow241.6%
difference-of-squares41.6%
Applied egg-rr41.6%
Applied egg-rr40.4%
unpow241.6%
unpow241.6%
difference-of-squares41.6%
Applied egg-rr40.4%
Final simplification61.0%
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a b angle_m)
:precision binary64
(let* ((t_0 (* (/ angle_m 180.0) PI)) (t_1 (* (+ a b) (- b a))))
(*
angle_s
(if (<= b 2.75e-5)
(* 2.0 (* t_1 (sin (* 0.005555555555555556 (* angle_m PI)))))
(if (<= b 2.5e+202)
(* (cos t_0) (* 0.011111111111111112 (* angle_m (* PI t_1))))
(* t_1 (* 2.0 (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 = (a + b) * (b - a);
double tmp;
if (b <= 2.75e-5) {
tmp = 2.0 * (t_1 * sin((0.005555555555555556 * (angle_m * ((double) M_PI)))));
} else if (b <= 2.5e+202) {
tmp = cos(t_0) * (0.011111111111111112 * (angle_m * (((double) M_PI) * t_1)));
} else {
tmp = t_1 * (2.0 * 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 = (a + b) * (b - a);
double tmp;
if (b <= 2.75e-5) {
tmp = 2.0 * (t_1 * Math.sin((0.005555555555555556 * (angle_m * Math.PI))));
} else if (b <= 2.5e+202) {
tmp = Math.cos(t_0) * (0.011111111111111112 * (angle_m * (Math.PI * t_1)));
} else {
tmp = t_1 * (2.0 * 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 = (a + b) * (b - a) tmp = 0 if b <= 2.75e-5: tmp = 2.0 * (t_1 * math.sin((0.005555555555555556 * (angle_m * math.pi)))) elif b <= 2.5e+202: tmp = math.cos(t_0) * (0.011111111111111112 * (angle_m * (math.pi * t_1))) else: tmp = t_1 * (2.0 * 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 = Float64(Float64(a + b) * Float64(b - a)) tmp = 0.0 if (b <= 2.75e-5) tmp = Float64(2.0 * Float64(t_1 * sin(Float64(0.005555555555555556 * Float64(angle_m * pi))))); elseif (b <= 2.5e+202) tmp = Float64(cos(t_0) * Float64(0.011111111111111112 * Float64(angle_m * Float64(pi * t_1)))); else tmp = Float64(t_1 * Float64(2.0 * 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 = (a + b) * (b - a); tmp = 0.0; if (b <= 2.75e-5) tmp = 2.0 * (t_1 * sin((0.005555555555555556 * (angle_m * pi)))); elseif (b <= 2.5e+202) tmp = cos(t_0) * (0.011111111111111112 * (angle_m * (pi * t_1))); else tmp = t_1 * (2.0 * 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[(N[(a + b), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision]}, N[(angle$95$s * If[LessEqual[b, 2.75e-5], N[(2.0 * N[(t$95$1 * N[Sin[N[(0.005555555555555556 * N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 2.5e+202], N[(N[Cos[t$95$0], $MachinePrecision] * N[(0.011111111111111112 * N[(angle$95$m * N[(Pi * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$1 * N[(2.0 * 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 := \frac{angle\_m}{180} \cdot \pi\\
t_1 := \left(a + b\right) \cdot \left(b - a\right)\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;b \leq 2.75 \cdot 10^{-5}:\\
\;\;\;\;2 \cdot \left(t\_1 \cdot \sin \left(0.005555555555555556 \cdot \left(angle\_m \cdot \pi\right)\right)\right)\\
\mathbf{elif}\;b \leq 2.5 \cdot 10^{+202}:\\
\;\;\;\;\cos t\_0 \cdot \left(0.011111111111111112 \cdot \left(angle\_m \cdot \left(\pi \cdot t\_1\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1 \cdot \left(2 \cdot \sin t\_0\right)\\
\end{array}
\end{array}
\end{array}
if b < 2.7500000000000001e-5Initial program 59.2%
associate-*l*59.2%
*-commutative59.2%
associate-*l*59.2%
Simplified59.2%
unpow259.2%
unpow259.2%
difference-of-squares60.8%
Applied egg-rr60.8%
Taylor expanded in angle around 0 60.9%
Taylor expanded in angle around inf 61.2%
if 2.7500000000000001e-5 < b < 2.5e202Initial program 54.5%
unpow254.5%
unpow254.5%
difference-of-squares57.7%
Applied egg-rr57.7%
Taylor expanded in angle around 0 55.6%
if 2.5e202 < b Initial program 45.7%
associate-*l*45.7%
*-commutative45.7%
associate-*l*45.7%
Simplified45.7%
unpow245.7%
unpow245.7%
difference-of-squares57.4%
Applied egg-rr57.4%
Taylor expanded in angle around 0 64.8%
Final simplification60.9%
angle\_m = (fabs.f64 angle) angle\_s = (copysign.f64 #s(literal 1 binary64) angle) (FPCore (angle_s a b angle_m) :precision binary64 (* angle_s (* (* (+ a b) (- b a)) (* 2.0 (* angle_m (* PI 0.005555555555555556))))))
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 * (((a + b) * (b - a)) * (2.0 * (angle_m * (((double) M_PI) * 0.005555555555555556))));
}
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 * (((a + b) * (b - a)) * (2.0 * (angle_m * (Math.PI * 0.005555555555555556))));
}
angle\_m = math.fabs(angle) angle\_s = math.copysign(1.0, angle) def code(angle_s, a, b, angle_m): return angle_s * (((a + b) * (b - a)) * (2.0 * (angle_m * (math.pi * 0.005555555555555556))))
angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a, b, angle_m) return Float64(angle_s * Float64(Float64(Float64(a + b) * Float64(b - a)) * Float64(2.0 * Float64(angle_m * Float64(pi * 0.005555555555555556))))) end
angle\_m = abs(angle); angle\_s = sign(angle) * abs(1.0); function tmp = code(angle_s, a, b, angle_m) tmp = angle_s * (((a + b) * (b - a)) * (2.0 * (angle_m * (pi * 0.005555555555555556)))); 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[(N[(N[(a + b), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision] * N[(2.0 * N[(angle$95$m * N[(Pi * 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 \left(\left(\left(a + b\right) \cdot \left(b - a\right)\right) \cdot \left(2 \cdot \left(angle\_m \cdot \left(\pi \cdot 0.005555555555555556\right)\right)\right)\right)
\end{array}
Initial program 57.2%
associate-*l*57.2%
*-commutative57.2%
associate-*l*57.2%
Simplified57.2%
unpow257.2%
unpow257.2%
difference-of-squares60.0%
Applied egg-rr60.0%
Taylor expanded in angle around 0 60.1%
Taylor expanded in angle around 0 59.3%
*-commutative59.3%
associate-*r*59.3%
Simplified59.3%
Final simplification59.3%
angle\_m = (fabs.f64 angle) angle\_s = (copysign.f64 #s(literal 1 binary64) 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 57.2%
associate-*l*57.2%
*-commutative57.2%
associate-*l*57.2%
Simplified57.2%
unpow257.2%
unpow257.2%
difference-of-squares60.0%
Applied egg-rr60.0%
add-cbrt-cube63.2%
pow363.2%
Applied egg-rr63.2%
Taylor expanded in angle around 0 59.3%
herbie shell --seed 2024106
(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)))))