
(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 13 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 (* (pow (sqrt PI) 2.0) (/ angle_m 180.0))))
(*
angle_s
(if (<= (/ angle_m 180.0) 1e+96)
(* (cos t_1) (* t_0 (sin (/ (* PI angle_m) 180.0))))
(if (<= (/ angle_m 180.0) 5e+219)
(* t_0 (sin (exp (log (* 0.005555555555555556 (* PI angle_m))))))
(* (cos (* PI (/ angle_m 180.0))) (* t_0 (sin t_1))))))))angle_m = fabs(angle);
angle_s = copysign(1.0, angle);
double code(double angle_s, double a, double b, double angle_m) {
double t_0 = 2.0 * ((b + a) * (b - a));
double t_1 = pow(sqrt(((double) M_PI)), 2.0) * (angle_m / 180.0);
double tmp;
if ((angle_m / 180.0) <= 1e+96) {
tmp = cos(t_1) * (t_0 * sin(((((double) M_PI) * angle_m) / 180.0)));
} else if ((angle_m / 180.0) <= 5e+219) {
tmp = t_0 * sin(exp(log((0.005555555555555556 * (((double) M_PI) * angle_m)))));
} else {
tmp = cos((((double) M_PI) * (angle_m / 180.0))) * (t_0 * sin(t_1));
}
return angle_s * tmp;
}
angle_m = Math.abs(angle);
angle_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b, double angle_m) {
double t_0 = 2.0 * ((b + a) * (b - a));
double t_1 = Math.pow(Math.sqrt(Math.PI), 2.0) * (angle_m / 180.0);
double tmp;
if ((angle_m / 180.0) <= 1e+96) {
tmp = Math.cos(t_1) * (t_0 * Math.sin(((Math.PI * angle_m) / 180.0)));
} else if ((angle_m / 180.0) <= 5e+219) {
tmp = t_0 * Math.sin(Math.exp(Math.log((0.005555555555555556 * (Math.PI * angle_m)))));
} else {
tmp = Math.cos((Math.PI * (angle_m / 180.0))) * (t_0 * Math.sin(t_1));
}
return angle_s * tmp;
}
angle_m = math.fabs(angle) angle_s = math.copysign(1.0, angle) def code(angle_s, a, b, angle_m): t_0 = 2.0 * ((b + a) * (b - a)) t_1 = math.pow(math.sqrt(math.pi), 2.0) * (angle_m / 180.0) tmp = 0 if (angle_m / 180.0) <= 1e+96: tmp = math.cos(t_1) * (t_0 * math.sin(((math.pi * angle_m) / 180.0))) elif (angle_m / 180.0) <= 5e+219: tmp = t_0 * math.sin(math.exp(math.log((0.005555555555555556 * (math.pi * angle_m))))) else: tmp = math.cos((math.pi * (angle_m / 180.0))) * (t_0 * math.sin(t_1)) return angle_s * tmp
angle_m = abs(angle) angle_s = copysign(1.0, angle) function code(angle_s, a, b, angle_m) t_0 = Float64(2.0 * Float64(Float64(b + a) * Float64(b - a))) t_1 = Float64((sqrt(pi) ^ 2.0) * Float64(angle_m / 180.0)) tmp = 0.0 if (Float64(angle_m / 180.0) <= 1e+96) tmp = Float64(cos(t_1) * Float64(t_0 * sin(Float64(Float64(pi * angle_m) / 180.0)))); elseif (Float64(angle_m / 180.0) <= 5e+219) tmp = Float64(t_0 * sin(exp(log(Float64(0.005555555555555556 * Float64(pi * angle_m)))))); else tmp = Float64(cos(Float64(pi * Float64(angle_m / 180.0))) * Float64(t_0 * sin(t_1))); end return Float64(angle_s * tmp) end
angle_m = abs(angle); angle_s = sign(angle) * abs(1.0); function tmp_2 = code(angle_s, a, b, angle_m) t_0 = 2.0 * ((b + a) * (b - a)); t_1 = (sqrt(pi) ^ 2.0) * (angle_m / 180.0); tmp = 0.0; if ((angle_m / 180.0) <= 1e+96) tmp = cos(t_1) * (t_0 * sin(((pi * angle_m) / 180.0))); elseif ((angle_m / 180.0) <= 5e+219) tmp = t_0 * sin(exp(log((0.005555555555555556 * (pi * angle_m))))); else tmp = cos((pi * (angle_m / 180.0))) * (t_0 * sin(t_1)); end tmp_2 = angle_s * tmp; end
angle_m = N[Abs[angle], $MachinePrecision]
angle_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a_, b_, angle$95$m_] := Block[{t$95$0 = N[(2.0 * N[(N[(b + a), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[Power[N[Sqrt[Pi], $MachinePrecision], 2.0], $MachinePrecision] * N[(angle$95$m / 180.0), $MachinePrecision]), $MachinePrecision]}, N[(angle$95$s * If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 1e+96], N[(N[Cos[t$95$1], $MachinePrecision] * N[(t$95$0 * N[Sin[N[(N[(Pi * angle$95$m), $MachinePrecision] / 180.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 5e+219], N[(t$95$0 * N[Sin[N[Exp[N[Log[N[(0.005555555555555556 * N[(Pi * angle$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Cos[N[(Pi * N[(angle$95$m / 180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(t$95$0 * N[Sin[t$95$1], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]]]
\begin{array}{l}
angle_m = \left|angle\right|
\\
angle_s = \mathsf{copysign}\left(1, angle\right)
\\
\begin{array}{l}
t_0 := 2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\\
t_1 := {\left(\sqrt{\pi}\right)}^{2} \cdot \frac{angle_m}{180}\\
angle_s \cdot \begin{array}{l}
\mathbf{if}\;\frac{angle_m}{180} \leq 10^{+96}:\\
\;\;\;\;\cos t_1 \cdot \left(t_0 \cdot \sin \left(\frac{\pi \cdot angle_m}{180}\right)\right)\\
\mathbf{elif}\;\frac{angle_m}{180} \leq 5 \cdot 10^{+219}:\\
\;\;\;\;t_0 \cdot \sin \left(e^{\log \left(0.005555555555555556 \cdot \left(\pi \cdot angle_m\right)\right)}\right)\\
\mathbf{else}:\\
\;\;\;\;\cos \left(\pi \cdot \frac{angle_m}{180}\right) \cdot \left(t_0 \cdot \sin t_1\right)\\
\end{array}
\end{array}
\end{array}
if (/.f64 angle 180) < 1.00000000000000005e96Initial program 63.1%
unpow263.1%
unpow263.1%
difference-of-squares66.0%
Applied egg-rr66.0%
add-sqr-sqrt68.3%
pow268.3%
Applied egg-rr68.3%
associate-*r/68.5%
Applied egg-rr68.5%
if 1.00000000000000005e96 < (/.f64 angle 180) < 5e219Initial program 29.8%
unpow229.8%
unpow229.8%
difference-of-squares29.8%
Applied egg-rr29.8%
Taylor expanded in angle around 0 33.2%
*-commutative33.2%
add-exp-log51.7%
div-inv51.7%
metadata-eval51.7%
associate-*r*51.7%
*-commutative51.7%
associate-*l*51.7%
Applied egg-rr51.7%
if 5e219 < (/.f64 angle 180) Initial program 6.4%
unpow26.4%
unpow26.4%
difference-of-squares20.6%
Applied egg-rr20.6%
add-sqr-sqrt34.2%
pow234.2%
Applied egg-rr33.5%
Final simplification65.0%
angle_m = (fabs.f64 angle)
angle_s = (copysign.f64 1 angle)
(FPCore (angle_s a b angle_m)
:precision binary64
(*
angle_s
(if (<= (- (pow b 2.0) (pow a 2.0)) 2e+255)
(*
(*
(* 2.0 (* (+ b a) (- b a)))
(sin (expm1 (log1p (* 0.005555555555555556 (* PI angle_m))))))
(cos (* (pow (sqrt PI) 2.0) (/ angle_m 180.0))))
(*
(pow
(*
(cbrt 2.0)
(*
(pow (cbrt b) 2.0)
(cbrt (sin (* PI (* 0.005555555555555556 angle_m))))))
3.0)
(cos (* PI (/ angle_m 180.0)))))))angle_m = fabs(angle);
angle_s = copysign(1.0, angle);
double code(double angle_s, double a, double b, double angle_m) {
double tmp;
if ((pow(b, 2.0) - pow(a, 2.0)) <= 2e+255) {
tmp = ((2.0 * ((b + a) * (b - a))) * sin(expm1(log1p((0.005555555555555556 * (((double) M_PI) * angle_m)))))) * cos((pow(sqrt(((double) M_PI)), 2.0) * (angle_m / 180.0)));
} else {
tmp = pow((cbrt(2.0) * (pow(cbrt(b), 2.0) * cbrt(sin((((double) M_PI) * (0.005555555555555556 * angle_m)))))), 3.0) * cos((((double) M_PI) * (angle_m / 180.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 tmp;
if ((Math.pow(b, 2.0) - Math.pow(a, 2.0)) <= 2e+255) {
tmp = ((2.0 * ((b + a) * (b - a))) * Math.sin(Math.expm1(Math.log1p((0.005555555555555556 * (Math.PI * angle_m)))))) * Math.cos((Math.pow(Math.sqrt(Math.PI), 2.0) * (angle_m / 180.0)));
} else {
tmp = Math.pow((Math.cbrt(2.0) * (Math.pow(Math.cbrt(b), 2.0) * Math.cbrt(Math.sin((Math.PI * (0.005555555555555556 * angle_m)))))), 3.0) * Math.cos((Math.PI * (angle_m / 180.0)));
}
return angle_s * tmp;
}
angle_m = abs(angle) angle_s = copysign(1.0, angle) function code(angle_s, a, b, angle_m) tmp = 0.0 if (Float64((b ^ 2.0) - (a ^ 2.0)) <= 2e+255) tmp = Float64(Float64(Float64(2.0 * Float64(Float64(b + a) * Float64(b - a))) * sin(expm1(log1p(Float64(0.005555555555555556 * Float64(pi * angle_m)))))) * cos(Float64((sqrt(pi) ^ 2.0) * Float64(angle_m / 180.0)))); else tmp = Float64((Float64(cbrt(2.0) * Float64((cbrt(b) ^ 2.0) * cbrt(sin(Float64(pi * Float64(0.005555555555555556 * angle_m)))))) ^ 3.0) * cos(Float64(pi * Float64(angle_m / 180.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_] := N[(angle$95$s * If[LessEqual[N[(N[Power[b, 2.0], $MachinePrecision] - N[Power[a, 2.0], $MachinePrecision]), $MachinePrecision], 2e+255], N[(N[(N[(2.0 * N[(N[(b + a), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sin[N[(Exp[N[Log[1 + N[(0.005555555555555556 * N[(Pi * angle$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]] - 1), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[Cos[N[(N[Power[N[Sqrt[Pi], $MachinePrecision], 2.0], $MachinePrecision] * N[(angle$95$m / 180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Power[N[(N[Power[2.0, 1/3], $MachinePrecision] * N[(N[Power[N[Power[b, 1/3], $MachinePrecision], 2.0], $MachinePrecision] * N[Power[N[Sin[N[(Pi * N[(0.005555555555555556 * angle$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 3.0], $MachinePrecision] * N[Cos[N[(Pi * N[(angle$95$m / 180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
angle_m = \left|angle\right|
\\
angle_s = \mathsf{copysign}\left(1, angle\right)
\\
angle_s \cdot \begin{array}{l}
\mathbf{if}\;{b}^{2} - {a}^{2} \leq 2 \cdot 10^{+255}:\\
\;\;\;\;\left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left(\mathsf{expm1}\left(\mathsf{log1p}\left(0.005555555555555556 \cdot \left(\pi \cdot angle_m\right)\right)\right)\right)\right) \cdot \cos \left({\left(\sqrt{\pi}\right)}^{2} \cdot \frac{angle_m}{180}\right)\\
\mathbf{else}:\\
\;\;\;\;{\left(\sqrt[3]{2} \cdot \left({\left(\sqrt[3]{b}\right)}^{2} \cdot \sqrt[3]{\sin \left(\pi \cdot \left(0.005555555555555556 \cdot angle_m\right)\right)}\right)\right)}^{3} \cdot \cos \left(\pi \cdot \frac{angle_m}{180}\right)\\
\end{array}
\end{array}
if (-.f64 (pow.f64 b 2) (pow.f64 a 2)) < 1.99999999999999998e255Initial program 60.6%
unpow260.6%
unpow260.6%
difference-of-squares60.6%
Applied egg-rr60.6%
add-sqr-sqrt63.7%
pow263.7%
Applied egg-rr63.7%
*-commutative63.7%
div-inv61.6%
metadata-eval61.6%
associate-*r*61.8%
expm1-log1p-u57.5%
*-commutative57.5%
associate-*l*57.5%
Applied egg-rr57.5%
if 1.99999999999999998e255 < (-.f64 (pow.f64 b 2) (pow.f64 a 2)) Initial program 45.8%
add-cube-cbrt45.6%
pow345.6%
*-commutative45.6%
div-inv44.2%
metadata-eval44.2%
Applied egg-rr44.2%
Taylor expanded in a around 0 35.3%
*-commutative35.3%
unpow1/351.6%
*-lft-identity51.6%
*-commutative51.6%
*-commutative51.6%
*-commutative51.6%
associate-*r*54.4%
*-commutative54.4%
Simplified54.4%
*-commutative54.4%
*-commutative54.4%
cbrt-prod54.5%
unpow254.5%
cbrt-prod70.0%
pow270.0%
*-commutative70.0%
Applied egg-rr70.0%
Final simplification60.8%
angle_m = (fabs.f64 angle)
angle_s = (copysign.f64 1 angle)
(FPCore (angle_s a b angle_m)
:precision binary64
(let* ((t_0 (* 0.005555555555555556 (* PI angle_m)))
(t_1 (* (* 2.0 (* (+ b a) (- b a))) (sin (expm1 (log1p t_0))))))
(*
angle_s
(if (<= (pow b 2.0) 2e+172)
(* t_1 (cos (* (pow (sqrt PI) 2.0) (/ angle_m 180.0))))
(* t_1 (expm1 (log1p (cos t_0))))))))angle_m = fabs(angle);
angle_s = copysign(1.0, angle);
double code(double angle_s, double a, double b, double angle_m) {
double t_0 = 0.005555555555555556 * (((double) M_PI) * angle_m);
double t_1 = (2.0 * ((b + a) * (b - a))) * sin(expm1(log1p(t_0)));
double tmp;
if (pow(b, 2.0) <= 2e+172) {
tmp = t_1 * cos((pow(sqrt(((double) M_PI)), 2.0) * (angle_m / 180.0)));
} else {
tmp = t_1 * expm1(log1p(cos(t_0)));
}
return angle_s * tmp;
}
angle_m = Math.abs(angle);
angle_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b, double angle_m) {
double t_0 = 0.005555555555555556 * (Math.PI * angle_m);
double t_1 = (2.0 * ((b + a) * (b - a))) * Math.sin(Math.expm1(Math.log1p(t_0)));
double tmp;
if (Math.pow(b, 2.0) <= 2e+172) {
tmp = t_1 * Math.cos((Math.pow(Math.sqrt(Math.PI), 2.0) * (angle_m / 180.0)));
} else {
tmp = t_1 * Math.expm1(Math.log1p(Math.cos(t_0)));
}
return angle_s * tmp;
}
angle_m = math.fabs(angle) angle_s = math.copysign(1.0, angle) def code(angle_s, a, b, angle_m): t_0 = 0.005555555555555556 * (math.pi * angle_m) t_1 = (2.0 * ((b + a) * (b - a))) * math.sin(math.expm1(math.log1p(t_0))) tmp = 0 if math.pow(b, 2.0) <= 2e+172: tmp = t_1 * math.cos((math.pow(math.sqrt(math.pi), 2.0) * (angle_m / 180.0))) else: tmp = t_1 * math.expm1(math.log1p(math.cos(t_0))) return angle_s * tmp
angle_m = abs(angle) angle_s = copysign(1.0, angle) function code(angle_s, a, b, angle_m) t_0 = Float64(0.005555555555555556 * Float64(pi * angle_m)) t_1 = Float64(Float64(2.0 * Float64(Float64(b + a) * Float64(b - a))) * sin(expm1(log1p(t_0)))) tmp = 0.0 if ((b ^ 2.0) <= 2e+172) tmp = Float64(t_1 * cos(Float64((sqrt(pi) ^ 2.0) * Float64(angle_m / 180.0)))); else tmp = Float64(t_1 * expm1(log1p(cos(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[(0.005555555555555556 * N[(Pi * angle$95$m), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(2.0 * N[(N[(b + a), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sin[N[(Exp[N[Log[1 + t$95$0], $MachinePrecision]] - 1), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, N[(angle$95$s * If[LessEqual[N[Power[b, 2.0], $MachinePrecision], 2e+172], N[(t$95$1 * N[Cos[N[(N[Power[N[Sqrt[Pi], $MachinePrecision], 2.0], $MachinePrecision] * N[(angle$95$m / 180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(t$95$1 * N[(Exp[N[Log[1 + N[Cos[t$95$0], $MachinePrecision]], $MachinePrecision]] - 1), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]]]
\begin{array}{l}
angle_m = \left|angle\right|
\\
angle_s = \mathsf{copysign}\left(1, angle\right)
\\
\begin{array}{l}
t_0 := 0.005555555555555556 \cdot \left(\pi \cdot angle_m\right)\\
t_1 := \left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left(\mathsf{expm1}\left(\mathsf{log1p}\left(t_0\right)\right)\right)\\
angle_s \cdot \begin{array}{l}
\mathbf{if}\;{b}^{2} \leq 2 \cdot 10^{+172}:\\
\;\;\;\;t_1 \cdot \cos \left({\left(\sqrt{\pi}\right)}^{2} \cdot \frac{angle_m}{180}\right)\\
\mathbf{else}:\\
\;\;\;\;t_1 \cdot \mathsf{expm1}\left(\mathsf{log1p}\left(\cos t_0\right)\right)\\
\end{array}
\end{array}
\end{array}
if (pow.f64 b 2) < 2.0000000000000002e172Initial program 60.7%
unpow260.7%
unpow260.7%
difference-of-squares60.7%
Applied egg-rr60.7%
add-sqr-sqrt63.4%
pow263.4%
Applied egg-rr63.4%
*-commutative63.4%
div-inv61.1%
metadata-eval61.1%
associate-*r*61.3%
expm1-log1p-u57.9%
*-commutative57.9%
associate-*l*57.8%
Applied egg-rr57.8%
if 2.0000000000000002e172 < (pow.f64 b 2) Initial program 48.3%
unpow248.3%
unpow248.3%
difference-of-squares56.8%
Applied egg-rr56.8%
add-sqr-sqrt61.0%
pow261.0%
Applied egg-rr61.0%
*-commutative61.0%
div-inv59.9%
metadata-eval59.9%
associate-*r*58.4%
expm1-log1p-u48.7%
*-commutative48.7%
associate-*l*48.7%
Applied egg-rr48.7%
expm1-log1p-u48.7%
unpow248.7%
add-sqr-sqrt48.7%
associate-*r/49.9%
div-inv50.1%
metadata-eval50.1%
*-commutative50.1%
Applied egg-rr50.1%
Final simplification55.3%
angle_m = (fabs.f64 angle)
angle_s = (copysign.f64 1 angle)
(FPCore (angle_s a b angle_m)
:precision binary64
(let* ((t_0 (* 0.005555555555555556 (* PI angle_m)))
(t_1 (* 2.0 (* (+ b a) (- b a)))))
(*
angle_s
(if (<= (pow b 2.0) 4e+77)
(*
(cos (* (pow (sqrt PI) 2.0) (/ angle_m 180.0)))
(* t_1 (sin (* PI (/ angle_m 180.0)))))
(* (* t_1 (sin (expm1 (log1p t_0)))) (expm1 (log1p (cos t_0))))))))angle_m = fabs(angle);
angle_s = copysign(1.0, angle);
double code(double angle_s, double a, double b, double angle_m) {
double t_0 = 0.005555555555555556 * (((double) M_PI) * angle_m);
double t_1 = 2.0 * ((b + a) * (b - a));
double tmp;
if (pow(b, 2.0) <= 4e+77) {
tmp = cos((pow(sqrt(((double) M_PI)), 2.0) * (angle_m / 180.0))) * (t_1 * sin((((double) M_PI) * (angle_m / 180.0))));
} else {
tmp = (t_1 * sin(expm1(log1p(t_0)))) * expm1(log1p(cos(t_0)));
}
return angle_s * tmp;
}
angle_m = Math.abs(angle);
angle_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b, double angle_m) {
double t_0 = 0.005555555555555556 * (Math.PI * angle_m);
double t_1 = 2.0 * ((b + a) * (b - a));
double tmp;
if (Math.pow(b, 2.0) <= 4e+77) {
tmp = Math.cos((Math.pow(Math.sqrt(Math.PI), 2.0) * (angle_m / 180.0))) * (t_1 * Math.sin((Math.PI * (angle_m / 180.0))));
} else {
tmp = (t_1 * Math.sin(Math.expm1(Math.log1p(t_0)))) * Math.expm1(Math.log1p(Math.cos(t_0)));
}
return angle_s * tmp;
}
angle_m = math.fabs(angle) angle_s = math.copysign(1.0, angle) def code(angle_s, a, b, angle_m): t_0 = 0.005555555555555556 * (math.pi * angle_m) t_1 = 2.0 * ((b + a) * (b - a)) tmp = 0 if math.pow(b, 2.0) <= 4e+77: tmp = math.cos((math.pow(math.sqrt(math.pi), 2.0) * (angle_m / 180.0))) * (t_1 * math.sin((math.pi * (angle_m / 180.0)))) else: tmp = (t_1 * math.sin(math.expm1(math.log1p(t_0)))) * math.expm1(math.log1p(math.cos(t_0))) return angle_s * tmp
angle_m = abs(angle) angle_s = copysign(1.0, angle) function code(angle_s, a, b, angle_m) t_0 = Float64(0.005555555555555556 * Float64(pi * angle_m)) t_1 = Float64(2.0 * Float64(Float64(b + a) * Float64(b - a))) tmp = 0.0 if ((b ^ 2.0) <= 4e+77) tmp = Float64(cos(Float64((sqrt(pi) ^ 2.0) * Float64(angle_m / 180.0))) * Float64(t_1 * sin(Float64(pi * Float64(angle_m / 180.0))))); else tmp = Float64(Float64(t_1 * sin(expm1(log1p(t_0)))) * expm1(log1p(cos(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[(0.005555555555555556 * N[(Pi * angle$95$m), $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[Power[b, 2.0], $MachinePrecision], 4e+77], N[(N[Cos[N[(N[Power[N[Sqrt[Pi], $MachinePrecision], 2.0], $MachinePrecision] * N[(angle$95$m / 180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(t$95$1 * N[Sin[N[(Pi * N[(angle$95$m / 180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(t$95$1 * N[Sin[N[(Exp[N[Log[1 + t$95$0], $MachinePrecision]] - 1), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(Exp[N[Log[1 + N[Cos[t$95$0], $MachinePrecision]], $MachinePrecision]] - 1), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]]]
\begin{array}{l}
angle_m = \left|angle\right|
\\
angle_s = \mathsf{copysign}\left(1, angle\right)
\\
\begin{array}{l}
t_0 := 0.005555555555555556 \cdot \left(\pi \cdot angle_m\right)\\
t_1 := 2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\\
angle_s \cdot \begin{array}{l}
\mathbf{if}\;{b}^{2} \leq 4 \cdot 10^{+77}:\\
\;\;\;\;\cos \left({\left(\sqrt{\pi}\right)}^{2} \cdot \frac{angle_m}{180}\right) \cdot \left(t_1 \cdot \sin \left(\pi \cdot \frac{angle_m}{180}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(t_1 \cdot \sin \left(\mathsf{expm1}\left(\mathsf{log1p}\left(t_0\right)\right)\right)\right) \cdot \mathsf{expm1}\left(\mathsf{log1p}\left(\cos t_0\right)\right)\\
\end{array}
\end{array}
\end{array}
if (pow.f64 b 2) < 3.99999999999999993e77Initial program 62.4%
unpow262.4%
unpow262.4%
difference-of-squares62.4%
Applied egg-rr62.4%
add-sqr-sqrt65.3%
pow265.3%
Applied egg-rr65.3%
if 3.99999999999999993e77 < (pow.f64 b 2) Initial program 47.0%
unpow247.0%
unpow247.0%
difference-of-squares54.5%
Applied egg-rr54.5%
add-sqr-sqrt58.3%
pow258.3%
Applied egg-rr58.3%
*-commutative58.3%
div-inv57.2%
metadata-eval57.2%
associate-*r*57.1%
expm1-log1p-u47.1%
*-commutative47.1%
associate-*l*47.0%
Applied egg-rr47.0%
expm1-log1p-u47.0%
unpow247.0%
add-sqr-sqrt47.0%
associate-*r/47.9%
div-inv48.0%
metadata-eval48.0%
*-commutative48.0%
Applied egg-rr48.0%
Final simplification58.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)))))
(*
angle_s
(if (or (<= (/ angle_m 180.0) 5e+78) (not (<= (/ angle_m 180.0) 5e+186)))
(*
(cos (* (pow (sqrt PI) 2.0) (/ angle_m 180.0)))
(* t_0 (sin (* PI (/ angle_m 180.0)))))
(* t_0 (sin (exp (log (* 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 = 2.0 * ((b + a) * (b - a));
double tmp;
if (((angle_m / 180.0) <= 5e+78) || !((angle_m / 180.0) <= 5e+186)) {
tmp = cos((pow(sqrt(((double) M_PI)), 2.0) * (angle_m / 180.0))) * (t_0 * sin((((double) M_PI) * (angle_m / 180.0))));
} else {
tmp = t_0 * sin(exp(log((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 = 2.0 * ((b + a) * (b - a));
double tmp;
if (((angle_m / 180.0) <= 5e+78) || !((angle_m / 180.0) <= 5e+186)) {
tmp = Math.cos((Math.pow(Math.sqrt(Math.PI), 2.0) * (angle_m / 180.0))) * (t_0 * Math.sin((Math.PI * (angle_m / 180.0))));
} else {
tmp = t_0 * Math.sin(Math.exp(Math.log((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 = 2.0 * ((b + a) * (b - a)) tmp = 0 if ((angle_m / 180.0) <= 5e+78) or not ((angle_m / 180.0) <= 5e+186): tmp = math.cos((math.pow(math.sqrt(math.pi), 2.0) * (angle_m / 180.0))) * (t_0 * math.sin((math.pi * (angle_m / 180.0)))) else: tmp = t_0 * math.sin(math.exp(math.log((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(2.0 * Float64(Float64(b + a) * Float64(b - a))) tmp = 0.0 if ((Float64(angle_m / 180.0) <= 5e+78) || !(Float64(angle_m / 180.0) <= 5e+186)) tmp = Float64(cos(Float64((sqrt(pi) ^ 2.0) * Float64(angle_m / 180.0))) * Float64(t_0 * sin(Float64(pi * Float64(angle_m / 180.0))))); else tmp = Float64(t_0 * sin(exp(log(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 = 2.0 * ((b + a) * (b - a)); tmp = 0.0; if (((angle_m / 180.0) <= 5e+78) || ~(((angle_m / 180.0) <= 5e+186))) tmp = cos(((sqrt(pi) ^ 2.0) * (angle_m / 180.0))) * (t_0 * sin((pi * (angle_m / 180.0)))); else tmp = t_0 * sin(exp(log((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[(2.0 * N[(N[(b + a), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, N[(angle$95$s * If[Or[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 5e+78], N[Not[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 5e+186]], $MachinePrecision]], N[(N[Cos[N[(N[Power[N[Sqrt[Pi], $MachinePrecision], 2.0], $MachinePrecision] * N[(angle$95$m / 180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(t$95$0 * N[Sin[N[(Pi * N[(angle$95$m / 180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$0 * N[Sin[N[Exp[N[Log[N[(0.005555555555555556 * N[(Pi * angle$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]]
\begin{array}{l}
angle_m = \left|angle\right|
\\
angle_s = \mathsf{copysign}\left(1, angle\right)
\\
\begin{array}{l}
t_0 := 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 5 \cdot 10^{+78} \lor \neg \left(\frac{angle_m}{180} \leq 5 \cdot 10^{+186}\right):\\
\;\;\;\;\cos \left({\left(\sqrt{\pi}\right)}^{2} \cdot \frac{angle_m}{180}\right) \cdot \left(t_0 \cdot \sin \left(\pi \cdot \frac{angle_m}{180}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t_0 \cdot \sin \left(e^{\log \left(0.005555555555555556 \cdot \left(\pi \cdot angle_m\right)\right)}\right)\\
\end{array}
\end{array}
\end{array}
if (/.f64 angle 180) < 4.99999999999999984e78 or 4.99999999999999954e186 < (/.f64 angle 180) Initial program 60.6%
unpow260.6%
unpow260.6%
difference-of-squares63.7%
Applied egg-rr63.7%
add-sqr-sqrt67.6%
pow267.6%
Applied egg-rr67.6%
if 4.99999999999999984e78 < (/.f64 angle 180) < 4.99999999999999954e186Initial program 26.9%
unpow226.9%
unpow226.9%
difference-of-squares26.9%
Applied egg-rr26.9%
Taylor expanded in angle around 0 27.4%
*-commutative27.4%
add-exp-log48.3%
div-inv48.3%
metadata-eval48.3%
associate-*r*48.3%
*-commutative48.3%
associate-*l*48.3%
Applied egg-rr48.3%
Final simplification65.3%
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 (sqrt PI) 2.0) (/ angle_m 180.0))))
(*
angle_s
(if (<= (/ angle_m 180.0) 5e+78)
(* (cos t_2) (* t_0 (sin t_1)))
(if (<= (/ angle_m 180.0) 5e+219)
(* t_0 (sin (exp (log (* 0.005555555555555556 (* PI angle_m))))))
(* (cos t_1) (* t_0 (sin t_2))))))))angle_m = fabs(angle);
angle_s = copysign(1.0, angle);
double code(double angle_s, double a, double b, double angle_m) {
double t_0 = 2.0 * ((b + a) * (b - a));
double t_1 = ((double) M_PI) * (angle_m / 180.0);
double t_2 = pow(sqrt(((double) M_PI)), 2.0) * (angle_m / 180.0);
double tmp;
if ((angle_m / 180.0) <= 5e+78) {
tmp = cos(t_2) * (t_0 * sin(t_1));
} else if ((angle_m / 180.0) <= 5e+219) {
tmp = t_0 * sin(exp(log((0.005555555555555556 * (((double) M_PI) * angle_m)))));
} else {
tmp = cos(t_1) * (t_0 * sin(t_2));
}
return angle_s * tmp;
}
angle_m = Math.abs(angle);
angle_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b, double angle_m) {
double t_0 = 2.0 * ((b + a) * (b - a));
double t_1 = Math.PI * (angle_m / 180.0);
double t_2 = Math.pow(Math.sqrt(Math.PI), 2.0) * (angle_m / 180.0);
double tmp;
if ((angle_m / 180.0) <= 5e+78) {
tmp = Math.cos(t_2) * (t_0 * Math.sin(t_1));
} else if ((angle_m / 180.0) <= 5e+219) {
tmp = t_0 * Math.sin(Math.exp(Math.log((0.005555555555555556 * (Math.PI * angle_m)))));
} else {
tmp = Math.cos(t_1) * (t_0 * Math.sin(t_2));
}
return angle_s * tmp;
}
angle_m = math.fabs(angle) angle_s = math.copysign(1.0, angle) def code(angle_s, a, b, angle_m): t_0 = 2.0 * ((b + a) * (b - a)) t_1 = math.pi * (angle_m / 180.0) t_2 = math.pow(math.sqrt(math.pi), 2.0) * (angle_m / 180.0) tmp = 0 if (angle_m / 180.0) <= 5e+78: tmp = math.cos(t_2) * (t_0 * math.sin(t_1)) elif (angle_m / 180.0) <= 5e+219: tmp = t_0 * math.sin(math.exp(math.log((0.005555555555555556 * (math.pi * angle_m))))) else: tmp = math.cos(t_1) * (t_0 * math.sin(t_2)) return angle_s * tmp
angle_m = abs(angle) angle_s = copysign(1.0, angle) function code(angle_s, a, b, angle_m) t_0 = Float64(2.0 * Float64(Float64(b + a) * Float64(b - a))) t_1 = Float64(pi * Float64(angle_m / 180.0)) t_2 = Float64((sqrt(pi) ^ 2.0) * Float64(angle_m / 180.0)) tmp = 0.0 if (Float64(angle_m / 180.0) <= 5e+78) tmp = Float64(cos(t_2) * Float64(t_0 * sin(t_1))); elseif (Float64(angle_m / 180.0) <= 5e+219) tmp = Float64(t_0 * sin(exp(log(Float64(0.005555555555555556 * Float64(pi * angle_m)))))); else tmp = Float64(cos(t_1) * Float64(t_0 * sin(t_2))); end return Float64(angle_s * tmp) end
angle_m = abs(angle); angle_s = sign(angle) * abs(1.0); function tmp_2 = code(angle_s, a, b, angle_m) t_0 = 2.0 * ((b + a) * (b - a)); t_1 = pi * (angle_m / 180.0); t_2 = (sqrt(pi) ^ 2.0) * (angle_m / 180.0); tmp = 0.0; if ((angle_m / 180.0) <= 5e+78) tmp = cos(t_2) * (t_0 * sin(t_1)); elseif ((angle_m / 180.0) <= 5e+219) tmp = t_0 * sin(exp(log((0.005555555555555556 * (pi * angle_m))))); else tmp = cos(t_1) * (t_0 * sin(t_2)); end tmp_2 = angle_s * tmp; end
angle_m = N[Abs[angle], $MachinePrecision]
angle_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a_, b_, angle$95$m_] := Block[{t$95$0 = N[(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[N[Sqrt[Pi], $MachinePrecision], 2.0], $MachinePrecision] * N[(angle$95$m / 180.0), $MachinePrecision]), $MachinePrecision]}, N[(angle$95$s * If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 5e+78], N[(N[Cos[t$95$2], $MachinePrecision] * N[(t$95$0 * N[Sin[t$95$1], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 5e+219], N[(t$95$0 * N[Sin[N[Exp[N[Log[N[(0.005555555555555556 * N[(Pi * angle$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Cos[t$95$1], $MachinePrecision] * N[(t$95$0 * N[Sin[t$95$2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]]]]
\begin{array}{l}
angle_m = \left|angle\right|
\\
angle_s = \mathsf{copysign}\left(1, angle\right)
\\
\begin{array}{l}
t_0 := 2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\\
t_1 := \pi \cdot \frac{angle_m}{180}\\
t_2 := {\left(\sqrt{\pi}\right)}^{2} \cdot \frac{angle_m}{180}\\
angle_s \cdot \begin{array}{l}
\mathbf{if}\;\frac{angle_m}{180} \leq 5 \cdot 10^{+78}:\\
\;\;\;\;\cos t_2 \cdot \left(t_0 \cdot \sin t_1\right)\\
\mathbf{elif}\;\frac{angle_m}{180} \leq 5 \cdot 10^{+219}:\\
\;\;\;\;t_0 \cdot \sin \left(e^{\log \left(0.005555555555555556 \cdot \left(\pi \cdot angle_m\right)\right)}\right)\\
\mathbf{else}:\\
\;\;\;\;\cos t_1 \cdot \left(t_0 \cdot \sin t_2\right)\\
\end{array}
\end{array}
\end{array}
if (/.f64 angle 180) < 4.99999999999999984e78Initial program 63.2%
unpow263.2%
unpow263.2%
difference-of-squares66.1%
Applied egg-rr66.1%
add-sqr-sqrt69.0%
pow269.0%
Applied egg-rr69.0%
if 4.99999999999999984e78 < (/.f64 angle 180) < 5e219Initial program 31.3%
unpow231.3%
unpow231.3%
difference-of-squares31.3%
Applied egg-rr31.3%
Taylor expanded in angle around 0 31.5%
*-commutative31.5%
add-exp-log49.6%
div-inv49.6%
metadata-eval49.6%
associate-*r*49.6%
*-commutative49.6%
associate-*l*49.6%
Applied egg-rr49.6%
if 5e219 < (/.f64 angle 180) Initial program 6.4%
unpow26.4%
unpow26.4%
difference-of-squares20.6%
Applied egg-rr20.6%
add-sqr-sqrt34.2%
pow234.2%
Applied egg-rr33.5%
Final simplification65.0%
angle_m = (fabs.f64 angle)
angle_s = (copysign.f64 1 angle)
(FPCore (angle_s a b angle_m)
:precision binary64
(let* ((t_0 (* 0.005555555555555556 (* PI angle_m)))
(t_1 (* 2.0 (* (+ b a) (- b a)))))
(*
angle_s
(if (<= a 1.35e+17)
(* t_1 (sin (/ (* PI angle_m) 180.0)))
(if (<= a 2.5e+189)
(* (cos (* PI (/ angle_m 180.0))) (* t_1 (sin t_0)))
(* t_1 (sin (exp (log t_0)))))))))angle_m = fabs(angle);
angle_s = copysign(1.0, angle);
double code(double angle_s, double a, double b, double angle_m) {
double t_0 = 0.005555555555555556 * (((double) M_PI) * angle_m);
double t_1 = 2.0 * ((b + a) * (b - a));
double tmp;
if (a <= 1.35e+17) {
tmp = t_1 * sin(((((double) M_PI) * angle_m) / 180.0));
} else if (a <= 2.5e+189) {
tmp = cos((((double) M_PI) * (angle_m / 180.0))) * (t_1 * sin(t_0));
} else {
tmp = t_1 * sin(exp(log(t_0)));
}
return angle_s * tmp;
}
angle_m = Math.abs(angle);
angle_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b, double angle_m) {
double t_0 = 0.005555555555555556 * (Math.PI * angle_m);
double t_1 = 2.0 * ((b + a) * (b - a));
double tmp;
if (a <= 1.35e+17) {
tmp = t_1 * Math.sin(((Math.PI * angle_m) / 180.0));
} else if (a <= 2.5e+189) {
tmp = Math.cos((Math.PI * (angle_m / 180.0))) * (t_1 * Math.sin(t_0));
} else {
tmp = t_1 * Math.sin(Math.exp(Math.log(t_0)));
}
return angle_s * tmp;
}
angle_m = math.fabs(angle) angle_s = math.copysign(1.0, angle) def code(angle_s, a, b, angle_m): t_0 = 0.005555555555555556 * (math.pi * angle_m) t_1 = 2.0 * ((b + a) * (b - a)) tmp = 0 if a <= 1.35e+17: tmp = t_1 * math.sin(((math.pi * angle_m) / 180.0)) elif a <= 2.5e+189: tmp = math.cos((math.pi * (angle_m / 180.0))) * (t_1 * math.sin(t_0)) else: tmp = t_1 * math.sin(math.exp(math.log(t_0))) return angle_s * tmp
angle_m = abs(angle) angle_s = copysign(1.0, angle) function code(angle_s, a, b, angle_m) t_0 = Float64(0.005555555555555556 * Float64(pi * angle_m)) t_1 = Float64(2.0 * Float64(Float64(b + a) * Float64(b - a))) tmp = 0.0 if (a <= 1.35e+17) tmp = Float64(t_1 * sin(Float64(Float64(pi * angle_m) / 180.0))); elseif (a <= 2.5e+189) tmp = Float64(cos(Float64(pi * Float64(angle_m / 180.0))) * Float64(t_1 * sin(t_0))); else tmp = Float64(t_1 * sin(exp(log(t_0)))); end return Float64(angle_s * tmp) end
angle_m = abs(angle); angle_s = sign(angle) * abs(1.0); function tmp_2 = code(angle_s, a, b, angle_m) t_0 = 0.005555555555555556 * (pi * angle_m); t_1 = 2.0 * ((b + a) * (b - a)); tmp = 0.0; if (a <= 1.35e+17) tmp = t_1 * sin(((pi * angle_m) / 180.0)); elseif (a <= 2.5e+189) tmp = cos((pi * (angle_m / 180.0))) * (t_1 * sin(t_0)); else tmp = t_1 * sin(exp(log(t_0))); end tmp_2 = angle_s * tmp; end
angle_m = N[Abs[angle], $MachinePrecision]
angle_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a_, b_, angle$95$m_] := Block[{t$95$0 = N[(0.005555555555555556 * N[(Pi * angle$95$m), $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[a, 1.35e+17], N[(t$95$1 * N[Sin[N[(N[(Pi * angle$95$m), $MachinePrecision] / 180.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 2.5e+189], N[(N[Cos[N[(Pi * N[(angle$95$m / 180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(t$95$1 * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$1 * N[Sin[N[Exp[N[Log[t$95$0], $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]]]
\begin{array}{l}
angle_m = \left|angle\right|
\\
angle_s = \mathsf{copysign}\left(1, angle\right)
\\
\begin{array}{l}
t_0 := 0.005555555555555556 \cdot \left(\pi \cdot angle_m\right)\\
t_1 := 2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\\
angle_s \cdot \begin{array}{l}
\mathbf{if}\;a \leq 1.35 \cdot 10^{+17}:\\
\;\;\;\;t_1 \cdot \sin \left(\frac{\pi \cdot angle_m}{180}\right)\\
\mathbf{elif}\;a \leq 2.5 \cdot 10^{+189}:\\
\;\;\;\;\cos \left(\pi \cdot \frac{angle_m}{180}\right) \cdot \left(t_1 \cdot \sin t_0\right)\\
\mathbf{else}:\\
\;\;\;\;t_1 \cdot \sin \left(e^{\log t_0}\right)\\
\end{array}
\end{array}
\end{array}
if a < 1.35e17Initial program 60.4%
unpow260.4%
unpow260.4%
difference-of-squares63.0%
Applied egg-rr63.0%
Taylor expanded in angle around 0 65.7%
associate-*r/64.7%
Applied egg-rr66.4%
if 1.35e17 < a < 2.5000000000000002e189Initial program 44.4%
unpow244.4%
unpow244.4%
difference-of-squares49.1%
Applied egg-rr49.1%
Taylor expanded in angle around inf 49.1%
if 2.5000000000000002e189 < a Initial program 47.6%
unpow247.6%
unpow247.6%
difference-of-squares48.0%
Applied egg-rr48.0%
Taylor expanded in angle around 0 57.6%
*-commutative57.6%
add-exp-log38.1%
div-inv38.1%
metadata-eval38.1%
associate-*r*38.1%
*-commutative38.1%
associate-*l*38.1%
Applied egg-rr38.1%
Final simplification61.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 (* t_0 (sin (* PI (* 0.005555555555555556 angle_m))))))
(*
angle_s
(if (<= (/ angle_m 180.0) 5e+74)
(* (cos (* PI (/ angle_m 180.0))) t_1)
(if (<= (/ angle_m 180.0) 5e+190)
(* t_0 (sin (exp (log (* 0.005555555555555556 (* PI angle_m))))))
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 = t_0 * sin((((double) M_PI) * (0.005555555555555556 * angle_m)));
double tmp;
if ((angle_m / 180.0) <= 5e+74) {
tmp = cos((((double) M_PI) * (angle_m / 180.0))) * t_1;
} else if ((angle_m / 180.0) <= 5e+190) {
tmp = t_0 * sin(exp(log((0.005555555555555556 * (((double) M_PI) * angle_m)))));
} else {
tmp = 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 = t_0 * Math.sin((Math.PI * (0.005555555555555556 * angle_m)));
double tmp;
if ((angle_m / 180.0) <= 5e+74) {
tmp = Math.cos((Math.PI * (angle_m / 180.0))) * t_1;
} else if ((angle_m / 180.0) <= 5e+190) {
tmp = t_0 * Math.sin(Math.exp(Math.log((0.005555555555555556 * (Math.PI * angle_m)))));
} else {
tmp = t_1;
}
return angle_s * tmp;
}
angle_m = math.fabs(angle) angle_s = math.copysign(1.0, angle) def code(angle_s, a, b, angle_m): t_0 = 2.0 * ((b + a) * (b - a)) t_1 = t_0 * math.sin((math.pi * (0.005555555555555556 * angle_m))) tmp = 0 if (angle_m / 180.0) <= 5e+74: tmp = math.cos((math.pi * (angle_m / 180.0))) * t_1 elif (angle_m / 180.0) <= 5e+190: tmp = t_0 * math.sin(math.exp(math.log((0.005555555555555556 * (math.pi * angle_m))))) else: tmp = 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(t_0 * sin(Float64(pi * Float64(0.005555555555555556 * angle_m)))) tmp = 0.0 if (Float64(angle_m / 180.0) <= 5e+74) tmp = Float64(cos(Float64(pi * Float64(angle_m / 180.0))) * t_1); elseif (Float64(angle_m / 180.0) <= 5e+190) tmp = Float64(t_0 * sin(exp(log(Float64(0.005555555555555556 * Float64(pi * angle_m)))))); else tmp = t_1; end return Float64(angle_s * tmp) end
angle_m = abs(angle); angle_s = sign(angle) * abs(1.0); function tmp_2 = code(angle_s, a, b, angle_m) t_0 = 2.0 * ((b + a) * (b - a)); t_1 = t_0 * sin((pi * (0.005555555555555556 * angle_m))); tmp = 0.0; if ((angle_m / 180.0) <= 5e+74) tmp = cos((pi * (angle_m / 180.0))) * t_1; elseif ((angle_m / 180.0) <= 5e+190) tmp = t_0 * sin(exp(log((0.005555555555555556 * (pi * angle_m))))); else tmp = t_1; end tmp_2 = angle_s * tmp; end
angle_m = N[Abs[angle], $MachinePrecision]
angle_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a_, b_, angle$95$m_] := Block[{t$95$0 = N[(2.0 * N[(N[(b + a), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(t$95$0 * N[Sin[N[(Pi * N[(0.005555555555555556 * angle$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, N[(angle$95$s * If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 5e+74], N[(N[Cos[N[(Pi * N[(angle$95$m / 180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * t$95$1), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 5e+190], N[(t$95$0 * N[Sin[N[Exp[N[Log[N[(0.005555555555555556 * N[(Pi * angle$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], t$95$1]]), $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 := t_0 \cdot \sin \left(\pi \cdot \left(0.005555555555555556 \cdot angle_m\right)\right)\\
angle_s \cdot \begin{array}{l}
\mathbf{if}\;\frac{angle_m}{180} \leq 5 \cdot 10^{+74}:\\
\;\;\;\;\cos \left(\pi \cdot \frac{angle_m}{180}\right) \cdot t_1\\
\mathbf{elif}\;\frac{angle_m}{180} \leq 5 \cdot 10^{+190}:\\
\;\;\;\;t_0 \cdot \sin \left(e^{\log \left(0.005555555555555556 \cdot \left(\pi \cdot angle_m\right)\right)}\right)\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
\end{array}
if (/.f64 angle 180) < 4.99999999999999963e74Initial program 64.1%
unpow264.1%
unpow264.1%
difference-of-squares67.0%
Applied egg-rr67.0%
Taylor expanded in angle around inf 67.2%
associate-*r*68.9%
*-commutative68.9%
*-commutative68.9%
*-commutative68.9%
Simplified66.3%
if 4.99999999999999963e74 < (/.f64 angle 180) < 5.00000000000000036e190Initial program 26.8%
unpow226.8%
unpow226.8%
difference-of-squares26.8%
Applied egg-rr26.8%
Taylor expanded in angle around 0 30.7%
*-commutative30.7%
add-exp-log48.6%
div-inv48.6%
metadata-eval48.6%
associate-*r*48.6%
*-commutative48.6%
associate-*l*48.6%
Applied egg-rr48.6%
if 5.00000000000000036e190 < (/.f64 angle 180) Initial program 24.3%
unpow224.3%
unpow224.3%
difference-of-squares30.5%
Applied egg-rr30.5%
Taylor expanded in angle around 0 22.6%
Taylor expanded in angle around inf 22.5%
associate-*r*28.9%
*-commutative28.9%
*-commutative28.9%
*-commutative28.9%
Simplified28.9%
Final simplification61.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))))
(*
angle_s
(if (<= (pow a 2.0) 4e-18)
(* 2.0 (* (sin (* 0.005555555555555556 (* PI angle_m))) t_0))
(* (* angle_m 0.011111111111111112) (* PI 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 = (b + a) * (b - a);
double tmp;
if (pow(a, 2.0) <= 4e-18) {
tmp = 2.0 * (sin((0.005555555555555556 * (((double) M_PI) * angle_m))) * t_0);
} else {
tmp = (angle_m * 0.011111111111111112) * (((double) M_PI) * 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 = (b + a) * (b - a);
double tmp;
if (Math.pow(a, 2.0) <= 4e-18) {
tmp = 2.0 * (Math.sin((0.005555555555555556 * (Math.PI * angle_m))) * t_0);
} else {
tmp = (angle_m * 0.011111111111111112) * (Math.PI * t_0);
}
return angle_s * tmp;
}
angle_m = math.fabs(angle) angle_s = math.copysign(1.0, angle) def code(angle_s, a, b, angle_m): t_0 = (b + a) * (b - a) tmp = 0 if math.pow(a, 2.0) <= 4e-18: tmp = 2.0 * (math.sin((0.005555555555555556 * (math.pi * angle_m))) * t_0) else: tmp = (angle_m * 0.011111111111111112) * (math.pi * t_0) return angle_s * tmp
angle_m = abs(angle) angle_s = copysign(1.0, angle) function code(angle_s, a, b, angle_m) t_0 = Float64(Float64(b + a) * Float64(b - a)) tmp = 0.0 if ((a ^ 2.0) <= 4e-18) tmp = Float64(2.0 * Float64(sin(Float64(0.005555555555555556 * Float64(pi * angle_m))) * t_0)); else tmp = Float64(Float64(angle_m * 0.011111111111111112) * Float64(pi * t_0)); end return Float64(angle_s * tmp) end
angle_m = abs(angle); angle_s = sign(angle) * abs(1.0); function tmp_2 = code(angle_s, a, b, angle_m) t_0 = (b + a) * (b - a); tmp = 0.0; if ((a ^ 2.0) <= 4e-18) tmp = 2.0 * (sin((0.005555555555555556 * (pi * angle_m))) * t_0); else tmp = (angle_m * 0.011111111111111112) * (pi * t_0); end tmp_2 = angle_s * tmp; end
angle_m = N[Abs[angle], $MachinePrecision]
angle_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a_, b_, angle$95$m_] := Block[{t$95$0 = N[(N[(b + a), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision]}, N[(angle$95$s * If[LessEqual[N[Power[a, 2.0], $MachinePrecision], 4e-18], N[(2.0 * N[(N[Sin[N[(0.005555555555555556 * N[(Pi * angle$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision], N[(N[(angle$95$m * 0.011111111111111112), $MachinePrecision] * N[(Pi * t$95$0), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]]
\begin{array}{l}
angle_m = \left|angle\right|
\\
angle_s = \mathsf{copysign}\left(1, angle\right)
\\
\begin{array}{l}
t_0 := \left(b + a\right) \cdot \left(b - a\right)\\
angle_s \cdot \begin{array}{l}
\mathbf{if}\;{a}^{2} \leq 4 \cdot 10^{-18}:\\
\;\;\;\;2 \cdot \left(\sin \left(0.005555555555555556 \cdot \left(\pi \cdot angle_m\right)\right) \cdot t_0\right)\\
\mathbf{else}:\\
\;\;\;\;\left(angle_m \cdot 0.011111111111111112\right) \cdot \left(\pi \cdot t_0\right)\\
\end{array}
\end{array}
\end{array}
if (pow.f64 a 2) < 4.0000000000000003e-18Initial program 66.4%
unpow266.4%
unpow266.4%
difference-of-squares66.4%
Applied egg-rr66.4%
Taylor expanded in angle around 0 66.0%
Taylor expanded in angle around inf 66.3%
if 4.0000000000000003e-18 < (pow.f64 a 2) Initial program 45.6%
unpow245.6%
unpow245.6%
difference-of-squares51.5%
Applied egg-rr51.5%
Taylor expanded in angle around 0 53.4%
Taylor expanded in angle around 0 55.1%
associate-*r*55.2%
Simplified55.2%
Final simplification61.1%
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))))
(*
angle_s
(if (<= a 0.0013)
(* (* 2.0 t_0) (sin (/ (* PI angle_m) 180.0)))
(* (* angle_m 0.011111111111111112) (* PI 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 = (b + a) * (b - a);
double tmp;
if (a <= 0.0013) {
tmp = (2.0 * t_0) * sin(((((double) M_PI) * angle_m) / 180.0));
} else {
tmp = (angle_m * 0.011111111111111112) * (((double) M_PI) * 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 = (b + a) * (b - a);
double tmp;
if (a <= 0.0013) {
tmp = (2.0 * t_0) * Math.sin(((Math.PI * angle_m) / 180.0));
} else {
tmp = (angle_m * 0.011111111111111112) * (Math.PI * t_0);
}
return angle_s * tmp;
}
angle_m = math.fabs(angle) angle_s = math.copysign(1.0, angle) def code(angle_s, a, b, angle_m): t_0 = (b + a) * (b - a) tmp = 0 if a <= 0.0013: tmp = (2.0 * t_0) * math.sin(((math.pi * angle_m) / 180.0)) else: tmp = (angle_m * 0.011111111111111112) * (math.pi * t_0) return angle_s * tmp
angle_m = abs(angle) angle_s = copysign(1.0, angle) function code(angle_s, a, b, angle_m) t_0 = Float64(Float64(b + a) * Float64(b - a)) tmp = 0.0 if (a <= 0.0013) tmp = Float64(Float64(2.0 * t_0) * sin(Float64(Float64(pi * angle_m) / 180.0))); else tmp = Float64(Float64(angle_m * 0.011111111111111112) * Float64(pi * t_0)); end return Float64(angle_s * tmp) end
angle_m = abs(angle); angle_s = sign(angle) * abs(1.0); function tmp_2 = code(angle_s, a, b, angle_m) t_0 = (b + a) * (b - a); tmp = 0.0; if (a <= 0.0013) tmp = (2.0 * t_0) * sin(((pi * angle_m) / 180.0)); else tmp = (angle_m * 0.011111111111111112) * (pi * t_0); end tmp_2 = angle_s * tmp; end
angle_m = N[Abs[angle], $MachinePrecision]
angle_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a_, b_, angle$95$m_] := Block[{t$95$0 = N[(N[(b + a), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision]}, N[(angle$95$s * If[LessEqual[a, 0.0013], N[(N[(2.0 * t$95$0), $MachinePrecision] * N[Sin[N[(N[(Pi * angle$95$m), $MachinePrecision] / 180.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[(angle$95$m * 0.011111111111111112), $MachinePrecision] * N[(Pi * t$95$0), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]]
\begin{array}{l}
angle_m = \left|angle\right|
\\
angle_s = \mathsf{copysign}\left(1, angle\right)
\\
\begin{array}{l}
t_0 := \left(b + a\right) \cdot \left(b - a\right)\\
angle_s \cdot \begin{array}{l}
\mathbf{if}\;a \leq 0.0013:\\
\;\;\;\;\left(2 \cdot t_0\right) \cdot \sin \left(\frac{\pi \cdot angle_m}{180}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(angle_m \cdot 0.011111111111111112\right) \cdot \left(\pi \cdot t_0\right)\\
\end{array}
\end{array}
\end{array}
if a < 0.0012999999999999999Initial program 60.9%
unpow260.9%
unpow260.9%
difference-of-squares63.6%
Applied egg-rr63.6%
Taylor expanded in angle around 0 65.7%
associate-*r/64.7%
Applied egg-rr66.4%
if 0.0012999999999999999 < a Initial program 45.2%
unpow245.2%
unpow245.2%
difference-of-squares48.2%
Applied egg-rr48.2%
Taylor expanded in angle around 0 45.3%
Taylor expanded in angle around 0 50.1%
associate-*r*50.2%
Simplified50.2%
Final simplification62.0%
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))) (sin (* PI (* 0.005555555555555556 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))) * sin((((double) M_PI) * (0.005555555555555556 * 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))) * Math.sin((Math.PI * (0.005555555555555556 * 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))) * math.sin((math.pi * (0.005555555555555556 * 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))) * sin(Float64(pi * Float64(0.005555555555555556 * 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))) * sin((pi * (0.005555555555555556 * 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[Sin[N[(Pi * N[(0.005555555555555556 * angle$95$m), $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 \sin \left(\pi \cdot \left(0.005555555555555556 \cdot angle_m\right)\right)\right)
\end{array}
Initial program 56.6%
unpow256.6%
unpow256.6%
difference-of-squares59.4%
Applied egg-rr59.4%
Taylor expanded in angle around 0 60.1%
Taylor expanded in angle around inf 58.7%
associate-*r*60.6%
*-commutative60.6%
*-commutative60.6%
*-commutative60.6%
Simplified60.6%
Final simplification60.6%
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 56.6%
unpow256.6%
unpow256.6%
difference-of-squares59.4%
Applied egg-rr59.4%
Taylor expanded in angle around 0 60.1%
Taylor expanded in angle around 0 59.3%
Final simplification59.3%
angle_m = (fabs.f64 angle) angle_s = (copysign.f64 1 angle) (FPCore (angle_s a b angle_m) :precision binary64 (* angle_s (* (* angle_m 0.011111111111111112) (* 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 * ((angle_m * 0.011111111111111112) * (((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 * ((angle_m * 0.011111111111111112) * (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 * ((angle_m * 0.011111111111111112) * (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(Float64(angle_m * 0.011111111111111112) * 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 * ((angle_m * 0.011111111111111112) * (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[(N[(angle$95$m * 0.011111111111111112), $MachinePrecision] * N[(Pi * 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(\left(angle_m \cdot 0.011111111111111112\right) \cdot \left(\pi \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right)\right)
\end{array}
Initial program 56.6%
unpow256.6%
unpow256.6%
difference-of-squares59.4%
Applied egg-rr59.4%
Taylor expanded in angle around 0 60.1%
Taylor expanded in angle around 0 59.3%
associate-*r*59.4%
Simplified59.4%
Final simplification59.4%
herbie shell --seed 2023322
(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)))))