
(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 16 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (a b angle) :precision binary64 (let* ((t_0 (* PI (/ angle 180.0)))) (* (* (* 2.0 (- (pow b 2.0) (pow a 2.0))) (sin t_0)) (cos t_0))))
double code(double a, double b, double angle) {
double t_0 = ((double) M_PI) * (angle / 180.0);
return ((2.0 * (pow(b, 2.0) - pow(a, 2.0))) * sin(t_0)) * cos(t_0);
}
public static double code(double a, double b, double angle) {
double t_0 = Math.PI * (angle / 180.0);
return ((2.0 * (Math.pow(b, 2.0) - Math.pow(a, 2.0))) * Math.sin(t_0)) * Math.cos(t_0);
}
def code(a, b, angle): t_0 = math.pi * (angle / 180.0) return ((2.0 * (math.pow(b, 2.0) - math.pow(a, 2.0))) * math.sin(t_0)) * math.cos(t_0)
function code(a, b, angle) t_0 = Float64(pi * Float64(angle / 180.0)) return Float64(Float64(Float64(2.0 * Float64((b ^ 2.0) - (a ^ 2.0))) * sin(t_0)) * cos(t_0)) end
function tmp = code(a, b, angle) t_0 = pi * (angle / 180.0); tmp = ((2.0 * ((b ^ 2.0) - (a ^ 2.0))) * sin(t_0)) * cos(t_0); end
code[a_, b_, angle_] := Block[{t$95$0 = N[(Pi * N[(angle / 180.0), $MachinePrecision]), $MachinePrecision]}, N[(N[(N[(2.0 * N[(N[Power[b, 2.0], $MachinePrecision] - N[Power[a, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision] * N[Cos[t$95$0], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \pi \cdot \frac{angle}{180}\\
\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin t\_0\right) \cdot \cos t\_0
\end{array}
\end{array}
a_m = (fabs.f64 a)
angle_m = (fabs.f64 angle)
angle_s = (copysign.f64 1 angle)
(FPCore (angle_s a_m b angle_m)
:precision binary64
(let* ((t_0 (* 2.0 (* (- b a_m) (+ b a_m))))
(t_1 (* 2.0 (+ b a_m)))
(t_2 (* PI (/ angle_m 180.0)))
(t_3 (cos t_2)))
(*
angle_s
(if (<= (/ angle_m 180.0) 5e-25)
(* t_3 (* (- b a_m) (* t_1 (* angle_m (* PI 0.005555555555555556)))))
(if (<= (/ angle_m 180.0) 4e+155)
(* t_3 (* t_0 (sin t_2)))
(if (<= (/ angle_m 180.0) 2e+190)
(* t_0 (sin (* angle_m (/ PI 180.0))))
(*
t_3
(*
t_1
(* (- b a_m) (sin (* 0.005555555555555556 (* PI angle_m))))))))))))a_m = fabs(a);
angle_m = fabs(angle);
angle_s = copysign(1.0, angle);
double code(double angle_s, double a_m, double b, double angle_m) {
double t_0 = 2.0 * ((b - a_m) * (b + a_m));
double t_1 = 2.0 * (b + a_m);
double t_2 = ((double) M_PI) * (angle_m / 180.0);
double t_3 = cos(t_2);
double tmp;
if ((angle_m / 180.0) <= 5e-25) {
tmp = t_3 * ((b - a_m) * (t_1 * (angle_m * (((double) M_PI) * 0.005555555555555556))));
} else if ((angle_m / 180.0) <= 4e+155) {
tmp = t_3 * (t_0 * sin(t_2));
} else if ((angle_m / 180.0) <= 2e+190) {
tmp = t_0 * sin((angle_m * (((double) M_PI) / 180.0)));
} else {
tmp = t_3 * (t_1 * ((b - a_m) * sin((0.005555555555555556 * (((double) M_PI) * angle_m)))));
}
return angle_s * tmp;
}
a_m = Math.abs(a);
angle_m = Math.abs(angle);
angle_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a_m, double b, double angle_m) {
double t_0 = 2.0 * ((b - a_m) * (b + a_m));
double t_1 = 2.0 * (b + a_m);
double t_2 = Math.PI * (angle_m / 180.0);
double t_3 = Math.cos(t_2);
double tmp;
if ((angle_m / 180.0) <= 5e-25) {
tmp = t_3 * ((b - a_m) * (t_1 * (angle_m * (Math.PI * 0.005555555555555556))));
} else if ((angle_m / 180.0) <= 4e+155) {
tmp = t_3 * (t_0 * Math.sin(t_2));
} else if ((angle_m / 180.0) <= 2e+190) {
tmp = t_0 * Math.sin((angle_m * (Math.PI / 180.0)));
} else {
tmp = t_3 * (t_1 * ((b - a_m) * Math.sin((0.005555555555555556 * (Math.PI * angle_m)))));
}
return angle_s * tmp;
}
a_m = math.fabs(a) angle_m = math.fabs(angle) angle_s = math.copysign(1.0, angle) def code(angle_s, a_m, b, angle_m): t_0 = 2.0 * ((b - a_m) * (b + a_m)) t_1 = 2.0 * (b + a_m) t_2 = math.pi * (angle_m / 180.0) t_3 = math.cos(t_2) tmp = 0 if (angle_m / 180.0) <= 5e-25: tmp = t_3 * ((b - a_m) * (t_1 * (angle_m * (math.pi * 0.005555555555555556)))) elif (angle_m / 180.0) <= 4e+155: tmp = t_3 * (t_0 * math.sin(t_2)) elif (angle_m / 180.0) <= 2e+190: tmp = t_0 * math.sin((angle_m * (math.pi / 180.0))) else: tmp = t_3 * (t_1 * ((b - a_m) * math.sin((0.005555555555555556 * (math.pi * angle_m))))) return angle_s * tmp
a_m = abs(a) angle_m = abs(angle) angle_s = copysign(1.0, angle) function code(angle_s, a_m, b, angle_m) t_0 = Float64(2.0 * Float64(Float64(b - a_m) * Float64(b + a_m))) t_1 = Float64(2.0 * Float64(b + a_m)) t_2 = Float64(pi * Float64(angle_m / 180.0)) t_3 = cos(t_2) tmp = 0.0 if (Float64(angle_m / 180.0) <= 5e-25) tmp = Float64(t_3 * Float64(Float64(b - a_m) * Float64(t_1 * Float64(angle_m * Float64(pi * 0.005555555555555556))))); elseif (Float64(angle_m / 180.0) <= 4e+155) tmp = Float64(t_3 * Float64(t_0 * sin(t_2))); elseif (Float64(angle_m / 180.0) <= 2e+190) tmp = Float64(t_0 * sin(Float64(angle_m * Float64(pi / 180.0)))); else tmp = Float64(t_3 * Float64(t_1 * Float64(Float64(b - a_m) * sin(Float64(0.005555555555555556 * Float64(pi * angle_m)))))); end return Float64(angle_s * tmp) end
a_m = abs(a); angle_m = abs(angle); angle_s = sign(angle) * abs(1.0); function tmp_2 = code(angle_s, a_m, b, angle_m) t_0 = 2.0 * ((b - a_m) * (b + a_m)); t_1 = 2.0 * (b + a_m); t_2 = pi * (angle_m / 180.0); t_3 = cos(t_2); tmp = 0.0; if ((angle_m / 180.0) <= 5e-25) tmp = t_3 * ((b - a_m) * (t_1 * (angle_m * (pi * 0.005555555555555556)))); elseif ((angle_m / 180.0) <= 4e+155) tmp = t_3 * (t_0 * sin(t_2)); elseif ((angle_m / 180.0) <= 2e+190) tmp = t_0 * sin((angle_m * (pi / 180.0))); else tmp = t_3 * (t_1 * ((b - a_m) * sin((0.005555555555555556 * (pi * angle_m))))); end tmp_2 = angle_s * tmp; end
a_m = N[Abs[a], $MachinePrecision]
angle_m = N[Abs[angle], $MachinePrecision]
angle_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a$95$m_, b_, angle$95$m_] := Block[{t$95$0 = N[(2.0 * N[(N[(b - a$95$m), $MachinePrecision] * N[(b + a$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(2.0 * N[(b + a$95$m), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(Pi * N[(angle$95$m / 180.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[Cos[t$95$2], $MachinePrecision]}, N[(angle$95$s * If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 5e-25], N[(t$95$3 * N[(N[(b - a$95$m), $MachinePrecision] * N[(t$95$1 * N[(angle$95$m * N[(Pi * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 4e+155], N[(t$95$3 * N[(t$95$0 * N[Sin[t$95$2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 2e+190], N[(t$95$0 * N[Sin[N[(angle$95$m * N[(Pi / 180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(t$95$3 * N[(t$95$1 * N[(N[(b - a$95$m), $MachinePrecision] * N[Sin[N[(0.005555555555555556 * N[(Pi * angle$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]), $MachinePrecision]]]]]
\begin{array}{l}
a_m = \left|a\right|
\\
angle_m = \left|angle\right|
\\
angle_s = \mathsf{copysign}\left(1, angle\right)
\\
\begin{array}{l}
t_0 := 2 \cdot \left(\left(b - a\_m\right) \cdot \left(b + a\_m\right)\right)\\
t_1 := 2 \cdot \left(b + a\_m\right)\\
t_2 := \pi \cdot \frac{angle\_m}{180}\\
t_3 := \cos t\_2\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;\frac{angle\_m}{180} \leq 5 \cdot 10^{-25}:\\
\;\;\;\;t\_3 \cdot \left(\left(b - a\_m\right) \cdot \left(t\_1 \cdot \left(angle\_m \cdot \left(\pi \cdot 0.005555555555555556\right)\right)\right)\right)\\
\mathbf{elif}\;\frac{angle\_m}{180} \leq 4 \cdot 10^{+155}:\\
\;\;\;\;t\_3 \cdot \left(t\_0 \cdot \sin t\_2\right)\\
\mathbf{elif}\;\frac{angle\_m}{180} \leq 2 \cdot 10^{+190}:\\
\;\;\;\;t\_0 \cdot \sin \left(angle\_m \cdot \frac{\pi}{180}\right)\\
\mathbf{else}:\\
\;\;\;\;t\_3 \cdot \left(t\_1 \cdot \left(\left(b - a\_m\right) \cdot \sin \left(0.005555555555555556 \cdot \left(\pi \cdot angle\_m\right)\right)\right)\right)\\
\end{array}
\end{array}
\end{array}
if (/.f64 angle 180) < 4.99999999999999962e-25Initial program 60.9%
add-cbrt-cube41.2%
pow1/329.8%
pow329.8%
*-commutative29.8%
div-inv29.8%
metadata-eval29.8%
Applied egg-rr29.8%
unpow1/340.7%
rem-cbrt-cube60.3%
*-commutative60.3%
*-commutative60.3%
*-commutative60.3%
unpow260.3%
unpow260.3%
difference-of-squares63.5%
associate-*r*63.5%
associate-*l*76.4%
Applied egg-rr76.4%
associate-*r*63.5%
*-commutative63.5%
associate-*l*76.4%
*-commutative76.4%
*-commutative76.4%
+-commutative76.4%
Simplified76.4%
Taylor expanded in angle around 0 71.3%
associate-*r*71.3%
*-commutative71.3%
associate-*r*71.4%
*-commutative71.4%
*-commutative71.4%
Simplified71.4%
if 4.99999999999999962e-25 < (/.f64 angle 180) < 4.00000000000000003e155Initial program 74.1%
unpow274.1%
unpow274.1%
difference-of-squares74.1%
Applied egg-rr74.1%
if 4.00000000000000003e155 < (/.f64 angle 180) < 2.0000000000000001e190Initial program 19.6%
unpow219.6%
unpow219.6%
difference-of-squares19.6%
Applied egg-rr19.6%
Taylor expanded in angle around 0 60.0%
clear-num51.7%
un-div-inv60.0%
Applied egg-rr60.0%
associate-/r/68.3%
Simplified68.3%
if 2.0000000000000001e190 < (/.f64 angle 180) Initial program 38.4%
add-cbrt-cube34.8%
pow1/326.1%
pow326.1%
*-commutative26.1%
div-inv25.3%
metadata-eval25.3%
Applied egg-rr25.3%
unpow1/334.4%
rem-cbrt-cube38.4%
*-commutative38.4%
*-commutative38.4%
*-commutative38.4%
unpow238.4%
unpow238.4%
difference-of-squares46.4%
associate-*r*46.4%
associate-*l*46.4%
Applied egg-rr46.4%
+-commutative46.4%
associate-*r*45.7%
*-commutative45.7%
*-commutative45.7%
Simplified45.7%
Final simplification69.1%
a_m = (fabs.f64 a)
angle_m = (fabs.f64 angle)
angle_s = (copysign.f64 1 angle)
(FPCore (angle_s a_m b angle_m)
:precision binary64
(let* ((t_0 (* 2.0 (+ b a_m))) (t_1 (* PI (* 0.005555555555555556 angle_m))))
(*
angle_s
(if (<= b 1.15e+244)
(* (cbrt (pow (cos t_1) 3.0)) (* (- b a_m) (* t_0 (sin t_1))))
(*
(*
(- b a_m)
(* t_0 (sin (expm1 (log1p (* angle_m (* PI 0.005555555555555556)))))))
(cos (* PI (/ angle_m 180.0))))))))a_m = fabs(a);
angle_m = fabs(angle);
angle_s = copysign(1.0, angle);
double code(double angle_s, double a_m, double b, double angle_m) {
double t_0 = 2.0 * (b + a_m);
double t_1 = ((double) M_PI) * (0.005555555555555556 * angle_m);
double tmp;
if (b <= 1.15e+244) {
tmp = cbrt(pow(cos(t_1), 3.0)) * ((b - a_m) * (t_0 * sin(t_1)));
} else {
tmp = ((b - a_m) * (t_0 * sin(expm1(log1p((angle_m * (((double) M_PI) * 0.005555555555555556))))))) * cos((((double) M_PI) * (angle_m / 180.0)));
}
return angle_s * tmp;
}
a_m = Math.abs(a);
angle_m = Math.abs(angle);
angle_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a_m, double b, double angle_m) {
double t_0 = 2.0 * (b + a_m);
double t_1 = Math.PI * (0.005555555555555556 * angle_m);
double tmp;
if (b <= 1.15e+244) {
tmp = Math.cbrt(Math.pow(Math.cos(t_1), 3.0)) * ((b - a_m) * (t_0 * Math.sin(t_1)));
} else {
tmp = ((b - a_m) * (t_0 * Math.sin(Math.expm1(Math.log1p((angle_m * (Math.PI * 0.005555555555555556))))))) * Math.cos((Math.PI * (angle_m / 180.0)));
}
return angle_s * tmp;
}
a_m = abs(a) angle_m = abs(angle) angle_s = copysign(1.0, angle) function code(angle_s, a_m, b, angle_m) t_0 = Float64(2.0 * Float64(b + a_m)) t_1 = Float64(pi * Float64(0.005555555555555556 * angle_m)) tmp = 0.0 if (b <= 1.15e+244) tmp = Float64(cbrt((cos(t_1) ^ 3.0)) * Float64(Float64(b - a_m) * Float64(t_0 * sin(t_1)))); else tmp = Float64(Float64(Float64(b - a_m) * Float64(t_0 * sin(expm1(log1p(Float64(angle_m * Float64(pi * 0.005555555555555556))))))) * cos(Float64(pi * Float64(angle_m / 180.0)))); end return Float64(angle_s * tmp) end
a_m = N[Abs[a], $MachinePrecision]
angle_m = N[Abs[angle], $MachinePrecision]
angle_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a$95$m_, b_, angle$95$m_] := Block[{t$95$0 = N[(2.0 * N[(b + a$95$m), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(Pi * N[(0.005555555555555556 * angle$95$m), $MachinePrecision]), $MachinePrecision]}, N[(angle$95$s * If[LessEqual[b, 1.15e+244], N[(N[Power[N[Power[N[Cos[t$95$1], $MachinePrecision], 3.0], $MachinePrecision], 1/3], $MachinePrecision] * N[(N[(b - a$95$m), $MachinePrecision] * N[(t$95$0 * N[Sin[t$95$1], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(b - a$95$m), $MachinePrecision] * N[(t$95$0 * N[Sin[N[(Exp[N[Log[1 + N[(angle$95$m * N[(Pi * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]] - 1), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Cos[N[(Pi * N[(angle$95$m / 180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]]]
\begin{array}{l}
a_m = \left|a\right|
\\
angle_m = \left|angle\right|
\\
angle_s = \mathsf{copysign}\left(1, angle\right)
\\
\begin{array}{l}
t_0 := 2 \cdot \left(b + a\_m\right)\\
t_1 := \pi \cdot \left(0.005555555555555556 \cdot angle\_m\right)\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;b \leq 1.15 \cdot 10^{+244}:\\
\;\;\;\;\sqrt[3]{{\cos t\_1}^{3}} \cdot \left(\left(b - a\_m\right) \cdot \left(t\_0 \cdot \sin t\_1\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(b - a\_m\right) \cdot \left(t\_0 \cdot \sin \left(\mathsf{expm1}\left(\mathsf{log1p}\left(angle\_m \cdot \left(\pi \cdot 0.005555555555555556\right)\right)\right)\right)\right)\right) \cdot \cos \left(\pi \cdot \frac{angle\_m}{180}\right)\\
\end{array}
\end{array}
\end{array}
if b < 1.15e244Initial program 58.9%
add-cbrt-cube42.3%
pow1/331.2%
pow331.2%
*-commutative31.2%
div-inv31.1%
metadata-eval31.1%
Applied egg-rr31.1%
unpow1/342.7%
rem-cbrt-cube59.3%
*-commutative59.3%
*-commutative59.3%
*-commutative59.3%
unpow259.3%
unpow259.3%
difference-of-squares61.8%
associate-*r*61.8%
associate-*l*71.0%
Applied egg-rr71.0%
associate-*r*61.8%
*-commutative61.8%
associate-*l*71.0%
*-commutative71.0%
*-commutative71.0%
+-commutative71.0%
Simplified71.0%
add-cbrt-cube71.0%
pow371.0%
div-inv71.6%
metadata-eval71.6%
Applied egg-rr71.6%
if 1.15e244 < b Initial program 50.9%
add-cbrt-cube50.9%
pow1/337.9%
pow337.9%
*-commutative37.9%
div-inv37.9%
metadata-eval37.9%
Applied egg-rr37.9%
unpow1/344.6%
rem-cbrt-cube44.6%
*-commutative44.6%
*-commutative44.6%
*-commutative44.6%
unpow244.6%
unpow244.6%
difference-of-squares57.1%
associate-*r*57.1%
associate-*l*68.8%
Applied egg-rr68.8%
associate-*r*57.1%
*-commutative57.1%
associate-*l*68.8%
*-commutative68.8%
*-commutative68.8%
+-commutative68.8%
Simplified68.8%
*-commutative68.8%
associate-*r*68.8%
metadata-eval68.8%
div-inv68.7%
add-sqr-sqrt37.5%
associate-/l*31.2%
expm1-log1p-u43.7%
associate-/l*43.8%
add-sqr-sqrt68.7%
div-inv68.8%
*-commutative68.8%
metadata-eval68.8%
associate-*l*68.8%
Applied egg-rr68.8%
Final simplification71.4%
a_m = (fabs.f64 a)
angle_m = (fabs.f64 angle)
angle_s = (copysign.f64 1 angle)
(FPCore (angle_s a_m b angle_m)
:precision binary64
(let* ((t_0 (* PI (* 0.005555555555555556 angle_m)))
(t_1 (cos (* PI (/ angle_m 180.0)))))
(*
angle_s
(if (<= b 3.7e+250)
(* t_1 (* (- b a_m) (* (* 2.0 (+ b a_m)) (sin t_0))))
(* t_1 (* (* 2.0 (* (- b a_m) (+ b a_m))) (sin (expm1 (log1p t_0)))))))))a_m = fabs(a);
angle_m = fabs(angle);
angle_s = copysign(1.0, angle);
double code(double angle_s, double a_m, double b, double angle_m) {
double t_0 = ((double) M_PI) * (0.005555555555555556 * angle_m);
double t_1 = cos((((double) M_PI) * (angle_m / 180.0)));
double tmp;
if (b <= 3.7e+250) {
tmp = t_1 * ((b - a_m) * ((2.0 * (b + a_m)) * sin(t_0)));
} else {
tmp = t_1 * ((2.0 * ((b - a_m) * (b + a_m))) * sin(expm1(log1p(t_0))));
}
return angle_s * tmp;
}
a_m = Math.abs(a);
angle_m = Math.abs(angle);
angle_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a_m, double b, double angle_m) {
double t_0 = Math.PI * (0.005555555555555556 * angle_m);
double t_1 = Math.cos((Math.PI * (angle_m / 180.0)));
double tmp;
if (b <= 3.7e+250) {
tmp = t_1 * ((b - a_m) * ((2.0 * (b + a_m)) * Math.sin(t_0)));
} else {
tmp = t_1 * ((2.0 * ((b - a_m) * (b + a_m))) * Math.sin(Math.expm1(Math.log1p(t_0))));
}
return angle_s * tmp;
}
a_m = math.fabs(a) angle_m = math.fabs(angle) angle_s = math.copysign(1.0, angle) def code(angle_s, a_m, b, angle_m): t_0 = math.pi * (0.005555555555555556 * angle_m) t_1 = math.cos((math.pi * (angle_m / 180.0))) tmp = 0 if b <= 3.7e+250: tmp = t_1 * ((b - a_m) * ((2.0 * (b + a_m)) * math.sin(t_0))) else: tmp = t_1 * ((2.0 * ((b - a_m) * (b + a_m))) * math.sin(math.expm1(math.log1p(t_0)))) return angle_s * tmp
a_m = abs(a) angle_m = abs(angle) angle_s = copysign(1.0, angle) function code(angle_s, a_m, b, angle_m) t_0 = Float64(pi * Float64(0.005555555555555556 * angle_m)) t_1 = cos(Float64(pi * Float64(angle_m / 180.0))) tmp = 0.0 if (b <= 3.7e+250) tmp = Float64(t_1 * Float64(Float64(b - a_m) * Float64(Float64(2.0 * Float64(b + a_m)) * sin(t_0)))); else tmp = Float64(t_1 * Float64(Float64(2.0 * Float64(Float64(b - a_m) * Float64(b + a_m))) * sin(expm1(log1p(t_0))))); end return Float64(angle_s * tmp) end
a_m = N[Abs[a], $MachinePrecision]
angle_m = N[Abs[angle], $MachinePrecision]
angle_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a$95$m_, b_, angle$95$m_] := Block[{t$95$0 = N[(Pi * N[(0.005555555555555556 * angle$95$m), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Cos[N[(Pi * N[(angle$95$m / 180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, N[(angle$95$s * If[LessEqual[b, 3.7e+250], N[(t$95$1 * N[(N[(b - a$95$m), $MachinePrecision] * N[(N[(2.0 * N[(b + a$95$m), $MachinePrecision]), $MachinePrecision] * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$1 * N[(N[(2.0 * N[(N[(b - a$95$m), $MachinePrecision] * N[(b + a$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sin[N[(Exp[N[Log[1 + t$95$0], $MachinePrecision]] - 1), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]]]
\begin{array}{l}
a_m = \left|a\right|
\\
angle_m = \left|angle\right|
\\
angle_s = \mathsf{copysign}\left(1, angle\right)
\\
\begin{array}{l}
t_0 := \pi \cdot \left(0.005555555555555556 \cdot angle\_m\right)\\
t_1 := \cos \left(\pi \cdot \frac{angle\_m}{180}\right)\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;b \leq 3.7 \cdot 10^{+250}:\\
\;\;\;\;t\_1 \cdot \left(\left(b - a\_m\right) \cdot \left(\left(2 \cdot \left(b + a\_m\right)\right) \cdot \sin t\_0\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1 \cdot \left(\left(2 \cdot \left(\left(b - a\_m\right) \cdot \left(b + a\_m\right)\right)\right) \cdot \sin \left(\mathsf{expm1}\left(\mathsf{log1p}\left(t\_0\right)\right)\right)\right)\\
\end{array}
\end{array}
\end{array}
if b < 3.70000000000000003e250Initial program 59.1%
add-cbrt-cube42.5%
pow1/331.5%
pow331.5%
*-commutative31.5%
div-inv31.4%
metadata-eval31.4%
Applied egg-rr31.4%
unpow1/343.0%
rem-cbrt-cube59.4%
*-commutative59.4%
*-commutative59.4%
*-commutative59.4%
unpow259.4%
unpow259.4%
difference-of-squares62.0%
associate-*r*62.0%
associate-*l*71.2%
Applied egg-rr71.2%
associate-*r*62.0%
*-commutative62.0%
associate-*l*71.2%
*-commutative71.2%
*-commutative71.2%
+-commutative71.2%
Simplified71.2%
if 3.70000000000000003e250 < b Initial program 47.6%
unpow247.6%
unpow247.6%
difference-of-squares54.3%
Applied egg-rr54.3%
div-inv54.3%
metadata-eval54.3%
expm1-log1p-u61.0%
Applied egg-rr61.0%
Final simplification70.6%
a_m = (fabs.f64 a)
angle_m = (fabs.f64 angle)
angle_s = (copysign.f64 1 angle)
(FPCore (angle_s a_m b angle_m)
:precision binary64
(let* ((t_0 (* 2.0 (+ b a_m))) (t_1 (cos (* PI (/ angle_m 180.0)))))
(*
angle_s
(if (<= b 5.8e+243)
(*
t_1
(* (- b a_m) (* t_0 (sin (* PI (* 0.005555555555555556 angle_m))))))
(*
(*
(- b a_m)
(* t_0 (sin (expm1 (log1p (* angle_m (* PI 0.005555555555555556)))))))
t_1)))))a_m = fabs(a);
angle_m = fabs(angle);
angle_s = copysign(1.0, angle);
double code(double angle_s, double a_m, double b, double angle_m) {
double t_0 = 2.0 * (b + a_m);
double t_1 = cos((((double) M_PI) * (angle_m / 180.0)));
double tmp;
if (b <= 5.8e+243) {
tmp = t_1 * ((b - a_m) * (t_0 * sin((((double) M_PI) * (0.005555555555555556 * angle_m)))));
} else {
tmp = ((b - a_m) * (t_0 * sin(expm1(log1p((angle_m * (((double) M_PI) * 0.005555555555555556))))))) * t_1;
}
return angle_s * tmp;
}
a_m = Math.abs(a);
angle_m = Math.abs(angle);
angle_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a_m, double b, double angle_m) {
double t_0 = 2.0 * (b + a_m);
double t_1 = Math.cos((Math.PI * (angle_m / 180.0)));
double tmp;
if (b <= 5.8e+243) {
tmp = t_1 * ((b - a_m) * (t_0 * Math.sin((Math.PI * (0.005555555555555556 * angle_m)))));
} else {
tmp = ((b - a_m) * (t_0 * Math.sin(Math.expm1(Math.log1p((angle_m * (Math.PI * 0.005555555555555556))))))) * t_1;
}
return angle_s * tmp;
}
a_m = math.fabs(a) angle_m = math.fabs(angle) angle_s = math.copysign(1.0, angle) def code(angle_s, a_m, b, angle_m): t_0 = 2.0 * (b + a_m) t_1 = math.cos((math.pi * (angle_m / 180.0))) tmp = 0 if b <= 5.8e+243: tmp = t_1 * ((b - a_m) * (t_0 * math.sin((math.pi * (0.005555555555555556 * angle_m))))) else: tmp = ((b - a_m) * (t_0 * math.sin(math.expm1(math.log1p((angle_m * (math.pi * 0.005555555555555556))))))) * t_1 return angle_s * tmp
a_m = abs(a) angle_m = abs(angle) angle_s = copysign(1.0, angle) function code(angle_s, a_m, b, angle_m) t_0 = Float64(2.0 * Float64(b + a_m)) t_1 = cos(Float64(pi * Float64(angle_m / 180.0))) tmp = 0.0 if (b <= 5.8e+243) tmp = Float64(t_1 * Float64(Float64(b - a_m) * Float64(t_0 * sin(Float64(pi * Float64(0.005555555555555556 * angle_m)))))); else tmp = Float64(Float64(Float64(b - a_m) * Float64(t_0 * sin(expm1(log1p(Float64(angle_m * Float64(pi * 0.005555555555555556))))))) * t_1); end return Float64(angle_s * tmp) end
a_m = N[Abs[a], $MachinePrecision]
angle_m = N[Abs[angle], $MachinePrecision]
angle_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a$95$m_, b_, angle$95$m_] := Block[{t$95$0 = N[(2.0 * N[(b + a$95$m), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Cos[N[(Pi * N[(angle$95$m / 180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, N[(angle$95$s * If[LessEqual[b, 5.8e+243], N[(t$95$1 * N[(N[(b - a$95$m), $MachinePrecision] * N[(t$95$0 * N[Sin[N[(Pi * N[(0.005555555555555556 * angle$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(b - a$95$m), $MachinePrecision] * N[(t$95$0 * N[Sin[N[(Exp[N[Log[1 + N[(angle$95$m * N[(Pi * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]] - 1), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision]]), $MachinePrecision]]]
\begin{array}{l}
a_m = \left|a\right|
\\
angle_m = \left|angle\right|
\\
angle_s = \mathsf{copysign}\left(1, angle\right)
\\
\begin{array}{l}
t_0 := 2 \cdot \left(b + a\_m\right)\\
t_1 := \cos \left(\pi \cdot \frac{angle\_m}{180}\right)\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;b \leq 5.8 \cdot 10^{+243}:\\
\;\;\;\;t\_1 \cdot \left(\left(b - a\_m\right) \cdot \left(t\_0 \cdot \sin \left(\pi \cdot \left(0.005555555555555556 \cdot angle\_m\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(b - a\_m\right) \cdot \left(t\_0 \cdot \sin \left(\mathsf{expm1}\left(\mathsf{log1p}\left(angle\_m \cdot \left(\pi \cdot 0.005555555555555556\right)\right)\right)\right)\right)\right) \cdot t\_1\\
\end{array}
\end{array}
\end{array}
if b < 5.80000000000000013e243Initial program 58.9%
add-cbrt-cube42.3%
pow1/331.2%
pow331.2%
*-commutative31.2%
div-inv31.1%
metadata-eval31.1%
Applied egg-rr31.1%
unpow1/342.7%
rem-cbrt-cube59.3%
*-commutative59.3%
*-commutative59.3%
*-commutative59.3%
unpow259.3%
unpow259.3%
difference-of-squares61.8%
associate-*r*61.8%
associate-*l*71.0%
Applied egg-rr71.0%
associate-*r*61.8%
*-commutative61.8%
associate-*l*71.0%
*-commutative71.0%
*-commutative71.0%
+-commutative71.0%
Simplified71.0%
if 5.80000000000000013e243 < b Initial program 50.9%
add-cbrt-cube50.9%
pow1/337.9%
pow337.9%
*-commutative37.9%
div-inv37.9%
metadata-eval37.9%
Applied egg-rr37.9%
unpow1/344.6%
rem-cbrt-cube44.6%
*-commutative44.6%
*-commutative44.6%
*-commutative44.6%
unpow244.6%
unpow244.6%
difference-of-squares57.1%
associate-*r*57.1%
associate-*l*68.8%
Applied egg-rr68.8%
associate-*r*57.1%
*-commutative57.1%
associate-*l*68.8%
*-commutative68.8%
*-commutative68.8%
+-commutative68.8%
Simplified68.8%
*-commutative68.8%
associate-*r*68.8%
metadata-eval68.8%
div-inv68.7%
add-sqr-sqrt37.5%
associate-/l*31.2%
expm1-log1p-u43.7%
associate-/l*43.8%
add-sqr-sqrt68.7%
div-inv68.8%
*-commutative68.8%
metadata-eval68.8%
associate-*l*68.8%
Applied egg-rr68.8%
Final simplification70.9%
a_m = (fabs.f64 a)
angle_m = (fabs.f64 angle)
angle_s = (copysign.f64 1 angle)
(FPCore (angle_s a_m b angle_m)
:precision binary64
(let* ((t_0 (* 2.0 (* (- b a_m) (+ b a_m))))
(t_1 (cos (* PI (/ angle_m 180.0)))))
(*
angle_s
(if (<= (/ angle_m 180.0) 5e-25)
(*
t_1
(*
(- b a_m)
(* (* 2.0 (+ b a_m)) (* angle_m (* PI 0.005555555555555556)))))
(if (or (<= (/ angle_m 180.0) 4e+155)
(not (<= (/ angle_m 180.0) 1e+198)))
(* t_1 (* t_0 (sin (* PI (* 0.005555555555555556 angle_m)))))
(* t_0 (sin (* angle_m (/ PI 180.0)))))))))a_m = fabs(a);
angle_m = fabs(angle);
angle_s = copysign(1.0, angle);
double code(double angle_s, double a_m, double b, double angle_m) {
double t_0 = 2.0 * ((b - a_m) * (b + a_m));
double t_1 = cos((((double) M_PI) * (angle_m / 180.0)));
double tmp;
if ((angle_m / 180.0) <= 5e-25) {
tmp = t_1 * ((b - a_m) * ((2.0 * (b + a_m)) * (angle_m * (((double) M_PI) * 0.005555555555555556))));
} else if (((angle_m / 180.0) <= 4e+155) || !((angle_m / 180.0) <= 1e+198)) {
tmp = t_1 * (t_0 * sin((((double) M_PI) * (0.005555555555555556 * angle_m))));
} else {
tmp = t_0 * sin((angle_m * (((double) M_PI) / 180.0)));
}
return angle_s * tmp;
}
a_m = Math.abs(a);
angle_m = Math.abs(angle);
angle_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a_m, double b, double angle_m) {
double t_0 = 2.0 * ((b - a_m) * (b + a_m));
double t_1 = Math.cos((Math.PI * (angle_m / 180.0)));
double tmp;
if ((angle_m / 180.0) <= 5e-25) {
tmp = t_1 * ((b - a_m) * ((2.0 * (b + a_m)) * (angle_m * (Math.PI * 0.005555555555555556))));
} else if (((angle_m / 180.0) <= 4e+155) || !((angle_m / 180.0) <= 1e+198)) {
tmp = t_1 * (t_0 * Math.sin((Math.PI * (0.005555555555555556 * angle_m))));
} else {
tmp = t_0 * Math.sin((angle_m * (Math.PI / 180.0)));
}
return angle_s * tmp;
}
a_m = math.fabs(a) angle_m = math.fabs(angle) angle_s = math.copysign(1.0, angle) def code(angle_s, a_m, b, angle_m): t_0 = 2.0 * ((b - a_m) * (b + a_m)) t_1 = math.cos((math.pi * (angle_m / 180.0))) tmp = 0 if (angle_m / 180.0) <= 5e-25: tmp = t_1 * ((b - a_m) * ((2.0 * (b + a_m)) * (angle_m * (math.pi * 0.005555555555555556)))) elif ((angle_m / 180.0) <= 4e+155) or not ((angle_m / 180.0) <= 1e+198): tmp = t_1 * (t_0 * math.sin((math.pi * (0.005555555555555556 * angle_m)))) else: tmp = t_0 * math.sin((angle_m * (math.pi / 180.0))) return angle_s * tmp
a_m = abs(a) angle_m = abs(angle) angle_s = copysign(1.0, angle) function code(angle_s, a_m, b, angle_m) t_0 = Float64(2.0 * Float64(Float64(b - a_m) * Float64(b + a_m))) t_1 = cos(Float64(pi * Float64(angle_m / 180.0))) tmp = 0.0 if (Float64(angle_m / 180.0) <= 5e-25) tmp = Float64(t_1 * Float64(Float64(b - a_m) * Float64(Float64(2.0 * Float64(b + a_m)) * Float64(angle_m * Float64(pi * 0.005555555555555556))))); elseif ((Float64(angle_m / 180.0) <= 4e+155) || !(Float64(angle_m / 180.0) <= 1e+198)) tmp = Float64(t_1 * Float64(t_0 * sin(Float64(pi * Float64(0.005555555555555556 * angle_m))))); else tmp = Float64(t_0 * sin(Float64(angle_m * Float64(pi / 180.0)))); end return Float64(angle_s * tmp) end
a_m = abs(a); angle_m = abs(angle); angle_s = sign(angle) * abs(1.0); function tmp_2 = code(angle_s, a_m, b, angle_m) t_0 = 2.0 * ((b - a_m) * (b + a_m)); t_1 = cos((pi * (angle_m / 180.0))); tmp = 0.0; if ((angle_m / 180.0) <= 5e-25) tmp = t_1 * ((b - a_m) * ((2.0 * (b + a_m)) * (angle_m * (pi * 0.005555555555555556)))); elseif (((angle_m / 180.0) <= 4e+155) || ~(((angle_m / 180.0) <= 1e+198))) tmp = t_1 * (t_0 * sin((pi * (0.005555555555555556 * angle_m)))); else tmp = t_0 * sin((angle_m * (pi / 180.0))); end tmp_2 = angle_s * tmp; end
a_m = N[Abs[a], $MachinePrecision]
angle_m = N[Abs[angle], $MachinePrecision]
angle_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a$95$m_, b_, angle$95$m_] := Block[{t$95$0 = N[(2.0 * N[(N[(b - a$95$m), $MachinePrecision] * N[(b + a$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Cos[N[(Pi * N[(angle$95$m / 180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, N[(angle$95$s * If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 5e-25], N[(t$95$1 * N[(N[(b - a$95$m), $MachinePrecision] * N[(N[(2.0 * N[(b + a$95$m), $MachinePrecision]), $MachinePrecision] * N[(angle$95$m * N[(Pi * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 4e+155], N[Not[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 1e+198]], $MachinePrecision]], N[(t$95$1 * N[(t$95$0 * N[Sin[N[(Pi * N[(0.005555555555555556 * angle$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$0 * N[Sin[N[(angle$95$m * N[(Pi / 180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]]]
\begin{array}{l}
a_m = \left|a\right|
\\
angle_m = \left|angle\right|
\\
angle_s = \mathsf{copysign}\left(1, angle\right)
\\
\begin{array}{l}
t_0 := 2 \cdot \left(\left(b - a\_m\right) \cdot \left(b + a\_m\right)\right)\\
t_1 := \cos \left(\pi \cdot \frac{angle\_m}{180}\right)\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;\frac{angle\_m}{180} \leq 5 \cdot 10^{-25}:\\
\;\;\;\;t\_1 \cdot \left(\left(b - a\_m\right) \cdot \left(\left(2 \cdot \left(b + a\_m\right)\right) \cdot \left(angle\_m \cdot \left(\pi \cdot 0.005555555555555556\right)\right)\right)\right)\\
\mathbf{elif}\;\frac{angle\_m}{180} \leq 4 \cdot 10^{+155} \lor \neg \left(\frac{angle\_m}{180} \leq 10^{+198}\right):\\
\;\;\;\;t\_1 \cdot \left(t\_0 \cdot \sin \left(\pi \cdot \left(0.005555555555555556 \cdot angle\_m\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0 \cdot \sin \left(angle\_m \cdot \frac{\pi}{180}\right)\\
\end{array}
\end{array}
\end{array}
if (/.f64 angle 180) < 4.99999999999999962e-25Initial program 60.9%
add-cbrt-cube41.2%
pow1/329.8%
pow329.8%
*-commutative29.8%
div-inv29.8%
metadata-eval29.8%
Applied egg-rr29.8%
unpow1/340.7%
rem-cbrt-cube60.3%
*-commutative60.3%
*-commutative60.3%
*-commutative60.3%
unpow260.3%
unpow260.3%
difference-of-squares63.5%
associate-*r*63.5%
associate-*l*76.4%
Applied egg-rr76.4%
associate-*r*63.5%
*-commutative63.5%
associate-*l*76.4%
*-commutative76.4%
*-commutative76.4%
+-commutative76.4%
Simplified76.4%
Taylor expanded in angle around 0 71.3%
associate-*r*71.3%
*-commutative71.3%
associate-*r*71.4%
*-commutative71.4%
*-commutative71.4%
Simplified71.4%
if 4.99999999999999962e-25 < (/.f64 angle 180) < 4.00000000000000003e155 or 1.00000000000000002e198 < (/.f64 angle 180) Initial program 61.4%
unpow261.4%
unpow261.4%
difference-of-squares63.2%
Applied egg-rr63.2%
Taylor expanded in angle around inf 51.6%
*-commutative51.6%
*-commutative51.6%
associate-*r*61.4%
Simplified61.4%
if 4.00000000000000003e155 < (/.f64 angle 180) < 1.00000000000000002e198Initial program 16.9%
unpow216.9%
unpow216.9%
difference-of-squares16.9%
Applied egg-rr16.9%
Taylor expanded in angle around 0 49.2%
clear-num41.4%
un-div-inv61.4%
Applied egg-rr61.4%
associate-/r/69.2%
Simplified69.2%
Final simplification69.1%
a_m = (fabs.f64 a)
angle_m = (fabs.f64 angle)
angle_s = (copysign.f64 1 angle)
(FPCore (angle_s a_m b angle_m)
:precision binary64
(let* ((t_0 (* 2.0 (* (- b a_m) (+ b a_m))))
(t_1 (* PI (/ angle_m 180.0)))
(t_2 (cos t_1)))
(*
angle_s
(if (<= (/ angle_m 180.0) 5e-25)
(*
t_2
(*
(- b a_m)
(* (* 2.0 (+ b a_m)) (* angle_m (* PI 0.005555555555555556)))))
(if (<= (/ angle_m 180.0) 4e+155)
(* t_2 (* t_0 (sin t_1)))
(if (<= (/ angle_m 180.0) 1e+198)
(* t_0 (sin (* angle_m (/ PI 180.0))))
(* t_2 (* t_0 (sin (* PI (* 0.005555555555555556 angle_m)))))))))))a_m = fabs(a);
angle_m = fabs(angle);
angle_s = copysign(1.0, angle);
double code(double angle_s, double a_m, double b, double angle_m) {
double t_0 = 2.0 * ((b - a_m) * (b + a_m));
double t_1 = ((double) M_PI) * (angle_m / 180.0);
double t_2 = cos(t_1);
double tmp;
if ((angle_m / 180.0) <= 5e-25) {
tmp = t_2 * ((b - a_m) * ((2.0 * (b + a_m)) * (angle_m * (((double) M_PI) * 0.005555555555555556))));
} else if ((angle_m / 180.0) <= 4e+155) {
tmp = t_2 * (t_0 * sin(t_1));
} else if ((angle_m / 180.0) <= 1e+198) {
tmp = t_0 * sin((angle_m * (((double) M_PI) / 180.0)));
} else {
tmp = t_2 * (t_0 * sin((((double) M_PI) * (0.005555555555555556 * angle_m))));
}
return angle_s * tmp;
}
a_m = Math.abs(a);
angle_m = Math.abs(angle);
angle_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a_m, double b, double angle_m) {
double t_0 = 2.0 * ((b - a_m) * (b + a_m));
double t_1 = Math.PI * (angle_m / 180.0);
double t_2 = Math.cos(t_1);
double tmp;
if ((angle_m / 180.0) <= 5e-25) {
tmp = t_2 * ((b - a_m) * ((2.0 * (b + a_m)) * (angle_m * (Math.PI * 0.005555555555555556))));
} else if ((angle_m / 180.0) <= 4e+155) {
tmp = t_2 * (t_0 * Math.sin(t_1));
} else if ((angle_m / 180.0) <= 1e+198) {
tmp = t_0 * Math.sin((angle_m * (Math.PI / 180.0)));
} else {
tmp = t_2 * (t_0 * Math.sin((Math.PI * (0.005555555555555556 * angle_m))));
}
return angle_s * tmp;
}
a_m = math.fabs(a) angle_m = math.fabs(angle) angle_s = math.copysign(1.0, angle) def code(angle_s, a_m, b, angle_m): t_0 = 2.0 * ((b - a_m) * (b + a_m)) t_1 = math.pi * (angle_m / 180.0) t_2 = math.cos(t_1) tmp = 0 if (angle_m / 180.0) <= 5e-25: tmp = t_2 * ((b - a_m) * ((2.0 * (b + a_m)) * (angle_m * (math.pi * 0.005555555555555556)))) elif (angle_m / 180.0) <= 4e+155: tmp = t_2 * (t_0 * math.sin(t_1)) elif (angle_m / 180.0) <= 1e+198: tmp = t_0 * math.sin((angle_m * (math.pi / 180.0))) else: tmp = t_2 * (t_0 * math.sin((math.pi * (0.005555555555555556 * angle_m)))) return angle_s * tmp
a_m = abs(a) angle_m = abs(angle) angle_s = copysign(1.0, angle) function code(angle_s, a_m, b, angle_m) t_0 = Float64(2.0 * Float64(Float64(b - a_m) * Float64(b + a_m))) t_1 = Float64(pi * Float64(angle_m / 180.0)) t_2 = cos(t_1) tmp = 0.0 if (Float64(angle_m / 180.0) <= 5e-25) tmp = Float64(t_2 * Float64(Float64(b - a_m) * Float64(Float64(2.0 * Float64(b + a_m)) * Float64(angle_m * Float64(pi * 0.005555555555555556))))); elseif (Float64(angle_m / 180.0) <= 4e+155) tmp = Float64(t_2 * Float64(t_0 * sin(t_1))); elseif (Float64(angle_m / 180.0) <= 1e+198) tmp = Float64(t_0 * sin(Float64(angle_m * Float64(pi / 180.0)))); else tmp = Float64(t_2 * Float64(t_0 * sin(Float64(pi * Float64(0.005555555555555556 * angle_m))))); end return Float64(angle_s * tmp) end
a_m = abs(a); angle_m = abs(angle); angle_s = sign(angle) * abs(1.0); function tmp_2 = code(angle_s, a_m, b, angle_m) t_0 = 2.0 * ((b - a_m) * (b + a_m)); t_1 = pi * (angle_m / 180.0); t_2 = cos(t_1); tmp = 0.0; if ((angle_m / 180.0) <= 5e-25) tmp = t_2 * ((b - a_m) * ((2.0 * (b + a_m)) * (angle_m * (pi * 0.005555555555555556)))); elseif ((angle_m / 180.0) <= 4e+155) tmp = t_2 * (t_0 * sin(t_1)); elseif ((angle_m / 180.0) <= 1e+198) tmp = t_0 * sin((angle_m * (pi / 180.0))); else tmp = t_2 * (t_0 * sin((pi * (0.005555555555555556 * angle_m)))); end tmp_2 = angle_s * tmp; end
a_m = N[Abs[a], $MachinePrecision]
angle_m = N[Abs[angle], $MachinePrecision]
angle_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a$95$m_, b_, angle$95$m_] := Block[{t$95$0 = N[(2.0 * N[(N[(b - a$95$m), $MachinePrecision] * N[(b + a$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(Pi * N[(angle$95$m / 180.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Cos[t$95$1], $MachinePrecision]}, N[(angle$95$s * If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 5e-25], N[(t$95$2 * N[(N[(b - a$95$m), $MachinePrecision] * N[(N[(2.0 * N[(b + a$95$m), $MachinePrecision]), $MachinePrecision] * N[(angle$95$m * N[(Pi * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 4e+155], N[(t$95$2 * N[(t$95$0 * N[Sin[t$95$1], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 1e+198], N[(t$95$0 * N[Sin[N[(angle$95$m * N[(Pi / 180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(t$95$2 * N[(t$95$0 * N[Sin[N[(Pi * N[(0.005555555555555556 * angle$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]), $MachinePrecision]]]]
\begin{array}{l}
a_m = \left|a\right|
\\
angle_m = \left|angle\right|
\\
angle_s = \mathsf{copysign}\left(1, angle\right)
\\
\begin{array}{l}
t_0 := 2 \cdot \left(\left(b - a\_m\right) \cdot \left(b + a\_m\right)\right)\\
t_1 := \pi \cdot \frac{angle\_m}{180}\\
t_2 := \cos t\_1\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;\frac{angle\_m}{180} \leq 5 \cdot 10^{-25}:\\
\;\;\;\;t\_2 \cdot \left(\left(b - a\_m\right) \cdot \left(\left(2 \cdot \left(b + a\_m\right)\right) \cdot \left(angle\_m \cdot \left(\pi \cdot 0.005555555555555556\right)\right)\right)\right)\\
\mathbf{elif}\;\frac{angle\_m}{180} \leq 4 \cdot 10^{+155}:\\
\;\;\;\;t\_2 \cdot \left(t\_0 \cdot \sin t\_1\right)\\
\mathbf{elif}\;\frac{angle\_m}{180} \leq 10^{+198}:\\
\;\;\;\;t\_0 \cdot \sin \left(angle\_m \cdot \frac{\pi}{180}\right)\\
\mathbf{else}:\\
\;\;\;\;t\_2 \cdot \left(t\_0 \cdot \sin \left(\pi \cdot \left(0.005555555555555556 \cdot angle\_m\right)\right)\right)\\
\end{array}
\end{array}
\end{array}
if (/.f64 angle 180) < 4.99999999999999962e-25Initial program 60.9%
add-cbrt-cube41.2%
pow1/329.8%
pow329.8%
*-commutative29.8%
div-inv29.8%
metadata-eval29.8%
Applied egg-rr29.8%
unpow1/340.7%
rem-cbrt-cube60.3%
*-commutative60.3%
*-commutative60.3%
*-commutative60.3%
unpow260.3%
unpow260.3%
difference-of-squares63.5%
associate-*r*63.5%
associate-*l*76.4%
Applied egg-rr76.4%
associate-*r*63.5%
*-commutative63.5%
associate-*l*76.4%
*-commutative76.4%
*-commutative76.4%
+-commutative76.4%
Simplified76.4%
Taylor expanded in angle around 0 71.3%
associate-*r*71.3%
*-commutative71.3%
associate-*r*71.4%
*-commutative71.4%
*-commutative71.4%
Simplified71.4%
if 4.99999999999999962e-25 < (/.f64 angle 180) < 4.00000000000000003e155Initial program 74.1%
unpow274.1%
unpow274.1%
difference-of-squares74.1%
Applied egg-rr74.1%
if 4.00000000000000003e155 < (/.f64 angle 180) < 1.00000000000000002e198Initial program 16.9%
unpow216.9%
unpow216.9%
difference-of-squares16.9%
Applied egg-rr16.9%
Taylor expanded in angle around 0 49.2%
clear-num41.4%
un-div-inv61.4%
Applied egg-rr61.4%
associate-/r/69.2%
Simplified69.2%
if 1.00000000000000002e198 < (/.f64 angle 180) Initial program 42.9%
unpow242.9%
unpow242.9%
difference-of-squares47.4%
Applied egg-rr47.4%
Taylor expanded in angle around inf 42.1%
*-commutative42.1%
*-commutative42.1%
associate-*r*47.4%
Simplified47.4%
Final simplification69.5%
a_m = (fabs.f64 a)
angle_m = (fabs.f64 angle)
angle_s = (copysign.f64 1 angle)
(FPCore (angle_s a_m b angle_m)
:precision binary64
(*
angle_s
(*
(cos (* PI (/ angle_m 180.0)))
(*
(- b a_m)
(* (* 2.0 (+ b a_m)) (sin (* PI (* 0.005555555555555556 angle_m))))))))a_m = fabs(a);
angle_m = fabs(angle);
angle_s = copysign(1.0, angle);
double code(double angle_s, double a_m, double b, double angle_m) {
return angle_s * (cos((((double) M_PI) * (angle_m / 180.0))) * ((b - a_m) * ((2.0 * (b + a_m)) * sin((((double) M_PI) * (0.005555555555555556 * angle_m))))));
}
a_m = Math.abs(a);
angle_m = Math.abs(angle);
angle_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a_m, double b, double angle_m) {
return angle_s * (Math.cos((Math.PI * (angle_m / 180.0))) * ((b - a_m) * ((2.0 * (b + a_m)) * Math.sin((Math.PI * (0.005555555555555556 * angle_m))))));
}
a_m = math.fabs(a) angle_m = math.fabs(angle) angle_s = math.copysign(1.0, angle) def code(angle_s, a_m, b, angle_m): return angle_s * (math.cos((math.pi * (angle_m / 180.0))) * ((b - a_m) * ((2.0 * (b + a_m)) * math.sin((math.pi * (0.005555555555555556 * angle_m))))))
a_m = abs(a) angle_m = abs(angle) angle_s = copysign(1.0, angle) function code(angle_s, a_m, b, angle_m) return Float64(angle_s * Float64(cos(Float64(pi * Float64(angle_m / 180.0))) * Float64(Float64(b - a_m) * Float64(Float64(2.0 * Float64(b + a_m)) * sin(Float64(pi * Float64(0.005555555555555556 * angle_m))))))) end
a_m = abs(a); angle_m = abs(angle); angle_s = sign(angle) * abs(1.0); function tmp = code(angle_s, a_m, b, angle_m) tmp = angle_s * (cos((pi * (angle_m / 180.0))) * ((b - a_m) * ((2.0 * (b + a_m)) * sin((pi * (0.005555555555555556 * angle_m)))))); end
a_m = N[Abs[a], $MachinePrecision]
angle_m = N[Abs[angle], $MachinePrecision]
angle_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a$95$m_, b_, angle$95$m_] := N[(angle$95$s * N[(N[Cos[N[(Pi * N[(angle$95$m / 180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(N[(b - a$95$m), $MachinePrecision] * N[(N[(2.0 * N[(b + a$95$m), $MachinePrecision]), $MachinePrecision] * N[Sin[N[(Pi * N[(0.005555555555555556 * angle$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
a_m = \left|a\right|
\\
angle_m = \left|angle\right|
\\
angle_s = \mathsf{copysign}\left(1, angle\right)
\\
angle\_s \cdot \left(\cos \left(\pi \cdot \frac{angle\_m}{180}\right) \cdot \left(\left(b - a\_m\right) \cdot \left(\left(2 \cdot \left(b + a\_m\right)\right) \cdot \sin \left(\pi \cdot \left(0.005555555555555556 \cdot angle\_m\right)\right)\right)\right)\right)
\end{array}
Initial program 58.4%
add-cbrt-cube42.8%
pow1/331.6%
pow331.6%
*-commutative31.6%
div-inv31.6%
metadata-eval31.6%
Applied egg-rr31.6%
unpow1/342.8%
rem-cbrt-cube58.3%
*-commutative58.3%
*-commutative58.3%
*-commutative58.3%
unpow258.3%
unpow258.3%
difference-of-squares61.5%
associate-*r*61.5%
associate-*l*70.9%
Applied egg-rr70.9%
associate-*r*61.5%
*-commutative61.5%
associate-*l*70.9%
*-commutative70.9%
*-commutative70.9%
+-commutative70.9%
Simplified70.9%
Final simplification70.9%
a_m = (fabs.f64 a)
angle_m = (fabs.f64 angle)
angle_s = (copysign.f64 1 angle)
(FPCore (angle_s a_m b angle_m)
:precision binary64
(let* ((t_0 (* (- b a_m) (+ b a_m))))
(*
angle_s
(if (<= (/ angle_m 180.0) 2e+14)
(*
(- b a_m)
(* (* 2.0 (+ b a_m)) (sin (* PI (* 0.005555555555555556 angle_m)))))
(if (<= (/ angle_m 180.0) 5e+116)
(* 0.011111111111111112 (* angle_m (* PI t_0)))
(if (<= (/ angle_m 180.0) 6e+197)
(* (* 2.0 t_0) (sin (* angle_m (/ PI 180.0))))
(*
0.011111111111111112
(* angle_m (* (- b a_m) (* PI (+ b a_m)))))))))))a_m = fabs(a);
angle_m = fabs(angle);
angle_s = copysign(1.0, angle);
double code(double angle_s, double a_m, double b, double angle_m) {
double t_0 = (b - a_m) * (b + a_m);
double tmp;
if ((angle_m / 180.0) <= 2e+14) {
tmp = (b - a_m) * ((2.0 * (b + a_m)) * sin((((double) M_PI) * (0.005555555555555556 * angle_m))));
} else if ((angle_m / 180.0) <= 5e+116) {
tmp = 0.011111111111111112 * (angle_m * (((double) M_PI) * t_0));
} else if ((angle_m / 180.0) <= 6e+197) {
tmp = (2.0 * t_0) * sin((angle_m * (((double) M_PI) / 180.0)));
} else {
tmp = 0.011111111111111112 * (angle_m * ((b - a_m) * (((double) M_PI) * (b + a_m))));
}
return angle_s * tmp;
}
a_m = Math.abs(a);
angle_m = Math.abs(angle);
angle_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a_m, double b, double angle_m) {
double t_0 = (b - a_m) * (b + a_m);
double tmp;
if ((angle_m / 180.0) <= 2e+14) {
tmp = (b - a_m) * ((2.0 * (b + a_m)) * Math.sin((Math.PI * (0.005555555555555556 * angle_m))));
} else if ((angle_m / 180.0) <= 5e+116) {
tmp = 0.011111111111111112 * (angle_m * (Math.PI * t_0));
} else if ((angle_m / 180.0) <= 6e+197) {
tmp = (2.0 * t_0) * Math.sin((angle_m * (Math.PI / 180.0)));
} else {
tmp = 0.011111111111111112 * (angle_m * ((b - a_m) * (Math.PI * (b + a_m))));
}
return angle_s * tmp;
}
a_m = math.fabs(a) angle_m = math.fabs(angle) angle_s = math.copysign(1.0, angle) def code(angle_s, a_m, b, angle_m): t_0 = (b - a_m) * (b + a_m) tmp = 0 if (angle_m / 180.0) <= 2e+14: tmp = (b - a_m) * ((2.0 * (b + a_m)) * math.sin((math.pi * (0.005555555555555556 * angle_m)))) elif (angle_m / 180.0) <= 5e+116: tmp = 0.011111111111111112 * (angle_m * (math.pi * t_0)) elif (angle_m / 180.0) <= 6e+197: tmp = (2.0 * t_0) * math.sin((angle_m * (math.pi / 180.0))) else: tmp = 0.011111111111111112 * (angle_m * ((b - a_m) * (math.pi * (b + a_m)))) return angle_s * tmp
a_m = abs(a) angle_m = abs(angle) angle_s = copysign(1.0, angle) function code(angle_s, a_m, b, angle_m) t_0 = Float64(Float64(b - a_m) * Float64(b + a_m)) tmp = 0.0 if (Float64(angle_m / 180.0) <= 2e+14) tmp = Float64(Float64(b - a_m) * Float64(Float64(2.0 * Float64(b + a_m)) * sin(Float64(pi * Float64(0.005555555555555556 * angle_m))))); elseif (Float64(angle_m / 180.0) <= 5e+116) tmp = Float64(0.011111111111111112 * Float64(angle_m * Float64(pi * t_0))); elseif (Float64(angle_m / 180.0) <= 6e+197) tmp = Float64(Float64(2.0 * t_0) * sin(Float64(angle_m * Float64(pi / 180.0)))); else tmp = Float64(0.011111111111111112 * Float64(angle_m * Float64(Float64(b - a_m) * Float64(pi * Float64(b + a_m))))); end return Float64(angle_s * tmp) end
a_m = abs(a); angle_m = abs(angle); angle_s = sign(angle) * abs(1.0); function tmp_2 = code(angle_s, a_m, b, angle_m) t_0 = (b - a_m) * (b + a_m); tmp = 0.0; if ((angle_m / 180.0) <= 2e+14) tmp = (b - a_m) * ((2.0 * (b + a_m)) * sin((pi * (0.005555555555555556 * angle_m)))); elseif ((angle_m / 180.0) <= 5e+116) tmp = 0.011111111111111112 * (angle_m * (pi * t_0)); elseif ((angle_m / 180.0) <= 6e+197) tmp = (2.0 * t_0) * sin((angle_m * (pi / 180.0))); else tmp = 0.011111111111111112 * (angle_m * ((b - a_m) * (pi * (b + a_m)))); end tmp_2 = angle_s * tmp; end
a_m = N[Abs[a], $MachinePrecision]
angle_m = N[Abs[angle], $MachinePrecision]
angle_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a$95$m_, b_, angle$95$m_] := Block[{t$95$0 = N[(N[(b - a$95$m), $MachinePrecision] * N[(b + a$95$m), $MachinePrecision]), $MachinePrecision]}, N[(angle$95$s * If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 2e+14], N[(N[(b - a$95$m), $MachinePrecision] * N[(N[(2.0 * N[(b + a$95$m), $MachinePrecision]), $MachinePrecision] * N[Sin[N[(Pi * N[(0.005555555555555556 * angle$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 5e+116], N[(0.011111111111111112 * N[(angle$95$m * N[(Pi * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 6e+197], N[(N[(2.0 * t$95$0), $MachinePrecision] * N[Sin[N[(angle$95$m * N[(Pi / 180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(0.011111111111111112 * N[(angle$95$m * N[(N[(b - a$95$m), $MachinePrecision] * N[(Pi * N[(b + a$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]), $MachinePrecision]]
\begin{array}{l}
a_m = \left|a\right|
\\
angle_m = \left|angle\right|
\\
angle_s = \mathsf{copysign}\left(1, angle\right)
\\
\begin{array}{l}
t_0 := \left(b - a\_m\right) \cdot \left(b + a\_m\right)\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;\frac{angle\_m}{180} \leq 2 \cdot 10^{+14}:\\
\;\;\;\;\left(b - a\_m\right) \cdot \left(\left(2 \cdot \left(b + a\_m\right)\right) \cdot \sin \left(\pi \cdot \left(0.005555555555555556 \cdot angle\_m\right)\right)\right)\\
\mathbf{elif}\;\frac{angle\_m}{180} \leq 5 \cdot 10^{+116}:\\
\;\;\;\;0.011111111111111112 \cdot \left(angle\_m \cdot \left(\pi \cdot t\_0\right)\right)\\
\mathbf{elif}\;\frac{angle\_m}{180} \leq 6 \cdot 10^{+197}:\\
\;\;\;\;\left(2 \cdot t\_0\right) \cdot \sin \left(angle\_m \cdot \frac{\pi}{180}\right)\\
\mathbf{else}:\\
\;\;\;\;0.011111111111111112 \cdot \left(angle\_m \cdot \left(\left(b - a\_m\right) \cdot \left(\pi \cdot \left(b + a\_m\right)\right)\right)\right)\\
\end{array}
\end{array}
\end{array}
if (/.f64 angle 180) < 2e14Initial program 62.8%
add-cbrt-cube43.6%
pow1/330.4%
pow330.4%
*-commutative30.4%
div-inv30.4%
metadata-eval30.4%
Applied egg-rr30.4%
unpow1/343.2%
rem-cbrt-cube62.3%
*-commutative62.3%
*-commutative62.3%
*-commutative62.3%
unpow262.3%
unpow262.3%
difference-of-squares65.3%
associate-*r*65.3%
associate-*l*77.4%
Applied egg-rr77.4%
associate-*r*65.3%
*-commutative65.3%
associate-*l*77.4%
*-commutative77.4%
*-commutative77.4%
+-commutative77.4%
Simplified77.4%
Taylor expanded in angle around 0 72.3%
if 2e14 < (/.f64 angle 180) < 5.00000000000000025e116Initial program 62.2%
unpow262.2%
unpow262.2%
difference-of-squares62.2%
Applied egg-rr62.2%
Taylor expanded in angle around 0 25.2%
Taylor expanded in angle around 0 67.3%
if 5.00000000000000025e116 < (/.f64 angle 180) < 6.0000000000000004e197Initial program 32.8%
unpow232.8%
unpow232.8%
difference-of-squares32.8%
Applied egg-rr32.8%
Taylor expanded in angle around 0 51.2%
clear-num45.7%
un-div-inv50.4%
Applied egg-rr50.4%
associate-/r/56.1%
Simplified56.1%
if 6.0000000000000004e197 < (/.f64 angle 180) Initial program 41.0%
unpow241.0%
unpow241.0%
difference-of-squares45.3%
Applied egg-rr45.3%
Taylor expanded in angle around 0 17.0%
Taylor expanded in angle around 0 36.5%
associate-*r*36.5%
sub-neg36.5%
distribute-lft-in32.1%
Applied egg-rr32.1%
distribute-lft-out36.5%
sub-neg36.5%
+-commutative36.5%
Simplified36.5%
Final simplification67.5%
a_m = (fabs.f64 a)
angle_m = (fabs.f64 angle)
angle_s = (copysign.f64 1 angle)
(FPCore (angle_s a_m b angle_m)
:precision binary64
(let* ((t_0 (* (- b a_m) (+ b a_m))))
(*
angle_s
(if (<= (/ angle_m 180.0) 2000000.0)
(*
(- b a_m)
(* (* 2.0 (+ b a_m)) (sin (* PI (* 0.005555555555555556 angle_m)))))
(if (<= (/ angle_m 180.0) 5e+116)
(*
(cos (* PI (/ angle_m 180.0)))
(* 0.011111111111111112 (* angle_m (* PI t_0))))
(if (<= (/ angle_m 180.0) 6e+197)
(* (* 2.0 t_0) (sin (* angle_m (/ PI 180.0))))
(*
0.011111111111111112
(* angle_m (* (- b a_m) (* PI (+ b a_m)))))))))))a_m = fabs(a);
angle_m = fabs(angle);
angle_s = copysign(1.0, angle);
double code(double angle_s, double a_m, double b, double angle_m) {
double t_0 = (b - a_m) * (b + a_m);
double tmp;
if ((angle_m / 180.0) <= 2000000.0) {
tmp = (b - a_m) * ((2.0 * (b + a_m)) * sin((((double) M_PI) * (0.005555555555555556 * angle_m))));
} else if ((angle_m / 180.0) <= 5e+116) {
tmp = cos((((double) M_PI) * (angle_m / 180.0))) * (0.011111111111111112 * (angle_m * (((double) M_PI) * t_0)));
} else if ((angle_m / 180.0) <= 6e+197) {
tmp = (2.0 * t_0) * sin((angle_m * (((double) M_PI) / 180.0)));
} else {
tmp = 0.011111111111111112 * (angle_m * ((b - a_m) * (((double) M_PI) * (b + a_m))));
}
return angle_s * tmp;
}
a_m = Math.abs(a);
angle_m = Math.abs(angle);
angle_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a_m, double b, double angle_m) {
double t_0 = (b - a_m) * (b + a_m);
double tmp;
if ((angle_m / 180.0) <= 2000000.0) {
tmp = (b - a_m) * ((2.0 * (b + a_m)) * Math.sin((Math.PI * (0.005555555555555556 * angle_m))));
} else if ((angle_m / 180.0) <= 5e+116) {
tmp = Math.cos((Math.PI * (angle_m / 180.0))) * (0.011111111111111112 * (angle_m * (Math.PI * t_0)));
} else if ((angle_m / 180.0) <= 6e+197) {
tmp = (2.0 * t_0) * Math.sin((angle_m * (Math.PI / 180.0)));
} else {
tmp = 0.011111111111111112 * (angle_m * ((b - a_m) * (Math.PI * (b + a_m))));
}
return angle_s * tmp;
}
a_m = math.fabs(a) angle_m = math.fabs(angle) angle_s = math.copysign(1.0, angle) def code(angle_s, a_m, b, angle_m): t_0 = (b - a_m) * (b + a_m) tmp = 0 if (angle_m / 180.0) <= 2000000.0: tmp = (b - a_m) * ((2.0 * (b + a_m)) * math.sin((math.pi * (0.005555555555555556 * angle_m)))) elif (angle_m / 180.0) <= 5e+116: tmp = math.cos((math.pi * (angle_m / 180.0))) * (0.011111111111111112 * (angle_m * (math.pi * t_0))) elif (angle_m / 180.0) <= 6e+197: tmp = (2.0 * t_0) * math.sin((angle_m * (math.pi / 180.0))) else: tmp = 0.011111111111111112 * (angle_m * ((b - a_m) * (math.pi * (b + a_m)))) return angle_s * tmp
a_m = abs(a) angle_m = abs(angle) angle_s = copysign(1.0, angle) function code(angle_s, a_m, b, angle_m) t_0 = Float64(Float64(b - a_m) * Float64(b + a_m)) tmp = 0.0 if (Float64(angle_m / 180.0) <= 2000000.0) tmp = Float64(Float64(b - a_m) * Float64(Float64(2.0 * Float64(b + a_m)) * sin(Float64(pi * Float64(0.005555555555555556 * angle_m))))); elseif (Float64(angle_m / 180.0) <= 5e+116) tmp = Float64(cos(Float64(pi * Float64(angle_m / 180.0))) * Float64(0.011111111111111112 * Float64(angle_m * Float64(pi * t_0)))); elseif (Float64(angle_m / 180.0) <= 6e+197) tmp = Float64(Float64(2.0 * t_0) * sin(Float64(angle_m * Float64(pi / 180.0)))); else tmp = Float64(0.011111111111111112 * Float64(angle_m * Float64(Float64(b - a_m) * Float64(pi * Float64(b + a_m))))); end return Float64(angle_s * tmp) end
a_m = abs(a); angle_m = abs(angle); angle_s = sign(angle) * abs(1.0); function tmp_2 = code(angle_s, a_m, b, angle_m) t_0 = (b - a_m) * (b + a_m); tmp = 0.0; if ((angle_m / 180.0) <= 2000000.0) tmp = (b - a_m) * ((2.0 * (b + a_m)) * sin((pi * (0.005555555555555556 * angle_m)))); elseif ((angle_m / 180.0) <= 5e+116) tmp = cos((pi * (angle_m / 180.0))) * (0.011111111111111112 * (angle_m * (pi * t_0))); elseif ((angle_m / 180.0) <= 6e+197) tmp = (2.0 * t_0) * sin((angle_m * (pi / 180.0))); else tmp = 0.011111111111111112 * (angle_m * ((b - a_m) * (pi * (b + a_m)))); end tmp_2 = angle_s * tmp; end
a_m = N[Abs[a], $MachinePrecision]
angle_m = N[Abs[angle], $MachinePrecision]
angle_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a$95$m_, b_, angle$95$m_] := Block[{t$95$0 = N[(N[(b - a$95$m), $MachinePrecision] * N[(b + a$95$m), $MachinePrecision]), $MachinePrecision]}, N[(angle$95$s * If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 2000000.0], N[(N[(b - a$95$m), $MachinePrecision] * N[(N[(2.0 * N[(b + a$95$m), $MachinePrecision]), $MachinePrecision] * N[Sin[N[(Pi * N[(0.005555555555555556 * angle$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 5e+116], N[(N[Cos[N[(Pi * N[(angle$95$m / 180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(0.011111111111111112 * N[(angle$95$m * N[(Pi * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 6e+197], N[(N[(2.0 * t$95$0), $MachinePrecision] * N[Sin[N[(angle$95$m * N[(Pi / 180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(0.011111111111111112 * N[(angle$95$m * N[(N[(b - a$95$m), $MachinePrecision] * N[(Pi * N[(b + a$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]), $MachinePrecision]]
\begin{array}{l}
a_m = \left|a\right|
\\
angle_m = \left|angle\right|
\\
angle_s = \mathsf{copysign}\left(1, angle\right)
\\
\begin{array}{l}
t_0 := \left(b - a\_m\right) \cdot \left(b + a\_m\right)\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;\frac{angle\_m}{180} \leq 2000000:\\
\;\;\;\;\left(b - a\_m\right) \cdot \left(\left(2 \cdot \left(b + a\_m\right)\right) \cdot \sin \left(\pi \cdot \left(0.005555555555555556 \cdot angle\_m\right)\right)\right)\\
\mathbf{elif}\;\frac{angle\_m}{180} \leq 5 \cdot 10^{+116}:\\
\;\;\;\;\cos \left(\pi \cdot \frac{angle\_m}{180}\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 6 \cdot 10^{+197}:\\
\;\;\;\;\left(2 \cdot t\_0\right) \cdot \sin \left(angle\_m \cdot \frac{\pi}{180}\right)\\
\mathbf{else}:\\
\;\;\;\;0.011111111111111112 \cdot \left(angle\_m \cdot \left(\left(b - a\_m\right) \cdot \left(\pi \cdot \left(b + a\_m\right)\right)\right)\right)\\
\end{array}
\end{array}
\end{array}
if (/.f64 angle 180) < 2e6Initial program 62.4%
add-cbrt-cube42.9%
pow1/330.0%
pow330.0%
*-commutative30.0%
div-inv30.0%
metadata-eval30.0%
Applied egg-rr30.0%
unpow1/342.5%
rem-cbrt-cube61.9%
*-commutative61.9%
*-commutative61.9%
*-commutative61.9%
unpow261.9%
unpow261.9%
difference-of-squares65.0%
associate-*r*65.0%
associate-*l*77.3%
Applied egg-rr77.3%
associate-*r*65.0%
*-commutative65.0%
associate-*l*77.3%
*-commutative77.3%
*-commutative77.3%
+-commutative77.3%
Simplified77.3%
Taylor expanded in angle around 0 73.1%
if 2e6 < (/.f64 angle 180) < 5.00000000000000025e116Initial program 67.3%
unpow267.3%
unpow267.3%
difference-of-squares67.3%
Applied egg-rr67.3%
Taylor expanded in angle around 0 57.8%
if 5.00000000000000025e116 < (/.f64 angle 180) < 6.0000000000000004e197Initial program 32.8%
unpow232.8%
unpow232.8%
difference-of-squares32.8%
Applied egg-rr32.8%
Taylor expanded in angle around 0 51.2%
clear-num45.7%
un-div-inv50.4%
Applied egg-rr50.4%
associate-/r/56.1%
Simplified56.1%
if 6.0000000000000004e197 < (/.f64 angle 180) Initial program 41.0%
unpow241.0%
unpow241.0%
difference-of-squares45.3%
Applied egg-rr45.3%
Taylor expanded in angle around 0 17.0%
Taylor expanded in angle around 0 36.5%
associate-*r*36.5%
sub-neg36.5%
distribute-lft-in32.1%
Applied egg-rr32.1%
distribute-lft-out36.5%
sub-neg36.5%
+-commutative36.5%
Simplified36.5%
Final simplification67.5%
a_m = (fabs.f64 a)
angle_m = (fabs.f64 angle)
angle_s = (copysign.f64 1 angle)
(FPCore (angle_s a_m b angle_m)
:precision binary64
(let* ((t_0 (* 2.0 (* (- b a_m) (+ b a_m)))))
(*
angle_s
(if (<= (/ angle_m 180.0) 2e-34)
(*
(- b a_m)
(* (* 2.0 (+ b a_m)) (sin (* PI (* 0.005555555555555556 angle_m)))))
(if (<= (/ angle_m 180.0) 5e+139)
(* t_0 (sin (/ 1.0 (/ 180.0 (* PI angle_m)))))
(if (<= (/ angle_m 180.0) 6e+197)
(* t_0 (sin (* angle_m (/ PI 180.0))))
(*
0.011111111111111112
(* angle_m (* (- b a_m) (* PI (+ b a_m)))))))))))a_m = fabs(a);
angle_m = fabs(angle);
angle_s = copysign(1.0, angle);
double code(double angle_s, double a_m, double b, double angle_m) {
double t_0 = 2.0 * ((b - a_m) * (b + a_m));
double tmp;
if ((angle_m / 180.0) <= 2e-34) {
tmp = (b - a_m) * ((2.0 * (b + a_m)) * sin((((double) M_PI) * (0.005555555555555556 * angle_m))));
} else if ((angle_m / 180.0) <= 5e+139) {
tmp = t_0 * sin((1.0 / (180.0 / (((double) M_PI) * angle_m))));
} else if ((angle_m / 180.0) <= 6e+197) {
tmp = t_0 * sin((angle_m * (((double) M_PI) / 180.0)));
} else {
tmp = 0.011111111111111112 * (angle_m * ((b - a_m) * (((double) M_PI) * (b + a_m))));
}
return angle_s * tmp;
}
a_m = Math.abs(a);
angle_m = Math.abs(angle);
angle_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a_m, double b, double angle_m) {
double t_0 = 2.0 * ((b - a_m) * (b + a_m));
double tmp;
if ((angle_m / 180.0) <= 2e-34) {
tmp = (b - a_m) * ((2.0 * (b + a_m)) * Math.sin((Math.PI * (0.005555555555555556 * angle_m))));
} else if ((angle_m / 180.0) <= 5e+139) {
tmp = t_0 * Math.sin((1.0 / (180.0 / (Math.PI * angle_m))));
} else if ((angle_m / 180.0) <= 6e+197) {
tmp = t_0 * Math.sin((angle_m * (Math.PI / 180.0)));
} else {
tmp = 0.011111111111111112 * (angle_m * ((b - a_m) * (Math.PI * (b + a_m))));
}
return angle_s * tmp;
}
a_m = math.fabs(a) angle_m = math.fabs(angle) angle_s = math.copysign(1.0, angle) def code(angle_s, a_m, b, angle_m): t_0 = 2.0 * ((b - a_m) * (b + a_m)) tmp = 0 if (angle_m / 180.0) <= 2e-34: tmp = (b - a_m) * ((2.0 * (b + a_m)) * math.sin((math.pi * (0.005555555555555556 * angle_m)))) elif (angle_m / 180.0) <= 5e+139: tmp = t_0 * math.sin((1.0 / (180.0 / (math.pi * angle_m)))) elif (angle_m / 180.0) <= 6e+197: tmp = t_0 * math.sin((angle_m * (math.pi / 180.0))) else: tmp = 0.011111111111111112 * (angle_m * ((b - a_m) * (math.pi * (b + a_m)))) return angle_s * tmp
a_m = abs(a) angle_m = abs(angle) angle_s = copysign(1.0, angle) function code(angle_s, a_m, b, angle_m) t_0 = Float64(2.0 * Float64(Float64(b - a_m) * Float64(b + a_m))) tmp = 0.0 if (Float64(angle_m / 180.0) <= 2e-34) tmp = Float64(Float64(b - a_m) * Float64(Float64(2.0 * Float64(b + a_m)) * sin(Float64(pi * Float64(0.005555555555555556 * angle_m))))); elseif (Float64(angle_m / 180.0) <= 5e+139) tmp = Float64(t_0 * sin(Float64(1.0 / Float64(180.0 / Float64(pi * angle_m))))); elseif (Float64(angle_m / 180.0) <= 6e+197) tmp = Float64(t_0 * sin(Float64(angle_m * Float64(pi / 180.0)))); else tmp = Float64(0.011111111111111112 * Float64(angle_m * Float64(Float64(b - a_m) * Float64(pi * Float64(b + a_m))))); end return Float64(angle_s * tmp) end
a_m = abs(a); angle_m = abs(angle); angle_s = sign(angle) * abs(1.0); function tmp_2 = code(angle_s, a_m, b, angle_m) t_0 = 2.0 * ((b - a_m) * (b + a_m)); tmp = 0.0; if ((angle_m / 180.0) <= 2e-34) tmp = (b - a_m) * ((2.0 * (b + a_m)) * sin((pi * (0.005555555555555556 * angle_m)))); elseif ((angle_m / 180.0) <= 5e+139) tmp = t_0 * sin((1.0 / (180.0 / (pi * angle_m)))); elseif ((angle_m / 180.0) <= 6e+197) tmp = t_0 * sin((angle_m * (pi / 180.0))); else tmp = 0.011111111111111112 * (angle_m * ((b - a_m) * (pi * (b + a_m)))); end tmp_2 = angle_s * tmp; end
a_m = N[Abs[a], $MachinePrecision]
angle_m = N[Abs[angle], $MachinePrecision]
angle_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a$95$m_, b_, angle$95$m_] := Block[{t$95$0 = N[(2.0 * N[(N[(b - a$95$m), $MachinePrecision] * N[(b + a$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, N[(angle$95$s * If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 2e-34], N[(N[(b - a$95$m), $MachinePrecision] * N[(N[(2.0 * N[(b + a$95$m), $MachinePrecision]), $MachinePrecision] * N[Sin[N[(Pi * N[(0.005555555555555556 * angle$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 5e+139], N[(t$95$0 * N[Sin[N[(1.0 / N[(180.0 / N[(Pi * angle$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 6e+197], N[(t$95$0 * N[Sin[N[(angle$95$m * N[(Pi / 180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(0.011111111111111112 * N[(angle$95$m * N[(N[(b - a$95$m), $MachinePrecision] * N[(Pi * N[(b + a$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]), $MachinePrecision]]
\begin{array}{l}
a_m = \left|a\right|
\\
angle_m = \left|angle\right|
\\
angle_s = \mathsf{copysign}\left(1, angle\right)
\\
\begin{array}{l}
t_0 := 2 \cdot \left(\left(b - a\_m\right) \cdot \left(b + a\_m\right)\right)\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;\frac{angle\_m}{180} \leq 2 \cdot 10^{-34}:\\
\;\;\;\;\left(b - a\_m\right) \cdot \left(\left(2 \cdot \left(b + a\_m\right)\right) \cdot \sin \left(\pi \cdot \left(0.005555555555555556 \cdot angle\_m\right)\right)\right)\\
\mathbf{elif}\;\frac{angle\_m}{180} \leq 5 \cdot 10^{+139}:\\
\;\;\;\;t\_0 \cdot \sin \left(\frac{1}{\frac{180}{\pi \cdot angle\_m}}\right)\\
\mathbf{elif}\;\frac{angle\_m}{180} \leq 6 \cdot 10^{+197}:\\
\;\;\;\;t\_0 \cdot \sin \left(angle\_m \cdot \frac{\pi}{180}\right)\\
\mathbf{else}:\\
\;\;\;\;0.011111111111111112 \cdot \left(angle\_m \cdot \left(\left(b - a\_m\right) \cdot \left(\pi \cdot \left(b + a\_m\right)\right)\right)\right)\\
\end{array}
\end{array}
\end{array}
if (/.f64 angle 180) < 1.99999999999999986e-34Initial program 60.2%
add-cbrt-cube40.8%
pow1/329.7%
pow329.7%
*-commutative29.7%
div-inv29.7%
metadata-eval29.7%
Applied egg-rr29.7%
unpow1/340.3%
rem-cbrt-cube59.6%
*-commutative59.6%
*-commutative59.6%
*-commutative59.6%
unpow259.6%
unpow259.6%
difference-of-squares62.9%
associate-*r*62.9%
associate-*l*76.0%
Applied egg-rr76.0%
associate-*r*62.9%
*-commutative62.9%
associate-*l*76.0%
*-commutative76.0%
*-commutative76.0%
+-commutative76.0%
Simplified76.0%
Taylor expanded in angle around 0 72.4%
if 1.99999999999999986e-34 < (/.f64 angle 180) < 5.0000000000000003e139Initial program 80.5%
unpow280.5%
unpow280.5%
difference-of-squares80.5%
Applied egg-rr80.5%
Taylor expanded in angle around 0 52.7%
associate-*r/56.2%
*-commutative56.2%
clear-num60.2%
*-commutative60.2%
Applied egg-rr60.2%
if 5.0000000000000003e139 < (/.f64 angle 180) < 6.0000000000000004e197Initial program 29.5%
unpow229.5%
unpow229.5%
difference-of-squares29.5%
Applied egg-rr29.5%
Taylor expanded in angle around 0 48.8%
clear-num43.0%
un-div-inv48.0%
Applied egg-rr48.0%
associate-/r/53.9%
Simplified53.9%
if 6.0000000000000004e197 < (/.f64 angle 180) Initial program 41.0%
unpow241.0%
unpow241.0%
difference-of-squares45.3%
Applied egg-rr45.3%
Taylor expanded in angle around 0 17.0%
Taylor expanded in angle around 0 36.5%
associate-*r*36.5%
sub-neg36.5%
distribute-lft-in32.1%
Applied egg-rr32.1%
distribute-lft-out36.5%
sub-neg36.5%
+-commutative36.5%
Simplified36.5%
Final simplification66.4%
a_m = (fabs.f64 a)
angle_m = (fabs.f64 angle)
angle_s = (copysign.f64 1 angle)
(FPCore (angle_s a_m b angle_m)
:precision binary64
(let* ((t_0 (* 2.0 (* (- b a_m) (+ b a_m)))))
(*
angle_s
(if (<= (/ angle_m 180.0) 10000000000000.0)
(*
(cos (* PI (/ angle_m 180.0)))
(*
(- b a_m)
(* (* 2.0 (+ b a_m)) (* angle_m (* PI 0.005555555555555556)))))
(if (<= (/ angle_m 180.0) 5e+139)
(* t_0 (sin (/ 1.0 (/ 180.0 (* PI angle_m)))))
(if (<= (/ angle_m 180.0) 6e+197)
(* t_0 (sin (* angle_m (/ PI 180.0))))
(*
0.011111111111111112
(* angle_m (* (- b a_m) (* PI (+ b a_m)))))))))))a_m = fabs(a);
angle_m = fabs(angle);
angle_s = copysign(1.0, angle);
double code(double angle_s, double a_m, double b, double angle_m) {
double t_0 = 2.0 * ((b - a_m) * (b + a_m));
double tmp;
if ((angle_m / 180.0) <= 10000000000000.0) {
tmp = cos((((double) M_PI) * (angle_m / 180.0))) * ((b - a_m) * ((2.0 * (b + a_m)) * (angle_m * (((double) M_PI) * 0.005555555555555556))));
} else if ((angle_m / 180.0) <= 5e+139) {
tmp = t_0 * sin((1.0 / (180.0 / (((double) M_PI) * angle_m))));
} else if ((angle_m / 180.0) <= 6e+197) {
tmp = t_0 * sin((angle_m * (((double) M_PI) / 180.0)));
} else {
tmp = 0.011111111111111112 * (angle_m * ((b - a_m) * (((double) M_PI) * (b + a_m))));
}
return angle_s * tmp;
}
a_m = Math.abs(a);
angle_m = Math.abs(angle);
angle_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a_m, double b, double angle_m) {
double t_0 = 2.0 * ((b - a_m) * (b + a_m));
double tmp;
if ((angle_m / 180.0) <= 10000000000000.0) {
tmp = Math.cos((Math.PI * (angle_m / 180.0))) * ((b - a_m) * ((2.0 * (b + a_m)) * (angle_m * (Math.PI * 0.005555555555555556))));
} else if ((angle_m / 180.0) <= 5e+139) {
tmp = t_0 * Math.sin((1.0 / (180.0 / (Math.PI * angle_m))));
} else if ((angle_m / 180.0) <= 6e+197) {
tmp = t_0 * Math.sin((angle_m * (Math.PI / 180.0)));
} else {
tmp = 0.011111111111111112 * (angle_m * ((b - a_m) * (Math.PI * (b + a_m))));
}
return angle_s * tmp;
}
a_m = math.fabs(a) angle_m = math.fabs(angle) angle_s = math.copysign(1.0, angle) def code(angle_s, a_m, b, angle_m): t_0 = 2.0 * ((b - a_m) * (b + a_m)) tmp = 0 if (angle_m / 180.0) <= 10000000000000.0: tmp = math.cos((math.pi * (angle_m / 180.0))) * ((b - a_m) * ((2.0 * (b + a_m)) * (angle_m * (math.pi * 0.005555555555555556)))) elif (angle_m / 180.0) <= 5e+139: tmp = t_0 * math.sin((1.0 / (180.0 / (math.pi * angle_m)))) elif (angle_m / 180.0) <= 6e+197: tmp = t_0 * math.sin((angle_m * (math.pi / 180.0))) else: tmp = 0.011111111111111112 * (angle_m * ((b - a_m) * (math.pi * (b + a_m)))) return angle_s * tmp
a_m = abs(a) angle_m = abs(angle) angle_s = copysign(1.0, angle) function code(angle_s, a_m, b, angle_m) t_0 = Float64(2.0 * Float64(Float64(b - a_m) * Float64(b + a_m))) tmp = 0.0 if (Float64(angle_m / 180.0) <= 10000000000000.0) tmp = Float64(cos(Float64(pi * Float64(angle_m / 180.0))) * Float64(Float64(b - a_m) * Float64(Float64(2.0 * Float64(b + a_m)) * Float64(angle_m * Float64(pi * 0.005555555555555556))))); elseif (Float64(angle_m / 180.0) <= 5e+139) tmp = Float64(t_0 * sin(Float64(1.0 / Float64(180.0 / Float64(pi * angle_m))))); elseif (Float64(angle_m / 180.0) <= 6e+197) tmp = Float64(t_0 * sin(Float64(angle_m * Float64(pi / 180.0)))); else tmp = Float64(0.011111111111111112 * Float64(angle_m * Float64(Float64(b - a_m) * Float64(pi * Float64(b + a_m))))); end return Float64(angle_s * tmp) end
a_m = abs(a); angle_m = abs(angle); angle_s = sign(angle) * abs(1.0); function tmp_2 = code(angle_s, a_m, b, angle_m) t_0 = 2.0 * ((b - a_m) * (b + a_m)); tmp = 0.0; if ((angle_m / 180.0) <= 10000000000000.0) tmp = cos((pi * (angle_m / 180.0))) * ((b - a_m) * ((2.0 * (b + a_m)) * (angle_m * (pi * 0.005555555555555556)))); elseif ((angle_m / 180.0) <= 5e+139) tmp = t_0 * sin((1.0 / (180.0 / (pi * angle_m)))); elseif ((angle_m / 180.0) <= 6e+197) tmp = t_0 * sin((angle_m * (pi / 180.0))); else tmp = 0.011111111111111112 * (angle_m * ((b - a_m) * (pi * (b + a_m)))); end tmp_2 = angle_s * tmp; end
a_m = N[Abs[a], $MachinePrecision]
angle_m = N[Abs[angle], $MachinePrecision]
angle_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a$95$m_, b_, angle$95$m_] := Block[{t$95$0 = N[(2.0 * N[(N[(b - a$95$m), $MachinePrecision] * N[(b + a$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, N[(angle$95$s * If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 10000000000000.0], N[(N[Cos[N[(Pi * N[(angle$95$m / 180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(N[(b - a$95$m), $MachinePrecision] * N[(N[(2.0 * N[(b + a$95$m), $MachinePrecision]), $MachinePrecision] * N[(angle$95$m * N[(Pi * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 5e+139], N[(t$95$0 * N[Sin[N[(1.0 / N[(180.0 / N[(Pi * angle$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 6e+197], N[(t$95$0 * N[Sin[N[(angle$95$m * N[(Pi / 180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(0.011111111111111112 * N[(angle$95$m * N[(N[(b - a$95$m), $MachinePrecision] * N[(Pi * N[(b + a$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]), $MachinePrecision]]
\begin{array}{l}
a_m = \left|a\right|
\\
angle_m = \left|angle\right|
\\
angle_s = \mathsf{copysign}\left(1, angle\right)
\\
\begin{array}{l}
t_0 := 2 \cdot \left(\left(b - a\_m\right) \cdot \left(b + a\_m\right)\right)\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;\frac{angle\_m}{180} \leq 10000000000000:\\
\;\;\;\;\cos \left(\pi \cdot \frac{angle\_m}{180}\right) \cdot \left(\left(b - a\_m\right) \cdot \left(\left(2 \cdot \left(b + a\_m\right)\right) \cdot \left(angle\_m \cdot \left(\pi \cdot 0.005555555555555556\right)\right)\right)\right)\\
\mathbf{elif}\;\frac{angle\_m}{180} \leq 5 \cdot 10^{+139}:\\
\;\;\;\;t\_0 \cdot \sin \left(\frac{1}{\frac{180}{\pi \cdot angle\_m}}\right)\\
\mathbf{elif}\;\frac{angle\_m}{180} \leq 6 \cdot 10^{+197}:\\
\;\;\;\;t\_0 \cdot \sin \left(angle\_m \cdot \frac{\pi}{180}\right)\\
\mathbf{else}:\\
\;\;\;\;0.011111111111111112 \cdot \left(angle\_m \cdot \left(\left(b - a\_m\right) \cdot \left(\pi \cdot \left(b + a\_m\right)\right)\right)\right)\\
\end{array}
\end{array}
\end{array}
if (/.f64 angle 180) < 1e13Initial program 63.0%
add-cbrt-cube43.8%
pow1/330.5%
pow330.5%
*-commutative30.5%
div-inv30.5%
metadata-eval30.5%
Applied egg-rr30.5%
unpow1/343.3%
rem-cbrt-cube62.5%
*-commutative62.5%
*-commutative62.5%
*-commutative62.5%
unpow262.5%
unpow262.5%
difference-of-squares65.5%
associate-*r*65.5%
associate-*l*77.6%
Applied egg-rr77.6%
associate-*r*65.5%
*-commutative65.5%
associate-*l*77.6%
*-commutative77.6%
*-commutative77.6%
+-commutative77.6%
Simplified77.6%
Taylor expanded in angle around 0 71.6%
associate-*r*71.6%
*-commutative71.6%
associate-*r*71.6%
*-commutative71.6%
*-commutative71.6%
Simplified71.6%
if 1e13 < (/.f64 angle 180) < 5.0000000000000003e139Initial program 62.6%
unpow262.6%
unpow262.6%
difference-of-squares62.6%
Applied egg-rr62.6%
Taylor expanded in angle around 0 30.6%
associate-*r/37.7%
*-commutative37.7%
clear-num46.0%
*-commutative46.0%
Applied egg-rr46.0%
if 5.0000000000000003e139 < (/.f64 angle 180) < 6.0000000000000004e197Initial program 29.5%
unpow229.5%
unpow229.5%
difference-of-squares29.5%
Applied egg-rr29.5%
Taylor expanded in angle around 0 48.8%
clear-num43.0%
un-div-inv48.0%
Applied egg-rr48.0%
associate-/r/53.9%
Simplified53.9%
if 6.0000000000000004e197 < (/.f64 angle 180) Initial program 41.0%
unpow241.0%
unpow241.0%
difference-of-squares45.3%
Applied egg-rr45.3%
Taylor expanded in angle around 0 17.0%
Taylor expanded in angle around 0 36.5%
associate-*r*36.5%
sub-neg36.5%
distribute-lft-in32.1%
Applied egg-rr32.1%
distribute-lft-out36.5%
sub-neg36.5%
+-commutative36.5%
Simplified36.5%
Final simplification65.7%
a_m = (fabs.f64 a)
angle_m = (fabs.f64 angle)
angle_s = (copysign.f64 1 angle)
(FPCore (angle_s a_m b angle_m)
:precision binary64
(*
angle_s
(if (<= a_m 5.5e+153)
(*
2.0
(* (sin (* 0.005555555555555556 (* PI angle_m))) (* (- b a_m) (+ b a_m))))
(* (* PI (* angle_m (pow a_m 2.0))) -0.011111111111111112))))a_m = fabs(a);
angle_m = fabs(angle);
angle_s = copysign(1.0, angle);
double code(double angle_s, double a_m, double b, double angle_m) {
double tmp;
if (a_m <= 5.5e+153) {
tmp = 2.0 * (sin((0.005555555555555556 * (((double) M_PI) * angle_m))) * ((b - a_m) * (b + a_m)));
} else {
tmp = (((double) M_PI) * (angle_m * pow(a_m, 2.0))) * -0.011111111111111112;
}
return angle_s * tmp;
}
a_m = Math.abs(a);
angle_m = Math.abs(angle);
angle_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a_m, double b, double angle_m) {
double tmp;
if (a_m <= 5.5e+153) {
tmp = 2.0 * (Math.sin((0.005555555555555556 * (Math.PI * angle_m))) * ((b - a_m) * (b + a_m)));
} else {
tmp = (Math.PI * (angle_m * Math.pow(a_m, 2.0))) * -0.011111111111111112;
}
return angle_s * tmp;
}
a_m = math.fabs(a) angle_m = math.fabs(angle) angle_s = math.copysign(1.0, angle) def code(angle_s, a_m, b, angle_m): tmp = 0 if a_m <= 5.5e+153: tmp = 2.0 * (math.sin((0.005555555555555556 * (math.pi * angle_m))) * ((b - a_m) * (b + a_m))) else: tmp = (math.pi * (angle_m * math.pow(a_m, 2.0))) * -0.011111111111111112 return angle_s * tmp
a_m = abs(a) angle_m = abs(angle) angle_s = copysign(1.0, angle) function code(angle_s, a_m, b, angle_m) tmp = 0.0 if (a_m <= 5.5e+153) tmp = Float64(2.0 * Float64(sin(Float64(0.005555555555555556 * Float64(pi * angle_m))) * Float64(Float64(b - a_m) * Float64(b + a_m)))); else tmp = Float64(Float64(pi * Float64(angle_m * (a_m ^ 2.0))) * -0.011111111111111112); end return Float64(angle_s * tmp) end
a_m = abs(a); angle_m = abs(angle); angle_s = sign(angle) * abs(1.0); function tmp_2 = code(angle_s, a_m, b, angle_m) tmp = 0.0; if (a_m <= 5.5e+153) tmp = 2.0 * (sin((0.005555555555555556 * (pi * angle_m))) * ((b - a_m) * (b + a_m))); else tmp = (pi * (angle_m * (a_m ^ 2.0))) * -0.011111111111111112; end tmp_2 = angle_s * tmp; end
a_m = N[Abs[a], $MachinePrecision]
angle_m = N[Abs[angle], $MachinePrecision]
angle_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a$95$m_, b_, angle$95$m_] := N[(angle$95$s * If[LessEqual[a$95$m, 5.5e+153], N[(2.0 * N[(N[Sin[N[(0.005555555555555556 * N[(Pi * angle$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(N[(b - a$95$m), $MachinePrecision] * N[(b + a$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(Pi * N[(angle$95$m * N[Power[a$95$m, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * -0.011111111111111112), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
a_m = \left|a\right|
\\
angle_m = \left|angle\right|
\\
angle_s = \mathsf{copysign}\left(1, angle\right)
\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;a\_m \leq 5.5 \cdot 10^{+153}:\\
\;\;\;\;2 \cdot \left(\sin \left(0.005555555555555556 \cdot \left(\pi \cdot angle\_m\right)\right) \cdot \left(\left(b - a\_m\right) \cdot \left(b + a\_m\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\pi \cdot \left(angle\_m \cdot {a\_m}^{2}\right)\right) \cdot -0.011111111111111112\\
\end{array}
\end{array}
if a < 5.5000000000000003e153Initial program 60.2%
unpow260.2%
unpow260.2%
difference-of-squares61.1%
Applied egg-rr61.1%
Taylor expanded in angle around 0 54.2%
add-cbrt-cube55.1%
pow355.1%
Applied egg-rr55.1%
Taylor expanded in angle around inf 55.8%
if 5.5000000000000003e153 < a Initial program 45.1%
unpow245.1%
unpow245.1%
difference-of-squares61.8%
Applied egg-rr61.8%
Taylor expanded in angle around 0 48.4%
Taylor expanded in angle around 0 58.4%
Taylor expanded in a around inf 61.8%
*-commutative61.8%
associate-*r*61.8%
*-commutative61.8%
*-commutative61.8%
Simplified61.8%
Final simplification56.5%
a_m = (fabs.f64 a)
angle_m = (fabs.f64 angle)
angle_s = (copysign.f64 1 angle)
(FPCore (angle_s a_m b angle_m)
:precision binary64
(*
angle_s
(if (<= a_m 9.5e+153)
(* (* 2.0 (* (- b a_m) (+ b a_m))) (sin (* angle_m (/ PI 180.0))))
(* (* PI (* angle_m (pow a_m 2.0))) -0.011111111111111112))))a_m = fabs(a);
angle_m = fabs(angle);
angle_s = copysign(1.0, angle);
double code(double angle_s, double a_m, double b, double angle_m) {
double tmp;
if (a_m <= 9.5e+153) {
tmp = (2.0 * ((b - a_m) * (b + a_m))) * sin((angle_m * (((double) M_PI) / 180.0)));
} else {
tmp = (((double) M_PI) * (angle_m * pow(a_m, 2.0))) * -0.011111111111111112;
}
return angle_s * tmp;
}
a_m = Math.abs(a);
angle_m = Math.abs(angle);
angle_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a_m, double b, double angle_m) {
double tmp;
if (a_m <= 9.5e+153) {
tmp = (2.0 * ((b - a_m) * (b + a_m))) * Math.sin((angle_m * (Math.PI / 180.0)));
} else {
tmp = (Math.PI * (angle_m * Math.pow(a_m, 2.0))) * -0.011111111111111112;
}
return angle_s * tmp;
}
a_m = math.fabs(a) angle_m = math.fabs(angle) angle_s = math.copysign(1.0, angle) def code(angle_s, a_m, b, angle_m): tmp = 0 if a_m <= 9.5e+153: tmp = (2.0 * ((b - a_m) * (b + a_m))) * math.sin((angle_m * (math.pi / 180.0))) else: tmp = (math.pi * (angle_m * math.pow(a_m, 2.0))) * -0.011111111111111112 return angle_s * tmp
a_m = abs(a) angle_m = abs(angle) angle_s = copysign(1.0, angle) function code(angle_s, a_m, b, angle_m) tmp = 0.0 if (a_m <= 9.5e+153) tmp = Float64(Float64(2.0 * Float64(Float64(b - a_m) * Float64(b + a_m))) * sin(Float64(angle_m * Float64(pi / 180.0)))); else tmp = Float64(Float64(pi * Float64(angle_m * (a_m ^ 2.0))) * -0.011111111111111112); end return Float64(angle_s * tmp) end
a_m = abs(a); angle_m = abs(angle); angle_s = sign(angle) * abs(1.0); function tmp_2 = code(angle_s, a_m, b, angle_m) tmp = 0.0; if (a_m <= 9.5e+153) tmp = (2.0 * ((b - a_m) * (b + a_m))) * sin((angle_m * (pi / 180.0))); else tmp = (pi * (angle_m * (a_m ^ 2.0))) * -0.011111111111111112; end tmp_2 = angle_s * tmp; end
a_m = N[Abs[a], $MachinePrecision]
angle_m = N[Abs[angle], $MachinePrecision]
angle_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a$95$m_, b_, angle$95$m_] := N[(angle$95$s * If[LessEqual[a$95$m, 9.5e+153], N[(N[(2.0 * N[(N[(b - a$95$m), $MachinePrecision] * N[(b + a$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sin[N[(angle$95$m * N[(Pi / 180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[(Pi * N[(angle$95$m * N[Power[a$95$m, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * -0.011111111111111112), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
a_m = \left|a\right|
\\
angle_m = \left|angle\right|
\\
angle_s = \mathsf{copysign}\left(1, angle\right)
\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;a\_m \leq 9.5 \cdot 10^{+153}:\\
\;\;\;\;\left(2 \cdot \left(\left(b - a\_m\right) \cdot \left(b + a\_m\right)\right)\right) \cdot \sin \left(angle\_m \cdot \frac{\pi}{180}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\pi \cdot \left(angle\_m \cdot {a\_m}^{2}\right)\right) \cdot -0.011111111111111112\\
\end{array}
\end{array}
if a < 9.4999999999999995e153Initial program 60.2%
unpow260.2%
unpow260.2%
difference-of-squares61.1%
Applied egg-rr61.1%
Taylor expanded in angle around 0 54.2%
clear-num54.3%
un-div-inv55.4%
Applied egg-rr55.4%
associate-/r/56.2%
Simplified56.2%
if 9.4999999999999995e153 < a Initial program 45.1%
unpow245.1%
unpow245.1%
difference-of-squares61.8%
Applied egg-rr61.8%
Taylor expanded in angle around 0 48.4%
Taylor expanded in angle around 0 58.4%
Taylor expanded in a around inf 61.8%
*-commutative61.8%
associate-*r*61.8%
*-commutative61.8%
*-commutative61.8%
Simplified61.8%
Final simplification56.9%
a_m = (fabs.f64 a) angle_m = (fabs.f64 angle) angle_s = (copysign.f64 1 angle) (FPCore (angle_s a_m b angle_m) :precision binary64 (* angle_s (* 0.011111111111111112 (* angle_m (* PI (* (- b a_m) (+ b a_m)))))))
a_m = fabs(a);
angle_m = fabs(angle);
angle_s = copysign(1.0, angle);
double code(double angle_s, double a_m, double b, double angle_m) {
return angle_s * (0.011111111111111112 * (angle_m * (((double) M_PI) * ((b - a_m) * (b + a_m)))));
}
a_m = Math.abs(a);
angle_m = Math.abs(angle);
angle_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a_m, double b, double angle_m) {
return angle_s * (0.011111111111111112 * (angle_m * (Math.PI * ((b - a_m) * (b + a_m)))));
}
a_m = math.fabs(a) angle_m = math.fabs(angle) angle_s = math.copysign(1.0, angle) def code(angle_s, a_m, b, angle_m): return angle_s * (0.011111111111111112 * (angle_m * (math.pi * ((b - a_m) * (b + a_m)))))
a_m = abs(a) angle_m = abs(angle) angle_s = copysign(1.0, angle) function code(angle_s, a_m, b, angle_m) return Float64(angle_s * Float64(0.011111111111111112 * Float64(angle_m * Float64(pi * Float64(Float64(b - a_m) * Float64(b + a_m)))))) end
a_m = abs(a); angle_m = abs(angle); angle_s = sign(angle) * abs(1.0); function tmp = code(angle_s, a_m, b, angle_m) tmp = angle_s * (0.011111111111111112 * (angle_m * (pi * ((b - a_m) * (b + a_m))))); end
a_m = N[Abs[a], $MachinePrecision]
angle_m = N[Abs[angle], $MachinePrecision]
angle_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a$95$m_, b_, angle$95$m_] := N[(angle$95$s * N[(0.011111111111111112 * N[(angle$95$m * N[(Pi * N[(N[(b - a$95$m), $MachinePrecision] * N[(b + a$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
a_m = \left|a\right|
\\
angle_m = \left|angle\right|
\\
angle_s = \mathsf{copysign}\left(1, angle\right)
\\
angle\_s \cdot \left(0.011111111111111112 \cdot \left(angle\_m \cdot \left(\pi \cdot \left(\left(b - a\_m\right) \cdot \left(b + a\_m\right)\right)\right)\right)\right)
\end{array}
Initial program 58.4%
unpow258.4%
unpow258.4%
difference-of-squares61.2%
Applied egg-rr61.2%
Taylor expanded in angle around 0 53.5%
Taylor expanded in angle around 0 54.7%
Final simplification54.7%
a_m = (fabs.f64 a) angle_m = (fabs.f64 angle) angle_s = (copysign.f64 1 angle) (FPCore (angle_s a_m b angle_m) :precision binary64 (* angle_s (* 0.011111111111111112 (* angle_m (* (- b a_m) (* PI (+ b a_m)))))))
a_m = fabs(a);
angle_m = fabs(angle);
angle_s = copysign(1.0, angle);
double code(double angle_s, double a_m, double b, double angle_m) {
return angle_s * (0.011111111111111112 * (angle_m * ((b - a_m) * (((double) M_PI) * (b + a_m)))));
}
a_m = Math.abs(a);
angle_m = Math.abs(angle);
angle_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a_m, double b, double angle_m) {
return angle_s * (0.011111111111111112 * (angle_m * ((b - a_m) * (Math.PI * (b + a_m)))));
}
a_m = math.fabs(a) angle_m = math.fabs(angle) angle_s = math.copysign(1.0, angle) def code(angle_s, a_m, b, angle_m): return angle_s * (0.011111111111111112 * (angle_m * ((b - a_m) * (math.pi * (b + a_m)))))
a_m = abs(a) angle_m = abs(angle) angle_s = copysign(1.0, angle) function code(angle_s, a_m, b, angle_m) return Float64(angle_s * Float64(0.011111111111111112 * Float64(angle_m * Float64(Float64(b - a_m) * Float64(pi * Float64(b + a_m)))))) end
a_m = abs(a); angle_m = abs(angle); angle_s = sign(angle) * abs(1.0); function tmp = code(angle_s, a_m, b, angle_m) tmp = angle_s * (0.011111111111111112 * (angle_m * ((b - a_m) * (pi * (b + a_m))))); end
a_m = N[Abs[a], $MachinePrecision]
angle_m = N[Abs[angle], $MachinePrecision]
angle_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a$95$m_, b_, angle$95$m_] := N[(angle$95$s * N[(0.011111111111111112 * N[(angle$95$m * N[(N[(b - a$95$m), $MachinePrecision] * N[(Pi * N[(b + a$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
a_m = \left|a\right|
\\
angle_m = \left|angle\right|
\\
angle_s = \mathsf{copysign}\left(1, angle\right)
\\
angle\_s \cdot \left(0.011111111111111112 \cdot \left(angle\_m \cdot \left(\left(b - a\_m\right) \cdot \left(\pi \cdot \left(b + a\_m\right)\right)\right)\right)\right)
\end{array}
Initial program 58.4%
unpow258.4%
unpow258.4%
difference-of-squares61.2%
Applied egg-rr61.2%
Taylor expanded in angle around 0 53.5%
Taylor expanded in angle around 0 54.7%
associate-*r*54.7%
sub-neg54.7%
distribute-lft-in52.3%
Applied egg-rr52.3%
distribute-lft-out54.7%
sub-neg54.7%
+-commutative54.7%
Simplified54.7%
Final simplification54.7%
a_m = (fabs.f64 a) angle_m = (fabs.f64 angle) angle_s = (copysign.f64 1 angle) (FPCore (angle_s a_m b angle_m) :precision binary64 (* angle_s (* (* PI (* (- b a_m) (+ b a_m))) (* angle_m 0.011111111111111112))))
a_m = fabs(a);
angle_m = fabs(angle);
angle_s = copysign(1.0, angle);
double code(double angle_s, double a_m, double b, double angle_m) {
return angle_s * ((((double) M_PI) * ((b - a_m) * (b + a_m))) * (angle_m * 0.011111111111111112));
}
a_m = Math.abs(a);
angle_m = Math.abs(angle);
angle_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a_m, double b, double angle_m) {
return angle_s * ((Math.PI * ((b - a_m) * (b + a_m))) * (angle_m * 0.011111111111111112));
}
a_m = math.fabs(a) angle_m = math.fabs(angle) angle_s = math.copysign(1.0, angle) def code(angle_s, a_m, b, angle_m): return angle_s * ((math.pi * ((b - a_m) * (b + a_m))) * (angle_m * 0.011111111111111112))
a_m = abs(a) angle_m = abs(angle) angle_s = copysign(1.0, angle) function code(angle_s, a_m, b, angle_m) return Float64(angle_s * Float64(Float64(pi * Float64(Float64(b - a_m) * Float64(b + a_m))) * Float64(angle_m * 0.011111111111111112))) end
a_m = abs(a); angle_m = abs(angle); angle_s = sign(angle) * abs(1.0); function tmp = code(angle_s, a_m, b, angle_m) tmp = angle_s * ((pi * ((b - a_m) * (b + a_m))) * (angle_m * 0.011111111111111112)); end
a_m = N[Abs[a], $MachinePrecision]
angle_m = N[Abs[angle], $MachinePrecision]
angle_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a$95$m_, b_, angle$95$m_] := N[(angle$95$s * N[(N[(Pi * N[(N[(b - a$95$m), $MachinePrecision] * N[(b + a$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(angle$95$m * 0.011111111111111112), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
a_m = \left|a\right|
\\
angle_m = \left|angle\right|
\\
angle_s = \mathsf{copysign}\left(1, angle\right)
\\
angle\_s \cdot \left(\left(\pi \cdot \left(\left(b - a\_m\right) \cdot \left(b + a\_m\right)\right)\right) \cdot \left(angle\_m \cdot 0.011111111111111112\right)\right)
\end{array}
Initial program 58.4%
unpow258.4%
unpow258.4%
difference-of-squares61.2%
Applied egg-rr61.2%
Taylor expanded in angle around 0 53.5%
Taylor expanded in angle around 0 54.7%
associate-*r*54.7%
Simplified54.7%
Final simplification54.7%
herbie shell --seed 2024031
(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)))))