
(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 15 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (a b angle) :precision binary64 (let* ((t_0 (* PI (/ angle 180.0)))) (* (* (* 2.0 (- (pow b 2.0) (pow a 2.0))) (sin t_0)) (cos t_0))))
double code(double a, double b, double angle) {
double t_0 = ((double) M_PI) * (angle / 180.0);
return ((2.0 * (pow(b, 2.0) - pow(a, 2.0))) * sin(t_0)) * cos(t_0);
}
public static double code(double a, double b, double angle) {
double t_0 = Math.PI * (angle / 180.0);
return ((2.0 * (Math.pow(b, 2.0) - Math.pow(a, 2.0))) * Math.sin(t_0)) * Math.cos(t_0);
}
def code(a, b, angle): t_0 = math.pi * (angle / 180.0) return ((2.0 * (math.pow(b, 2.0) - math.pow(a, 2.0))) * math.sin(t_0)) * math.cos(t_0)
function code(a, b, angle) t_0 = Float64(pi * Float64(angle / 180.0)) return Float64(Float64(Float64(2.0 * Float64((b ^ 2.0) - (a ^ 2.0))) * sin(t_0)) * cos(t_0)) end
function tmp = code(a, b, angle) t_0 = pi * (angle / 180.0); tmp = ((2.0 * ((b ^ 2.0) - (a ^ 2.0))) * sin(t_0)) * cos(t_0); end
code[a_, b_, angle_] := Block[{t$95$0 = N[(Pi * N[(angle / 180.0), $MachinePrecision]), $MachinePrecision]}, N[(N[(N[(2.0 * N[(N[Power[b, 2.0], $MachinePrecision] - N[Power[a, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision] * N[Cos[t$95$0], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \pi \cdot \frac{angle}{180}\\
\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin t\_0\right) \cdot \cos t\_0
\end{array}
\end{array}
b_m = (fabs.f64 b)
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a b_m angle_m)
:precision binary64
(let* ((t_0 (* (/ angle_m 180.0) PI))
(t_1 (* (+ a b_m) (- b_m a)))
(t_2 (cbrt (+ a b_m))))
(*
angle_s
(if (<= (/ angle_m 180.0) 1e+29)
(pow
(*
t_2
(cbrt (* (- b_m a) (sin (* PI (* angle_m 0.011111111111111112))))))
3.0)
(if (<= (/ angle_m 180.0) 1e+141)
(*
(* 2.0 (* (sin t_0) (cos (* (/ angle_m 180.0) (cbrt (pow PI 3.0))))))
t_1)
(if (<= (/ angle_m 180.0) 1e+176)
(pow
(*
t_2
(fabs
(cbrt
(* (- b_m a) (sin (* 0.011111111111111112 (* angle_m PI)))))))
3.0)
(*
(*
2.0
(* (sin (* (/ angle_m 180.0) (pow (sqrt PI) 2.0))) (cos t_0)))
t_1)))))))b_m = fabs(b);
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a, double b_m, double angle_m) {
double t_0 = (angle_m / 180.0) * ((double) M_PI);
double t_1 = (a + b_m) * (b_m - a);
double t_2 = cbrt((a + b_m));
double tmp;
if ((angle_m / 180.0) <= 1e+29) {
tmp = pow((t_2 * cbrt(((b_m - a) * sin((((double) M_PI) * (angle_m * 0.011111111111111112)))))), 3.0);
} else if ((angle_m / 180.0) <= 1e+141) {
tmp = (2.0 * (sin(t_0) * cos(((angle_m / 180.0) * cbrt(pow(((double) M_PI), 3.0)))))) * t_1;
} else if ((angle_m / 180.0) <= 1e+176) {
tmp = pow((t_2 * fabs(cbrt(((b_m - a) * sin((0.011111111111111112 * (angle_m * ((double) M_PI)))))))), 3.0);
} else {
tmp = (2.0 * (sin(((angle_m / 180.0) * pow(sqrt(((double) M_PI)), 2.0))) * cos(t_0))) * t_1;
}
return angle_s * tmp;
}
b_m = Math.abs(b);
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b_m, double angle_m) {
double t_0 = (angle_m / 180.0) * Math.PI;
double t_1 = (a + b_m) * (b_m - a);
double t_2 = Math.cbrt((a + b_m));
double tmp;
if ((angle_m / 180.0) <= 1e+29) {
tmp = Math.pow((t_2 * Math.cbrt(((b_m - a) * Math.sin((Math.PI * (angle_m * 0.011111111111111112)))))), 3.0);
} else if ((angle_m / 180.0) <= 1e+141) {
tmp = (2.0 * (Math.sin(t_0) * Math.cos(((angle_m / 180.0) * Math.cbrt(Math.pow(Math.PI, 3.0)))))) * t_1;
} else if ((angle_m / 180.0) <= 1e+176) {
tmp = Math.pow((t_2 * Math.abs(Math.cbrt(((b_m - a) * Math.sin((0.011111111111111112 * (angle_m * Math.PI))))))), 3.0);
} else {
tmp = (2.0 * (Math.sin(((angle_m / 180.0) * Math.pow(Math.sqrt(Math.PI), 2.0))) * Math.cos(t_0))) * t_1;
}
return angle_s * tmp;
}
b_m = abs(b) angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a, b_m, angle_m) t_0 = Float64(Float64(angle_m / 180.0) * pi) t_1 = Float64(Float64(a + b_m) * Float64(b_m - a)) t_2 = cbrt(Float64(a + b_m)) tmp = 0.0 if (Float64(angle_m / 180.0) <= 1e+29) tmp = Float64(t_2 * cbrt(Float64(Float64(b_m - a) * sin(Float64(pi * Float64(angle_m * 0.011111111111111112)))))) ^ 3.0; elseif (Float64(angle_m / 180.0) <= 1e+141) tmp = Float64(Float64(2.0 * Float64(sin(t_0) * cos(Float64(Float64(angle_m / 180.0) * cbrt((pi ^ 3.0)))))) * t_1); elseif (Float64(angle_m / 180.0) <= 1e+176) tmp = Float64(t_2 * abs(cbrt(Float64(Float64(b_m - a) * sin(Float64(0.011111111111111112 * Float64(angle_m * pi))))))) ^ 3.0; else tmp = Float64(Float64(2.0 * Float64(sin(Float64(Float64(angle_m / 180.0) * (sqrt(pi) ^ 2.0))) * cos(t_0))) * t_1); end return Float64(angle_s * tmp) end
b_m = N[Abs[b], $MachinePrecision]
angle\_m = N[Abs[angle], $MachinePrecision]
angle\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a_, b$95$m_, angle$95$m_] := Block[{t$95$0 = N[(N[(angle$95$m / 180.0), $MachinePrecision] * Pi), $MachinePrecision]}, Block[{t$95$1 = N[(N[(a + b$95$m), $MachinePrecision] * N[(b$95$m - a), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Power[N[(a + b$95$m), $MachinePrecision], 1/3], $MachinePrecision]}, N[(angle$95$s * If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 1e+29], N[Power[N[(t$95$2 * N[Power[N[(N[(b$95$m - a), $MachinePrecision] * N[Sin[N[(Pi * N[(angle$95$m * 0.011111111111111112), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision], 3.0], $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 1e+141], N[(N[(2.0 * N[(N[Sin[t$95$0], $MachinePrecision] * N[Cos[N[(N[(angle$95$m / 180.0), $MachinePrecision] * N[Power[N[Power[Pi, 3.0], $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 1e+176], N[Power[N[(t$95$2 * N[Abs[N[Power[N[(N[(b$95$m - a), $MachinePrecision] * N[Sin[N[(0.011111111111111112 * N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 3.0], $MachinePrecision], N[(N[(2.0 * N[(N[Sin[N[(N[(angle$95$m / 180.0), $MachinePrecision] * N[Power[N[Sqrt[Pi], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Cos[t$95$0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision]]]]), $MachinePrecision]]]]
\begin{array}{l}
b_m = \left|b\right|
\\
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
\begin{array}{l}
t_0 := \frac{angle\_m}{180} \cdot \pi\\
t_1 := \left(a + b\_m\right) \cdot \left(b\_m - a\right)\\
t_2 := \sqrt[3]{a + b\_m}\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;\frac{angle\_m}{180} \leq 10^{+29}:\\
\;\;\;\;{\left(t\_2 \cdot \sqrt[3]{\left(b\_m - a\right) \cdot \sin \left(\pi \cdot \left(angle\_m \cdot 0.011111111111111112\right)\right)}\right)}^{3}\\
\mathbf{elif}\;\frac{angle\_m}{180} \leq 10^{+141}:\\
\;\;\;\;\left(2 \cdot \left(\sin t\_0 \cdot \cos \left(\frac{angle\_m}{180} \cdot \sqrt[3]{{\pi}^{3}}\right)\right)\right) \cdot t\_1\\
\mathbf{elif}\;\frac{angle\_m}{180} \leq 10^{+176}:\\
\;\;\;\;{\left(t\_2 \cdot \left|\sqrt[3]{\left(b\_m - a\right) \cdot \sin \left(0.011111111111111112 \cdot \left(angle\_m \cdot \pi\right)\right)}\right|\right)}^{3}\\
\mathbf{else}:\\
\;\;\;\;\left(2 \cdot \left(\sin \left(\frac{angle\_m}{180} \cdot {\left(\sqrt{\pi}\right)}^{2}\right) \cdot \cos t\_0\right)\right) \cdot t\_1\\
\end{array}
\end{array}
\end{array}
if (/.f64 angle #s(literal 180 binary64)) < 9.99999999999999914e28Initial program 68.8%
associate-*l*68.8%
*-commutative68.8%
associate-*l*68.8%
Simplified68.8%
add-cube-cbrt68.3%
pow368.3%
2-sin68.3%
associate-*r*68.4%
div-inv68.6%
metadata-eval68.6%
Applied egg-rr68.6%
Applied egg-rr81.1%
+-commutative81.1%
associate-*l*81.5%
Simplified81.5%
if 9.99999999999999914e28 < (/.f64 angle #s(literal 180 binary64)) < 1.00000000000000002e141Initial program 24.1%
associate-*l*24.1%
*-commutative24.1%
associate-*l*24.1%
Simplified24.1%
unpow224.1%
unpow224.1%
difference-of-squares28.7%
Applied egg-rr28.7%
add-cbrt-cube47.9%
pow347.9%
Applied egg-rr47.9%
if 1.00000000000000002e141 < (/.f64 angle #s(literal 180 binary64)) < 1e176Initial program 18.1%
associate-*l*18.1%
*-commutative18.1%
associate-*l*18.1%
Simplified18.1%
add-cube-cbrt18.1%
pow318.1%
2-sin18.1%
associate-*r*18.1%
div-inv18.1%
metadata-eval18.1%
Applied egg-rr18.1%
Applied egg-rr21.6%
+-commutative21.6%
associate-*l*18.1%
Simplified18.1%
add-sqr-sqrt5.4%
sqrt-unprod34.7%
pow234.7%
Applied egg-rr34.7%
unpow234.7%
rem-sqrt-square34.7%
*-commutative34.7%
*-commutative34.7%
*-commutative34.7%
associate-*r*37.1%
Simplified37.1%
if 1e176 < (/.f64 angle #s(literal 180 binary64)) Initial program 21.4%
associate-*l*21.4%
*-commutative21.4%
associate-*l*21.4%
Simplified21.4%
unpow221.4%
unpow221.4%
difference-of-squares21.4%
Applied egg-rr21.4%
add-sqr-sqrt38.0%
pow238.0%
Applied egg-rr38.0%
Final simplification74.2%
b_m = (fabs.f64 b)
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a b_m angle_m)
:precision binary64
(let* ((t_0 (* (/ angle_m 180.0) PI)) (t_1 (* (+ a b_m) (- b_m a))))
(*
angle_s
(if (<= (/ angle_m 180.0) 1e+29)
(pow
(*
(cbrt (+ a b_m))
(cbrt (* (- b_m a) (sin (* PI (* angle_m 0.011111111111111112))))))
3.0)
(if (<= (/ angle_m 180.0) 1e+141)
(*
(* 2.0 (* (sin t_0) (cos (* (/ angle_m 180.0) (cbrt (pow PI 3.0))))))
t_1)
(if (<= (/ angle_m 180.0) 1e+176)
(*
0.011111111111111112
(* angle_m (sqrt (pow (* (- b_m a) (* (+ a b_m) PI)) 2.0))))
(*
(*
2.0
(* (sin (* (/ angle_m 180.0) (pow (sqrt PI) 2.0))) (cos t_0)))
t_1)))))))b_m = fabs(b);
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a, double b_m, double angle_m) {
double t_0 = (angle_m / 180.0) * ((double) M_PI);
double t_1 = (a + b_m) * (b_m - a);
double tmp;
if ((angle_m / 180.0) <= 1e+29) {
tmp = pow((cbrt((a + b_m)) * cbrt(((b_m - a) * sin((((double) M_PI) * (angle_m * 0.011111111111111112)))))), 3.0);
} else if ((angle_m / 180.0) <= 1e+141) {
tmp = (2.0 * (sin(t_0) * cos(((angle_m / 180.0) * cbrt(pow(((double) M_PI), 3.0)))))) * t_1;
} else if ((angle_m / 180.0) <= 1e+176) {
tmp = 0.011111111111111112 * (angle_m * sqrt(pow(((b_m - a) * ((a + b_m) * ((double) M_PI))), 2.0)));
} else {
tmp = (2.0 * (sin(((angle_m / 180.0) * pow(sqrt(((double) M_PI)), 2.0))) * cos(t_0))) * t_1;
}
return angle_s * tmp;
}
b_m = Math.abs(b);
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b_m, double angle_m) {
double t_0 = (angle_m / 180.0) * Math.PI;
double t_1 = (a + b_m) * (b_m - a);
double tmp;
if ((angle_m / 180.0) <= 1e+29) {
tmp = Math.pow((Math.cbrt((a + b_m)) * Math.cbrt(((b_m - a) * Math.sin((Math.PI * (angle_m * 0.011111111111111112)))))), 3.0);
} else if ((angle_m / 180.0) <= 1e+141) {
tmp = (2.0 * (Math.sin(t_0) * Math.cos(((angle_m / 180.0) * Math.cbrt(Math.pow(Math.PI, 3.0)))))) * t_1;
} else if ((angle_m / 180.0) <= 1e+176) {
tmp = 0.011111111111111112 * (angle_m * Math.sqrt(Math.pow(((b_m - a) * ((a + b_m) * Math.PI)), 2.0)));
} else {
tmp = (2.0 * (Math.sin(((angle_m / 180.0) * Math.pow(Math.sqrt(Math.PI), 2.0))) * Math.cos(t_0))) * t_1;
}
return angle_s * tmp;
}
b_m = abs(b) angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a, b_m, angle_m) t_0 = Float64(Float64(angle_m / 180.0) * pi) t_1 = Float64(Float64(a + b_m) * Float64(b_m - a)) tmp = 0.0 if (Float64(angle_m / 180.0) <= 1e+29) tmp = Float64(cbrt(Float64(a + b_m)) * cbrt(Float64(Float64(b_m - a) * sin(Float64(pi * Float64(angle_m * 0.011111111111111112)))))) ^ 3.0; elseif (Float64(angle_m / 180.0) <= 1e+141) tmp = Float64(Float64(2.0 * Float64(sin(t_0) * cos(Float64(Float64(angle_m / 180.0) * cbrt((pi ^ 3.0)))))) * t_1); elseif (Float64(angle_m / 180.0) <= 1e+176) tmp = Float64(0.011111111111111112 * Float64(angle_m * sqrt((Float64(Float64(b_m - a) * Float64(Float64(a + b_m) * pi)) ^ 2.0)))); else tmp = Float64(Float64(2.0 * Float64(sin(Float64(Float64(angle_m / 180.0) * (sqrt(pi) ^ 2.0))) * cos(t_0))) * t_1); end return Float64(angle_s * tmp) end
b_m = N[Abs[b], $MachinePrecision]
angle\_m = N[Abs[angle], $MachinePrecision]
angle\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a_, b$95$m_, angle$95$m_] := Block[{t$95$0 = N[(N[(angle$95$m / 180.0), $MachinePrecision] * Pi), $MachinePrecision]}, Block[{t$95$1 = N[(N[(a + b$95$m), $MachinePrecision] * N[(b$95$m - a), $MachinePrecision]), $MachinePrecision]}, N[(angle$95$s * If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 1e+29], N[Power[N[(N[Power[N[(a + b$95$m), $MachinePrecision], 1/3], $MachinePrecision] * N[Power[N[(N[(b$95$m - a), $MachinePrecision] * N[Sin[N[(Pi * N[(angle$95$m * 0.011111111111111112), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision], 3.0], $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 1e+141], N[(N[(2.0 * N[(N[Sin[t$95$0], $MachinePrecision] * N[Cos[N[(N[(angle$95$m / 180.0), $MachinePrecision] * N[Power[N[Power[Pi, 3.0], $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 1e+176], N[(0.011111111111111112 * N[(angle$95$m * N[Sqrt[N[Power[N[(N[(b$95$m - a), $MachinePrecision] * N[(N[(a + b$95$m), $MachinePrecision] * Pi), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(2.0 * N[(N[Sin[N[(N[(angle$95$m / 180.0), $MachinePrecision] * N[Power[N[Sqrt[Pi], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Cos[t$95$0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision]]]]), $MachinePrecision]]]
\begin{array}{l}
b_m = \left|b\right|
\\
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
\begin{array}{l}
t_0 := \frac{angle\_m}{180} \cdot \pi\\
t_1 := \left(a + b\_m\right) \cdot \left(b\_m - a\right)\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;\frac{angle\_m}{180} \leq 10^{+29}:\\
\;\;\;\;{\left(\sqrt[3]{a + b\_m} \cdot \sqrt[3]{\left(b\_m - a\right) \cdot \sin \left(\pi \cdot \left(angle\_m \cdot 0.011111111111111112\right)\right)}\right)}^{3}\\
\mathbf{elif}\;\frac{angle\_m}{180} \leq 10^{+141}:\\
\;\;\;\;\left(2 \cdot \left(\sin t\_0 \cdot \cos \left(\frac{angle\_m}{180} \cdot \sqrt[3]{{\pi}^{3}}\right)\right)\right) \cdot t\_1\\
\mathbf{elif}\;\frac{angle\_m}{180} \leq 10^{+176}:\\
\;\;\;\;0.011111111111111112 \cdot \left(angle\_m \cdot \sqrt{{\left(\left(b\_m - a\right) \cdot \left(\left(a + b\_m\right) \cdot \pi\right)\right)}^{2}}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(2 \cdot \left(\sin \left(\frac{angle\_m}{180} \cdot {\left(\sqrt{\pi}\right)}^{2}\right) \cdot \cos t\_0\right)\right) \cdot t\_1\\
\end{array}
\end{array}
\end{array}
if (/.f64 angle #s(literal 180 binary64)) < 9.99999999999999914e28Initial program 68.8%
associate-*l*68.8%
*-commutative68.8%
associate-*l*68.8%
Simplified68.8%
add-cube-cbrt68.3%
pow368.3%
2-sin68.3%
associate-*r*68.4%
div-inv68.6%
metadata-eval68.6%
Applied egg-rr68.6%
Applied egg-rr81.1%
+-commutative81.1%
associate-*l*81.5%
Simplified81.5%
if 9.99999999999999914e28 < (/.f64 angle #s(literal 180 binary64)) < 1.00000000000000002e141Initial program 24.1%
associate-*l*24.1%
*-commutative24.1%
associate-*l*24.1%
Simplified24.1%
unpow224.1%
unpow224.1%
difference-of-squares28.7%
Applied egg-rr28.7%
add-cbrt-cube47.9%
pow347.9%
Applied egg-rr47.9%
if 1.00000000000000002e141 < (/.f64 angle #s(literal 180 binary64)) < 1e176Initial program 18.1%
associate-*l*18.1%
*-commutative18.1%
associate-*l*18.1%
Simplified18.1%
Taylor expanded in angle around 0 26.8%
unpow218.1%
unpow218.1%
difference-of-squares18.1%
Applied egg-rr26.8%
add-sqr-sqrt13.8%
sqrt-unprod27.0%
pow227.0%
associate-*r*27.0%
Applied egg-rr27.0%
if 1e176 < (/.f64 angle #s(literal 180 binary64)) Initial program 21.4%
associate-*l*21.4%
*-commutative21.4%
associate-*l*21.4%
Simplified21.4%
unpow221.4%
unpow221.4%
difference-of-squares21.4%
Applied egg-rr21.4%
add-sqr-sqrt38.0%
pow238.0%
Applied egg-rr38.0%
Final simplification73.9%
b_m = (fabs.f64 b)
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a b_m angle_m)
:precision binary64
(*
angle_s
(if (<= (/ angle_m 180.0) 1e+29)
(pow
(*
(cbrt (+ a b_m))
(cbrt (* (- b_m a) (sin (* PI (* angle_m 0.011111111111111112))))))
3.0)
(if (<= (/ angle_m 180.0) 2e+141)
(*
(*
2.0
(*
(sin (* (/ angle_m 180.0) PI))
(cos (* (/ angle_m 180.0) (cbrt (pow PI 3.0))))))
(* (+ a b_m) (- b_m a)))
(fabs
(*
(sin (* 0.011111111111111112 (* angle_m PI)))
(- (pow b_m 2.0) (pow a 2.0))))))))b_m = fabs(b);
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a, double b_m, double angle_m) {
double tmp;
if ((angle_m / 180.0) <= 1e+29) {
tmp = pow((cbrt((a + b_m)) * cbrt(((b_m - a) * sin((((double) M_PI) * (angle_m * 0.011111111111111112)))))), 3.0);
} else if ((angle_m / 180.0) <= 2e+141) {
tmp = (2.0 * (sin(((angle_m / 180.0) * ((double) M_PI))) * cos(((angle_m / 180.0) * cbrt(pow(((double) M_PI), 3.0)))))) * ((a + b_m) * (b_m - a));
} else {
tmp = fabs((sin((0.011111111111111112 * (angle_m * ((double) M_PI)))) * (pow(b_m, 2.0) - pow(a, 2.0))));
}
return angle_s * tmp;
}
b_m = Math.abs(b);
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b_m, double angle_m) {
double tmp;
if ((angle_m / 180.0) <= 1e+29) {
tmp = Math.pow((Math.cbrt((a + b_m)) * Math.cbrt(((b_m - a) * Math.sin((Math.PI * (angle_m * 0.011111111111111112)))))), 3.0);
} else if ((angle_m / 180.0) <= 2e+141) {
tmp = (2.0 * (Math.sin(((angle_m / 180.0) * Math.PI)) * Math.cos(((angle_m / 180.0) * Math.cbrt(Math.pow(Math.PI, 3.0)))))) * ((a + b_m) * (b_m - a));
} else {
tmp = Math.abs((Math.sin((0.011111111111111112 * (angle_m * Math.PI))) * (Math.pow(b_m, 2.0) - Math.pow(a, 2.0))));
}
return angle_s * tmp;
}
b_m = abs(b) angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a, b_m, angle_m) tmp = 0.0 if (Float64(angle_m / 180.0) <= 1e+29) tmp = Float64(cbrt(Float64(a + b_m)) * cbrt(Float64(Float64(b_m - a) * sin(Float64(pi * Float64(angle_m * 0.011111111111111112)))))) ^ 3.0; elseif (Float64(angle_m / 180.0) <= 2e+141) tmp = Float64(Float64(2.0 * Float64(sin(Float64(Float64(angle_m / 180.0) * pi)) * cos(Float64(Float64(angle_m / 180.0) * cbrt((pi ^ 3.0)))))) * Float64(Float64(a + b_m) * Float64(b_m - a))); else tmp = abs(Float64(sin(Float64(0.011111111111111112 * Float64(angle_m * pi))) * Float64((b_m ^ 2.0) - (a ^ 2.0)))); end return Float64(angle_s * tmp) end
b_m = N[Abs[b], $MachinePrecision]
angle\_m = N[Abs[angle], $MachinePrecision]
angle\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a_, b$95$m_, angle$95$m_] := N[(angle$95$s * If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 1e+29], N[Power[N[(N[Power[N[(a + b$95$m), $MachinePrecision], 1/3], $MachinePrecision] * N[Power[N[(N[(b$95$m - a), $MachinePrecision] * N[Sin[N[(Pi * N[(angle$95$m * 0.011111111111111112), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision], 3.0], $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 2e+141], N[(N[(2.0 * N[(N[Sin[N[(N[(angle$95$m / 180.0), $MachinePrecision] * Pi), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(N[(angle$95$m / 180.0), $MachinePrecision] * N[Power[N[Power[Pi, 3.0], $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(a + b$95$m), $MachinePrecision] * N[(b$95$m - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Abs[N[(N[Sin[N[(0.011111111111111112 * N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(N[Power[b$95$m, 2.0], $MachinePrecision] - N[Power[a, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]), $MachinePrecision]
\begin{array}{l}
b_m = \left|b\right|
\\
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;\frac{angle\_m}{180} \leq 10^{+29}:\\
\;\;\;\;{\left(\sqrt[3]{a + b\_m} \cdot \sqrt[3]{\left(b\_m - a\right) \cdot \sin \left(\pi \cdot \left(angle\_m \cdot 0.011111111111111112\right)\right)}\right)}^{3}\\
\mathbf{elif}\;\frac{angle\_m}{180} \leq 2 \cdot 10^{+141}:\\
\;\;\;\;\left(2 \cdot \left(\sin \left(\frac{angle\_m}{180} \cdot \pi\right) \cdot \cos \left(\frac{angle\_m}{180} \cdot \sqrt[3]{{\pi}^{3}}\right)\right)\right) \cdot \left(\left(a + b\_m\right) \cdot \left(b\_m - a\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left|\sin \left(0.011111111111111112 \cdot \left(angle\_m \cdot \pi\right)\right) \cdot \left({b\_m}^{2} - {a}^{2}\right)\right|\\
\end{array}
\end{array}
if (/.f64 angle #s(literal 180 binary64)) < 9.99999999999999914e28Initial program 68.8%
associate-*l*68.8%
*-commutative68.8%
associate-*l*68.8%
Simplified68.8%
add-cube-cbrt68.3%
pow368.3%
2-sin68.3%
associate-*r*68.4%
div-inv68.6%
metadata-eval68.6%
Applied egg-rr68.6%
Applied egg-rr81.1%
+-commutative81.1%
associate-*l*81.5%
Simplified81.5%
if 9.99999999999999914e28 < (/.f64 angle #s(literal 180 binary64)) < 2.00000000000000003e141Initial program 24.1%
associate-*l*24.1%
*-commutative24.1%
associate-*l*24.1%
Simplified24.1%
unpow224.1%
unpow224.1%
difference-of-squares28.7%
Applied egg-rr28.7%
add-cbrt-cube47.9%
pow347.9%
Applied egg-rr47.9%
if 2.00000000000000003e141 < (/.f64 angle #s(literal 180 binary64)) Initial program 20.4%
associate-*l*20.4%
*-commutative20.4%
associate-*l*20.4%
Simplified20.4%
unpow220.4%
unpow220.4%
difference-of-squares20.4%
Applied egg-rr20.4%
difference-of-squares20.4%
unpow220.4%
unpow220.4%
2-sin20.4%
div-inv25.2%
metadata-eval25.2%
associate-*l*25.2%
add-cbrt-cube23.8%
pow1/330.7%
Applied egg-rr30.7%
unpow1/323.9%
rem-cbrt-cube24.8%
add-sqr-sqrt19.2%
sqrt-unprod32.6%
pow232.6%
associate-*r*32.5%
Applied egg-rr32.5%
unpow232.5%
rem-sqrt-square33.5%
*-commutative33.5%
*-commutative33.5%
associate-*r*33.5%
Simplified33.5%
Final simplification73.8%
b_m = (fabs.f64 b)
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a b_m angle_m)
:precision binary64
(*
angle_s
(pow
(*
(cbrt (+ a b_m))
(cbrt (* (- b_m a) (sin (* PI (* angle_m 0.011111111111111112))))))
3.0)))b_m = fabs(b);
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a, double b_m, double angle_m) {
return angle_s * pow((cbrt((a + b_m)) * cbrt(((b_m - a) * sin((((double) M_PI) * (angle_m * 0.011111111111111112)))))), 3.0);
}
b_m = Math.abs(b);
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b_m, double angle_m) {
return angle_s * Math.pow((Math.cbrt((a + b_m)) * Math.cbrt(((b_m - a) * Math.sin((Math.PI * (angle_m * 0.011111111111111112)))))), 3.0);
}
b_m = abs(b) angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a, b_m, angle_m) return Float64(angle_s * (Float64(cbrt(Float64(a + b_m)) * cbrt(Float64(Float64(b_m - a) * sin(Float64(pi * Float64(angle_m * 0.011111111111111112)))))) ^ 3.0)) end
b_m = N[Abs[b], $MachinePrecision]
angle\_m = N[Abs[angle], $MachinePrecision]
angle\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a_, b$95$m_, angle$95$m_] := N[(angle$95$s * N[Power[N[(N[Power[N[(a + b$95$m), $MachinePrecision], 1/3], $MachinePrecision] * N[Power[N[(N[(b$95$m - a), $MachinePrecision] * N[Sin[N[(Pi * N[(angle$95$m * 0.011111111111111112), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision], 3.0], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
b_m = \left|b\right|
\\
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
angle\_s \cdot {\left(\sqrt[3]{a + b\_m} \cdot \sqrt[3]{\left(b\_m - a\right) \cdot \sin \left(\pi \cdot \left(angle\_m \cdot 0.011111111111111112\right)\right)}\right)}^{3}
\end{array}
Initial program 60.0%
associate-*l*60.0%
*-commutative60.0%
associate-*l*60.0%
Simplified60.0%
add-cube-cbrt59.7%
pow359.7%
2-sin59.7%
associate-*r*59.7%
div-inv60.4%
metadata-eval60.4%
Applied egg-rr60.4%
Applied egg-rr70.9%
+-commutative70.9%
associate-*l*71.3%
Simplified71.3%
b_m = (fabs.f64 b)
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a b_m angle_m)
:precision binary64
(let* ((t_0 (* angle_m (* (- b_m a) PI)))
(t_1 (* PI (* angle_m 0.005555555555555556))))
(*
angle_s
(if (<= (/ angle_m 180.0) 1e-78)
(* 0.011111111111111112 (+ (* b_m t_0) (* a t_0)))
(* (* 2.0 (cos t_1)) (* (sin t_1) (* (+ a b_m) (- b_m a))))))))b_m = fabs(b);
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a, double b_m, double angle_m) {
double t_0 = angle_m * ((b_m - a) * ((double) M_PI));
double t_1 = ((double) M_PI) * (angle_m * 0.005555555555555556);
double tmp;
if ((angle_m / 180.0) <= 1e-78) {
tmp = 0.011111111111111112 * ((b_m * t_0) + (a * t_0));
} else {
tmp = (2.0 * cos(t_1)) * (sin(t_1) * ((a + b_m) * (b_m - a)));
}
return angle_s * tmp;
}
b_m = Math.abs(b);
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b_m, double angle_m) {
double t_0 = angle_m * ((b_m - a) * Math.PI);
double t_1 = Math.PI * (angle_m * 0.005555555555555556);
double tmp;
if ((angle_m / 180.0) <= 1e-78) {
tmp = 0.011111111111111112 * ((b_m * t_0) + (a * t_0));
} else {
tmp = (2.0 * Math.cos(t_1)) * (Math.sin(t_1) * ((a + b_m) * (b_m - a)));
}
return angle_s * tmp;
}
b_m = math.fabs(b) angle\_m = math.fabs(angle) angle\_s = math.copysign(1.0, angle) def code(angle_s, a, b_m, angle_m): t_0 = angle_m * ((b_m - a) * math.pi) t_1 = math.pi * (angle_m * 0.005555555555555556) tmp = 0 if (angle_m / 180.0) <= 1e-78: tmp = 0.011111111111111112 * ((b_m * t_0) + (a * t_0)) else: tmp = (2.0 * math.cos(t_1)) * (math.sin(t_1) * ((a + b_m) * (b_m - a))) return angle_s * tmp
b_m = abs(b) angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a, b_m, angle_m) t_0 = Float64(angle_m * Float64(Float64(b_m - a) * pi)) t_1 = Float64(pi * Float64(angle_m * 0.005555555555555556)) tmp = 0.0 if (Float64(angle_m / 180.0) <= 1e-78) tmp = Float64(0.011111111111111112 * Float64(Float64(b_m * t_0) + Float64(a * t_0))); else tmp = Float64(Float64(2.0 * cos(t_1)) * Float64(sin(t_1) * Float64(Float64(a + b_m) * Float64(b_m - a)))); end return Float64(angle_s * tmp) end
b_m = abs(b); angle\_m = abs(angle); angle\_s = sign(angle) * abs(1.0); function tmp_2 = code(angle_s, a, b_m, angle_m) t_0 = angle_m * ((b_m - a) * pi); t_1 = pi * (angle_m * 0.005555555555555556); tmp = 0.0; if ((angle_m / 180.0) <= 1e-78) tmp = 0.011111111111111112 * ((b_m * t_0) + (a * t_0)); else tmp = (2.0 * cos(t_1)) * (sin(t_1) * ((a + b_m) * (b_m - a))); end tmp_2 = angle_s * tmp; end
b_m = N[Abs[b], $MachinePrecision]
angle\_m = N[Abs[angle], $MachinePrecision]
angle\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a_, b$95$m_, angle$95$m_] := Block[{t$95$0 = N[(angle$95$m * N[(N[(b$95$m - a), $MachinePrecision] * Pi), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(Pi * N[(angle$95$m * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]}, N[(angle$95$s * If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 1e-78], N[(0.011111111111111112 * N[(N[(b$95$m * t$95$0), $MachinePrecision] + N[(a * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(2.0 * N[Cos[t$95$1], $MachinePrecision]), $MachinePrecision] * N[(N[Sin[t$95$1], $MachinePrecision] * N[(N[(a + b$95$m), $MachinePrecision] * N[(b$95$m - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]]]
\begin{array}{l}
b_m = \left|b\right|
\\
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
\begin{array}{l}
t_0 := angle\_m \cdot \left(\left(b\_m - a\right) \cdot \pi\right)\\
t_1 := \pi \cdot \left(angle\_m \cdot 0.005555555555555556\right)\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;\frac{angle\_m}{180} \leq 10^{-78}:\\
\;\;\;\;0.011111111111111112 \cdot \left(b\_m \cdot t\_0 + a \cdot t\_0\right)\\
\mathbf{else}:\\
\;\;\;\;\left(2 \cdot \cos t\_1\right) \cdot \left(\sin t\_1 \cdot \left(\left(a + b\_m\right) \cdot \left(b\_m - a\right)\right)\right)\\
\end{array}
\end{array}
\end{array}
if (/.f64 angle #s(literal 180 binary64)) < 9.99999999999999999e-79Initial program 67.2%
associate-*l*67.2%
*-commutative67.2%
associate-*l*67.2%
Simplified67.2%
Taylor expanded in angle around 0 65.8%
unpow267.2%
unpow267.2%
difference-of-squares69.8%
Applied egg-rr67.9%
Taylor expanded in angle around 0 67.9%
associate-*r*67.9%
+-commutative67.9%
*-commutative67.9%
+-commutative67.9%
Simplified67.9%
associate-*r*78.6%
+-commutative78.6%
distribute-lft-in75.5%
associate-*l*75.5%
associate-*l*75.5%
Applied egg-rr75.5%
if 9.99999999999999999e-79 < (/.f64 angle #s(literal 180 binary64)) Initial program 38.8%
associate-*l*38.8%
*-commutative38.8%
associate-*l*38.8%
Simplified38.8%
unpow238.8%
unpow238.8%
difference-of-squares40.4%
Applied egg-rr40.4%
Taylor expanded in angle around inf 42.1%
associate-*r*42.1%
associate-*r*41.9%
*-commutative41.9%
associate-*r*42.3%
*-commutative42.3%
Simplified42.3%
Final simplification67.0%
b_m = (fabs.f64 b)
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a b_m angle_m)
:precision binary64
(let* ((t_0 (* angle_m (* (- b_m a) PI)))
(t_1 (* (* angle_m PI) 0.005555555555555556)))
(*
angle_s
(if (<= (/ angle_m 180.0) 1e-78)
(* 0.011111111111111112 (+ (* b_m t_0) (* a t_0)))
(* 2.0 (* (cos t_1) (* (* (+ a b_m) (- b_m a)) (sin t_1))))))))b_m = fabs(b);
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a, double b_m, double angle_m) {
double t_0 = angle_m * ((b_m - a) * ((double) M_PI));
double t_1 = (angle_m * ((double) M_PI)) * 0.005555555555555556;
double tmp;
if ((angle_m / 180.0) <= 1e-78) {
tmp = 0.011111111111111112 * ((b_m * t_0) + (a * t_0));
} else {
tmp = 2.0 * (cos(t_1) * (((a + b_m) * (b_m - a)) * sin(t_1)));
}
return angle_s * tmp;
}
b_m = Math.abs(b);
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b_m, double angle_m) {
double t_0 = angle_m * ((b_m - a) * Math.PI);
double t_1 = (angle_m * Math.PI) * 0.005555555555555556;
double tmp;
if ((angle_m / 180.0) <= 1e-78) {
tmp = 0.011111111111111112 * ((b_m * t_0) + (a * t_0));
} else {
tmp = 2.0 * (Math.cos(t_1) * (((a + b_m) * (b_m - a)) * Math.sin(t_1)));
}
return angle_s * tmp;
}
b_m = math.fabs(b) angle\_m = math.fabs(angle) angle\_s = math.copysign(1.0, angle) def code(angle_s, a, b_m, angle_m): t_0 = angle_m * ((b_m - a) * math.pi) t_1 = (angle_m * math.pi) * 0.005555555555555556 tmp = 0 if (angle_m / 180.0) <= 1e-78: tmp = 0.011111111111111112 * ((b_m * t_0) + (a * t_0)) else: tmp = 2.0 * (math.cos(t_1) * (((a + b_m) * (b_m - a)) * math.sin(t_1))) return angle_s * tmp
b_m = abs(b) angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a, b_m, angle_m) t_0 = Float64(angle_m * Float64(Float64(b_m - a) * pi)) t_1 = Float64(Float64(angle_m * pi) * 0.005555555555555556) tmp = 0.0 if (Float64(angle_m / 180.0) <= 1e-78) tmp = Float64(0.011111111111111112 * Float64(Float64(b_m * t_0) + Float64(a * t_0))); else tmp = Float64(2.0 * Float64(cos(t_1) * Float64(Float64(Float64(a + b_m) * Float64(b_m - a)) * sin(t_1)))); end return Float64(angle_s * tmp) end
b_m = abs(b); angle\_m = abs(angle); angle\_s = sign(angle) * abs(1.0); function tmp_2 = code(angle_s, a, b_m, angle_m) t_0 = angle_m * ((b_m - a) * pi); t_1 = (angle_m * pi) * 0.005555555555555556; tmp = 0.0; if ((angle_m / 180.0) <= 1e-78) tmp = 0.011111111111111112 * ((b_m * t_0) + (a * t_0)); else tmp = 2.0 * (cos(t_1) * (((a + b_m) * (b_m - a)) * sin(t_1))); end tmp_2 = angle_s * tmp; end
b_m = N[Abs[b], $MachinePrecision]
angle\_m = N[Abs[angle], $MachinePrecision]
angle\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a_, b$95$m_, angle$95$m_] := Block[{t$95$0 = N[(angle$95$m * N[(N[(b$95$m - a), $MachinePrecision] * Pi), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(angle$95$m * Pi), $MachinePrecision] * 0.005555555555555556), $MachinePrecision]}, N[(angle$95$s * If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 1e-78], N[(0.011111111111111112 * N[(N[(b$95$m * t$95$0), $MachinePrecision] + N[(a * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[Cos[t$95$1], $MachinePrecision] * N[(N[(N[(a + b$95$m), $MachinePrecision] * N[(b$95$m - a), $MachinePrecision]), $MachinePrecision] * N[Sin[t$95$1], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]]]
\begin{array}{l}
b_m = \left|b\right|
\\
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
\begin{array}{l}
t_0 := angle\_m \cdot \left(\left(b\_m - a\right) \cdot \pi\right)\\
t_1 := \left(angle\_m \cdot \pi\right) \cdot 0.005555555555555556\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;\frac{angle\_m}{180} \leq 10^{-78}:\\
\;\;\;\;0.011111111111111112 \cdot \left(b\_m \cdot t\_0 + a \cdot t\_0\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(\cos t\_1 \cdot \left(\left(\left(a + b\_m\right) \cdot \left(b\_m - a\right)\right) \cdot \sin t\_1\right)\right)\\
\end{array}
\end{array}
\end{array}
if (/.f64 angle #s(literal 180 binary64)) < 9.99999999999999999e-79Initial program 67.2%
associate-*l*67.2%
*-commutative67.2%
associate-*l*67.2%
Simplified67.2%
Taylor expanded in angle around 0 65.8%
unpow267.2%
unpow267.2%
difference-of-squares69.8%
Applied egg-rr67.9%
Taylor expanded in angle around 0 67.9%
associate-*r*67.9%
+-commutative67.9%
*-commutative67.9%
+-commutative67.9%
Simplified67.9%
associate-*r*78.6%
+-commutative78.6%
distribute-lft-in75.5%
associate-*l*75.5%
associate-*l*75.5%
Applied egg-rr75.5%
if 9.99999999999999999e-79 < (/.f64 angle #s(literal 180 binary64)) Initial program 38.8%
associate-*l*38.8%
*-commutative38.8%
associate-*l*38.8%
Simplified38.8%
unpow238.8%
unpow238.8%
difference-of-squares40.4%
Applied egg-rr40.4%
Taylor expanded in angle around inf 42.1%
Final simplification67.0%
b_m = (fabs.f64 b)
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a b_m angle_m)
:precision binary64
(let* ((t_0 (* angle_m (* (- b_m a) PI))))
(*
angle_s
(if (<= (/ angle_m 180.0) 200000.0)
(* 0.011111111111111112 (+ (* b_m t_0) (* a t_0)))
(*
0.011111111111111112
(* angle_m (sqrt (pow (* (- b_m a) (* (+ a b_m) PI)) 2.0))))))))b_m = fabs(b);
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a, double b_m, double angle_m) {
double t_0 = angle_m * ((b_m - a) * ((double) M_PI));
double tmp;
if ((angle_m / 180.0) <= 200000.0) {
tmp = 0.011111111111111112 * ((b_m * t_0) + (a * t_0));
} else {
tmp = 0.011111111111111112 * (angle_m * sqrt(pow(((b_m - a) * ((a + b_m) * ((double) M_PI))), 2.0)));
}
return angle_s * tmp;
}
b_m = Math.abs(b);
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b_m, double angle_m) {
double t_0 = angle_m * ((b_m - a) * Math.PI);
double tmp;
if ((angle_m / 180.0) <= 200000.0) {
tmp = 0.011111111111111112 * ((b_m * t_0) + (a * t_0));
} else {
tmp = 0.011111111111111112 * (angle_m * Math.sqrt(Math.pow(((b_m - a) * ((a + b_m) * Math.PI)), 2.0)));
}
return angle_s * tmp;
}
b_m = math.fabs(b) angle\_m = math.fabs(angle) angle\_s = math.copysign(1.0, angle) def code(angle_s, a, b_m, angle_m): t_0 = angle_m * ((b_m - a) * math.pi) tmp = 0 if (angle_m / 180.0) <= 200000.0: tmp = 0.011111111111111112 * ((b_m * t_0) + (a * t_0)) else: tmp = 0.011111111111111112 * (angle_m * math.sqrt(math.pow(((b_m - a) * ((a + b_m) * math.pi)), 2.0))) return angle_s * tmp
b_m = abs(b) angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a, b_m, angle_m) t_0 = Float64(angle_m * Float64(Float64(b_m - a) * pi)) tmp = 0.0 if (Float64(angle_m / 180.0) <= 200000.0) tmp = Float64(0.011111111111111112 * Float64(Float64(b_m * t_0) + Float64(a * t_0))); else tmp = Float64(0.011111111111111112 * Float64(angle_m * sqrt((Float64(Float64(b_m - a) * Float64(Float64(a + b_m) * pi)) ^ 2.0)))); end return Float64(angle_s * tmp) end
b_m = abs(b); angle\_m = abs(angle); angle\_s = sign(angle) * abs(1.0); function tmp_2 = code(angle_s, a, b_m, angle_m) t_0 = angle_m * ((b_m - a) * pi); tmp = 0.0; if ((angle_m / 180.0) <= 200000.0) tmp = 0.011111111111111112 * ((b_m * t_0) + (a * t_0)); else tmp = 0.011111111111111112 * (angle_m * sqrt((((b_m - a) * ((a + b_m) * pi)) ^ 2.0))); end tmp_2 = angle_s * tmp; end
b_m = N[Abs[b], $MachinePrecision]
angle\_m = N[Abs[angle], $MachinePrecision]
angle\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a_, b$95$m_, angle$95$m_] := Block[{t$95$0 = N[(angle$95$m * N[(N[(b$95$m - a), $MachinePrecision] * Pi), $MachinePrecision]), $MachinePrecision]}, N[(angle$95$s * If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 200000.0], N[(0.011111111111111112 * N[(N[(b$95$m * t$95$0), $MachinePrecision] + N[(a * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.011111111111111112 * N[(angle$95$m * N[Sqrt[N[Power[N[(N[(b$95$m - a), $MachinePrecision] * N[(N[(a + b$95$m), $MachinePrecision] * Pi), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]]
\begin{array}{l}
b_m = \left|b\right|
\\
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
\begin{array}{l}
t_0 := angle\_m \cdot \left(\left(b\_m - a\right) \cdot \pi\right)\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;\frac{angle\_m}{180} \leq 200000:\\
\;\;\;\;0.011111111111111112 \cdot \left(b\_m \cdot t\_0 + a \cdot t\_0\right)\\
\mathbf{else}:\\
\;\;\;\;0.011111111111111112 \cdot \left(angle\_m \cdot \sqrt{{\left(\left(b\_m - a\right) \cdot \left(\left(a + b\_m\right) \cdot \pi\right)\right)}^{2}}\right)\\
\end{array}
\end{array}
\end{array}
if (/.f64 angle #s(literal 180 binary64)) < 2e5Initial program 68.5%
associate-*l*68.5%
*-commutative68.5%
associate-*l*68.5%
Simplified68.5%
Taylor expanded in angle around 0 67.1%
unpow268.5%
unpow268.5%
difference-of-squares71.0%
Applied egg-rr69.2%
Taylor expanded in angle around 0 69.2%
associate-*r*69.2%
+-commutative69.2%
*-commutative69.2%
+-commutative69.2%
Simplified69.2%
associate-*r*79.5%
+-commutative79.5%
distribute-lft-in76.5%
associate-*l*76.5%
associate-*l*76.5%
Applied egg-rr76.5%
if 2e5 < (/.f64 angle #s(literal 180 binary64)) Initial program 30.3%
associate-*l*30.3%
*-commutative30.3%
associate-*l*30.3%
Simplified30.3%
Taylor expanded in angle around 0 21.0%
unpow230.3%
unpow230.3%
difference-of-squares32.0%
Applied egg-rr21.0%
add-sqr-sqrt15.1%
sqrt-unprod32.6%
pow232.6%
associate-*r*32.6%
Applied egg-rr32.6%
Final simplification66.7%
b_m = (fabs.f64 b)
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a b_m angle_m)
:precision binary64
(let* ((t_0 (* angle_m (* (- b_m a) PI))))
(*
angle_s
(if (<= (/ angle_m 180.0) 1e-78)
(* 0.011111111111111112 (+ (* b_m t_0) (* a t_0)))
(* (* (+ a b_m) (- b_m a)) (* 2.0 (sin (* (/ angle_m 180.0) PI))))))))b_m = fabs(b);
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a, double b_m, double angle_m) {
double t_0 = angle_m * ((b_m - a) * ((double) M_PI));
double tmp;
if ((angle_m / 180.0) <= 1e-78) {
tmp = 0.011111111111111112 * ((b_m * t_0) + (a * t_0));
} else {
tmp = ((a + b_m) * (b_m - a)) * (2.0 * sin(((angle_m / 180.0) * ((double) M_PI))));
}
return angle_s * tmp;
}
b_m = Math.abs(b);
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b_m, double angle_m) {
double t_0 = angle_m * ((b_m - a) * Math.PI);
double tmp;
if ((angle_m / 180.0) <= 1e-78) {
tmp = 0.011111111111111112 * ((b_m * t_0) + (a * t_0));
} else {
tmp = ((a + b_m) * (b_m - a)) * (2.0 * Math.sin(((angle_m / 180.0) * Math.PI)));
}
return angle_s * tmp;
}
b_m = math.fabs(b) angle\_m = math.fabs(angle) angle\_s = math.copysign(1.0, angle) def code(angle_s, a, b_m, angle_m): t_0 = angle_m * ((b_m - a) * math.pi) tmp = 0 if (angle_m / 180.0) <= 1e-78: tmp = 0.011111111111111112 * ((b_m * t_0) + (a * t_0)) else: tmp = ((a + b_m) * (b_m - a)) * (2.0 * math.sin(((angle_m / 180.0) * math.pi))) return angle_s * tmp
b_m = abs(b) angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a, b_m, angle_m) t_0 = Float64(angle_m * Float64(Float64(b_m - a) * pi)) tmp = 0.0 if (Float64(angle_m / 180.0) <= 1e-78) tmp = Float64(0.011111111111111112 * Float64(Float64(b_m * t_0) + Float64(a * t_0))); else tmp = Float64(Float64(Float64(a + b_m) * Float64(b_m - a)) * Float64(2.0 * sin(Float64(Float64(angle_m / 180.0) * pi)))); end return Float64(angle_s * tmp) end
b_m = abs(b); angle\_m = abs(angle); angle\_s = sign(angle) * abs(1.0); function tmp_2 = code(angle_s, a, b_m, angle_m) t_0 = angle_m * ((b_m - a) * pi); tmp = 0.0; if ((angle_m / 180.0) <= 1e-78) tmp = 0.011111111111111112 * ((b_m * t_0) + (a * t_0)); else tmp = ((a + b_m) * (b_m - a)) * (2.0 * sin(((angle_m / 180.0) * pi))); end tmp_2 = angle_s * tmp; end
b_m = N[Abs[b], $MachinePrecision]
angle\_m = N[Abs[angle], $MachinePrecision]
angle\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a_, b$95$m_, angle$95$m_] := Block[{t$95$0 = N[(angle$95$m * N[(N[(b$95$m - a), $MachinePrecision] * Pi), $MachinePrecision]), $MachinePrecision]}, N[(angle$95$s * If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 1e-78], N[(0.011111111111111112 * N[(N[(b$95$m * t$95$0), $MachinePrecision] + N[(a * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(a + b$95$m), $MachinePrecision] * N[(b$95$m - a), $MachinePrecision]), $MachinePrecision] * N[(2.0 * N[Sin[N[(N[(angle$95$m / 180.0), $MachinePrecision] * Pi), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]]
\begin{array}{l}
b_m = \left|b\right|
\\
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
\begin{array}{l}
t_0 := angle\_m \cdot \left(\left(b\_m - a\right) \cdot \pi\right)\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;\frac{angle\_m}{180} \leq 10^{-78}:\\
\;\;\;\;0.011111111111111112 \cdot \left(b\_m \cdot t\_0 + a \cdot t\_0\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(a + b\_m\right) \cdot \left(b\_m - a\right)\right) \cdot \left(2 \cdot \sin \left(\frac{angle\_m}{180} \cdot \pi\right)\right)\\
\end{array}
\end{array}
\end{array}
if (/.f64 angle #s(literal 180 binary64)) < 9.99999999999999999e-79Initial program 67.2%
associate-*l*67.2%
*-commutative67.2%
associate-*l*67.2%
Simplified67.2%
Taylor expanded in angle around 0 65.8%
unpow267.2%
unpow267.2%
difference-of-squares69.8%
Applied egg-rr67.9%
Taylor expanded in angle around 0 67.9%
associate-*r*67.9%
+-commutative67.9%
*-commutative67.9%
+-commutative67.9%
Simplified67.9%
associate-*r*78.6%
+-commutative78.6%
distribute-lft-in75.5%
associate-*l*75.5%
associate-*l*75.5%
Applied egg-rr75.5%
if 9.99999999999999999e-79 < (/.f64 angle #s(literal 180 binary64)) Initial program 38.8%
associate-*l*38.8%
*-commutative38.8%
associate-*l*38.8%
Simplified38.8%
unpow238.8%
unpow238.8%
difference-of-squares40.4%
Applied egg-rr40.4%
Taylor expanded in angle around 0 36.1%
Final simplification65.5%
b_m = (fabs.f64 b)
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a b_m angle_m)
:precision binary64
(let* ((t_0 (* angle_m (* (- b_m a) PI))))
(*
angle_s
(if (<= angle_m 118000000.0)
(* 0.011111111111111112 (+ (* b_m t_0) (* a t_0)))
(*
0.011111111111111112
(* angle_m (fabs (* PI (* (+ a b_m) (- b_m a))))))))))b_m = fabs(b);
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a, double b_m, double angle_m) {
double t_0 = angle_m * ((b_m - a) * ((double) M_PI));
double tmp;
if (angle_m <= 118000000.0) {
tmp = 0.011111111111111112 * ((b_m * t_0) + (a * t_0));
} else {
tmp = 0.011111111111111112 * (angle_m * fabs((((double) M_PI) * ((a + b_m) * (b_m - a)))));
}
return angle_s * tmp;
}
b_m = Math.abs(b);
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b_m, double angle_m) {
double t_0 = angle_m * ((b_m - a) * Math.PI);
double tmp;
if (angle_m <= 118000000.0) {
tmp = 0.011111111111111112 * ((b_m * t_0) + (a * t_0));
} else {
tmp = 0.011111111111111112 * (angle_m * Math.abs((Math.PI * ((a + b_m) * (b_m - a)))));
}
return angle_s * tmp;
}
b_m = math.fabs(b) angle\_m = math.fabs(angle) angle\_s = math.copysign(1.0, angle) def code(angle_s, a, b_m, angle_m): t_0 = angle_m * ((b_m - a) * math.pi) tmp = 0 if angle_m <= 118000000.0: tmp = 0.011111111111111112 * ((b_m * t_0) + (a * t_0)) else: tmp = 0.011111111111111112 * (angle_m * math.fabs((math.pi * ((a + b_m) * (b_m - a))))) return angle_s * tmp
b_m = abs(b) angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a, b_m, angle_m) t_0 = Float64(angle_m * Float64(Float64(b_m - a) * pi)) tmp = 0.0 if (angle_m <= 118000000.0) tmp = Float64(0.011111111111111112 * Float64(Float64(b_m * t_0) + Float64(a * t_0))); else tmp = Float64(0.011111111111111112 * Float64(angle_m * abs(Float64(pi * Float64(Float64(a + b_m) * Float64(b_m - a)))))); end return Float64(angle_s * tmp) end
b_m = abs(b); angle\_m = abs(angle); angle\_s = sign(angle) * abs(1.0); function tmp_2 = code(angle_s, a, b_m, angle_m) t_0 = angle_m * ((b_m - a) * pi); tmp = 0.0; if (angle_m <= 118000000.0) tmp = 0.011111111111111112 * ((b_m * t_0) + (a * t_0)); else tmp = 0.011111111111111112 * (angle_m * abs((pi * ((a + b_m) * (b_m - a))))); end tmp_2 = angle_s * tmp; end
b_m = N[Abs[b], $MachinePrecision]
angle\_m = N[Abs[angle], $MachinePrecision]
angle\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a_, b$95$m_, angle$95$m_] := Block[{t$95$0 = N[(angle$95$m * N[(N[(b$95$m - a), $MachinePrecision] * Pi), $MachinePrecision]), $MachinePrecision]}, N[(angle$95$s * If[LessEqual[angle$95$m, 118000000.0], N[(0.011111111111111112 * N[(N[(b$95$m * t$95$0), $MachinePrecision] + N[(a * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.011111111111111112 * N[(angle$95$m * N[Abs[N[(Pi * N[(N[(a + b$95$m), $MachinePrecision] * N[(b$95$m - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]]
\begin{array}{l}
b_m = \left|b\right|
\\
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
\begin{array}{l}
t_0 := angle\_m \cdot \left(\left(b\_m - a\right) \cdot \pi\right)\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;angle\_m \leq 118000000:\\
\;\;\;\;0.011111111111111112 \cdot \left(b\_m \cdot t\_0 + a \cdot t\_0\right)\\
\mathbf{else}:\\
\;\;\;\;0.011111111111111112 \cdot \left(angle\_m \cdot \left|\pi \cdot \left(\left(a + b\_m\right) \cdot \left(b\_m - a\right)\right)\right|\right)\\
\end{array}
\end{array}
\end{array}
if angle < 1.18e8Initial program 68.5%
associate-*l*68.5%
*-commutative68.5%
associate-*l*68.5%
Simplified68.5%
Taylor expanded in angle around 0 67.1%
unpow268.5%
unpow268.5%
difference-of-squares71.0%
Applied egg-rr69.2%
Taylor expanded in angle around 0 69.2%
associate-*r*69.2%
+-commutative69.2%
*-commutative69.2%
+-commutative69.2%
Simplified69.2%
associate-*r*79.5%
+-commutative79.5%
distribute-lft-in76.5%
associate-*l*76.5%
associate-*l*76.5%
Applied egg-rr76.5%
if 1.18e8 < angle Initial program 30.3%
associate-*l*30.3%
*-commutative30.3%
associate-*l*30.3%
Simplified30.3%
Taylor expanded in angle around 0 21.0%
unpow230.3%
unpow230.3%
difference-of-squares32.0%
Applied egg-rr21.0%
add-sqr-sqrt15.1%
sqrt-unprod32.6%
pow232.6%
associate-*r*32.6%
Applied egg-rr32.6%
unpow232.6%
rem-sqrt-square30.3%
associate-*l*30.3%
difference-of-squares30.3%
unpow230.3%
unpow230.3%
Simplified30.3%
unpow230.3%
unpow230.3%
difference-of-squares32.0%
Applied egg-rr30.3%
Final simplification66.2%
b_m = (fabs.f64 b) angle\_m = (fabs.f64 angle) angle\_s = (copysign.f64 #s(literal 1 binary64) angle) (FPCore (angle_s a b_m angle_m) :precision binary64 (let* ((t_0 (* angle_m (* (- b_m a) PI)))) (* angle_s (* 0.011111111111111112 (+ (* b_m t_0) (* a t_0))))))
b_m = fabs(b);
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a, double b_m, double angle_m) {
double t_0 = angle_m * ((b_m - a) * ((double) M_PI));
return angle_s * (0.011111111111111112 * ((b_m * t_0) + (a * t_0)));
}
b_m = Math.abs(b);
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b_m, double angle_m) {
double t_0 = angle_m * ((b_m - a) * Math.PI);
return angle_s * (0.011111111111111112 * ((b_m * t_0) + (a * t_0)));
}
b_m = math.fabs(b) angle\_m = math.fabs(angle) angle\_s = math.copysign(1.0, angle) def code(angle_s, a, b_m, angle_m): t_0 = angle_m * ((b_m - a) * math.pi) return angle_s * (0.011111111111111112 * ((b_m * t_0) + (a * t_0)))
b_m = abs(b) angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a, b_m, angle_m) t_0 = Float64(angle_m * Float64(Float64(b_m - a) * pi)) return Float64(angle_s * Float64(0.011111111111111112 * Float64(Float64(b_m * t_0) + Float64(a * t_0)))) end
b_m = abs(b); angle\_m = abs(angle); angle\_s = sign(angle) * abs(1.0); function tmp = code(angle_s, a, b_m, angle_m) t_0 = angle_m * ((b_m - a) * pi); tmp = angle_s * (0.011111111111111112 * ((b_m * t_0) + (a * t_0))); end
b_m = N[Abs[b], $MachinePrecision]
angle\_m = N[Abs[angle], $MachinePrecision]
angle\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a_, b$95$m_, angle$95$m_] := Block[{t$95$0 = N[(angle$95$m * N[(N[(b$95$m - a), $MachinePrecision] * Pi), $MachinePrecision]), $MachinePrecision]}, N[(angle$95$s * N[(0.011111111111111112 * N[(N[(b$95$m * t$95$0), $MachinePrecision] + N[(a * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
b_m = \left|b\right|
\\
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
\begin{array}{l}
t_0 := angle\_m \cdot \left(\left(b\_m - a\right) \cdot \pi\right)\\
angle\_s \cdot \left(0.011111111111111112 \cdot \left(b\_m \cdot t\_0 + a \cdot t\_0\right)\right)
\end{array}
\end{array}
Initial program 60.0%
associate-*l*60.0%
*-commutative60.0%
associate-*l*60.0%
Simplified60.0%
Taylor expanded in angle around 0 56.9%
unpow260.0%
unpow260.0%
difference-of-squares62.4%
Applied egg-rr58.4%
Taylor expanded in angle around 0 58.4%
associate-*r*58.5%
+-commutative58.5%
*-commutative58.5%
+-commutative58.5%
Simplified58.5%
associate-*r*66.1%
+-commutative66.1%
distribute-lft-in62.6%
associate-*l*62.6%
associate-*l*62.5%
Applied egg-rr62.5%
Final simplification62.5%
b_m = (fabs.f64 b)
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a b_m angle_m)
:precision binary64
(*
angle_s
(if (<= b_m 1.35e+154)
(* angle_m (* (* (+ a b_m) (- b_m a)) (* PI 0.011111111111111112)))
(* 0.011111111111111112 (* (* angle_m b_m) (* b_m PI))))))b_m = fabs(b);
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a, double b_m, double angle_m) {
double tmp;
if (b_m <= 1.35e+154) {
tmp = angle_m * (((a + b_m) * (b_m - a)) * (((double) M_PI) * 0.011111111111111112));
} else {
tmp = 0.011111111111111112 * ((angle_m * b_m) * (b_m * ((double) M_PI)));
}
return angle_s * tmp;
}
b_m = Math.abs(b);
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b_m, double angle_m) {
double tmp;
if (b_m <= 1.35e+154) {
tmp = angle_m * (((a + b_m) * (b_m - a)) * (Math.PI * 0.011111111111111112));
} else {
tmp = 0.011111111111111112 * ((angle_m * b_m) * (b_m * Math.PI));
}
return angle_s * tmp;
}
b_m = math.fabs(b) angle\_m = math.fabs(angle) angle\_s = math.copysign(1.0, angle) def code(angle_s, a, b_m, angle_m): tmp = 0 if b_m <= 1.35e+154: tmp = angle_m * (((a + b_m) * (b_m - a)) * (math.pi * 0.011111111111111112)) else: tmp = 0.011111111111111112 * ((angle_m * b_m) * (b_m * math.pi)) return angle_s * tmp
b_m = abs(b) angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a, b_m, angle_m) tmp = 0.0 if (b_m <= 1.35e+154) tmp = Float64(angle_m * Float64(Float64(Float64(a + b_m) * Float64(b_m - a)) * Float64(pi * 0.011111111111111112))); else tmp = Float64(0.011111111111111112 * Float64(Float64(angle_m * b_m) * Float64(b_m * pi))); end return Float64(angle_s * tmp) end
b_m = abs(b); angle\_m = abs(angle); angle\_s = sign(angle) * abs(1.0); function tmp_2 = code(angle_s, a, b_m, angle_m) tmp = 0.0; if (b_m <= 1.35e+154) tmp = angle_m * (((a + b_m) * (b_m - a)) * (pi * 0.011111111111111112)); else tmp = 0.011111111111111112 * ((angle_m * b_m) * (b_m * pi)); end tmp_2 = angle_s * tmp; end
b_m = N[Abs[b], $MachinePrecision]
angle\_m = N[Abs[angle], $MachinePrecision]
angle\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a_, b$95$m_, angle$95$m_] := N[(angle$95$s * If[LessEqual[b$95$m, 1.35e+154], N[(angle$95$m * N[(N[(N[(a + b$95$m), $MachinePrecision] * N[(b$95$m - a), $MachinePrecision]), $MachinePrecision] * N[(Pi * 0.011111111111111112), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.011111111111111112 * N[(N[(angle$95$m * b$95$m), $MachinePrecision] * N[(b$95$m * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
b_m = \left|b\right|
\\
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;b\_m \leq 1.35 \cdot 10^{+154}:\\
\;\;\;\;angle\_m \cdot \left(\left(\left(a + b\_m\right) \cdot \left(b\_m - a\right)\right) \cdot \left(\pi \cdot 0.011111111111111112\right)\right)\\
\mathbf{else}:\\
\;\;\;\;0.011111111111111112 \cdot \left(\left(angle\_m \cdot b\_m\right) \cdot \left(b\_m \cdot \pi\right)\right)\\
\end{array}
\end{array}
if b < 1.35000000000000003e154Initial program 61.9%
associate-*l*61.9%
*-commutative61.9%
associate-*l*61.9%
Simplified61.9%
unpow261.9%
unpow261.9%
difference-of-squares62.8%
Applied egg-rr62.8%
Taylor expanded in angle around 0 42.4%
fma-define42.4%
associate-*r*42.4%
distribute-rgt-out42.4%
associate-*r*42.4%
metadata-eval42.4%
Simplified42.4%
Taylor expanded in angle around 0 58.0%
associate-*r*58.0%
+-commutative58.0%
*-commutative58.0%
+-commutative58.0%
Simplified58.0%
if 1.35000000000000003e154 < b Initial program 44.3%
associate-*l*44.3%
*-commutative44.3%
associate-*l*44.3%
Simplified44.3%
Taylor expanded in angle around 0 55.0%
unpow244.3%
unpow244.3%
difference-of-squares58.6%
Applied egg-rr65.8%
Taylor expanded in angle around 0 65.8%
associate-*r*65.8%
+-commutative65.8%
*-commutative65.8%
+-commutative65.8%
Simplified65.8%
Taylor expanded in a around 0 62.2%
Simplified79.2%
Final simplification60.3%
b_m = (fabs.f64 b)
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a b_m angle_m)
:precision binary64
(*
angle_s
(if (<= b_m 3.1e+151)
(* angle_m (* 0.011111111111111112 (* PI (* (+ a b_m) (- b_m a)))))
(* 0.011111111111111112 (* (* angle_m b_m) (* b_m PI))))))b_m = fabs(b);
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a, double b_m, double angle_m) {
double tmp;
if (b_m <= 3.1e+151) {
tmp = angle_m * (0.011111111111111112 * (((double) M_PI) * ((a + b_m) * (b_m - a))));
} else {
tmp = 0.011111111111111112 * ((angle_m * b_m) * (b_m * ((double) M_PI)));
}
return angle_s * tmp;
}
b_m = Math.abs(b);
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b_m, double angle_m) {
double tmp;
if (b_m <= 3.1e+151) {
tmp = angle_m * (0.011111111111111112 * (Math.PI * ((a + b_m) * (b_m - a))));
} else {
tmp = 0.011111111111111112 * ((angle_m * b_m) * (b_m * Math.PI));
}
return angle_s * tmp;
}
b_m = math.fabs(b) angle\_m = math.fabs(angle) angle\_s = math.copysign(1.0, angle) def code(angle_s, a, b_m, angle_m): tmp = 0 if b_m <= 3.1e+151: tmp = angle_m * (0.011111111111111112 * (math.pi * ((a + b_m) * (b_m - a)))) else: tmp = 0.011111111111111112 * ((angle_m * b_m) * (b_m * math.pi)) return angle_s * tmp
b_m = abs(b) angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a, b_m, angle_m) tmp = 0.0 if (b_m <= 3.1e+151) tmp = Float64(angle_m * Float64(0.011111111111111112 * Float64(pi * Float64(Float64(a + b_m) * Float64(b_m - a))))); else tmp = Float64(0.011111111111111112 * Float64(Float64(angle_m * b_m) * Float64(b_m * pi))); end return Float64(angle_s * tmp) end
b_m = abs(b); angle\_m = abs(angle); angle\_s = sign(angle) * abs(1.0); function tmp_2 = code(angle_s, a, b_m, angle_m) tmp = 0.0; if (b_m <= 3.1e+151) tmp = angle_m * (0.011111111111111112 * (pi * ((a + b_m) * (b_m - a)))); else tmp = 0.011111111111111112 * ((angle_m * b_m) * (b_m * pi)); end tmp_2 = angle_s * tmp; end
b_m = N[Abs[b], $MachinePrecision]
angle\_m = N[Abs[angle], $MachinePrecision]
angle\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a_, b$95$m_, angle$95$m_] := N[(angle$95$s * If[LessEqual[b$95$m, 3.1e+151], N[(angle$95$m * N[(0.011111111111111112 * N[(Pi * N[(N[(a + b$95$m), $MachinePrecision] * N[(b$95$m - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.011111111111111112 * N[(N[(angle$95$m * b$95$m), $MachinePrecision] * N[(b$95$m * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
b_m = \left|b\right|
\\
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;b\_m \leq 3.1 \cdot 10^{+151}:\\
\;\;\;\;angle\_m \cdot \left(0.011111111111111112 \cdot \left(\pi \cdot \left(\left(a + b\_m\right) \cdot \left(b\_m - a\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;0.011111111111111112 \cdot \left(\left(angle\_m \cdot b\_m\right) \cdot \left(b\_m \cdot \pi\right)\right)\\
\end{array}
\end{array}
if b < 3.1000000000000002e151Initial program 61.9%
associate-*l*61.9%
*-commutative61.9%
associate-*l*61.9%
Simplified61.9%
unpow261.9%
unpow261.9%
difference-of-squares62.8%
Applied egg-rr62.8%
Taylor expanded in angle around 0 42.4%
fma-define42.4%
associate-*r*42.4%
distribute-rgt-out42.4%
associate-*r*42.4%
metadata-eval42.4%
Simplified42.4%
Taylor expanded in angle around 0 58.0%
if 3.1000000000000002e151 < b Initial program 44.3%
associate-*l*44.3%
*-commutative44.3%
associate-*l*44.3%
Simplified44.3%
Taylor expanded in angle around 0 55.0%
unpow244.3%
unpow244.3%
difference-of-squares58.6%
Applied egg-rr65.8%
Taylor expanded in angle around 0 65.8%
associate-*r*65.8%
+-commutative65.8%
*-commutative65.8%
+-commutative65.8%
Simplified65.8%
Taylor expanded in a around 0 62.2%
Simplified79.2%
Final simplification60.3%
b_m = (fabs.f64 b)
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a b_m angle_m)
:precision binary64
(*
angle_s
(if (<= b_m 2.5e+141)
(* 0.011111111111111112 (* (* angle_m PI) (* (+ a b_m) (- b_m a))))
(* 0.011111111111111112 (* (* angle_m b_m) (* b_m PI))))))b_m = fabs(b);
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a, double b_m, double angle_m) {
double tmp;
if (b_m <= 2.5e+141) {
tmp = 0.011111111111111112 * ((angle_m * ((double) M_PI)) * ((a + b_m) * (b_m - a)));
} else {
tmp = 0.011111111111111112 * ((angle_m * b_m) * (b_m * ((double) M_PI)));
}
return angle_s * tmp;
}
b_m = Math.abs(b);
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b_m, double angle_m) {
double tmp;
if (b_m <= 2.5e+141) {
tmp = 0.011111111111111112 * ((angle_m * Math.PI) * ((a + b_m) * (b_m - a)));
} else {
tmp = 0.011111111111111112 * ((angle_m * b_m) * (b_m * Math.PI));
}
return angle_s * tmp;
}
b_m = math.fabs(b) angle\_m = math.fabs(angle) angle\_s = math.copysign(1.0, angle) def code(angle_s, a, b_m, angle_m): tmp = 0 if b_m <= 2.5e+141: tmp = 0.011111111111111112 * ((angle_m * math.pi) * ((a + b_m) * (b_m - a))) else: tmp = 0.011111111111111112 * ((angle_m * b_m) * (b_m * math.pi)) return angle_s * tmp
b_m = abs(b) angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a, b_m, angle_m) tmp = 0.0 if (b_m <= 2.5e+141) tmp = Float64(0.011111111111111112 * Float64(Float64(angle_m * pi) * Float64(Float64(a + b_m) * Float64(b_m - a)))); else tmp = Float64(0.011111111111111112 * Float64(Float64(angle_m * b_m) * Float64(b_m * pi))); end return Float64(angle_s * tmp) end
b_m = abs(b); angle\_m = abs(angle); angle\_s = sign(angle) * abs(1.0); function tmp_2 = code(angle_s, a, b_m, angle_m) tmp = 0.0; if (b_m <= 2.5e+141) tmp = 0.011111111111111112 * ((angle_m * pi) * ((a + b_m) * (b_m - a))); else tmp = 0.011111111111111112 * ((angle_m * b_m) * (b_m * pi)); end tmp_2 = angle_s * tmp; end
b_m = N[Abs[b], $MachinePrecision]
angle\_m = N[Abs[angle], $MachinePrecision]
angle\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a_, b$95$m_, angle$95$m_] := N[(angle$95$s * If[LessEqual[b$95$m, 2.5e+141], N[(0.011111111111111112 * N[(N[(angle$95$m * Pi), $MachinePrecision] * N[(N[(a + b$95$m), $MachinePrecision] * N[(b$95$m - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.011111111111111112 * N[(N[(angle$95$m * b$95$m), $MachinePrecision] * N[(b$95$m * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
b_m = \left|b\right|
\\
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;b\_m \leq 2.5 \cdot 10^{+141}:\\
\;\;\;\;0.011111111111111112 \cdot \left(\left(angle\_m \cdot \pi\right) \cdot \left(\left(a + b\_m\right) \cdot \left(b\_m - a\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;0.011111111111111112 \cdot \left(\left(angle\_m \cdot b\_m\right) \cdot \left(b\_m \cdot \pi\right)\right)\\
\end{array}
\end{array}
if b < 2.50000000000000013e141Initial program 61.4%
associate-*l*61.4%
*-commutative61.4%
associate-*l*61.4%
Simplified61.4%
unpow261.4%
unpow261.4%
difference-of-squares62.3%
Applied egg-rr62.3%
Taylor expanded in angle around 0 57.0%
associate-*r*57.0%
Simplified57.0%
if 2.50000000000000013e141 < b Initial program 49.6%
associate-*l*49.6%
*-commutative49.6%
associate-*l*49.6%
Simplified49.6%
Taylor expanded in angle around 0 59.3%
unpow249.6%
unpow249.6%
difference-of-squares62.5%
Applied egg-rr69.0%
Taylor expanded in angle around 0 69.0%
associate-*r*69.0%
+-commutative69.0%
*-commutative69.0%
+-commutative69.0%
Simplified69.0%
Taylor expanded in a around 0 65.8%
Simplified81.2%
Final simplification59.9%
b_m = (fabs.f64 b)
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a b_m angle_m)
:precision binary64
(*
angle_s
(if (<= b_m 1.3e+145)
(* 0.011111111111111112 (* angle_m (* PI (* (+ a b_m) (- b_m a)))))
(* 0.011111111111111112 (* (* angle_m b_m) (* b_m PI))))))b_m = fabs(b);
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a, double b_m, double angle_m) {
double tmp;
if (b_m <= 1.3e+145) {
tmp = 0.011111111111111112 * (angle_m * (((double) M_PI) * ((a + b_m) * (b_m - a))));
} else {
tmp = 0.011111111111111112 * ((angle_m * b_m) * (b_m * ((double) M_PI)));
}
return angle_s * tmp;
}
b_m = Math.abs(b);
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b_m, double angle_m) {
double tmp;
if (b_m <= 1.3e+145) {
tmp = 0.011111111111111112 * (angle_m * (Math.PI * ((a + b_m) * (b_m - a))));
} else {
tmp = 0.011111111111111112 * ((angle_m * b_m) * (b_m * Math.PI));
}
return angle_s * tmp;
}
b_m = math.fabs(b) angle\_m = math.fabs(angle) angle\_s = math.copysign(1.0, angle) def code(angle_s, a, b_m, angle_m): tmp = 0 if b_m <= 1.3e+145: tmp = 0.011111111111111112 * (angle_m * (math.pi * ((a + b_m) * (b_m - a)))) else: tmp = 0.011111111111111112 * ((angle_m * b_m) * (b_m * math.pi)) return angle_s * tmp
b_m = abs(b) angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a, b_m, angle_m) tmp = 0.0 if (b_m <= 1.3e+145) tmp = Float64(0.011111111111111112 * Float64(angle_m * Float64(pi * Float64(Float64(a + b_m) * Float64(b_m - a))))); else tmp = Float64(0.011111111111111112 * Float64(Float64(angle_m * b_m) * Float64(b_m * pi))); end return Float64(angle_s * tmp) end
b_m = abs(b); angle\_m = abs(angle); angle\_s = sign(angle) * abs(1.0); function tmp_2 = code(angle_s, a, b_m, angle_m) tmp = 0.0; if (b_m <= 1.3e+145) tmp = 0.011111111111111112 * (angle_m * (pi * ((a + b_m) * (b_m - a)))); else tmp = 0.011111111111111112 * ((angle_m * b_m) * (b_m * pi)); end tmp_2 = angle_s * tmp; end
b_m = N[Abs[b], $MachinePrecision]
angle\_m = N[Abs[angle], $MachinePrecision]
angle\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a_, b$95$m_, angle$95$m_] := N[(angle$95$s * If[LessEqual[b$95$m, 1.3e+145], N[(0.011111111111111112 * N[(angle$95$m * N[(Pi * N[(N[(a + b$95$m), $MachinePrecision] * N[(b$95$m - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.011111111111111112 * N[(N[(angle$95$m * b$95$m), $MachinePrecision] * N[(b$95$m * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
b_m = \left|b\right|
\\
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;b\_m \leq 1.3 \cdot 10^{+145}:\\
\;\;\;\;0.011111111111111112 \cdot \left(angle\_m \cdot \left(\pi \cdot \left(\left(a + b\_m\right) \cdot \left(b\_m - a\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;0.011111111111111112 \cdot \left(\left(angle\_m \cdot b\_m\right) \cdot \left(b\_m \cdot \pi\right)\right)\\
\end{array}
\end{array}
if b < 1.30000000000000001e145Initial program 61.6%
associate-*l*61.6%
*-commutative61.6%
associate-*l*61.6%
Simplified61.6%
Taylor expanded in angle around 0 56.7%
unpow261.6%
unpow261.6%
difference-of-squares62.5%
Applied egg-rr57.2%
if 1.30000000000000001e145 < b Initial program 48.0%
associate-*l*48.0%
*-commutative48.0%
associate-*l*48.0%
Simplified48.0%
Taylor expanded in angle around 0 58.0%
unpow248.0%
unpow248.0%
difference-of-squares61.3%
Applied egg-rr68.0%
Taylor expanded in angle around 0 68.0%
associate-*r*68.0%
+-commutative68.0%
*-commutative68.0%
+-commutative68.0%
Simplified68.0%
Taylor expanded in a around 0 64.7%
Simplified80.5%
Final simplification59.9%
b_m = (fabs.f64 b) angle\_m = (fabs.f64 angle) angle\_s = (copysign.f64 #s(literal 1 binary64) angle) (FPCore (angle_s a b_m angle_m) :precision binary64 (* angle_s (* 0.011111111111111112 (* (* angle_m b_m) (* b_m PI)))))
b_m = fabs(b);
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a, double b_m, double angle_m) {
return angle_s * (0.011111111111111112 * ((angle_m * b_m) * (b_m * ((double) M_PI))));
}
b_m = Math.abs(b);
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b_m, double angle_m) {
return angle_s * (0.011111111111111112 * ((angle_m * b_m) * (b_m * Math.PI)));
}
b_m = math.fabs(b) angle\_m = math.fabs(angle) angle\_s = math.copysign(1.0, angle) def code(angle_s, a, b_m, angle_m): return angle_s * (0.011111111111111112 * ((angle_m * b_m) * (b_m * math.pi)))
b_m = abs(b) angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a, b_m, angle_m) return Float64(angle_s * Float64(0.011111111111111112 * Float64(Float64(angle_m * b_m) * Float64(b_m * pi)))) end
b_m = abs(b); angle\_m = abs(angle); angle\_s = sign(angle) * abs(1.0); function tmp = code(angle_s, a, b_m, angle_m) tmp = angle_s * (0.011111111111111112 * ((angle_m * b_m) * (b_m * pi))); end
b_m = N[Abs[b], $MachinePrecision]
angle\_m = N[Abs[angle], $MachinePrecision]
angle\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a_, b$95$m_, angle$95$m_] := N[(angle$95$s * N[(0.011111111111111112 * N[(N[(angle$95$m * b$95$m), $MachinePrecision] * N[(b$95$m * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
b_m = \left|b\right|
\\
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
angle\_s \cdot \left(0.011111111111111112 \cdot \left(\left(angle\_m \cdot b\_m\right) \cdot \left(b\_m \cdot \pi\right)\right)\right)
\end{array}
Initial program 60.0%
associate-*l*60.0%
*-commutative60.0%
associate-*l*60.0%
Simplified60.0%
Taylor expanded in angle around 0 56.9%
unpow260.0%
unpow260.0%
difference-of-squares62.4%
Applied egg-rr58.4%
Taylor expanded in angle around 0 58.4%
associate-*r*58.5%
+-commutative58.5%
*-commutative58.5%
+-commutative58.5%
Simplified58.5%
Taylor expanded in a around 0 36.8%
Simplified40.0%
Final simplification40.0%
herbie shell --seed 2024102
(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)))))