
(FPCore (a b angle) :precision binary64 (let* ((t_0 (* PI (/ angle 180.0)))) (* (* (* 2.0 (- (pow b 2.0) (pow a 2.0))) (sin t_0)) (cos t_0))))
double code(double a, double b, double angle) {
double t_0 = ((double) M_PI) * (angle / 180.0);
return ((2.0 * (pow(b, 2.0) - pow(a, 2.0))) * sin(t_0)) * cos(t_0);
}
public static double code(double a, double b, double angle) {
double t_0 = Math.PI * (angle / 180.0);
return ((2.0 * (Math.pow(b, 2.0) - Math.pow(a, 2.0))) * Math.sin(t_0)) * Math.cos(t_0);
}
def code(a, b, angle): t_0 = math.pi * (angle / 180.0) return ((2.0 * (math.pow(b, 2.0) - math.pow(a, 2.0))) * math.sin(t_0)) * math.cos(t_0)
function code(a, b, angle) t_0 = Float64(pi * Float64(angle / 180.0)) return Float64(Float64(Float64(2.0 * Float64((b ^ 2.0) - (a ^ 2.0))) * sin(t_0)) * cos(t_0)) end
function tmp = code(a, b, angle) t_0 = pi * (angle / 180.0); tmp = ((2.0 * ((b ^ 2.0) - (a ^ 2.0))) * sin(t_0)) * cos(t_0); end
code[a_, b_, angle_] := Block[{t$95$0 = N[(Pi * N[(angle / 180.0), $MachinePrecision]), $MachinePrecision]}, N[(N[(N[(2.0 * N[(N[Power[b, 2.0], $MachinePrecision] - N[Power[a, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision] * N[Cos[t$95$0], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \pi \cdot \frac{angle}{180}\\
\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin t\_0\right) \cdot \cos t\_0
\end{array}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 22 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (a b angle) :precision binary64 (let* ((t_0 (* PI (/ angle 180.0)))) (* (* (* 2.0 (- (pow b 2.0) (pow a 2.0))) (sin t_0)) (cos t_0))))
double code(double a, double b, double angle) {
double t_0 = ((double) M_PI) * (angle / 180.0);
return ((2.0 * (pow(b, 2.0) - pow(a, 2.0))) * sin(t_0)) * cos(t_0);
}
public static double code(double a, double b, double angle) {
double t_0 = Math.PI * (angle / 180.0);
return ((2.0 * (Math.pow(b, 2.0) - Math.pow(a, 2.0))) * Math.sin(t_0)) * Math.cos(t_0);
}
def code(a, b, angle): t_0 = math.pi * (angle / 180.0) return ((2.0 * (math.pow(b, 2.0) - math.pow(a, 2.0))) * math.sin(t_0)) * math.cos(t_0)
function code(a, b, angle) t_0 = Float64(pi * Float64(angle / 180.0)) return Float64(Float64(Float64(2.0 * Float64((b ^ 2.0) - (a ^ 2.0))) * sin(t_0)) * cos(t_0)) end
function tmp = code(a, b, angle) t_0 = pi * (angle / 180.0); tmp = ((2.0 * ((b ^ 2.0) - (a ^ 2.0))) * sin(t_0)) * cos(t_0); end
code[a_, b_, angle_] := Block[{t$95$0 = N[(Pi * N[(angle / 180.0), $MachinePrecision]), $MachinePrecision]}, N[(N[(N[(2.0 * N[(N[Power[b, 2.0], $MachinePrecision] - N[Power[a, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision] * N[Cos[t$95$0], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \pi \cdot \frac{angle}{180}\\
\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin t\_0\right) \cdot \cos t\_0
\end{array}
\end{array}
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a b angle_m)
:precision binary64
(let* ((t_0 (* PI (* angle_m 0.005555555555555556)))
(t_1 (- (pow b 2.0) (pow a 2.0)))
(t_2 (sin (* PI (* angle_m -0.005555555555555556))))
(t_3 (cos (expm1 (log1p t_0))))
(t_4 (* t_2 0.0)))
(*
angle_s
(if (<= t_1 -1e+293)
(* t_3 (* 2.0 (- (* a (fma a t_2 t_4)) (* (pow b 2.0) t_2))))
(if (<= t_1 INFINITY)
(*
(cos (pow E (log t_0)))
(* 2.0 (fma b (- t_4 (* b t_2)) (* (pow a 2.0) t_2))))
(*
t_3
(*
2.0
(*
(sin (* angle_m (pow (cbrt (* PI -0.005555555555555556)) 3.0)))
(* (- a b) (+ b a))))))))))angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a, double b, double angle_m) {
double t_0 = ((double) M_PI) * (angle_m * 0.005555555555555556);
double t_1 = pow(b, 2.0) - pow(a, 2.0);
double t_2 = sin((((double) M_PI) * (angle_m * -0.005555555555555556)));
double t_3 = cos(expm1(log1p(t_0)));
double t_4 = t_2 * 0.0;
double tmp;
if (t_1 <= -1e+293) {
tmp = t_3 * (2.0 * ((a * fma(a, t_2, t_4)) - (pow(b, 2.0) * t_2)));
} else if (t_1 <= ((double) INFINITY)) {
tmp = cos(pow(((double) M_E), log(t_0))) * (2.0 * fma(b, (t_4 - (b * t_2)), (pow(a, 2.0) * t_2)));
} else {
tmp = t_3 * (2.0 * (sin((angle_m * pow(cbrt((((double) M_PI) * -0.005555555555555556)), 3.0))) * ((a - b) * (b + a))));
}
return angle_s * tmp;
}
angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a, b, angle_m) t_0 = Float64(pi * Float64(angle_m * 0.005555555555555556)) t_1 = Float64((b ^ 2.0) - (a ^ 2.0)) t_2 = sin(Float64(pi * Float64(angle_m * -0.005555555555555556))) t_3 = cos(expm1(log1p(t_0))) t_4 = Float64(t_2 * 0.0) tmp = 0.0 if (t_1 <= -1e+293) tmp = Float64(t_3 * Float64(2.0 * Float64(Float64(a * fma(a, t_2, t_4)) - Float64((b ^ 2.0) * t_2)))); elseif (t_1 <= Inf) tmp = Float64(cos((exp(1) ^ log(t_0))) * Float64(2.0 * fma(b, Float64(t_4 - Float64(b * t_2)), Float64((a ^ 2.0) * t_2)))); else tmp = Float64(t_3 * Float64(2.0 * Float64(sin(Float64(angle_m * (cbrt(Float64(pi * -0.005555555555555556)) ^ 3.0))) * Float64(Float64(a - b) * Float64(b + a))))); 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[(N[Power[b, 2.0], $MachinePrecision] - N[Power[a, 2.0], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Sin[N[(Pi * N[(angle$95$m * -0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[Cos[N[(Exp[N[Log[1 + t$95$0], $MachinePrecision]] - 1), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$4 = N[(t$95$2 * 0.0), $MachinePrecision]}, N[(angle$95$s * If[LessEqual[t$95$1, -1e+293], N[(t$95$3 * N[(2.0 * N[(N[(a * N[(a * t$95$2 + t$95$4), $MachinePrecision]), $MachinePrecision] - N[(N[Power[b, 2.0], $MachinePrecision] * t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, Infinity], N[(N[Cos[N[Power[E, N[Log[t$95$0], $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * N[(2.0 * N[(b * N[(t$95$4 - N[(b * t$95$2), $MachinePrecision]), $MachinePrecision] + N[(N[Power[a, 2.0], $MachinePrecision] * t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$3 * N[(2.0 * N[(N[Sin[N[(angle$95$m * N[Power[N[Power[N[(Pi * -0.005555555555555556), $MachinePrecision], 1/3], $MachinePrecision], 3.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(N[(a - b), $MachinePrecision] * N[(b + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]]]]]]
\begin{array}{l}
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
\begin{array}{l}
t_0 := \pi \cdot \left(angle\_m \cdot 0.005555555555555556\right)\\
t_1 := {b}^{2} - {a}^{2}\\
t_2 := \sin \left(\pi \cdot \left(angle\_m \cdot -0.005555555555555556\right)\right)\\
t_3 := \cos \left(\mathsf{expm1}\left(\mathsf{log1p}\left(t\_0\right)\right)\right)\\
t_4 := t\_2 \cdot 0\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_1 \leq -1 \cdot 10^{+293}:\\
\;\;\;\;t\_3 \cdot \left(2 \cdot \left(a \cdot \mathsf{fma}\left(a, t\_2, t\_4\right) - {b}^{2} \cdot t\_2\right)\right)\\
\mathbf{elif}\;t\_1 \leq \infty:\\
\;\;\;\;\cos \left({e}^{\log t\_0}\right) \cdot \left(2 \cdot \mathsf{fma}\left(b, t\_4 - b \cdot t\_2, {a}^{2} \cdot t\_2\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_3 \cdot \left(2 \cdot \left(\sin \left(angle\_m \cdot {\left(\sqrt[3]{\pi \cdot -0.005555555555555556}\right)}^{3}\right) \cdot \left(\left(a - b\right) \cdot \left(b + a\right)\right)\right)\right)\\
\end{array}
\end{array}
\end{array}
if (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) < -9.9999999999999992e292Initial program 47.6%
Simplified49.4%
add-sqr-sqrt33.4%
sqrt-unprod45.0%
associate-*r/45.0%
associate-*r/45.0%
frac-times42.9%
*-commutative42.9%
*-commutative42.9%
metadata-eval42.9%
metadata-eval42.9%
frac-times45.0%
associate-*r/42.9%
associate-*r/40.7%
sqrt-unprod18.6%
add-sqr-sqrt47.6%
expm1-log1p-u38.5%
expm1-undefine40.7%
Applied egg-rr40.7%
expm1-define38.5%
Simplified38.5%
unpow238.5%
unpow238.5%
difference-of-squares38.5%
Applied egg-rr38.5%
Taylor expanded in a around 0 60.6%
+-commutative60.6%
mul-1-neg60.6%
unsub-neg60.6%
Simplified60.6%
if -9.9999999999999992e292 < (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) < +inf.0Initial program 58.2%
Simplified57.7%
add-sqr-sqrt28.0%
sqrt-unprod50.4%
associate-*r/51.4%
associate-*r/51.9%
frac-times52.5%
*-commutative52.5%
*-commutative52.5%
metadata-eval52.5%
metadata-eval52.5%
frac-times51.9%
associate-*r/52.0%
associate-*r/51.6%
sqrt-unprod31.0%
add-sqr-sqrt58.9%
expm1-log1p-u53.2%
expm1-undefine52.7%
Applied egg-rr52.7%
expm1-define53.2%
Simplified53.2%
unpow253.2%
unpow253.2%
difference-of-squares53.2%
Applied egg-rr53.2%
Taylor expanded in b around 0 56.9%
fma-define56.9%
+-commutative56.9%
mul-1-neg56.9%
unsub-neg56.9%
associate-*r*56.9%
distribute-rgt1-in56.9%
metadata-eval56.9%
mul0-lft56.9%
associate-*r*56.3%
Simplified56.3%
expm1-log1p-u62.8%
rem-exp-log34.1%
*-un-lft-identity34.1%
exp-prod35.7%
Applied egg-rr35.7%
if +inf.0 < (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) Initial program 0.0%
Simplified0.0%
add-sqr-sqrt0.0%
sqrt-unprod0.0%
associate-*r/0.0%
associate-*r/0.0%
frac-times0.0%
*-commutative0.0%
*-commutative0.0%
metadata-eval0.0%
metadata-eval0.0%
frac-times0.0%
associate-*r/0.0%
associate-*r/0.0%
sqrt-unprod0.0%
add-sqr-sqrt0.0%
expm1-log1p-u0.0%
expm1-undefine0.0%
Applied egg-rr0.0%
expm1-define0.0%
Simplified0.0%
unpow20.0%
unpow20.0%
difference-of-squares51.2%
Applied egg-rr51.2%
add-cube-cbrt62.3%
pow362.3%
div-inv62.3%
metadata-eval62.3%
Applied egg-rr62.3%
Final simplification42.0%
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a b angle_m)
:precision binary64
(let* ((t_0 (* PI (/ angle_m 180.0)))
(t_1 (sin (* PI (* angle_m -0.005555555555555556))))
(t_2 (* (* (* 2.0 (- (pow b 2.0) (pow a 2.0))) (sin t_0)) (cos t_0)))
(t_3 (* PI (* angle_m 0.005555555555555556)))
(t_4 (cos (expm1 (log1p t_3)))))
(*
angle_s
(if (<= t_2 5e-162)
(* t_4 (* 2.0 (- (* a (fma a t_1 (* t_1 0.0))) (* (pow b 2.0) t_1))))
(if (<= t_2 INFINITY)
(* (* 2.0 (cos t_3)) (fma (pow a 2.0) t_1 (* b (* b (- t_1)))))
(*
t_4
(*
2.0
(*
(sin (* angle_m (pow (cbrt (* PI -0.005555555555555556)) 3.0)))
(* (- a b) (+ b a))))))))))angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a, double b, double angle_m) {
double t_0 = ((double) M_PI) * (angle_m / 180.0);
double t_1 = sin((((double) M_PI) * (angle_m * -0.005555555555555556)));
double t_2 = ((2.0 * (pow(b, 2.0) - pow(a, 2.0))) * sin(t_0)) * cos(t_0);
double t_3 = ((double) M_PI) * (angle_m * 0.005555555555555556);
double t_4 = cos(expm1(log1p(t_3)));
double tmp;
if (t_2 <= 5e-162) {
tmp = t_4 * (2.0 * ((a * fma(a, t_1, (t_1 * 0.0))) - (pow(b, 2.0) * t_1)));
} else if (t_2 <= ((double) INFINITY)) {
tmp = (2.0 * cos(t_3)) * fma(pow(a, 2.0), t_1, (b * (b * -t_1)));
} else {
tmp = t_4 * (2.0 * (sin((angle_m * pow(cbrt((((double) M_PI) * -0.005555555555555556)), 3.0))) * ((a - b) * (b + a))));
}
return angle_s * tmp;
}
angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a, b, angle_m) t_0 = Float64(pi * Float64(angle_m / 180.0)) t_1 = sin(Float64(pi * Float64(angle_m * -0.005555555555555556))) t_2 = Float64(Float64(Float64(2.0 * Float64((b ^ 2.0) - (a ^ 2.0))) * sin(t_0)) * cos(t_0)) t_3 = Float64(pi * Float64(angle_m * 0.005555555555555556)) t_4 = cos(expm1(log1p(t_3))) tmp = 0.0 if (t_2 <= 5e-162) tmp = Float64(t_4 * Float64(2.0 * Float64(Float64(a * fma(a, t_1, Float64(t_1 * 0.0))) - Float64((b ^ 2.0) * t_1)))); elseif (t_2 <= Inf) tmp = Float64(Float64(2.0 * cos(t_3)) * fma((a ^ 2.0), t_1, Float64(b * Float64(b * Float64(-t_1))))); else tmp = Float64(t_4 * Float64(2.0 * Float64(sin(Float64(angle_m * (cbrt(Float64(pi * -0.005555555555555556)) ^ 3.0))) * Float64(Float64(a - b) * Float64(b + a))))); 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 / 180.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Sin[N[(Pi * N[(angle$95$m * -0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = 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]}, Block[{t$95$3 = N[(Pi * N[(angle$95$m * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[Cos[N[(Exp[N[Log[1 + t$95$3], $MachinePrecision]] - 1), $MachinePrecision]], $MachinePrecision]}, N[(angle$95$s * If[LessEqual[t$95$2, 5e-162], N[(t$95$4 * N[(2.0 * N[(N[(a * N[(a * t$95$1 + N[(t$95$1 * 0.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[Power[b, 2.0], $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, Infinity], N[(N[(2.0 * N[Cos[t$95$3], $MachinePrecision]), $MachinePrecision] * N[(N[Power[a, 2.0], $MachinePrecision] * t$95$1 + N[(b * N[(b * (-t$95$1)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$4 * N[(2.0 * N[(N[Sin[N[(angle$95$m * N[Power[N[Power[N[(Pi * -0.005555555555555556), $MachinePrecision], 1/3], $MachinePrecision], 3.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(N[(a - b), $MachinePrecision] * N[(b + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]]]]]]
\begin{array}{l}
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
\begin{array}{l}
t_0 := \pi \cdot \frac{angle\_m}{180}\\
t_1 := \sin \left(\pi \cdot \left(angle\_m \cdot -0.005555555555555556\right)\right)\\
t_2 := \left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin t\_0\right) \cdot \cos t\_0\\
t_3 := \pi \cdot \left(angle\_m \cdot 0.005555555555555556\right)\\
t_4 := \cos \left(\mathsf{expm1}\left(\mathsf{log1p}\left(t\_3\right)\right)\right)\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_2 \leq 5 \cdot 10^{-162}:\\
\;\;\;\;t\_4 \cdot \left(2 \cdot \left(a \cdot \mathsf{fma}\left(a, t\_1, t\_1 \cdot 0\right) - {b}^{2} \cdot t\_1\right)\right)\\
\mathbf{elif}\;t\_2 \leq \infty:\\
\;\;\;\;\left(2 \cdot \cos t\_3\right) \cdot \mathsf{fma}\left({a}^{2}, t\_1, b \cdot \left(b \cdot \left(-t\_1\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_4 \cdot \left(2 \cdot \left(\sin \left(angle\_m \cdot {\left(\sqrt[3]{\pi \cdot -0.005555555555555556}\right)}^{3}\right) \cdot \left(\left(a - b\right) \cdot \left(b + a\right)\right)\right)\right)\\
\end{array}
\end{array}
\end{array}
if (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64)))) (sin.f64 (*.f64 (PI.f64) (/.f64 angle #s(literal 180 binary64))))) (cos.f64 (*.f64 (PI.f64) (/.f64 angle #s(literal 180 binary64))))) < 5.00000000000000014e-162Initial program 58.5%
Simplified58.2%
add-sqr-sqrt31.4%
sqrt-unprod53.5%
associate-*r/54.8%
associate-*r/54.8%
frac-times54.8%
*-commutative54.8%
*-commutative54.8%
metadata-eval54.8%
metadata-eval54.8%
frac-times54.8%
associate-*r/54.2%
associate-*r/53.0%
sqrt-unprod30.6%
add-sqr-sqrt59.2%
expm1-log1p-u56.0%
expm1-undefine55.2%
Applied egg-rr55.2%
expm1-define56.0%
Simplified56.0%
unpow256.0%
unpow256.0%
difference-of-squares56.0%
Applied egg-rr56.0%
Taylor expanded in a around 0 58.2%
+-commutative58.2%
mul-1-neg58.2%
unsub-neg58.2%
Simplified58.5%
if 5.00000000000000014e-162 < (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64)))) (sin.f64 (*.f64 (PI.f64) (/.f64 angle #s(literal 180 binary64))))) (cos.f64 (*.f64 (PI.f64) (/.f64 angle #s(literal 180 binary64))))) < +inf.0Initial program 52.9%
Simplified53.1%
add-sqr-sqrt25.7%
sqrt-unprod43.6%
associate-*r/43.6%
associate-*r/44.6%
frac-times44.7%
*-commutative44.7%
*-commutative44.7%
metadata-eval44.7%
metadata-eval44.7%
frac-times44.6%
associate-*r/44.6%
associate-*r/44.6%
sqrt-unprod25.8%
add-sqr-sqrt53.2%
expm1-log1p-u42.4%
expm1-undefine43.4%
Applied egg-rr43.4%
expm1-define42.4%
Simplified42.4%
unpow242.4%
unpow242.4%
difference-of-squares42.4%
Applied egg-rr42.4%
Taylor expanded in b around 0 46.2%
fma-define46.2%
+-commutative46.2%
mul-1-neg46.2%
unsub-neg46.2%
associate-*r*46.2%
distribute-rgt1-in46.2%
metadata-eval46.2%
mul0-lft46.2%
associate-*r*45.9%
Simplified44.8%
pow144.8%
Applied egg-rr56.3%
unpow156.3%
*-commutative56.3%
fma-define56.3%
+-commutative56.3%
distribute-rgt-neg-out56.3%
unsub-neg56.3%
*-commutative56.3%
*-commutative56.3%
fmm-def56.3%
Simplified56.0%
if +inf.0 < (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64)))) (sin.f64 (*.f64 (PI.f64) (/.f64 angle #s(literal 180 binary64))))) (cos.f64 (*.f64 (PI.f64) (/.f64 angle #s(literal 180 binary64))))) Initial program 0.0%
Simplified0.0%
add-sqr-sqrt0.0%
sqrt-unprod0.0%
associate-*r/0.0%
associate-*r/0.0%
frac-times0.0%
*-commutative0.0%
*-commutative0.0%
metadata-eval0.0%
metadata-eval0.0%
frac-times0.0%
associate-*r/0.0%
associate-*r/0.0%
sqrt-unprod0.0%
add-sqr-sqrt0.0%
expm1-log1p-u0.0%
expm1-undefine0.0%
Applied egg-rr0.0%
expm1-define0.0%
Simplified0.0%
unpow20.0%
unpow20.0%
difference-of-squares51.2%
Applied egg-rr51.2%
add-cube-cbrt62.3%
pow362.3%
div-inv62.3%
metadata-eval62.3%
Applied egg-rr62.3%
Final simplification57.8%
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a b angle_m)
:precision binary64
(let* ((t_0 (- (pow b 2.0) (pow a 2.0)))
(t_1 (* 2.0 (* (* (- a b) (+ b a)) (sin (* angle_m (/ PI -180.0)))))))
(*
angle_s
(if (<= t_0 (- INFINITY))
(* (* a 0.011111111111111112) (* (* PI angle_m) (- b a)))
(if (<= t_0 5e+214)
(* t_1 (cos (* angle_m (* PI (cbrt 1.7146776406035666e-7)))))
(if (<= t_0 INFINITY)
(*
0.011111111111111112
(-
(* b (+ (* angle_m (* PI (- a a))) (* angle_m (* b PI))))
(* (pow a 2.0) (* 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 = pow(b, 2.0) - pow(a, 2.0);
double t_1 = 2.0 * (((a - b) * (b + a)) * sin((angle_m * (((double) M_PI) / -180.0))));
double tmp;
if (t_0 <= -((double) INFINITY)) {
tmp = (a * 0.011111111111111112) * ((((double) M_PI) * angle_m) * (b - a));
} else if (t_0 <= 5e+214) {
tmp = t_1 * cos((angle_m * (((double) M_PI) * cbrt(1.7146776406035666e-7))));
} else if (t_0 <= ((double) INFINITY)) {
tmp = 0.011111111111111112 * ((b * ((angle_m * (((double) M_PI) * (a - a))) + (angle_m * (b * ((double) M_PI))))) - (pow(a, 2.0) * (((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 = Math.pow(b, 2.0) - Math.pow(a, 2.0);
double t_1 = 2.0 * (((a - b) * (b + a)) * Math.sin((angle_m * (Math.PI / -180.0))));
double tmp;
if (t_0 <= -Double.POSITIVE_INFINITY) {
tmp = (a * 0.011111111111111112) * ((Math.PI * angle_m) * (b - a));
} else if (t_0 <= 5e+214) {
tmp = t_1 * Math.cos((angle_m * (Math.PI * Math.cbrt(1.7146776406035666e-7))));
} else if (t_0 <= Double.POSITIVE_INFINITY) {
tmp = 0.011111111111111112 * ((b * ((angle_m * (Math.PI * (a - a))) + (angle_m * (b * Math.PI)))) - (Math.pow(a, 2.0) * (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((b ^ 2.0) - (a ^ 2.0)) t_1 = Float64(2.0 * Float64(Float64(Float64(a - b) * Float64(b + a)) * sin(Float64(angle_m * Float64(pi / -180.0))))) tmp = 0.0 if (t_0 <= Float64(-Inf)) tmp = Float64(Float64(a * 0.011111111111111112) * Float64(Float64(pi * angle_m) * Float64(b - a))); elseif (t_0 <= 5e+214) tmp = Float64(t_1 * cos(Float64(angle_m * Float64(pi * cbrt(1.7146776406035666e-7))))); elseif (t_0 <= Inf) tmp = Float64(0.011111111111111112 * Float64(Float64(b * Float64(Float64(angle_m * Float64(pi * Float64(a - a))) + Float64(angle_m * Float64(b * pi)))) - Float64((a ^ 2.0) * Float64(pi * angle_m)))); else tmp = 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[(N[Power[b, 2.0], $MachinePrecision] - N[Power[a, 2.0], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(2.0 * N[(N[(N[(a - b), $MachinePrecision] * N[(b + a), $MachinePrecision]), $MachinePrecision] * N[Sin[N[(angle$95$m * N[(Pi / -180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, N[(angle$95$s * If[LessEqual[t$95$0, (-Infinity)], N[(N[(a * 0.011111111111111112), $MachinePrecision] * N[(N[(Pi * angle$95$m), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 5e+214], N[(t$95$1 * N[Cos[N[(angle$95$m * N[(Pi * N[Power[1.7146776406035666e-7, 1/3], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, Infinity], N[(0.011111111111111112 * N[(N[(b * N[(N[(angle$95$m * N[(Pi * N[(a - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(angle$95$m * N[(b * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[Power[a, 2.0], $MachinePrecision] * N[(Pi * angle$95$m), $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 := {b}^{2} - {a}^{2}\\
t_1 := 2 \cdot \left(\left(\left(a - b\right) \cdot \left(b + a\right)\right) \cdot \sin \left(angle\_m \cdot \frac{\pi}{-180}\right)\right)\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_0 \leq -\infty:\\
\;\;\;\;\left(a \cdot 0.011111111111111112\right) \cdot \left(\left(\pi \cdot angle\_m\right) \cdot \left(b - a\right)\right)\\
\mathbf{elif}\;t\_0 \leq 5 \cdot 10^{+214}:\\
\;\;\;\;t\_1 \cdot \cos \left(angle\_m \cdot \left(\pi \cdot \sqrt[3]{1.7146776406035666 \cdot 10^{-7}}\right)\right)\\
\mathbf{elif}\;t\_0 \leq \infty:\\
\;\;\;\;0.011111111111111112 \cdot \left(b \cdot \left(angle\_m \cdot \left(\pi \cdot \left(a - a\right)\right) + angle\_m \cdot \left(b \cdot \pi\right)\right) - {a}^{2} \cdot \left(\pi \cdot angle\_m\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
\end{array}
if (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) < -inf.0Initial program 45.9%
associate-*l*45.9%
*-commutative45.9%
associate-*l*45.9%
Simplified45.9%
Taylor expanded in angle around 0 52.9%
unpow252.9%
unpow252.9%
difference-of-squares52.9%
Applied egg-rr52.9%
Taylor expanded in b around 0 52.9%
Taylor expanded in angle around 0 74.1%
associate-*r*74.3%
associate-*r*74.3%
Simplified74.3%
if -inf.0 < (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) < 4.99999999999999953e214Initial program 61.0%
Simplified60.9%
add-sqr-sqrt28.5%
sqrt-unprod56.5%
associate-*r/56.3%
associate-*r/56.3%
frac-times56.5%
*-commutative56.5%
*-commutative56.5%
metadata-eval56.5%
metadata-eval56.5%
frac-times56.3%
associate-*r/56.4%
associate-*r/56.7%
sqrt-unprod32.3%
add-sqr-sqrt61.3%
expm1-log1p-u54.7%
expm1-undefine54.7%
Applied egg-rr54.7%
expm1-define54.7%
Simplified54.7%
unpow254.7%
unpow254.7%
difference-of-squares54.7%
Applied egg-rr54.7%
add-cbrt-cube53.3%
pow1/345.4%
expm1-log1p-u45.2%
expm1-log1p-u44.8%
expm1-log1p-u45.0%
pow345.0%
Applied egg-rr45.0%
Taylor expanded in angle around inf 61.6%
if 4.99999999999999953e214 < (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) < +inf.0Initial program 52.6%
associate-*l*52.6%
*-commutative52.6%
associate-*l*52.6%
Simplified52.6%
Taylor expanded in angle around 0 61.2%
unpow261.2%
unpow261.2%
difference-of-squares61.2%
Applied egg-rr61.2%
Taylor expanded in b around 0 70.3%
if +inf.0 < (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) Initial program 0.0%
Simplified0.0%
add-sqr-sqrt0.0%
sqrt-unprod0.0%
associate-*r/0.0%
associate-*r/0.0%
frac-times0.0%
*-commutative0.0%
*-commutative0.0%
metadata-eval0.0%
metadata-eval0.0%
frac-times0.0%
associate-*r/0.0%
associate-*r/0.0%
sqrt-unprod0.0%
add-sqr-sqrt0.0%
expm1-log1p-u0.0%
expm1-undefine0.0%
Applied egg-rr0.0%
expm1-define0.0%
Simplified0.0%
unpow20.0%
unpow20.0%
difference-of-squares51.2%
Applied egg-rr51.2%
Taylor expanded in angle around 0 62.3%
Final simplification65.8%
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a b angle_m)
:precision binary64
(let* ((t_0 (* 2.0 (* (* (- a b) (+ b a)) (sin (* angle_m (/ PI -180.0))))))
(t_1 (- (pow b 2.0) (pow a 2.0))))
(*
angle_s
(if (<= t_1 (- INFINITY))
(* (* a 0.011111111111111112) (* (* PI angle_m) (- b a)))
(if (<= t_1 5e+214)
(* (cos (* PI (* angle_m 0.005555555555555556))) t_0)
(if (<= t_1 INFINITY)
(*
0.011111111111111112
(-
(* b (+ (* angle_m (* PI (- a a))) (* angle_m (* b PI))))
(* (pow a 2.0) (* PI angle_m))))
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 = 2.0 * (((a - b) * (b + a)) * sin((angle_m * (((double) M_PI) / -180.0))));
double t_1 = pow(b, 2.0) - pow(a, 2.0);
double tmp;
if (t_1 <= -((double) INFINITY)) {
tmp = (a * 0.011111111111111112) * ((((double) M_PI) * angle_m) * (b - a));
} else if (t_1 <= 5e+214) {
tmp = cos((((double) M_PI) * (angle_m * 0.005555555555555556))) * t_0;
} else if (t_1 <= ((double) INFINITY)) {
tmp = 0.011111111111111112 * ((b * ((angle_m * (((double) M_PI) * (a - a))) + (angle_m * (b * ((double) M_PI))))) - (pow(a, 2.0) * (((double) M_PI) * angle_m)));
} else {
tmp = 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 = 2.0 * (((a - b) * (b + a)) * Math.sin((angle_m * (Math.PI / -180.0))));
double t_1 = Math.pow(b, 2.0) - Math.pow(a, 2.0);
double tmp;
if (t_1 <= -Double.POSITIVE_INFINITY) {
tmp = (a * 0.011111111111111112) * ((Math.PI * angle_m) * (b - a));
} else if (t_1 <= 5e+214) {
tmp = Math.cos((Math.PI * (angle_m * 0.005555555555555556))) * t_0;
} else if (t_1 <= Double.POSITIVE_INFINITY) {
tmp = 0.011111111111111112 * ((b * ((angle_m * (Math.PI * (a - a))) + (angle_m * (b * Math.PI)))) - (Math.pow(a, 2.0) * (Math.PI * angle_m)));
} else {
tmp = 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 = 2.0 * (((a - b) * (b + a)) * math.sin((angle_m * (math.pi / -180.0)))) t_1 = math.pow(b, 2.0) - math.pow(a, 2.0) tmp = 0 if t_1 <= -math.inf: tmp = (a * 0.011111111111111112) * ((math.pi * angle_m) * (b - a)) elif t_1 <= 5e+214: tmp = math.cos((math.pi * (angle_m * 0.005555555555555556))) * t_0 elif t_1 <= math.inf: tmp = 0.011111111111111112 * ((b * ((angle_m * (math.pi * (a - a))) + (angle_m * (b * math.pi)))) - (math.pow(a, 2.0) * (math.pi * angle_m))) else: tmp = 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(2.0 * Float64(Float64(Float64(a - b) * Float64(b + a)) * sin(Float64(angle_m * Float64(pi / -180.0))))) t_1 = Float64((b ^ 2.0) - (a ^ 2.0)) tmp = 0.0 if (t_1 <= Float64(-Inf)) tmp = Float64(Float64(a * 0.011111111111111112) * Float64(Float64(pi * angle_m) * Float64(b - a))); elseif (t_1 <= 5e+214) tmp = Float64(cos(Float64(pi * Float64(angle_m * 0.005555555555555556))) * t_0); elseif (t_1 <= Inf) tmp = Float64(0.011111111111111112 * Float64(Float64(b * Float64(Float64(angle_m * Float64(pi * Float64(a - a))) + Float64(angle_m * Float64(b * pi)))) - Float64((a ^ 2.0) * Float64(pi * angle_m)))); else tmp = 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 = 2.0 * (((a - b) * (b + a)) * sin((angle_m * (pi / -180.0)))); t_1 = (b ^ 2.0) - (a ^ 2.0); tmp = 0.0; if (t_1 <= -Inf) tmp = (a * 0.011111111111111112) * ((pi * angle_m) * (b - a)); elseif (t_1 <= 5e+214) tmp = cos((pi * (angle_m * 0.005555555555555556))) * t_0; elseif (t_1 <= Inf) tmp = 0.011111111111111112 * ((b * ((angle_m * (pi * (a - a))) + (angle_m * (b * pi)))) - ((a ^ 2.0) * (pi * angle_m))); else tmp = 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[(2.0 * N[(N[(N[(a - b), $MachinePrecision] * N[(b + a), $MachinePrecision]), $MachinePrecision] * N[Sin[N[(angle$95$m * N[(Pi / -180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[Power[b, 2.0], $MachinePrecision] - N[Power[a, 2.0], $MachinePrecision]), $MachinePrecision]}, N[(angle$95$s * If[LessEqual[t$95$1, (-Infinity)], N[(N[(a * 0.011111111111111112), $MachinePrecision] * N[(N[(Pi * angle$95$m), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 5e+214], N[(N[Cos[N[(Pi * N[(angle$95$m * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * t$95$0), $MachinePrecision], If[LessEqual[t$95$1, Infinity], N[(0.011111111111111112 * N[(N[(b * N[(N[(angle$95$m * N[(Pi * N[(a - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(angle$95$m * N[(b * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[Power[a, 2.0], $MachinePrecision] * N[(Pi * angle$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]), $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(\left(a - b\right) \cdot \left(b + a\right)\right) \cdot \sin \left(angle\_m \cdot \frac{\pi}{-180}\right)\right)\\
t_1 := {b}^{2} - {a}^{2}\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_1 \leq -\infty:\\
\;\;\;\;\left(a \cdot 0.011111111111111112\right) \cdot \left(\left(\pi \cdot angle\_m\right) \cdot \left(b - a\right)\right)\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+214}:\\
\;\;\;\;\cos \left(\pi \cdot \left(angle\_m \cdot 0.005555555555555556\right)\right) \cdot t\_0\\
\mathbf{elif}\;t\_1 \leq \infty:\\
\;\;\;\;0.011111111111111112 \cdot \left(b \cdot \left(angle\_m \cdot \left(\pi \cdot \left(a - a\right)\right) + angle\_m \cdot \left(b \cdot \pi\right)\right) - {a}^{2} \cdot \left(\pi \cdot angle\_m\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
\end{array}
if (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) < -inf.0Initial program 45.9%
associate-*l*45.9%
*-commutative45.9%
associate-*l*45.9%
Simplified45.9%
Taylor expanded in angle around 0 52.9%
unpow252.9%
unpow252.9%
difference-of-squares52.9%
Applied egg-rr52.9%
Taylor expanded in b around 0 52.9%
Taylor expanded in angle around 0 74.1%
associate-*r*74.3%
associate-*r*74.3%
Simplified74.3%
if -inf.0 < (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) < 4.99999999999999953e214Initial program 61.0%
Simplified60.9%
add-sqr-sqrt28.5%
sqrt-unprod56.5%
associate-*r/56.3%
associate-*r/56.3%
frac-times56.5%
*-commutative56.5%
*-commutative56.5%
metadata-eval56.5%
metadata-eval56.5%
frac-times56.3%
associate-*r/56.4%
associate-*r/56.7%
sqrt-unprod32.3%
add-sqr-sqrt61.3%
expm1-log1p-u54.7%
expm1-undefine54.7%
Applied egg-rr54.7%
expm1-define54.7%
Simplified54.7%
unpow254.7%
unpow254.7%
difference-of-squares54.7%
Applied egg-rr54.7%
expm1-log1p-u61.4%
*-commutative61.4%
Applied egg-rr61.4%
if 4.99999999999999953e214 < (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) < +inf.0Initial program 52.6%
associate-*l*52.6%
*-commutative52.6%
associate-*l*52.6%
Simplified52.6%
Taylor expanded in angle around 0 61.2%
unpow261.2%
unpow261.2%
difference-of-squares61.2%
Applied egg-rr61.2%
Taylor expanded in b around 0 70.3%
if +inf.0 < (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) Initial program 0.0%
Simplified0.0%
add-sqr-sqrt0.0%
sqrt-unprod0.0%
associate-*r/0.0%
associate-*r/0.0%
frac-times0.0%
*-commutative0.0%
*-commutative0.0%
metadata-eval0.0%
metadata-eval0.0%
frac-times0.0%
associate-*r/0.0%
associate-*r/0.0%
sqrt-unprod0.0%
add-sqr-sqrt0.0%
expm1-log1p-u0.0%
expm1-undefine0.0%
Applied egg-rr0.0%
expm1-define0.0%
Simplified0.0%
unpow20.0%
unpow20.0%
difference-of-squares51.2%
Applied egg-rr51.2%
Taylor expanded in angle around 0 62.3%
Final simplification65.7%
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a b angle_m)
:precision binary64
(let* ((t_0 (* angle_m (/ PI -180.0)))
(t_1 (- (pow b 2.0) (pow a 2.0)))
(t_2 (* 2.0 (* (* (- a b) (+ b a)) (sin t_0)))))
(*
angle_s
(if (<= t_1 (- INFINITY))
(* (* a 0.011111111111111112) (* (* PI angle_m) (- b a)))
(if (<= t_1 5e+214)
(* t_2 (cos t_0))
(if (<= t_1 INFINITY)
(*
0.011111111111111112
(-
(* b (+ (* angle_m (* PI (- a a))) (* angle_m (* b PI))))
(* (pow a 2.0) (* PI angle_m))))
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 = angle_m * (((double) M_PI) / -180.0);
double t_1 = pow(b, 2.0) - pow(a, 2.0);
double t_2 = 2.0 * (((a - b) * (b + a)) * sin(t_0));
double tmp;
if (t_1 <= -((double) INFINITY)) {
tmp = (a * 0.011111111111111112) * ((((double) M_PI) * angle_m) * (b - a));
} else if (t_1 <= 5e+214) {
tmp = t_2 * cos(t_0);
} else if (t_1 <= ((double) INFINITY)) {
tmp = 0.011111111111111112 * ((b * ((angle_m * (((double) M_PI) * (a - a))) + (angle_m * (b * ((double) M_PI))))) - (pow(a, 2.0) * (((double) M_PI) * angle_m)));
} else {
tmp = 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 = angle_m * (Math.PI / -180.0);
double t_1 = Math.pow(b, 2.0) - Math.pow(a, 2.0);
double t_2 = 2.0 * (((a - b) * (b + a)) * Math.sin(t_0));
double tmp;
if (t_1 <= -Double.POSITIVE_INFINITY) {
tmp = (a * 0.011111111111111112) * ((Math.PI * angle_m) * (b - a));
} else if (t_1 <= 5e+214) {
tmp = t_2 * Math.cos(t_0);
} else if (t_1 <= Double.POSITIVE_INFINITY) {
tmp = 0.011111111111111112 * ((b * ((angle_m * (Math.PI * (a - a))) + (angle_m * (b * Math.PI)))) - (Math.pow(a, 2.0) * (Math.PI * angle_m)));
} else {
tmp = 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 = angle_m * (math.pi / -180.0) t_1 = math.pow(b, 2.0) - math.pow(a, 2.0) t_2 = 2.0 * (((a - b) * (b + a)) * math.sin(t_0)) tmp = 0 if t_1 <= -math.inf: tmp = (a * 0.011111111111111112) * ((math.pi * angle_m) * (b - a)) elif t_1 <= 5e+214: tmp = t_2 * math.cos(t_0) elif t_1 <= math.inf: tmp = 0.011111111111111112 * ((b * ((angle_m * (math.pi * (a - a))) + (angle_m * (b * math.pi)))) - (math.pow(a, 2.0) * (math.pi * angle_m))) else: tmp = 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(angle_m * Float64(pi / -180.0)) t_1 = Float64((b ^ 2.0) - (a ^ 2.0)) t_2 = Float64(2.0 * Float64(Float64(Float64(a - b) * Float64(b + a)) * sin(t_0))) tmp = 0.0 if (t_1 <= Float64(-Inf)) tmp = Float64(Float64(a * 0.011111111111111112) * Float64(Float64(pi * angle_m) * Float64(b - a))); elseif (t_1 <= 5e+214) tmp = Float64(t_2 * cos(t_0)); elseif (t_1 <= Inf) tmp = Float64(0.011111111111111112 * Float64(Float64(b * Float64(Float64(angle_m * Float64(pi * Float64(a - a))) + Float64(angle_m * Float64(b * pi)))) - Float64((a ^ 2.0) * Float64(pi * angle_m)))); else tmp = 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 = angle_m * (pi / -180.0); t_1 = (b ^ 2.0) - (a ^ 2.0); t_2 = 2.0 * (((a - b) * (b + a)) * sin(t_0)); tmp = 0.0; if (t_1 <= -Inf) tmp = (a * 0.011111111111111112) * ((pi * angle_m) * (b - a)); elseif (t_1 <= 5e+214) tmp = t_2 * cos(t_0); elseif (t_1 <= Inf) tmp = 0.011111111111111112 * ((b * ((angle_m * (pi * (a - a))) + (angle_m * (b * pi)))) - ((a ^ 2.0) * (pi * angle_m))); else tmp = 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[(angle$95$m * N[(Pi / -180.0), $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[(2.0 * N[(N[(N[(a - b), $MachinePrecision] * N[(b + a), $MachinePrecision]), $MachinePrecision] * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, N[(angle$95$s * If[LessEqual[t$95$1, (-Infinity)], N[(N[(a * 0.011111111111111112), $MachinePrecision] * N[(N[(Pi * angle$95$m), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 5e+214], N[(t$95$2 * N[Cos[t$95$0], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, Infinity], N[(0.011111111111111112 * N[(N[(b * N[(N[(angle$95$m * N[(Pi * N[(a - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(angle$95$m * N[(b * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[Power[a, 2.0], $MachinePrecision] * N[(Pi * angle$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$2]]]), $MachinePrecision]]]]
\begin{array}{l}
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
\begin{array}{l}
t_0 := angle\_m \cdot \frac{\pi}{-180}\\
t_1 := {b}^{2} - {a}^{2}\\
t_2 := 2 \cdot \left(\left(\left(a - b\right) \cdot \left(b + a\right)\right) \cdot \sin t\_0\right)\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_1 \leq -\infty:\\
\;\;\;\;\left(a \cdot 0.011111111111111112\right) \cdot \left(\left(\pi \cdot angle\_m\right) \cdot \left(b - a\right)\right)\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+214}:\\
\;\;\;\;t\_2 \cdot \cos t\_0\\
\mathbf{elif}\;t\_1 \leq \infty:\\
\;\;\;\;0.011111111111111112 \cdot \left(b \cdot \left(angle\_m \cdot \left(\pi \cdot \left(a - a\right)\right) + angle\_m \cdot \left(b \cdot \pi\right)\right) - {a}^{2} \cdot \left(\pi \cdot angle\_m\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
\end{array}
if (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) < -inf.0Initial program 45.9%
associate-*l*45.9%
*-commutative45.9%
associate-*l*45.9%
Simplified45.9%
Taylor expanded in angle around 0 52.9%
unpow252.9%
unpow252.9%
difference-of-squares52.9%
Applied egg-rr52.9%
Taylor expanded in b around 0 52.9%
Taylor expanded in angle around 0 74.1%
associate-*r*74.3%
associate-*r*74.3%
Simplified74.3%
if -inf.0 < (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) < 4.99999999999999953e214Initial program 61.0%
Simplified60.9%
unpow254.7%
unpow254.7%
difference-of-squares54.7%
Applied egg-rr60.9%
if 4.99999999999999953e214 < (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) < +inf.0Initial program 52.6%
associate-*l*52.6%
*-commutative52.6%
associate-*l*52.6%
Simplified52.6%
Taylor expanded in angle around 0 61.2%
unpow261.2%
unpow261.2%
difference-of-squares61.2%
Applied egg-rr61.2%
Taylor expanded in b around 0 70.3%
if +inf.0 < (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) Initial program 0.0%
Simplified0.0%
add-sqr-sqrt0.0%
sqrt-unprod0.0%
associate-*r/0.0%
associate-*r/0.0%
frac-times0.0%
*-commutative0.0%
*-commutative0.0%
metadata-eval0.0%
metadata-eval0.0%
frac-times0.0%
associate-*r/0.0%
associate-*r/0.0%
sqrt-unprod0.0%
add-sqr-sqrt0.0%
expm1-log1p-u0.0%
expm1-undefine0.0%
Applied egg-rr0.0%
expm1-define0.0%
Simplified0.0%
unpow20.0%
unpow20.0%
difference-of-squares51.2%
Applied egg-rr51.2%
Taylor expanded in angle around 0 62.3%
Final simplification65.5%
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a b angle_m)
:precision binary64
(let* ((t_0 (- (pow b 2.0) (pow a 2.0))) (t_1 (* (- a b) (+ b a))))
(*
angle_s
(if (<= t_0 (- INFINITY))
(* (* a 0.011111111111111112) (* (* PI angle_m) (- b a)))
(if (<= t_0 5e+214)
(*
2.0
(*
(* t_1 (sin (* -0.005555555555555556 (* PI angle_m))))
(cos (* 0.005555555555555556 (* PI angle_m)))))
(if (<= t_0 INFINITY)
(*
0.011111111111111112
(-
(* b (+ (* angle_m (* PI (- a a))) (* angle_m (* b PI))))
(* (pow a 2.0) (* PI angle_m))))
(* 2.0 (* t_1 (sin (* angle_m (/ PI -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 t_0 = pow(b, 2.0) - pow(a, 2.0);
double t_1 = (a - b) * (b + a);
double tmp;
if (t_0 <= -((double) INFINITY)) {
tmp = (a * 0.011111111111111112) * ((((double) M_PI) * angle_m) * (b - a));
} else if (t_0 <= 5e+214) {
tmp = 2.0 * ((t_1 * sin((-0.005555555555555556 * (((double) M_PI) * angle_m)))) * cos((0.005555555555555556 * (((double) M_PI) * angle_m))));
} else if (t_0 <= ((double) INFINITY)) {
tmp = 0.011111111111111112 * ((b * ((angle_m * (((double) M_PI) * (a - a))) + (angle_m * (b * ((double) M_PI))))) - (pow(a, 2.0) * (((double) M_PI) * angle_m)));
} else {
tmp = 2.0 * (t_1 * sin((angle_m * (((double) M_PI) / -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 t_0 = Math.pow(b, 2.0) - Math.pow(a, 2.0);
double t_1 = (a - b) * (b + a);
double tmp;
if (t_0 <= -Double.POSITIVE_INFINITY) {
tmp = (a * 0.011111111111111112) * ((Math.PI * angle_m) * (b - a));
} else if (t_0 <= 5e+214) {
tmp = 2.0 * ((t_1 * Math.sin((-0.005555555555555556 * (Math.PI * angle_m)))) * Math.cos((0.005555555555555556 * (Math.PI * angle_m))));
} else if (t_0 <= Double.POSITIVE_INFINITY) {
tmp = 0.011111111111111112 * ((b * ((angle_m * (Math.PI * (a - a))) + (angle_m * (b * Math.PI)))) - (Math.pow(a, 2.0) * (Math.PI * angle_m)));
} else {
tmp = 2.0 * (t_1 * Math.sin((angle_m * (Math.PI / -180.0))));
}
return angle_s * tmp;
}
angle\_m = math.fabs(angle) angle\_s = math.copysign(1.0, angle) def code(angle_s, a, b, angle_m): t_0 = math.pow(b, 2.0) - math.pow(a, 2.0) t_1 = (a - b) * (b + a) tmp = 0 if t_0 <= -math.inf: tmp = (a * 0.011111111111111112) * ((math.pi * angle_m) * (b - a)) elif t_0 <= 5e+214: tmp = 2.0 * ((t_1 * math.sin((-0.005555555555555556 * (math.pi * angle_m)))) * math.cos((0.005555555555555556 * (math.pi * angle_m)))) elif t_0 <= math.inf: tmp = 0.011111111111111112 * ((b * ((angle_m * (math.pi * (a - a))) + (angle_m * (b * math.pi)))) - (math.pow(a, 2.0) * (math.pi * angle_m))) else: tmp = 2.0 * (t_1 * math.sin((angle_m * (math.pi / -180.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((b ^ 2.0) - (a ^ 2.0)) t_1 = Float64(Float64(a - b) * Float64(b + a)) tmp = 0.0 if (t_0 <= Float64(-Inf)) tmp = Float64(Float64(a * 0.011111111111111112) * Float64(Float64(pi * angle_m) * Float64(b - a))); elseif (t_0 <= 5e+214) tmp = Float64(2.0 * Float64(Float64(t_1 * sin(Float64(-0.005555555555555556 * Float64(pi * angle_m)))) * cos(Float64(0.005555555555555556 * Float64(pi * angle_m))))); elseif (t_0 <= Inf) tmp = Float64(0.011111111111111112 * Float64(Float64(b * Float64(Float64(angle_m * Float64(pi * Float64(a - a))) + Float64(angle_m * Float64(b * pi)))) - Float64((a ^ 2.0) * Float64(pi * angle_m)))); else tmp = Float64(2.0 * Float64(t_1 * sin(Float64(angle_m * Float64(pi / -180.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 ^ 2.0) - (a ^ 2.0); t_1 = (a - b) * (b + a); tmp = 0.0; if (t_0 <= -Inf) tmp = (a * 0.011111111111111112) * ((pi * angle_m) * (b - a)); elseif (t_0 <= 5e+214) tmp = 2.0 * ((t_1 * sin((-0.005555555555555556 * (pi * angle_m)))) * cos((0.005555555555555556 * (pi * angle_m)))); elseif (t_0 <= Inf) tmp = 0.011111111111111112 * ((b * ((angle_m * (pi * (a - a))) + (angle_m * (b * pi)))) - ((a ^ 2.0) * (pi * angle_m))); else tmp = 2.0 * (t_1 * sin((angle_m * (pi / -180.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[Power[b, 2.0], $MachinePrecision] - N[Power[a, 2.0], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(a - b), $MachinePrecision] * N[(b + a), $MachinePrecision]), $MachinePrecision]}, N[(angle$95$s * If[LessEqual[t$95$0, (-Infinity)], N[(N[(a * 0.011111111111111112), $MachinePrecision] * N[(N[(Pi * angle$95$m), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 5e+214], N[(2.0 * N[(N[(t$95$1 * N[Sin[N[(-0.005555555555555556 * N[(Pi * angle$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[Cos[N[(0.005555555555555556 * N[(Pi * angle$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, Infinity], N[(0.011111111111111112 * N[(N[(b * N[(N[(angle$95$m * N[(Pi * N[(a - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(angle$95$m * N[(b * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[Power[a, 2.0], $MachinePrecision] * N[(Pi * angle$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(t$95$1 * N[Sin[N[(angle$95$m * N[(Pi / -180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]), $MachinePrecision]]]
\begin{array}{l}
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
\begin{array}{l}
t_0 := {b}^{2} - {a}^{2}\\
t_1 := \left(a - b\right) \cdot \left(b + a\right)\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_0 \leq -\infty:\\
\;\;\;\;\left(a \cdot 0.011111111111111112\right) \cdot \left(\left(\pi \cdot angle\_m\right) \cdot \left(b - a\right)\right)\\
\mathbf{elif}\;t\_0 \leq 5 \cdot 10^{+214}:\\
\;\;\;\;2 \cdot \left(\left(t\_1 \cdot \sin \left(-0.005555555555555556 \cdot \left(\pi \cdot angle\_m\right)\right)\right) \cdot \cos \left(0.005555555555555556 \cdot \left(\pi \cdot angle\_m\right)\right)\right)\\
\mathbf{elif}\;t\_0 \leq \infty:\\
\;\;\;\;0.011111111111111112 \cdot \left(b \cdot \left(angle\_m \cdot \left(\pi \cdot \left(a - a\right)\right) + angle\_m \cdot \left(b \cdot \pi\right)\right) - {a}^{2} \cdot \left(\pi \cdot angle\_m\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(t\_1 \cdot \sin \left(angle\_m \cdot \frac{\pi}{-180}\right)\right)\\
\end{array}
\end{array}
\end{array}
if (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) < -inf.0Initial program 45.9%
associate-*l*45.9%
*-commutative45.9%
associate-*l*45.9%
Simplified45.9%
Taylor expanded in angle around 0 52.9%
unpow252.9%
unpow252.9%
difference-of-squares52.9%
Applied egg-rr52.9%
Taylor expanded in b around 0 52.9%
Taylor expanded in angle around 0 74.1%
associate-*r*74.3%
associate-*r*74.3%
Simplified74.3%
if -inf.0 < (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) < 4.99999999999999953e214Initial program 61.0%
Simplified60.9%
add-sqr-sqrt28.5%
sqrt-unprod56.5%
associate-*r/56.3%
associate-*r/56.3%
frac-times56.5%
*-commutative56.5%
*-commutative56.5%
metadata-eval56.5%
metadata-eval56.5%
frac-times56.3%
associate-*r/56.4%
associate-*r/56.7%
sqrt-unprod32.3%
add-sqr-sqrt61.3%
expm1-log1p-u54.7%
expm1-undefine54.7%
Applied egg-rr54.7%
expm1-define54.7%
Simplified54.7%
unpow254.7%
unpow254.7%
difference-of-squares54.7%
Applied egg-rr54.7%
Taylor expanded in angle around inf 60.6%
if 4.99999999999999953e214 < (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) < +inf.0Initial program 52.6%
associate-*l*52.6%
*-commutative52.6%
associate-*l*52.6%
Simplified52.6%
Taylor expanded in angle around 0 61.2%
unpow261.2%
unpow261.2%
difference-of-squares61.2%
Applied egg-rr61.2%
Taylor expanded in b around 0 70.3%
if +inf.0 < (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) Initial program 0.0%
Simplified0.0%
add-sqr-sqrt0.0%
sqrt-unprod0.0%
associate-*r/0.0%
associate-*r/0.0%
frac-times0.0%
*-commutative0.0%
*-commutative0.0%
metadata-eval0.0%
metadata-eval0.0%
frac-times0.0%
associate-*r/0.0%
associate-*r/0.0%
sqrt-unprod0.0%
add-sqr-sqrt0.0%
expm1-log1p-u0.0%
expm1-undefine0.0%
Applied egg-rr0.0%
expm1-define0.0%
Simplified0.0%
unpow20.0%
unpow20.0%
difference-of-squares51.2%
Applied egg-rr51.2%
Taylor expanded in angle around 0 62.3%
Final simplification65.3%
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a b angle_m)
:precision binary64
(let* ((t_0 (expm1 (log1p (* PI (* angle_m 0.005555555555555556)))))
(t_1 (cos t_0))
(t_2 (* (- a b) (+ b a))))
(*
angle_s
(if (<= (/ angle_m 180.0) 1e-126)
(*
0.011111111111111112
(+
(* a (- (* angle_m (* PI (- b b))) (* a (* PI angle_m))))
(* angle_m (* (pow b 2.0) PI))))
(if (<= (/ angle_m 180.0) 5e+152)
(* t_1 (* 2.0 (* t_2 (sin (* angle_m (/ PI -180.0))))))
(if (<= (/ angle_m 180.0) 1e+207)
(* t_1 (* 2.0 (* t_2 (sin (/ (* PI angle_m) 180.0)))))
(* t_1 (* 2.0 (* t_2 (sin t_0))))))))))angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a, double b, double angle_m) {
double t_0 = expm1(log1p((((double) M_PI) * (angle_m * 0.005555555555555556))));
double t_1 = cos(t_0);
double t_2 = (a - b) * (b + a);
double tmp;
if ((angle_m / 180.0) <= 1e-126) {
tmp = 0.011111111111111112 * ((a * ((angle_m * (((double) M_PI) * (b - b))) - (a * (((double) M_PI) * angle_m)))) + (angle_m * (pow(b, 2.0) * ((double) M_PI))));
} else if ((angle_m / 180.0) <= 5e+152) {
tmp = t_1 * (2.0 * (t_2 * sin((angle_m * (((double) M_PI) / -180.0)))));
} else if ((angle_m / 180.0) <= 1e+207) {
tmp = t_1 * (2.0 * (t_2 * sin(((((double) M_PI) * angle_m) / 180.0))));
} else {
tmp = t_1 * (2.0 * (t_2 * sin(t_0)));
}
return angle_s * tmp;
}
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b, double angle_m) {
double t_0 = Math.expm1(Math.log1p((Math.PI * (angle_m * 0.005555555555555556))));
double t_1 = Math.cos(t_0);
double t_2 = (a - b) * (b + a);
double tmp;
if ((angle_m / 180.0) <= 1e-126) {
tmp = 0.011111111111111112 * ((a * ((angle_m * (Math.PI * (b - b))) - (a * (Math.PI * angle_m)))) + (angle_m * (Math.pow(b, 2.0) * Math.PI)));
} else if ((angle_m / 180.0) <= 5e+152) {
tmp = t_1 * (2.0 * (t_2 * Math.sin((angle_m * (Math.PI / -180.0)))));
} else if ((angle_m / 180.0) <= 1e+207) {
tmp = t_1 * (2.0 * (t_2 * Math.sin(((Math.PI * angle_m) / 180.0))));
} else {
tmp = t_1 * (2.0 * (t_2 * Math.sin(t_0)));
}
return angle_s * tmp;
}
angle\_m = math.fabs(angle) angle\_s = math.copysign(1.0, angle) def code(angle_s, a, b, angle_m): t_0 = math.expm1(math.log1p((math.pi * (angle_m * 0.005555555555555556)))) t_1 = math.cos(t_0) t_2 = (a - b) * (b + a) tmp = 0 if (angle_m / 180.0) <= 1e-126: tmp = 0.011111111111111112 * ((a * ((angle_m * (math.pi * (b - b))) - (a * (math.pi * angle_m)))) + (angle_m * (math.pow(b, 2.0) * math.pi))) elif (angle_m / 180.0) <= 5e+152: tmp = t_1 * (2.0 * (t_2 * math.sin((angle_m * (math.pi / -180.0))))) elif (angle_m / 180.0) <= 1e+207: tmp = t_1 * (2.0 * (t_2 * math.sin(((math.pi * angle_m) / 180.0)))) else: tmp = t_1 * (2.0 * (t_2 * math.sin(t_0))) return angle_s * tmp
angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a, b, angle_m) t_0 = expm1(log1p(Float64(pi * Float64(angle_m * 0.005555555555555556)))) t_1 = cos(t_0) t_2 = Float64(Float64(a - b) * Float64(b + a)) tmp = 0.0 if (Float64(angle_m / 180.0) <= 1e-126) tmp = Float64(0.011111111111111112 * Float64(Float64(a * Float64(Float64(angle_m * Float64(pi * Float64(b - b))) - Float64(a * Float64(pi * angle_m)))) + Float64(angle_m * Float64((b ^ 2.0) * pi)))); elseif (Float64(angle_m / 180.0) <= 5e+152) tmp = Float64(t_1 * Float64(2.0 * Float64(t_2 * sin(Float64(angle_m * Float64(pi / -180.0)))))); elseif (Float64(angle_m / 180.0) <= 1e+207) tmp = Float64(t_1 * Float64(2.0 * Float64(t_2 * sin(Float64(Float64(pi * angle_m) / 180.0))))); else tmp = Float64(t_1 * Float64(2.0 * Float64(t_2 * sin(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[(Exp[N[Log[1 + N[(Pi * N[(angle$95$m * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]] - 1), $MachinePrecision]}, Block[{t$95$1 = N[Cos[t$95$0], $MachinePrecision]}, Block[{t$95$2 = N[(N[(a - b), $MachinePrecision] * N[(b + a), $MachinePrecision]), $MachinePrecision]}, N[(angle$95$s * If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 1e-126], N[(0.011111111111111112 * N[(N[(a * N[(N[(angle$95$m * N[(Pi * N[(b - b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(a * N[(Pi * angle$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(angle$95$m * N[(N[Power[b, 2.0], $MachinePrecision] * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 5e+152], N[(t$95$1 * N[(2.0 * N[(t$95$2 * N[Sin[N[(angle$95$m * N[(Pi / -180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 1e+207], N[(t$95$1 * N[(2.0 * N[(t$95$2 * N[Sin[N[(N[(Pi * angle$95$m), $MachinePrecision] / 180.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$1 * N[(2.0 * N[(t$95$2 * N[Sin[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 := \mathsf{expm1}\left(\mathsf{log1p}\left(\pi \cdot \left(angle\_m \cdot 0.005555555555555556\right)\right)\right)\\
t_1 := \cos t\_0\\
t_2 := \left(a - b\right) \cdot \left(b + a\right)\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;\frac{angle\_m}{180} \leq 10^{-126}:\\
\;\;\;\;0.011111111111111112 \cdot \left(a \cdot \left(angle\_m \cdot \left(\pi \cdot \left(b - b\right)\right) - a \cdot \left(\pi \cdot angle\_m\right)\right) + angle\_m \cdot \left({b}^{2} \cdot \pi\right)\right)\\
\mathbf{elif}\;\frac{angle\_m}{180} \leq 5 \cdot 10^{+152}:\\
\;\;\;\;t\_1 \cdot \left(2 \cdot \left(t\_2 \cdot \sin \left(angle\_m \cdot \frac{\pi}{-180}\right)\right)\right)\\
\mathbf{elif}\;\frac{angle\_m}{180} \leq 10^{+207}:\\
\;\;\;\;t\_1 \cdot \left(2 \cdot \left(t\_2 \cdot \sin \left(\frac{\pi \cdot angle\_m}{180}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1 \cdot \left(2 \cdot \left(t\_2 \cdot \sin t\_0\right)\right)\\
\end{array}
\end{array}
\end{array}
if (/.f64 angle #s(literal 180 binary64)) < 9.9999999999999995e-127Initial program 57.1%
associate-*l*57.1%
*-commutative57.1%
associate-*l*57.1%
Simplified57.1%
Taylor expanded in angle around 0 58.4%
unpow258.4%
unpow258.4%
difference-of-squares60.5%
Applied egg-rr60.5%
Taylor expanded in a around 0 61.3%
if 9.9999999999999995e-127 < (/.f64 angle #s(literal 180 binary64)) < 5e152Initial program 57.0%
Simplified55.8%
add-sqr-sqrt0.0%
sqrt-unprod55.8%
associate-*r/58.6%
associate-*r/58.6%
frac-times58.6%
*-commutative58.6%
*-commutative58.6%
metadata-eval58.6%
metadata-eval58.6%
frac-times58.6%
associate-*r/57.3%
associate-*r/56.0%
sqrt-unprod53.9%
add-sqr-sqrt56.0%
expm1-log1p-u63.9%
expm1-undefine63.9%
Applied egg-rr63.9%
expm1-define63.9%
Simplified63.9%
unpow263.9%
unpow263.9%
difference-of-squares73.2%
Applied egg-rr73.2%
if 5e152 < (/.f64 angle #s(literal 180 binary64)) < 1e207Initial program 18.7%
Simplified20.1%
add-sqr-sqrt0.0%
sqrt-unprod0.0%
associate-*r/0.0%
associate-*r/0.0%
frac-times0.0%
*-commutative0.0%
*-commutative0.0%
metadata-eval0.0%
metadata-eval0.0%
frac-times0.0%
associate-*r/0.0%
associate-*r/0.0%
sqrt-unprod11.7%
add-sqr-sqrt18.4%
expm1-log1p-u21.2%
expm1-undefine21.3%
Applied egg-rr21.3%
expm1-define21.2%
Simplified21.2%
unpow221.2%
unpow221.2%
difference-of-squares21.2%
Applied egg-rr21.2%
add-sqr-sqrt0.0%
sqrt-unprod0.0%
associate-*r/0.0%
associate-*r/0.0%
frac-times0.0%
*-commutative0.0%
*-commutative0.0%
metadata-eval0.0%
metadata-eval0.0%
frac-times0.0%
associate-*r/0.0%
associate-*r/0.0%
sqrt-unprod27.5%
add-sqr-sqrt41.8%
*-commutative41.8%
associate-*l/48.9%
Applied egg-rr48.9%
if 1e207 < (/.f64 angle #s(literal 180 binary64)) Initial program 18.5%
Simplified17.1%
add-sqr-sqrt0.0%
sqrt-unprod0.0%
associate-*r/0.0%
associate-*r/0.0%
frac-times0.0%
*-commutative0.0%
*-commutative0.0%
metadata-eval0.0%
metadata-eval0.0%
frac-times0.0%
associate-*r/0.0%
associate-*r/0.0%
sqrt-unprod29.0%
add-sqr-sqrt23.6%
expm1-log1p-u20.3%
expm1-undefine20.3%
Applied egg-rr20.3%
expm1-define20.3%
Simplified20.3%
unpow220.3%
unpow220.3%
difference-of-squares25.8%
Applied egg-rr25.8%
add-sqr-sqrt0.0%
sqrt-unprod0.0%
associate-*r/0.0%
associate-*r/0.0%
frac-times0.0%
*-commutative0.0%
*-commutative0.0%
metadata-eval0.0%
metadata-eval0.0%
frac-times0.0%
associate-*r/0.0%
associate-*r/0.0%
sqrt-unprod29.0%
add-sqr-sqrt23.6%
expm1-log1p-u20.3%
expm1-undefine20.3%
Applied egg-rr39.9%
expm1-define20.3%
Simplified39.9%
Final simplification62.1%
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a b angle_m)
:precision binary64
(let* ((t_0 (* PI (* angle_m 0.005555555555555556)))
(t_1 (cos (expm1 (log1p t_0))))
(t_2 (* (- a b) (+ b a))))
(*
angle_s
(if (<= (/ angle_m 180.0) 1e-126)
(*
0.011111111111111112
(+
(* a (- (* angle_m (* PI (- b b))) (* a (* PI angle_m))))
(* angle_m (* (pow b 2.0) PI))))
(if (<= (/ angle_m 180.0) 5e+152)
(* t_1 (* 2.0 (* t_2 (sin (* angle_m (/ PI -180.0))))))
(if (<= (/ angle_m 180.0) 1e+207)
(* t_1 (* 2.0 (* t_2 (sin (/ (* PI angle_m) 180.0)))))
(* t_1 (* 2.0 (* t_2 (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 = ((double) M_PI) * (angle_m * 0.005555555555555556);
double t_1 = cos(expm1(log1p(t_0)));
double t_2 = (a - b) * (b + a);
double tmp;
if ((angle_m / 180.0) <= 1e-126) {
tmp = 0.011111111111111112 * ((a * ((angle_m * (((double) M_PI) * (b - b))) - (a * (((double) M_PI) * angle_m)))) + (angle_m * (pow(b, 2.0) * ((double) M_PI))));
} else if ((angle_m / 180.0) <= 5e+152) {
tmp = t_1 * (2.0 * (t_2 * sin((angle_m * (((double) M_PI) / -180.0)))));
} else if ((angle_m / 180.0) <= 1e+207) {
tmp = t_1 * (2.0 * (t_2 * sin(((((double) M_PI) * angle_m) / 180.0))));
} else {
tmp = t_1 * (2.0 * (t_2 * 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 = Math.PI * (angle_m * 0.005555555555555556);
double t_1 = Math.cos(Math.expm1(Math.log1p(t_0)));
double t_2 = (a - b) * (b + a);
double tmp;
if ((angle_m / 180.0) <= 1e-126) {
tmp = 0.011111111111111112 * ((a * ((angle_m * (Math.PI * (b - b))) - (a * (Math.PI * angle_m)))) + (angle_m * (Math.pow(b, 2.0) * Math.PI)));
} else if ((angle_m / 180.0) <= 5e+152) {
tmp = t_1 * (2.0 * (t_2 * Math.sin((angle_m * (Math.PI / -180.0)))));
} else if ((angle_m / 180.0) <= 1e+207) {
tmp = t_1 * (2.0 * (t_2 * Math.sin(((Math.PI * angle_m) / 180.0))));
} else {
tmp = t_1 * (2.0 * (t_2 * 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 = math.pi * (angle_m * 0.005555555555555556) t_1 = math.cos(math.expm1(math.log1p(t_0))) t_2 = (a - b) * (b + a) tmp = 0 if (angle_m / 180.0) <= 1e-126: tmp = 0.011111111111111112 * ((a * ((angle_m * (math.pi * (b - b))) - (a * (math.pi * angle_m)))) + (angle_m * (math.pow(b, 2.0) * math.pi))) elif (angle_m / 180.0) <= 5e+152: tmp = t_1 * (2.0 * (t_2 * math.sin((angle_m * (math.pi / -180.0))))) elif (angle_m / 180.0) <= 1e+207: tmp = t_1 * (2.0 * (t_2 * math.sin(((math.pi * angle_m) / 180.0)))) else: tmp = t_1 * (2.0 * (t_2 * 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(pi * Float64(angle_m * 0.005555555555555556)) t_1 = cos(expm1(log1p(t_0))) t_2 = Float64(Float64(a - b) * Float64(b + a)) tmp = 0.0 if (Float64(angle_m / 180.0) <= 1e-126) tmp = Float64(0.011111111111111112 * Float64(Float64(a * Float64(Float64(angle_m * Float64(pi * Float64(b - b))) - Float64(a * Float64(pi * angle_m)))) + Float64(angle_m * Float64((b ^ 2.0) * pi)))); elseif (Float64(angle_m / 180.0) <= 5e+152) tmp = Float64(t_1 * Float64(2.0 * Float64(t_2 * sin(Float64(angle_m * Float64(pi / -180.0)))))); elseif (Float64(angle_m / 180.0) <= 1e+207) tmp = Float64(t_1 * Float64(2.0 * Float64(t_2 * sin(Float64(Float64(pi * angle_m) / 180.0))))); else tmp = Float64(t_1 * Float64(2.0 * Float64(t_2 * sin(exp(log(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[Cos[N[(Exp[N[Log[1 + t$95$0], $MachinePrecision]] - 1), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[(N[(a - b), $MachinePrecision] * N[(b + a), $MachinePrecision]), $MachinePrecision]}, N[(angle$95$s * If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 1e-126], N[(0.011111111111111112 * N[(N[(a * N[(N[(angle$95$m * N[(Pi * N[(b - b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(a * N[(Pi * angle$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(angle$95$m * N[(N[Power[b, 2.0], $MachinePrecision] * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 5e+152], N[(t$95$1 * N[(2.0 * N[(t$95$2 * N[Sin[N[(angle$95$m * N[(Pi / -180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 1e+207], N[(t$95$1 * N[(2.0 * N[(t$95$2 * N[Sin[N[(N[(Pi * angle$95$m), $MachinePrecision] / 180.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$1 * N[(2.0 * N[(t$95$2 * N[Sin[N[Exp[N[Log[t$95$0], $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 := \pi \cdot \left(angle\_m \cdot 0.005555555555555556\right)\\
t_1 := \cos \left(\mathsf{expm1}\left(\mathsf{log1p}\left(t\_0\right)\right)\right)\\
t_2 := \left(a - b\right) \cdot \left(b + a\right)\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;\frac{angle\_m}{180} \leq 10^{-126}:\\
\;\;\;\;0.011111111111111112 \cdot \left(a \cdot \left(angle\_m \cdot \left(\pi \cdot \left(b - b\right)\right) - a \cdot \left(\pi \cdot angle\_m\right)\right) + angle\_m \cdot \left({b}^{2} \cdot \pi\right)\right)\\
\mathbf{elif}\;\frac{angle\_m}{180} \leq 5 \cdot 10^{+152}:\\
\;\;\;\;t\_1 \cdot \left(2 \cdot \left(t\_2 \cdot \sin \left(angle\_m \cdot \frac{\pi}{-180}\right)\right)\right)\\
\mathbf{elif}\;\frac{angle\_m}{180} \leq 10^{+207}:\\
\;\;\;\;t\_1 \cdot \left(2 \cdot \left(t\_2 \cdot \sin \left(\frac{\pi \cdot angle\_m}{180}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1 \cdot \left(2 \cdot \left(t\_2 \cdot \sin \left(e^{\log t\_0}\right)\right)\right)\\
\end{array}
\end{array}
\end{array}
if (/.f64 angle #s(literal 180 binary64)) < 9.9999999999999995e-127Initial program 57.1%
associate-*l*57.1%
*-commutative57.1%
associate-*l*57.1%
Simplified57.1%
Taylor expanded in angle around 0 58.4%
unpow258.4%
unpow258.4%
difference-of-squares60.5%
Applied egg-rr60.5%
Taylor expanded in a around 0 61.3%
if 9.9999999999999995e-127 < (/.f64 angle #s(literal 180 binary64)) < 5e152Initial program 57.0%
Simplified55.8%
add-sqr-sqrt0.0%
sqrt-unprod55.8%
associate-*r/58.6%
associate-*r/58.6%
frac-times58.6%
*-commutative58.6%
*-commutative58.6%
metadata-eval58.6%
metadata-eval58.6%
frac-times58.6%
associate-*r/57.3%
associate-*r/56.0%
sqrt-unprod53.9%
add-sqr-sqrt56.0%
expm1-log1p-u63.9%
expm1-undefine63.9%
Applied egg-rr63.9%
expm1-define63.9%
Simplified63.9%
unpow263.9%
unpow263.9%
difference-of-squares73.2%
Applied egg-rr73.2%
if 5e152 < (/.f64 angle #s(literal 180 binary64)) < 1e207Initial program 18.7%
Simplified20.1%
add-sqr-sqrt0.0%
sqrt-unprod0.0%
associate-*r/0.0%
associate-*r/0.0%
frac-times0.0%
*-commutative0.0%
*-commutative0.0%
metadata-eval0.0%
metadata-eval0.0%
frac-times0.0%
associate-*r/0.0%
associate-*r/0.0%
sqrt-unprod11.7%
add-sqr-sqrt18.4%
expm1-log1p-u21.2%
expm1-undefine21.3%
Applied egg-rr21.3%
expm1-define21.2%
Simplified21.2%
unpow221.2%
unpow221.2%
difference-of-squares21.2%
Applied egg-rr21.2%
add-sqr-sqrt0.0%
sqrt-unprod0.0%
associate-*r/0.0%
associate-*r/0.0%
frac-times0.0%
*-commutative0.0%
*-commutative0.0%
metadata-eval0.0%
metadata-eval0.0%
frac-times0.0%
associate-*r/0.0%
associate-*r/0.0%
sqrt-unprod27.5%
add-sqr-sqrt41.8%
*-commutative41.8%
associate-*l/48.9%
Applied egg-rr48.9%
if 1e207 < (/.f64 angle #s(literal 180 binary64)) Initial program 18.5%
Simplified17.1%
add-sqr-sqrt0.0%
sqrt-unprod0.0%
associate-*r/0.0%
associate-*r/0.0%
frac-times0.0%
*-commutative0.0%
*-commutative0.0%
metadata-eval0.0%
metadata-eval0.0%
frac-times0.0%
associate-*r/0.0%
associate-*r/0.0%
sqrt-unprod29.0%
add-sqr-sqrt23.6%
expm1-log1p-u20.3%
expm1-undefine20.3%
Applied egg-rr20.3%
expm1-define20.3%
Simplified20.3%
unpow220.3%
unpow220.3%
difference-of-squares25.8%
Applied egg-rr25.8%
add-exp-log0.0%
add-sqr-sqrt0.0%
sqrt-unprod0.0%
associate-*r/0.0%
associate-*r/0.0%
frac-times0.0%
*-commutative0.0%
*-commutative0.0%
metadata-eval0.0%
metadata-eval0.0%
frac-times0.0%
associate-*r/0.0%
associate-*r/0.0%
sqrt-unprod39.9%
add-sqr-sqrt39.9%
div-inv39.9%
metadata-eval39.9%
Applied egg-rr39.9%
Final simplification62.1%
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a b angle_m)
:precision binary64
(*
angle_s
(if (<= (- (pow b 2.0) (pow a 2.0)) (- INFINITY))
(* (* a 0.011111111111111112) (* (* PI angle_m) (- b a)))
(*
(cos (expm1 (log1p (* PI (* angle_m 0.005555555555555556)))))
(* 2.0 (* (* (- a b) (+ b a)) (sin (* angle_m (/ PI -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)) <= -((double) INFINITY)) {
tmp = (a * 0.011111111111111112) * ((((double) M_PI) * angle_m) * (b - a));
} else {
tmp = cos(expm1(log1p((((double) M_PI) * (angle_m * 0.005555555555555556))))) * (2.0 * (((a - b) * (b + a)) * sin((angle_m * (((double) M_PI) / -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)) <= -Double.POSITIVE_INFINITY) {
tmp = (a * 0.011111111111111112) * ((Math.PI * angle_m) * (b - a));
} else {
tmp = Math.cos(Math.expm1(Math.log1p((Math.PI * (angle_m * 0.005555555555555556))))) * (2.0 * (((a - b) * (b + a)) * Math.sin((angle_m * (Math.PI / -180.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): tmp = 0 if (math.pow(b, 2.0) - math.pow(a, 2.0)) <= -math.inf: tmp = (a * 0.011111111111111112) * ((math.pi * angle_m) * (b - a)) else: tmp = math.cos(math.expm1(math.log1p((math.pi * (angle_m * 0.005555555555555556))))) * (2.0 * (((a - b) * (b + a)) * math.sin((angle_m * (math.pi / -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)) <= Float64(-Inf)) tmp = Float64(Float64(a * 0.011111111111111112) * Float64(Float64(pi * angle_m) * Float64(b - a))); else tmp = Float64(cos(expm1(log1p(Float64(pi * Float64(angle_m * 0.005555555555555556))))) * Float64(2.0 * Float64(Float64(Float64(a - b) * Float64(b + a)) * sin(Float64(angle_m * Float64(pi / -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], (-Infinity)], N[(N[(a * 0.011111111111111112), $MachinePrecision] * N[(N[(Pi * angle$95$m), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Cos[N[(Exp[N[Log[1 + N[(Pi * N[(angle$95$m * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]] - 1), $MachinePrecision]], $MachinePrecision] * N[(2.0 * N[(N[(N[(a - b), $MachinePrecision] * N[(b + a), $MachinePrecision]), $MachinePrecision] * N[Sin[N[(angle$95$m * N[(Pi / -180.0), $MachinePrecision]), $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 \begin{array}{l}
\mathbf{if}\;{b}^{2} - {a}^{2} \leq -\infty:\\
\;\;\;\;\left(a \cdot 0.011111111111111112\right) \cdot \left(\left(\pi \cdot angle\_m\right) \cdot \left(b - a\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\cos \left(\mathsf{expm1}\left(\mathsf{log1p}\left(\pi \cdot \left(angle\_m \cdot 0.005555555555555556\right)\right)\right)\right) \cdot \left(2 \cdot \left(\left(\left(a - b\right) \cdot \left(b + a\right)\right) \cdot \sin \left(angle\_m \cdot \frac{\pi}{-180}\right)\right)\right)\\
\end{array}
\end{array}
if (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) < -inf.0Initial program 45.9%
associate-*l*45.9%
*-commutative45.9%
associate-*l*45.9%
Simplified45.9%
Taylor expanded in angle around 0 52.9%
unpow252.9%
unpow252.9%
difference-of-squares52.9%
Applied egg-rr52.9%
Taylor expanded in b around 0 52.9%
Taylor expanded in angle around 0 74.1%
associate-*r*74.3%
associate-*r*74.3%
Simplified74.3%
if -inf.0 < (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) Initial program 53.5%
Simplified52.9%
add-sqr-sqrt26.2%
sqrt-unprod46.4%
associate-*r/47.2%
associate-*r/47.7%
frac-times48.3%
*-commutative48.3%
*-commutative48.3%
metadata-eval48.3%
metadata-eval48.3%
frac-times47.7%
associate-*r/47.8%
associate-*r/47.5%
sqrt-unprod28.1%
add-sqr-sqrt54.1%
expm1-log1p-u48.9%
expm1-undefine48.4%
Applied egg-rr48.4%
expm1-define48.9%
Simplified48.9%
unpow248.9%
unpow248.9%
difference-of-squares53.2%
Applied egg-rr53.2%
Final simplification56.8%
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a b angle_m)
:precision binary64
(*
angle_s
(if (<= (- (pow b 2.0) (pow a 2.0)) (- INFINITY))
(* (* a 0.011111111111111112) (* (* PI angle_m) (- b a)))
(*
(cos (expm1 (log1p (* PI (* angle_m 0.005555555555555556)))))
(*
2.0
(*
(* (- a b) (+ b a))
(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 tmp;
if ((pow(b, 2.0) - pow(a, 2.0)) <= -((double) INFINITY)) {
tmp = (a * 0.011111111111111112) * ((((double) M_PI) * angle_m) * (b - a));
} else {
tmp = cos(expm1(log1p((((double) M_PI) * (angle_m * 0.005555555555555556))))) * (2.0 * (((a - b) * (b + a)) * 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 tmp;
if ((Math.pow(b, 2.0) - Math.pow(a, 2.0)) <= -Double.POSITIVE_INFINITY) {
tmp = (a * 0.011111111111111112) * ((Math.PI * angle_m) * (b - a));
} else {
tmp = Math.cos(Math.expm1(Math.log1p((Math.PI * (angle_m * 0.005555555555555556))))) * (2.0 * (((a - b) * (b + a)) * 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): tmp = 0 if (math.pow(b, 2.0) - math.pow(a, 2.0)) <= -math.inf: tmp = (a * 0.011111111111111112) * ((math.pi * angle_m) * (b - a)) else: tmp = math.cos(math.expm1(math.log1p((math.pi * (angle_m * 0.005555555555555556))))) * (2.0 * (((a - b) * (b + a)) * 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) tmp = 0.0 if (Float64((b ^ 2.0) - (a ^ 2.0)) <= Float64(-Inf)) tmp = Float64(Float64(a * 0.011111111111111112) * Float64(Float64(pi * angle_m) * Float64(b - a))); else tmp = Float64(cos(expm1(log1p(Float64(pi * Float64(angle_m * 0.005555555555555556))))) * Float64(2.0 * Float64(Float64(Float64(a - b) * Float64(b + a)) * sin(Float64(-0.005555555555555556 * Float64(pi * angle_m)))))); 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], (-Infinity)], N[(N[(a * 0.011111111111111112), $MachinePrecision] * N[(N[(Pi * angle$95$m), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Cos[N[(Exp[N[Log[1 + N[(Pi * N[(angle$95$m * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]] - 1), $MachinePrecision]], $MachinePrecision] * N[(2.0 * N[(N[(N[(a - b), $MachinePrecision] * N[(b + a), $MachinePrecision]), $MachinePrecision] * N[Sin[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)
\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;{b}^{2} - {a}^{2} \leq -\infty:\\
\;\;\;\;\left(a \cdot 0.011111111111111112\right) \cdot \left(\left(\pi \cdot angle\_m\right) \cdot \left(b - a\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\cos \left(\mathsf{expm1}\left(\mathsf{log1p}\left(\pi \cdot \left(angle\_m \cdot 0.005555555555555556\right)\right)\right)\right) \cdot \left(2 \cdot \left(\left(\left(a - b\right) \cdot \left(b + a\right)\right) \cdot \sin \left(-0.005555555555555556 \cdot \left(\pi \cdot angle\_m\right)\right)\right)\right)\\
\end{array}
\end{array}
if (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) < -inf.0Initial program 45.9%
associate-*l*45.9%
*-commutative45.9%
associate-*l*45.9%
Simplified45.9%
Taylor expanded in angle around 0 52.9%
unpow252.9%
unpow252.9%
difference-of-squares52.9%
Applied egg-rr52.9%
Taylor expanded in b around 0 52.9%
Taylor expanded in angle around 0 74.1%
associate-*r*74.3%
associate-*r*74.3%
Simplified74.3%
if -inf.0 < (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) Initial program 53.5%
Simplified52.9%
add-sqr-sqrt26.2%
sqrt-unprod46.4%
associate-*r/47.2%
associate-*r/47.7%
frac-times48.3%
*-commutative48.3%
*-commutative48.3%
metadata-eval48.3%
metadata-eval48.3%
frac-times47.7%
associate-*r/47.8%
associate-*r/47.5%
sqrt-unprod28.1%
add-sqr-sqrt54.1%
expm1-log1p-u48.9%
expm1-undefine48.4%
Applied egg-rr48.4%
expm1-define48.9%
Simplified48.9%
unpow248.9%
unpow248.9%
difference-of-squares53.2%
Applied egg-rr53.2%
Taylor expanded in angle around inf 53.0%
Final simplification56.6%
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a b angle_m)
:precision binary64
(let* ((t_0 (sin (* PI (* angle_m -0.005555555555555556))))
(t_1 (* PI (* angle_m 0.005555555555555556))))
(*
angle_s
(if (<= a 4.2e-103)
(* (* 2.0 (cos t_1)) (fma (pow a 2.0) t_0 (* b (* b (- t_0)))))
(if (<= a 1.55e+173)
(*
(cos (pow E (log t_1)))
(* 2.0 (* (* (- a b) (+ b a)) (sin (* angle_m (/ PI -180.0))))))
(* (* a 0.011111111111111112) (* (* PI angle_m) (- b a))))))))angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a, double b, double angle_m) {
double t_0 = sin((((double) M_PI) * (angle_m * -0.005555555555555556)));
double t_1 = ((double) M_PI) * (angle_m * 0.005555555555555556);
double tmp;
if (a <= 4.2e-103) {
tmp = (2.0 * cos(t_1)) * fma(pow(a, 2.0), t_0, (b * (b * -t_0)));
} else if (a <= 1.55e+173) {
tmp = cos(pow(((double) M_E), log(t_1))) * (2.0 * (((a - b) * (b + a)) * sin((angle_m * (((double) M_PI) / -180.0)))));
} else {
tmp = (a * 0.011111111111111112) * ((((double) M_PI) * angle_m) * (b - a));
}
return angle_s * tmp;
}
angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a, b, angle_m) t_0 = sin(Float64(pi * Float64(angle_m * -0.005555555555555556))) t_1 = Float64(pi * Float64(angle_m * 0.005555555555555556)) tmp = 0.0 if (a <= 4.2e-103) tmp = Float64(Float64(2.0 * cos(t_1)) * fma((a ^ 2.0), t_0, Float64(b * Float64(b * Float64(-t_0))))); elseif (a <= 1.55e+173) tmp = Float64(cos((exp(1) ^ log(t_1))) * Float64(2.0 * Float64(Float64(Float64(a - b) * Float64(b + a)) * sin(Float64(angle_m * Float64(pi / -180.0)))))); else tmp = Float64(Float64(a * 0.011111111111111112) * Float64(Float64(pi * angle_m) * Float64(b - a))); end return Float64(angle_s * tmp) end
angle\_m = N[Abs[angle], $MachinePrecision]
angle\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a_, b_, angle$95$m_] := Block[{t$95$0 = N[Sin[N[(Pi * N[(angle$95$m * -0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(Pi * N[(angle$95$m * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]}, N[(angle$95$s * If[LessEqual[a, 4.2e-103], N[(N[(2.0 * N[Cos[t$95$1], $MachinePrecision]), $MachinePrecision] * N[(N[Power[a, 2.0], $MachinePrecision] * t$95$0 + N[(b * N[(b * (-t$95$0)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 1.55e+173], N[(N[Cos[N[Power[E, N[Log[t$95$1], $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * N[(2.0 * N[(N[(N[(a - b), $MachinePrecision] * N[(b + a), $MachinePrecision]), $MachinePrecision] * N[Sin[N[(angle$95$m * N[(Pi / -180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(a * 0.011111111111111112), $MachinePrecision] * N[(N[(Pi * angle$95$m), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]]]
\begin{array}{l}
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
\begin{array}{l}
t_0 := \sin \left(\pi \cdot \left(angle\_m \cdot -0.005555555555555556\right)\right)\\
t_1 := \pi \cdot \left(angle\_m \cdot 0.005555555555555556\right)\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;a \leq 4.2 \cdot 10^{-103}:\\
\;\;\;\;\left(2 \cdot \cos t\_1\right) \cdot \mathsf{fma}\left({a}^{2}, t\_0, b \cdot \left(b \cdot \left(-t\_0\right)\right)\right)\\
\mathbf{elif}\;a \leq 1.55 \cdot 10^{+173}:\\
\;\;\;\;\cos \left({e}^{\log t\_1}\right) \cdot \left(2 \cdot \left(\left(\left(a - b\right) \cdot \left(b + a\right)\right) \cdot \sin \left(angle\_m \cdot \frac{\pi}{-180}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(a \cdot 0.011111111111111112\right) \cdot \left(\left(\pi \cdot angle\_m\right) \cdot \left(b - a\right)\right)\\
\end{array}
\end{array}
\end{array}
if a < 4.20000000000000009e-103Initial program 54.4%
Simplified54.3%
add-sqr-sqrt30.2%
sqrt-unprod48.3%
associate-*r/48.8%
associate-*r/50.0%
frac-times50.1%
*-commutative50.1%
*-commutative50.1%
metadata-eval50.1%
metadata-eval50.1%
frac-times50.0%
associate-*r/50.0%
associate-*r/49.0%
sqrt-unprod26.4%
add-sqr-sqrt55.2%
expm1-log1p-u48.2%
expm1-undefine47.8%
Applied egg-rr47.8%
expm1-define48.2%
Simplified48.2%
unpow248.2%
unpow248.2%
difference-of-squares51.3%
Applied egg-rr51.3%
Taylor expanded in b around 0 53.2%
fma-define55.6%
+-commutative55.6%
mul-1-neg55.6%
unsub-neg55.6%
associate-*r*55.6%
distribute-rgt1-in55.6%
metadata-eval55.6%
mul0-lft55.6%
associate-*r*55.6%
Simplified55.0%
pow155.0%
Applied egg-rr60.7%
unpow160.7%
*-commutative60.7%
fma-define59.6%
+-commutative59.6%
distribute-rgt-neg-out59.6%
unsub-neg59.6%
*-commutative59.6%
*-commutative59.6%
fmm-def59.6%
Simplified60.2%
if 4.20000000000000009e-103 < a < 1.55e173Initial program 53.2%
Simplified53.2%
add-sqr-sqrt24.4%
sqrt-unprod44.9%
associate-*r/46.6%
associate-*r/46.6%
frac-times46.6%
*-commutative46.6%
*-commutative46.6%
metadata-eval46.6%
metadata-eval46.6%
frac-times46.6%
associate-*r/45.2%
associate-*r/45.2%
sqrt-unprod33.8%
add-sqr-sqrt53.2%
expm1-log1p-u50.7%
expm1-undefine50.4%
Applied egg-rr50.4%
expm1-define50.7%
Simplified50.7%
unpow250.7%
unpow250.7%
difference-of-squares50.8%
Applied egg-rr50.8%
expm1-log1p-u53.2%
rem-exp-log32.9%
*-un-lft-identity32.9%
exp-prod35.6%
Applied egg-rr36.5%
if 1.55e173 < a Initial program 38.0%
associate-*l*38.0%
*-commutative38.0%
associate-*l*38.0%
Simplified38.0%
Taylor expanded in angle around 0 28.0%
unpow228.0%
unpow228.0%
difference-of-squares44.8%
Applied egg-rr44.8%
Taylor expanded in b around 0 41.4%
Taylor expanded in angle around 0 58.3%
associate-*r*58.3%
associate-*r*58.3%
Simplified58.3%
Final simplification54.6%
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a b angle_m)
:precision binary64
(let* ((t_0 (cos (expm1 (log1p (* PI (* angle_m 0.005555555555555556))))))
(t_1 (* (- a b) (+ b a))))
(*
angle_s
(if (<= (/ angle_m 180.0) 1e-126)
(*
0.011111111111111112
(+
(* a (- (* angle_m (* PI (- b b))) (* a (* PI angle_m))))
(* angle_m (* (pow b 2.0) PI))))
(if (<= (/ angle_m 180.0) 5e+152)
(* t_0 (* 2.0 (* t_1 (sin (* angle_m (/ PI -180.0))))))
(if (<= (/ angle_m 180.0) 5e+205)
(* t_0 (* 2.0 (* t_1 (sin (/ (* PI angle_m) 180.0)))))
(*
t_0
(*
2.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 = cos(expm1(log1p((((double) M_PI) * (angle_m * 0.005555555555555556)))));
double t_1 = (a - b) * (b + a);
double tmp;
if ((angle_m / 180.0) <= 1e-126) {
tmp = 0.011111111111111112 * ((a * ((angle_m * (((double) M_PI) * (b - b))) - (a * (((double) M_PI) * angle_m)))) + (angle_m * (pow(b, 2.0) * ((double) M_PI))));
} else if ((angle_m / 180.0) <= 5e+152) {
tmp = t_0 * (2.0 * (t_1 * sin((angle_m * (((double) M_PI) / -180.0)))));
} else if ((angle_m / 180.0) <= 5e+205) {
tmp = t_0 * (2.0 * (t_1 * sin(((((double) M_PI) * angle_m) / 180.0))));
} else {
tmp = t_0 * (2.0 * (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 = Math.cos(Math.expm1(Math.log1p((Math.PI * (angle_m * 0.005555555555555556)))));
double t_1 = (a - b) * (b + a);
double tmp;
if ((angle_m / 180.0) <= 1e-126) {
tmp = 0.011111111111111112 * ((a * ((angle_m * (Math.PI * (b - b))) - (a * (Math.PI * angle_m)))) + (angle_m * (Math.pow(b, 2.0) * Math.PI)));
} else if ((angle_m / 180.0) <= 5e+152) {
tmp = t_0 * (2.0 * (t_1 * Math.sin((angle_m * (Math.PI / -180.0)))));
} else if ((angle_m / 180.0) <= 5e+205) {
tmp = t_0 * (2.0 * (t_1 * Math.sin(((Math.PI * angle_m) / 180.0))));
} else {
tmp = t_0 * (2.0 * (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 = math.cos(math.expm1(math.log1p((math.pi * (angle_m * 0.005555555555555556))))) t_1 = (a - b) * (b + a) tmp = 0 if (angle_m / 180.0) <= 1e-126: tmp = 0.011111111111111112 * ((a * ((angle_m * (math.pi * (b - b))) - (a * (math.pi * angle_m)))) + (angle_m * (math.pow(b, 2.0) * math.pi))) elif (angle_m / 180.0) <= 5e+152: tmp = t_0 * (2.0 * (t_1 * math.sin((angle_m * (math.pi / -180.0))))) elif (angle_m / 180.0) <= 5e+205: tmp = t_0 * (2.0 * (t_1 * math.sin(((math.pi * angle_m) / 180.0)))) else: tmp = t_0 * (2.0 * (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 = cos(expm1(log1p(Float64(pi * Float64(angle_m * 0.005555555555555556))))) t_1 = Float64(Float64(a - b) * Float64(b + a)) tmp = 0.0 if (Float64(angle_m / 180.0) <= 1e-126) tmp = Float64(0.011111111111111112 * Float64(Float64(a * Float64(Float64(angle_m * Float64(pi * Float64(b - b))) - Float64(a * Float64(pi * angle_m)))) + Float64(angle_m * Float64((b ^ 2.0) * pi)))); elseif (Float64(angle_m / 180.0) <= 5e+152) tmp = Float64(t_0 * Float64(2.0 * Float64(t_1 * sin(Float64(angle_m * Float64(pi / -180.0)))))); elseif (Float64(angle_m / 180.0) <= 5e+205) tmp = Float64(t_0 * Float64(2.0 * Float64(t_1 * sin(Float64(Float64(pi * angle_m) / 180.0))))); else tmp = Float64(t_0 * Float64(2.0 * Float64(t_1 * sin(Float64(-0.005555555555555556 * Float64(pi * angle_m)))))); end return Float64(angle_s * tmp) end
angle\_m = N[Abs[angle], $MachinePrecision]
angle\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a_, b_, angle$95$m_] := Block[{t$95$0 = N[Cos[N[(Exp[N[Log[1 + N[(Pi * N[(angle$95$m * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]] - 1), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(N[(a - b), $MachinePrecision] * N[(b + a), $MachinePrecision]), $MachinePrecision]}, N[(angle$95$s * If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 1e-126], N[(0.011111111111111112 * N[(N[(a * N[(N[(angle$95$m * N[(Pi * N[(b - b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(a * N[(Pi * angle$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(angle$95$m * N[(N[Power[b, 2.0], $MachinePrecision] * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 5e+152], N[(t$95$0 * N[(2.0 * N[(t$95$1 * N[Sin[N[(angle$95$m * N[(Pi / -180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 5e+205], N[(t$95$0 * N[(2.0 * N[(t$95$1 * N[Sin[N[(N[(Pi * angle$95$m), $MachinePrecision] / 180.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$0 * N[(2.0 * N[(t$95$1 * N[Sin[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 := \cos \left(\mathsf{expm1}\left(\mathsf{log1p}\left(\pi \cdot \left(angle\_m \cdot 0.005555555555555556\right)\right)\right)\right)\\
t_1 := \left(a - b\right) \cdot \left(b + a\right)\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;\frac{angle\_m}{180} \leq 10^{-126}:\\
\;\;\;\;0.011111111111111112 \cdot \left(a \cdot \left(angle\_m \cdot \left(\pi \cdot \left(b - b\right)\right) - a \cdot \left(\pi \cdot angle\_m\right)\right) + angle\_m \cdot \left({b}^{2} \cdot \pi\right)\right)\\
\mathbf{elif}\;\frac{angle\_m}{180} \leq 5 \cdot 10^{+152}:\\
\;\;\;\;t\_0 \cdot \left(2 \cdot \left(t\_1 \cdot \sin \left(angle\_m \cdot \frac{\pi}{-180}\right)\right)\right)\\
\mathbf{elif}\;\frac{angle\_m}{180} \leq 5 \cdot 10^{+205}:\\
\;\;\;\;t\_0 \cdot \left(2 \cdot \left(t\_1 \cdot \sin \left(\frac{\pi \cdot angle\_m}{180}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0 \cdot \left(2 \cdot \left(t\_1 \cdot \sin \left(-0.005555555555555556 \cdot \left(\pi \cdot angle\_m\right)\right)\right)\right)\\
\end{array}
\end{array}
\end{array}
if (/.f64 angle #s(literal 180 binary64)) < 9.9999999999999995e-127Initial program 57.1%
associate-*l*57.1%
*-commutative57.1%
associate-*l*57.1%
Simplified57.1%
Taylor expanded in angle around 0 58.4%
unpow258.4%
unpow258.4%
difference-of-squares60.5%
Applied egg-rr60.5%
Taylor expanded in a around 0 61.3%
if 9.9999999999999995e-127 < (/.f64 angle #s(literal 180 binary64)) < 5e152Initial program 57.0%
Simplified55.8%
add-sqr-sqrt0.0%
sqrt-unprod55.8%
associate-*r/58.6%
associate-*r/58.6%
frac-times58.6%
*-commutative58.6%
*-commutative58.6%
metadata-eval58.6%
metadata-eval58.6%
frac-times58.6%
associate-*r/57.3%
associate-*r/56.0%
sqrt-unprod53.9%
add-sqr-sqrt56.0%
expm1-log1p-u63.9%
expm1-undefine63.9%
Applied egg-rr63.9%
expm1-define63.9%
Simplified63.9%
unpow263.9%
unpow263.9%
difference-of-squares73.2%
Applied egg-rr73.2%
if 5e152 < (/.f64 angle #s(literal 180 binary64)) < 5.0000000000000002e205Initial program 18.7%
Simplified20.1%
add-sqr-sqrt0.0%
sqrt-unprod0.0%
associate-*r/0.0%
associate-*r/0.0%
frac-times0.0%
*-commutative0.0%
*-commutative0.0%
metadata-eval0.0%
metadata-eval0.0%
frac-times0.0%
associate-*r/0.0%
associate-*r/0.0%
sqrt-unprod11.7%
add-sqr-sqrt18.4%
expm1-log1p-u21.2%
expm1-undefine21.3%
Applied egg-rr21.3%
expm1-define21.2%
Simplified21.2%
unpow221.2%
unpow221.2%
difference-of-squares21.2%
Applied egg-rr21.2%
add-sqr-sqrt0.0%
sqrt-unprod0.0%
associate-*r/0.0%
associate-*r/0.0%
frac-times0.0%
*-commutative0.0%
*-commutative0.0%
metadata-eval0.0%
metadata-eval0.0%
frac-times0.0%
associate-*r/0.0%
associate-*r/0.0%
sqrt-unprod27.5%
add-sqr-sqrt41.8%
*-commutative41.8%
associate-*l/48.9%
Applied egg-rr48.9%
if 5.0000000000000002e205 < (/.f64 angle #s(literal 180 binary64)) Initial program 18.5%
Simplified17.1%
add-sqr-sqrt0.0%
sqrt-unprod0.0%
associate-*r/0.0%
associate-*r/0.0%
frac-times0.0%
*-commutative0.0%
*-commutative0.0%
metadata-eval0.0%
metadata-eval0.0%
frac-times0.0%
associate-*r/0.0%
associate-*r/0.0%
sqrt-unprod29.0%
add-sqr-sqrt23.6%
expm1-log1p-u20.3%
expm1-undefine20.3%
Applied egg-rr20.3%
expm1-define20.3%
Simplified20.3%
unpow220.3%
unpow220.3%
difference-of-squares25.8%
Applied egg-rr25.8%
Taylor expanded in angle around inf 32.2%
Final simplification61.6%
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a b angle_m)
:precision binary64
(*
angle_s
(if (<= (/ angle_m 180.0) 1e-126)
(*
0.011111111111111112
(+
(* a (- (* angle_m (* PI (- b b))) (* a (* PI angle_m))))
(* angle_m (* (pow b 2.0) PI))))
(if (<= (/ angle_m 180.0) 8.5e+18)
(*
(* 2.0 (cos (* angle_m (* PI (cbrt -1.7146776406035666e-7)))))
(* (sin (* PI (* angle_m -0.005555555555555556))) (* (- a b) (+ b a))))
(*
2.0
(*
(cos (* -0.005555555555555556 (* PI angle_m)))
(*
(sin (* 0.005555555555555556 (* PI angle_m)))
(- (pow a 2.0) (pow b 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 tmp;
if ((angle_m / 180.0) <= 1e-126) {
tmp = 0.011111111111111112 * ((a * ((angle_m * (((double) M_PI) * (b - b))) - (a * (((double) M_PI) * angle_m)))) + (angle_m * (pow(b, 2.0) * ((double) M_PI))));
} else if ((angle_m / 180.0) <= 8.5e+18) {
tmp = (2.0 * cos((angle_m * (((double) M_PI) * cbrt(-1.7146776406035666e-7))))) * (sin((((double) M_PI) * (angle_m * -0.005555555555555556))) * ((a - b) * (b + a)));
} else {
tmp = 2.0 * (cos((-0.005555555555555556 * (((double) M_PI) * angle_m))) * (sin((0.005555555555555556 * (((double) M_PI) * angle_m))) * (pow(a, 2.0) - pow(b, 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 tmp;
if ((angle_m / 180.0) <= 1e-126) {
tmp = 0.011111111111111112 * ((a * ((angle_m * (Math.PI * (b - b))) - (a * (Math.PI * angle_m)))) + (angle_m * (Math.pow(b, 2.0) * Math.PI)));
} else if ((angle_m / 180.0) <= 8.5e+18) {
tmp = (2.0 * Math.cos((angle_m * (Math.PI * Math.cbrt(-1.7146776406035666e-7))))) * (Math.sin((Math.PI * (angle_m * -0.005555555555555556))) * ((a - b) * (b + a)));
} else {
tmp = 2.0 * (Math.cos((-0.005555555555555556 * (Math.PI * angle_m))) * (Math.sin((0.005555555555555556 * (Math.PI * angle_m))) * (Math.pow(a, 2.0) - Math.pow(b, 2.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(angle_m / 180.0) <= 1e-126) tmp = Float64(0.011111111111111112 * Float64(Float64(a * Float64(Float64(angle_m * Float64(pi * Float64(b - b))) - Float64(a * Float64(pi * angle_m)))) + Float64(angle_m * Float64((b ^ 2.0) * pi)))); elseif (Float64(angle_m / 180.0) <= 8.5e+18) tmp = Float64(Float64(2.0 * cos(Float64(angle_m * Float64(pi * cbrt(-1.7146776406035666e-7))))) * Float64(sin(Float64(pi * Float64(angle_m * -0.005555555555555556))) * Float64(Float64(a - b) * Float64(b + a)))); else tmp = Float64(2.0 * Float64(cos(Float64(-0.005555555555555556 * Float64(pi * angle_m))) * Float64(sin(Float64(0.005555555555555556 * Float64(pi * angle_m))) * Float64((a ^ 2.0) - (b ^ 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_] := N[(angle$95$s * If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 1e-126], N[(0.011111111111111112 * N[(N[(a * N[(N[(angle$95$m * N[(Pi * N[(b - b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(a * N[(Pi * angle$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(angle$95$m * N[(N[Power[b, 2.0], $MachinePrecision] * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 8.5e+18], N[(N[(2.0 * N[Cos[N[(angle$95$m * N[(Pi * N[Power[-1.7146776406035666e-7, 1/3], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(N[Sin[N[(Pi * N[(angle$95$m * -0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(N[(a - b), $MachinePrecision] * N[(b + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[Cos[N[(-0.005555555555555556 * N[(Pi * angle$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(N[Sin[N[(0.005555555555555556 * N[(Pi * angle$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(N[Power[a, 2.0], $MachinePrecision] - N[Power[b, 2.0], $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 \begin{array}{l}
\mathbf{if}\;\frac{angle\_m}{180} \leq 10^{-126}:\\
\;\;\;\;0.011111111111111112 \cdot \left(a \cdot \left(angle\_m \cdot \left(\pi \cdot \left(b - b\right)\right) - a \cdot \left(\pi \cdot angle\_m\right)\right) + angle\_m \cdot \left({b}^{2} \cdot \pi\right)\right)\\
\mathbf{elif}\;\frac{angle\_m}{180} \leq 8.5 \cdot 10^{+18}:\\
\;\;\;\;\left(2 \cdot \cos \left(angle\_m \cdot \left(\pi \cdot \sqrt[3]{-1.7146776406035666 \cdot 10^{-7}}\right)\right)\right) \cdot \left(\sin \left(\pi \cdot \left(angle\_m \cdot -0.005555555555555556\right)\right) \cdot \left(\left(a - b\right) \cdot \left(b + a\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(\cos \left(-0.005555555555555556 \cdot \left(\pi \cdot angle\_m\right)\right) \cdot \left(\sin \left(0.005555555555555556 \cdot \left(\pi \cdot angle\_m\right)\right) \cdot \left({a}^{2} - {b}^{2}\right)\right)\right)\\
\end{array}
\end{array}
if (/.f64 angle #s(literal 180 binary64)) < 9.9999999999999995e-127Initial program 57.1%
associate-*l*57.1%
*-commutative57.1%
associate-*l*57.1%
Simplified57.1%
Taylor expanded in angle around 0 58.4%
unpow258.4%
unpow258.4%
difference-of-squares60.5%
Applied egg-rr60.5%
Taylor expanded in a around 0 61.3%
if 9.9999999999999995e-127 < (/.f64 angle #s(literal 180 binary64)) < 8.5e18Initial program 77.8%
Simplified77.9%
add-sqr-sqrt0.0%
sqrt-unprod77.9%
associate-*r/77.9%
associate-*r/77.9%
frac-times77.9%
*-commutative77.9%
*-commutative77.9%
metadata-eval77.9%
metadata-eval77.9%
frac-times77.9%
associate-*r/77.9%
associate-*r/77.9%
sqrt-unprod77.9%
add-sqr-sqrt77.9%
expm1-log1p-u77.7%
expm1-undefine77.7%
Applied egg-rr77.7%
expm1-define77.7%
Simplified77.7%
unpow277.7%
unpow277.7%
difference-of-squares92.4%
Applied egg-rr92.4%
add-cbrt-cube92.4%
pow1/392.4%
expm1-log1p-u92.4%
expm1-log1p-u92.4%
expm1-log1p-u92.4%
pow392.4%
Applied egg-rr92.4%
Taylor expanded in angle around -inf 92.5%
associate-*r*92.5%
mul-1-neg92.5%
cos-neg92.5%
associate-*r*92.5%
Simplified92.5%
if 8.5e18 < (/.f64 angle #s(literal 180 binary64)) Initial program 26.2%
Simplified24.8%
add-exp-log0.0%
add-sqr-sqrt0.0%
sqrt-unprod25.4%
associate-*r/25.4%
associate-*r/25.4%
frac-times23.8%
*-commutative23.8%
*-commutative23.8%
metadata-eval23.8%
metadata-eval23.8%
frac-times25.4%
associate-*r/25.4%
associate-*r/25.4%
sqrt-unprod42.9%
add-sqr-sqrt42.9%
div-inv42.9%
metadata-eval42.9%
Applied egg-rr31.8%
Taylor expanded in angle around inf 40.0%
Final simplification60.2%
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a b angle_m)
:precision binary64
(*
angle_s
(if (<= a 1.55e+173)
(*
(cos (pow E (log (* PI (* angle_m 0.005555555555555556)))))
(* 2.0 (* (* (- a b) (+ b a)) (sin (* angle_m (/ PI -180.0))))))
(* (* a 0.011111111111111112) (* (* PI angle_m) (- b a))))))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 (a <= 1.55e+173) {
tmp = cos(pow(((double) M_E), log((((double) M_PI) * (angle_m * 0.005555555555555556))))) * (2.0 * (((a - b) * (b + a)) * sin((angle_m * (((double) M_PI) / -180.0)))));
} else {
tmp = (a * 0.011111111111111112) * ((((double) M_PI) * angle_m) * (b - a));
}
return angle_s * tmp;
}
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b, double angle_m) {
double tmp;
if (a <= 1.55e+173) {
tmp = Math.cos(Math.pow(Math.E, Math.log((Math.PI * (angle_m * 0.005555555555555556))))) * (2.0 * (((a - b) * (b + a)) * Math.sin((angle_m * (Math.PI / -180.0)))));
} else {
tmp = (a * 0.011111111111111112) * ((Math.PI * angle_m) * (b - a));
}
return angle_s * tmp;
}
angle\_m = math.fabs(angle) angle\_s = math.copysign(1.0, angle) def code(angle_s, a, b, angle_m): tmp = 0 if a <= 1.55e+173: tmp = math.cos(math.pow(math.e, math.log((math.pi * (angle_m * 0.005555555555555556))))) * (2.0 * (((a - b) * (b + a)) * math.sin((angle_m * (math.pi / -180.0))))) else: tmp = (a * 0.011111111111111112) * ((math.pi * angle_m) * (b - a)) 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 (a <= 1.55e+173) tmp = Float64(cos((exp(1) ^ log(Float64(pi * Float64(angle_m * 0.005555555555555556))))) * Float64(2.0 * Float64(Float64(Float64(a - b) * Float64(b + a)) * sin(Float64(angle_m * Float64(pi / -180.0)))))); else tmp = Float64(Float64(a * 0.011111111111111112) * Float64(Float64(pi * angle_m) * Float64(b - a))); end return Float64(angle_s * tmp) end
angle\_m = abs(angle); angle\_s = sign(angle) * abs(1.0); function tmp_2 = code(angle_s, a, b, angle_m) tmp = 0.0; if (a <= 1.55e+173) tmp = cos((2.71828182845904523536 ^ log((pi * (angle_m * 0.005555555555555556))))) * (2.0 * (((a - b) * (b + a)) * sin((angle_m * (pi / -180.0))))); else tmp = (a * 0.011111111111111112) * ((pi * angle_m) * (b - a)); end tmp_2 = angle_s * tmp; end
angle\_m = N[Abs[angle], $MachinePrecision]
angle\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a_, b_, angle$95$m_] := N[(angle$95$s * If[LessEqual[a, 1.55e+173], N[(N[Cos[N[Power[E, N[Log[N[(Pi * N[(angle$95$m * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * N[(2.0 * N[(N[(N[(a - b), $MachinePrecision] * N[(b + a), $MachinePrecision]), $MachinePrecision] * N[Sin[N[(angle$95$m * N[(Pi / -180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(a * 0.011111111111111112), $MachinePrecision] * N[(N[(Pi * angle$95$m), $MachinePrecision] * N[(b - a), $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}\;a \leq 1.55 \cdot 10^{+173}:\\
\;\;\;\;\cos \left({e}^{\log \left(\pi \cdot \left(angle\_m \cdot 0.005555555555555556\right)\right)}\right) \cdot \left(2 \cdot \left(\left(\left(a - b\right) \cdot \left(b + a\right)\right) \cdot \sin \left(angle\_m \cdot \frac{\pi}{-180}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(a \cdot 0.011111111111111112\right) \cdot \left(\left(\pi \cdot angle\_m\right) \cdot \left(b - a\right)\right)\\
\end{array}
\end{array}
if a < 1.55e173Initial program 54.1%
Simplified54.0%
add-sqr-sqrt28.7%
sqrt-unprod47.4%
associate-*r/48.2%
associate-*r/49.1%
frac-times49.2%
*-commutative49.2%
*-commutative49.2%
metadata-eval49.2%
metadata-eval49.2%
frac-times49.1%
associate-*r/48.7%
associate-*r/48.0%
sqrt-unprod28.3%
add-sqr-sqrt54.7%
expm1-log1p-u48.9%
expm1-undefine48.4%
Applied egg-rr48.4%
expm1-define48.9%
Simplified48.9%
unpow248.9%
unpow248.9%
difference-of-squares51.2%
Applied egg-rr51.2%
expm1-log1p-u59.3%
rem-exp-log32.6%
*-un-lft-identity32.6%
exp-prod33.5%
Applied egg-rr32.9%
if 1.55e173 < a Initial program 38.0%
associate-*l*38.0%
*-commutative38.0%
associate-*l*38.0%
Simplified38.0%
Taylor expanded in angle around 0 28.0%
unpow228.0%
unpow228.0%
difference-of-squares44.8%
Applied egg-rr44.8%
Taylor expanded in b around 0 41.4%
Taylor expanded in angle around 0 58.3%
associate-*r*58.3%
associate-*r*58.3%
Simplified58.3%
Final simplification35.8%
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a b angle_m)
:precision binary64
(*
angle_s
(if (<= (pow a 2.0) 2e+255)
(*
0.011111111111111112
(-
(* b (+ (* angle_m (* PI (- a a))) (* angle_m (* b PI))))
(* (pow a 2.0) (* PI angle_m))))
(* (* a 0.011111111111111112) (* (* PI angle_m) (- b a))))))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(a, 2.0) <= 2e+255) {
tmp = 0.011111111111111112 * ((b * ((angle_m * (((double) M_PI) * (a - a))) + (angle_m * (b * ((double) M_PI))))) - (pow(a, 2.0) * (((double) M_PI) * angle_m)));
} else {
tmp = (a * 0.011111111111111112) * ((((double) M_PI) * angle_m) * (b - a));
}
return angle_s * tmp;
}
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b, double angle_m) {
double tmp;
if (Math.pow(a, 2.0) <= 2e+255) {
tmp = 0.011111111111111112 * ((b * ((angle_m * (Math.PI * (a - a))) + (angle_m * (b * Math.PI)))) - (Math.pow(a, 2.0) * (Math.PI * angle_m)));
} else {
tmp = (a * 0.011111111111111112) * ((Math.PI * angle_m) * (b - a));
}
return angle_s * tmp;
}
angle\_m = math.fabs(angle) angle\_s = math.copysign(1.0, angle) def code(angle_s, a, b, angle_m): tmp = 0 if math.pow(a, 2.0) <= 2e+255: tmp = 0.011111111111111112 * ((b * ((angle_m * (math.pi * (a - a))) + (angle_m * (b * math.pi)))) - (math.pow(a, 2.0) * (math.pi * angle_m))) else: tmp = (a * 0.011111111111111112) * ((math.pi * angle_m) * (b - a)) 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 ((a ^ 2.0) <= 2e+255) tmp = Float64(0.011111111111111112 * Float64(Float64(b * Float64(Float64(angle_m * Float64(pi * Float64(a - a))) + Float64(angle_m * Float64(b * pi)))) - Float64((a ^ 2.0) * Float64(pi * angle_m)))); else tmp = Float64(Float64(a * 0.011111111111111112) * Float64(Float64(pi * angle_m) * Float64(b - a))); end return Float64(angle_s * tmp) end
angle\_m = abs(angle); angle\_s = sign(angle) * abs(1.0); function tmp_2 = code(angle_s, a, b, angle_m) tmp = 0.0; if ((a ^ 2.0) <= 2e+255) tmp = 0.011111111111111112 * ((b * ((angle_m * (pi * (a - a))) + (angle_m * (b * pi)))) - ((a ^ 2.0) * (pi * angle_m))); else tmp = (a * 0.011111111111111112) * ((pi * angle_m) * (b - a)); end tmp_2 = angle_s * tmp; end
angle\_m = N[Abs[angle], $MachinePrecision]
angle\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a_, b_, angle$95$m_] := N[(angle$95$s * If[LessEqual[N[Power[a, 2.0], $MachinePrecision], 2e+255], N[(0.011111111111111112 * N[(N[(b * N[(N[(angle$95$m * N[(Pi * N[(a - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(angle$95$m * N[(b * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[Power[a, 2.0], $MachinePrecision] * N[(Pi * angle$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(a * 0.011111111111111112), $MachinePrecision] * N[(N[(Pi * angle$95$m), $MachinePrecision] * N[(b - a), $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}\;{a}^{2} \leq 2 \cdot 10^{+255}:\\
\;\;\;\;0.011111111111111112 \cdot \left(b \cdot \left(angle\_m \cdot \left(\pi \cdot \left(a - a\right)\right) + angle\_m \cdot \left(b \cdot \pi\right)\right) - {a}^{2} \cdot \left(\pi \cdot angle\_m\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(a \cdot 0.011111111111111112\right) \cdot \left(\left(\pi \cdot angle\_m\right) \cdot \left(b - a\right)\right)\\
\end{array}
\end{array}
if (pow.f64 a #s(literal 2 binary64)) < 1.99999999999999998e255Initial program 58.2%
associate-*l*58.2%
*-commutative58.2%
associate-*l*58.2%
Simplified58.2%
Taylor expanded in angle around 0 58.0%
unpow258.0%
unpow258.0%
difference-of-squares58.0%
Applied egg-rr58.0%
Taylor expanded in b around 0 59.9%
if 1.99999999999999998e255 < (pow.f64 a #s(literal 2 binary64)) Initial program 37.6%
associate-*l*37.6%
*-commutative37.6%
associate-*l*37.6%
Simplified37.6%
Taylor expanded in angle around 0 42.8%
unpow242.8%
unpow242.8%
difference-of-squares55.3%
Applied egg-rr55.3%
Taylor expanded in b around 0 48.7%
Taylor expanded in angle around 0 61.8%
associate-*r*61.9%
associate-*r*61.9%
Simplified61.9%
Final simplification60.4%
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a b angle_m)
:precision binary64
(*
angle_s
(if (<= (pow a 2.0) 2e+296)
(* 0.011111111111111112 (* angle_m (* PI (* (- b a) (+ b a)))))
(* (* a 0.011111111111111112) (* (* PI angle_m) (- b a))))))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(a, 2.0) <= 2e+296) {
tmp = 0.011111111111111112 * (angle_m * (((double) M_PI) * ((b - a) * (b + a))));
} else {
tmp = (a * 0.011111111111111112) * ((((double) M_PI) * angle_m) * (b - a));
}
return angle_s * tmp;
}
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b, double angle_m) {
double tmp;
if (Math.pow(a, 2.0) <= 2e+296) {
tmp = 0.011111111111111112 * (angle_m * (Math.PI * ((b - a) * (b + a))));
} else {
tmp = (a * 0.011111111111111112) * ((Math.PI * angle_m) * (b - a));
}
return angle_s * tmp;
}
angle\_m = math.fabs(angle) angle\_s = math.copysign(1.0, angle) def code(angle_s, a, b, angle_m): tmp = 0 if math.pow(a, 2.0) <= 2e+296: tmp = 0.011111111111111112 * (angle_m * (math.pi * ((b - a) * (b + a)))) else: tmp = (a * 0.011111111111111112) * ((math.pi * angle_m) * (b - a)) 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 ((a ^ 2.0) <= 2e+296) tmp = Float64(0.011111111111111112 * Float64(angle_m * Float64(pi * Float64(Float64(b - a) * Float64(b + a))))); else tmp = Float64(Float64(a * 0.011111111111111112) * Float64(Float64(pi * angle_m) * Float64(b - a))); end return Float64(angle_s * tmp) end
angle\_m = abs(angle); angle\_s = sign(angle) * abs(1.0); function tmp_2 = code(angle_s, a, b, angle_m) tmp = 0.0; if ((a ^ 2.0) <= 2e+296) tmp = 0.011111111111111112 * (angle_m * (pi * ((b - a) * (b + a)))); else tmp = (a * 0.011111111111111112) * ((pi * angle_m) * (b - a)); end tmp_2 = angle_s * tmp; end
angle\_m = N[Abs[angle], $MachinePrecision]
angle\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a_, b_, angle$95$m_] := N[(angle$95$s * If[LessEqual[N[Power[a, 2.0], $MachinePrecision], 2e+296], N[(0.011111111111111112 * N[(angle$95$m * N[(Pi * N[(N[(b - a), $MachinePrecision] * N[(b + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(a * 0.011111111111111112), $MachinePrecision] * N[(N[(Pi * angle$95$m), $MachinePrecision] * N[(b - a), $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}\;{a}^{2} \leq 2 \cdot 10^{+296}:\\
\;\;\;\;0.011111111111111112 \cdot \left(angle\_m \cdot \left(\pi \cdot \left(\left(b - a\right) \cdot \left(b + a\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(a \cdot 0.011111111111111112\right) \cdot \left(\left(\pi \cdot angle\_m\right) \cdot \left(b - a\right)\right)\\
\end{array}
\end{array}
if (pow.f64 a #s(literal 2 binary64)) < 1.99999999999999996e296Initial program 58.0%
associate-*l*58.0%
*-commutative58.0%
associate-*l*58.0%
Simplified58.0%
Taylor expanded in angle around 0 58.4%
unpow258.4%
unpow258.4%
difference-of-squares58.4%
Applied egg-rr58.4%
if 1.99999999999999996e296 < (pow.f64 a #s(literal 2 binary64)) Initial program 34.5%
associate-*l*34.5%
*-commutative34.5%
associate-*l*34.5%
Simplified34.5%
Taylor expanded in angle around 0 39.2%
unpow239.2%
unpow239.2%
difference-of-squares53.9%
Applied egg-rr53.9%
Taylor expanded in b around 0 50.6%
Taylor expanded in angle around 0 66.1%
associate-*r*66.1%
associate-*r*66.2%
Simplified66.2%
Final simplification60.3%
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a b angle_m)
:precision binary64
(*
angle_s
(if (<= a 3.25e+150)
(* -0.011111111111111112 (* (* (- a b) (+ b a)) (* PI angle_m)))
(* (* a 0.011111111111111112) (* (* PI angle_m) (- b a))))))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 (a <= 3.25e+150) {
tmp = -0.011111111111111112 * (((a - b) * (b + a)) * (((double) M_PI) * angle_m));
} else {
tmp = (a * 0.011111111111111112) * ((((double) M_PI) * angle_m) * (b - a));
}
return angle_s * tmp;
}
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b, double angle_m) {
double tmp;
if (a <= 3.25e+150) {
tmp = -0.011111111111111112 * (((a - b) * (b + a)) * (Math.PI * angle_m));
} else {
tmp = (a * 0.011111111111111112) * ((Math.PI * angle_m) * (b - a));
}
return angle_s * tmp;
}
angle\_m = math.fabs(angle) angle\_s = math.copysign(1.0, angle) def code(angle_s, a, b, angle_m): tmp = 0 if a <= 3.25e+150: tmp = -0.011111111111111112 * (((a - b) * (b + a)) * (math.pi * angle_m)) else: tmp = (a * 0.011111111111111112) * ((math.pi * angle_m) * (b - a)) 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 (a <= 3.25e+150) tmp = Float64(-0.011111111111111112 * Float64(Float64(Float64(a - b) * Float64(b + a)) * Float64(pi * angle_m))); else tmp = Float64(Float64(a * 0.011111111111111112) * Float64(Float64(pi * angle_m) * Float64(b - a))); end return Float64(angle_s * tmp) end
angle\_m = abs(angle); angle\_s = sign(angle) * abs(1.0); function tmp_2 = code(angle_s, a, b, angle_m) tmp = 0.0; if (a <= 3.25e+150) tmp = -0.011111111111111112 * (((a - b) * (b + a)) * (pi * angle_m)); else tmp = (a * 0.011111111111111112) * ((pi * angle_m) * (b - a)); end tmp_2 = angle_s * tmp; end
angle\_m = N[Abs[angle], $MachinePrecision]
angle\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a_, b_, angle$95$m_] := N[(angle$95$s * If[LessEqual[a, 3.25e+150], N[(-0.011111111111111112 * N[(N[(N[(a - b), $MachinePrecision] * N[(b + a), $MachinePrecision]), $MachinePrecision] * N[(Pi * angle$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(a * 0.011111111111111112), $MachinePrecision] * N[(N[(Pi * angle$95$m), $MachinePrecision] * N[(b - a), $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}\;a \leq 3.25 \cdot 10^{+150}:\\
\;\;\;\;-0.011111111111111112 \cdot \left(\left(\left(a - b\right) \cdot \left(b + a\right)\right) \cdot \left(\pi \cdot angle\_m\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(a \cdot 0.011111111111111112\right) \cdot \left(\left(\pi \cdot angle\_m\right) \cdot \left(b - a\right)\right)\\
\end{array}
\end{array}
if a < 3.25000000000000016e150Initial program 54.6%
Simplified54.5%
add-sqr-sqrt28.5%
sqrt-unprod47.8%
associate-*r/48.7%
associate-*r/49.5%
frac-times49.6%
*-commutative49.6%
*-commutative49.6%
metadata-eval49.6%
metadata-eval49.6%
frac-times49.5%
associate-*r/49.2%
associate-*r/48.4%
sqrt-unprod28.6%
add-sqr-sqrt55.2%
expm1-log1p-u49.3%
expm1-undefine48.9%
Applied egg-rr48.9%
expm1-define49.3%
Simplified49.3%
unpow249.3%
unpow249.3%
difference-of-squares51.6%
Applied egg-rr51.6%
Taylor expanded in angle around 0 59.0%
associate-*r*58.9%
Simplified58.9%
if 3.25000000000000016e150 < a Initial program 35.6%
associate-*l*35.6%
*-commutative35.6%
associate-*l*35.6%
Simplified35.6%
Taylor expanded in angle around 0 29.3%
unpow229.3%
unpow229.3%
difference-of-squares45.3%
Applied egg-rr45.3%
Taylor expanded in b around 0 42.0%
Taylor expanded in angle around 0 57.8%
associate-*r*57.8%
associate-*r*57.8%
Simplified57.8%
Final simplification58.8%
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a b angle_m)
:precision binary64
(*
angle_s
(if (<= a 1.32e-45)
(* 0.011111111111111112 (* angle_m (* PI (* b (- b a)))))
(* 0.011111111111111112 (* a (* (* PI angle_m) (- b a)))))))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 (a <= 1.32e-45) {
tmp = 0.011111111111111112 * (angle_m * (((double) M_PI) * (b * (b - a))));
} else {
tmp = 0.011111111111111112 * (a * ((((double) M_PI) * angle_m) * (b - a)));
}
return angle_s * tmp;
}
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b, double angle_m) {
double tmp;
if (a <= 1.32e-45) {
tmp = 0.011111111111111112 * (angle_m * (Math.PI * (b * (b - a))));
} else {
tmp = 0.011111111111111112 * (a * ((Math.PI * angle_m) * (b - a)));
}
return angle_s * tmp;
}
angle\_m = math.fabs(angle) angle\_s = math.copysign(1.0, angle) def code(angle_s, a, b, angle_m): tmp = 0 if a <= 1.32e-45: tmp = 0.011111111111111112 * (angle_m * (math.pi * (b * (b - a)))) else: tmp = 0.011111111111111112 * (a * ((math.pi * angle_m) * (b - a))) 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 (a <= 1.32e-45) tmp = Float64(0.011111111111111112 * Float64(angle_m * Float64(pi * Float64(b * Float64(b - a))))); else tmp = Float64(0.011111111111111112 * Float64(a * Float64(Float64(pi * angle_m) * Float64(b - a)))); end return Float64(angle_s * tmp) end
angle\_m = abs(angle); angle\_s = sign(angle) * abs(1.0); function tmp_2 = code(angle_s, a, b, angle_m) tmp = 0.0; if (a <= 1.32e-45) tmp = 0.011111111111111112 * (angle_m * (pi * (b * (b - a)))); else tmp = 0.011111111111111112 * (a * ((pi * angle_m) * (b - a))); end tmp_2 = angle_s * tmp; end
angle\_m = N[Abs[angle], $MachinePrecision]
angle\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a_, b_, angle$95$m_] := N[(angle$95$s * If[LessEqual[a, 1.32e-45], N[(0.011111111111111112 * N[(angle$95$m * N[(Pi * N[(b * N[(b - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.011111111111111112 * N[(a * N[(N[(Pi * angle$95$m), $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 \begin{array}{l}
\mathbf{if}\;a \leq 1.32 \cdot 10^{-45}:\\
\;\;\;\;0.011111111111111112 \cdot \left(angle\_m \cdot \left(\pi \cdot \left(b \cdot \left(b - a\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;0.011111111111111112 \cdot \left(a \cdot \left(\left(\pi \cdot angle\_m\right) \cdot \left(b - a\right)\right)\right)\\
\end{array}
\end{array}
if a < 1.32000000000000005e-45Initial program 55.5%
associate-*l*55.5%
*-commutative55.5%
associate-*l*55.5%
Simplified55.5%
Taylor expanded in angle around 0 58.3%
unpow258.3%
unpow258.3%
difference-of-squares60.5%
Applied egg-rr60.5%
Taylor expanded in b around inf 47.8%
if 1.32000000000000005e-45 < a Initial program 44.3%
associate-*l*44.3%
*-commutative44.3%
associate-*l*44.3%
Simplified44.3%
Taylor expanded in angle around 0 42.5%
unpow242.5%
unpow242.5%
difference-of-squares49.3%
Applied egg-rr49.3%
Taylor expanded in b around 0 37.9%
Taylor expanded in angle around 0 44.6%
associate-*r*44.6%
Simplified44.6%
Final simplification46.8%
angle\_m = (fabs.f64 angle) angle\_s = (copysign.f64 #s(literal 1 binary64) angle) (FPCore (angle_s a b angle_m) :precision binary64 (* angle_s (* 0.011111111111111112 (* a (* (* PI angle_m) (- 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 * (a * ((((double) M_PI) * angle_m) * (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 * (a * ((Math.PI * angle_m) * (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 * (a * ((math.pi * angle_m) * (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(a * Float64(Float64(pi * angle_m) * 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 * (a * ((pi * angle_m) * (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[(a * N[(N[(Pi * angle$95$m), $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(a \cdot \left(\left(\pi \cdot angle\_m\right) \cdot \left(b - a\right)\right)\right)\right)
\end{array}
Initial program 52.2%
associate-*l*52.2%
*-commutative52.2%
associate-*l*52.2%
Simplified52.2%
Taylor expanded in angle around 0 53.6%
unpow253.6%
unpow253.6%
difference-of-squares57.3%
Applied egg-rr57.3%
Taylor expanded in b around 0 35.6%
Taylor expanded in angle around 0 39.8%
associate-*r*39.8%
Simplified39.8%
Final simplification39.8%
angle\_m = (fabs.f64 angle) angle\_s = (copysign.f64 #s(literal 1 binary64) angle) (FPCore (angle_s a b angle_m) :precision binary64 (* angle_s (* 0.011111111111111112 (* angle_m (* PI (* 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))));
}
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))));
}
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))))
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(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)))); 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[(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(angle\_m \cdot \left(\pi \cdot \left(b \cdot a\right)\right)\right)\right)
\end{array}
Initial program 52.2%
associate-*l*52.2%
*-commutative52.2%
associate-*l*52.2%
Simplified52.2%
Taylor expanded in angle around 0 53.6%
unpow253.6%
unpow253.6%
difference-of-squares57.3%
Applied egg-rr57.3%
Taylor expanded in b around 0 35.6%
Taylor expanded in a around 0 19.7%
Final simplification19.7%
angle\_m = (fabs.f64 angle) angle\_s = (copysign.f64 #s(literal 1 binary64) angle) (FPCore (angle_s a b angle_m) :precision binary64 (* angle_s (* 0.011111111111111112 (* angle_m (* a (* b PI))))))
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 * (a * (b * ((double) M_PI)))));
}
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 * (a * (b * Math.PI))));
}
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 * (a * (b * math.pi))))
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(a * Float64(b * pi))))) 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 * (a * (b * pi)))); 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[(a * N[(b * Pi), $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(a \cdot \left(b \cdot \pi\right)\right)\right)\right)
\end{array}
Initial program 52.2%
associate-*l*52.2%
*-commutative52.2%
associate-*l*52.2%
Simplified52.2%
Taylor expanded in angle around 0 53.6%
unpow253.6%
unpow253.6%
difference-of-squares57.3%
Applied egg-rr57.3%
Taylor expanded in b around 0 35.6%
Taylor expanded in a around 0 19.7%
*-commutative19.7%
Simplified19.7%
Final simplification19.7%
angle\_m = (fabs.f64 angle) angle\_s = (copysign.f64 #s(literal 1 binary64) angle) (FPCore (angle_s a b angle_m) :precision binary64 (* angle_s (* 0.011111111111111112 (* a (* angle_m (* b PI))))))
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 * (a * (angle_m * (b * ((double) M_PI)))));
}
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 * (a * (angle_m * (b * Math.PI))));
}
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 * (a * (angle_m * (b * math.pi))))
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(a * Float64(angle_m * Float64(b * pi))))) 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 * (a * (angle_m * (b * pi)))); 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[(a * N[(angle$95$m * N[(b * Pi), $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(a \cdot \left(angle\_m \cdot \left(b \cdot \pi\right)\right)\right)\right)
\end{array}
Initial program 52.2%
associate-*l*52.2%
*-commutative52.2%
associate-*l*52.2%
Simplified52.2%
Taylor expanded in angle around 0 53.6%
unpow253.6%
unpow253.6%
difference-of-squares57.3%
Applied egg-rr57.3%
Taylor expanded in b around 0 35.6%
Taylor expanded in a around 0 19.4%
*-commutative19.4%
Simplified19.4%
Final simplification19.4%
herbie shell --seed 2024150
(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)))))