
(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 14 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (a b angle) :precision binary64 (let* ((t_0 (* PI (/ angle 180.0)))) (* (* (* 2.0 (- (pow b 2.0) (pow a 2.0))) (sin t_0)) (cos t_0))))
double code(double a, double b, double angle) {
double t_0 = ((double) M_PI) * (angle / 180.0);
return ((2.0 * (pow(b, 2.0) - pow(a, 2.0))) * sin(t_0)) * cos(t_0);
}
public static double code(double a, double b, double angle) {
double t_0 = Math.PI * (angle / 180.0);
return ((2.0 * (Math.pow(b, 2.0) - Math.pow(a, 2.0))) * Math.sin(t_0)) * Math.cos(t_0);
}
def code(a, b, angle): t_0 = math.pi * (angle / 180.0) return ((2.0 * (math.pow(b, 2.0) - math.pow(a, 2.0))) * math.sin(t_0)) * math.cos(t_0)
function code(a, b, angle) t_0 = Float64(pi * Float64(angle / 180.0)) return Float64(Float64(Float64(2.0 * Float64((b ^ 2.0) - (a ^ 2.0))) * sin(t_0)) * cos(t_0)) end
function tmp = code(a, b, angle) t_0 = pi * (angle / 180.0); tmp = ((2.0 * ((b ^ 2.0) - (a ^ 2.0))) * sin(t_0)) * cos(t_0); end
code[a_, b_, angle_] := Block[{t$95$0 = N[(Pi * N[(angle / 180.0), $MachinePrecision]), $MachinePrecision]}, N[(N[(N[(2.0 * N[(N[Power[b, 2.0], $MachinePrecision] - N[Power[a, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision] * N[Cos[t$95$0], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \pi \cdot \frac{angle}{180}\\
\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin t_0\right) \cdot \cos t_0
\end{array}
\end{array}
angle_m = (fabs.f64 angle)
angle_s = (copysign.f64 1 angle)
(FPCore (angle_s a b angle_m)
:precision binary64
(let* ((t_0 (* 2.0 (* (+ b a) (- b a))))
(t_1 (* PI (/ angle_m 180.0)))
(t_2 (- (pow b 2.0) (pow a 2.0))))
(*
angle_s
(if (<= t_2 1e+306)
(*
(* t_0 (sin t_1))
(cos (* (/ angle_m 180.0) (pow (pow (cbrt (sqrt PI)) 3.0) 2.0))))
(if (<= t_2 INFINITY)
(*
(pow
(*
(sqrt (sin (* 0.005555555555555556 (* PI angle_m))))
(* b (sqrt 2.0)))
2.0)
(cos t_1))
(*
(* t_0 (sin (* (/ angle_m 180.0) (cbrt (pow PI 3.0)))))
(cos (expm1 (log1p (* PI (* angle_m 0.005555555555555556)))))))))))angle_m = fabs(angle);
angle_s = copysign(1.0, angle);
double code(double angle_s, double a, double b, double angle_m) {
double t_0 = 2.0 * ((b + a) * (b - a));
double t_1 = ((double) M_PI) * (angle_m / 180.0);
double t_2 = pow(b, 2.0) - pow(a, 2.0);
double tmp;
if (t_2 <= 1e+306) {
tmp = (t_0 * sin(t_1)) * cos(((angle_m / 180.0) * pow(pow(cbrt(sqrt(((double) M_PI))), 3.0), 2.0)));
} else if (t_2 <= ((double) INFINITY)) {
tmp = pow((sqrt(sin((0.005555555555555556 * (((double) M_PI) * angle_m)))) * (b * sqrt(2.0))), 2.0) * cos(t_1);
} else {
tmp = (t_0 * sin(((angle_m / 180.0) * cbrt(pow(((double) M_PI), 3.0))))) * cos(expm1(log1p((((double) M_PI) * (angle_m * 0.005555555555555556)))));
}
return angle_s * tmp;
}
angle_m = Math.abs(angle);
angle_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b, double angle_m) {
double t_0 = 2.0 * ((b + a) * (b - a));
double t_1 = Math.PI * (angle_m / 180.0);
double t_2 = Math.pow(b, 2.0) - Math.pow(a, 2.0);
double tmp;
if (t_2 <= 1e+306) {
tmp = (t_0 * Math.sin(t_1)) * Math.cos(((angle_m / 180.0) * Math.pow(Math.pow(Math.cbrt(Math.sqrt(Math.PI)), 3.0), 2.0)));
} else if (t_2 <= Double.POSITIVE_INFINITY) {
tmp = Math.pow((Math.sqrt(Math.sin((0.005555555555555556 * (Math.PI * angle_m)))) * (b * Math.sqrt(2.0))), 2.0) * Math.cos(t_1);
} else {
tmp = (t_0 * Math.sin(((angle_m / 180.0) * Math.cbrt(Math.pow(Math.PI, 3.0))))) * Math.cos(Math.expm1(Math.log1p((Math.PI * (angle_m * 0.005555555555555556)))));
}
return angle_s * tmp;
}
angle_m = abs(angle) angle_s = copysign(1.0, angle) function code(angle_s, a, b, angle_m) t_0 = Float64(2.0 * Float64(Float64(b + a) * Float64(b - a))) t_1 = Float64(pi * Float64(angle_m / 180.0)) t_2 = Float64((b ^ 2.0) - (a ^ 2.0)) tmp = 0.0 if (t_2 <= 1e+306) tmp = Float64(Float64(t_0 * sin(t_1)) * cos(Float64(Float64(angle_m / 180.0) * ((cbrt(sqrt(pi)) ^ 3.0) ^ 2.0)))); elseif (t_2 <= Inf) tmp = Float64((Float64(sqrt(sin(Float64(0.005555555555555556 * Float64(pi * angle_m)))) * Float64(b * sqrt(2.0))) ^ 2.0) * cos(t_1)); else tmp = Float64(Float64(t_0 * sin(Float64(Float64(angle_m / 180.0) * cbrt((pi ^ 3.0))))) * cos(expm1(log1p(Float64(pi * Float64(angle_m * 0.005555555555555556)))))); end return Float64(angle_s * tmp) end
angle_m = N[Abs[angle], $MachinePrecision]
angle_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a_, b_, angle$95$m_] := Block[{t$95$0 = N[(2.0 * N[(N[(b + a), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(Pi * N[(angle$95$m / 180.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[Power[b, 2.0], $MachinePrecision] - N[Power[a, 2.0], $MachinePrecision]), $MachinePrecision]}, N[(angle$95$s * If[LessEqual[t$95$2, 1e+306], N[(N[(t$95$0 * N[Sin[t$95$1], $MachinePrecision]), $MachinePrecision] * N[Cos[N[(N[(angle$95$m / 180.0), $MachinePrecision] * N[Power[N[Power[N[Power[N[Sqrt[Pi], $MachinePrecision], 1/3], $MachinePrecision], 3.0], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, Infinity], N[(N[Power[N[(N[Sqrt[N[Sin[N[(0.005555555555555556 * N[(Pi * angle$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * N[(b * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[Cos[t$95$1], $MachinePrecision]), $MachinePrecision], N[(N[(t$95$0 * N[Sin[N[(N[(angle$95$m / 180.0), $MachinePrecision] * N[Power[N[Power[Pi, 3.0], $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[Cos[N[(Exp[N[Log[1 + N[(Pi * N[(angle$95$m * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]] - 1), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]]]]
\begin{array}{l}
angle_m = \left|angle\right|
\\
angle_s = \mathsf{copysign}\left(1, angle\right)
\\
\begin{array}{l}
t_0 := 2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\\
t_1 := \pi \cdot \frac{angle_m}{180}\\
t_2 := {b}^{2} - {a}^{2}\\
angle_s \cdot \begin{array}{l}
\mathbf{if}\;t_2 \leq 10^{+306}:\\
\;\;\;\;\left(t_0 \cdot \sin t_1\right) \cdot \cos \left(\frac{angle_m}{180} \cdot {\left({\left(\sqrt[3]{\sqrt{\pi}}\right)}^{3}\right)}^{2}\right)\\
\mathbf{elif}\;t_2 \leq \infty:\\
\;\;\;\;{\left(\sqrt{\sin \left(0.005555555555555556 \cdot \left(\pi \cdot angle_m\right)\right)} \cdot \left(b \cdot \sqrt{2}\right)\right)}^{2} \cdot \cos t_1\\
\mathbf{else}:\\
\;\;\;\;\left(t_0 \cdot \sin \left(\frac{angle_m}{180} \cdot \sqrt[3]{{\pi}^{3}}\right)\right) \cdot \cos \left(\mathsf{expm1}\left(\mathsf{log1p}\left(\pi \cdot \left(angle_m \cdot 0.005555555555555556\right)\right)\right)\right)\\
\end{array}
\end{array}
\end{array}
if (-.f64 (pow.f64 b 2) (pow.f64 a 2)) < 1.00000000000000002e306Initial program 56.0%
unpow256.0%
unpow256.0%
difference-of-squares56.0%
Applied egg-rr56.0%
add-sqr-sqrt56.6%
pow256.6%
Applied egg-rr56.6%
add-cube-cbrt57.0%
pow358.6%
Applied egg-rr58.6%
if 1.00000000000000002e306 < (-.f64 (pow.f64 b 2) (pow.f64 a 2)) < +inf.0Initial program 47.1%
unpow247.1%
unpow247.1%
difference-of-squares47.1%
Applied egg-rr47.1%
Taylor expanded in b around inf 47.1%
associate-*r*47.1%
associate-*r*49.1%
*-commutative49.1%
*-commutative49.1%
*-commutative49.1%
Simplified49.1%
add-sqr-sqrt27.7%
pow227.7%
*-commutative27.7%
rem-log-exp18.4%
sqrt-prod18.4%
*-commutative18.4%
sqrt-prod18.4%
unpow218.4%
sqrt-prod8.7%
add-sqr-sqrt19.5%
rem-log-exp48.3%
Applied egg-rr48.3%
*-commutative48.3%
*-commutative48.3%
*-commutative48.3%
associate-*r*46.4%
Simplified46.4%
if +inf.0 < (-.f64 (pow.f64 b 2) (pow.f64 a 2)) Initial program 0.0%
unpow20.0%
unpow20.0%
difference-of-squares56.8%
Applied egg-rr56.8%
add-cbrt-cube69.3%
pow369.3%
Applied egg-rr69.3%
div-inv69.3%
metadata-eval69.3%
expm1-log1p-u44.3%
Applied egg-rr44.3%
Final simplification55.4%
angle_m = (fabs.f64 angle)
angle_s = (copysign.f64 1 angle)
(FPCore (angle_s a b angle_m)
:precision binary64
(let* ((t_0 (* 2.0 (* (+ b a) (- b a))))
(t_1 (- (pow b 2.0) (pow a 2.0)))
(t_2 (* PI (* angle_m 0.005555555555555556))))
(*
angle_s
(if (<= t_1 2e+266)
(* (* t_0 (expm1 (log1p (sin t_2)))) (cos (/ angle_m (/ 180.0 PI))))
(if (<= t_1 INFINITY)
(*
(pow
(*
(sqrt (sin (* 0.005555555555555556 (* PI angle_m))))
(* b (sqrt 2.0)))
2.0)
(cos (* PI (/ angle_m 180.0))))
(*
(* t_0 (sin (* (/ angle_m 180.0) (cbrt (pow PI 3.0)))))
(cos (expm1 (log1p t_2)))))))))angle_m = fabs(angle);
angle_s = copysign(1.0, angle);
double code(double angle_s, double a, double b, double angle_m) {
double t_0 = 2.0 * ((b + a) * (b - a));
double t_1 = pow(b, 2.0) - pow(a, 2.0);
double t_2 = ((double) M_PI) * (angle_m * 0.005555555555555556);
double tmp;
if (t_1 <= 2e+266) {
tmp = (t_0 * expm1(log1p(sin(t_2)))) * cos((angle_m / (180.0 / ((double) M_PI))));
} else if (t_1 <= ((double) INFINITY)) {
tmp = pow((sqrt(sin((0.005555555555555556 * (((double) M_PI) * angle_m)))) * (b * sqrt(2.0))), 2.0) * cos((((double) M_PI) * (angle_m / 180.0)));
} else {
tmp = (t_0 * sin(((angle_m / 180.0) * cbrt(pow(((double) M_PI), 3.0))))) * cos(expm1(log1p(t_2)));
}
return angle_s * tmp;
}
angle_m = Math.abs(angle);
angle_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b, double angle_m) {
double t_0 = 2.0 * ((b + a) * (b - a));
double t_1 = Math.pow(b, 2.0) - Math.pow(a, 2.0);
double t_2 = Math.PI * (angle_m * 0.005555555555555556);
double tmp;
if (t_1 <= 2e+266) {
tmp = (t_0 * Math.expm1(Math.log1p(Math.sin(t_2)))) * Math.cos((angle_m / (180.0 / Math.PI)));
} else if (t_1 <= Double.POSITIVE_INFINITY) {
tmp = Math.pow((Math.sqrt(Math.sin((0.005555555555555556 * (Math.PI * angle_m)))) * (b * Math.sqrt(2.0))), 2.0) * Math.cos((Math.PI * (angle_m / 180.0)));
} else {
tmp = (t_0 * Math.sin(((angle_m / 180.0) * Math.cbrt(Math.pow(Math.PI, 3.0))))) * Math.cos(Math.expm1(Math.log1p(t_2)));
}
return angle_s * tmp;
}
angle_m = abs(angle) angle_s = copysign(1.0, angle) function code(angle_s, a, b, angle_m) t_0 = Float64(2.0 * Float64(Float64(b + a) * Float64(b - a))) t_1 = Float64((b ^ 2.0) - (a ^ 2.0)) t_2 = Float64(pi * Float64(angle_m * 0.005555555555555556)) tmp = 0.0 if (t_1 <= 2e+266) tmp = Float64(Float64(t_0 * expm1(log1p(sin(t_2)))) * cos(Float64(angle_m / Float64(180.0 / pi)))); elseif (t_1 <= Inf) tmp = Float64((Float64(sqrt(sin(Float64(0.005555555555555556 * Float64(pi * angle_m)))) * Float64(b * sqrt(2.0))) ^ 2.0) * cos(Float64(pi * Float64(angle_m / 180.0)))); else tmp = Float64(Float64(t_0 * sin(Float64(Float64(angle_m / 180.0) * cbrt((pi ^ 3.0))))) * cos(expm1(log1p(t_2)))); end return Float64(angle_s * tmp) end
angle_m = N[Abs[angle], $MachinePrecision]
angle_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a_, b_, angle$95$m_] := Block[{t$95$0 = N[(2.0 * N[(N[(b + a), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[Power[b, 2.0], $MachinePrecision] - N[Power[a, 2.0], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(Pi * N[(angle$95$m * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]}, N[(angle$95$s * If[LessEqual[t$95$1, 2e+266], N[(N[(t$95$0 * N[(Exp[N[Log[1 + N[Sin[t$95$2], $MachinePrecision]], $MachinePrecision]] - 1), $MachinePrecision]), $MachinePrecision] * N[Cos[N[(angle$95$m / N[(180.0 / Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, Infinity], N[(N[Power[N[(N[Sqrt[N[Sin[N[(0.005555555555555556 * N[(Pi * angle$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * N[(b * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[Cos[N[(Pi * N[(angle$95$m / 180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[(t$95$0 * N[Sin[N[(N[(angle$95$m / 180.0), $MachinePrecision] * N[Power[N[Power[Pi, 3.0], $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[Cos[N[(Exp[N[Log[1 + t$95$2], $MachinePrecision]] - 1), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]]]]
\begin{array}{l}
angle_m = \left|angle\right|
\\
angle_s = \mathsf{copysign}\left(1, angle\right)
\\
\begin{array}{l}
t_0 := 2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\\
t_1 := {b}^{2} - {a}^{2}\\
t_2 := \pi \cdot \left(angle_m \cdot 0.005555555555555556\right)\\
angle_s \cdot \begin{array}{l}
\mathbf{if}\;t_1 \leq 2 \cdot 10^{+266}:\\
\;\;\;\;\left(t_0 \cdot \mathsf{expm1}\left(\mathsf{log1p}\left(\sin t_2\right)\right)\right) \cdot \cos \left(\frac{angle_m}{\frac{180}{\pi}}\right)\\
\mathbf{elif}\;t_1 \leq \infty:\\
\;\;\;\;{\left(\sqrt{\sin \left(0.005555555555555556 \cdot \left(\pi \cdot angle_m\right)\right)} \cdot \left(b \cdot \sqrt{2}\right)\right)}^{2} \cdot \cos \left(\pi \cdot \frac{angle_m}{180}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(t_0 \cdot \sin \left(\frac{angle_m}{180} \cdot \sqrt[3]{{\pi}^{3}}\right)\right) \cdot \cos \left(\mathsf{expm1}\left(\mathsf{log1p}\left(t_2\right)\right)\right)\\
\end{array}
\end{array}
\end{array}
if (-.f64 (pow.f64 b 2) (pow.f64 a 2)) < 2.0000000000000001e266Initial program 56.4%
unpow256.4%
unpow256.4%
difference-of-squares56.4%
Applied egg-rr56.4%
add-cbrt-cube55.3%
pow355.3%
Applied egg-rr55.3%
associate-*r/54.9%
*-commutative54.9%
associate-/l*56.8%
Applied egg-rr56.8%
rem-cbrt-cube58.1%
div-inv58.5%
metadata-eval58.5%
expm1-log1p-u58.5%
Applied egg-rr58.5%
if 2.0000000000000001e266 < (-.f64 (pow.f64 b 2) (pow.f64 a 2)) < +inf.0Initial program 46.9%
unpow246.9%
unpow246.9%
difference-of-squares46.9%
Applied egg-rr46.9%
Taylor expanded in b around inf 47.0%
associate-*r*47.0%
associate-*r*48.7%
*-commutative48.7%
*-commutative48.7%
*-commutative48.7%
Simplified48.7%
add-sqr-sqrt26.0%
pow226.0%
*-commutative26.0%
rem-log-exp16.2%
sqrt-prod16.2%
*-commutative16.2%
sqrt-prod16.2%
unpow216.2%
sqrt-prod7.7%
add-sqr-sqrt17.3%
rem-log-exp44.0%
Applied egg-rr44.0%
*-commutative44.0%
*-commutative44.0%
*-commutative44.0%
associate-*r*42.7%
Simplified42.7%
if +inf.0 < (-.f64 (pow.f64 b 2) (pow.f64 a 2)) Initial program 0.0%
unpow20.0%
unpow20.0%
difference-of-squares56.8%
Applied egg-rr56.8%
add-cbrt-cube69.3%
pow369.3%
Applied egg-rr69.3%
div-inv69.3%
metadata-eval69.3%
expm1-log1p-u44.3%
Applied egg-rr44.3%
Final simplification54.1%
angle_m = (fabs.f64 angle)
angle_s = (copysign.f64 1 angle)
(FPCore (angle_s a b angle_m)
:precision binary64
(let* ((t_0 (* 2.0 (* (+ b a) (- b a))))
(t_1 (- (pow b 2.0) (pow a 2.0)))
(t_2 (* PI (/ angle_m 180.0))))
(*
angle_s
(if (<= t_1 2e+266)
(*
(* t_0 (expm1 (log1p (sin (* PI (* angle_m 0.005555555555555556))))))
(cos (/ angle_m (/ 180.0 PI))))
(if (<= t_1 INFINITY)
(*
(pow
(*
(sqrt (sin (* 0.005555555555555556 (* PI angle_m))))
(* b (sqrt 2.0)))
2.0)
(cos t_2))
(*
(* t_0 (sin t_2))
(cos (* (/ angle_m 180.0) (pow (cbrt (pow PI 1.5)) 2.0)))))))))angle_m = fabs(angle);
angle_s = copysign(1.0, angle);
double code(double angle_s, double a, double b, double angle_m) {
double t_0 = 2.0 * ((b + a) * (b - a));
double t_1 = pow(b, 2.0) - pow(a, 2.0);
double t_2 = ((double) M_PI) * (angle_m / 180.0);
double tmp;
if (t_1 <= 2e+266) {
tmp = (t_0 * expm1(log1p(sin((((double) M_PI) * (angle_m * 0.005555555555555556)))))) * cos((angle_m / (180.0 / ((double) M_PI))));
} else if (t_1 <= ((double) INFINITY)) {
tmp = pow((sqrt(sin((0.005555555555555556 * (((double) M_PI) * angle_m)))) * (b * sqrt(2.0))), 2.0) * cos(t_2);
} else {
tmp = (t_0 * sin(t_2)) * cos(((angle_m / 180.0) * pow(cbrt(pow(((double) M_PI), 1.5)), 2.0)));
}
return angle_s * tmp;
}
angle_m = Math.abs(angle);
angle_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b, double angle_m) {
double t_0 = 2.0 * ((b + a) * (b - a));
double t_1 = Math.pow(b, 2.0) - Math.pow(a, 2.0);
double t_2 = Math.PI * (angle_m / 180.0);
double tmp;
if (t_1 <= 2e+266) {
tmp = (t_0 * Math.expm1(Math.log1p(Math.sin((Math.PI * (angle_m * 0.005555555555555556)))))) * Math.cos((angle_m / (180.0 / Math.PI)));
} else if (t_1 <= Double.POSITIVE_INFINITY) {
tmp = Math.pow((Math.sqrt(Math.sin((0.005555555555555556 * (Math.PI * angle_m)))) * (b * Math.sqrt(2.0))), 2.0) * Math.cos(t_2);
} else {
tmp = (t_0 * Math.sin(t_2)) * Math.cos(((angle_m / 180.0) * Math.pow(Math.cbrt(Math.pow(Math.PI, 1.5)), 2.0)));
}
return angle_s * tmp;
}
angle_m = abs(angle) angle_s = copysign(1.0, angle) function code(angle_s, a, b, angle_m) t_0 = Float64(2.0 * Float64(Float64(b + a) * Float64(b - a))) t_1 = Float64((b ^ 2.0) - (a ^ 2.0)) t_2 = Float64(pi * Float64(angle_m / 180.0)) tmp = 0.0 if (t_1 <= 2e+266) tmp = Float64(Float64(t_0 * expm1(log1p(sin(Float64(pi * Float64(angle_m * 0.005555555555555556)))))) * cos(Float64(angle_m / Float64(180.0 / pi)))); elseif (t_1 <= Inf) tmp = Float64((Float64(sqrt(sin(Float64(0.005555555555555556 * Float64(pi * angle_m)))) * Float64(b * sqrt(2.0))) ^ 2.0) * cos(t_2)); else tmp = Float64(Float64(t_0 * sin(t_2)) * cos(Float64(Float64(angle_m / 180.0) * (cbrt((pi ^ 1.5)) ^ 2.0)))); end return Float64(angle_s * tmp) end
angle_m = N[Abs[angle], $MachinePrecision]
angle_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a_, b_, angle$95$m_] := Block[{t$95$0 = N[(2.0 * N[(N[(b + a), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[Power[b, 2.0], $MachinePrecision] - N[Power[a, 2.0], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(Pi * N[(angle$95$m / 180.0), $MachinePrecision]), $MachinePrecision]}, N[(angle$95$s * If[LessEqual[t$95$1, 2e+266], N[(N[(t$95$0 * N[(Exp[N[Log[1 + N[Sin[N[(Pi * N[(angle$95$m * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]] - 1), $MachinePrecision]), $MachinePrecision] * N[Cos[N[(angle$95$m / N[(180.0 / Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, Infinity], N[(N[Power[N[(N[Sqrt[N[Sin[N[(0.005555555555555556 * N[(Pi * angle$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * N[(b * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[Cos[t$95$2], $MachinePrecision]), $MachinePrecision], N[(N[(t$95$0 * N[Sin[t$95$2], $MachinePrecision]), $MachinePrecision] * N[Cos[N[(N[(angle$95$m / 180.0), $MachinePrecision] * N[Power[N[Power[N[Power[Pi, 1.5], $MachinePrecision], 1/3], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]]]]
\begin{array}{l}
angle_m = \left|angle\right|
\\
angle_s = \mathsf{copysign}\left(1, angle\right)
\\
\begin{array}{l}
t_0 := 2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\\
t_1 := {b}^{2} - {a}^{2}\\
t_2 := \pi \cdot \frac{angle_m}{180}\\
angle_s \cdot \begin{array}{l}
\mathbf{if}\;t_1 \leq 2 \cdot 10^{+266}:\\
\;\;\;\;\left(t_0 \cdot \mathsf{expm1}\left(\mathsf{log1p}\left(\sin \left(\pi \cdot \left(angle_m \cdot 0.005555555555555556\right)\right)\right)\right)\right) \cdot \cos \left(\frac{angle_m}{\frac{180}{\pi}}\right)\\
\mathbf{elif}\;t_1 \leq \infty:\\
\;\;\;\;{\left(\sqrt{\sin \left(0.005555555555555556 \cdot \left(\pi \cdot angle_m\right)\right)} \cdot \left(b \cdot \sqrt{2}\right)\right)}^{2} \cdot \cos t_2\\
\mathbf{else}:\\
\;\;\;\;\left(t_0 \cdot \sin t_2\right) \cdot \cos \left(\frac{angle_m}{180} \cdot {\left(\sqrt[3]{{\pi}^{1.5}}\right)}^{2}\right)\\
\end{array}
\end{array}
\end{array}
if (-.f64 (pow.f64 b 2) (pow.f64 a 2)) < 2.0000000000000001e266Initial program 56.4%
unpow256.4%
unpow256.4%
difference-of-squares56.4%
Applied egg-rr56.4%
add-cbrt-cube55.3%
pow355.3%
Applied egg-rr55.3%
associate-*r/54.9%
*-commutative54.9%
associate-/l*56.8%
Applied egg-rr56.8%
rem-cbrt-cube58.1%
div-inv58.5%
metadata-eval58.5%
expm1-log1p-u58.5%
Applied egg-rr58.5%
if 2.0000000000000001e266 < (-.f64 (pow.f64 b 2) (pow.f64 a 2)) < +inf.0Initial program 46.9%
unpow246.9%
unpow246.9%
difference-of-squares46.9%
Applied egg-rr46.9%
Taylor expanded in b around inf 47.0%
associate-*r*47.0%
associate-*r*48.7%
*-commutative48.7%
*-commutative48.7%
*-commutative48.7%
Simplified48.7%
add-sqr-sqrt26.0%
pow226.0%
*-commutative26.0%
rem-log-exp16.2%
sqrt-prod16.2%
*-commutative16.2%
sqrt-prod16.2%
unpow216.2%
sqrt-prod7.7%
add-sqr-sqrt17.3%
rem-log-exp44.0%
Applied egg-rr44.0%
*-commutative44.0%
*-commutative44.0%
*-commutative44.0%
associate-*r*42.7%
Simplified42.7%
if +inf.0 < (-.f64 (pow.f64 b 2) (pow.f64 a 2)) Initial program 0.0%
unpow20.0%
unpow20.0%
difference-of-squares56.8%
Applied egg-rr56.8%
add-sqr-sqrt50.6%
pow250.6%
Applied egg-rr50.6%
add-cbrt-cube50.6%
pow1/350.6%
add-sqr-sqrt50.6%
pow150.6%
metadata-eval50.6%
pow1/250.6%
pow-prod-up50.6%
metadata-eval50.6%
metadata-eval50.6%
Applied egg-rr50.6%
unpow1/375.6%
Simplified75.6%
Final simplification56.1%
angle_m = (fabs.f64 angle)
angle_s = (copysign.f64 1 angle)
(FPCore (angle_s a b angle_m)
:precision binary64
(let* ((t_0 (* 2.0 (* (+ b a) (- b a))))
(t_1 (- (pow b 2.0) (pow a 2.0)))
(t_2 (* PI (/ angle_m 180.0))))
(*
angle_s
(if (<= t_1 2e+266)
(*
(* t_0 (expm1 (log1p (sin (* PI (* angle_m 0.005555555555555556))))))
(cos (/ angle_m (/ 180.0 PI))))
(if (<= t_1 INFINITY)
(*
(pow
(*
(sqrt (sin (* 0.005555555555555556 (* PI angle_m))))
(* b (sqrt 2.0)))
2.0)
(cos t_2))
(*
(* t_0 (sin t_2))
(cos (* (/ angle_m 180.0) (cbrt (pow PI 3.0))))))))))angle_m = fabs(angle);
angle_s = copysign(1.0, angle);
double code(double angle_s, double a, double b, double angle_m) {
double t_0 = 2.0 * ((b + a) * (b - a));
double t_1 = pow(b, 2.0) - pow(a, 2.0);
double t_2 = ((double) M_PI) * (angle_m / 180.0);
double tmp;
if (t_1 <= 2e+266) {
tmp = (t_0 * expm1(log1p(sin((((double) M_PI) * (angle_m * 0.005555555555555556)))))) * cos((angle_m / (180.0 / ((double) M_PI))));
} else if (t_1 <= ((double) INFINITY)) {
tmp = pow((sqrt(sin((0.005555555555555556 * (((double) M_PI) * angle_m)))) * (b * sqrt(2.0))), 2.0) * cos(t_2);
} else {
tmp = (t_0 * sin(t_2)) * cos(((angle_m / 180.0) * cbrt(pow(((double) M_PI), 3.0))));
}
return angle_s * tmp;
}
angle_m = Math.abs(angle);
angle_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b, double angle_m) {
double t_0 = 2.0 * ((b + a) * (b - a));
double t_1 = Math.pow(b, 2.0) - Math.pow(a, 2.0);
double t_2 = Math.PI * (angle_m / 180.0);
double tmp;
if (t_1 <= 2e+266) {
tmp = (t_0 * Math.expm1(Math.log1p(Math.sin((Math.PI * (angle_m * 0.005555555555555556)))))) * Math.cos((angle_m / (180.0 / Math.PI)));
} else if (t_1 <= Double.POSITIVE_INFINITY) {
tmp = Math.pow((Math.sqrt(Math.sin((0.005555555555555556 * (Math.PI * angle_m)))) * (b * Math.sqrt(2.0))), 2.0) * Math.cos(t_2);
} else {
tmp = (t_0 * Math.sin(t_2)) * Math.cos(((angle_m / 180.0) * Math.cbrt(Math.pow(Math.PI, 3.0))));
}
return angle_s * tmp;
}
angle_m = abs(angle) angle_s = copysign(1.0, angle) function code(angle_s, a, b, angle_m) t_0 = Float64(2.0 * Float64(Float64(b + a) * Float64(b - a))) t_1 = Float64((b ^ 2.0) - (a ^ 2.0)) t_2 = Float64(pi * Float64(angle_m / 180.0)) tmp = 0.0 if (t_1 <= 2e+266) tmp = Float64(Float64(t_0 * expm1(log1p(sin(Float64(pi * Float64(angle_m * 0.005555555555555556)))))) * cos(Float64(angle_m / Float64(180.0 / pi)))); elseif (t_1 <= Inf) tmp = Float64((Float64(sqrt(sin(Float64(0.005555555555555556 * Float64(pi * angle_m)))) * Float64(b * sqrt(2.0))) ^ 2.0) * cos(t_2)); else tmp = Float64(Float64(t_0 * sin(t_2)) * cos(Float64(Float64(angle_m / 180.0) * cbrt((pi ^ 3.0))))); end return Float64(angle_s * tmp) end
angle_m = N[Abs[angle], $MachinePrecision]
angle_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a_, b_, angle$95$m_] := Block[{t$95$0 = N[(2.0 * N[(N[(b + a), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[Power[b, 2.0], $MachinePrecision] - N[Power[a, 2.0], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(Pi * N[(angle$95$m / 180.0), $MachinePrecision]), $MachinePrecision]}, N[(angle$95$s * If[LessEqual[t$95$1, 2e+266], N[(N[(t$95$0 * N[(Exp[N[Log[1 + N[Sin[N[(Pi * N[(angle$95$m * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]] - 1), $MachinePrecision]), $MachinePrecision] * N[Cos[N[(angle$95$m / N[(180.0 / Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, Infinity], N[(N[Power[N[(N[Sqrt[N[Sin[N[(0.005555555555555556 * N[(Pi * angle$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * N[(b * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[Cos[t$95$2], $MachinePrecision]), $MachinePrecision], N[(N[(t$95$0 * N[Sin[t$95$2], $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]]]]
\begin{array}{l}
angle_m = \left|angle\right|
\\
angle_s = \mathsf{copysign}\left(1, angle\right)
\\
\begin{array}{l}
t_0 := 2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\\
t_1 := {b}^{2} - {a}^{2}\\
t_2 := \pi \cdot \frac{angle_m}{180}\\
angle_s \cdot \begin{array}{l}
\mathbf{if}\;t_1 \leq 2 \cdot 10^{+266}:\\
\;\;\;\;\left(t_0 \cdot \mathsf{expm1}\left(\mathsf{log1p}\left(\sin \left(\pi \cdot \left(angle_m \cdot 0.005555555555555556\right)\right)\right)\right)\right) \cdot \cos \left(\frac{angle_m}{\frac{180}{\pi}}\right)\\
\mathbf{elif}\;t_1 \leq \infty:\\
\;\;\;\;{\left(\sqrt{\sin \left(0.005555555555555556 \cdot \left(\pi \cdot angle_m\right)\right)} \cdot \left(b \cdot \sqrt{2}\right)\right)}^{2} \cdot \cos t_2\\
\mathbf{else}:\\
\;\;\;\;\left(t_0 \cdot \sin t_2\right) \cdot \cos \left(\frac{angle_m}{180} \cdot \sqrt[3]{{\pi}^{3}}\right)\\
\end{array}
\end{array}
\end{array}
if (-.f64 (pow.f64 b 2) (pow.f64 a 2)) < 2.0000000000000001e266Initial program 56.4%
unpow256.4%
unpow256.4%
difference-of-squares56.4%
Applied egg-rr56.4%
add-cbrt-cube55.3%
pow355.3%
Applied egg-rr55.3%
associate-*r/54.9%
*-commutative54.9%
associate-/l*56.8%
Applied egg-rr56.8%
rem-cbrt-cube58.1%
div-inv58.5%
metadata-eval58.5%
expm1-log1p-u58.5%
Applied egg-rr58.5%
if 2.0000000000000001e266 < (-.f64 (pow.f64 b 2) (pow.f64 a 2)) < +inf.0Initial program 46.9%
unpow246.9%
unpow246.9%
difference-of-squares46.9%
Applied egg-rr46.9%
Taylor expanded in b around inf 47.0%
associate-*r*47.0%
associate-*r*48.7%
*-commutative48.7%
*-commutative48.7%
*-commutative48.7%
Simplified48.7%
add-sqr-sqrt26.0%
pow226.0%
*-commutative26.0%
rem-log-exp16.2%
sqrt-prod16.2%
*-commutative16.2%
sqrt-prod16.2%
unpow216.2%
sqrt-prod7.7%
add-sqr-sqrt17.3%
rem-log-exp44.0%
Applied egg-rr44.0%
*-commutative44.0%
*-commutative44.0%
*-commutative44.0%
associate-*r*42.7%
Simplified42.7%
if +inf.0 < (-.f64 (pow.f64 b 2) (pow.f64 a 2)) Initial program 0.0%
unpow20.0%
unpow20.0%
difference-of-squares56.8%
Applied egg-rr56.8%
add-cbrt-cube69.3%
pow369.3%
Applied egg-rr69.3%
Final simplification55.7%
angle_m = (fabs.f64 angle)
angle_s = (copysign.f64 1 angle)
(FPCore (angle_s a b angle_m)
:precision binary64
(let* ((t_0 (* 2.0 (* (+ b a) (- b a))))
(t_1 (* PI (* angle_m 0.005555555555555556))))
(*
angle_s
(if (<= (/ angle_m 180.0) 1e+49)
(*
(cos (* PI (/ angle_m 180.0)))
(* t_0 (sin (* 0.005555555555555556 (* PI angle_m)))))
(if (<= (/ angle_m 180.0) 2e+190)
(* t_0 (sin (pow (cbrt t_1) 3.0)))
(*
(* t_0 (expm1 (log1p (sin t_1))))
(cos (/ angle_m (/ 180.0 PI)))))))))angle_m = fabs(angle);
angle_s = copysign(1.0, angle);
double code(double angle_s, double a, double b, double angle_m) {
double t_0 = 2.0 * ((b + a) * (b - a));
double t_1 = ((double) M_PI) * (angle_m * 0.005555555555555556);
double tmp;
if ((angle_m / 180.0) <= 1e+49) {
tmp = cos((((double) M_PI) * (angle_m / 180.0))) * (t_0 * sin((0.005555555555555556 * (((double) M_PI) * angle_m))));
} else if ((angle_m / 180.0) <= 2e+190) {
tmp = t_0 * sin(pow(cbrt(t_1), 3.0));
} else {
tmp = (t_0 * expm1(log1p(sin(t_1)))) * cos((angle_m / (180.0 / ((double) M_PI))));
}
return angle_s * tmp;
}
angle_m = Math.abs(angle);
angle_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b, double angle_m) {
double t_0 = 2.0 * ((b + a) * (b - a));
double t_1 = Math.PI * (angle_m * 0.005555555555555556);
double tmp;
if ((angle_m / 180.0) <= 1e+49) {
tmp = Math.cos((Math.PI * (angle_m / 180.0))) * (t_0 * Math.sin((0.005555555555555556 * (Math.PI * angle_m))));
} else if ((angle_m / 180.0) <= 2e+190) {
tmp = t_0 * Math.sin(Math.pow(Math.cbrt(t_1), 3.0));
} else {
tmp = (t_0 * Math.expm1(Math.log1p(Math.sin(t_1)))) * Math.cos((angle_m / (180.0 / Math.PI)));
}
return angle_s * tmp;
}
angle_m = abs(angle) angle_s = copysign(1.0, angle) function code(angle_s, a, b, angle_m) t_0 = Float64(2.0 * Float64(Float64(b + a) * Float64(b - a))) t_1 = Float64(pi * Float64(angle_m * 0.005555555555555556)) tmp = 0.0 if (Float64(angle_m / 180.0) <= 1e+49) tmp = Float64(cos(Float64(pi * Float64(angle_m / 180.0))) * Float64(t_0 * sin(Float64(0.005555555555555556 * Float64(pi * angle_m))))); elseif (Float64(angle_m / 180.0) <= 2e+190) tmp = Float64(t_0 * sin((cbrt(t_1) ^ 3.0))); else tmp = Float64(Float64(t_0 * expm1(log1p(sin(t_1)))) * cos(Float64(angle_m / Float64(180.0 / pi)))); end return Float64(angle_s * tmp) end
angle_m = N[Abs[angle], $MachinePrecision]
angle_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a_, b_, angle$95$m_] := Block[{t$95$0 = N[(2.0 * N[(N[(b + a), $MachinePrecision] * N[(b - a), $MachinePrecision]), $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+49], N[(N[Cos[N[(Pi * N[(angle$95$m / 180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(t$95$0 * N[Sin[N[(0.005555555555555556 * N[(Pi * angle$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 2e+190], N[(t$95$0 * N[Sin[N[Power[N[Power[t$95$1, 1/3], $MachinePrecision], 3.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[(t$95$0 * N[(Exp[N[Log[1 + N[Sin[t$95$1], $MachinePrecision]], $MachinePrecision]] - 1), $MachinePrecision]), $MachinePrecision] * N[Cos[N[(angle$95$m / N[(180.0 / Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]]]
\begin{array}{l}
angle_m = \left|angle\right|
\\
angle_s = \mathsf{copysign}\left(1, angle\right)
\\
\begin{array}{l}
t_0 := 2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\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^{+49}:\\
\;\;\;\;\cos \left(\pi \cdot \frac{angle_m}{180}\right) \cdot \left(t_0 \cdot \sin \left(0.005555555555555556 \cdot \left(\pi \cdot angle_m\right)\right)\right)\\
\mathbf{elif}\;\frac{angle_m}{180} \leq 2 \cdot 10^{+190}:\\
\;\;\;\;t_0 \cdot \sin \left({\left(\sqrt[3]{t_1}\right)}^{3}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(t_0 \cdot \mathsf{expm1}\left(\mathsf{log1p}\left(\sin t_1\right)\right)\right) \cdot \cos \left(\frac{angle_m}{\frac{180}{\pi}}\right)\\
\end{array}
\end{array}
\end{array}
if (/.f64 angle 180) < 9.99999999999999946e48Initial program 53.8%
unpow253.8%
unpow253.8%
difference-of-squares58.0%
Applied egg-rr58.0%
Taylor expanded in angle around inf 58.4%
if 9.99999999999999946e48 < (/.f64 angle 180) < 2.0000000000000001e190Initial program 35.8%
unpow235.8%
unpow235.8%
difference-of-squares35.8%
Applied egg-rr35.8%
Taylor expanded in angle around 0 28.4%
*-commutative28.4%
div-inv33.4%
metadata-eval33.4%
*-commutative33.4%
associate-*r*29.3%
add-cube-cbrt46.0%
pow350.1%
*-commutative50.1%
*-commutative50.1%
associate-*r*45.2%
Applied egg-rr45.2%
if 2.0000000000000001e190 < (/.f64 angle 180) Initial program 31.6%
unpow231.6%
unpow231.6%
difference-of-squares31.6%
Applied egg-rr31.6%
add-cbrt-cube30.7%
pow330.7%
Applied egg-rr30.7%
associate-*r/36.1%
*-commutative36.1%
associate-/l*36.1%
Applied egg-rr36.1%
rem-cbrt-cube47.0%
div-inv51.3%
metadata-eval51.3%
expm1-log1p-u51.3%
Applied egg-rr51.3%
Final simplification56.8%
angle_m = (fabs.f64 angle)
angle_s = (copysign.f64 1 angle)
(FPCore (angle_s a b angle_m)
:precision binary64
(let* ((t_0 (* 2.0 (* (+ b a) (- b a)))) (t_1 (* PI (/ angle_m 180.0))))
(*
angle_s
(if (<= (/ angle_m 180.0) 5e+83)
(* (cos t_1) (* t_0 (* 0.005555555555555556 (* PI angle_m))))
(if (<= (/ angle_m 180.0) 5e+204)
(* t_0 (fabs (sin (* angle_m (* PI 0.005555555555555556)))))
(* (* t_0 (sin t_1)) (cos (/ angle_m (/ 180.0 PI)))))))))angle_m = fabs(angle);
angle_s = copysign(1.0, angle);
double code(double angle_s, double a, double b, double angle_m) {
double t_0 = 2.0 * ((b + a) * (b - a));
double t_1 = ((double) M_PI) * (angle_m / 180.0);
double tmp;
if ((angle_m / 180.0) <= 5e+83) {
tmp = cos(t_1) * (t_0 * (0.005555555555555556 * (((double) M_PI) * angle_m)));
} else if ((angle_m / 180.0) <= 5e+204) {
tmp = t_0 * fabs(sin((angle_m * (((double) M_PI) * 0.005555555555555556))));
} else {
tmp = (t_0 * sin(t_1)) * cos((angle_m / (180.0 / ((double) M_PI))));
}
return angle_s * tmp;
}
angle_m = Math.abs(angle);
angle_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b, double angle_m) {
double t_0 = 2.0 * ((b + a) * (b - a));
double t_1 = Math.PI * (angle_m / 180.0);
double tmp;
if ((angle_m / 180.0) <= 5e+83) {
tmp = Math.cos(t_1) * (t_0 * (0.005555555555555556 * (Math.PI * angle_m)));
} else if ((angle_m / 180.0) <= 5e+204) {
tmp = t_0 * Math.abs(Math.sin((angle_m * (Math.PI * 0.005555555555555556))));
} else {
tmp = (t_0 * Math.sin(t_1)) * Math.cos((angle_m / (180.0 / Math.PI)));
}
return angle_s * tmp;
}
angle_m = math.fabs(angle) angle_s = math.copysign(1.0, angle) def code(angle_s, a, b, angle_m): t_0 = 2.0 * ((b + a) * (b - a)) t_1 = math.pi * (angle_m / 180.0) tmp = 0 if (angle_m / 180.0) <= 5e+83: tmp = math.cos(t_1) * (t_0 * (0.005555555555555556 * (math.pi * angle_m))) elif (angle_m / 180.0) <= 5e+204: tmp = t_0 * math.fabs(math.sin((angle_m * (math.pi * 0.005555555555555556)))) else: tmp = (t_0 * math.sin(t_1)) * math.cos((angle_m / (180.0 / math.pi))) return angle_s * tmp
angle_m = abs(angle) angle_s = copysign(1.0, angle) function code(angle_s, a, b, angle_m) t_0 = Float64(2.0 * Float64(Float64(b + a) * Float64(b - a))) t_1 = Float64(pi * Float64(angle_m / 180.0)) tmp = 0.0 if (Float64(angle_m / 180.0) <= 5e+83) tmp = Float64(cos(t_1) * Float64(t_0 * Float64(0.005555555555555556 * Float64(pi * angle_m)))); elseif (Float64(angle_m / 180.0) <= 5e+204) tmp = Float64(t_0 * abs(sin(Float64(angle_m * Float64(pi * 0.005555555555555556))))); else tmp = Float64(Float64(t_0 * sin(t_1)) * cos(Float64(angle_m / Float64(180.0 / pi)))); end return Float64(angle_s * tmp) end
angle_m = abs(angle); angle_s = sign(angle) * abs(1.0); function tmp_2 = code(angle_s, a, b, angle_m) t_0 = 2.0 * ((b + a) * (b - a)); t_1 = pi * (angle_m / 180.0); tmp = 0.0; if ((angle_m / 180.0) <= 5e+83) tmp = cos(t_1) * (t_0 * (0.005555555555555556 * (pi * angle_m))); elseif ((angle_m / 180.0) <= 5e+204) tmp = t_0 * abs(sin((angle_m * (pi * 0.005555555555555556)))); else tmp = (t_0 * sin(t_1)) * cos((angle_m / (180.0 / pi))); end tmp_2 = angle_s * tmp; end
angle_m = N[Abs[angle], $MachinePrecision]
angle_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a_, b_, angle$95$m_] := Block[{t$95$0 = N[(2.0 * N[(N[(b + a), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(Pi * N[(angle$95$m / 180.0), $MachinePrecision]), $MachinePrecision]}, N[(angle$95$s * If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 5e+83], N[(N[Cos[t$95$1], $MachinePrecision] * N[(t$95$0 * N[(0.005555555555555556 * N[(Pi * angle$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 5e+204], N[(t$95$0 * N[Abs[N[Sin[N[(angle$95$m * N[(Pi * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[(t$95$0 * N[Sin[t$95$1], $MachinePrecision]), $MachinePrecision] * N[Cos[N[(angle$95$m / N[(180.0 / Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]]]
\begin{array}{l}
angle_m = \left|angle\right|
\\
angle_s = \mathsf{copysign}\left(1, angle\right)
\\
\begin{array}{l}
t_0 := 2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\\
t_1 := \pi \cdot \frac{angle_m}{180}\\
angle_s \cdot \begin{array}{l}
\mathbf{if}\;\frac{angle_m}{180} \leq 5 \cdot 10^{+83}:\\
\;\;\;\;\cos t_1 \cdot \left(t_0 \cdot \left(0.005555555555555556 \cdot \left(\pi \cdot angle_m\right)\right)\right)\\
\mathbf{elif}\;\frac{angle_m}{180} \leq 5 \cdot 10^{+204}:\\
\;\;\;\;t_0 \cdot \left|\sin \left(angle_m \cdot \left(\pi \cdot 0.005555555555555556\right)\right)\right|\\
\mathbf{else}:\\
\;\;\;\;\left(t_0 \cdot \sin t_1\right) \cdot \cos \left(\frac{angle_m}{\frac{180}{\pi}}\right)\\
\end{array}
\end{array}
\end{array}
if (/.f64 angle 180) < 5.00000000000000029e83Initial program 53.4%
unpow253.4%
unpow253.4%
difference-of-squares57.5%
Applied egg-rr57.5%
Taylor expanded in angle around 0 57.0%
if 5.00000000000000029e83 < (/.f64 angle 180) < 5.00000000000000008e204Initial program 32.2%
unpow232.2%
unpow232.2%
difference-of-squares32.2%
Applied egg-rr32.2%
Taylor expanded in angle around 0 24.0%
*-commutative24.0%
div-inv24.0%
metadata-eval24.0%
*-commutative24.0%
associate-*r*24.8%
add-sqr-sqrt31.0%
pow231.7%
*-commutative31.7%
*-commutative31.7%
associate-*r*30.9%
Applied egg-rr30.9%
rem-square-sqrt15.5%
sqrt-unprod49.6%
pow249.6%
unpow249.6%
add-sqr-sqrt49.7%
*-commutative49.7%
associate-*r*49.8%
metadata-eval49.8%
div-inv49.8%
*-commutative49.8%
div-inv49.8%
metadata-eval49.8%
Applied egg-rr49.8%
unpow249.8%
rem-sqrt-square49.8%
Simplified49.8%
if 5.00000000000000008e204 < (/.f64 angle 180) Initial program 41.2%
unpow241.2%
unpow241.2%
difference-of-squares41.2%
Applied egg-rr41.2%
add-cbrt-cube34.3%
pow334.3%
Applied egg-rr34.3%
associate-*r/34.5%
*-commutative34.5%
associate-/l*34.5%
Applied egg-rr34.5%
rem-cbrt-cube54.9%
expm1-log1p-u54.9%
expm1-udef54.9%
Applied egg-rr54.9%
expm1-def54.9%
expm1-log1p54.9%
Simplified54.9%
Final simplification56.2%
angle_m = (fabs.f64 angle)
angle_s = (copysign.f64 1 angle)
(FPCore (angle_s a b angle_m)
:precision binary64
(let* ((t_0 (* 2.0 (* (+ b a) (- b a))))
(t_1 (* PI (* angle_m 0.005555555555555556))))
(*
angle_s
(if (<= (/ angle_m 180.0) 1e+49)
(*
(cos (* PI (/ angle_m 180.0)))
(* t_0 (sin (* 0.005555555555555556 (* PI angle_m)))))
(if (<= (/ angle_m 180.0) 4e+152)
(* t_0 (sin (pow (cbrt t_1) 3.0)))
(* t_0 (sin (expm1 (log1p t_1)))))))))angle_m = fabs(angle);
angle_s = copysign(1.0, angle);
double code(double angle_s, double a, double b, double angle_m) {
double t_0 = 2.0 * ((b + a) * (b - a));
double t_1 = ((double) M_PI) * (angle_m * 0.005555555555555556);
double tmp;
if ((angle_m / 180.0) <= 1e+49) {
tmp = cos((((double) M_PI) * (angle_m / 180.0))) * (t_0 * sin((0.005555555555555556 * (((double) M_PI) * angle_m))));
} else if ((angle_m / 180.0) <= 4e+152) {
tmp = t_0 * sin(pow(cbrt(t_1), 3.0));
} else {
tmp = t_0 * sin(expm1(log1p(t_1)));
}
return angle_s * tmp;
}
angle_m = Math.abs(angle);
angle_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b, double angle_m) {
double t_0 = 2.0 * ((b + a) * (b - a));
double t_1 = Math.PI * (angle_m * 0.005555555555555556);
double tmp;
if ((angle_m / 180.0) <= 1e+49) {
tmp = Math.cos((Math.PI * (angle_m / 180.0))) * (t_0 * Math.sin((0.005555555555555556 * (Math.PI * angle_m))));
} else if ((angle_m / 180.0) <= 4e+152) {
tmp = t_0 * Math.sin(Math.pow(Math.cbrt(t_1), 3.0));
} else {
tmp = t_0 * Math.sin(Math.expm1(Math.log1p(t_1)));
}
return angle_s * tmp;
}
angle_m = abs(angle) angle_s = copysign(1.0, angle) function code(angle_s, a, b, angle_m) t_0 = Float64(2.0 * Float64(Float64(b + a) * Float64(b - a))) t_1 = Float64(pi * Float64(angle_m * 0.005555555555555556)) tmp = 0.0 if (Float64(angle_m / 180.0) <= 1e+49) tmp = Float64(cos(Float64(pi * Float64(angle_m / 180.0))) * Float64(t_0 * sin(Float64(0.005555555555555556 * Float64(pi * angle_m))))); elseif (Float64(angle_m / 180.0) <= 4e+152) tmp = Float64(t_0 * sin((cbrt(t_1) ^ 3.0))); else tmp = Float64(t_0 * sin(expm1(log1p(t_1)))); end return Float64(angle_s * tmp) end
angle_m = N[Abs[angle], $MachinePrecision]
angle_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a_, b_, angle$95$m_] := Block[{t$95$0 = N[(2.0 * N[(N[(b + a), $MachinePrecision] * N[(b - a), $MachinePrecision]), $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+49], N[(N[Cos[N[(Pi * N[(angle$95$m / 180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(t$95$0 * N[Sin[N[(0.005555555555555556 * N[(Pi * angle$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 4e+152], N[(t$95$0 * N[Sin[N[Power[N[Power[t$95$1, 1/3], $MachinePrecision], 3.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(t$95$0 * N[Sin[N[(Exp[N[Log[1 + t$95$1], $MachinePrecision]] - 1), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]]]
\begin{array}{l}
angle_m = \left|angle\right|
\\
angle_s = \mathsf{copysign}\left(1, angle\right)
\\
\begin{array}{l}
t_0 := 2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\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^{+49}:\\
\;\;\;\;\cos \left(\pi \cdot \frac{angle_m}{180}\right) \cdot \left(t_0 \cdot \sin \left(0.005555555555555556 \cdot \left(\pi \cdot angle_m\right)\right)\right)\\
\mathbf{elif}\;\frac{angle_m}{180} \leq 4 \cdot 10^{+152}:\\
\;\;\;\;t_0 \cdot \sin \left({\left(\sqrt[3]{t_1}\right)}^{3}\right)\\
\mathbf{else}:\\
\;\;\;\;t_0 \cdot \sin \left(\mathsf{expm1}\left(\mathsf{log1p}\left(t_1\right)\right)\right)\\
\end{array}
\end{array}
\end{array}
if (/.f64 angle 180) < 9.99999999999999946e48Initial program 53.8%
unpow253.8%
unpow253.8%
difference-of-squares58.0%
Applied egg-rr58.0%
Taylor expanded in angle around inf 58.4%
if 9.99999999999999946e48 < (/.f64 angle 180) < 4.0000000000000002e152Initial program 42.1%
unpow242.1%
unpow242.1%
difference-of-squares42.1%
Applied egg-rr42.1%
Taylor expanded in angle around 0 33.4%
*-commutative33.4%
div-inv33.4%
metadata-eval33.4%
*-commutative33.4%
associate-*r*34.5%
add-cube-cbrt42.4%
pow347.2%
*-commutative47.2%
*-commutative47.2%
associate-*r*47.3%
Applied egg-rr47.3%
if 4.0000000000000002e152 < (/.f64 angle 180) Initial program 27.3%
unpow227.3%
unpow227.3%
difference-of-squares27.3%
Applied egg-rr27.3%
Taylor expanded in angle around 0 24.4%
div-inv27.6%
metadata-eval27.6%
expm1-log1p-u40.5%
Applied egg-rr32.2%
Final simplification55.4%
angle_m = (fabs.f64 angle)
angle_s = (copysign.f64 1 angle)
(FPCore (angle_s a b angle_m)
:precision binary64
(let* ((t_0 (* PI (* angle_m 0.005555555555555556)))
(t_1 (* 2.0 (* (+ b a) (- b a)))))
(*
angle_s
(if (<= (/ angle_m 180.0) 4e+152)
(* t_1 (sin (pow (cbrt t_0) 3.0)))
(* t_1 (sin (expm1 (log1p t_0))))))))angle_m = fabs(angle);
angle_s = copysign(1.0, angle);
double code(double angle_s, double a, double b, double angle_m) {
double t_0 = ((double) M_PI) * (angle_m * 0.005555555555555556);
double t_1 = 2.0 * ((b + a) * (b - a));
double tmp;
if ((angle_m / 180.0) <= 4e+152) {
tmp = t_1 * sin(pow(cbrt(t_0), 3.0));
} else {
tmp = t_1 * sin(expm1(log1p(t_0)));
}
return angle_s * tmp;
}
angle_m = Math.abs(angle);
angle_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b, double angle_m) {
double t_0 = Math.PI * (angle_m * 0.005555555555555556);
double t_1 = 2.0 * ((b + a) * (b - a));
double tmp;
if ((angle_m / 180.0) <= 4e+152) {
tmp = t_1 * Math.sin(Math.pow(Math.cbrt(t_0), 3.0));
} else {
tmp = t_1 * Math.sin(Math.expm1(Math.log1p(t_0)));
}
return angle_s * tmp;
}
angle_m = abs(angle) angle_s = copysign(1.0, angle) function code(angle_s, a, b, angle_m) t_0 = Float64(pi * Float64(angle_m * 0.005555555555555556)) t_1 = Float64(2.0 * Float64(Float64(b + a) * Float64(b - a))) tmp = 0.0 if (Float64(angle_m / 180.0) <= 4e+152) tmp = Float64(t_1 * sin((cbrt(t_0) ^ 3.0))); else tmp = Float64(t_1 * sin(expm1(log1p(t_0)))); end return Float64(angle_s * tmp) end
angle_m = N[Abs[angle], $MachinePrecision]
angle_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a_, b_, angle$95$m_] := Block[{t$95$0 = N[(Pi * N[(angle$95$m * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(2.0 * N[(N[(b + a), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, N[(angle$95$s * If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 4e+152], N[(t$95$1 * N[Sin[N[Power[N[Power[t$95$0, 1/3], $MachinePrecision], 3.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(t$95$1 * N[Sin[N[(Exp[N[Log[1 + t$95$0], $MachinePrecision]] - 1), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]]]
\begin{array}{l}
angle_m = \left|angle\right|
\\
angle_s = \mathsf{copysign}\left(1, angle\right)
\\
\begin{array}{l}
t_0 := \pi \cdot \left(angle_m \cdot 0.005555555555555556\right)\\
t_1 := 2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\\
angle_s \cdot \begin{array}{l}
\mathbf{if}\;\frac{angle_m}{180} \leq 4 \cdot 10^{+152}:\\
\;\;\;\;t_1 \cdot \sin \left({\left(\sqrt[3]{t_0}\right)}^{3}\right)\\
\mathbf{else}:\\
\;\;\;\;t_1 \cdot \sin \left(\mathsf{expm1}\left(\mathsf{log1p}\left(t_0\right)\right)\right)\\
\end{array}
\end{array}
\end{array}
if (/.f64 angle 180) < 4.0000000000000002e152Initial program 53.0%
unpow253.0%
unpow253.0%
difference-of-squares56.9%
Applied egg-rr56.9%
Taylor expanded in angle around 0 55.2%
*-commutative55.2%
div-inv55.2%
metadata-eval55.2%
*-commutative55.2%
associate-*r*55.4%
add-cube-cbrt54.5%
pow355.9%
*-commutative55.9%
*-commutative55.9%
associate-*r*56.5%
Applied egg-rr56.5%
if 4.0000000000000002e152 < (/.f64 angle 180) Initial program 27.3%
unpow227.3%
unpow227.3%
difference-of-squares27.3%
Applied egg-rr27.3%
Taylor expanded in angle around 0 24.4%
div-inv27.6%
metadata-eval27.6%
expm1-log1p-u40.5%
Applied egg-rr32.2%
Final simplification54.4%
angle_m = (fabs.f64 angle)
angle_s = (copysign.f64 1 angle)
(FPCore (angle_s a b angle_m)
:precision binary64
(let* ((t_0 (* 2.0 (* (+ b a) (- b a)))))
(*
angle_s
(if (<= (pow b 2.0) 1e+290)
(* t_0 (sin (* 0.005555555555555556 (* PI angle_m))))
(* t_0 (* PI (* angle_m 0.005555555555555556)))))))angle_m = fabs(angle);
angle_s = copysign(1.0, angle);
double code(double angle_s, double a, double b, double angle_m) {
double t_0 = 2.0 * ((b + a) * (b - a));
double tmp;
if (pow(b, 2.0) <= 1e+290) {
tmp = t_0 * sin((0.005555555555555556 * (((double) M_PI) * angle_m)));
} else {
tmp = t_0 * (((double) M_PI) * (angle_m * 0.005555555555555556));
}
return angle_s * tmp;
}
angle_m = Math.abs(angle);
angle_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b, double angle_m) {
double t_0 = 2.0 * ((b + a) * (b - a));
double tmp;
if (Math.pow(b, 2.0) <= 1e+290) {
tmp = t_0 * Math.sin((0.005555555555555556 * (Math.PI * angle_m)));
} else {
tmp = t_0 * (Math.PI * (angle_m * 0.005555555555555556));
}
return angle_s * tmp;
}
angle_m = math.fabs(angle) angle_s = math.copysign(1.0, angle) def code(angle_s, a, b, angle_m): t_0 = 2.0 * ((b + a) * (b - a)) tmp = 0 if math.pow(b, 2.0) <= 1e+290: tmp = t_0 * math.sin((0.005555555555555556 * (math.pi * angle_m))) else: tmp = t_0 * (math.pi * (angle_m * 0.005555555555555556)) return angle_s * tmp
angle_m = abs(angle) angle_s = copysign(1.0, angle) function code(angle_s, a, b, angle_m) t_0 = Float64(2.0 * Float64(Float64(b + a) * Float64(b - a))) tmp = 0.0 if ((b ^ 2.0) <= 1e+290) tmp = Float64(t_0 * sin(Float64(0.005555555555555556 * Float64(pi * angle_m)))); else tmp = Float64(t_0 * Float64(pi * Float64(angle_m * 0.005555555555555556))); end return Float64(angle_s * tmp) end
angle_m = abs(angle); angle_s = sign(angle) * abs(1.0); function tmp_2 = code(angle_s, a, b, angle_m) t_0 = 2.0 * ((b + a) * (b - a)); tmp = 0.0; if ((b ^ 2.0) <= 1e+290) tmp = t_0 * sin((0.005555555555555556 * (pi * angle_m))); else tmp = t_0 * (pi * (angle_m * 0.005555555555555556)); end tmp_2 = angle_s * tmp; end
angle_m = N[Abs[angle], $MachinePrecision]
angle_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a_, b_, angle$95$m_] := Block[{t$95$0 = N[(2.0 * N[(N[(b + a), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, N[(angle$95$s * If[LessEqual[N[Power[b, 2.0], $MachinePrecision], 1e+290], N[(t$95$0 * N[Sin[N[(0.005555555555555556 * N[(Pi * angle$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(t$95$0 * N[(Pi * N[(angle$95$m * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]]
\begin{array}{l}
angle_m = \left|angle\right|
\\
angle_s = \mathsf{copysign}\left(1, angle\right)
\\
\begin{array}{l}
t_0 := 2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\\
angle_s \cdot \begin{array}{l}
\mathbf{if}\;{b}^{2} \leq 10^{+290}:\\
\;\;\;\;t_0 \cdot \sin \left(0.005555555555555556 \cdot \left(\pi \cdot angle_m\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t_0 \cdot \left(\pi \cdot \left(angle_m \cdot 0.005555555555555556\right)\right)\\
\end{array}
\end{array}
\end{array}
if (pow.f64 b 2) < 1.00000000000000006e290Initial program 56.4%
unpow256.4%
unpow256.4%
difference-of-squares56.4%
Applied egg-rr56.4%
Taylor expanded in angle around 0 55.5%
Taylor expanded in angle around inf 56.6%
if 1.00000000000000006e290 < (pow.f64 b 2) Initial program 36.4%
unpow236.4%
unpow236.4%
difference-of-squares49.0%
Applied egg-rr49.0%
Taylor expanded in angle around 0 44.9%
Taylor expanded in angle around 0 51.9%
associate-*r*51.9%
*-commutative51.9%
*-commutative51.9%
*-commutative51.9%
Simplified51.9%
Final simplification55.3%
angle_m = (fabs.f64 angle) angle_s = (copysign.f64 1 angle) (FPCore (angle_s a b angle_m) :precision binary64 (* angle_s (* (* 2.0 (* (+ b a) (- b a))) (fabs (sin (* angle_m (* PI 0.005555555555555556)))))))
angle_m = fabs(angle);
angle_s = copysign(1.0, angle);
double code(double angle_s, double a, double b, double angle_m) {
return angle_s * ((2.0 * ((b + a) * (b - a))) * fabs(sin((angle_m * (((double) M_PI) * 0.005555555555555556)))));
}
angle_m = Math.abs(angle);
angle_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b, double angle_m) {
return angle_s * ((2.0 * ((b + a) * (b - a))) * Math.abs(Math.sin((angle_m * (Math.PI * 0.005555555555555556)))));
}
angle_m = math.fabs(angle) angle_s = math.copysign(1.0, angle) def code(angle_s, a, b, angle_m): return angle_s * ((2.0 * ((b + a) * (b - a))) * math.fabs(math.sin((angle_m * (math.pi * 0.005555555555555556)))))
angle_m = abs(angle) angle_s = copysign(1.0, angle) function code(angle_s, a, b, angle_m) return Float64(angle_s * Float64(Float64(2.0 * Float64(Float64(b + a) * Float64(b - a))) * abs(sin(Float64(angle_m * Float64(pi * 0.005555555555555556)))))) end
angle_m = abs(angle); angle_s = sign(angle) * abs(1.0); function tmp = code(angle_s, a, b, angle_m) tmp = angle_s * ((2.0 * ((b + a) * (b - a))) * abs(sin((angle_m * (pi * 0.005555555555555556))))); end
angle_m = N[Abs[angle], $MachinePrecision]
angle_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a_, b_, angle$95$m_] := N[(angle$95$s * N[(N[(2.0 * N[(N[(b + a), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Abs[N[Sin[N[(angle$95$m * N[(Pi * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
angle_m = \left|angle\right|
\\
angle_s = \mathsf{copysign}\left(1, angle\right)
\\
angle_s \cdot \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \left|\sin \left(angle_m \cdot \left(\pi \cdot 0.005555555555555556\right)\right)\right|\right)
\end{array}
Initial program 50.8%
unpow250.8%
unpow250.8%
difference-of-squares54.3%
Applied egg-rr54.3%
Taylor expanded in angle around 0 52.5%
*-commutative52.5%
div-inv52.7%
metadata-eval52.7%
*-commutative52.7%
associate-*r*53.3%
add-sqr-sqrt26.1%
pow226.2%
*-commutative26.2%
*-commutative26.2%
associate-*r*26.1%
Applied egg-rr26.1%
rem-square-sqrt22.7%
sqrt-unprod21.5%
pow221.5%
unpow221.5%
add-sqr-sqrt31.4%
*-commutative31.4%
associate-*r*31.4%
metadata-eval31.4%
div-inv31.4%
*-commutative31.4%
div-inv31.4%
metadata-eval31.4%
Applied egg-rr31.4%
unpow231.4%
rem-sqrt-square37.6%
Simplified37.6%
Final simplification37.6%
angle_m = (fabs.f64 angle)
angle_s = (copysign.f64 1 angle)
(FPCore (angle_s a b angle_m)
:precision binary64
(let* ((t_0 (* (+ b a) (- b a))) (t_1 (* 2.0 t_0)))
(*
angle_s
(if (<= (/ angle_m 180.0) 2e+118)
(* t_1 (sin (/ (* PI angle_m) 180.0)))
(if (<= (/ angle_m 180.0) 2e+211)
(* 0.011111111111111112 (* angle_m (* PI t_0)))
(* t_1 (sin (* 0.005555555555555556 (* PI angle_m)))))))))angle_m = fabs(angle);
angle_s = copysign(1.0, angle);
double code(double angle_s, double a, double b, double angle_m) {
double t_0 = (b + a) * (b - a);
double t_1 = 2.0 * t_0;
double tmp;
if ((angle_m / 180.0) <= 2e+118) {
tmp = t_1 * sin(((((double) M_PI) * angle_m) / 180.0));
} else if ((angle_m / 180.0) <= 2e+211) {
tmp = 0.011111111111111112 * (angle_m * (((double) M_PI) * t_0));
} else {
tmp = t_1 * sin((0.005555555555555556 * (((double) M_PI) * angle_m)));
}
return angle_s * tmp;
}
angle_m = Math.abs(angle);
angle_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b, double angle_m) {
double t_0 = (b + a) * (b - a);
double t_1 = 2.0 * t_0;
double tmp;
if ((angle_m / 180.0) <= 2e+118) {
tmp = t_1 * Math.sin(((Math.PI * angle_m) / 180.0));
} else if ((angle_m / 180.0) <= 2e+211) {
tmp = 0.011111111111111112 * (angle_m * (Math.PI * t_0));
} else {
tmp = t_1 * Math.sin((0.005555555555555556 * (Math.PI * angle_m)));
}
return angle_s * tmp;
}
angle_m = math.fabs(angle) angle_s = math.copysign(1.0, angle) def code(angle_s, a, b, angle_m): t_0 = (b + a) * (b - a) t_1 = 2.0 * t_0 tmp = 0 if (angle_m / 180.0) <= 2e+118: tmp = t_1 * math.sin(((math.pi * angle_m) / 180.0)) elif (angle_m / 180.0) <= 2e+211: tmp = 0.011111111111111112 * (angle_m * (math.pi * t_0)) else: tmp = t_1 * math.sin((0.005555555555555556 * (math.pi * angle_m))) return angle_s * tmp
angle_m = abs(angle) angle_s = copysign(1.0, angle) function code(angle_s, a, b, angle_m) t_0 = Float64(Float64(b + a) * Float64(b - a)) t_1 = Float64(2.0 * t_0) tmp = 0.0 if (Float64(angle_m / 180.0) <= 2e+118) tmp = Float64(t_1 * sin(Float64(Float64(pi * angle_m) / 180.0))); elseif (Float64(angle_m / 180.0) <= 2e+211) tmp = Float64(0.011111111111111112 * Float64(angle_m * Float64(pi * t_0))); else tmp = Float64(t_1 * sin(Float64(0.005555555555555556 * Float64(pi * angle_m)))); end return Float64(angle_s * tmp) end
angle_m = abs(angle); angle_s = sign(angle) * abs(1.0); function tmp_2 = code(angle_s, a, b, angle_m) t_0 = (b + a) * (b - a); t_1 = 2.0 * t_0; tmp = 0.0; if ((angle_m / 180.0) <= 2e+118) tmp = t_1 * sin(((pi * angle_m) / 180.0)); elseif ((angle_m / 180.0) <= 2e+211) tmp = 0.011111111111111112 * (angle_m * (pi * t_0)); else tmp = t_1 * sin((0.005555555555555556 * (pi * angle_m))); end tmp_2 = angle_s * tmp; end
angle_m = N[Abs[angle], $MachinePrecision]
angle_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a_, b_, angle$95$m_] := Block[{t$95$0 = N[(N[(b + a), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(2.0 * t$95$0), $MachinePrecision]}, N[(angle$95$s * If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 2e+118], N[(t$95$1 * N[Sin[N[(N[(Pi * angle$95$m), $MachinePrecision] / 180.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 2e+211], N[(0.011111111111111112 * N[(angle$95$m * N[(Pi * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$1 * N[Sin[N[(0.005555555555555556 * N[(Pi * angle$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]]]
\begin{array}{l}
angle_m = \left|angle\right|
\\
angle_s = \mathsf{copysign}\left(1, angle\right)
\\
\begin{array}{l}
t_0 := \left(b + a\right) \cdot \left(b - a\right)\\
t_1 := 2 \cdot t_0\\
angle_s \cdot \begin{array}{l}
\mathbf{if}\;\frac{angle_m}{180} \leq 2 \cdot 10^{+118}:\\
\;\;\;\;t_1 \cdot \sin \left(\frac{\pi \cdot angle_m}{180}\right)\\
\mathbf{elif}\;\frac{angle_m}{180} \leq 2 \cdot 10^{+211}:\\
\;\;\;\;0.011111111111111112 \cdot \left(angle_m \cdot \left(\pi \cdot t_0\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t_1 \cdot \sin \left(0.005555555555555556 \cdot \left(\pi \cdot angle_m\right)\right)\\
\end{array}
\end{array}
\end{array}
if (/.f64 angle 180) < 1.99999999999999993e118Initial program 53.1%
unpow253.1%
unpow253.1%
difference-of-squares57.1%
Applied egg-rr57.1%
Taylor expanded in angle around 0 56.0%
associate-*r/56.7%
Applied egg-rr56.7%
if 1.99999999999999993e118 < (/.f64 angle 180) < 1.9999999999999999e211Initial program 30.1%
unpow230.1%
unpow230.1%
difference-of-squares30.1%
Applied egg-rr30.1%
Taylor expanded in angle around 0 19.3%
Taylor expanded in angle around 0 45.5%
if 1.9999999999999999e211 < (/.f64 angle 180) Initial program 36.7%
unpow236.7%
unpow236.7%
difference-of-squares36.7%
Applied egg-rr36.7%
Taylor expanded in angle around 0 33.3%
Taylor expanded in angle around inf 44.1%
Final simplification55.4%
angle_m = (fabs.f64 angle) angle_s = (copysign.f64 1 angle) (FPCore (angle_s a b angle_m) :precision binary64 (* angle_s (* (* 2.0 (* (+ b a) (- b a))) (* 0.005555555555555556 (* PI angle_m)))))
angle_m = fabs(angle);
angle_s = copysign(1.0, angle);
double code(double angle_s, double a, double b, double angle_m) {
return angle_s * ((2.0 * ((b + a) * (b - a))) * (0.005555555555555556 * (((double) M_PI) * angle_m)));
}
angle_m = Math.abs(angle);
angle_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b, double angle_m) {
return angle_s * ((2.0 * ((b + a) * (b - a))) * (0.005555555555555556 * (Math.PI * angle_m)));
}
angle_m = math.fabs(angle) angle_s = math.copysign(1.0, angle) def code(angle_s, a, b, angle_m): return angle_s * ((2.0 * ((b + a) * (b - a))) * (0.005555555555555556 * (math.pi * angle_m)))
angle_m = abs(angle) angle_s = copysign(1.0, angle) function code(angle_s, a, b, angle_m) return Float64(angle_s * Float64(Float64(2.0 * Float64(Float64(b + a) * Float64(b - a))) * Float64(0.005555555555555556 * Float64(pi * angle_m)))) end
angle_m = abs(angle); angle_s = sign(angle) * abs(1.0); function tmp = code(angle_s, a, b, angle_m) tmp = angle_s * ((2.0 * ((b + a) * (b - a))) * (0.005555555555555556 * (pi * angle_m))); end
angle_m = N[Abs[angle], $MachinePrecision]
angle_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a_, b_, angle$95$m_] := N[(angle$95$s * N[(N[(2.0 * N[(N[(b + a), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(0.005555555555555556 * N[(Pi * angle$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
angle_m = \left|angle\right|
\\
angle_s = \mathsf{copysign}\left(1, angle\right)
\\
angle_s \cdot \left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \left(0.005555555555555556 \cdot \left(\pi \cdot angle_m\right)\right)\right)
\end{array}
Initial program 50.8%
unpow250.8%
unpow250.8%
difference-of-squares54.3%
Applied egg-rr54.3%
Taylor expanded in angle around 0 52.5%
Taylor expanded in angle around 0 53.3%
Final simplification53.3%
angle_m = (fabs.f64 angle) angle_s = (copysign.f64 1 angle) (FPCore (angle_s a b angle_m) :precision binary64 (* angle_s (* 0.011111111111111112 (* angle_m (* PI (* (+ b a) (- b a)))))))
angle_m = fabs(angle);
angle_s = copysign(1.0, angle);
double code(double angle_s, double a, double b, double angle_m) {
return angle_s * (0.011111111111111112 * (angle_m * (((double) M_PI) * ((b + a) * (b - a)))));
}
angle_m = Math.abs(angle);
angle_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b, double angle_m) {
return angle_s * (0.011111111111111112 * (angle_m * (Math.PI * ((b + a) * (b - a)))));
}
angle_m = math.fabs(angle) angle_s = math.copysign(1.0, angle) def code(angle_s, a, b, angle_m): return angle_s * (0.011111111111111112 * (angle_m * (math.pi * ((b + a) * (b - a)))))
angle_m = abs(angle) angle_s = copysign(1.0, angle) function code(angle_s, a, b, angle_m) return Float64(angle_s * Float64(0.011111111111111112 * Float64(angle_m * Float64(pi * Float64(Float64(b + a) * Float64(b - a)))))) end
angle_m = abs(angle); angle_s = sign(angle) * abs(1.0); function tmp = code(angle_s, a, b, angle_m) tmp = angle_s * (0.011111111111111112 * (angle_m * (pi * ((b + a) * (b - a))))); end
angle_m = N[Abs[angle], $MachinePrecision]
angle_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a_, b_, angle$95$m_] := N[(angle$95$s * N[(0.011111111111111112 * N[(angle$95$m * N[(Pi * N[(N[(b + a), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
angle_m = \left|angle\right|
\\
angle_s = \mathsf{copysign}\left(1, angle\right)
\\
angle_s \cdot \left(0.011111111111111112 \cdot \left(angle_m \cdot \left(\pi \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right)\right)\right)
\end{array}
Initial program 50.8%
unpow250.8%
unpow250.8%
difference-of-squares54.3%
Applied egg-rr54.3%
Taylor expanded in angle around 0 52.5%
Taylor expanded in angle around 0 53.3%
Final simplification53.3%
angle_m = (fabs.f64 angle) angle_s = (copysign.f64 1 angle) (FPCore (angle_s a b angle_m) :precision binary64 (* angle_s (* 0.011111111111111112 (* (* PI angle_m) (* (+ b a) (- b a))))))
angle_m = fabs(angle);
angle_s = copysign(1.0, angle);
double code(double angle_s, double a, double b, double angle_m) {
return angle_s * (0.011111111111111112 * ((((double) M_PI) * angle_m) * ((b + a) * (b - a))));
}
angle_m = Math.abs(angle);
angle_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b, double angle_m) {
return angle_s * (0.011111111111111112 * ((Math.PI * angle_m) * ((b + a) * (b - a))));
}
angle_m = math.fabs(angle) angle_s = math.copysign(1.0, angle) def code(angle_s, a, b, angle_m): return angle_s * (0.011111111111111112 * ((math.pi * angle_m) * ((b + a) * (b - a))))
angle_m = abs(angle) angle_s = copysign(1.0, angle) function code(angle_s, a, b, angle_m) return Float64(angle_s * Float64(0.011111111111111112 * Float64(Float64(pi * angle_m) * Float64(Float64(b + a) * Float64(b - a))))) end
angle_m = abs(angle); angle_s = sign(angle) * abs(1.0); function tmp = code(angle_s, a, b, angle_m) tmp = angle_s * (0.011111111111111112 * ((pi * angle_m) * ((b + a) * (b - a)))); end
angle_m = N[Abs[angle], $MachinePrecision]
angle_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a_, b_, angle$95$m_] := N[(angle$95$s * N[(0.011111111111111112 * N[(N[(Pi * angle$95$m), $MachinePrecision] * N[(N[(b + a), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
angle_m = \left|angle\right|
\\
angle_s = \mathsf{copysign}\left(1, angle\right)
\\
angle_s \cdot \left(0.011111111111111112 \cdot \left(\left(\pi \cdot angle_m\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right)\right)
\end{array}
Initial program 50.8%
unpow250.8%
unpow250.8%
difference-of-squares54.3%
Applied egg-rr54.3%
Taylor expanded in angle around 0 52.5%
Taylor expanded in angle around 0 53.3%
associate-*r*53.3%
Simplified53.3%
Final simplification53.3%
herbie shell --seed 2023318
(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)))))