
(FPCore (a b angle) :precision binary64 (let* ((t_0 (* PI (/ angle 180.0)))) (* (* (* 2.0 (- (pow b 2.0) (pow a 2.0))) (sin t_0)) (cos t_0))))
double code(double a, double b, double angle) {
double t_0 = ((double) M_PI) * (angle / 180.0);
return ((2.0 * (pow(b, 2.0) - pow(a, 2.0))) * sin(t_0)) * cos(t_0);
}
public static double code(double a, double b, double angle) {
double t_0 = Math.PI * (angle / 180.0);
return ((2.0 * (Math.pow(b, 2.0) - Math.pow(a, 2.0))) * Math.sin(t_0)) * Math.cos(t_0);
}
def code(a, b, angle): t_0 = math.pi * (angle / 180.0) return ((2.0 * (math.pow(b, 2.0) - math.pow(a, 2.0))) * math.sin(t_0)) * math.cos(t_0)
function code(a, b, angle) t_0 = Float64(pi * Float64(angle / 180.0)) return Float64(Float64(Float64(2.0 * Float64((b ^ 2.0) - (a ^ 2.0))) * sin(t_0)) * cos(t_0)) end
function tmp = code(a, b, angle) t_0 = pi * (angle / 180.0); tmp = ((2.0 * ((b ^ 2.0) - (a ^ 2.0))) * sin(t_0)) * cos(t_0); end
code[a_, b_, angle_] := Block[{t$95$0 = N[(Pi * N[(angle / 180.0), $MachinePrecision]), $MachinePrecision]}, N[(N[(N[(2.0 * N[(N[Power[b, 2.0], $MachinePrecision] - N[Power[a, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision] * N[Cos[t$95$0], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \pi \cdot \frac{angle}{180}\\
\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin t\_0\right) \cdot \cos t\_0
\end{array}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 14 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (a b angle) :precision binary64 (let* ((t_0 (* PI (/ angle 180.0)))) (* (* (* 2.0 (- (pow b 2.0) (pow a 2.0))) (sin t_0)) (cos t_0))))
double code(double a, double b, double angle) {
double t_0 = ((double) M_PI) * (angle / 180.0);
return ((2.0 * (pow(b, 2.0) - pow(a, 2.0))) * sin(t_0)) * cos(t_0);
}
public static double code(double a, double b, double angle) {
double t_0 = Math.PI * (angle / 180.0);
return ((2.0 * (Math.pow(b, 2.0) - Math.pow(a, 2.0))) * Math.sin(t_0)) * Math.cos(t_0);
}
def code(a, b, angle): t_0 = math.pi * (angle / 180.0) return ((2.0 * (math.pow(b, 2.0) - math.pow(a, 2.0))) * math.sin(t_0)) * math.cos(t_0)
function code(a, b, angle) t_0 = Float64(pi * Float64(angle / 180.0)) return Float64(Float64(Float64(2.0 * Float64((b ^ 2.0) - (a ^ 2.0))) * sin(t_0)) * cos(t_0)) end
function tmp = code(a, b, angle) t_0 = pi * (angle / 180.0); tmp = ((2.0 * ((b ^ 2.0) - (a ^ 2.0))) * sin(t_0)) * cos(t_0); end
code[a_, b_, angle_] := Block[{t$95$0 = N[(Pi * N[(angle / 180.0), $MachinePrecision]), $MachinePrecision]}, N[(N[(N[(2.0 * N[(N[Power[b, 2.0], $MachinePrecision] - N[Power[a, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision] * N[Cos[t$95$0], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \pi \cdot \frac{angle}{180}\\
\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin t\_0\right) \cdot \cos t\_0
\end{array}
\end{array}
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a b angle_m)
:precision binary64
(let* ((t_0 (* PI (/ angle_m 180.0)))
(t_1 (* (* PI angle_m) 0.005555555555555556))
(t_2 (sin t_1))
(t_3 (cos t_1)))
(*
angle_s
(if (<=
(* (* (* 2.0 (- (pow b 2.0) (pow a 2.0))) (sin t_0)) (cos t_0))
(- INFINITY))
(*
0.011111111111111112
(- (* PI (* (pow b 2.0) angle_m)) (* a (* a (* PI angle_m)))))
(fma
b
(* 2.0 (* b (* t_2 t_3)))
(* -2.0 (* t_2 (* (pow a 2.0) t_3))))))))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 = (((double) M_PI) * angle_m) * 0.005555555555555556;
double t_2 = sin(t_1);
double t_3 = cos(t_1);
double tmp;
if ((((2.0 * (pow(b, 2.0) - pow(a, 2.0))) * sin(t_0)) * cos(t_0)) <= -((double) INFINITY)) {
tmp = 0.011111111111111112 * ((((double) M_PI) * (pow(b, 2.0) * angle_m)) - (a * (a * (((double) M_PI) * angle_m))));
} else {
tmp = fma(b, (2.0 * (b * (t_2 * t_3))), (-2.0 * (t_2 * (pow(a, 2.0) * t_3))));
}
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(Float64(pi * angle_m) * 0.005555555555555556) t_2 = sin(t_1) t_3 = cos(t_1) tmp = 0.0 if (Float64(Float64(Float64(2.0 * Float64((b ^ 2.0) - (a ^ 2.0))) * sin(t_0)) * cos(t_0)) <= Float64(-Inf)) tmp = Float64(0.011111111111111112 * Float64(Float64(pi * Float64((b ^ 2.0) * angle_m)) - Float64(a * Float64(a * Float64(pi * angle_m))))); else tmp = fma(b, Float64(2.0 * Float64(b * Float64(t_2 * t_3))), Float64(-2.0 * Float64(t_2 * Float64((a ^ 2.0) * t_3)))); 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[(N[(Pi * angle$95$m), $MachinePrecision] * 0.005555555555555556), $MachinePrecision]}, Block[{t$95$2 = N[Sin[t$95$1], $MachinePrecision]}, Block[{t$95$3 = N[Cos[t$95$1], $MachinePrecision]}, N[(angle$95$s * If[LessEqual[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], (-Infinity)], N[(0.011111111111111112 * N[(N[(Pi * N[(N[Power[b, 2.0], $MachinePrecision] * angle$95$m), $MachinePrecision]), $MachinePrecision] - N[(a * N[(a * N[(Pi * angle$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(b * N[(2.0 * N[(b * N[(t$95$2 * t$95$3), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(-2.0 * N[(t$95$2 * N[(N[Power[a, 2.0], $MachinePrecision] * t$95$3), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]]]]]
\begin{array}{l}
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
\begin{array}{l}
t_0 := \pi \cdot \frac{angle\_m}{180}\\
t_1 := \left(\pi \cdot angle\_m\right) \cdot 0.005555555555555556\\
t_2 := \sin t\_1\\
t_3 := \cos t\_1\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin t\_0\right) \cdot \cos t\_0 \leq -\infty:\\
\;\;\;\;0.011111111111111112 \cdot \left(\pi \cdot \left({b}^{2} \cdot angle\_m\right) - a \cdot \left(a \cdot \left(\pi \cdot angle\_m\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(b, 2 \cdot \left(b \cdot \left(t\_2 \cdot t\_3\right)\right), -2 \cdot \left(t\_2 \cdot \left({a}^{2} \cdot t\_3\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 54.2%
associate-*l*54.2%
*-commutative54.2%
associate-*l*54.2%
Simplified54.2%
unpow254.2%
unpow254.2%
difference-of-squares54.2%
Applied egg-rr54.2%
div-inv54.2%
metadata-eval54.2%
add-exp-log33.4%
Applied egg-rr33.4%
Taylor expanded in angle around 0 52.0%
Taylor expanded in a around 0 59.9%
+-commutative59.9%
*-commutative59.9%
Simplified59.9%
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 51.5%
associate-*l*51.5%
*-commutative51.5%
associate-*l*51.5%
Simplified51.5%
unpow251.5%
unpow251.5%
difference-of-squares55.8%
Applied egg-rr55.8%
div-inv56.0%
metadata-eval56.0%
add-exp-log22.9%
Applied egg-rr22.9%
Taylor expanded in b around 0 58.0%
Simplified61.8%
Final simplification61.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 (* PI (/ angle_m 180.0)))
(t_1 (* (- b a) (+ b a)))
(t_2 (* (* (* 2.0 (- (pow b 2.0) (pow a 2.0))) (sin t_0)) (cos t_0)))
(t_3 (* (* PI angle_m) 0.005555555555555556))
(t_4 (cos t_3))
(t_5 (sin t_3)))
(*
angle_s
(if (<= t_2 (- INFINITY))
(*
0.011111111111111112
(- (* PI (* (pow b 2.0) angle_m)) (* a (* a (* PI angle_m)))))
(if (<= t_2 1e+302)
(* (* 2.0 t_4) (* t_5 t_1))
(if (<= t_2 INFINITY)
(fma
b
(* 2.0 (* b (* t_5 t_4)))
(* -2.0 (* (* PI angle_m) (* (pow a 2.0) 0.005555555555555556))))
(*
t_1
(*
2.0
(*
(sin (/ 1.0 (/ 180.0 (* PI angle_m))))
(cbrt
(pow (cos (* PI (* angle_m 0.005555555555555556))) 3.0)))))))))))angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a, double b, double angle_m) {
double t_0 = ((double) M_PI) * (angle_m / 180.0);
double t_1 = (b - a) * (b + a);
double t_2 = ((2.0 * (pow(b, 2.0) - pow(a, 2.0))) * sin(t_0)) * cos(t_0);
double t_3 = (((double) M_PI) * angle_m) * 0.005555555555555556;
double t_4 = cos(t_3);
double t_5 = sin(t_3);
double tmp;
if (t_2 <= -((double) INFINITY)) {
tmp = 0.011111111111111112 * ((((double) M_PI) * (pow(b, 2.0) * angle_m)) - (a * (a * (((double) M_PI) * angle_m))));
} else if (t_2 <= 1e+302) {
tmp = (2.0 * t_4) * (t_5 * t_1);
} else if (t_2 <= ((double) INFINITY)) {
tmp = fma(b, (2.0 * (b * (t_5 * t_4))), (-2.0 * ((((double) M_PI) * angle_m) * (pow(a, 2.0) * 0.005555555555555556))));
} else {
tmp = t_1 * (2.0 * (sin((1.0 / (180.0 / (((double) M_PI) * angle_m)))) * cbrt(pow(cos((((double) M_PI) * (angle_m * 0.005555555555555556))), 3.0))));
}
return angle_s * tmp;
}
angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a, b, angle_m) t_0 = Float64(pi * Float64(angle_m / 180.0)) t_1 = Float64(Float64(b - a) * Float64(b + a)) t_2 = Float64(Float64(Float64(2.0 * Float64((b ^ 2.0) - (a ^ 2.0))) * sin(t_0)) * cos(t_0)) t_3 = Float64(Float64(pi * angle_m) * 0.005555555555555556) t_4 = cos(t_3) t_5 = sin(t_3) tmp = 0.0 if (t_2 <= Float64(-Inf)) tmp = Float64(0.011111111111111112 * Float64(Float64(pi * Float64((b ^ 2.0) * angle_m)) - Float64(a * Float64(a * Float64(pi * angle_m))))); elseif (t_2 <= 1e+302) tmp = Float64(Float64(2.0 * t_4) * Float64(t_5 * t_1)); elseif (t_2 <= Inf) tmp = fma(b, Float64(2.0 * Float64(b * Float64(t_5 * t_4))), Float64(-2.0 * Float64(Float64(pi * angle_m) * Float64((a ^ 2.0) * 0.005555555555555556)))); else tmp = Float64(t_1 * Float64(2.0 * Float64(sin(Float64(1.0 / Float64(180.0 / Float64(pi * angle_m)))) * cbrt((cos(Float64(pi * Float64(angle_m * 0.005555555555555556))) ^ 3.0))))); end return Float64(angle_s * tmp) end
angle\_m = N[Abs[angle], $MachinePrecision]
angle\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a_, b_, angle$95$m_] := Block[{t$95$0 = N[(Pi * N[(angle$95$m / 180.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(b - a), $MachinePrecision] * N[(b + a), $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[(N[(Pi * angle$95$m), $MachinePrecision] * 0.005555555555555556), $MachinePrecision]}, Block[{t$95$4 = N[Cos[t$95$3], $MachinePrecision]}, Block[{t$95$5 = N[Sin[t$95$3], $MachinePrecision]}, N[(angle$95$s * If[LessEqual[t$95$2, (-Infinity)], N[(0.011111111111111112 * N[(N[(Pi * N[(N[Power[b, 2.0], $MachinePrecision] * angle$95$m), $MachinePrecision]), $MachinePrecision] - N[(a * N[(a * N[(Pi * angle$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 1e+302], N[(N[(2.0 * t$95$4), $MachinePrecision] * N[(t$95$5 * t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, Infinity], N[(b * N[(2.0 * N[(b * N[(t$95$5 * t$95$4), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(-2.0 * N[(N[(Pi * angle$95$m), $MachinePrecision] * N[(N[Power[a, 2.0], $MachinePrecision] * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$1 * N[(2.0 * N[(N[Sin[N[(1.0 / N[(180.0 / N[(Pi * angle$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Power[N[Power[N[Cos[N[(Pi * N[(angle$95$m * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], 3.0], $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]), $MachinePrecision]]]]]]]
\begin{array}{l}
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
\begin{array}{l}
t_0 := \pi \cdot \frac{angle\_m}{180}\\
t_1 := \left(b - a\right) \cdot \left(b + a\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 := \left(\pi \cdot angle\_m\right) \cdot 0.005555555555555556\\
t_4 := \cos t\_3\\
t_5 := \sin t\_3\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_2 \leq -\infty:\\
\;\;\;\;0.011111111111111112 \cdot \left(\pi \cdot \left({b}^{2} \cdot angle\_m\right) - a \cdot \left(a \cdot \left(\pi \cdot angle\_m\right)\right)\right)\\
\mathbf{elif}\;t\_2 \leq 10^{+302}:\\
\;\;\;\;\left(2 \cdot t\_4\right) \cdot \left(t\_5 \cdot t\_1\right)\\
\mathbf{elif}\;t\_2 \leq \infty:\\
\;\;\;\;\mathsf{fma}\left(b, 2 \cdot \left(b \cdot \left(t\_5 \cdot t\_4\right)\right), -2 \cdot \left(\left(\pi \cdot angle\_m\right) \cdot \left({a}^{2} \cdot 0.005555555555555556\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1 \cdot \left(2 \cdot \left(\sin \left(\frac{1}{\frac{180}{\pi \cdot angle\_m}}\right) \cdot \sqrt[3]{{\cos \left(\pi \cdot \left(angle\_m \cdot 0.005555555555555556\right)\right)}^{3}}\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 54.2%
associate-*l*54.2%
*-commutative54.2%
associate-*l*54.2%
Simplified54.2%
unpow254.2%
unpow254.2%
difference-of-squares54.2%
Applied egg-rr54.2%
div-inv54.2%
metadata-eval54.2%
add-exp-log33.4%
Applied egg-rr33.4%
Taylor expanded in angle around 0 52.0%
Taylor expanded in a around 0 59.9%
+-commutative59.9%
*-commutative59.9%
Simplified59.9%
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))))) < 1.0000000000000001e302Initial program 58.4%
associate-*l*58.4%
*-commutative58.4%
associate-*l*58.4%
Simplified58.4%
unpow258.4%
unpow258.4%
difference-of-squares58.4%
Applied egg-rr58.4%
div-inv58.7%
metadata-eval58.7%
add-exp-log24.5%
Applied egg-rr24.5%
Taylor expanded in angle around inf 60.0%
associate-*r*60.0%
Simplified60.0%
if 1.0000000000000001e302 < (*.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 40.5%
associate-*l*40.5%
*-commutative40.5%
associate-*l*40.5%
Simplified40.5%
unpow240.5%
unpow240.5%
difference-of-squares40.5%
Applied egg-rr40.5%
div-inv40.5%
metadata-eval40.5%
add-exp-log13.7%
Applied egg-rr13.7%
Taylor expanded in b around 0 65.0%
Simplified65.0%
Taylor expanded in angle around 0 60.6%
associate-*r*60.6%
Simplified60.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%
associate-*l*0.0%
*-commutative0.0%
associate-*l*0.0%
Simplified0.0%
unpow20.0%
unpow20.0%
difference-of-squares75.9%
Applied egg-rr75.9%
associate-*r/84.2%
clear-num84.2%
Applied egg-rr84.2%
add-cbrt-cube84.2%
pow384.2%
div-inv84.2%
metadata-eval84.2%
Applied egg-rr84.2%
Final simplification61.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 (* PI (/ angle_m 180.0)))
(t_1 (* (* (* 2.0 (- (pow b 2.0) (pow a 2.0))) (sin t_0)) (cos t_0)))
(t_2 (* (* PI angle_m) 0.005555555555555556))
(t_3 (cos t_2))
(t_4 (sin t_2)))
(*
angle_s
(if (<= t_1 (- INFINITY))
(*
0.011111111111111112
(- (* PI (* (pow b 2.0) angle_m)) (* a (* a (* PI angle_m)))))
(if (<= t_1 1e+302)
(* (* 2.0 t_3) (* t_4 (* (- b a) (+ b a))))
(fma
b
(* 2.0 (* b (* t_3 (* angle_m (* PI 0.005555555555555556)))))
(* -2.0 (* t_4 (* (pow a 2.0) t_3)))))))))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 = ((2.0 * (pow(b, 2.0) - pow(a, 2.0))) * sin(t_0)) * cos(t_0);
double t_2 = (((double) M_PI) * angle_m) * 0.005555555555555556;
double t_3 = cos(t_2);
double t_4 = sin(t_2);
double tmp;
if (t_1 <= -((double) INFINITY)) {
tmp = 0.011111111111111112 * ((((double) M_PI) * (pow(b, 2.0) * angle_m)) - (a * (a * (((double) M_PI) * angle_m))));
} else if (t_1 <= 1e+302) {
tmp = (2.0 * t_3) * (t_4 * ((b - a) * (b + a)));
} else {
tmp = fma(b, (2.0 * (b * (t_3 * (angle_m * (((double) M_PI) * 0.005555555555555556))))), (-2.0 * (t_4 * (pow(a, 2.0) * t_3))));
}
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(Float64(Float64(2.0 * Float64((b ^ 2.0) - (a ^ 2.0))) * sin(t_0)) * cos(t_0)) t_2 = Float64(Float64(pi * angle_m) * 0.005555555555555556) t_3 = cos(t_2) t_4 = sin(t_2) tmp = 0.0 if (t_1 <= Float64(-Inf)) tmp = Float64(0.011111111111111112 * Float64(Float64(pi * Float64((b ^ 2.0) * angle_m)) - Float64(a * Float64(a * Float64(pi * angle_m))))); elseif (t_1 <= 1e+302) tmp = Float64(Float64(2.0 * t_3) * Float64(t_4 * Float64(Float64(b - a) * Float64(b + a)))); else tmp = fma(b, Float64(2.0 * Float64(b * Float64(t_3 * Float64(angle_m * Float64(pi * 0.005555555555555556))))), Float64(-2.0 * Float64(t_4 * Float64((a ^ 2.0) * t_3)))); 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[(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$2 = N[(N[(Pi * angle$95$m), $MachinePrecision] * 0.005555555555555556), $MachinePrecision]}, Block[{t$95$3 = N[Cos[t$95$2], $MachinePrecision]}, Block[{t$95$4 = N[Sin[t$95$2], $MachinePrecision]}, N[(angle$95$s * If[LessEqual[t$95$1, (-Infinity)], N[(0.011111111111111112 * N[(N[(Pi * N[(N[Power[b, 2.0], $MachinePrecision] * angle$95$m), $MachinePrecision]), $MachinePrecision] - N[(a * N[(a * N[(Pi * angle$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 1e+302], N[(N[(2.0 * t$95$3), $MachinePrecision] * N[(t$95$4 * N[(N[(b - a), $MachinePrecision] * N[(b + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(b * N[(2.0 * N[(b * N[(t$95$3 * N[(angle$95$m * N[(Pi * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(-2.0 * N[(t$95$4 * N[(N[Power[a, 2.0], $MachinePrecision] * t$95$3), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]]]]]]
\begin{array}{l}
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
\begin{array}{l}
t_0 := \pi \cdot \frac{angle\_m}{180}\\
t_1 := \left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin t\_0\right) \cdot \cos t\_0\\
t_2 := \left(\pi \cdot angle\_m\right) \cdot 0.005555555555555556\\
t_3 := \cos t\_2\\
t_4 := \sin t\_2\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_1 \leq -\infty:\\
\;\;\;\;0.011111111111111112 \cdot \left(\pi \cdot \left({b}^{2} \cdot angle\_m\right) - a \cdot \left(a \cdot \left(\pi \cdot angle\_m\right)\right)\right)\\
\mathbf{elif}\;t\_1 \leq 10^{+302}:\\
\;\;\;\;\left(2 \cdot t\_3\right) \cdot \left(t\_4 \cdot \left(\left(b - a\right) \cdot \left(b + a\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(b, 2 \cdot \left(b \cdot \left(t\_3 \cdot \left(angle\_m \cdot \left(\pi \cdot 0.005555555555555556\right)\right)\right)\right), -2 \cdot \left(t\_4 \cdot \left({a}^{2} \cdot t\_3\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 54.2%
associate-*l*54.2%
*-commutative54.2%
associate-*l*54.2%
Simplified54.2%
unpow254.2%
unpow254.2%
difference-of-squares54.2%
Applied egg-rr54.2%
div-inv54.2%
metadata-eval54.2%
add-exp-log33.4%
Applied egg-rr33.4%
Taylor expanded in angle around 0 52.0%
Taylor expanded in a around 0 59.9%
+-commutative59.9%
*-commutative59.9%
Simplified59.9%
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))))) < 1.0000000000000001e302Initial program 58.4%
associate-*l*58.4%
*-commutative58.4%
associate-*l*58.4%
Simplified58.4%
unpow258.4%
unpow258.4%
difference-of-squares58.4%
Applied egg-rr58.4%
div-inv58.7%
metadata-eval58.7%
add-exp-log24.5%
Applied egg-rr24.5%
Taylor expanded in angle around inf 60.0%
associate-*r*60.0%
Simplified60.0%
if 1.0000000000000001e302 < (*.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 31.5%
associate-*l*31.5%
*-commutative31.5%
associate-*l*31.5%
Simplified31.5%
unpow231.5%
unpow231.5%
difference-of-squares48.3%
Applied egg-rr48.3%
div-inv48.3%
metadata-eval48.3%
add-exp-log18.1%
Applied egg-rr18.1%
Taylor expanded in b around 0 52.4%
Simplified67.2%
Taylor expanded in angle around 0 63.5%
*-commutative63.5%
associate-*r*63.6%
*-commutative63.6%
Simplified63.6%
Final simplification60.7%
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a b angle_m)
:precision binary64
(let* ((t_0 (* (- b a) (+ b a)))
(t_1 (- (pow b 2.0) (pow a 2.0)))
(t_2 (* (* PI angle_m) 0.005555555555555556)))
(*
angle_s
(if (<= t_1 -1e+306)
(* -0.011111111111111112 (pow (* a (sqrt (* PI angle_m))) 2.0))
(if (<= t_1 1e+306)
(* (* 2.0 (cos t_2)) (* (sin t_2) t_0))
(if (<= t_1 INFINITY)
(*
0.011111111111111112
(-
(* b (+ (* angle_m (* b PI)) (* angle_m (* PI (- a a)))))
(* (pow a 2.0) (* PI angle_m))))
(*
t_0
(*
2.0
(*
(sin (/ 1.0 (/ 180.0 (* PI angle_m))))
(cbrt
(pow (cos (* PI (* angle_m 0.005555555555555556))) 3.0)))))))))))angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a, double b, double angle_m) {
double t_0 = (b - a) * (b + a);
double t_1 = pow(b, 2.0) - pow(a, 2.0);
double t_2 = (((double) M_PI) * angle_m) * 0.005555555555555556;
double tmp;
if (t_1 <= -1e+306) {
tmp = -0.011111111111111112 * pow((a * sqrt((((double) M_PI) * angle_m))), 2.0);
} else if (t_1 <= 1e+306) {
tmp = (2.0 * cos(t_2)) * (sin(t_2) * t_0);
} else if (t_1 <= ((double) INFINITY)) {
tmp = 0.011111111111111112 * ((b * ((angle_m * (b * ((double) M_PI))) + (angle_m * (((double) M_PI) * (a - a))))) - (pow(a, 2.0) * (((double) M_PI) * angle_m)));
} else {
tmp = t_0 * (2.0 * (sin((1.0 / (180.0 / (((double) M_PI) * angle_m)))) * cbrt(pow(cos((((double) M_PI) * (angle_m * 0.005555555555555556))), 3.0))));
}
return angle_s * tmp;
}
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b, double angle_m) {
double t_0 = (b - a) * (b + a);
double t_1 = Math.pow(b, 2.0) - Math.pow(a, 2.0);
double t_2 = (Math.PI * angle_m) * 0.005555555555555556;
double tmp;
if (t_1 <= -1e+306) {
tmp = -0.011111111111111112 * Math.pow((a * Math.sqrt((Math.PI * angle_m))), 2.0);
} else if (t_1 <= 1e+306) {
tmp = (2.0 * Math.cos(t_2)) * (Math.sin(t_2) * t_0);
} else if (t_1 <= Double.POSITIVE_INFINITY) {
tmp = 0.011111111111111112 * ((b * ((angle_m * (b * Math.PI)) + (angle_m * (Math.PI * (a - a))))) - (Math.pow(a, 2.0) * (Math.PI * angle_m)));
} else {
tmp = t_0 * (2.0 * (Math.sin((1.0 / (180.0 / (Math.PI * angle_m)))) * Math.cbrt(Math.pow(Math.cos((Math.PI * (angle_m * 0.005555555555555556))), 3.0))));
}
return angle_s * tmp;
}
angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a, b, angle_m) t_0 = Float64(Float64(b - a) * Float64(b + a)) t_1 = Float64((b ^ 2.0) - (a ^ 2.0)) t_2 = Float64(Float64(pi * angle_m) * 0.005555555555555556) tmp = 0.0 if (t_1 <= -1e+306) tmp = Float64(-0.011111111111111112 * (Float64(a * sqrt(Float64(pi * angle_m))) ^ 2.0)); elseif (t_1 <= 1e+306) tmp = Float64(Float64(2.0 * cos(t_2)) * Float64(sin(t_2) * t_0)); elseif (t_1 <= Inf) tmp = Float64(0.011111111111111112 * Float64(Float64(b * Float64(Float64(angle_m * Float64(b * pi)) + Float64(angle_m * Float64(pi * Float64(a - a))))) - Float64((a ^ 2.0) * Float64(pi * angle_m)))); else tmp = Float64(t_0 * Float64(2.0 * Float64(sin(Float64(1.0 / Float64(180.0 / Float64(pi * angle_m)))) * cbrt((cos(Float64(pi * Float64(angle_m * 0.005555555555555556))) ^ 3.0))))); end return Float64(angle_s * tmp) end
angle\_m = N[Abs[angle], $MachinePrecision]
angle\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a_, b_, angle$95$m_] := Block[{t$95$0 = N[(N[(b - a), $MachinePrecision] * N[(b + a), $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[(N[(Pi * angle$95$m), $MachinePrecision] * 0.005555555555555556), $MachinePrecision]}, N[(angle$95$s * If[LessEqual[t$95$1, -1e+306], N[(-0.011111111111111112 * N[Power[N[(a * N[Sqrt[N[(Pi * angle$95$m), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 1e+306], N[(N[(2.0 * N[Cos[t$95$2], $MachinePrecision]), $MachinePrecision] * N[(N[Sin[t$95$2], $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, Infinity], N[(0.011111111111111112 * N[(N[(b * N[(N[(angle$95$m * N[(b * Pi), $MachinePrecision]), $MachinePrecision] + N[(angle$95$m * N[(Pi * N[(a - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[Power[a, 2.0], $MachinePrecision] * N[(Pi * angle$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$0 * N[(2.0 * N[(N[Sin[N[(1.0 / N[(180.0 / N[(Pi * angle$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Power[N[Power[N[Cos[N[(Pi * N[(angle$95$m * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], 3.0], $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]), $MachinePrecision]]]]
\begin{array}{l}
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
\begin{array}{l}
t_0 := \left(b - a\right) \cdot \left(b + a\right)\\
t_1 := {b}^{2} - {a}^{2}\\
t_2 := \left(\pi \cdot angle\_m\right) \cdot 0.005555555555555556\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_1 \leq -1 \cdot 10^{+306}:\\
\;\;\;\;-0.011111111111111112 \cdot {\left(a \cdot \sqrt{\pi \cdot angle\_m}\right)}^{2}\\
\mathbf{elif}\;t\_1 \leq 10^{+306}:\\
\;\;\;\;\left(2 \cdot \cos t\_2\right) \cdot \left(\sin t\_2 \cdot t\_0\right)\\
\mathbf{elif}\;t\_1 \leq \infty:\\
\;\;\;\;0.011111111111111112 \cdot \left(b \cdot \left(angle\_m \cdot \left(b \cdot \pi\right) + angle\_m \cdot \left(\pi \cdot \left(a - a\right)\right)\right) - {a}^{2} \cdot \left(\pi \cdot angle\_m\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0 \cdot \left(2 \cdot \left(\sin \left(\frac{1}{\frac{180}{\pi \cdot angle\_m}}\right) \cdot \sqrt[3]{{\cos \left(\pi \cdot \left(angle\_m \cdot 0.005555555555555556\right)\right)}^{3}}\right)\right)\\
\end{array}
\end{array}
\end{array}
if (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) < -1.00000000000000002e306Initial program 60.3%
associate-*l*60.3%
*-commutative60.3%
associate-*l*60.3%
Simplified60.3%
Taylor expanded in angle around 0 54.1%
Taylor expanded in b around 0 54.1%
add-sqr-sqrt31.5%
pow231.5%
*-commutative31.5%
sqrt-prod31.5%
sqrt-pow143.6%
metadata-eval43.6%
pow143.6%
Applied egg-rr43.6%
if -1.00000000000000002e306 < (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) < 1.00000000000000002e306Initial program 57.9%
associate-*l*57.9%
*-commutative57.9%
associate-*l*57.9%
Simplified57.9%
unpow257.9%
unpow257.9%
difference-of-squares57.9%
Applied egg-rr57.9%
div-inv58.2%
metadata-eval58.2%
add-exp-log24.2%
Applied egg-rr24.2%
Taylor expanded in angle around inf 59.5%
associate-*r*59.5%
Simplified59.5%
if 1.00000000000000002e306 < (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) < +inf.0Initial program 36.7%
associate-*l*36.7%
*-commutative36.7%
associate-*l*36.7%
Simplified36.7%
unpow236.7%
unpow236.7%
difference-of-squares36.7%
Applied egg-rr36.7%
div-inv36.7%
metadata-eval36.7%
add-exp-log19.5%
Applied egg-rr19.5%
Taylor expanded in angle around 0 48.1%
Taylor expanded in b around 0 83.9%
if +inf.0 < (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) Initial program 0.0%
associate-*l*0.0%
*-commutative0.0%
associate-*l*0.0%
Simplified0.0%
unpow20.0%
unpow20.0%
difference-of-squares75.9%
Applied egg-rr75.9%
associate-*r/84.2%
clear-num84.2%
Applied egg-rr84.2%
add-cbrt-cube84.2%
pow384.2%
div-inv84.2%
metadata-eval84.2%
Applied egg-rr84.2%
Final simplification62.0%
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a b angle_m)
:precision binary64
(let* ((t_0 (- (pow b 2.0) (pow a 2.0)))
(t_1 (sin (* 0.011111111111111112 (* PI angle_m))))
(t_2 (* (pow a 2.0) (- t_1))))
(*
angle_s
(if (<= t_0 -1e+306)
(* -0.011111111111111112 (pow (* a (sqrt (* PI angle_m))) 2.0))
(if (<= t_0 2e-256)
t_2
(if (<= t_0 1e+306)
(* (pow b 2.0) t_1)
(if (<= t_0 INFINITY)
(*
0.011111111111111112
(-
(* b (+ (* angle_m (* b PI)) (* angle_m (* PI (- a a)))))
(* (pow a 2.0) (* PI angle_m))))
t_2)))))))angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a, double b, double angle_m) {
double t_0 = pow(b, 2.0) - pow(a, 2.0);
double t_1 = sin((0.011111111111111112 * (((double) M_PI) * angle_m)));
double t_2 = pow(a, 2.0) * -t_1;
double tmp;
if (t_0 <= -1e+306) {
tmp = -0.011111111111111112 * pow((a * sqrt((((double) M_PI) * angle_m))), 2.0);
} else if (t_0 <= 2e-256) {
tmp = t_2;
} else if (t_0 <= 1e+306) {
tmp = pow(b, 2.0) * t_1;
} else if (t_0 <= ((double) INFINITY)) {
tmp = 0.011111111111111112 * ((b * ((angle_m * (b * ((double) M_PI))) + (angle_m * (((double) M_PI) * (a - a))))) - (pow(a, 2.0) * (((double) M_PI) * angle_m)));
} else {
tmp = t_2;
}
return angle_s * tmp;
}
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b, double angle_m) {
double t_0 = Math.pow(b, 2.0) - Math.pow(a, 2.0);
double t_1 = Math.sin((0.011111111111111112 * (Math.PI * angle_m)));
double t_2 = Math.pow(a, 2.0) * -t_1;
double tmp;
if (t_0 <= -1e+306) {
tmp = -0.011111111111111112 * Math.pow((a * Math.sqrt((Math.PI * angle_m))), 2.0);
} else if (t_0 <= 2e-256) {
tmp = t_2;
} else if (t_0 <= 1e+306) {
tmp = Math.pow(b, 2.0) * t_1;
} else if (t_0 <= Double.POSITIVE_INFINITY) {
tmp = 0.011111111111111112 * ((b * ((angle_m * (b * Math.PI)) + (angle_m * (Math.PI * (a - a))))) - (Math.pow(a, 2.0) * (Math.PI * angle_m)));
} else {
tmp = t_2;
}
return angle_s * tmp;
}
angle\_m = math.fabs(angle) angle\_s = math.copysign(1.0, angle) def code(angle_s, a, b, angle_m): t_0 = math.pow(b, 2.0) - math.pow(a, 2.0) t_1 = math.sin((0.011111111111111112 * (math.pi * angle_m))) t_2 = math.pow(a, 2.0) * -t_1 tmp = 0 if t_0 <= -1e+306: tmp = -0.011111111111111112 * math.pow((a * math.sqrt((math.pi * angle_m))), 2.0) elif t_0 <= 2e-256: tmp = t_2 elif t_0 <= 1e+306: tmp = math.pow(b, 2.0) * t_1 elif t_0 <= math.inf: tmp = 0.011111111111111112 * ((b * ((angle_m * (b * math.pi)) + (angle_m * (math.pi * (a - a))))) - (math.pow(a, 2.0) * (math.pi * angle_m))) else: tmp = t_2 return angle_s * tmp
angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a, b, angle_m) t_0 = Float64((b ^ 2.0) - (a ^ 2.0)) t_1 = sin(Float64(0.011111111111111112 * Float64(pi * angle_m))) t_2 = Float64((a ^ 2.0) * Float64(-t_1)) tmp = 0.0 if (t_0 <= -1e+306) tmp = Float64(-0.011111111111111112 * (Float64(a * sqrt(Float64(pi * angle_m))) ^ 2.0)); elseif (t_0 <= 2e-256) tmp = t_2; elseif (t_0 <= 1e+306) tmp = Float64((b ^ 2.0) * t_1); elseif (t_0 <= Inf) tmp = Float64(0.011111111111111112 * Float64(Float64(b * Float64(Float64(angle_m * Float64(b * pi)) + Float64(angle_m * Float64(pi * Float64(a - a))))) - Float64((a ^ 2.0) * Float64(pi * angle_m)))); else tmp = t_2; end return Float64(angle_s * tmp) end
angle\_m = abs(angle); angle\_s = sign(angle) * abs(1.0); function tmp_2 = code(angle_s, a, b, angle_m) t_0 = (b ^ 2.0) - (a ^ 2.0); t_1 = sin((0.011111111111111112 * (pi * angle_m))); t_2 = (a ^ 2.0) * -t_1; tmp = 0.0; if (t_0 <= -1e+306) tmp = -0.011111111111111112 * ((a * sqrt((pi * angle_m))) ^ 2.0); elseif (t_0 <= 2e-256) tmp = t_2; elseif (t_0 <= 1e+306) tmp = (b ^ 2.0) * t_1; elseif (t_0 <= Inf) tmp = 0.011111111111111112 * ((b * ((angle_m * (b * pi)) + (angle_m * (pi * (a - a))))) - ((a ^ 2.0) * (pi * angle_m))); else tmp = t_2; end tmp_2 = angle_s * tmp; end
angle\_m = N[Abs[angle], $MachinePrecision]
angle\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a_, b_, angle$95$m_] := Block[{t$95$0 = N[(N[Power[b, 2.0], $MachinePrecision] - N[Power[a, 2.0], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Sin[N[(0.011111111111111112 * N[(Pi * angle$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[(N[Power[a, 2.0], $MachinePrecision] * (-t$95$1)), $MachinePrecision]}, N[(angle$95$s * If[LessEqual[t$95$0, -1e+306], N[(-0.011111111111111112 * N[Power[N[(a * N[Sqrt[N[(Pi * angle$95$m), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 2e-256], t$95$2, If[LessEqual[t$95$0, 1e+306], N[(N[Power[b, 2.0], $MachinePrecision] * t$95$1), $MachinePrecision], If[LessEqual[t$95$0, Infinity], N[(0.011111111111111112 * N[(N[(b * N[(N[(angle$95$m * N[(b * Pi), $MachinePrecision]), $MachinePrecision] + N[(angle$95$m * N[(Pi * N[(a - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[Power[a, 2.0], $MachinePrecision] * N[(Pi * angle$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$2]]]]), $MachinePrecision]]]]
\begin{array}{l}
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
\begin{array}{l}
t_0 := {b}^{2} - {a}^{2}\\
t_1 := \sin \left(0.011111111111111112 \cdot \left(\pi \cdot angle\_m\right)\right)\\
t_2 := {a}^{2} \cdot \left(-t\_1\right)\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_0 \leq -1 \cdot 10^{+306}:\\
\;\;\;\;-0.011111111111111112 \cdot {\left(a \cdot \sqrt{\pi \cdot angle\_m}\right)}^{2}\\
\mathbf{elif}\;t\_0 \leq 2 \cdot 10^{-256}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_0 \leq 10^{+306}:\\
\;\;\;\;{b}^{2} \cdot t\_1\\
\mathbf{elif}\;t\_0 \leq \infty:\\
\;\;\;\;0.011111111111111112 \cdot \left(b \cdot \left(angle\_m \cdot \left(b \cdot \pi\right) + angle\_m \cdot \left(\pi \cdot \left(a - a\right)\right)\right) - {a}^{2} \cdot \left(\pi \cdot angle\_m\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
\end{array}
if (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) < -1.00000000000000002e306Initial program 60.3%
associate-*l*60.3%
*-commutative60.3%
associate-*l*60.3%
Simplified60.3%
Taylor expanded in angle around 0 54.1%
Taylor expanded in b around 0 54.1%
add-sqr-sqrt31.5%
pow231.5%
*-commutative31.5%
sqrt-prod31.5%
sqrt-pow143.6%
metadata-eval43.6%
pow143.6%
Applied egg-rr43.6%
if -1.00000000000000002e306 < (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) < 1.99999999999999995e-256 or +inf.0 < (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) Initial program 56.5%
associate-*l*56.5%
*-commutative56.5%
associate-*l*56.5%
Simplified56.5%
log1p-expm1-u41.0%
log1p-undefine26.6%
2-sin26.6%
associate-*r*26.6%
div-inv26.6%
metadata-eval26.6%
Applied egg-rr26.6%
Taylor expanded in b around 0 67.8%
associate-*r*67.8%
neg-mul-167.8%
Simplified67.8%
if 1.99999999999999995e-256 < (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) < 1.00000000000000002e306Initial program 50.0%
associate-*l*50.0%
*-commutative50.0%
associate-*l*50.0%
Simplified50.0%
log1p-expm1-u34.5%
log1p-undefine12.3%
2-sin12.3%
associate-*r*12.3%
div-inv12.4%
metadata-eval12.4%
Applied egg-rr12.4%
Taylor expanded in b around inf 50.8%
if 1.00000000000000002e306 < (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) < +inf.0Initial program 36.7%
associate-*l*36.7%
*-commutative36.7%
associate-*l*36.7%
Simplified36.7%
unpow236.7%
unpow236.7%
difference-of-squares36.7%
Applied egg-rr36.7%
div-inv36.7%
metadata-eval36.7%
add-exp-log19.5%
Applied egg-rr19.5%
Taylor expanded in angle around 0 48.1%
Taylor expanded in b around 0 83.9%
Final simplification61.4%
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) (+ b a)))
(t_1 (- (pow b 2.0) (pow a 2.0)))
(t_2 (* (* PI angle_m) 0.005555555555555556)))
(*
angle_s
(if (<= t_1 -1e+306)
(* -0.011111111111111112 (pow (* a (sqrt (* PI angle_m))) 2.0))
(if (<= t_1 1e+306)
(* (* 2.0 (cos t_2)) (* (sin t_2) t_0))
(if (<= t_1 INFINITY)
(*
0.011111111111111112
(-
(* b (+ (* angle_m (* b PI)) (* angle_m (* PI (- a a)))))
(* (pow a 2.0) (* PI angle_m))))
(*
t_0
(*
2.0
(*
(cos (* PI (/ angle_m 180.0)))
(sin (/ 1.0 (/ 180.0 (* PI angle_m)))))))))))))angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a, double b, double angle_m) {
double t_0 = (b - a) * (b + a);
double t_1 = pow(b, 2.0) - pow(a, 2.0);
double t_2 = (((double) M_PI) * angle_m) * 0.005555555555555556;
double tmp;
if (t_1 <= -1e+306) {
tmp = -0.011111111111111112 * pow((a * sqrt((((double) M_PI) * angle_m))), 2.0);
} else if (t_1 <= 1e+306) {
tmp = (2.0 * cos(t_2)) * (sin(t_2) * t_0);
} else if (t_1 <= ((double) INFINITY)) {
tmp = 0.011111111111111112 * ((b * ((angle_m * (b * ((double) M_PI))) + (angle_m * (((double) M_PI) * (a - a))))) - (pow(a, 2.0) * (((double) M_PI) * angle_m)));
} else {
tmp = t_0 * (2.0 * (cos((((double) M_PI) * (angle_m / 180.0))) * sin((1.0 / (180.0 / (((double) M_PI) * angle_m))))));
}
return angle_s * tmp;
}
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b, double angle_m) {
double t_0 = (b - a) * (b + a);
double t_1 = Math.pow(b, 2.0) - Math.pow(a, 2.0);
double t_2 = (Math.PI * angle_m) * 0.005555555555555556;
double tmp;
if (t_1 <= -1e+306) {
tmp = -0.011111111111111112 * Math.pow((a * Math.sqrt((Math.PI * angle_m))), 2.0);
} else if (t_1 <= 1e+306) {
tmp = (2.0 * Math.cos(t_2)) * (Math.sin(t_2) * t_0);
} else if (t_1 <= Double.POSITIVE_INFINITY) {
tmp = 0.011111111111111112 * ((b * ((angle_m * (b * Math.PI)) + (angle_m * (Math.PI * (a - a))))) - (Math.pow(a, 2.0) * (Math.PI * angle_m)));
} else {
tmp = t_0 * (2.0 * (Math.cos((Math.PI * (angle_m / 180.0))) * Math.sin((1.0 / (180.0 / (Math.PI * angle_m))))));
}
return angle_s * tmp;
}
angle\_m = math.fabs(angle) angle\_s = math.copysign(1.0, angle) def code(angle_s, a, b, angle_m): t_0 = (b - a) * (b + a) t_1 = math.pow(b, 2.0) - math.pow(a, 2.0) t_2 = (math.pi * angle_m) * 0.005555555555555556 tmp = 0 if t_1 <= -1e+306: tmp = -0.011111111111111112 * math.pow((a * math.sqrt((math.pi * angle_m))), 2.0) elif t_1 <= 1e+306: tmp = (2.0 * math.cos(t_2)) * (math.sin(t_2) * t_0) elif t_1 <= math.inf: tmp = 0.011111111111111112 * ((b * ((angle_m * (b * math.pi)) + (angle_m * (math.pi * (a - a))))) - (math.pow(a, 2.0) * (math.pi * angle_m))) else: tmp = t_0 * (2.0 * (math.cos((math.pi * (angle_m / 180.0))) * math.sin((1.0 / (180.0 / (math.pi * angle_m)))))) return angle_s * tmp
angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a, b, angle_m) t_0 = Float64(Float64(b - a) * Float64(b + a)) t_1 = Float64((b ^ 2.0) - (a ^ 2.0)) t_2 = Float64(Float64(pi * angle_m) * 0.005555555555555556) tmp = 0.0 if (t_1 <= -1e+306) tmp = Float64(-0.011111111111111112 * (Float64(a * sqrt(Float64(pi * angle_m))) ^ 2.0)); elseif (t_1 <= 1e+306) tmp = Float64(Float64(2.0 * cos(t_2)) * Float64(sin(t_2) * t_0)); elseif (t_1 <= Inf) tmp = Float64(0.011111111111111112 * Float64(Float64(b * Float64(Float64(angle_m * Float64(b * pi)) + Float64(angle_m * Float64(pi * Float64(a - a))))) - Float64((a ^ 2.0) * Float64(pi * angle_m)))); else tmp = Float64(t_0 * Float64(2.0 * Float64(cos(Float64(pi * Float64(angle_m / 180.0))) * sin(Float64(1.0 / Float64(180.0 / Float64(pi * angle_m))))))); end return Float64(angle_s * tmp) end
angle\_m = abs(angle); angle\_s = sign(angle) * abs(1.0); function tmp_2 = code(angle_s, a, b, angle_m) t_0 = (b - a) * (b + a); t_1 = (b ^ 2.0) - (a ^ 2.0); t_2 = (pi * angle_m) * 0.005555555555555556; tmp = 0.0; if (t_1 <= -1e+306) tmp = -0.011111111111111112 * ((a * sqrt((pi * angle_m))) ^ 2.0); elseif (t_1 <= 1e+306) tmp = (2.0 * cos(t_2)) * (sin(t_2) * t_0); elseif (t_1 <= Inf) tmp = 0.011111111111111112 * ((b * ((angle_m * (b * pi)) + (angle_m * (pi * (a - a))))) - ((a ^ 2.0) * (pi * angle_m))); else tmp = t_0 * (2.0 * (cos((pi * (angle_m / 180.0))) * sin((1.0 / (180.0 / (pi * angle_m)))))); end tmp_2 = angle_s * tmp; end
angle\_m = N[Abs[angle], $MachinePrecision]
angle\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a_, b_, angle$95$m_] := Block[{t$95$0 = N[(N[(b - a), $MachinePrecision] * N[(b + a), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[Power[b, 2.0], $MachinePrecision] - N[Power[a, 2.0], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(Pi * angle$95$m), $MachinePrecision] * 0.005555555555555556), $MachinePrecision]}, N[(angle$95$s * If[LessEqual[t$95$1, -1e+306], N[(-0.011111111111111112 * N[Power[N[(a * N[Sqrt[N[(Pi * angle$95$m), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 1e+306], N[(N[(2.0 * N[Cos[t$95$2], $MachinePrecision]), $MachinePrecision] * N[(N[Sin[t$95$2], $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, Infinity], N[(0.011111111111111112 * N[(N[(b * N[(N[(angle$95$m * N[(b * Pi), $MachinePrecision]), $MachinePrecision] + N[(angle$95$m * N[(Pi * N[(a - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[Power[a, 2.0], $MachinePrecision] * N[(Pi * angle$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$0 * N[(2.0 * N[(N[Cos[N[(Pi * N[(angle$95$m / 180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sin[N[(1.0 / N[(180.0 / N[(Pi * angle$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]), $MachinePrecision]]]]
\begin{array}{l}
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
\begin{array}{l}
t_0 := \left(b - a\right) \cdot \left(b + a\right)\\
t_1 := {b}^{2} - {a}^{2}\\
t_2 := \left(\pi \cdot angle\_m\right) \cdot 0.005555555555555556\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_1 \leq -1 \cdot 10^{+306}:\\
\;\;\;\;-0.011111111111111112 \cdot {\left(a \cdot \sqrt{\pi \cdot angle\_m}\right)}^{2}\\
\mathbf{elif}\;t\_1 \leq 10^{+306}:\\
\;\;\;\;\left(2 \cdot \cos t\_2\right) \cdot \left(\sin t\_2 \cdot t\_0\right)\\
\mathbf{elif}\;t\_1 \leq \infty:\\
\;\;\;\;0.011111111111111112 \cdot \left(b \cdot \left(angle\_m \cdot \left(b \cdot \pi\right) + angle\_m \cdot \left(\pi \cdot \left(a - a\right)\right)\right) - {a}^{2} \cdot \left(\pi \cdot angle\_m\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0 \cdot \left(2 \cdot \left(\cos \left(\pi \cdot \frac{angle\_m}{180}\right) \cdot \sin \left(\frac{1}{\frac{180}{\pi \cdot angle\_m}}\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))) < -1.00000000000000002e306Initial program 60.3%
associate-*l*60.3%
*-commutative60.3%
associate-*l*60.3%
Simplified60.3%
Taylor expanded in angle around 0 54.1%
Taylor expanded in b around 0 54.1%
add-sqr-sqrt31.5%
pow231.5%
*-commutative31.5%
sqrt-prod31.5%
sqrt-pow143.6%
metadata-eval43.6%
pow143.6%
Applied egg-rr43.6%
if -1.00000000000000002e306 < (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) < 1.00000000000000002e306Initial program 57.9%
associate-*l*57.9%
*-commutative57.9%
associate-*l*57.9%
Simplified57.9%
unpow257.9%
unpow257.9%
difference-of-squares57.9%
Applied egg-rr57.9%
div-inv58.2%
metadata-eval58.2%
add-exp-log24.2%
Applied egg-rr24.2%
Taylor expanded in angle around inf 59.5%
associate-*r*59.5%
Simplified59.5%
if 1.00000000000000002e306 < (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) < +inf.0Initial program 36.7%
associate-*l*36.7%
*-commutative36.7%
associate-*l*36.7%
Simplified36.7%
unpow236.7%
unpow236.7%
difference-of-squares36.7%
Applied egg-rr36.7%
div-inv36.7%
metadata-eval36.7%
add-exp-log19.5%
Applied egg-rr19.5%
Taylor expanded in angle around 0 48.1%
Taylor expanded in b around 0 83.9%
if +inf.0 < (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) Initial program 0.0%
associate-*l*0.0%
*-commutative0.0%
associate-*l*0.0%
Simplified0.0%
unpow20.0%
unpow20.0%
difference-of-squares75.9%
Applied egg-rr75.9%
associate-*r/84.2%
clear-num84.2%
Applied egg-rr84.2%
Final simplification62.0%
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a b angle_m)
:precision binary64
(let* ((t_0 (* PI (/ angle_m 180.0))) (t_1 (- (pow b 2.0) (pow a 2.0))))
(*
angle_s
(if (<= t_1 -1e+306)
(* -0.011111111111111112 (pow (* a (sqrt (* PI angle_m))) 2.0))
(if (or (<= t_1 1e+306) (not (<= t_1 INFINITY)))
(* 2.0 (* (cos t_0) (* (sin t_0) (* (- b a) (+ b a)))))
(*
0.011111111111111112
(-
(* b (+ (* angle_m (* b PI)) (* angle_m (* PI (- a a)))))
(* (pow a 2.0) (* PI angle_m)))))))))angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a, double b, double angle_m) {
double t_0 = ((double) M_PI) * (angle_m / 180.0);
double t_1 = pow(b, 2.0) - pow(a, 2.0);
double tmp;
if (t_1 <= -1e+306) {
tmp = -0.011111111111111112 * pow((a * sqrt((((double) M_PI) * angle_m))), 2.0);
} else if ((t_1 <= 1e+306) || !(t_1 <= ((double) INFINITY))) {
tmp = 2.0 * (cos(t_0) * (sin(t_0) * ((b - a) * (b + a))));
} else {
tmp = 0.011111111111111112 * ((b * ((angle_m * (b * ((double) M_PI))) + (angle_m * (((double) M_PI) * (a - a))))) - (pow(a, 2.0) * (((double) M_PI) * angle_m)));
}
return angle_s * tmp;
}
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b, double angle_m) {
double t_0 = Math.PI * (angle_m / 180.0);
double t_1 = Math.pow(b, 2.0) - Math.pow(a, 2.0);
double tmp;
if (t_1 <= -1e+306) {
tmp = -0.011111111111111112 * Math.pow((a * Math.sqrt((Math.PI * angle_m))), 2.0);
} else if ((t_1 <= 1e+306) || !(t_1 <= Double.POSITIVE_INFINITY)) {
tmp = 2.0 * (Math.cos(t_0) * (Math.sin(t_0) * ((b - a) * (b + a))));
} else {
tmp = 0.011111111111111112 * ((b * ((angle_m * (b * Math.PI)) + (angle_m * (Math.PI * (a - a))))) - (Math.pow(a, 2.0) * (Math.PI * angle_m)));
}
return angle_s * tmp;
}
angle\_m = math.fabs(angle) angle\_s = math.copysign(1.0, angle) def code(angle_s, a, b, angle_m): t_0 = math.pi * (angle_m / 180.0) t_1 = math.pow(b, 2.0) - math.pow(a, 2.0) tmp = 0 if t_1 <= -1e+306: tmp = -0.011111111111111112 * math.pow((a * math.sqrt((math.pi * angle_m))), 2.0) elif (t_1 <= 1e+306) or not (t_1 <= math.inf): tmp = 2.0 * (math.cos(t_0) * (math.sin(t_0) * ((b - a) * (b + a)))) else: tmp = 0.011111111111111112 * ((b * ((angle_m * (b * math.pi)) + (angle_m * (math.pi * (a - a))))) - (math.pow(a, 2.0) * (math.pi * angle_m))) return angle_s * tmp
angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a, b, angle_m) t_0 = Float64(pi * Float64(angle_m / 180.0)) t_1 = Float64((b ^ 2.0) - (a ^ 2.0)) tmp = 0.0 if (t_1 <= -1e+306) tmp = Float64(-0.011111111111111112 * (Float64(a * sqrt(Float64(pi * angle_m))) ^ 2.0)); elseif ((t_1 <= 1e+306) || !(t_1 <= Inf)) tmp = Float64(2.0 * Float64(cos(t_0) * Float64(sin(t_0) * Float64(Float64(b - a) * Float64(b + a))))); else tmp = Float64(0.011111111111111112 * Float64(Float64(b * Float64(Float64(angle_m * Float64(b * pi)) + Float64(angle_m * Float64(pi * Float64(a - a))))) - Float64((a ^ 2.0) * Float64(pi * angle_m)))); end return Float64(angle_s * tmp) end
angle\_m = abs(angle); angle\_s = sign(angle) * abs(1.0); function tmp_2 = code(angle_s, a, b, angle_m) t_0 = pi * (angle_m / 180.0); t_1 = (b ^ 2.0) - (a ^ 2.0); tmp = 0.0; if (t_1 <= -1e+306) tmp = -0.011111111111111112 * ((a * sqrt((pi * angle_m))) ^ 2.0); elseif ((t_1 <= 1e+306) || ~((t_1 <= Inf))) tmp = 2.0 * (cos(t_0) * (sin(t_0) * ((b - a) * (b + a)))); else tmp = 0.011111111111111112 * ((b * ((angle_m * (b * pi)) + (angle_m * (pi * (a - a))))) - ((a ^ 2.0) * (pi * angle_m))); end tmp_2 = angle_s * tmp; end
angle\_m = N[Abs[angle], $MachinePrecision]
angle\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a_, b_, angle$95$m_] := Block[{t$95$0 = N[(Pi * N[(angle$95$m / 180.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[Power[b, 2.0], $MachinePrecision] - N[Power[a, 2.0], $MachinePrecision]), $MachinePrecision]}, N[(angle$95$s * If[LessEqual[t$95$1, -1e+306], N[(-0.011111111111111112 * N[Power[N[(a * N[Sqrt[N[(Pi * angle$95$m), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[t$95$1, 1e+306], N[Not[LessEqual[t$95$1, Infinity]], $MachinePrecision]], N[(2.0 * N[(N[Cos[t$95$0], $MachinePrecision] * N[(N[Sin[t$95$0], $MachinePrecision] * N[(N[(b - a), $MachinePrecision] * N[(b + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.011111111111111112 * N[(N[(b * N[(N[(angle$95$m * N[(b * Pi), $MachinePrecision]), $MachinePrecision] + N[(angle$95$m * N[(Pi * N[(a - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[Power[a, 2.0], $MachinePrecision] * N[(Pi * angle$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]]]
\begin{array}{l}
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
\begin{array}{l}
t_0 := \pi \cdot \frac{angle\_m}{180}\\
t_1 := {b}^{2} - {a}^{2}\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_1 \leq -1 \cdot 10^{+306}:\\
\;\;\;\;-0.011111111111111112 \cdot {\left(a \cdot \sqrt{\pi \cdot angle\_m}\right)}^{2}\\
\mathbf{elif}\;t\_1 \leq 10^{+306} \lor \neg \left(t\_1 \leq \infty\right):\\
\;\;\;\;2 \cdot \left(\cos t\_0 \cdot \left(\sin t\_0 \cdot \left(\left(b - a\right) \cdot \left(b + a\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;0.011111111111111112 \cdot \left(b \cdot \left(angle\_m \cdot \left(b \cdot \pi\right) + angle\_m \cdot \left(\pi \cdot \left(a - a\right)\right)\right) - {a}^{2} \cdot \left(\pi \cdot angle\_m\right)\right)\\
\end{array}
\end{array}
\end{array}
if (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) < -1.00000000000000002e306Initial program 60.3%
associate-*l*60.3%
*-commutative60.3%
associate-*l*60.3%
Simplified60.3%
Taylor expanded in angle around 0 54.1%
Taylor expanded in b around 0 54.1%
add-sqr-sqrt31.5%
pow231.5%
*-commutative31.5%
sqrt-prod31.5%
sqrt-pow143.6%
metadata-eval43.6%
pow143.6%
Applied egg-rr43.6%
if -1.00000000000000002e306 < (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) < 1.00000000000000002e306 or +inf.0 < (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) Initial program 53.7%
associate-*l*53.7%
associate-*l*53.7%
Simplified53.7%
unpow253.7%
unpow253.7%
difference-of-squares59.2%
Applied egg-rr59.2%
if 1.00000000000000002e306 < (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) < +inf.0Initial program 36.7%
associate-*l*36.7%
*-commutative36.7%
associate-*l*36.7%
Simplified36.7%
unpow236.7%
unpow236.7%
difference-of-squares36.7%
Applied egg-rr36.7%
div-inv36.7%
metadata-eval36.7%
add-exp-log19.5%
Applied egg-rr19.5%
Taylor expanded in angle around 0 48.1%
Taylor expanded in b around 0 83.9%
Final simplification60.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) (+ b a)))
(t_1 (* PI (/ angle_m 180.0)))
(t_2 (- (pow b 2.0) (pow a 2.0)))
(t_3 (* (* PI angle_m) 0.005555555555555556)))
(*
angle_s
(if (<= t_2 -1e+306)
(* -0.011111111111111112 (pow (* a (sqrt (* PI angle_m))) 2.0))
(if (<= t_2 1e+306)
(* (* 2.0 (cos t_3)) (* (sin t_3) t_0))
(if (<= t_2 INFINITY)
(*
0.011111111111111112
(-
(* b (+ (* angle_m (* b PI)) (* angle_m (* PI (- a a)))))
(* (pow a 2.0) (* PI angle_m))))
(* 2.0 (* (cos t_1) (* (sin t_1) t_0)))))))))angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a, double b, double angle_m) {
double t_0 = (b - a) * (b + a);
double t_1 = ((double) M_PI) * (angle_m / 180.0);
double t_2 = pow(b, 2.0) - pow(a, 2.0);
double t_3 = (((double) M_PI) * angle_m) * 0.005555555555555556;
double tmp;
if (t_2 <= -1e+306) {
tmp = -0.011111111111111112 * pow((a * sqrt((((double) M_PI) * angle_m))), 2.0);
} else if (t_2 <= 1e+306) {
tmp = (2.0 * cos(t_3)) * (sin(t_3) * t_0);
} else if (t_2 <= ((double) INFINITY)) {
tmp = 0.011111111111111112 * ((b * ((angle_m * (b * ((double) M_PI))) + (angle_m * (((double) M_PI) * (a - a))))) - (pow(a, 2.0) * (((double) M_PI) * angle_m)));
} else {
tmp = 2.0 * (cos(t_1) * (sin(t_1) * t_0));
}
return angle_s * tmp;
}
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b, double angle_m) {
double t_0 = (b - a) * (b + a);
double t_1 = Math.PI * (angle_m / 180.0);
double t_2 = Math.pow(b, 2.0) - Math.pow(a, 2.0);
double t_3 = (Math.PI * angle_m) * 0.005555555555555556;
double tmp;
if (t_2 <= -1e+306) {
tmp = -0.011111111111111112 * Math.pow((a * Math.sqrt((Math.PI * angle_m))), 2.0);
} else if (t_2 <= 1e+306) {
tmp = (2.0 * Math.cos(t_3)) * (Math.sin(t_3) * t_0);
} else if (t_2 <= Double.POSITIVE_INFINITY) {
tmp = 0.011111111111111112 * ((b * ((angle_m * (b * Math.PI)) + (angle_m * (Math.PI * (a - a))))) - (Math.pow(a, 2.0) * (Math.PI * angle_m)));
} else {
tmp = 2.0 * (Math.cos(t_1) * (Math.sin(t_1) * t_0));
}
return angle_s * tmp;
}
angle\_m = math.fabs(angle) angle\_s = math.copysign(1.0, angle) def code(angle_s, a, b, angle_m): t_0 = (b - a) * (b + a) t_1 = math.pi * (angle_m / 180.0) t_2 = math.pow(b, 2.0) - math.pow(a, 2.0) t_3 = (math.pi * angle_m) * 0.005555555555555556 tmp = 0 if t_2 <= -1e+306: tmp = -0.011111111111111112 * math.pow((a * math.sqrt((math.pi * angle_m))), 2.0) elif t_2 <= 1e+306: tmp = (2.0 * math.cos(t_3)) * (math.sin(t_3) * t_0) elif t_2 <= math.inf: tmp = 0.011111111111111112 * ((b * ((angle_m * (b * math.pi)) + (angle_m * (math.pi * (a - a))))) - (math.pow(a, 2.0) * (math.pi * angle_m))) else: tmp = 2.0 * (math.cos(t_1) * (math.sin(t_1) * t_0)) return angle_s * tmp
angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a, b, angle_m) t_0 = Float64(Float64(b - a) * Float64(b + a)) t_1 = Float64(pi * Float64(angle_m / 180.0)) t_2 = Float64((b ^ 2.0) - (a ^ 2.0)) t_3 = Float64(Float64(pi * angle_m) * 0.005555555555555556) tmp = 0.0 if (t_2 <= -1e+306) tmp = Float64(-0.011111111111111112 * (Float64(a * sqrt(Float64(pi * angle_m))) ^ 2.0)); elseif (t_2 <= 1e+306) tmp = Float64(Float64(2.0 * cos(t_3)) * Float64(sin(t_3) * t_0)); elseif (t_2 <= Inf) tmp = Float64(0.011111111111111112 * Float64(Float64(b * Float64(Float64(angle_m * Float64(b * pi)) + Float64(angle_m * Float64(pi * Float64(a - a))))) - Float64((a ^ 2.0) * Float64(pi * angle_m)))); else tmp = Float64(2.0 * Float64(cos(t_1) * Float64(sin(t_1) * t_0))); end return Float64(angle_s * tmp) end
angle\_m = abs(angle); angle\_s = sign(angle) * abs(1.0); function tmp_2 = code(angle_s, a, b, angle_m) t_0 = (b - a) * (b + a); t_1 = pi * (angle_m / 180.0); t_2 = (b ^ 2.0) - (a ^ 2.0); t_3 = (pi * angle_m) * 0.005555555555555556; tmp = 0.0; if (t_2 <= -1e+306) tmp = -0.011111111111111112 * ((a * sqrt((pi * angle_m))) ^ 2.0); elseif (t_2 <= 1e+306) tmp = (2.0 * cos(t_3)) * (sin(t_3) * t_0); elseif (t_2 <= Inf) tmp = 0.011111111111111112 * ((b * ((angle_m * (b * pi)) + (angle_m * (pi * (a - a))))) - ((a ^ 2.0) * (pi * angle_m))); else tmp = 2.0 * (cos(t_1) * (sin(t_1) * t_0)); end tmp_2 = angle_s * tmp; end
angle\_m = N[Abs[angle], $MachinePrecision]
angle\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a_, b_, angle$95$m_] := Block[{t$95$0 = N[(N[(b - a), $MachinePrecision] * N[(b + a), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(Pi * N[(angle$95$m / 180.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[Power[b, 2.0], $MachinePrecision] - N[Power[a, 2.0], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(Pi * angle$95$m), $MachinePrecision] * 0.005555555555555556), $MachinePrecision]}, N[(angle$95$s * If[LessEqual[t$95$2, -1e+306], N[(-0.011111111111111112 * N[Power[N[(a * N[Sqrt[N[(Pi * angle$95$m), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 1e+306], N[(N[(2.0 * N[Cos[t$95$3], $MachinePrecision]), $MachinePrecision] * N[(N[Sin[t$95$3], $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, Infinity], N[(0.011111111111111112 * N[(N[(b * N[(N[(angle$95$m * N[(b * Pi), $MachinePrecision]), $MachinePrecision] + N[(angle$95$m * N[(Pi * N[(a - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[Power[a, 2.0], $MachinePrecision] * N[(Pi * angle$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[Cos[t$95$1], $MachinePrecision] * N[(N[Sin[t$95$1], $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]), $MachinePrecision]]]]]
\begin{array}{l}
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
\begin{array}{l}
t_0 := \left(b - a\right) \cdot \left(b + a\right)\\
t_1 := \pi \cdot \frac{angle\_m}{180}\\
t_2 := {b}^{2} - {a}^{2}\\
t_3 := \left(\pi \cdot angle\_m\right) \cdot 0.005555555555555556\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_2 \leq -1 \cdot 10^{+306}:\\
\;\;\;\;-0.011111111111111112 \cdot {\left(a \cdot \sqrt{\pi \cdot angle\_m}\right)}^{2}\\
\mathbf{elif}\;t\_2 \leq 10^{+306}:\\
\;\;\;\;\left(2 \cdot \cos t\_3\right) \cdot \left(\sin t\_3 \cdot t\_0\right)\\
\mathbf{elif}\;t\_2 \leq \infty:\\
\;\;\;\;0.011111111111111112 \cdot \left(b \cdot \left(angle\_m \cdot \left(b \cdot \pi\right) + angle\_m \cdot \left(\pi \cdot \left(a - a\right)\right)\right) - {a}^{2} \cdot \left(\pi \cdot angle\_m\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(\cos t\_1 \cdot \left(\sin t\_1 \cdot t\_0\right)\right)\\
\end{array}
\end{array}
\end{array}
if (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) < -1.00000000000000002e306Initial program 60.3%
associate-*l*60.3%
*-commutative60.3%
associate-*l*60.3%
Simplified60.3%
Taylor expanded in angle around 0 54.1%
Taylor expanded in b around 0 54.1%
add-sqr-sqrt31.5%
pow231.5%
*-commutative31.5%
sqrt-prod31.5%
sqrt-pow143.6%
metadata-eval43.6%
pow143.6%
Applied egg-rr43.6%
if -1.00000000000000002e306 < (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) < 1.00000000000000002e306Initial program 57.9%
associate-*l*57.9%
*-commutative57.9%
associate-*l*57.9%
Simplified57.9%
unpow257.9%
unpow257.9%
difference-of-squares57.9%
Applied egg-rr57.9%
div-inv58.2%
metadata-eval58.2%
add-exp-log24.2%
Applied egg-rr24.2%
Taylor expanded in angle around inf 59.5%
associate-*r*59.5%
Simplified59.5%
if 1.00000000000000002e306 < (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) < +inf.0Initial program 36.7%
associate-*l*36.7%
*-commutative36.7%
associate-*l*36.7%
Simplified36.7%
unpow236.7%
unpow236.7%
difference-of-squares36.7%
Applied egg-rr36.7%
div-inv36.7%
metadata-eval36.7%
add-exp-log19.5%
Applied egg-rr19.5%
Taylor expanded in angle around 0 48.1%
Taylor expanded in b around 0 83.9%
if +inf.0 < (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) Initial program 0.0%
associate-*l*0.0%
associate-*l*0.0%
Simplified0.0%
unpow20.0%
unpow20.0%
difference-of-squares75.9%
Applied egg-rr75.9%
Final simplification61.6%
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a b angle_m)
:precision binary64
(*
angle_s
(if (<= (/ angle_m 180.0) 4e+16)
(*
0.011111111111111112
(-
(* b (+ (* angle_m (* b PI)) (* angle_m (* PI (- a a)))))
(* (pow a 2.0) (* PI angle_m))))
(if (<= (/ angle_m 180.0) 4e+243)
(* (* (- b a) (+ b a)) (* 2.0 (sin (* PI (/ angle_m 180.0)))))
(fabs (* -0.011111111111111112 (* PI (* (pow a 2.0) 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 ((angle_m / 180.0) <= 4e+16) {
tmp = 0.011111111111111112 * ((b * ((angle_m * (b * ((double) M_PI))) + (angle_m * (((double) M_PI) * (a - a))))) - (pow(a, 2.0) * (((double) M_PI) * angle_m)));
} else if ((angle_m / 180.0) <= 4e+243) {
tmp = ((b - a) * (b + a)) * (2.0 * sin((((double) M_PI) * (angle_m / 180.0))));
} else {
tmp = fabs((-0.011111111111111112 * (((double) M_PI) * (pow(a, 2.0) * 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 ((angle_m / 180.0) <= 4e+16) {
tmp = 0.011111111111111112 * ((b * ((angle_m * (b * Math.PI)) + (angle_m * (Math.PI * (a - a))))) - (Math.pow(a, 2.0) * (Math.PI * angle_m)));
} else if ((angle_m / 180.0) <= 4e+243) {
tmp = ((b - a) * (b + a)) * (2.0 * Math.sin((Math.PI * (angle_m / 180.0))));
} else {
tmp = Math.abs((-0.011111111111111112 * (Math.PI * (Math.pow(a, 2.0) * 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 (angle_m / 180.0) <= 4e+16: tmp = 0.011111111111111112 * ((b * ((angle_m * (b * math.pi)) + (angle_m * (math.pi * (a - a))))) - (math.pow(a, 2.0) * (math.pi * angle_m))) elif (angle_m / 180.0) <= 4e+243: tmp = ((b - a) * (b + a)) * (2.0 * math.sin((math.pi * (angle_m / 180.0)))) else: tmp = math.fabs((-0.011111111111111112 * (math.pi * (math.pow(a, 2.0) * angle_m)))) return angle_s * tmp
angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a, b, angle_m) tmp = 0.0 if (Float64(angle_m / 180.0) <= 4e+16) tmp = Float64(0.011111111111111112 * Float64(Float64(b * Float64(Float64(angle_m * Float64(b * pi)) + Float64(angle_m * Float64(pi * Float64(a - a))))) - Float64((a ^ 2.0) * Float64(pi * angle_m)))); elseif (Float64(angle_m / 180.0) <= 4e+243) tmp = Float64(Float64(Float64(b - a) * Float64(b + a)) * Float64(2.0 * sin(Float64(pi * Float64(angle_m / 180.0))))); else tmp = abs(Float64(-0.011111111111111112 * Float64(pi * Float64((a ^ 2.0) * 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 ((angle_m / 180.0) <= 4e+16) tmp = 0.011111111111111112 * ((b * ((angle_m * (b * pi)) + (angle_m * (pi * (a - a))))) - ((a ^ 2.0) * (pi * angle_m))); elseif ((angle_m / 180.0) <= 4e+243) tmp = ((b - a) * (b + a)) * (2.0 * sin((pi * (angle_m / 180.0)))); else tmp = abs((-0.011111111111111112 * (pi * ((a ^ 2.0) * 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[N[(angle$95$m / 180.0), $MachinePrecision], 4e+16], N[(0.011111111111111112 * N[(N[(b * N[(N[(angle$95$m * N[(b * Pi), $MachinePrecision]), $MachinePrecision] + N[(angle$95$m * N[(Pi * N[(a - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[Power[a, 2.0], $MachinePrecision] * N[(Pi * angle$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 4e+243], N[(N[(N[(b - a), $MachinePrecision] * N[(b + a), $MachinePrecision]), $MachinePrecision] * N[(2.0 * N[Sin[N[(Pi * N[(angle$95$m / 180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Abs[N[(-0.011111111111111112 * N[(Pi * N[(N[Power[a, 2.0], $MachinePrecision] * angle$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]), $MachinePrecision]
\begin{array}{l}
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;\frac{angle\_m}{180} \leq 4 \cdot 10^{+16}:\\
\;\;\;\;0.011111111111111112 \cdot \left(b \cdot \left(angle\_m \cdot \left(b \cdot \pi\right) + angle\_m \cdot \left(\pi \cdot \left(a - a\right)\right)\right) - {a}^{2} \cdot \left(\pi \cdot angle\_m\right)\right)\\
\mathbf{elif}\;\frac{angle\_m}{180} \leq 4 \cdot 10^{+243}:\\
\;\;\;\;\left(\left(b - a\right) \cdot \left(b + a\right)\right) \cdot \left(2 \cdot \sin \left(\pi \cdot \frac{angle\_m}{180}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left|-0.011111111111111112 \cdot \left(\pi \cdot \left({a}^{2} \cdot angle\_m\right)\right)\right|\\
\end{array}
\end{array}
if (/.f64 angle #s(literal 180 binary64)) < 4e16Initial program 59.8%
associate-*l*59.8%
*-commutative59.8%
associate-*l*59.8%
Simplified59.8%
unpow259.8%
unpow259.8%
difference-of-squares63.1%
Applied egg-rr63.1%
div-inv63.2%
metadata-eval63.2%
add-exp-log21.7%
Applied egg-rr21.7%
Taylor expanded in angle around 0 58.6%
Taylor expanded in b around 0 63.7%
if 4e16 < (/.f64 angle #s(literal 180 binary64)) < 4.0000000000000003e243Initial program 31.1%
associate-*l*31.1%
*-commutative31.1%
associate-*l*31.1%
Simplified31.1%
unpow231.1%
unpow231.1%
difference-of-squares34.8%
Applied egg-rr34.8%
Taylor expanded in angle around 0 37.4%
if 4.0000000000000003e243 < (/.f64 angle #s(literal 180 binary64)) Initial program 24.6%
associate-*l*24.6%
*-commutative24.6%
associate-*l*24.6%
Simplified24.6%
Taylor expanded in angle around 0 25.1%
Taylor expanded in b around 0 18.0%
add-sqr-sqrt9.2%
sqrt-unprod40.5%
*-commutative40.5%
*-commutative40.5%
swap-sqr40.5%
pow240.5%
*-commutative40.5%
*-commutative40.5%
*-commutative40.5%
associate-*l*40.5%
metadata-eval40.5%
Applied egg-rr40.5%
unpow240.5%
metadata-eval40.5%
swap-sqr40.5%
rem-sqrt-square40.5%
associate-*r*40.5%
*-commutative40.5%
associate-*l*40.5%
Simplified40.5%
Final simplification57.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 (<= (/ angle_m 180.0) 1e+21)
(*
0.011111111111111112
(-
(* b (+ (* angle_m (* b PI)) (* angle_m (* PI (- a a)))))
(* (pow a 2.0) (* PI angle_m))))
(* (* (- b a) (+ b a)) (* 2.0 (sin (/ 1.0 (/ 180.0 (* 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 ((angle_m / 180.0) <= 1e+21) {
tmp = 0.011111111111111112 * ((b * ((angle_m * (b * ((double) M_PI))) + (angle_m * (((double) M_PI) * (a - a))))) - (pow(a, 2.0) * (((double) M_PI) * angle_m)));
} else {
tmp = ((b - a) * (b + a)) * (2.0 * sin((1.0 / (180.0 / (((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 ((angle_m / 180.0) <= 1e+21) {
tmp = 0.011111111111111112 * ((b * ((angle_m * (b * Math.PI)) + (angle_m * (Math.PI * (a - a))))) - (Math.pow(a, 2.0) * (Math.PI * angle_m)));
} else {
tmp = ((b - a) * (b + a)) * (2.0 * Math.sin((1.0 / (180.0 / (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 (angle_m / 180.0) <= 1e+21: tmp = 0.011111111111111112 * ((b * ((angle_m * (b * math.pi)) + (angle_m * (math.pi * (a - a))))) - (math.pow(a, 2.0) * (math.pi * angle_m))) else: tmp = ((b - a) * (b + a)) * (2.0 * math.sin((1.0 / (180.0 / (math.pi * angle_m))))) return angle_s * tmp
angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a, b, angle_m) tmp = 0.0 if (Float64(angle_m / 180.0) <= 1e+21) tmp = Float64(0.011111111111111112 * Float64(Float64(b * Float64(Float64(angle_m * Float64(b * pi)) + Float64(angle_m * Float64(pi * Float64(a - a))))) - Float64((a ^ 2.0) * Float64(pi * angle_m)))); else tmp = Float64(Float64(Float64(b - a) * Float64(b + a)) * Float64(2.0 * sin(Float64(1.0 / Float64(180.0 / 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 ((angle_m / 180.0) <= 1e+21) tmp = 0.011111111111111112 * ((b * ((angle_m * (b * pi)) + (angle_m * (pi * (a - a))))) - ((a ^ 2.0) * (pi * angle_m))); else tmp = ((b - a) * (b + a)) * (2.0 * sin((1.0 / (180.0 / (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[N[(angle$95$m / 180.0), $MachinePrecision], 1e+21], N[(0.011111111111111112 * N[(N[(b * N[(N[(angle$95$m * N[(b * Pi), $MachinePrecision]), $MachinePrecision] + N[(angle$95$m * N[(Pi * N[(a - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[Power[a, 2.0], $MachinePrecision] * N[(Pi * angle$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(b - a), $MachinePrecision] * N[(b + a), $MachinePrecision]), $MachinePrecision] * N[(2.0 * N[Sin[N[(1.0 / N[(180.0 / N[(Pi * angle$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;\frac{angle\_m}{180} \leq 10^{+21}:\\
\;\;\;\;0.011111111111111112 \cdot \left(b \cdot \left(angle\_m \cdot \left(b \cdot \pi\right) + angle\_m \cdot \left(\pi \cdot \left(a - a\right)\right)\right) - {a}^{2} \cdot \left(\pi \cdot angle\_m\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(b - a\right) \cdot \left(b + a\right)\right) \cdot \left(2 \cdot \sin \left(\frac{1}{\frac{180}{\pi \cdot angle\_m}}\right)\right)\\
\end{array}
\end{array}
if (/.f64 angle #s(literal 180 binary64)) < 1e21Initial program 59.7%
associate-*l*59.7%
*-commutative59.7%
associate-*l*59.7%
Simplified59.7%
unpow259.7%
unpow259.7%
difference-of-squares62.9%
Applied egg-rr62.9%
div-inv63.1%
metadata-eval63.1%
add-exp-log22.0%
Applied egg-rr22.0%
Taylor expanded in angle around 0 58.5%
Taylor expanded in b around 0 63.5%
if 1e21 < (/.f64 angle #s(literal 180 binary64)) Initial program 28.2%
associate-*l*28.2%
*-commutative28.2%
associate-*l*28.2%
Simplified28.2%
unpow228.2%
unpow228.2%
difference-of-squares32.9%
Applied egg-rr32.9%
associate-*r/36.9%
clear-num37.9%
Applied egg-rr37.9%
Taylor expanded in angle around 0 36.3%
Final simplification56.8%
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a b angle_m)
:precision binary64
(*
angle_s
(if (<= (/ angle_m 180.0) 1e+21)
(*
0.011111111111111112
(- (* PI (* (pow b 2.0) angle_m)) (* a (* a (* PI angle_m)))))
(* (* (- b a) (+ b a)) (* 2.0 (sin (/ 1.0 (/ 180.0 (* 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 ((angle_m / 180.0) <= 1e+21) {
tmp = 0.011111111111111112 * ((((double) M_PI) * (pow(b, 2.0) * angle_m)) - (a * (a * (((double) M_PI) * angle_m))));
} else {
tmp = ((b - a) * (b + a)) * (2.0 * sin((1.0 / (180.0 / (((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 ((angle_m / 180.0) <= 1e+21) {
tmp = 0.011111111111111112 * ((Math.PI * (Math.pow(b, 2.0) * angle_m)) - (a * (a * (Math.PI * angle_m))));
} else {
tmp = ((b - a) * (b + a)) * (2.0 * Math.sin((1.0 / (180.0 / (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 (angle_m / 180.0) <= 1e+21: tmp = 0.011111111111111112 * ((math.pi * (math.pow(b, 2.0) * angle_m)) - (a * (a * (math.pi * angle_m)))) else: tmp = ((b - a) * (b + a)) * (2.0 * math.sin((1.0 / (180.0 / (math.pi * angle_m))))) return angle_s * tmp
angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a, b, angle_m) tmp = 0.0 if (Float64(angle_m / 180.0) <= 1e+21) tmp = Float64(0.011111111111111112 * Float64(Float64(pi * Float64((b ^ 2.0) * angle_m)) - Float64(a * Float64(a * Float64(pi * angle_m))))); else tmp = Float64(Float64(Float64(b - a) * Float64(b + a)) * Float64(2.0 * sin(Float64(1.0 / Float64(180.0 / 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 ((angle_m / 180.0) <= 1e+21) tmp = 0.011111111111111112 * ((pi * ((b ^ 2.0) * angle_m)) - (a * (a * (pi * angle_m)))); else tmp = ((b - a) * (b + a)) * (2.0 * sin((1.0 / (180.0 / (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[N[(angle$95$m / 180.0), $MachinePrecision], 1e+21], N[(0.011111111111111112 * N[(N[(Pi * N[(N[Power[b, 2.0], $MachinePrecision] * angle$95$m), $MachinePrecision]), $MachinePrecision] - N[(a * N[(a * N[(Pi * angle$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(b - a), $MachinePrecision] * N[(b + a), $MachinePrecision]), $MachinePrecision] * N[(2.0 * N[Sin[N[(1.0 / N[(180.0 / N[(Pi * angle$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;\frac{angle\_m}{180} \leq 10^{+21}:\\
\;\;\;\;0.011111111111111112 \cdot \left(\pi \cdot \left({b}^{2} \cdot angle\_m\right) - a \cdot \left(a \cdot \left(\pi \cdot angle\_m\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(b - a\right) \cdot \left(b + a\right)\right) \cdot \left(2 \cdot \sin \left(\frac{1}{\frac{180}{\pi \cdot angle\_m}}\right)\right)\\
\end{array}
\end{array}
if (/.f64 angle #s(literal 180 binary64)) < 1e21Initial program 59.7%
associate-*l*59.7%
*-commutative59.7%
associate-*l*59.7%
Simplified59.7%
unpow259.7%
unpow259.7%
difference-of-squares62.9%
Applied egg-rr62.9%
div-inv63.1%
metadata-eval63.1%
add-exp-log22.0%
Applied egg-rr22.0%
Taylor expanded in angle around 0 58.5%
Taylor expanded in a around 0 60.2%
+-commutative60.2%
*-commutative60.2%
Simplified60.1%
if 1e21 < (/.f64 angle #s(literal 180 binary64)) Initial program 28.2%
associate-*l*28.2%
*-commutative28.2%
associate-*l*28.2%
Simplified28.2%
unpow228.2%
unpow228.2%
difference-of-squares32.9%
Applied egg-rr32.9%
associate-*r/36.9%
clear-num37.9%
Applied egg-rr37.9%
Taylor expanded in angle around 0 36.3%
Final simplification54.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 (<= (/ angle_m 180.0) 4e+16)
(*
0.011111111111111112
(- (* PI (* (pow b 2.0) angle_m)) (* a (* a (* PI angle_m)))))
(* (* (- b a) (+ b a)) (* 2.0 (sin (* PI (/ angle_m 180.0))))))))angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a, double b, double angle_m) {
double tmp;
if ((angle_m / 180.0) <= 4e+16) {
tmp = 0.011111111111111112 * ((((double) M_PI) * (pow(b, 2.0) * angle_m)) - (a * (a * (((double) M_PI) * angle_m))));
} else {
tmp = ((b - a) * (b + a)) * (2.0 * sin((((double) M_PI) * (angle_m / 180.0))));
}
return angle_s * tmp;
}
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b, double angle_m) {
double tmp;
if ((angle_m / 180.0) <= 4e+16) {
tmp = 0.011111111111111112 * ((Math.PI * (Math.pow(b, 2.0) * angle_m)) - (a * (a * (Math.PI * angle_m))));
} else {
tmp = ((b - a) * (b + a)) * (2.0 * Math.sin((Math.PI * (angle_m / 180.0))));
}
return angle_s * tmp;
}
angle\_m = math.fabs(angle) angle\_s = math.copysign(1.0, angle) def code(angle_s, a, b, angle_m): tmp = 0 if (angle_m / 180.0) <= 4e+16: tmp = 0.011111111111111112 * ((math.pi * (math.pow(b, 2.0) * angle_m)) - (a * (a * (math.pi * angle_m)))) else: tmp = ((b - a) * (b + a)) * (2.0 * math.sin((math.pi * (angle_m / 180.0)))) return angle_s * tmp
angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a, b, angle_m) tmp = 0.0 if (Float64(angle_m / 180.0) <= 4e+16) tmp = Float64(0.011111111111111112 * Float64(Float64(pi * Float64((b ^ 2.0) * angle_m)) - Float64(a * Float64(a * Float64(pi * angle_m))))); else tmp = Float64(Float64(Float64(b - a) * Float64(b + a)) * Float64(2.0 * sin(Float64(pi * Float64(angle_m / 180.0))))); end return Float64(angle_s * tmp) end
angle\_m = abs(angle); angle\_s = sign(angle) * abs(1.0); function tmp_2 = code(angle_s, a, b, angle_m) tmp = 0.0; if ((angle_m / 180.0) <= 4e+16) tmp = 0.011111111111111112 * ((pi * ((b ^ 2.0) * angle_m)) - (a * (a * (pi * angle_m)))); else tmp = ((b - a) * (b + a)) * (2.0 * sin((pi * (angle_m / 180.0)))); end tmp_2 = angle_s * tmp; end
angle\_m = N[Abs[angle], $MachinePrecision]
angle\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a_, b_, angle$95$m_] := N[(angle$95$s * If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 4e+16], N[(0.011111111111111112 * N[(N[(Pi * N[(N[Power[b, 2.0], $MachinePrecision] * angle$95$m), $MachinePrecision]), $MachinePrecision] - N[(a * N[(a * N[(Pi * angle$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(b - a), $MachinePrecision] * N[(b + a), $MachinePrecision]), $MachinePrecision] * N[(2.0 * N[Sin[N[(Pi * N[(angle$95$m / 180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;\frac{angle\_m}{180} \leq 4 \cdot 10^{+16}:\\
\;\;\;\;0.011111111111111112 \cdot \left(\pi \cdot \left({b}^{2} \cdot angle\_m\right) - a \cdot \left(a \cdot \left(\pi \cdot angle\_m\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(b - a\right) \cdot \left(b + a\right)\right) \cdot \left(2 \cdot \sin \left(\pi \cdot \frac{angle\_m}{180}\right)\right)\\
\end{array}
\end{array}
if (/.f64 angle #s(literal 180 binary64)) < 4e16Initial program 59.8%
associate-*l*59.8%
*-commutative59.8%
associate-*l*59.8%
Simplified59.8%
unpow259.8%
unpow259.8%
difference-of-squares63.1%
Applied egg-rr63.1%
div-inv63.2%
metadata-eval63.2%
add-exp-log21.7%
Applied egg-rr21.7%
Taylor expanded in angle around 0 58.6%
Taylor expanded in a around 0 60.3%
+-commutative60.3%
*-commutative60.3%
Simplified60.3%
if 4e16 < (/.f64 angle #s(literal 180 binary64)) Initial program 29.8%
associate-*l*29.8%
*-commutative29.8%
associate-*l*29.8%
Simplified29.8%
unpow229.8%
unpow229.8%
difference-of-squares34.3%
Applied egg-rr34.3%
Taylor expanded in angle around 0 35.7%
Final simplification53.8%
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a b angle_m)
:precision binary64
(*
angle_s
(if (<= angle_m 4.7e+61)
(*
0.011111111111111112
(- (* PI (* (pow b 2.0) angle_m)) (* a (* a (* PI angle_m)))))
(* 0.011111111111111112 (* angle_m (* (pow b 2.0) PI))))))angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a, double b, double angle_m) {
double tmp;
if (angle_m <= 4.7e+61) {
tmp = 0.011111111111111112 * ((((double) M_PI) * (pow(b, 2.0) * angle_m)) - (a * (a * (((double) M_PI) * angle_m))));
} else {
tmp = 0.011111111111111112 * (angle_m * (pow(b, 2.0) * ((double) M_PI)));
}
return angle_s * tmp;
}
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b, double angle_m) {
double tmp;
if (angle_m <= 4.7e+61) {
tmp = 0.011111111111111112 * ((Math.PI * (Math.pow(b, 2.0) * angle_m)) - (a * (a * (Math.PI * angle_m))));
} else {
tmp = 0.011111111111111112 * (angle_m * (Math.pow(b, 2.0) * Math.PI));
}
return angle_s * tmp;
}
angle\_m = math.fabs(angle) angle\_s = math.copysign(1.0, angle) def code(angle_s, a, b, angle_m): tmp = 0 if angle_m <= 4.7e+61: tmp = 0.011111111111111112 * ((math.pi * (math.pow(b, 2.0) * angle_m)) - (a * (a * (math.pi * angle_m)))) else: tmp = 0.011111111111111112 * (angle_m * (math.pow(b, 2.0) * math.pi)) return angle_s * tmp
angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a, b, angle_m) tmp = 0.0 if (angle_m <= 4.7e+61) tmp = Float64(0.011111111111111112 * Float64(Float64(pi * Float64((b ^ 2.0) * angle_m)) - Float64(a * Float64(a * Float64(pi * angle_m))))); else tmp = Float64(0.011111111111111112 * Float64(angle_m * Float64((b ^ 2.0) * pi))); end return Float64(angle_s * tmp) end
angle\_m = abs(angle); angle\_s = sign(angle) * abs(1.0); function tmp_2 = code(angle_s, a, b, angle_m) tmp = 0.0; if (angle_m <= 4.7e+61) tmp = 0.011111111111111112 * ((pi * ((b ^ 2.0) * angle_m)) - (a * (a * (pi * angle_m)))); else tmp = 0.011111111111111112 * (angle_m * ((b ^ 2.0) * pi)); end tmp_2 = angle_s * tmp; end
angle\_m = N[Abs[angle], $MachinePrecision]
angle\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a_, b_, angle$95$m_] := N[(angle$95$s * If[LessEqual[angle$95$m, 4.7e+61], N[(0.011111111111111112 * N[(N[(Pi * N[(N[Power[b, 2.0], $MachinePrecision] * angle$95$m), $MachinePrecision]), $MachinePrecision] - N[(a * N[(a * N[(Pi * angle$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.011111111111111112 * N[(angle$95$m * N[(N[Power[b, 2.0], $MachinePrecision] * Pi), $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.7 \cdot 10^{+61}:\\
\;\;\;\;0.011111111111111112 \cdot \left(\pi \cdot \left({b}^{2} \cdot angle\_m\right) - a \cdot \left(a \cdot \left(\pi \cdot angle\_m\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;0.011111111111111112 \cdot \left(angle\_m \cdot \left({b}^{2} \cdot \pi\right)\right)\\
\end{array}
\end{array}
if angle < 4.6999999999999998e61Initial program 58.1%
associate-*l*58.1%
*-commutative58.1%
associate-*l*58.1%
Simplified58.1%
unpow258.1%
unpow258.1%
difference-of-squares61.6%
Applied egg-rr61.6%
div-inv61.7%
metadata-eval61.7%
add-exp-log22.4%
Applied egg-rr22.4%
Taylor expanded in angle around 0 57.1%
Taylor expanded in a around 0 58.2%
+-commutative58.2%
*-commutative58.2%
Simplified58.2%
if 4.6999999999999998e61 < angle Initial program 28.6%
associate-*l*28.6%
*-commutative28.6%
associate-*l*28.6%
Simplified28.6%
Taylor expanded in angle around 0 23.3%
Taylor expanded in b around inf 26.5%
Final simplification51.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 (* 0.011111111111111112 (* angle_m (* PI (* (- b a) (+ b a)))))))
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a, double b, double angle_m) {
return angle_s * (0.011111111111111112 * (angle_m * (((double) M_PI) * ((b - a) * (b + a)))));
}
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b, double angle_m) {
return angle_s * (0.011111111111111112 * (angle_m * (Math.PI * ((b - a) * (b + a)))));
}
angle\_m = math.fabs(angle) angle\_s = math.copysign(1.0, angle) def code(angle_s, a, b, angle_m): return angle_s * (0.011111111111111112 * (angle_m * (math.pi * ((b - a) * (b + a)))))
angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a, b, angle_m) return Float64(angle_s * Float64(0.011111111111111112 * Float64(angle_m * Float64(pi * Float64(Float64(b - a) * Float64(b + a)))))) end
angle\_m = abs(angle); angle\_s = sign(angle) * abs(1.0); function tmp = code(angle_s, a, b, angle_m) tmp = angle_s * (0.011111111111111112 * (angle_m * (pi * ((b - a) * (b + a))))); end
angle\_m = N[Abs[angle], $MachinePrecision]
angle\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a_, b_, angle$95$m_] := N[(angle$95$s * N[(0.011111111111111112 * N[(angle$95$m * N[(Pi * N[(N[(b - a), $MachinePrecision] * N[(b + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
angle\_s \cdot \left(0.011111111111111112 \cdot \left(angle\_m \cdot \left(\pi \cdot \left(\left(b - a\right) \cdot \left(b + a\right)\right)\right)\right)\right)
\end{array}
Initial program 52.0%
associate-*l*52.0%
*-commutative52.0%
associate-*l*52.0%
Simplified52.0%
unpow252.0%
unpow252.0%
difference-of-squares55.5%
Applied egg-rr55.5%
div-inv55.7%
metadata-eval55.7%
add-exp-log24.8%
Applied egg-rr24.8%
Taylor expanded in angle around 0 50.5%
Final simplification50.5%
herbie shell --seed 2024094
(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)))))