
(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 21 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 (cos (* angle_m (/ PI -180.0))))
(t_1 (* PI (/ angle_m 180.0)))
(t_2 (* (* (* 2.0 (- (pow b 2.0) (pow a 2.0))) (sin t_1)) (cos t_1)))
(t_3 (sin (* angle_m (* PI -0.005555555555555556)))))
(*
angle_s
(if (<= t_2 -2e-266)
(* t_0 (* 2.0 (- (* a (* a t_3)) (* (pow b 2.0) t_3))))
(if (<= t_2 INFINITY)
(* t_0 (* 2.0 (fma b (* t_3 (- b)) (* (pow a 2.0) t_3))))
(*
t_0
(*
2.0
(*
(* angle_m -0.005555555555555556)
(* (* PI (+ b a)) (- a b))))))))))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((angle_m * (((double) M_PI) / -180.0)));
double t_1 = ((double) M_PI) * (angle_m / 180.0);
double t_2 = ((2.0 * (pow(b, 2.0) - pow(a, 2.0))) * sin(t_1)) * cos(t_1);
double t_3 = sin((angle_m * (((double) M_PI) * -0.005555555555555556)));
double tmp;
if (t_2 <= -2e-266) {
tmp = t_0 * (2.0 * ((a * (a * t_3)) - (pow(b, 2.0) * t_3)));
} else if (t_2 <= ((double) INFINITY)) {
tmp = t_0 * (2.0 * fma(b, (t_3 * -b), (pow(a, 2.0) * t_3)));
} else {
tmp = t_0 * (2.0 * ((angle_m * -0.005555555555555556) * ((((double) M_PI) * (b + a)) * (a - b))));
}
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(Float64(angle_m * Float64(pi / -180.0))) t_1 = Float64(pi * Float64(angle_m / 180.0)) t_2 = Float64(Float64(Float64(2.0 * Float64((b ^ 2.0) - (a ^ 2.0))) * sin(t_1)) * cos(t_1)) t_3 = sin(Float64(angle_m * Float64(pi * -0.005555555555555556))) tmp = 0.0 if (t_2 <= -2e-266) tmp = Float64(t_0 * Float64(2.0 * Float64(Float64(a * Float64(a * t_3)) - Float64((b ^ 2.0) * t_3)))); elseif (t_2 <= Inf) tmp = Float64(t_0 * Float64(2.0 * fma(b, Float64(t_3 * Float64(-b)), Float64((a ^ 2.0) * t_3)))); else tmp = Float64(t_0 * Float64(2.0 * Float64(Float64(angle_m * -0.005555555555555556) * Float64(Float64(pi * Float64(b + a)) * Float64(a - b))))); 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[(angle$95$m * N[(Pi / -180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(Pi * N[(angle$95$m / 180.0), $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$1], $MachinePrecision]), $MachinePrecision] * N[Cos[t$95$1], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[Sin[N[(angle$95$m * N[(Pi * -0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, N[(angle$95$s * If[LessEqual[t$95$2, -2e-266], N[(t$95$0 * N[(2.0 * N[(N[(a * N[(a * t$95$3), $MachinePrecision]), $MachinePrecision] - N[(N[Power[b, 2.0], $MachinePrecision] * t$95$3), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, Infinity], N[(t$95$0 * N[(2.0 * N[(b * N[(t$95$3 * (-b)), $MachinePrecision] + N[(N[Power[a, 2.0], $MachinePrecision] * t$95$3), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$0 * N[(2.0 * N[(N[(angle$95$m * -0.005555555555555556), $MachinePrecision] * N[(N[(Pi * N[(b + a), $MachinePrecision]), $MachinePrecision] * N[(a - b), $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(angle\_m \cdot \frac{\pi}{-180}\right)\\
t_1 := \pi \cdot \frac{angle\_m}{180}\\
t_2 := \left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin t\_1\right) \cdot \cos t\_1\\
t_3 := \sin \left(angle\_m \cdot \left(\pi \cdot -0.005555555555555556\right)\right)\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_2 \leq -2 \cdot 10^{-266}:\\
\;\;\;\;t\_0 \cdot \left(2 \cdot \left(a \cdot \left(a \cdot t\_3\right) - {b}^{2} \cdot t\_3\right)\right)\\
\mathbf{elif}\;t\_2 \leq \infty:\\
\;\;\;\;t\_0 \cdot \left(2 \cdot \mathsf{fma}\left(b, t\_3 \cdot \left(-b\right), {a}^{2} \cdot t\_3\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0 \cdot \left(2 \cdot \left(\left(angle\_m \cdot -0.005555555555555556\right) \cdot \left(\left(\pi \cdot \left(b + a\right)\right) \cdot \left(a - b\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))))) < -2e-266Initial program 45.0%
Simplified46.7%
unpow246.7%
unpow246.7%
difference-of-squares46.6%
Applied egg-rr46.6%
Taylor expanded in a around 0 54.1%
+-commutative54.1%
mul-1-neg54.1%
unsub-neg54.1%
Simplified54.8%
if -2e-266 < (*.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 67.1%
Simplified68.2%
unpow268.2%
unpow268.2%
difference-of-squares68.2%
Applied egg-rr68.2%
Taylor expanded in b around 0 70.8%
fma-define70.8%
+-commutative70.8%
*-commutative70.8%
distribute-rgt1-in70.8%
metadata-eval70.8%
mul0-lft70.8%
associate-*r*70.8%
distribute-rgt-out70.8%
*-commutative70.8%
associate-*r*72.1%
mul-1-neg72.1%
Simplified72.7%
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%
unpow20.0%
unpow20.0%
difference-of-squares61.5%
Applied egg-rr61.5%
Taylor expanded in angle around 0 78.1%
associate-*r*78.1%
associate-*r*78.1%
Simplified78.1%
Final simplification65.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 180.0)))
(t_1 (* angle_m (* PI -0.005555555555555556)))
(t_2 (* (* (* 2.0 (- (pow b 2.0) (pow a 2.0))) (sin t_0)) (cos t_0)))
(t_3 (* angle_m (/ PI -180.0))))
(*
angle_s
(if (<= t_2 (- INFINITY))
(* (* a 0.011111111111111112) (* (- b a) (* PI angle_m)))
(if (<= t_2 5e+268)
(*
(cos (/ (* PI angle_m) 180.0))
(* 2.0 (* (sin t_3) (- (pow a 2.0) (pow b 2.0)))))
(if (<= t_2 INFINITY)
(* 2.0 (fma b (* (- b) t_1) (* (pow a 2.0) (sin t_1))))
(*
(cos t_3)
(*
2.0
(*
(* angle_m -0.005555555555555556)
(* (* PI (+ b a)) (- a b)))))))))))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 = angle_m * (((double) M_PI) * -0.005555555555555556);
double t_2 = ((2.0 * (pow(b, 2.0) - pow(a, 2.0))) * sin(t_0)) * cos(t_0);
double t_3 = angle_m * (((double) M_PI) / -180.0);
double tmp;
if (t_2 <= -((double) INFINITY)) {
tmp = (a * 0.011111111111111112) * ((b - a) * (((double) M_PI) * angle_m));
} else if (t_2 <= 5e+268) {
tmp = cos(((((double) M_PI) * angle_m) / 180.0)) * (2.0 * (sin(t_3) * (pow(a, 2.0) - pow(b, 2.0))));
} else if (t_2 <= ((double) INFINITY)) {
tmp = 2.0 * fma(b, (-b * t_1), (pow(a, 2.0) * sin(t_1)));
} else {
tmp = cos(t_3) * (2.0 * ((angle_m * -0.005555555555555556) * ((((double) M_PI) * (b + a)) * (a - b))));
}
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 = Float64(angle_m * Float64(pi * -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(angle_m * Float64(pi / -180.0)) tmp = 0.0 if (t_2 <= Float64(-Inf)) tmp = Float64(Float64(a * 0.011111111111111112) * Float64(Float64(b - a) * Float64(pi * angle_m))); elseif (t_2 <= 5e+268) tmp = Float64(cos(Float64(Float64(pi * angle_m) / 180.0)) * Float64(2.0 * Float64(sin(t_3) * Float64((a ^ 2.0) - (b ^ 2.0))))); elseif (t_2 <= Inf) tmp = Float64(2.0 * fma(b, Float64(Float64(-b) * t_1), Float64((a ^ 2.0) * sin(t_1)))); else tmp = Float64(cos(t_3) * Float64(2.0 * Float64(Float64(angle_m * -0.005555555555555556) * Float64(Float64(pi * Float64(b + a)) * Float64(a - b))))); 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[(angle$95$m * N[(Pi * -0.005555555555555556), $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[(angle$95$m * N[(Pi / -180.0), $MachinePrecision]), $MachinePrecision]}, N[(angle$95$s * If[LessEqual[t$95$2, (-Infinity)], N[(N[(a * 0.011111111111111112), $MachinePrecision] * N[(N[(b - a), $MachinePrecision] * N[(Pi * angle$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 5e+268], N[(N[Cos[N[(N[(Pi * angle$95$m), $MachinePrecision] / 180.0), $MachinePrecision]], $MachinePrecision] * N[(2.0 * N[(N[Sin[t$95$3], $MachinePrecision] * N[(N[Power[a, 2.0], $MachinePrecision] - N[Power[b, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, Infinity], N[(2.0 * N[(b * N[((-b) * t$95$1), $MachinePrecision] + N[(N[Power[a, 2.0], $MachinePrecision] * N[Sin[t$95$1], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Cos[t$95$3], $MachinePrecision] * N[(2.0 * N[(N[(angle$95$m * -0.005555555555555556), $MachinePrecision] * N[(N[(Pi * N[(b + a), $MachinePrecision]), $MachinePrecision] * N[(a - b), $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 := angle\_m \cdot \left(\pi \cdot -0.005555555555555556\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 := angle\_m \cdot \frac{\pi}{-180}\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_2 \leq -\infty:\\
\;\;\;\;\left(a \cdot 0.011111111111111112\right) \cdot \left(\left(b - a\right) \cdot \left(\pi \cdot angle\_m\right)\right)\\
\mathbf{elif}\;t\_2 \leq 5 \cdot 10^{+268}:\\
\;\;\;\;\cos \left(\frac{\pi \cdot angle\_m}{180}\right) \cdot \left(2 \cdot \left(\sin t\_3 \cdot \left({a}^{2} - {b}^{2}\right)\right)\right)\\
\mathbf{elif}\;t\_2 \leq \infty:\\
\;\;\;\;2 \cdot \mathsf{fma}\left(b, \left(-b\right) \cdot t\_1, {a}^{2} \cdot \sin t\_1\right)\\
\mathbf{else}:\\
\;\;\;\;\cos t\_3 \cdot \left(2 \cdot \left(\left(angle\_m \cdot -0.005555555555555556\right) \cdot \left(\left(\pi \cdot \left(b + a\right)\right) \cdot \left(a - b\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))))) < -inf.0Initial program 39.1%
associate-*l*39.1%
associate-*l*39.1%
Simplified39.1%
Taylor expanded in angle around 0 32.8%
unpow232.8%
unpow232.8%
difference-of-squares32.8%
Applied egg-rr32.8%
Taylor expanded in b around 0 23.4%
Taylor expanded in angle around 0 41.7%
associate-*r*41.8%
associate-*r*41.8%
Simplified41.8%
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))))) < 5.0000000000000002e268Initial program 65.0%
Simplified65.2%
add-sqr-sqrt33.4%
sqrt-unprod58.9%
associate-*r/59.1%
associate-*r/59.2%
frac-times59.3%
*-commutative59.3%
*-commutative59.3%
metadata-eval59.3%
metadata-eval59.3%
frac-times59.2%
associate-*r/59.2%
associate-*r/59.0%
sqrt-unprod32.2%
add-sqr-sqrt65.3%
associate-*r/65.7%
Applied egg-rr65.7%
if 5.0000000000000002e268 < (*.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 56.9%
Simplified59.5%
unpow259.5%
unpow259.5%
difference-of-squares59.5%
Applied egg-rr59.5%
Taylor expanded in b around 0 68.3%
fma-define68.3%
+-commutative68.3%
*-commutative68.3%
distribute-rgt1-in68.3%
metadata-eval68.3%
mul0-lft68.3%
associate-*r*68.3%
distribute-rgt-out68.3%
*-commutative68.3%
associate-*r*71.1%
mul-1-neg71.1%
Simplified73.7%
Taylor expanded in angle around 0 62.2%
Taylor expanded in angle around 0 59.6%
*-commutative59.6%
associate-*r*59.6%
*-commutative59.6%
Simplified59.6%
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%
unpow20.0%
unpow20.0%
difference-of-squares61.5%
Applied egg-rr61.5%
Taylor expanded in angle around 0 78.1%
associate-*r*78.1%
associate-*r*78.1%
Simplified78.1%
Final simplification59.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 (cos (* angle_m (/ PI -180.0))))
(t_1 (- (pow b 2.0) (pow a 2.0)))
(t_2 (sin (* angle_m (* PI -0.005555555555555556)))))
(*
angle_s
(if (<= t_1 4e+51)
(* t_0 (* 2.0 (- (* a (* a t_2)) (* (pow b 2.0) t_2))))
(if (<= t_1 INFINITY)
(* 2.0 (fma b (* t_2 (- b)) (* (pow a 2.0) t_2)))
(*
t_0
(*
2.0
(*
(* angle_m -0.005555555555555556)
(* (* PI (+ b a)) (- a b))))))))))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((angle_m * (((double) M_PI) / -180.0)));
double t_1 = pow(b, 2.0) - pow(a, 2.0);
double t_2 = sin((angle_m * (((double) M_PI) * -0.005555555555555556)));
double tmp;
if (t_1 <= 4e+51) {
tmp = t_0 * (2.0 * ((a * (a * t_2)) - (pow(b, 2.0) * t_2)));
} else if (t_1 <= ((double) INFINITY)) {
tmp = 2.0 * fma(b, (t_2 * -b), (pow(a, 2.0) * t_2));
} else {
tmp = t_0 * (2.0 * ((angle_m * -0.005555555555555556) * ((((double) M_PI) * (b + a)) * (a - b))));
}
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(Float64(angle_m * Float64(pi / -180.0))) t_1 = Float64((b ^ 2.0) - (a ^ 2.0)) t_2 = sin(Float64(angle_m * Float64(pi * -0.005555555555555556))) tmp = 0.0 if (t_1 <= 4e+51) tmp = Float64(t_0 * Float64(2.0 * Float64(Float64(a * Float64(a * t_2)) - Float64((b ^ 2.0) * t_2)))); elseif (t_1 <= Inf) tmp = Float64(2.0 * fma(b, Float64(t_2 * Float64(-b)), Float64((a ^ 2.0) * t_2))); else tmp = Float64(t_0 * Float64(2.0 * Float64(Float64(angle_m * -0.005555555555555556) * Float64(Float64(pi * Float64(b + a)) * Float64(a - b))))); 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[(angle$95$m * N[(Pi / -180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(N[Power[b, 2.0], $MachinePrecision] - N[Power[a, 2.0], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Sin[N[(angle$95$m * N[(Pi * -0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, N[(angle$95$s * If[LessEqual[t$95$1, 4e+51], N[(t$95$0 * N[(2.0 * N[(N[(a * N[(a * t$95$2), $MachinePrecision]), $MachinePrecision] - N[(N[Power[b, 2.0], $MachinePrecision] * t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, Infinity], N[(2.0 * N[(b * N[(t$95$2 * (-b)), $MachinePrecision] + N[(N[Power[a, 2.0], $MachinePrecision] * t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$0 * N[(2.0 * N[(N[(angle$95$m * -0.005555555555555556), $MachinePrecision] * N[(N[(Pi * N[(b + a), $MachinePrecision]), $MachinePrecision] * N[(a - b), $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(angle\_m \cdot \frac{\pi}{-180}\right)\\
t_1 := {b}^{2} - {a}^{2}\\
t_2 := \sin \left(angle\_m \cdot \left(\pi \cdot -0.005555555555555556\right)\right)\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_1 \leq 4 \cdot 10^{+51}:\\
\;\;\;\;t\_0 \cdot \left(2 \cdot \left(a \cdot \left(a \cdot t\_2\right) - {b}^{2} \cdot t\_2\right)\right)\\
\mathbf{elif}\;t\_1 \leq \infty:\\
\;\;\;\;2 \cdot \mathsf{fma}\left(b, t\_2 \cdot \left(-b\right), {a}^{2} \cdot t\_2\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0 \cdot \left(2 \cdot \left(\left(angle\_m \cdot -0.005555555555555556\right) \cdot \left(\left(\pi \cdot \left(b + a\right)\right) \cdot \left(a - b\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))) < 4e51Initial program 62.1%
Simplified61.7%
unpow261.7%
unpow261.7%
difference-of-squares61.7%
Applied egg-rr61.7%
Taylor expanded in a around 0 69.4%
+-commutative69.4%
mul-1-neg69.4%
unsub-neg69.4%
Simplified70.6%
if 4e51 < (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) < +inf.0Initial program 45.5%
Simplified50.3%
unpow250.3%
unpow250.3%
difference-of-squares50.3%
Applied egg-rr50.3%
Taylor expanded in b around 0 70.6%
fma-define70.6%
+-commutative70.6%
*-commutative70.6%
distribute-rgt1-in70.6%
metadata-eval70.6%
mul0-lft70.6%
associate-*r*70.6%
distribute-rgt-out70.6%
*-commutative70.6%
associate-*r*72.2%
mul-1-neg72.2%
Simplified72.2%
Taylor expanded in angle around 0 71.0%
if +inf.0 < (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) Initial program 0.0%
Simplified0.0%
unpow20.0%
unpow20.0%
difference-of-squares61.5%
Applied egg-rr61.5%
Taylor expanded in angle around 0 78.1%
associate-*r*78.1%
associate-*r*78.1%
Simplified78.1%
Final simplification71.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 (sin (* angle_m (* PI -0.005555555555555556)))))
(*
angle_s
(if (<= a 2.5e+125)
(* 2.0 (fma b (* t_0 (- b)) (* (pow a 2.0) t_0)))
(if (<= a 8.8e+182)
(* (* (* angle_m 0.011111111111111112) (* a PI)) (- b a))
(*
(cos (exp (log (* PI (* angle_m 0.005555555555555556)))))
(* 2.0 (* (sin (* angle_m (/ PI -180.0))) (* (+ b a) (- a b))))))))))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((angle_m * (((double) M_PI) * -0.005555555555555556)));
double tmp;
if (a <= 2.5e+125) {
tmp = 2.0 * fma(b, (t_0 * -b), (pow(a, 2.0) * t_0));
} else if (a <= 8.8e+182) {
tmp = ((angle_m * 0.011111111111111112) * (a * ((double) M_PI))) * (b - a);
} else {
tmp = cos(exp(log((((double) M_PI) * (angle_m * 0.005555555555555556))))) * (2.0 * (sin((angle_m * (((double) M_PI) / -180.0))) * ((b + a) * (a - b))));
}
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(angle_m * Float64(pi * -0.005555555555555556))) tmp = 0.0 if (a <= 2.5e+125) tmp = Float64(2.0 * fma(b, Float64(t_0 * Float64(-b)), Float64((a ^ 2.0) * t_0))); elseif (a <= 8.8e+182) tmp = Float64(Float64(Float64(angle_m * 0.011111111111111112) * Float64(a * pi)) * Float64(b - a)); else tmp = Float64(cos(exp(log(Float64(pi * Float64(angle_m * 0.005555555555555556))))) * Float64(2.0 * Float64(sin(Float64(angle_m * Float64(pi / -180.0))) * Float64(Float64(b + a) * Float64(a - b))))); 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[(angle$95$m * N[(Pi * -0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, N[(angle$95$s * If[LessEqual[a, 2.5e+125], N[(2.0 * N[(b * N[(t$95$0 * (-b)), $MachinePrecision] + N[(N[Power[a, 2.0], $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 8.8e+182], N[(N[(N[(angle$95$m * 0.011111111111111112), $MachinePrecision] * N[(a * Pi), $MachinePrecision]), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision], N[(N[Cos[N[Exp[N[Log[N[(Pi * N[(angle$95$m * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * N[(2.0 * N[(N[Sin[N[(angle$95$m * N[(Pi / -180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(N[(b + a), $MachinePrecision] * N[(a - b), $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 := \sin \left(angle\_m \cdot \left(\pi \cdot -0.005555555555555556\right)\right)\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;a \leq 2.5 \cdot 10^{+125}:\\
\;\;\;\;2 \cdot \mathsf{fma}\left(b, t\_0 \cdot \left(-b\right), {a}^{2} \cdot t\_0\right)\\
\mathbf{elif}\;a \leq 8.8 \cdot 10^{+182}:\\
\;\;\;\;\left(\left(angle\_m \cdot 0.011111111111111112\right) \cdot \left(a \cdot \pi\right)\right) \cdot \left(b - a\right)\\
\mathbf{else}:\\
\;\;\;\;\cos \left(e^{\log \left(\pi \cdot \left(angle\_m \cdot 0.005555555555555556\right)\right)}\right) \cdot \left(2 \cdot \left(\sin \left(angle\_m \cdot \frac{\pi}{-180}\right) \cdot \left(\left(b + a\right) \cdot \left(a - b\right)\right)\right)\right)\\
\end{array}
\end{array}
\end{array}
if a < 2.49999999999999981e125Initial program 53.5%
Simplified54.6%
unpow254.6%
unpow254.6%
difference-of-squares57.8%
Applied egg-rr57.8%
Taylor expanded in b around 0 62.4%
fma-define65.6%
+-commutative65.6%
*-commutative65.6%
distribute-rgt1-in65.6%
metadata-eval65.6%
mul0-lft65.6%
associate-*r*65.6%
distribute-rgt-out65.6%
*-commutative65.6%
associate-*r*65.9%
mul-1-neg65.9%
Simplified65.3%
Taylor expanded in angle around 0 64.5%
if 2.49999999999999981e125 < a < 8.79999999999999986e182Initial program 47.6%
associate-*l*47.6%
associate-*l*47.6%
Simplified47.6%
Taylor expanded in angle around 0 33.2%
unpow233.2%
unpow233.2%
difference-of-squares39.4%
Applied egg-rr39.4%
Taylor expanded in b around 0 33.2%
pow133.2%
associate-*r*33.2%
associate-*r*33.3%
Applied egg-rr33.3%
unpow133.3%
associate-*r*57.1%
*-commutative57.1%
*-commutative57.1%
Simplified57.1%
if 8.79999999999999986e182 < a Initial program 45.9%
Simplified50.9%
unpow250.9%
unpow250.9%
difference-of-squares70.9%
Applied egg-rr70.9%
add-exp-log45.0%
add-sqr-sqrt45.0%
sqrt-unprod50.9%
associate-*r/50.9%
associate-*r/50.9%
frac-times50.9%
*-commutative50.9%
*-commutative50.9%
metadata-eval50.9%
metadata-eval50.9%
frac-times50.9%
associate-*r/50.9%
associate-*r/50.9%
sqrt-unprod40.9%
add-sqr-sqrt40.9%
div-inv40.9%
metadata-eval40.9%
Applied egg-rr40.9%
Final simplification62.2%
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 -0.005555555555555556))))
(*
angle_s
(if (<= (/ angle_m 180.0) 1.5e-139)
(* 2.0 (fma b (* (- b) t_0) (* (pow a 2.0) (sin t_0))))
(*
(cos (exp (log (* PI (* angle_m 0.005555555555555556)))))
(* 2.0 (* (sin (* angle_m (/ PI -180.0))) (* (+ b a) (- a b)))))))))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) * -0.005555555555555556);
double tmp;
if ((angle_m / 180.0) <= 1.5e-139) {
tmp = 2.0 * fma(b, (-b * t_0), (pow(a, 2.0) * sin(t_0)));
} else {
tmp = cos(exp(log((((double) M_PI) * (angle_m * 0.005555555555555556))))) * (2.0 * (sin((angle_m * (((double) M_PI) / -180.0))) * ((b + a) * (a - b))));
}
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 * -0.005555555555555556)) tmp = 0.0 if (Float64(angle_m / 180.0) <= 1.5e-139) tmp = Float64(2.0 * fma(b, Float64(Float64(-b) * t_0), Float64((a ^ 2.0) * sin(t_0)))); else tmp = Float64(cos(exp(log(Float64(pi * Float64(angle_m * 0.005555555555555556))))) * Float64(2.0 * Float64(sin(Float64(angle_m * Float64(pi / -180.0))) * Float64(Float64(b + a) * Float64(a - b))))); 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[(angle$95$m * N[(Pi * -0.005555555555555556), $MachinePrecision]), $MachinePrecision]}, N[(angle$95$s * If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 1.5e-139], N[(2.0 * N[(b * N[((-b) * t$95$0), $MachinePrecision] + N[(N[Power[a, 2.0], $MachinePrecision] * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Cos[N[Exp[N[Log[N[(Pi * N[(angle$95$m * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * N[(2.0 * N[(N[Sin[N[(angle$95$m * N[(Pi / -180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(N[(b + a), $MachinePrecision] * N[(a - b), $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 := angle\_m \cdot \left(\pi \cdot -0.005555555555555556\right)\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;\frac{angle\_m}{180} \leq 1.5 \cdot 10^{-139}:\\
\;\;\;\;2 \cdot \mathsf{fma}\left(b, \left(-b\right) \cdot t\_0, {a}^{2} \cdot \sin t\_0\right)\\
\mathbf{else}:\\
\;\;\;\;\cos \left(e^{\log \left(\pi \cdot \left(angle\_m \cdot 0.005555555555555556\right)\right)}\right) \cdot \left(2 \cdot \left(\sin \left(angle\_m \cdot \frac{\pi}{-180}\right) \cdot \left(\left(b + a\right) \cdot \left(a - b\right)\right)\right)\right)\\
\end{array}
\end{array}
\end{array}
if (/.f64 angle #s(literal 180 binary64)) < 1.5e-139Initial program 54.7%
Simplified56.0%
unpow256.0%
unpow256.0%
difference-of-squares58.4%
Applied egg-rr58.4%
Taylor expanded in b around 0 65.2%
fma-define68.1%
+-commutative68.1%
*-commutative68.1%
distribute-rgt1-in68.1%
metadata-eval68.1%
mul0-lft68.1%
associate-*r*68.1%
distribute-rgt-out68.1%
*-commutative68.1%
associate-*r*67.7%
mul-1-neg67.7%
Simplified69.4%
Taylor expanded in angle around 0 66.5%
Taylor expanded in angle around 0 61.7%
*-commutative61.7%
associate-*r*61.7%
*-commutative61.7%
Simplified61.7%
if 1.5e-139 < (/.f64 angle #s(literal 180 binary64)) Initial program 48.3%
Simplified49.7%
unpow249.7%
unpow249.7%
difference-of-squares57.7%
Applied egg-rr57.7%
add-exp-log0.0%
add-sqr-sqrt0.0%
sqrt-unprod45.8%
associate-*r/45.8%
associate-*r/45.8%
frac-times45.8%
*-commutative45.8%
*-commutative45.8%
metadata-eval45.8%
metadata-eval45.8%
frac-times45.8%
associate-*r/45.8%
associate-*r/45.8%
sqrt-unprod64.0%
add-sqr-sqrt64.0%
div-inv64.0%
metadata-eval64.0%
Applied egg-rr64.0%
Final simplification62.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 (* angle_m (* PI -0.005555555555555556)))
(t_1 (* (+ b a) (- a b))))
(*
angle_s
(if (<= (/ angle_m 180.0) 1.5e-139)
(* 2.0 (fma b (* (- b) t_0) (* (pow a 2.0) (sin t_0))))
(if (<= (/ angle_m 180.0) 2e+223)
(*
(* 2.0 (* (sin (* angle_m (/ PI -180.0))) t_1))
(cos (/ 1.0 (/ 180.0 (* PI angle_m)))))
(*
(cos (* -0.005555555555555556 (* PI angle_m)))
(* 2.0 (* (sin (* PI (/ angle_m 180.0))) 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 = angle_m * (((double) M_PI) * -0.005555555555555556);
double t_1 = (b + a) * (a - b);
double tmp;
if ((angle_m / 180.0) <= 1.5e-139) {
tmp = 2.0 * fma(b, (-b * t_0), (pow(a, 2.0) * sin(t_0)));
} else if ((angle_m / 180.0) <= 2e+223) {
tmp = (2.0 * (sin((angle_m * (((double) M_PI) / -180.0))) * t_1)) * cos((1.0 / (180.0 / (((double) M_PI) * angle_m))));
} else {
tmp = cos((-0.005555555555555556 * (((double) M_PI) * angle_m))) * (2.0 * (sin((((double) M_PI) * (angle_m / 180.0))) * 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(angle_m * Float64(pi * -0.005555555555555556)) t_1 = Float64(Float64(b + a) * Float64(a - b)) tmp = 0.0 if (Float64(angle_m / 180.0) <= 1.5e-139) tmp = Float64(2.0 * fma(b, Float64(Float64(-b) * t_0), Float64((a ^ 2.0) * sin(t_0)))); elseif (Float64(angle_m / 180.0) <= 2e+223) tmp = Float64(Float64(2.0 * Float64(sin(Float64(angle_m * Float64(pi / -180.0))) * t_1)) * cos(Float64(1.0 / Float64(180.0 / Float64(pi * angle_m))))); else tmp = Float64(cos(Float64(-0.005555555555555556 * Float64(pi * angle_m))) * Float64(2.0 * Float64(sin(Float64(pi * Float64(angle_m / 180.0))) * 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[(angle$95$m * N[(Pi * -0.005555555555555556), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(b + a), $MachinePrecision] * N[(a - b), $MachinePrecision]), $MachinePrecision]}, N[(angle$95$s * If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 1.5e-139], N[(2.0 * N[(b * N[((-b) * t$95$0), $MachinePrecision] + N[(N[Power[a, 2.0], $MachinePrecision] * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 2e+223], N[(N[(2.0 * N[(N[Sin[N[(angle$95$m * N[(Pi / -180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision] * N[Cos[N[(1.0 / N[(180.0 / N[(Pi * angle$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Cos[N[(-0.005555555555555556 * N[(Pi * angle$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(2.0 * N[(N[Sin[N[(Pi * N[(angle$95$m / 180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]]]
\begin{array}{l}
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
\begin{array}{l}
t_0 := angle\_m \cdot \left(\pi \cdot -0.005555555555555556\right)\\
t_1 := \left(b + a\right) \cdot \left(a - b\right)\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;\frac{angle\_m}{180} \leq 1.5 \cdot 10^{-139}:\\
\;\;\;\;2 \cdot \mathsf{fma}\left(b, \left(-b\right) \cdot t\_0, {a}^{2} \cdot \sin t\_0\right)\\
\mathbf{elif}\;\frac{angle\_m}{180} \leq 2 \cdot 10^{+223}:\\
\;\;\;\;\left(2 \cdot \left(\sin \left(angle\_m \cdot \frac{\pi}{-180}\right) \cdot t\_1\right)\right) \cdot \cos \left(\frac{1}{\frac{180}{\pi \cdot angle\_m}}\right)\\
\mathbf{else}:\\
\;\;\;\;\cos \left(-0.005555555555555556 \cdot \left(\pi \cdot angle\_m\right)\right) \cdot \left(2 \cdot \left(\sin \left(\pi \cdot \frac{angle\_m}{180}\right) \cdot t\_1\right)\right)\\
\end{array}
\end{array}
\end{array}
if (/.f64 angle #s(literal 180 binary64)) < 1.5e-139Initial program 54.7%
Simplified56.0%
unpow256.0%
unpow256.0%
difference-of-squares58.4%
Applied egg-rr58.4%
Taylor expanded in b around 0 65.2%
fma-define68.1%
+-commutative68.1%
*-commutative68.1%
distribute-rgt1-in68.1%
metadata-eval68.1%
mul0-lft68.1%
associate-*r*68.1%
distribute-rgt-out68.1%
*-commutative68.1%
associate-*r*67.7%
mul-1-neg67.7%
Simplified69.4%
Taylor expanded in angle around 0 66.5%
Taylor expanded in angle around 0 61.7%
*-commutative61.7%
associate-*r*61.7%
*-commutative61.7%
Simplified61.7%
if 1.5e-139 < (/.f64 angle #s(literal 180 binary64)) < 2.00000000000000009e223Initial program 53.9%
Simplified54.0%
unpow254.0%
unpow254.0%
difference-of-squares64.8%
Applied egg-rr64.8%
add-sqr-sqrt0.0%
sqrt-unprod57.6%
associate-*r/56.3%
associate-*r/55.0%
frac-times53.5%
*-commutative53.5%
*-commutative53.5%
metadata-eval53.5%
metadata-eval53.5%
frac-times55.0%
associate-*r/53.5%
associate-*r/54.8%
sqrt-unprod60.6%
add-sqr-sqrt61.9%
associate-*r/62.2%
clear-num62.2%
Applied egg-rr62.2%
if 2.00000000000000009e223 < (/.f64 angle #s(literal 180 binary64)) Initial program 31.5%
Simplified36.7%
unpow236.7%
unpow236.7%
difference-of-squares36.7%
Applied egg-rr36.7%
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-unprod37.0%
add-sqr-sqrt33.2%
clear-num34.9%
un-div-inv34.1%
Applied egg-rr34.1%
associate-/r/28.8%
associate-*l/33.5%
associate-/l*33.2%
Simplified33.2%
Taylor expanded in angle around inf 39.0%
Final simplification59.9%
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-206)
(*
0.011111111111111112
(- (* b (* angle_m (* b PI))) (* PI (* (pow a 2.0) angle_m))))
(if (<= (/ angle_m 180.0) 2e+53)
(*
0.011111111111111112
(fma
a
(- (* angle_m (* PI 0.0)) (* PI (* a angle_m)))
(* angle_m (* (pow b 2.0) PI))))
(* 2.0 (* (sin (* PI (/ angle_m 180.0))) (* (+ b a) (- a b))))))))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-206) {
tmp = 0.011111111111111112 * ((b * (angle_m * (b * ((double) M_PI)))) - (((double) M_PI) * (pow(a, 2.0) * angle_m)));
} else if ((angle_m / 180.0) <= 2e+53) {
tmp = 0.011111111111111112 * fma(a, ((angle_m * (((double) M_PI) * 0.0)) - (((double) M_PI) * (a * angle_m))), (angle_m * (pow(b, 2.0) * ((double) M_PI))));
} else {
tmp = 2.0 * (sin((((double) M_PI) * (angle_m / 180.0))) * ((b + a) * (a - b)));
}
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-206) tmp = Float64(0.011111111111111112 * Float64(Float64(b * Float64(angle_m * Float64(b * pi))) - Float64(pi * Float64((a ^ 2.0) * angle_m)))); elseif (Float64(angle_m / 180.0) <= 2e+53) tmp = Float64(0.011111111111111112 * fma(a, Float64(Float64(angle_m * Float64(pi * 0.0)) - Float64(pi * Float64(a * angle_m))), Float64(angle_m * Float64((b ^ 2.0) * pi)))); else tmp = Float64(2.0 * Float64(sin(Float64(pi * Float64(angle_m / 180.0))) * Float64(Float64(b + a) * Float64(a - b)))); 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-206], N[(0.011111111111111112 * N[(N[(b * N[(angle$95$m * N[(b * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(Pi * N[(N[Power[a, 2.0], $MachinePrecision] * angle$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 2e+53], N[(0.011111111111111112 * N[(a * N[(N[(angle$95$m * N[(Pi * 0.0), $MachinePrecision]), $MachinePrecision] - N[(Pi * N[(a * angle$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(angle$95$m * N[(N[Power[b, 2.0], $MachinePrecision] * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[Sin[N[(Pi * N[(angle$95$m / 180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(N[(b + a), $MachinePrecision] * N[(a - b), $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^{-206}:\\
\;\;\;\;0.011111111111111112 \cdot \left(b \cdot \left(angle\_m \cdot \left(b \cdot \pi\right)\right) - \pi \cdot \left({a}^{2} \cdot angle\_m\right)\right)\\
\mathbf{elif}\;\frac{angle\_m}{180} \leq 2 \cdot 10^{+53}:\\
\;\;\;\;0.011111111111111112 \cdot \mathsf{fma}\left(a, angle\_m \cdot \left(\pi \cdot 0\right) - \pi \cdot \left(a \cdot angle\_m\right), angle\_m \cdot \left({b}^{2} \cdot \pi\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(\sin \left(\pi \cdot \frac{angle\_m}{180}\right) \cdot \left(\left(b + a\right) \cdot \left(a - b\right)\right)\right)\\
\end{array}
\end{array}
if (/.f64 angle #s(literal 180 binary64)) < 1.00000000000000003e-206Initial program 53.8%
associate-*l*53.8%
associate-*l*53.8%
Simplified53.8%
Taylor expanded in angle around 0 50.0%
unpow250.0%
unpow250.0%
difference-of-squares54.5%
Applied egg-rr54.5%
Taylor expanded in b around 0 56.5%
+-commutative56.5%
mul-1-neg56.5%
unsub-neg56.5%
distribute-lft-out56.5%
+-commutative56.5%
distribute-rgt1-in56.5%
metadata-eval56.5%
mul0-lft56.5%
*-commutative56.5%
distribute-lft-out56.5%
+-lft-identity56.5%
Simplified56.5%
if 1.00000000000000003e-206 < (/.f64 angle #s(literal 180 binary64)) < 2e53Initial program 69.4%
associate-*l*69.4%
associate-*l*69.4%
Simplified69.4%
Taylor expanded in angle around 0 67.5%
unpow267.5%
unpow267.5%
difference-of-squares75.1%
Applied egg-rr75.1%
Taylor expanded in a around 0 79.9%
fma-define81.8%
+-commutative81.8%
mul-1-neg81.8%
unsub-neg81.8%
distribute-rgt1-in81.8%
metadata-eval81.8%
mul0-lft81.8%
associate-*r*81.8%
*-commutative81.8%
Simplified81.8%
if 2e53 < (/.f64 angle #s(literal 180 binary64)) Initial program 29.0%
Simplified33.6%
unpow233.6%
unpow233.6%
difference-of-squares40.2%
Applied egg-rr40.2%
add-sqr-sqrt0.0%
sqrt-unprod5.0%
associate-*r/4.4%
associate-*r/8.0%
frac-times8.4%
*-commutative8.4%
*-commutative8.4%
metadata-eval8.4%
metadata-eval8.4%
frac-times8.0%
associate-*r/5.8%
associate-*r/6.4%
sqrt-unprod32.2%
add-sqr-sqrt27.1%
clear-num30.6%
un-div-inv31.8%
Applied egg-rr31.8%
associate-/r/23.3%
associate-*l/29.0%
associate-/l*27.1%
Simplified27.1%
Taylor expanded in angle around 0 32.3%
Final simplification57.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 (<= (/ angle_m 180.0) 1e-206)
(*
0.011111111111111112
(- (* b (* angle_m (* b PI))) (* PI (* (pow a 2.0) angle_m))))
(if (<= (/ angle_m 180.0) 0.5)
(+
(* 0.011111111111111112 (* angle_m (* (pow b 2.0) PI)))
(*
a
(+
(* -0.011111111111111112 (* a (* PI angle_m)))
(* 0.011111111111111112 (* angle_m (* PI (- b b)))))))
(* 2.0 (* (sin (* PI (/ angle_m 180.0))) (* (+ b a) (- a b))))))))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-206) {
tmp = 0.011111111111111112 * ((b * (angle_m * (b * ((double) M_PI)))) - (((double) M_PI) * (pow(a, 2.0) * angle_m)));
} else if ((angle_m / 180.0) <= 0.5) {
tmp = (0.011111111111111112 * (angle_m * (pow(b, 2.0) * ((double) M_PI)))) + (a * ((-0.011111111111111112 * (a * (((double) M_PI) * angle_m))) + (0.011111111111111112 * (angle_m * (((double) M_PI) * (b - b))))));
} else {
tmp = 2.0 * (sin((((double) M_PI) * (angle_m / 180.0))) * ((b + a) * (a - b)));
}
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-206) {
tmp = 0.011111111111111112 * ((b * (angle_m * (b * Math.PI))) - (Math.PI * (Math.pow(a, 2.0) * angle_m)));
} else if ((angle_m / 180.0) <= 0.5) {
tmp = (0.011111111111111112 * (angle_m * (Math.pow(b, 2.0) * Math.PI))) + (a * ((-0.011111111111111112 * (a * (Math.PI * angle_m))) + (0.011111111111111112 * (angle_m * (Math.PI * (b - b))))));
} else {
tmp = 2.0 * (Math.sin((Math.PI * (angle_m / 180.0))) * ((b + a) * (a - b)));
}
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 (angle_m / 180.0) <= 1e-206: tmp = 0.011111111111111112 * ((b * (angle_m * (b * math.pi))) - (math.pi * (math.pow(a, 2.0) * angle_m))) elif (angle_m / 180.0) <= 0.5: tmp = (0.011111111111111112 * (angle_m * (math.pow(b, 2.0) * math.pi))) + (a * ((-0.011111111111111112 * (a * (math.pi * angle_m))) + (0.011111111111111112 * (angle_m * (math.pi * (b - b)))))) else: tmp = 2.0 * (math.sin((math.pi * (angle_m / 180.0))) * ((b + a) * (a - b))) 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-206) tmp = Float64(0.011111111111111112 * Float64(Float64(b * Float64(angle_m * Float64(b * pi))) - Float64(pi * Float64((a ^ 2.0) * angle_m)))); elseif (Float64(angle_m / 180.0) <= 0.5) tmp = Float64(Float64(0.011111111111111112 * Float64(angle_m * Float64((b ^ 2.0) * pi))) + Float64(a * Float64(Float64(-0.011111111111111112 * Float64(a * Float64(pi * angle_m))) + Float64(0.011111111111111112 * Float64(angle_m * Float64(pi * Float64(b - b))))))); else tmp = Float64(2.0 * Float64(sin(Float64(pi * Float64(angle_m / 180.0))) * Float64(Float64(b + a) * Float64(a - b)))); 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 ((angle_m / 180.0) <= 1e-206) tmp = 0.011111111111111112 * ((b * (angle_m * (b * pi))) - (pi * ((a ^ 2.0) * angle_m))); elseif ((angle_m / 180.0) <= 0.5) tmp = (0.011111111111111112 * (angle_m * ((b ^ 2.0) * pi))) + (a * ((-0.011111111111111112 * (a * (pi * angle_m))) + (0.011111111111111112 * (angle_m * (pi * (b - b)))))); else tmp = 2.0 * (sin((pi * (angle_m / 180.0))) * ((b + a) * (a - b))); 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[(angle$95$m / 180.0), $MachinePrecision], 1e-206], N[(0.011111111111111112 * N[(N[(b * N[(angle$95$m * N[(b * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(Pi * N[(N[Power[a, 2.0], $MachinePrecision] * angle$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 0.5], N[(N[(0.011111111111111112 * N[(angle$95$m * N[(N[Power[b, 2.0], $MachinePrecision] * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(a * N[(N[(-0.011111111111111112 * N[(a * N[(Pi * angle$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(0.011111111111111112 * N[(angle$95$m * N[(Pi * N[(b - b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[Sin[N[(Pi * N[(angle$95$m / 180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(N[(b + a), $MachinePrecision] * N[(a - b), $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^{-206}:\\
\;\;\;\;0.011111111111111112 \cdot \left(b \cdot \left(angle\_m \cdot \left(b \cdot \pi\right)\right) - \pi \cdot \left({a}^{2} \cdot angle\_m\right)\right)\\
\mathbf{elif}\;\frac{angle\_m}{180} \leq 0.5:\\
\;\;\;\;0.011111111111111112 \cdot \left(angle\_m \cdot \left({b}^{2} \cdot \pi\right)\right) + a \cdot \left(-0.011111111111111112 \cdot \left(a \cdot \left(\pi \cdot angle\_m\right)\right) + 0.011111111111111112 \cdot \left(angle\_m \cdot \left(\pi \cdot \left(b - b\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(\sin \left(\pi \cdot \frac{angle\_m}{180}\right) \cdot \left(\left(b + a\right) \cdot \left(a - b\right)\right)\right)\\
\end{array}
\end{array}
if (/.f64 angle #s(literal 180 binary64)) < 1.00000000000000003e-206Initial program 53.8%
associate-*l*53.8%
associate-*l*53.8%
Simplified53.8%
Taylor expanded in angle around 0 50.0%
unpow250.0%
unpow250.0%
difference-of-squares54.5%
Applied egg-rr54.5%
Taylor expanded in b around 0 56.5%
+-commutative56.5%
mul-1-neg56.5%
unsub-neg56.5%
distribute-lft-out56.5%
+-commutative56.5%
distribute-rgt1-in56.5%
metadata-eval56.5%
mul0-lft56.5%
*-commutative56.5%
distribute-lft-out56.5%
+-lft-identity56.5%
Simplified56.5%
if 1.00000000000000003e-206 < (/.f64 angle #s(literal 180 binary64)) < 0.5Initial program 76.1%
associate-*l*76.1%
associate-*l*76.1%
Simplified76.1%
Taylor expanded in angle around 0 74.4%
unpow274.4%
unpow274.4%
difference-of-squares79.1%
Applied egg-rr79.1%
Taylor expanded in a around 0 89.5%
if 0.5 < (/.f64 angle #s(literal 180 binary64)) Initial program 30.2%
Simplified32.4%
unpow232.4%
unpow232.4%
difference-of-squares41.5%
Applied egg-rr41.5%
add-sqr-sqrt0.0%
sqrt-unprod11.5%
associate-*r/11.0%
associate-*r/14.0%
frac-times14.3%
*-commutative14.3%
*-commutative14.3%
metadata-eval14.3%
metadata-eval14.3%
frac-times14.0%
associate-*r/12.2%
associate-*r/10.8%
sqrt-unprod30.6%
add-sqr-sqrt28.2%
clear-num32.9%
un-div-inv33.9%
Applied egg-rr33.9%
associate-/r/26.8%
associate-*l/31.6%
associate-/l*28.2%
Simplified28.2%
Taylor expanded in angle around 0 30.7%
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
(*
angle_s
(if (<= (/ angle_m 180.0) 1e-206)
(*
0.011111111111111112
(- (* b (* angle_m (* b PI))) (* PI (* (pow a 2.0) angle_m))))
(if (<= (/ angle_m 180.0) 0.5)
(*
0.011111111111111112
(+
(* angle_m (* (pow b 2.0) PI))
(* a (- (* angle_m (* PI (- b b))) (* a (* PI angle_m))))))
(* 2.0 (* (sin (* PI (/ angle_m 180.0))) (* (+ b a) (- a b))))))))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-206) {
tmp = 0.011111111111111112 * ((b * (angle_m * (b * ((double) M_PI)))) - (((double) M_PI) * (pow(a, 2.0) * angle_m)));
} else if ((angle_m / 180.0) <= 0.5) {
tmp = 0.011111111111111112 * ((angle_m * (pow(b, 2.0) * ((double) M_PI))) + (a * ((angle_m * (((double) M_PI) * (b - b))) - (a * (((double) M_PI) * angle_m)))));
} else {
tmp = 2.0 * (sin((((double) M_PI) * (angle_m / 180.0))) * ((b + a) * (a - b)));
}
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-206) {
tmp = 0.011111111111111112 * ((b * (angle_m * (b * Math.PI))) - (Math.PI * (Math.pow(a, 2.0) * angle_m)));
} else if ((angle_m / 180.0) <= 0.5) {
tmp = 0.011111111111111112 * ((angle_m * (Math.pow(b, 2.0) * Math.PI)) + (a * ((angle_m * (Math.PI * (b - b))) - (a * (Math.PI * angle_m)))));
} else {
tmp = 2.0 * (Math.sin((Math.PI * (angle_m / 180.0))) * ((b + a) * (a - b)));
}
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 (angle_m / 180.0) <= 1e-206: tmp = 0.011111111111111112 * ((b * (angle_m * (b * math.pi))) - (math.pi * (math.pow(a, 2.0) * angle_m))) elif (angle_m / 180.0) <= 0.5: tmp = 0.011111111111111112 * ((angle_m * (math.pow(b, 2.0) * math.pi)) + (a * ((angle_m * (math.pi * (b - b))) - (a * (math.pi * angle_m))))) else: tmp = 2.0 * (math.sin((math.pi * (angle_m / 180.0))) * ((b + a) * (a - b))) 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-206) tmp = Float64(0.011111111111111112 * Float64(Float64(b * Float64(angle_m * Float64(b * pi))) - Float64(pi * Float64((a ^ 2.0) * angle_m)))); elseif (Float64(angle_m / 180.0) <= 0.5) tmp = Float64(0.011111111111111112 * Float64(Float64(angle_m * Float64((b ^ 2.0) * pi)) + Float64(a * Float64(Float64(angle_m * Float64(pi * Float64(b - b))) - Float64(a * Float64(pi * angle_m)))))); else tmp = Float64(2.0 * Float64(sin(Float64(pi * Float64(angle_m / 180.0))) * Float64(Float64(b + a) * Float64(a - b)))); 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 ((angle_m / 180.0) <= 1e-206) tmp = 0.011111111111111112 * ((b * (angle_m * (b * pi))) - (pi * ((a ^ 2.0) * angle_m))); elseif ((angle_m / 180.0) <= 0.5) tmp = 0.011111111111111112 * ((angle_m * ((b ^ 2.0) * pi)) + (a * ((angle_m * (pi * (b - b))) - (a * (pi * angle_m))))); else tmp = 2.0 * (sin((pi * (angle_m / 180.0))) * ((b + a) * (a - b))); 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[(angle$95$m / 180.0), $MachinePrecision], 1e-206], N[(0.011111111111111112 * N[(N[(b * N[(angle$95$m * N[(b * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(Pi * N[(N[Power[a, 2.0], $MachinePrecision] * angle$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 0.5], N[(0.011111111111111112 * N[(N[(angle$95$m * N[(N[Power[b, 2.0], $MachinePrecision] * Pi), $MachinePrecision]), $MachinePrecision] + 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]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[Sin[N[(Pi * N[(angle$95$m / 180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(N[(b + a), $MachinePrecision] * N[(a - b), $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^{-206}:\\
\;\;\;\;0.011111111111111112 \cdot \left(b \cdot \left(angle\_m \cdot \left(b \cdot \pi\right)\right) - \pi \cdot \left({a}^{2} \cdot angle\_m\right)\right)\\
\mathbf{elif}\;\frac{angle\_m}{180} \leq 0.5:\\
\;\;\;\;0.011111111111111112 \cdot \left(angle\_m \cdot \left({b}^{2} \cdot \pi\right) + a \cdot \left(angle\_m \cdot \left(\pi \cdot \left(b - b\right)\right) - a \cdot \left(\pi \cdot angle\_m\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(\sin \left(\pi \cdot \frac{angle\_m}{180}\right) \cdot \left(\left(b + a\right) \cdot \left(a - b\right)\right)\right)\\
\end{array}
\end{array}
if (/.f64 angle #s(literal 180 binary64)) < 1.00000000000000003e-206Initial program 53.8%
associate-*l*53.8%
associate-*l*53.8%
Simplified53.8%
Taylor expanded in angle around 0 50.0%
unpow250.0%
unpow250.0%
difference-of-squares54.5%
Applied egg-rr54.5%
Taylor expanded in b around 0 56.5%
+-commutative56.5%
mul-1-neg56.5%
unsub-neg56.5%
distribute-lft-out56.5%
+-commutative56.5%
distribute-rgt1-in56.5%
metadata-eval56.5%
mul0-lft56.5%
*-commutative56.5%
distribute-lft-out56.5%
+-lft-identity56.5%
Simplified56.5%
if 1.00000000000000003e-206 < (/.f64 angle #s(literal 180 binary64)) < 0.5Initial program 76.1%
associate-*l*76.1%
associate-*l*76.1%
Simplified76.1%
Taylor expanded in angle around 0 74.4%
unpow274.4%
unpow274.4%
difference-of-squares79.1%
Applied egg-rr79.1%
Taylor expanded in a around 0 89.4%
if 0.5 < (/.f64 angle #s(literal 180 binary64)) Initial program 30.2%
Simplified32.4%
unpow232.4%
unpow232.4%
difference-of-squares41.5%
Applied egg-rr41.5%
add-sqr-sqrt0.0%
sqrt-unprod11.5%
associate-*r/11.0%
associate-*r/14.0%
frac-times14.3%
*-commutative14.3%
*-commutative14.3%
metadata-eval14.3%
metadata-eval14.3%
frac-times14.0%
associate-*r/12.2%
associate-*r/10.8%
sqrt-unprod30.6%
add-sqr-sqrt28.2%
clear-num32.9%
un-div-inv33.9%
Applied egg-rr33.9%
associate-/r/26.8%
associate-*l/31.6%
associate-/l*28.2%
Simplified28.2%
Taylor expanded in angle around 0 30.7%
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 (* (+ b a) (- a b))))
(*
angle_s
(if (<= (/ angle_m 180.0) 1.5e-139)
(*
0.011111111111111112
(- (* b (* angle_m (* b PI))) (* PI (* (pow a 2.0) angle_m))))
(if (<= (/ angle_m 180.0) 4e+18)
(* 2.0 (* (sin (* angle_m (/ PI -180.0))) t_0))
(* 2.0 (* (sin (* PI (/ angle_m 180.0))) t_0)))))))angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a, double b, double angle_m) {
double t_0 = (b + a) * (a - b);
double tmp;
if ((angle_m / 180.0) <= 1.5e-139) {
tmp = 0.011111111111111112 * ((b * (angle_m * (b * ((double) M_PI)))) - (((double) M_PI) * (pow(a, 2.0) * angle_m)));
} else if ((angle_m / 180.0) <= 4e+18) {
tmp = 2.0 * (sin((angle_m * (((double) M_PI) / -180.0))) * t_0);
} else {
tmp = 2.0 * (sin((((double) M_PI) * (angle_m / 180.0))) * t_0);
}
return angle_s * tmp;
}
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b, double angle_m) {
double t_0 = (b + a) * (a - b);
double tmp;
if ((angle_m / 180.0) <= 1.5e-139) {
tmp = 0.011111111111111112 * ((b * (angle_m * (b * Math.PI))) - (Math.PI * (Math.pow(a, 2.0) * angle_m)));
} else if ((angle_m / 180.0) <= 4e+18) {
tmp = 2.0 * (Math.sin((angle_m * (Math.PI / -180.0))) * t_0);
} else {
tmp = 2.0 * (Math.sin((Math.PI * (angle_m / 180.0))) * t_0);
}
return angle_s * tmp;
}
angle\_m = math.fabs(angle) angle\_s = math.copysign(1.0, angle) def code(angle_s, a, b, angle_m): t_0 = (b + a) * (a - b) tmp = 0 if (angle_m / 180.0) <= 1.5e-139: tmp = 0.011111111111111112 * ((b * (angle_m * (b * math.pi))) - (math.pi * (math.pow(a, 2.0) * angle_m))) elif (angle_m / 180.0) <= 4e+18: tmp = 2.0 * (math.sin((angle_m * (math.pi / -180.0))) * t_0) else: tmp = 2.0 * (math.sin((math.pi * (angle_m / 180.0))) * t_0) return angle_s * tmp
angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a, b, angle_m) t_0 = Float64(Float64(b + a) * Float64(a - b)) tmp = 0.0 if (Float64(angle_m / 180.0) <= 1.5e-139) tmp = Float64(0.011111111111111112 * Float64(Float64(b * Float64(angle_m * Float64(b * pi))) - Float64(pi * Float64((a ^ 2.0) * angle_m)))); elseif (Float64(angle_m / 180.0) <= 4e+18) tmp = Float64(2.0 * Float64(sin(Float64(angle_m * Float64(pi / -180.0))) * t_0)); else tmp = Float64(2.0 * Float64(sin(Float64(pi * Float64(angle_m / 180.0))) * t_0)); end return Float64(angle_s * tmp) end
angle\_m = abs(angle); angle\_s = sign(angle) * abs(1.0); function tmp_2 = code(angle_s, a, b, angle_m) t_0 = (b + a) * (a - b); tmp = 0.0; if ((angle_m / 180.0) <= 1.5e-139) tmp = 0.011111111111111112 * ((b * (angle_m * (b * pi))) - (pi * ((a ^ 2.0) * angle_m))); elseif ((angle_m / 180.0) <= 4e+18) tmp = 2.0 * (sin((angle_m * (pi / -180.0))) * t_0); else tmp = 2.0 * (sin((pi * (angle_m / 180.0))) * t_0); end tmp_2 = angle_s * tmp; end
angle\_m = N[Abs[angle], $MachinePrecision]
angle\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a_, b_, angle$95$m_] := Block[{t$95$0 = N[(N[(b + a), $MachinePrecision] * N[(a - b), $MachinePrecision]), $MachinePrecision]}, N[(angle$95$s * If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 1.5e-139], N[(0.011111111111111112 * N[(N[(b * N[(angle$95$m * N[(b * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(Pi * N[(N[Power[a, 2.0], $MachinePrecision] * angle$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 4e+18], N[(2.0 * N[(N[Sin[N[(angle$95$m * N[(Pi / -180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[Sin[N[(Pi * N[(angle$95$m / 180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]]
\begin{array}{l}
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
\begin{array}{l}
t_0 := \left(b + a\right) \cdot \left(a - b\right)\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;\frac{angle\_m}{180} \leq 1.5 \cdot 10^{-139}:\\
\;\;\;\;0.011111111111111112 \cdot \left(b \cdot \left(angle\_m \cdot \left(b \cdot \pi\right)\right) - \pi \cdot \left({a}^{2} \cdot angle\_m\right)\right)\\
\mathbf{elif}\;\frac{angle\_m}{180} \leq 4 \cdot 10^{+18}:\\
\;\;\;\;2 \cdot \left(\sin \left(angle\_m \cdot \frac{\pi}{-180}\right) \cdot t\_0\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(\sin \left(\pi \cdot \frac{angle\_m}{180}\right) \cdot t\_0\right)\\
\end{array}
\end{array}
\end{array}
if (/.f64 angle #s(literal 180 binary64)) < 1.5e-139Initial program 54.7%
associate-*l*54.7%
associate-*l*54.7%
Simplified54.7%
Taylor expanded in angle around 0 51.3%
unpow251.3%
unpow251.3%
difference-of-squares55.5%
Applied egg-rr55.5%
Taylor expanded in b around 0 58.4%
+-commutative58.4%
mul-1-neg58.4%
unsub-neg58.4%
distribute-lft-out58.4%
+-commutative58.4%
distribute-rgt1-in58.4%
metadata-eval58.4%
mul0-lft58.4%
*-commutative58.4%
distribute-lft-out58.4%
+-lft-identity58.4%
Simplified58.4%
if 1.5e-139 < (/.f64 angle #s(literal 180 binary64)) < 4e18Initial program 76.8%
Simplified77.1%
unpow277.1%
unpow277.1%
difference-of-squares82.6%
Applied egg-rr82.6%
Taylor expanded in angle around 0 80.1%
if 4e18 < (/.f64 angle #s(literal 180 binary64)) Initial program 28.1%
Simplified30.3%
unpow230.3%
unpow230.3%
difference-of-squares40.1%
Applied egg-rr40.1%
add-sqr-sqrt0.0%
sqrt-unprod10.4%
associate-*r/9.9%
associate-*r/13.1%
frac-times13.4%
*-commutative13.4%
*-commutative13.4%
metadata-eval13.4%
metadata-eval13.4%
frac-times13.1%
associate-*r/11.2%
associate-*r/9.7%
sqrt-unprod31.0%
add-sqr-sqrt28.4%
clear-num33.5%
un-div-inv34.6%
Applied egg-rr34.6%
associate-/r/26.9%
associate-*l/32.0%
associate-/l*28.4%
Simplified28.4%
Taylor expanded in angle around 0 31.1%
Final simplification56.0%
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.16e+100)
(*
0.011111111111111112
(- (* b (* angle_m (* b PI))) (* PI (* (pow a 2.0) angle_m))))
(* (* (* angle_m 0.011111111111111112) (* a 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) {
double tmp;
if (a <= 1.16e+100) {
tmp = 0.011111111111111112 * ((b * (angle_m * (b * ((double) M_PI)))) - (((double) M_PI) * (pow(a, 2.0) * angle_m)));
} else {
tmp = ((angle_m * 0.011111111111111112) * (a * ((double) M_PI))) * (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.16e+100) {
tmp = 0.011111111111111112 * ((b * (angle_m * (b * Math.PI))) - (Math.PI * (Math.pow(a, 2.0) * angle_m)));
} else {
tmp = ((angle_m * 0.011111111111111112) * (a * Math.PI)) * (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.16e+100: tmp = 0.011111111111111112 * ((b * (angle_m * (b * math.pi))) - (math.pi * (math.pow(a, 2.0) * angle_m))) else: tmp = ((angle_m * 0.011111111111111112) * (a * math.pi)) * (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.16e+100) tmp = Float64(0.011111111111111112 * Float64(Float64(b * Float64(angle_m * Float64(b * pi))) - Float64(pi * Float64((a ^ 2.0) * angle_m)))); else tmp = Float64(Float64(Float64(angle_m * 0.011111111111111112) * Float64(a * pi)) * 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.16e+100) tmp = 0.011111111111111112 * ((b * (angle_m * (b * pi))) - (pi * ((a ^ 2.0) * angle_m))); else tmp = ((angle_m * 0.011111111111111112) * (a * pi)) * (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.16e+100], N[(0.011111111111111112 * N[(N[(b * N[(angle$95$m * N[(b * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(Pi * N[(N[Power[a, 2.0], $MachinePrecision] * angle$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(angle$95$m * 0.011111111111111112), $MachinePrecision] * N[(a * Pi), $MachinePrecision]), $MachinePrecision] * N[(b - a), $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.16 \cdot 10^{+100}:\\
\;\;\;\;0.011111111111111112 \cdot \left(b \cdot \left(angle\_m \cdot \left(b \cdot \pi\right)\right) - \pi \cdot \left({a}^{2} \cdot angle\_m\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(angle\_m \cdot 0.011111111111111112\right) \cdot \left(a \cdot \pi\right)\right) \cdot \left(b - a\right)\\
\end{array}
\end{array}
if a < 1.1600000000000001e100Initial program 54.1%
associate-*l*54.1%
associate-*l*54.1%
Simplified54.1%
Taylor expanded in angle around 0 50.5%
unpow250.5%
unpow250.5%
difference-of-squares54.2%
Applied egg-rr54.2%
Taylor expanded in b around 0 55.1%
+-commutative55.1%
mul-1-neg55.1%
unsub-neg55.1%
distribute-lft-out55.1%
+-commutative55.1%
distribute-rgt1-in55.1%
metadata-eval55.1%
mul0-lft55.1%
*-commutative55.1%
distribute-lft-out55.1%
+-lft-identity55.1%
Simplified55.0%
if 1.1600000000000001e100 < a Initial program 44.4%
associate-*l*44.4%
associate-*l*44.4%
Simplified44.4%
Taylor expanded in angle around 0 30.4%
unpow230.4%
unpow230.4%
difference-of-squares42.6%
Applied egg-rr42.6%
Taylor expanded in b around 0 40.2%
pow140.2%
associate-*r*40.2%
associate-*r*40.3%
Applied egg-rr40.3%
unpow140.3%
associate-*r*56.4%
*-commutative56.4%
*-commutative56.4%
Simplified56.4%
Final simplification55.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 7.5e+153)
(* 0.011111111111111112 (* angle_m (- (* b (* b PI)) (* (pow a 2.0) PI))))
(* (* (* angle_m 0.011111111111111112) (* a 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) {
double tmp;
if (a <= 7.5e+153) {
tmp = 0.011111111111111112 * (angle_m * ((b * (b * ((double) M_PI))) - (pow(a, 2.0) * ((double) M_PI))));
} else {
tmp = ((angle_m * 0.011111111111111112) * (a * ((double) M_PI))) * (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 <= 7.5e+153) {
tmp = 0.011111111111111112 * (angle_m * ((b * (b * Math.PI)) - (Math.pow(a, 2.0) * Math.PI)));
} else {
tmp = ((angle_m * 0.011111111111111112) * (a * Math.PI)) * (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 <= 7.5e+153: tmp = 0.011111111111111112 * (angle_m * ((b * (b * math.pi)) - (math.pow(a, 2.0) * math.pi))) else: tmp = ((angle_m * 0.011111111111111112) * (a * math.pi)) * (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 <= 7.5e+153) tmp = Float64(0.011111111111111112 * Float64(angle_m * Float64(Float64(b * Float64(b * pi)) - Float64((a ^ 2.0) * pi)))); else tmp = Float64(Float64(Float64(angle_m * 0.011111111111111112) * Float64(a * pi)) * 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 <= 7.5e+153) tmp = 0.011111111111111112 * (angle_m * ((b * (b * pi)) - ((a ^ 2.0) * pi))); else tmp = ((angle_m * 0.011111111111111112) * (a * pi)) * (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, 7.5e+153], N[(0.011111111111111112 * N[(angle$95$m * N[(N[(b * N[(b * Pi), $MachinePrecision]), $MachinePrecision] - N[(N[Power[a, 2.0], $MachinePrecision] * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(angle$95$m * 0.011111111111111112), $MachinePrecision] * N[(a * Pi), $MachinePrecision]), $MachinePrecision] * N[(b - a), $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 7.5 \cdot 10^{+153}:\\
\;\;\;\;0.011111111111111112 \cdot \left(angle\_m \cdot \left(b \cdot \left(b \cdot \pi\right) - {a}^{2} \cdot \pi\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(angle\_m \cdot 0.011111111111111112\right) \cdot \left(a \cdot \pi\right)\right) \cdot \left(b - a\right)\\
\end{array}
\end{array}
if a < 7.50000000000000065e153Initial program 54.2%
associate-*l*54.2%
associate-*l*54.2%
Simplified54.2%
Taylor expanded in angle around 0 50.0%
unpow250.0%
unpow250.0%
difference-of-squares53.6%
Applied egg-rr53.6%
Taylor expanded in b around 0 50.1%
+-commutative50.1%
mul-1-neg50.1%
unsub-neg50.1%
+-commutative50.1%
distribute-rgt1-in50.1%
metadata-eval50.1%
mul0-lft50.1%
*-commutative50.1%
distribute-lft-out50.1%
+-lft-identity50.1%
Simplified50.1%
if 7.50000000000000065e153 < a Initial program 40.7%
associate-*l*40.7%
associate-*l*40.7%
Simplified40.7%
Taylor expanded in angle around 0 27.2%
unpow227.2%
unpow227.2%
difference-of-squares43.3%
Applied egg-rr43.3%
Taylor expanded in b around 0 36.9%
pow136.9%
associate-*r*36.9%
associate-*r*36.9%
Applied egg-rr36.9%
unpow136.9%
associate-*r*61.1%
*-commutative61.1%
*-commutative61.1%
Simplified61.1%
Final simplification51.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 (<= a 1.2e+154)
(* 0.011111111111111112 (* (* PI angle_m) (* (+ b a) (- b a))))
(* (* (* angle_m 0.011111111111111112) (* a 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) {
double tmp;
if (a <= 1.2e+154) {
tmp = 0.011111111111111112 * ((((double) M_PI) * angle_m) * ((b + a) * (b - a)));
} else {
tmp = ((angle_m * 0.011111111111111112) * (a * ((double) M_PI))) * (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.2e+154) {
tmp = 0.011111111111111112 * ((Math.PI * angle_m) * ((b + a) * (b - a)));
} else {
tmp = ((angle_m * 0.011111111111111112) * (a * Math.PI)) * (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.2e+154: tmp = 0.011111111111111112 * ((math.pi * angle_m) * ((b + a) * (b - a))) else: tmp = ((angle_m * 0.011111111111111112) * (a * math.pi)) * (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.2e+154) tmp = Float64(0.011111111111111112 * Float64(Float64(pi * angle_m) * Float64(Float64(b + a) * Float64(b - a)))); else tmp = Float64(Float64(Float64(angle_m * 0.011111111111111112) * Float64(a * pi)) * 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.2e+154) tmp = 0.011111111111111112 * ((pi * angle_m) * ((b + a) * (b - a))); else tmp = ((angle_m * 0.011111111111111112) * (a * pi)) * (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.2e+154], N[(0.011111111111111112 * N[(N[(Pi * angle$95$m), $MachinePrecision] * N[(N[(b + a), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(angle$95$m * 0.011111111111111112), $MachinePrecision] * N[(a * Pi), $MachinePrecision]), $MachinePrecision] * N[(b - a), $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.2 \cdot 10^{+154}:\\
\;\;\;\;0.011111111111111112 \cdot \left(\left(\pi \cdot angle\_m\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(angle\_m \cdot 0.011111111111111112\right) \cdot \left(a \cdot \pi\right)\right) \cdot \left(b - a\right)\\
\end{array}
\end{array}
if a < 1.20000000000000007e154Initial program 54.2%
associate-*l*54.2%
associate-*l*54.2%
Simplified54.2%
Taylor expanded in angle around 0 50.0%
unpow250.0%
unpow250.0%
difference-of-squares53.6%
Applied egg-rr53.6%
Taylor expanded in angle around 0 53.6%
associate-*r*53.6%
+-commutative53.6%
*-commutative53.6%
+-commutative53.6%
Simplified53.6%
if 1.20000000000000007e154 < a Initial program 40.7%
associate-*l*40.7%
associate-*l*40.7%
Simplified40.7%
Taylor expanded in angle around 0 27.2%
unpow227.2%
unpow227.2%
difference-of-squares43.3%
Applied egg-rr43.3%
Taylor expanded in b around 0 36.9%
pow136.9%
associate-*r*36.9%
associate-*r*36.9%
Applied egg-rr36.9%
unpow136.9%
associate-*r*61.1%
*-commutative61.1%
*-commutative61.1%
Simplified61.1%
Final simplification54.5%
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 6e+153)
(* 0.011111111111111112 (* angle_m (* PI (* (+ b a) (- b a)))))
(* (* (* angle_m 0.011111111111111112) (* a 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) {
double tmp;
if (a <= 6e+153) {
tmp = 0.011111111111111112 * (angle_m * (((double) M_PI) * ((b + a) * (b - a))));
} else {
tmp = ((angle_m * 0.011111111111111112) * (a * ((double) M_PI))) * (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 <= 6e+153) {
tmp = 0.011111111111111112 * (angle_m * (Math.PI * ((b + a) * (b - a))));
} else {
tmp = ((angle_m * 0.011111111111111112) * (a * Math.PI)) * (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 <= 6e+153: tmp = 0.011111111111111112 * (angle_m * (math.pi * ((b + a) * (b - a)))) else: tmp = ((angle_m * 0.011111111111111112) * (a * math.pi)) * (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 <= 6e+153) tmp = Float64(0.011111111111111112 * Float64(angle_m * Float64(pi * Float64(Float64(b + a) * Float64(b - a))))); else tmp = Float64(Float64(Float64(angle_m * 0.011111111111111112) * Float64(a * pi)) * 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 <= 6e+153) tmp = 0.011111111111111112 * (angle_m * (pi * ((b + a) * (b - a)))); else tmp = ((angle_m * 0.011111111111111112) * (a * pi)) * (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, 6e+153], N[(0.011111111111111112 * N[(angle$95$m * N[(Pi * N[(N[(b + a), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(angle$95$m * 0.011111111111111112), $MachinePrecision] * N[(a * Pi), $MachinePrecision]), $MachinePrecision] * N[(b - a), $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 6 \cdot 10^{+153}:\\
\;\;\;\;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(\left(angle\_m \cdot 0.011111111111111112\right) \cdot \left(a \cdot \pi\right)\right) \cdot \left(b - a\right)\\
\end{array}
\end{array}
if a < 6.00000000000000037e153Initial program 54.2%
associate-*l*54.2%
associate-*l*54.2%
Simplified54.2%
Taylor expanded in angle around 0 50.0%
unpow250.0%
unpow250.0%
difference-of-squares53.6%
Applied egg-rr53.6%
if 6.00000000000000037e153 < a Initial program 40.7%
associate-*l*40.7%
associate-*l*40.7%
Simplified40.7%
Taylor expanded in angle around 0 27.2%
unpow227.2%
unpow227.2%
difference-of-squares43.3%
Applied egg-rr43.3%
Taylor expanded in b around 0 36.9%
pow136.9%
associate-*r*36.9%
associate-*r*36.9%
Applied egg-rr36.9%
unpow136.9%
associate-*r*61.1%
*-commutative61.1%
*-commutative61.1%
Simplified61.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 (<= a 1000000000000.0)
(* 0.011111111111111112 (* angle_m (* PI (* b (- b a)))))
(* (* a 0.011111111111111112) (* (- b a) (* 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 (a <= 1000000000000.0) {
tmp = 0.011111111111111112 * (angle_m * (((double) M_PI) * (b * (b - a))));
} else {
tmp = (a * 0.011111111111111112) * ((b - a) * (((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 (a <= 1000000000000.0) {
tmp = 0.011111111111111112 * (angle_m * (Math.PI * (b * (b - a))));
} else {
tmp = (a * 0.011111111111111112) * ((b - a) * (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 a <= 1000000000000.0: tmp = 0.011111111111111112 * (angle_m * (math.pi * (b * (b - a)))) else: tmp = (a * 0.011111111111111112) * ((b - a) * (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 (a <= 1000000000000.0) tmp = Float64(0.011111111111111112 * Float64(angle_m * Float64(pi * Float64(b * Float64(b - a))))); else tmp = Float64(Float64(a * 0.011111111111111112) * Float64(Float64(b - a) * Float64(pi * angle_m))); end return Float64(angle_s * tmp) end
angle\_m = abs(angle); angle\_s = sign(angle) * abs(1.0); function tmp_2 = code(angle_s, a, b, angle_m) tmp = 0.0; if (a <= 1000000000000.0) tmp = 0.011111111111111112 * (angle_m * (pi * (b * (b - a)))); else tmp = (a * 0.011111111111111112) * ((b - a) * (pi * angle_m)); end tmp_2 = angle_s * tmp; end
angle\_m = N[Abs[angle], $MachinePrecision]
angle\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a_, b_, angle$95$m_] := N[(angle$95$s * If[LessEqual[a, 1000000000000.0], N[(0.011111111111111112 * N[(angle$95$m * N[(Pi * N[(b * N[(b - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(a * 0.011111111111111112), $MachinePrecision] * N[(N[(b - a), $MachinePrecision] * N[(Pi * angle$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;a \leq 1000000000000:\\
\;\;\;\;0.011111111111111112 \cdot \left(angle\_m \cdot \left(\pi \cdot \left(b \cdot \left(b - a\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(a \cdot 0.011111111111111112\right) \cdot \left(\left(b - a\right) \cdot \left(\pi \cdot angle\_m\right)\right)\\
\end{array}
\end{array}
if a < 1e12Initial program 53.7%
associate-*l*53.7%
associate-*l*53.7%
Simplified53.7%
Taylor expanded in angle around 0 50.3%
unpow250.3%
unpow250.3%
difference-of-squares54.7%
Applied egg-rr54.7%
Taylor expanded in b around inf 43.2%
if 1e12 < a Initial program 49.5%
associate-*l*49.5%
associate-*l*49.5%
Simplified49.5%
Taylor expanded in angle around 0 39.0%
unpow239.0%
unpow239.0%
difference-of-squares46.2%
Applied egg-rr46.2%
Taylor expanded in b around 0 44.1%
Taylor expanded in angle around 0 52.3%
associate-*r*52.3%
associate-*r*52.4%
Simplified52.4%
Final simplification45.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
(if (<= a 3200000000000.0)
(* 0.011111111111111112 (* angle_m (* PI (* b (- b a)))))
(* 0.011111111111111112 (* (- b a) (* angle_m (* a PI)))))))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 <= 3200000000000.0) {
tmp = 0.011111111111111112 * (angle_m * (((double) M_PI) * (b * (b - a))));
} else {
tmp = 0.011111111111111112 * ((b - a) * (angle_m * (a * ((double) M_PI))));
}
return angle_s * tmp;
}
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b, double angle_m) {
double tmp;
if (a <= 3200000000000.0) {
tmp = 0.011111111111111112 * (angle_m * (Math.PI * (b * (b - a))));
} else {
tmp = 0.011111111111111112 * ((b - a) * (angle_m * (a * Math.PI)));
}
return angle_s * tmp;
}
angle\_m = math.fabs(angle) angle\_s = math.copysign(1.0, angle) def code(angle_s, a, b, angle_m): tmp = 0 if a <= 3200000000000.0: tmp = 0.011111111111111112 * (angle_m * (math.pi * (b * (b - a)))) else: tmp = 0.011111111111111112 * ((b - a) * (angle_m * (a * math.pi))) 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 <= 3200000000000.0) tmp = Float64(0.011111111111111112 * Float64(angle_m * Float64(pi * Float64(b * Float64(b - a))))); else tmp = Float64(0.011111111111111112 * Float64(Float64(b - a) * Float64(angle_m * Float64(a * pi)))); end return Float64(angle_s * tmp) end
angle\_m = abs(angle); angle\_s = sign(angle) * abs(1.0); function tmp_2 = code(angle_s, a, b, angle_m) tmp = 0.0; if (a <= 3200000000000.0) tmp = 0.011111111111111112 * (angle_m * (pi * (b * (b - a)))); else tmp = 0.011111111111111112 * ((b - a) * (angle_m * (a * pi))); end tmp_2 = angle_s * tmp; end
angle\_m = N[Abs[angle], $MachinePrecision]
angle\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a_, b_, angle$95$m_] := N[(angle$95$s * If[LessEqual[a, 3200000000000.0], N[(0.011111111111111112 * N[(angle$95$m * N[(Pi * N[(b * N[(b - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.011111111111111112 * N[(N[(b - a), $MachinePrecision] * N[(angle$95$m * N[(a * 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 \begin{array}{l}
\mathbf{if}\;a \leq 3200000000000:\\
\;\;\;\;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(\left(b - a\right) \cdot \left(angle\_m \cdot \left(a \cdot \pi\right)\right)\right)\\
\end{array}
\end{array}
if a < 3.2e12Initial program 53.7%
associate-*l*53.7%
associate-*l*53.7%
Simplified53.7%
Taylor expanded in angle around 0 50.3%
unpow250.3%
unpow250.3%
difference-of-squares54.7%
Applied egg-rr54.7%
Taylor expanded in b around inf 43.2%
if 3.2e12 < a Initial program 49.5%
associate-*l*49.5%
associate-*l*49.5%
Simplified49.5%
Taylor expanded in angle around 0 39.0%
unpow239.0%
unpow239.0%
difference-of-squares46.2%
Applied egg-rr46.2%
Taylor expanded in b around 0 44.1%
pow144.1%
associate-*r*44.2%
Applied egg-rr44.2%
unpow144.2%
associate-*r*52.3%
*-commutative52.3%
Simplified52.3%
Final simplification45.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
(if (<= a 260000000000.0)
(* 0.011111111111111112 (* angle_m (* PI (* b (- b a)))))
(* 0.011111111111111112 (* angle_m (* PI (* a (- b a))))))))angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a, double b, double angle_m) {
double tmp;
if (a <= 260000000000.0) {
tmp = 0.011111111111111112 * (angle_m * (((double) M_PI) * (b * (b - a))));
} else {
tmp = 0.011111111111111112 * (angle_m * (((double) M_PI) * (a * (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 <= 260000000000.0) {
tmp = 0.011111111111111112 * (angle_m * (Math.PI * (b * (b - a))));
} else {
tmp = 0.011111111111111112 * (angle_m * (Math.PI * (a * (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 <= 260000000000.0: tmp = 0.011111111111111112 * (angle_m * (math.pi * (b * (b - a)))) else: tmp = 0.011111111111111112 * (angle_m * (math.pi * (a * (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 <= 260000000000.0) tmp = Float64(0.011111111111111112 * Float64(angle_m * Float64(pi * Float64(b * Float64(b - a))))); else tmp = Float64(0.011111111111111112 * Float64(angle_m * Float64(pi * Float64(a * 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 <= 260000000000.0) tmp = 0.011111111111111112 * (angle_m * (pi * (b * (b - a)))); else tmp = 0.011111111111111112 * (angle_m * (pi * (a * (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, 260000000000.0], N[(0.011111111111111112 * N[(angle$95$m * N[(Pi * N[(b * N[(b - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.011111111111111112 * N[(angle$95$m * N[(Pi * N[(a * N[(b - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;a \leq 260000000000:\\
\;\;\;\;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(angle\_m \cdot \left(\pi \cdot \left(a \cdot \left(b - a\right)\right)\right)\right)\\
\end{array}
\end{array}
if a < 2.6e11Initial program 53.7%
associate-*l*53.7%
associate-*l*53.7%
Simplified53.7%
Taylor expanded in angle around 0 50.3%
unpow250.3%
unpow250.3%
difference-of-squares54.7%
Applied egg-rr54.7%
Taylor expanded in b around inf 43.2%
if 2.6e11 < a Initial program 49.5%
associate-*l*49.5%
associate-*l*49.5%
Simplified49.5%
Taylor expanded in angle around 0 39.0%
unpow239.0%
unpow239.0%
difference-of-squares46.2%
Applied egg-rr46.2%
Taylor expanded in b around 0 44.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 (<= angle_m 4.3e+176)
(* 0.011111111111111112 (* angle_m (* PI (* a (- b a)))))
(* 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) {
double tmp;
if (angle_m <= 4.3e+176) {
tmp = 0.011111111111111112 * (angle_m * (((double) M_PI) * (a * (b - a))));
} else {
tmp = 0.011111111111111112 * (angle_m * (a * (b * ((double) M_PI))));
}
return angle_s * tmp;
}
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b, double angle_m) {
double tmp;
if (angle_m <= 4.3e+176) {
tmp = 0.011111111111111112 * (angle_m * (Math.PI * (a * (b - a))));
} else {
tmp = 0.011111111111111112 * (angle_m * (a * (b * Math.PI)));
}
return angle_s * tmp;
}
angle\_m = math.fabs(angle) angle\_s = math.copysign(1.0, angle) def code(angle_s, a, b, angle_m): tmp = 0 if angle_m <= 4.3e+176: tmp = 0.011111111111111112 * (angle_m * (math.pi * (a * (b - a)))) else: tmp = 0.011111111111111112 * (angle_m * (a * (b * math.pi))) 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 (angle_m <= 4.3e+176) tmp = Float64(0.011111111111111112 * Float64(angle_m * Float64(pi * Float64(a * Float64(b - a))))); else tmp = Float64(0.011111111111111112 * Float64(angle_m * Float64(a * Float64(b * pi)))); end return Float64(angle_s * tmp) end
angle\_m = abs(angle); angle\_s = sign(angle) * abs(1.0); function tmp_2 = code(angle_s, a, b, angle_m) tmp = 0.0; if (angle_m <= 4.3e+176) tmp = 0.011111111111111112 * (angle_m * (pi * (a * (b - a)))); else tmp = 0.011111111111111112 * (angle_m * (a * (b * pi))); end tmp_2 = angle_s * tmp; end
angle\_m = N[Abs[angle], $MachinePrecision]
angle\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a_, b_, angle$95$m_] := N[(angle$95$s * If[LessEqual[angle$95$m, 4.3e+176], N[(0.011111111111111112 * N[(angle$95$m * N[(Pi * N[(a * N[(b - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 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 \begin{array}{l}
\mathbf{if}\;angle\_m \leq 4.3 \cdot 10^{+176}:\\
\;\;\;\;0.011111111111111112 \cdot \left(angle\_m \cdot \left(\pi \cdot \left(a \cdot \left(b - a\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;0.011111111111111112 \cdot \left(angle\_m \cdot \left(a \cdot \left(b \cdot \pi\right)\right)\right)\\
\end{array}
\end{array}
if angle < 4.30000000000000026e176Initial program 54.8%
associate-*l*54.8%
associate-*l*54.8%
Simplified54.8%
Taylor expanded in angle around 0 50.9%
unpow250.9%
unpow250.9%
difference-of-squares56.2%
Applied egg-rr56.2%
Taylor expanded in b around 0 38.5%
if 4.30000000000000026e176 < angle Initial program 35.0%
associate-*l*35.0%
associate-*l*35.0%
Simplified35.0%
Taylor expanded in angle around 0 18.6%
unpow218.6%
unpow218.6%
difference-of-squares22.1%
Applied egg-rr22.1%
Taylor expanded in b around 0 18.7%
Taylor expanded in a around 0 18.9%
*-commutative18.9%
Simplified18.9%
Final simplification36.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 9.8e+188)
(* 0.011111111111111112 (* angle_m (* a (* b PI))))
(* 0.011111111111111112 (* (* b PI) (* a 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 (a <= 9.8e+188) {
tmp = 0.011111111111111112 * (angle_m * (a * (b * ((double) M_PI))));
} else {
tmp = 0.011111111111111112 * ((b * ((double) M_PI)) * (a * 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 (a <= 9.8e+188) {
tmp = 0.011111111111111112 * (angle_m * (a * (b * Math.PI)));
} else {
tmp = 0.011111111111111112 * ((b * Math.PI) * (a * 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 a <= 9.8e+188: tmp = 0.011111111111111112 * (angle_m * (a * (b * math.pi))) else: tmp = 0.011111111111111112 * ((b * math.pi) * (a * 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 (a <= 9.8e+188) tmp = Float64(0.011111111111111112 * Float64(angle_m * Float64(a * Float64(b * pi)))); else tmp = Float64(0.011111111111111112 * Float64(Float64(b * pi) * Float64(a * angle_m))); end return Float64(angle_s * tmp) end
angle\_m = abs(angle); angle\_s = sign(angle) * abs(1.0); function tmp_2 = code(angle_s, a, b, angle_m) tmp = 0.0; if (a <= 9.8e+188) tmp = 0.011111111111111112 * (angle_m * (a * (b * pi))); else tmp = 0.011111111111111112 * ((b * pi) * (a * angle_m)); end tmp_2 = angle_s * tmp; end
angle\_m = N[Abs[angle], $MachinePrecision]
angle\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a_, b_, angle$95$m_] := N[(angle$95$s * If[LessEqual[a, 9.8e+188], N[(0.011111111111111112 * N[(angle$95$m * N[(a * N[(b * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.011111111111111112 * N[(N[(b * Pi), $MachinePrecision] * N[(a * angle$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;a \leq 9.8 \cdot 10^{+188}:\\
\;\;\;\;0.011111111111111112 \cdot \left(angle\_m \cdot \left(a \cdot \left(b \cdot \pi\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;0.011111111111111112 \cdot \left(\left(b \cdot \pi\right) \cdot \left(a \cdot angle\_m\right)\right)\\
\end{array}
\end{array}
if a < 9.8e188Initial program 52.7%
associate-*l*52.7%
associate-*l*52.7%
Simplified52.7%
Taylor expanded in angle around 0 48.3%
unpow248.3%
unpow248.3%
difference-of-squares52.9%
Applied egg-rr52.9%
Taylor expanded in b around 0 35.6%
Taylor expanded in a around 0 20.4%
*-commutative20.4%
Simplified20.4%
if 9.8e188 < a Initial program 51.0%
associate-*l*51.0%
associate-*l*51.0%
Simplified51.0%
Taylor expanded in angle around 0 34.3%
unpow234.3%
unpow234.3%
difference-of-squares45.4%
Applied egg-rr45.4%
Taylor expanded in b around 0 45.4%
Taylor expanded in a around 0 7.3%
associate-*r*12.4%
*-commutative12.4%
Simplified12.4%
Final simplification19.9%
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.5%
associate-*l*52.5%
associate-*l*52.5%
Simplified52.5%
Taylor expanded in angle around 0 47.3%
unpow247.3%
unpow247.3%
difference-of-squares52.4%
Applied egg-rr52.4%
Taylor expanded in b around 0 36.3%
Taylor expanded in a around 0 19.9%
*-commutative19.9%
Simplified19.9%
Final simplification19.9%
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.5%
associate-*l*52.5%
associate-*l*52.5%
Simplified52.5%
Taylor expanded in angle around 0 47.3%
unpow247.3%
unpow247.3%
difference-of-squares52.4%
Applied egg-rr52.4%
Taylor expanded in b around 0 36.3%
Taylor expanded in a around 0 17.7%
*-commutative17.7%
Simplified17.7%
Final simplification17.7%
herbie shell --seed 2024172
(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)))))