
(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 20 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 (sin (* 0.005555555555555556 (* angle_m PI))))
(t_2 (* (* (+ b a) (- b a)) (sin t_0))))
(*
angle_s
(if (<= (/ angle_m 180.0) 1e-6)
(*
2.0
(*
(+ (* a (- (* t_1 (- b b)) (* a t_1))) (pow (* b (sqrt t_1)) 2.0))
(cos t_0)))
(if (<= (/ angle_m 180.0) 2e+172)
(* 2.0 (* t_2 (cos (* (/ angle_m 180.0) (cbrt (pow PI 3.0))))))
(*
2.0
(*
t_2
(sqrt (pow (cos (* PI (* 0.005555555555555556 angle_m))) 2.0)))))))))angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a, double b, double angle_m) {
double t_0 = ((double) M_PI) * (angle_m / 180.0);
double t_1 = sin((0.005555555555555556 * (angle_m * ((double) M_PI))));
double t_2 = ((b + a) * (b - a)) * sin(t_0);
double tmp;
if ((angle_m / 180.0) <= 1e-6) {
tmp = 2.0 * (((a * ((t_1 * (b - b)) - (a * t_1))) + pow((b * sqrt(t_1)), 2.0)) * cos(t_0));
} else if ((angle_m / 180.0) <= 2e+172) {
tmp = 2.0 * (t_2 * cos(((angle_m / 180.0) * cbrt(pow(((double) M_PI), 3.0)))));
} else {
tmp = 2.0 * (t_2 * sqrt(pow(cos((((double) M_PI) * (0.005555555555555556 * angle_m))), 2.0)));
}
return angle_s * tmp;
}
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b, double angle_m) {
double t_0 = Math.PI * (angle_m / 180.0);
double t_1 = Math.sin((0.005555555555555556 * (angle_m * Math.PI)));
double t_2 = ((b + a) * (b - a)) * Math.sin(t_0);
double tmp;
if ((angle_m / 180.0) <= 1e-6) {
tmp = 2.0 * (((a * ((t_1 * (b - b)) - (a * t_1))) + Math.pow((b * Math.sqrt(t_1)), 2.0)) * Math.cos(t_0));
} else if ((angle_m / 180.0) <= 2e+172) {
tmp = 2.0 * (t_2 * Math.cos(((angle_m / 180.0) * Math.cbrt(Math.pow(Math.PI, 3.0)))));
} else {
tmp = 2.0 * (t_2 * Math.sqrt(Math.pow(Math.cos((Math.PI * (0.005555555555555556 * angle_m))), 2.0)));
}
return angle_s * tmp;
}
angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a, b, angle_m) t_0 = Float64(pi * Float64(angle_m / 180.0)) t_1 = sin(Float64(0.005555555555555556 * Float64(angle_m * pi))) t_2 = Float64(Float64(Float64(b + a) * Float64(b - a)) * sin(t_0)) tmp = 0.0 if (Float64(angle_m / 180.0) <= 1e-6) tmp = Float64(2.0 * Float64(Float64(Float64(a * Float64(Float64(t_1 * Float64(b - b)) - Float64(a * t_1))) + (Float64(b * sqrt(t_1)) ^ 2.0)) * cos(t_0))); elseif (Float64(angle_m / 180.0) <= 2e+172) tmp = Float64(2.0 * Float64(t_2 * cos(Float64(Float64(angle_m / 180.0) * cbrt((pi ^ 3.0)))))); else tmp = Float64(2.0 * Float64(t_2 * sqrt((cos(Float64(pi * Float64(0.005555555555555556 * angle_m))) ^ 2.0)))); end return Float64(angle_s * tmp) end
angle\_m = N[Abs[angle], $MachinePrecision]
angle\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a_, b_, angle$95$m_] := Block[{t$95$0 = N[(Pi * N[(angle$95$m / 180.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Sin[N[(0.005555555555555556 * N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(b + a), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision] * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision]}, N[(angle$95$s * If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 1e-6], N[(2.0 * N[(N[(N[(a * N[(N[(t$95$1 * N[(b - b), $MachinePrecision]), $MachinePrecision] - N[(a * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[Power[N[(b * N[Sqrt[t$95$1], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[Cos[t$95$0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 2e+172], N[(2.0 * N[(t$95$2 * N[Cos[N[(N[(angle$95$m / 180.0), $MachinePrecision] * N[Power[N[Power[Pi, 3.0], $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(t$95$2 * N[Sqrt[N[Power[N[Cos[N[(Pi * N[(0.005555555555555556 * angle$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], 2.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]]]]
\begin{array}{l}
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
\begin{array}{l}
t_0 := \pi \cdot \frac{angle\_m}{180}\\
t_1 := \sin \left(0.005555555555555556 \cdot \left(angle\_m \cdot \pi\right)\right)\\
t_2 := \left(\left(b + a\right) \cdot \left(b - a\right)\right) \cdot \sin t\_0\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;\frac{angle\_m}{180} \leq 10^{-6}:\\
\;\;\;\;2 \cdot \left(\left(a \cdot \left(t\_1 \cdot \left(b - b\right) - a \cdot t\_1\right) + {\left(b \cdot \sqrt{t\_1}\right)}^{2}\right) \cdot \cos t\_0\right)\\
\mathbf{elif}\;\frac{angle\_m}{180} \leq 2 \cdot 10^{+172}:\\
\;\;\;\;2 \cdot \left(t\_2 \cdot \cos \left(\frac{angle\_m}{180} \cdot \sqrt[3]{{\pi}^{3}}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(t\_2 \cdot \sqrt{{\cos \left(\pi \cdot \left(0.005555555555555556 \cdot angle\_m\right)\right)}^{2}}\right)\\
\end{array}
\end{array}
\end{array}
if (/.f64 angle #s(literal 180 binary64)) < 9.99999999999999955e-7Initial program 55.3%
associate-*l*55.3%
associate-*l*55.3%
Simplified55.3%
unpow255.3%
unpow255.3%
difference-of-squares58.1%
Applied egg-rr58.1%
Taylor expanded in a around 0 62.2%
add-sqr-sqrt45.2%
pow245.2%
sqrt-prod34.9%
sqrt-pow139.4%
metadata-eval39.4%
pow139.4%
Applied egg-rr39.4%
if 9.99999999999999955e-7 < (/.f64 angle #s(literal 180 binary64)) < 2.0000000000000002e172Initial program 50.3%
associate-*l*50.3%
associate-*l*50.3%
Simplified50.3%
unpow250.3%
unpow250.3%
difference-of-squares50.3%
Applied egg-rr50.3%
add-cbrt-cube50.2%
pow350.2%
Applied egg-rr50.2%
if 2.0000000000000002e172 < (/.f64 angle #s(literal 180 binary64)) Initial program 34.9%
associate-*l*34.9%
associate-*l*34.9%
Simplified34.9%
unpow234.9%
unpow234.9%
difference-of-squares38.1%
Applied egg-rr38.1%
add-sqr-sqrt22.2%
sqrt-unprod51.2%
pow251.2%
div-inv51.1%
metadata-eval51.1%
Applied egg-rr51.1%
Final simplification42.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 (sin (* 0.005555555555555556 (* angle_m PI)))))
(*
angle_s
(if (<= (- (pow b 2.0) (pow a 2.0)) -1e-250)
(*
2.0
(*
(+
(* a (- (* t_0 (- b b)) (* a t_0)))
(*
(pow b 2.0)
(sin
(*
0.005555555555555556
(* angle_m (* (cbrt PI) (pow (cbrt PI) 2.0)))))))
(expm1 (log1p (cos (* PI (* 0.005555555555555556 angle_m)))))))
(*
(hypot b a)
(*
(hypot b a)
(sin (* 2.0 (* angle_m (* 0.005555555555555556 PI))))))))))angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a, double b, double angle_m) {
double t_0 = sin((0.005555555555555556 * (angle_m * ((double) M_PI))));
double tmp;
if ((pow(b, 2.0) - pow(a, 2.0)) <= -1e-250) {
tmp = 2.0 * (((a * ((t_0 * (b - b)) - (a * t_0))) + (pow(b, 2.0) * sin((0.005555555555555556 * (angle_m * (cbrt(((double) M_PI)) * pow(cbrt(((double) M_PI)), 2.0))))))) * expm1(log1p(cos((((double) M_PI) * (0.005555555555555556 * angle_m))))));
} else {
tmp = hypot(b, a) * (hypot(b, a) * sin((2.0 * (angle_m * (0.005555555555555556 * ((double) M_PI))))));
}
return angle_s * tmp;
}
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b, double angle_m) {
double t_0 = Math.sin((0.005555555555555556 * (angle_m * Math.PI)));
double tmp;
if ((Math.pow(b, 2.0) - Math.pow(a, 2.0)) <= -1e-250) {
tmp = 2.0 * (((a * ((t_0 * (b - b)) - (a * t_0))) + (Math.pow(b, 2.0) * Math.sin((0.005555555555555556 * (angle_m * (Math.cbrt(Math.PI) * Math.pow(Math.cbrt(Math.PI), 2.0))))))) * Math.expm1(Math.log1p(Math.cos((Math.PI * (0.005555555555555556 * angle_m))))));
} else {
tmp = Math.hypot(b, a) * (Math.hypot(b, a) * Math.sin((2.0 * (angle_m * (0.005555555555555556 * Math.PI)))));
}
return angle_s * tmp;
}
angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a, b, angle_m) t_0 = sin(Float64(0.005555555555555556 * Float64(angle_m * pi))) tmp = 0.0 if (Float64((b ^ 2.0) - (a ^ 2.0)) <= -1e-250) tmp = Float64(2.0 * Float64(Float64(Float64(a * Float64(Float64(t_0 * Float64(b - b)) - Float64(a * t_0))) + Float64((b ^ 2.0) * sin(Float64(0.005555555555555556 * Float64(angle_m * Float64(cbrt(pi) * (cbrt(pi) ^ 2.0))))))) * expm1(log1p(cos(Float64(pi * Float64(0.005555555555555556 * angle_m))))))); else tmp = Float64(hypot(b, a) * Float64(hypot(b, a) * sin(Float64(2.0 * Float64(angle_m * Float64(0.005555555555555556 * pi)))))); end return Float64(angle_s * tmp) end
angle\_m = N[Abs[angle], $MachinePrecision]
angle\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a_, b_, angle$95$m_] := Block[{t$95$0 = N[Sin[N[(0.005555555555555556 * N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, N[(angle$95$s * If[LessEqual[N[(N[Power[b, 2.0], $MachinePrecision] - N[Power[a, 2.0], $MachinePrecision]), $MachinePrecision], -1e-250], N[(2.0 * N[(N[(N[(a * N[(N[(t$95$0 * N[(b - b), $MachinePrecision]), $MachinePrecision] - N[(a * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Power[b, 2.0], $MachinePrecision] * N[Sin[N[(0.005555555555555556 * N[(angle$95$m * N[(N[Power[Pi, 1/3], $MachinePrecision] * N[Power[N[Power[Pi, 1/3], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(Exp[N[Log[1 + N[Cos[N[(Pi * N[(0.005555555555555556 * angle$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]] - 1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[b ^ 2 + a ^ 2], $MachinePrecision] * N[(N[Sqrt[b ^ 2 + a ^ 2], $MachinePrecision] * N[Sin[N[(2.0 * N[(angle$95$m * N[(0.005555555555555556 * Pi), $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 := \sin \left(0.005555555555555556 \cdot \left(angle\_m \cdot \pi\right)\right)\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;{b}^{2} - {a}^{2} \leq -1 \cdot 10^{-250}:\\
\;\;\;\;2 \cdot \left(\left(a \cdot \left(t\_0 \cdot \left(b - b\right) - a \cdot t\_0\right) + {b}^{2} \cdot \sin \left(0.005555555555555556 \cdot \left(angle\_m \cdot \left(\sqrt[3]{\pi} \cdot {\left(\sqrt[3]{\pi}\right)}^{2}\right)\right)\right)\right) \cdot \mathsf{expm1}\left(\mathsf{log1p}\left(\cos \left(\pi \cdot \left(0.005555555555555556 \cdot angle\_m\right)\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{hypot}\left(b, a\right) \cdot \left(\mathsf{hypot}\left(b, a\right) \cdot \sin \left(2 \cdot \left(angle\_m \cdot \left(0.005555555555555556 \cdot \pi\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))) < -1.0000000000000001e-250Initial program 50.1%
associate-*l*50.1%
associate-*l*50.1%
Simplified50.1%
unpow250.1%
unpow250.1%
difference-of-squares50.1%
Applied egg-rr50.1%
Taylor expanded in a around 0 61.3%
add-cube-cbrt61.3%
pow261.3%
Applied egg-rr61.3%
expm1-log1p-u61.3%
div-inv63.1%
metadata-eval63.1%
Applied egg-rr63.1%
if -1.0000000000000001e-250 < (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) Initial program 53.7%
associate-*l*53.7%
*-commutative53.7%
associate-*l*53.7%
Simplified53.7%
add-cbrt-cube40.5%
pow1/330.3%
Applied egg-rr30.3%
unpow1/341.3%
rem-cbrt-cube54.7%
add-sqr-sqrt54.6%
associate-*l*54.6%
Applied egg-rr72.5%
Final simplification68.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 (sin (* 0.005555555555555556 (* angle_m PI)))))
(*
angle_s
(if (<= (- (pow b 2.0) (pow a 2.0)) -1e-250)
(*
2.0
(*
(+ (* a (- (* t_0 (- b b)) (* a t_0))) (* (pow b 2.0) t_0))
(log1p (expm1 (cos (* PI (* 0.005555555555555556 angle_m)))))))
(*
(hypot b a)
(*
(hypot b a)
(sin (* 2.0 (* angle_m (* 0.005555555555555556 PI))))))))))angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a, double b, double angle_m) {
double t_0 = sin((0.005555555555555556 * (angle_m * ((double) M_PI))));
double tmp;
if ((pow(b, 2.0) - pow(a, 2.0)) <= -1e-250) {
tmp = 2.0 * (((a * ((t_0 * (b - b)) - (a * t_0))) + (pow(b, 2.0) * t_0)) * log1p(expm1(cos((((double) M_PI) * (0.005555555555555556 * angle_m))))));
} else {
tmp = hypot(b, a) * (hypot(b, a) * sin((2.0 * (angle_m * (0.005555555555555556 * ((double) M_PI))))));
}
return angle_s * tmp;
}
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b, double angle_m) {
double t_0 = Math.sin((0.005555555555555556 * (angle_m * Math.PI)));
double tmp;
if ((Math.pow(b, 2.0) - Math.pow(a, 2.0)) <= -1e-250) {
tmp = 2.0 * (((a * ((t_0 * (b - b)) - (a * t_0))) + (Math.pow(b, 2.0) * t_0)) * Math.log1p(Math.expm1(Math.cos((Math.PI * (0.005555555555555556 * angle_m))))));
} else {
tmp = Math.hypot(b, a) * (Math.hypot(b, a) * Math.sin((2.0 * (angle_m * (0.005555555555555556 * Math.PI)))));
}
return angle_s * tmp;
}
angle\_m = math.fabs(angle) angle\_s = math.copysign(1.0, angle) def code(angle_s, a, b, angle_m): t_0 = math.sin((0.005555555555555556 * (angle_m * math.pi))) tmp = 0 if (math.pow(b, 2.0) - math.pow(a, 2.0)) <= -1e-250: tmp = 2.0 * (((a * ((t_0 * (b - b)) - (a * t_0))) + (math.pow(b, 2.0) * t_0)) * math.log1p(math.expm1(math.cos((math.pi * (0.005555555555555556 * angle_m)))))) else: tmp = math.hypot(b, a) * (math.hypot(b, a) * math.sin((2.0 * (angle_m * (0.005555555555555556 * math.pi))))) return angle_s * tmp
angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a, b, angle_m) t_0 = sin(Float64(0.005555555555555556 * Float64(angle_m * pi))) tmp = 0.0 if (Float64((b ^ 2.0) - (a ^ 2.0)) <= -1e-250) tmp = Float64(2.0 * Float64(Float64(Float64(a * Float64(Float64(t_0 * Float64(b - b)) - Float64(a * t_0))) + Float64((b ^ 2.0) * t_0)) * log1p(expm1(cos(Float64(pi * Float64(0.005555555555555556 * angle_m))))))); else tmp = Float64(hypot(b, a) * Float64(hypot(b, a) * sin(Float64(2.0 * Float64(angle_m * Float64(0.005555555555555556 * pi)))))); end return Float64(angle_s * tmp) end
angle\_m = N[Abs[angle], $MachinePrecision]
angle\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a_, b_, angle$95$m_] := Block[{t$95$0 = N[Sin[N[(0.005555555555555556 * N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, N[(angle$95$s * If[LessEqual[N[(N[Power[b, 2.0], $MachinePrecision] - N[Power[a, 2.0], $MachinePrecision]), $MachinePrecision], -1e-250], N[(2.0 * N[(N[(N[(a * N[(N[(t$95$0 * N[(b - b), $MachinePrecision]), $MachinePrecision] - N[(a * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Power[b, 2.0], $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision] * N[Log[1 + N[(Exp[N[Cos[N[(Pi * N[(0.005555555555555556 * angle$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]] - 1), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[b ^ 2 + a ^ 2], $MachinePrecision] * N[(N[Sqrt[b ^ 2 + a ^ 2], $MachinePrecision] * N[Sin[N[(2.0 * N[(angle$95$m * N[(0.005555555555555556 * Pi), $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 := \sin \left(0.005555555555555556 \cdot \left(angle\_m \cdot \pi\right)\right)\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;{b}^{2} - {a}^{2} \leq -1 \cdot 10^{-250}:\\
\;\;\;\;2 \cdot \left(\left(a \cdot \left(t\_0 \cdot \left(b - b\right) - a \cdot t\_0\right) + {b}^{2} \cdot t\_0\right) \cdot \mathsf{log1p}\left(\mathsf{expm1}\left(\cos \left(\pi \cdot \left(0.005555555555555556 \cdot angle\_m\right)\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{hypot}\left(b, a\right) \cdot \left(\mathsf{hypot}\left(b, a\right) \cdot \sin \left(2 \cdot \left(angle\_m \cdot \left(0.005555555555555556 \cdot \pi\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))) < -1.0000000000000001e-250Initial program 50.1%
associate-*l*50.1%
associate-*l*50.1%
Simplified50.1%
unpow250.1%
unpow250.1%
difference-of-squares50.1%
Applied egg-rr50.1%
Taylor expanded in a around 0 61.3%
log1p-expm1-u61.3%
div-inv63.1%
metadata-eval63.1%
Applied egg-rr63.1%
if -1.0000000000000001e-250 < (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) Initial program 53.7%
associate-*l*53.7%
*-commutative53.7%
associate-*l*53.7%
Simplified53.7%
add-cbrt-cube40.5%
pow1/330.3%
Applied egg-rr30.3%
unpow1/341.3%
rem-cbrt-cube54.7%
add-sqr-sqrt54.6%
associate-*l*54.6%
Applied egg-rr72.5%
Final simplification68.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 (sin (* 0.005555555555555556 (* angle_m PI)))))
(*
angle_s
(if (<= (- (pow b 2.0) (pow a 2.0)) -1e-250)
(*
2.0
(*
(cos (* PI (/ angle_m 180.0)))
(+ (* a (- (* t_0 (- b b)) (* a t_0))) (fabs (* (pow b 2.0) t_0)))))
(*
(hypot b a)
(*
(hypot b a)
(sin (* 2.0 (* angle_m (* 0.005555555555555556 PI))))))))))angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a, double b, double angle_m) {
double t_0 = sin((0.005555555555555556 * (angle_m * ((double) M_PI))));
double tmp;
if ((pow(b, 2.0) - pow(a, 2.0)) <= -1e-250) {
tmp = 2.0 * (cos((((double) M_PI) * (angle_m / 180.0))) * ((a * ((t_0 * (b - b)) - (a * t_0))) + fabs((pow(b, 2.0) * t_0))));
} else {
tmp = hypot(b, a) * (hypot(b, a) * sin((2.0 * (angle_m * (0.005555555555555556 * ((double) M_PI))))));
}
return angle_s * tmp;
}
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b, double angle_m) {
double t_0 = Math.sin((0.005555555555555556 * (angle_m * Math.PI)));
double tmp;
if ((Math.pow(b, 2.0) - Math.pow(a, 2.0)) <= -1e-250) {
tmp = 2.0 * (Math.cos((Math.PI * (angle_m / 180.0))) * ((a * ((t_0 * (b - b)) - (a * t_0))) + Math.abs((Math.pow(b, 2.0) * t_0))));
} else {
tmp = Math.hypot(b, a) * (Math.hypot(b, a) * Math.sin((2.0 * (angle_m * (0.005555555555555556 * Math.PI)))));
}
return angle_s * tmp;
}
angle\_m = math.fabs(angle) angle\_s = math.copysign(1.0, angle) def code(angle_s, a, b, angle_m): t_0 = math.sin((0.005555555555555556 * (angle_m * math.pi))) tmp = 0 if (math.pow(b, 2.0) - math.pow(a, 2.0)) <= -1e-250: tmp = 2.0 * (math.cos((math.pi * (angle_m / 180.0))) * ((a * ((t_0 * (b - b)) - (a * t_0))) + math.fabs((math.pow(b, 2.0) * t_0)))) else: tmp = math.hypot(b, a) * (math.hypot(b, a) * math.sin((2.0 * (angle_m * (0.005555555555555556 * math.pi))))) return angle_s * tmp
angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a, b, angle_m) t_0 = sin(Float64(0.005555555555555556 * Float64(angle_m * pi))) tmp = 0.0 if (Float64((b ^ 2.0) - (a ^ 2.0)) <= -1e-250) tmp = Float64(2.0 * Float64(cos(Float64(pi * Float64(angle_m / 180.0))) * Float64(Float64(a * Float64(Float64(t_0 * Float64(b - b)) - Float64(a * t_0))) + abs(Float64((b ^ 2.0) * t_0))))); else tmp = Float64(hypot(b, a) * Float64(hypot(b, a) * sin(Float64(2.0 * Float64(angle_m * Float64(0.005555555555555556 * pi)))))); end return Float64(angle_s * tmp) end
angle\_m = abs(angle); angle\_s = sign(angle) * abs(1.0); function tmp_2 = code(angle_s, a, b, angle_m) t_0 = sin((0.005555555555555556 * (angle_m * pi))); tmp = 0.0; if (((b ^ 2.0) - (a ^ 2.0)) <= -1e-250) tmp = 2.0 * (cos((pi * (angle_m / 180.0))) * ((a * ((t_0 * (b - b)) - (a * t_0))) + abs(((b ^ 2.0) * t_0)))); else tmp = hypot(b, a) * (hypot(b, a) * sin((2.0 * (angle_m * (0.005555555555555556 * pi))))); end tmp_2 = angle_s * tmp; end
angle\_m = N[Abs[angle], $MachinePrecision]
angle\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a_, b_, angle$95$m_] := Block[{t$95$0 = N[Sin[N[(0.005555555555555556 * N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, N[(angle$95$s * If[LessEqual[N[(N[Power[b, 2.0], $MachinePrecision] - N[Power[a, 2.0], $MachinePrecision]), $MachinePrecision], -1e-250], N[(2.0 * N[(N[Cos[N[(Pi * N[(angle$95$m / 180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(N[(a * N[(N[(t$95$0 * N[(b - b), $MachinePrecision]), $MachinePrecision] - N[(a * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[Abs[N[(N[Power[b, 2.0], $MachinePrecision] * t$95$0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[b ^ 2 + a ^ 2], $MachinePrecision] * N[(N[Sqrt[b ^ 2 + a ^ 2], $MachinePrecision] * N[Sin[N[(2.0 * N[(angle$95$m * N[(0.005555555555555556 * Pi), $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 := \sin \left(0.005555555555555556 \cdot \left(angle\_m \cdot \pi\right)\right)\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;{b}^{2} - {a}^{2} \leq -1 \cdot 10^{-250}:\\
\;\;\;\;2 \cdot \left(\cos \left(\pi \cdot \frac{angle\_m}{180}\right) \cdot \left(a \cdot \left(t\_0 \cdot \left(b - b\right) - a \cdot t\_0\right) + \left|{b}^{2} \cdot t\_0\right|\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{hypot}\left(b, a\right) \cdot \left(\mathsf{hypot}\left(b, a\right) \cdot \sin \left(2 \cdot \left(angle\_m \cdot \left(0.005555555555555556 \cdot \pi\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))) < -1.0000000000000001e-250Initial program 50.1%
associate-*l*50.1%
associate-*l*50.1%
Simplified50.1%
unpow250.1%
unpow250.1%
difference-of-squares50.1%
Applied egg-rr50.1%
Taylor expanded in a around 0 61.3%
add-cube-cbrt61.3%
pow261.3%
Applied egg-rr61.3%
add-sqr-sqrt52.3%
sqrt-unprod60.3%
Applied egg-rr60.3%
*-commutative60.3%
metadata-eval60.3%
pow-sqr60.3%
unpow260.3%
unpow260.3%
*-commutative60.3%
associate-*r*60.3%
*-commutative60.3%
unpow260.3%
swap-sqr60.3%
rem-sqrt-square61.3%
Simplified61.3%
if -1.0000000000000001e-250 < (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) Initial program 53.7%
associate-*l*53.7%
*-commutative53.7%
associate-*l*53.7%
Simplified53.7%
add-cbrt-cube40.5%
pow1/330.3%
Applied egg-rr30.3%
unpow1/341.3%
rem-cbrt-cube54.7%
add-sqr-sqrt54.6%
associate-*l*54.6%
Applied egg-rr72.5%
Final simplification67.6%
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a b angle_m)
:precision binary64
(let* ((t_0 (sin (* 0.005555555555555556 (* angle_m PI)))))
(*
angle_s
(if (<= (- (pow b 2.0) (pow a 2.0)) -1e-250)
(*
2.0
(*
(+ (* a (- (* t_0 (- b b)) (* a t_0))) (* (pow b 2.0) t_0))
(cos (* PI (/ angle_m 180.0)))))
(*
(hypot b a)
(*
(hypot b a)
(sin (* 2.0 (* angle_m (* 0.005555555555555556 PI))))))))))angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a, double b, double angle_m) {
double t_0 = sin((0.005555555555555556 * (angle_m * ((double) M_PI))));
double tmp;
if ((pow(b, 2.0) - pow(a, 2.0)) <= -1e-250) {
tmp = 2.0 * (((a * ((t_0 * (b - b)) - (a * t_0))) + (pow(b, 2.0) * t_0)) * cos((((double) M_PI) * (angle_m / 180.0))));
} else {
tmp = hypot(b, a) * (hypot(b, a) * sin((2.0 * (angle_m * (0.005555555555555556 * ((double) M_PI))))));
}
return angle_s * tmp;
}
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b, double angle_m) {
double t_0 = Math.sin((0.005555555555555556 * (angle_m * Math.PI)));
double tmp;
if ((Math.pow(b, 2.0) - Math.pow(a, 2.0)) <= -1e-250) {
tmp = 2.0 * (((a * ((t_0 * (b - b)) - (a * t_0))) + (Math.pow(b, 2.0) * t_0)) * Math.cos((Math.PI * (angle_m / 180.0))));
} else {
tmp = Math.hypot(b, a) * (Math.hypot(b, a) * Math.sin((2.0 * (angle_m * (0.005555555555555556 * Math.PI)))));
}
return angle_s * tmp;
}
angle\_m = math.fabs(angle) angle\_s = math.copysign(1.0, angle) def code(angle_s, a, b, angle_m): t_0 = math.sin((0.005555555555555556 * (angle_m * math.pi))) tmp = 0 if (math.pow(b, 2.0) - math.pow(a, 2.0)) <= -1e-250: tmp = 2.0 * (((a * ((t_0 * (b - b)) - (a * t_0))) + (math.pow(b, 2.0) * t_0)) * math.cos((math.pi * (angle_m / 180.0)))) else: tmp = math.hypot(b, a) * (math.hypot(b, a) * math.sin((2.0 * (angle_m * (0.005555555555555556 * math.pi))))) return angle_s * tmp
angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a, b, angle_m) t_0 = sin(Float64(0.005555555555555556 * Float64(angle_m * pi))) tmp = 0.0 if (Float64((b ^ 2.0) - (a ^ 2.0)) <= -1e-250) tmp = Float64(2.0 * Float64(Float64(Float64(a * Float64(Float64(t_0 * Float64(b - b)) - Float64(a * t_0))) + Float64((b ^ 2.0) * t_0)) * cos(Float64(pi * Float64(angle_m / 180.0))))); else tmp = Float64(hypot(b, a) * Float64(hypot(b, a) * sin(Float64(2.0 * Float64(angle_m * Float64(0.005555555555555556 * pi)))))); end return Float64(angle_s * tmp) end
angle\_m = abs(angle); angle\_s = sign(angle) * abs(1.0); function tmp_2 = code(angle_s, a, b, angle_m) t_0 = sin((0.005555555555555556 * (angle_m * pi))); tmp = 0.0; if (((b ^ 2.0) - (a ^ 2.0)) <= -1e-250) tmp = 2.0 * (((a * ((t_0 * (b - b)) - (a * t_0))) + ((b ^ 2.0) * t_0)) * cos((pi * (angle_m / 180.0)))); else tmp = hypot(b, a) * (hypot(b, a) * sin((2.0 * (angle_m * (0.005555555555555556 * pi))))); end tmp_2 = angle_s * tmp; end
angle\_m = N[Abs[angle], $MachinePrecision]
angle\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a_, b_, angle$95$m_] := Block[{t$95$0 = N[Sin[N[(0.005555555555555556 * N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, N[(angle$95$s * If[LessEqual[N[(N[Power[b, 2.0], $MachinePrecision] - N[Power[a, 2.0], $MachinePrecision]), $MachinePrecision], -1e-250], N[(2.0 * N[(N[(N[(a * N[(N[(t$95$0 * N[(b - b), $MachinePrecision]), $MachinePrecision] - N[(a * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Power[b, 2.0], $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision] * N[Cos[N[(Pi * N[(angle$95$m / 180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[b ^ 2 + a ^ 2], $MachinePrecision] * N[(N[Sqrt[b ^ 2 + a ^ 2], $MachinePrecision] * N[Sin[N[(2.0 * N[(angle$95$m * N[(0.005555555555555556 * Pi), $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 := \sin \left(0.005555555555555556 \cdot \left(angle\_m \cdot \pi\right)\right)\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;{b}^{2} - {a}^{2} \leq -1 \cdot 10^{-250}:\\
\;\;\;\;2 \cdot \left(\left(a \cdot \left(t\_0 \cdot \left(b - b\right) - a \cdot t\_0\right) + {b}^{2} \cdot t\_0\right) \cdot \cos \left(\pi \cdot \frac{angle\_m}{180}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{hypot}\left(b, a\right) \cdot \left(\mathsf{hypot}\left(b, a\right) \cdot \sin \left(2 \cdot \left(angle\_m \cdot \left(0.005555555555555556 \cdot \pi\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))) < -1.0000000000000001e-250Initial program 50.1%
associate-*l*50.1%
associate-*l*50.1%
Simplified50.1%
unpow250.1%
unpow250.1%
difference-of-squares50.1%
Applied egg-rr50.1%
Taylor expanded in a around 0 61.3%
if -1.0000000000000001e-250 < (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) Initial program 53.7%
associate-*l*53.7%
*-commutative53.7%
associate-*l*53.7%
Simplified53.7%
add-cbrt-cube40.5%
pow1/330.3%
Applied egg-rr30.3%
unpow1/341.3%
rem-cbrt-cube54.7%
add-sqr-sqrt54.6%
associate-*l*54.6%
Applied egg-rr72.5%
Final simplification67.6%
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a b angle_m)
:precision binary64
(let* ((t_0 (sin (* 0.005555555555555556 (* angle_m PI)))))
(*
angle_s
(if (<= (- (pow b 2.0) (pow a 2.0)) 1e+60)
(* 2.0 (+ (* a (- (* t_0 (- b b)) (* a t_0))) (* (pow b 2.0) t_0)))
(*
(hypot b a)
(*
(hypot b a)
(sin (* 2.0 (* angle_m (* 0.005555555555555556 PI))))))))))angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a, double b, double angle_m) {
double t_0 = sin((0.005555555555555556 * (angle_m * ((double) M_PI))));
double tmp;
if ((pow(b, 2.0) - pow(a, 2.0)) <= 1e+60) {
tmp = 2.0 * ((a * ((t_0 * (b - b)) - (a * t_0))) + (pow(b, 2.0) * t_0));
} else {
tmp = hypot(b, a) * (hypot(b, a) * sin((2.0 * (angle_m * (0.005555555555555556 * ((double) M_PI))))));
}
return angle_s * tmp;
}
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b, double angle_m) {
double t_0 = Math.sin((0.005555555555555556 * (angle_m * Math.PI)));
double tmp;
if ((Math.pow(b, 2.0) - Math.pow(a, 2.0)) <= 1e+60) {
tmp = 2.0 * ((a * ((t_0 * (b - b)) - (a * t_0))) + (Math.pow(b, 2.0) * t_0));
} else {
tmp = Math.hypot(b, a) * (Math.hypot(b, a) * Math.sin((2.0 * (angle_m * (0.005555555555555556 * Math.PI)))));
}
return angle_s * tmp;
}
angle\_m = math.fabs(angle) angle\_s = math.copysign(1.0, angle) def code(angle_s, a, b, angle_m): t_0 = math.sin((0.005555555555555556 * (angle_m * math.pi))) tmp = 0 if (math.pow(b, 2.0) - math.pow(a, 2.0)) <= 1e+60: tmp = 2.0 * ((a * ((t_0 * (b - b)) - (a * t_0))) + (math.pow(b, 2.0) * t_0)) else: tmp = math.hypot(b, a) * (math.hypot(b, a) * math.sin((2.0 * (angle_m * (0.005555555555555556 * math.pi))))) return angle_s * tmp
angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a, b, angle_m) t_0 = sin(Float64(0.005555555555555556 * Float64(angle_m * pi))) tmp = 0.0 if (Float64((b ^ 2.0) - (a ^ 2.0)) <= 1e+60) tmp = Float64(2.0 * Float64(Float64(a * Float64(Float64(t_0 * Float64(b - b)) - Float64(a * t_0))) + Float64((b ^ 2.0) * t_0))); else tmp = Float64(hypot(b, a) * Float64(hypot(b, a) * sin(Float64(2.0 * Float64(angle_m * Float64(0.005555555555555556 * pi)))))); end return Float64(angle_s * tmp) end
angle\_m = abs(angle); angle\_s = sign(angle) * abs(1.0); function tmp_2 = code(angle_s, a, b, angle_m) t_0 = sin((0.005555555555555556 * (angle_m * pi))); tmp = 0.0; if (((b ^ 2.0) - (a ^ 2.0)) <= 1e+60) tmp = 2.0 * ((a * ((t_0 * (b - b)) - (a * t_0))) + ((b ^ 2.0) * t_0)); else tmp = hypot(b, a) * (hypot(b, a) * sin((2.0 * (angle_m * (0.005555555555555556 * pi))))); end tmp_2 = angle_s * tmp; end
angle\_m = N[Abs[angle], $MachinePrecision]
angle\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a_, b_, angle$95$m_] := Block[{t$95$0 = N[Sin[N[(0.005555555555555556 * N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, N[(angle$95$s * If[LessEqual[N[(N[Power[b, 2.0], $MachinePrecision] - N[Power[a, 2.0], $MachinePrecision]), $MachinePrecision], 1e+60], N[(2.0 * N[(N[(a * N[(N[(t$95$0 * N[(b - b), $MachinePrecision]), $MachinePrecision] - N[(a * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Power[b, 2.0], $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[b ^ 2 + a ^ 2], $MachinePrecision] * N[(N[Sqrt[b ^ 2 + a ^ 2], $MachinePrecision] * N[Sin[N[(2.0 * N[(angle$95$m * N[(0.005555555555555556 * Pi), $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 := \sin \left(0.005555555555555556 \cdot \left(angle\_m \cdot \pi\right)\right)\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;{b}^{2} - {a}^{2} \leq 10^{+60}:\\
\;\;\;\;2 \cdot \left(a \cdot \left(t\_0 \cdot \left(b - b\right) - a \cdot t\_0\right) + {b}^{2} \cdot t\_0\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{hypot}\left(b, a\right) \cdot \left(\mathsf{hypot}\left(b, a\right) \cdot \sin \left(2 \cdot \left(angle\_m \cdot \left(0.005555555555555556 \cdot \pi\right)\right)\right)\right)\\
\end{array}
\end{array}
\end{array}
if (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) < 9.9999999999999995e59Initial program 55.2%
associate-*l*55.2%
associate-*l*55.2%
Simplified55.2%
unpow255.2%
unpow255.2%
difference-of-squares55.2%
Applied egg-rr55.2%
Taylor expanded in a around 0 63.1%
Taylor expanded in angle around 0 61.3%
if 9.9999999999999995e59 < (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) Initial program 47.3%
associate-*l*47.3%
*-commutative47.3%
associate-*l*47.3%
Simplified47.3%
add-cbrt-cube36.7%
pow1/323.5%
Applied egg-rr23.5%
unpow1/337.9%
rem-cbrt-cube48.8%
add-sqr-sqrt48.8%
associate-*l*48.7%
Applied egg-rr73.7%
Final simplification66.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 (- (pow b 2.0) (pow a 2.0))) (t_1 (* (+ b a) (- b a))))
(*
angle_s
(if (<= t_0 2e+307)
(*
2.0
(*
(cos (* PI (* 0.005555555555555556 angle_m)))
(* (sin (* 0.005555555555555556 (* angle_m PI))) t_1)))
(if (<= t_0 INFINITY)
(fma
b
(* (* angle_m 0.011111111111111112) (* b PI))
(* (* (pow a 2.0) (* angle_m PI)) -0.011111111111111112))
(* (* angle_m 0.011111111111111112) (* PI t_1)))))))angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a, double b, double angle_m) {
double t_0 = pow(b, 2.0) - pow(a, 2.0);
double t_1 = (b + a) * (b - a);
double tmp;
if (t_0 <= 2e+307) {
tmp = 2.0 * (cos((((double) M_PI) * (0.005555555555555556 * angle_m))) * (sin((0.005555555555555556 * (angle_m * ((double) M_PI)))) * t_1));
} else if (t_0 <= ((double) INFINITY)) {
tmp = fma(b, ((angle_m * 0.011111111111111112) * (b * ((double) M_PI))), ((pow(a, 2.0) * (angle_m * ((double) M_PI))) * -0.011111111111111112));
} else {
tmp = (angle_m * 0.011111111111111112) * (((double) M_PI) * t_1);
}
return angle_s * tmp;
}
angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a, b, angle_m) t_0 = Float64((b ^ 2.0) - (a ^ 2.0)) t_1 = Float64(Float64(b + a) * Float64(b - a)) tmp = 0.0 if (t_0 <= 2e+307) tmp = Float64(2.0 * Float64(cos(Float64(pi * Float64(0.005555555555555556 * angle_m))) * Float64(sin(Float64(0.005555555555555556 * Float64(angle_m * pi))) * t_1))); elseif (t_0 <= Inf) tmp = fma(b, Float64(Float64(angle_m * 0.011111111111111112) * Float64(b * pi)), Float64(Float64((a ^ 2.0) * Float64(angle_m * pi)) * -0.011111111111111112)); else tmp = Float64(Float64(angle_m * 0.011111111111111112) * Float64(pi * t_1)); end return Float64(angle_s * tmp) end
angle\_m = N[Abs[angle], $MachinePrecision]
angle\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a_, b_, angle$95$m_] := Block[{t$95$0 = N[(N[Power[b, 2.0], $MachinePrecision] - N[Power[a, 2.0], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(b + a), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision]}, N[(angle$95$s * If[LessEqual[t$95$0, 2e+307], N[(2.0 * N[(N[Cos[N[(Pi * N[(0.005555555555555556 * angle$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(N[Sin[N[(0.005555555555555556 * N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, Infinity], N[(b * N[(N[(angle$95$m * 0.011111111111111112), $MachinePrecision] * N[(b * Pi), $MachinePrecision]), $MachinePrecision] + N[(N[(N[Power[a, 2.0], $MachinePrecision] * N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision] * -0.011111111111111112), $MachinePrecision]), $MachinePrecision], N[(N[(angle$95$m * 0.011111111111111112), $MachinePrecision] * N[(Pi * t$95$1), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]]]
\begin{array}{l}
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
\begin{array}{l}
t_0 := {b}^{2} - {a}^{2}\\
t_1 := \left(b + a\right) \cdot \left(b - a\right)\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_0 \leq 2 \cdot 10^{+307}:\\
\;\;\;\;2 \cdot \left(\cos \left(\pi \cdot \left(0.005555555555555556 \cdot angle\_m\right)\right) \cdot \left(\sin \left(0.005555555555555556 \cdot \left(angle\_m \cdot \pi\right)\right) \cdot t\_1\right)\right)\\
\mathbf{elif}\;t\_0 \leq \infty:\\
\;\;\;\;\mathsf{fma}\left(b, \left(angle\_m \cdot 0.011111111111111112\right) \cdot \left(b \cdot \pi\right), \left({a}^{2} \cdot \left(angle\_m \cdot \pi\right)\right) \cdot -0.011111111111111112\right)\\
\mathbf{else}:\\
\;\;\;\;\left(angle\_m \cdot 0.011111111111111112\right) \cdot \left(\pi \cdot t\_1\right)\\
\end{array}
\end{array}
\end{array}
if (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) < 1.99999999999999997e307Initial program 56.2%
associate-*l*56.2%
associate-*l*56.2%
Simplified56.2%
unpow256.2%
unpow256.2%
difference-of-squares56.2%
Applied egg-rr56.2%
Taylor expanded in angle around inf 57.5%
associate-*r*57.4%
*-commutative57.4%
*-commutative57.4%
*-commutative57.4%
Simplified57.4%
Taylor expanded in angle around inf 58.8%
if 1.99999999999999997e307 < (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) < +inf.0Initial program 51.9%
associate-*l*51.9%
*-commutative51.9%
associate-*l*51.9%
Simplified51.9%
Taylor expanded in angle around 0 47.8%
unpow251.9%
unpow251.9%
difference-of-squares51.9%
Applied egg-rr47.8%
Taylor expanded in b around 0 68.5%
+-commutative68.5%
fma-define68.5%
associate-*r*68.6%
associate-*r*68.6%
distribute-lft-out68.6%
+-commutative68.6%
*-commutative68.6%
distribute-rgt1-in68.6%
metadata-eval68.6%
mul0-lft68.6%
distribute-rgt-out68.6%
*-commutative68.6%
Simplified68.6%
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%
Taylor expanded in angle around 0 0.0%
unpow20.0%
unpow20.0%
difference-of-squares42.3%
Applied egg-rr42.3%
Taylor expanded in angle around 0 42.3%
associate-*r*42.3%
+-commutative42.3%
*-commutative42.3%
Simplified42.3%
Final simplification59.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 (<= (- (pow b 2.0) (pow a 2.0)) 2e+191)
(*
2.0
(*
(* (* (+ b a) (- b a)) (sin (* PI (* 0.005555555555555556 angle_m))))
(cos (* (/ angle_m 180.0) (pow (sqrt PI) 2.0)))))
(*
(hypot b a)
(* (hypot b a) (sin (* 2.0 (* angle_m (* 0.005555555555555556 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 ((pow(b, 2.0) - pow(a, 2.0)) <= 2e+191) {
tmp = 2.0 * ((((b + a) * (b - a)) * sin((((double) M_PI) * (0.005555555555555556 * angle_m)))) * cos(((angle_m / 180.0) * pow(sqrt(((double) M_PI)), 2.0))));
} else {
tmp = hypot(b, a) * (hypot(b, a) * sin((2.0 * (angle_m * (0.005555555555555556 * ((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 ((Math.pow(b, 2.0) - Math.pow(a, 2.0)) <= 2e+191) {
tmp = 2.0 * ((((b + a) * (b - a)) * Math.sin((Math.PI * (0.005555555555555556 * angle_m)))) * Math.cos(((angle_m / 180.0) * Math.pow(Math.sqrt(Math.PI), 2.0))));
} else {
tmp = Math.hypot(b, a) * (Math.hypot(b, a) * Math.sin((2.0 * (angle_m * (0.005555555555555556 * 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 (math.pow(b, 2.0) - math.pow(a, 2.0)) <= 2e+191: tmp = 2.0 * ((((b + a) * (b - a)) * math.sin((math.pi * (0.005555555555555556 * angle_m)))) * math.cos(((angle_m / 180.0) * math.pow(math.sqrt(math.pi), 2.0)))) else: tmp = math.hypot(b, a) * (math.hypot(b, a) * math.sin((2.0 * (angle_m * (0.005555555555555556 * 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 (Float64((b ^ 2.0) - (a ^ 2.0)) <= 2e+191) tmp = Float64(2.0 * Float64(Float64(Float64(Float64(b + a) * Float64(b - a)) * sin(Float64(pi * Float64(0.005555555555555556 * angle_m)))) * cos(Float64(Float64(angle_m / 180.0) * (sqrt(pi) ^ 2.0))))); else tmp = Float64(hypot(b, a) * Float64(hypot(b, a) * sin(Float64(2.0 * Float64(angle_m * Float64(0.005555555555555556 * 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 (((b ^ 2.0) - (a ^ 2.0)) <= 2e+191) tmp = 2.0 * ((((b + a) * (b - a)) * sin((pi * (0.005555555555555556 * angle_m)))) * cos(((angle_m / 180.0) * (sqrt(pi) ^ 2.0)))); else tmp = hypot(b, a) * (hypot(b, a) * sin((2.0 * (angle_m * (0.005555555555555556 * 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[N[(N[Power[b, 2.0], $MachinePrecision] - N[Power[a, 2.0], $MachinePrecision]), $MachinePrecision], 2e+191], N[(2.0 * N[(N[(N[(N[(b + a), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision] * N[Sin[N[(Pi * N[(0.005555555555555556 * angle$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[Cos[N[(N[(angle$95$m / 180.0), $MachinePrecision] * N[Power[N[Sqrt[Pi], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[b ^ 2 + a ^ 2], $MachinePrecision] * N[(N[Sqrt[b ^ 2 + a ^ 2], $MachinePrecision] * N[Sin[N[(2.0 * N[(angle$95$m * N[(0.005555555555555556 * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;{b}^{2} - {a}^{2} \leq 2 \cdot 10^{+191}:\\
\;\;\;\;2 \cdot \left(\left(\left(\left(b + a\right) \cdot \left(b - a\right)\right) \cdot \sin \left(\pi \cdot \left(0.005555555555555556 \cdot angle\_m\right)\right)\right) \cdot \cos \left(\frac{angle\_m}{180} \cdot {\left(\sqrt{\pi}\right)}^{2}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{hypot}\left(b, a\right) \cdot \left(\mathsf{hypot}\left(b, a\right) \cdot \sin \left(2 \cdot \left(angle\_m \cdot \left(0.005555555555555556 \cdot \pi\right)\right)\right)\right)\\
\end{array}
\end{array}
if (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) < 2.00000000000000015e191Initial program 55.1%
associate-*l*55.1%
associate-*l*55.1%
Simplified55.1%
unpow255.1%
unpow255.1%
difference-of-squares55.1%
Applied egg-rr55.1%
add-sqr-sqrt57.9%
pow257.9%
Applied egg-rr57.9%
Taylor expanded in angle around inf 57.0%
associate-*r*58.7%
*-commutative58.7%
*-commutative58.7%
*-commutative58.7%
Simplified58.7%
if 2.00000000000000015e191 < (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) Initial program 45.9%
associate-*l*45.9%
*-commutative45.9%
associate-*l*45.9%
Simplified45.9%
add-cbrt-cube38.4%
pow1/325.4%
Applied egg-rr25.4%
unpow1/339.7%
rem-cbrt-cube47.6%
add-sqr-sqrt47.6%
associate-*l*47.6%
Applied egg-rr76.9%
Final simplification64.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 (<= (- (pow b 2.0) (pow a 2.0)) -1e-250)
(*
2.0
(*
(cos (* PI (* 0.005555555555555556 angle_m)))
(* (sin (* 0.005555555555555556 (* angle_m PI))) (* (+ b a) (- b a)))))
(*
(hypot b a)
(* (hypot b a) (sin (* 2.0 (* angle_m (* 0.005555555555555556 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 ((pow(b, 2.0) - pow(a, 2.0)) <= -1e-250) {
tmp = 2.0 * (cos((((double) M_PI) * (0.005555555555555556 * angle_m))) * (sin((0.005555555555555556 * (angle_m * ((double) M_PI)))) * ((b + a) * (b - a))));
} else {
tmp = hypot(b, a) * (hypot(b, a) * sin((2.0 * (angle_m * (0.005555555555555556 * ((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 ((Math.pow(b, 2.0) - Math.pow(a, 2.0)) <= -1e-250) {
tmp = 2.0 * (Math.cos((Math.PI * (0.005555555555555556 * angle_m))) * (Math.sin((0.005555555555555556 * (angle_m * Math.PI))) * ((b + a) * (b - a))));
} else {
tmp = Math.hypot(b, a) * (Math.hypot(b, a) * Math.sin((2.0 * (angle_m * (0.005555555555555556 * 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 (math.pow(b, 2.0) - math.pow(a, 2.0)) <= -1e-250: tmp = 2.0 * (math.cos((math.pi * (0.005555555555555556 * angle_m))) * (math.sin((0.005555555555555556 * (angle_m * math.pi))) * ((b + a) * (b - a)))) else: tmp = math.hypot(b, a) * (math.hypot(b, a) * math.sin((2.0 * (angle_m * (0.005555555555555556 * 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 (Float64((b ^ 2.0) - (a ^ 2.0)) <= -1e-250) tmp = Float64(2.0 * Float64(cos(Float64(pi * Float64(0.005555555555555556 * angle_m))) * Float64(sin(Float64(0.005555555555555556 * Float64(angle_m * pi))) * Float64(Float64(b + a) * Float64(b - a))))); else tmp = Float64(hypot(b, a) * Float64(hypot(b, a) * sin(Float64(2.0 * Float64(angle_m * Float64(0.005555555555555556 * 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 (((b ^ 2.0) - (a ^ 2.0)) <= -1e-250) tmp = 2.0 * (cos((pi * (0.005555555555555556 * angle_m))) * (sin((0.005555555555555556 * (angle_m * pi))) * ((b + a) * (b - a)))); else tmp = hypot(b, a) * (hypot(b, a) * sin((2.0 * (angle_m * (0.005555555555555556 * 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[N[(N[Power[b, 2.0], $MachinePrecision] - N[Power[a, 2.0], $MachinePrecision]), $MachinePrecision], -1e-250], N[(2.0 * N[(N[Cos[N[(Pi * N[(0.005555555555555556 * angle$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(N[Sin[N[(0.005555555555555556 * N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(N[(b + a), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[b ^ 2 + a ^ 2], $MachinePrecision] * N[(N[Sqrt[b ^ 2 + a ^ 2], $MachinePrecision] * N[Sin[N[(2.0 * N[(angle$95$m * N[(0.005555555555555556 * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;{b}^{2} - {a}^{2} \leq -1 \cdot 10^{-250}:\\
\;\;\;\;2 \cdot \left(\cos \left(\pi \cdot \left(0.005555555555555556 \cdot angle\_m\right)\right) \cdot \left(\sin \left(0.005555555555555556 \cdot \left(angle\_m \cdot \pi\right)\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{hypot}\left(b, a\right) \cdot \left(\mathsf{hypot}\left(b, a\right) \cdot \sin \left(2 \cdot \left(angle\_m \cdot \left(0.005555555555555556 \cdot \pi\right)\right)\right)\right)\\
\end{array}
\end{array}
if (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) < -1.0000000000000001e-250Initial program 50.1%
associate-*l*50.1%
associate-*l*50.1%
Simplified50.1%
unpow250.1%
unpow250.1%
difference-of-squares50.1%
Applied egg-rr50.1%
Taylor expanded in angle around inf 52.0%
associate-*r*51.9%
*-commutative51.9%
*-commutative51.9%
*-commutative51.9%
Simplified51.9%
Taylor expanded in angle around inf 54.0%
if -1.0000000000000001e-250 < (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) Initial program 53.7%
associate-*l*53.7%
*-commutative53.7%
associate-*l*53.7%
Simplified53.7%
add-cbrt-cube40.5%
pow1/330.3%
Applied egg-rr30.3%
unpow1/341.3%
rem-cbrt-cube54.7%
add-sqr-sqrt54.6%
associate-*l*54.6%
Applied egg-rr72.5%
Final simplification64.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 (<= (- (pow b 2.0) (pow a 2.0)) 2e+294)
(*
2.0
(*
(cos (* PI (* 0.005555555555555556 angle_m)))
(* (sin (* 0.005555555555555556 (* angle_m PI))) (* (+ b a) (- b a)))))
(* 0.011111111111111112 (pow (* (hypot b a) (sqrt (* angle_m PI))) 2.0)))))angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a, double b, double angle_m) {
double tmp;
if ((pow(b, 2.0) - pow(a, 2.0)) <= 2e+294) {
tmp = 2.0 * (cos((((double) M_PI) * (0.005555555555555556 * angle_m))) * (sin((0.005555555555555556 * (angle_m * ((double) M_PI)))) * ((b + a) * (b - a))));
} else {
tmp = 0.011111111111111112 * pow((hypot(b, a) * sqrt((angle_m * ((double) M_PI)))), 2.0);
}
return angle_s * tmp;
}
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b, double angle_m) {
double tmp;
if ((Math.pow(b, 2.0) - Math.pow(a, 2.0)) <= 2e+294) {
tmp = 2.0 * (Math.cos((Math.PI * (0.005555555555555556 * angle_m))) * (Math.sin((0.005555555555555556 * (angle_m * Math.PI))) * ((b + a) * (b - a))));
} else {
tmp = 0.011111111111111112 * Math.pow((Math.hypot(b, a) * Math.sqrt((angle_m * Math.PI))), 2.0);
}
return angle_s * tmp;
}
angle\_m = math.fabs(angle) angle\_s = math.copysign(1.0, angle) def code(angle_s, a, b, angle_m): tmp = 0 if (math.pow(b, 2.0) - math.pow(a, 2.0)) <= 2e+294: tmp = 2.0 * (math.cos((math.pi * (0.005555555555555556 * angle_m))) * (math.sin((0.005555555555555556 * (angle_m * math.pi))) * ((b + a) * (b - a)))) else: tmp = 0.011111111111111112 * math.pow((math.hypot(b, a) * math.sqrt((angle_m * math.pi))), 2.0) return angle_s * tmp
angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a, b, angle_m) tmp = 0.0 if (Float64((b ^ 2.0) - (a ^ 2.0)) <= 2e+294) tmp = Float64(2.0 * Float64(cos(Float64(pi * Float64(0.005555555555555556 * angle_m))) * Float64(sin(Float64(0.005555555555555556 * Float64(angle_m * pi))) * Float64(Float64(b + a) * Float64(b - a))))); else tmp = Float64(0.011111111111111112 * (Float64(hypot(b, a) * sqrt(Float64(angle_m * pi))) ^ 2.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 (((b ^ 2.0) - (a ^ 2.0)) <= 2e+294) tmp = 2.0 * (cos((pi * (0.005555555555555556 * angle_m))) * (sin((0.005555555555555556 * (angle_m * pi))) * ((b + a) * (b - a)))); else tmp = 0.011111111111111112 * ((hypot(b, a) * sqrt((angle_m * pi))) ^ 2.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[(N[Power[b, 2.0], $MachinePrecision] - N[Power[a, 2.0], $MachinePrecision]), $MachinePrecision], 2e+294], N[(2.0 * N[(N[Cos[N[(Pi * N[(0.005555555555555556 * angle$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(N[Sin[N[(0.005555555555555556 * N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(N[(b + a), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.011111111111111112 * N[Power[N[(N[Sqrt[b ^ 2 + a ^ 2], $MachinePrecision] * N[Sqrt[N[(angle$95$m * Pi), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;{b}^{2} - {a}^{2} \leq 2 \cdot 10^{+294}:\\
\;\;\;\;2 \cdot \left(\cos \left(\pi \cdot \left(0.005555555555555556 \cdot angle\_m\right)\right) \cdot \left(\sin \left(0.005555555555555556 \cdot \left(angle\_m \cdot \pi\right)\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;0.011111111111111112 \cdot {\left(\mathsf{hypot}\left(b, a\right) \cdot \sqrt{angle\_m \cdot \pi}\right)}^{2}\\
\end{array}
\end{array}
if (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) < 2.00000000000000013e294Initial program 55.9%
associate-*l*55.9%
associate-*l*55.9%
Simplified55.9%
unpow255.9%
unpow255.9%
difference-of-squares55.9%
Applied egg-rr55.9%
Taylor expanded in angle around inf 57.3%
associate-*r*57.2%
*-commutative57.2%
*-commutative57.2%
*-commutative57.2%
Simplified57.2%
Taylor expanded in angle around inf 58.5%
if 2.00000000000000013e294 < (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) Initial program 40.5%
associate-*l*40.5%
*-commutative40.5%
associate-*l*40.5%
Simplified40.5%
Taylor expanded in angle around 0 37.4%
add-sqr-sqrt20.8%
pow220.8%
Applied egg-rr35.8%
Final simplification52.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) 2e-230)
(fma
b
(* (* angle_m 0.011111111111111112) (* b PI))
(* (* (pow a 2.0) (* angle_m PI)) -0.011111111111111112))
(if (<= (/ angle_m 180.0) 4e-155)
(+
(* 0.011111111111111112 (* angle_m (* (pow b 2.0) PI)))
(*
a
(+
(* -0.011111111111111112 (* a (* angle_m PI)))
(* 0.011111111111111112 (* angle_m (* PI (- b b)))))))
(if (<= (/ angle_m 180.0) 1e+76)
(* (* angle_m 0.011111111111111112) (* (- b a) (* PI (+ b a))))
(* 2.0 (* (* (+ b a) (- b a)) (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) <= 2e-230) {
tmp = fma(b, ((angle_m * 0.011111111111111112) * (b * ((double) M_PI))), ((pow(a, 2.0) * (angle_m * ((double) M_PI))) * -0.011111111111111112));
} else if ((angle_m / 180.0) <= 4e-155) {
tmp = (0.011111111111111112 * (angle_m * (pow(b, 2.0) * ((double) M_PI)))) + (a * ((-0.011111111111111112 * (a * (angle_m * ((double) M_PI)))) + (0.011111111111111112 * (angle_m * (((double) M_PI) * (b - b))))));
} else if ((angle_m / 180.0) <= 1e+76) {
tmp = (angle_m * 0.011111111111111112) * ((b - a) * (((double) M_PI) * (b + a)));
} else {
tmp = 2.0 * (((b + a) * (b - a)) * sin((((double) M_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) <= 2e-230) tmp = fma(b, Float64(Float64(angle_m * 0.011111111111111112) * Float64(b * pi)), Float64(Float64((a ^ 2.0) * Float64(angle_m * pi)) * -0.011111111111111112)); elseif (Float64(angle_m / 180.0) <= 4e-155) tmp = Float64(Float64(0.011111111111111112 * Float64(angle_m * Float64((b ^ 2.0) * pi))) + Float64(a * Float64(Float64(-0.011111111111111112 * Float64(a * Float64(angle_m * pi))) + Float64(0.011111111111111112 * Float64(angle_m * Float64(pi * Float64(b - b))))))); elseif (Float64(angle_m / 180.0) <= 1e+76) tmp = Float64(Float64(angle_m * 0.011111111111111112) * Float64(Float64(b - a) * Float64(pi * Float64(b + a)))); else tmp = Float64(2.0 * Float64(Float64(Float64(b + a) * Float64(b - a)) * sin(Float64(pi * Float64(angle_m / 180.0))))); end return Float64(angle_s * tmp) end
angle\_m = N[Abs[angle], $MachinePrecision]
angle\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a_, b_, angle$95$m_] := N[(angle$95$s * If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 2e-230], N[(b * N[(N[(angle$95$m * 0.011111111111111112), $MachinePrecision] * N[(b * Pi), $MachinePrecision]), $MachinePrecision] + N[(N[(N[Power[a, 2.0], $MachinePrecision] * N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision] * -0.011111111111111112), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 4e-155], 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[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(0.011111111111111112 * N[(angle$95$m * N[(Pi * N[(b - b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 1e+76], N[(N[(angle$95$m * 0.011111111111111112), $MachinePrecision] * N[(N[(b - a), $MachinePrecision] * N[(Pi * N[(b + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(N[(b + a), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision] * 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 2 \cdot 10^{-230}:\\
\;\;\;\;\mathsf{fma}\left(b, \left(angle\_m \cdot 0.011111111111111112\right) \cdot \left(b \cdot \pi\right), \left({a}^{2} \cdot \left(angle\_m \cdot \pi\right)\right) \cdot -0.011111111111111112\right)\\
\mathbf{elif}\;\frac{angle\_m}{180} \leq 4 \cdot 10^{-155}:\\
\;\;\;\;0.011111111111111112 \cdot \left(angle\_m \cdot \left({b}^{2} \cdot \pi\right)\right) + a \cdot \left(-0.011111111111111112 \cdot \left(a \cdot \left(angle\_m \cdot \pi\right)\right) + 0.011111111111111112 \cdot \left(angle\_m \cdot \left(\pi \cdot \left(b - b\right)\right)\right)\right)\\
\mathbf{elif}\;\frac{angle\_m}{180} \leq 10^{+76}:\\
\;\;\;\;\left(angle\_m \cdot 0.011111111111111112\right) \cdot \left(\left(b - a\right) \cdot \left(\pi \cdot \left(b + a\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(\left(\left(b + a\right) \cdot \left(b - a\right)\right) \cdot \sin \left(\pi \cdot \frac{angle\_m}{180}\right)\right)\\
\end{array}
\end{array}
if (/.f64 angle #s(literal 180 binary64)) < 2.00000000000000009e-230Initial program 44.5%
associate-*l*44.5%
*-commutative44.5%
associate-*l*44.5%
Simplified44.5%
Taylor expanded in angle around 0 44.7%
unpow244.5%
unpow244.5%
difference-of-squares46.9%
Applied egg-rr46.3%
Taylor expanded in b around 0 47.8%
+-commutative47.8%
fma-define47.8%
associate-*r*47.8%
associate-*r*47.8%
distribute-lft-out47.8%
+-commutative47.8%
*-commutative47.8%
distribute-rgt1-in47.8%
metadata-eval47.8%
mul0-lft47.8%
distribute-rgt-out47.8%
*-commutative47.8%
Simplified47.8%
if 2.00000000000000009e-230 < (/.f64 angle #s(literal 180 binary64)) < 4.00000000000000006e-155Initial program 82.0%
associate-*l*82.0%
*-commutative82.0%
associate-*l*82.0%
Simplified82.0%
Taylor expanded in angle around 0 81.8%
unpow282.0%
unpow282.0%
difference-of-squares82.0%
Applied egg-rr81.8%
Taylor expanded in a around 0 99.4%
if 4.00000000000000006e-155 < (/.f64 angle #s(literal 180 binary64)) < 1e76Initial program 74.5%
associate-*l*74.5%
*-commutative74.5%
associate-*l*74.5%
Simplified74.5%
Taylor expanded in angle around 0 71.0%
unpow274.5%
unpow274.5%
difference-of-squares78.6%
Applied egg-rr75.1%
Taylor expanded in angle around 0 75.1%
associate-*r*75.2%
+-commutative75.2%
*-commutative75.2%
Simplified75.2%
Taylor expanded in angle around 0 75.1%
associate-*r*75.2%
*-commutative75.2%
associate-*r*75.2%
+-commutative75.2%
Simplified75.2%
if 1e76 < (/.f64 angle #s(literal 180 binary64)) Initial program 41.4%
associate-*l*41.4%
associate-*l*41.4%
Simplified41.4%
unpow241.4%
unpow241.4%
difference-of-squares43.3%
Applied egg-rr43.3%
Taylor expanded in angle around 0 50.1%
Final simplification56.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) 2e-230)
(+
(* (* (pow a 2.0) (* angle_m PI)) -0.011111111111111112)
(*
b
(+
(* 0.011111111111111112 (* angle_m (* b PI)))
(* 0.011111111111111112 (* angle_m (* PI (- a a)))))))
(if (<= (/ angle_m 180.0) 4e-155)
(+
(* 0.011111111111111112 (* angle_m (* (pow b 2.0) PI)))
(*
a
(+
(* -0.011111111111111112 (* a (* angle_m PI)))
(* 0.011111111111111112 (* angle_m (* PI (- b b)))))))
(if (<= (/ angle_m 180.0) 1e+76)
(* (* angle_m 0.011111111111111112) (* (- b a) (* PI (+ b a))))
(* 2.0 (* (* (+ b a) (- b a)) (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) <= 2e-230) {
tmp = ((pow(a, 2.0) * (angle_m * ((double) M_PI))) * -0.011111111111111112) + (b * ((0.011111111111111112 * (angle_m * (b * ((double) M_PI)))) + (0.011111111111111112 * (angle_m * (((double) M_PI) * (a - a))))));
} else if ((angle_m / 180.0) <= 4e-155) {
tmp = (0.011111111111111112 * (angle_m * (pow(b, 2.0) * ((double) M_PI)))) + (a * ((-0.011111111111111112 * (a * (angle_m * ((double) M_PI)))) + (0.011111111111111112 * (angle_m * (((double) M_PI) * (b - b))))));
} else if ((angle_m / 180.0) <= 1e+76) {
tmp = (angle_m * 0.011111111111111112) * ((b - a) * (((double) M_PI) * (b + a)));
} else {
tmp = 2.0 * (((b + a) * (b - a)) * 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) <= 2e-230) {
tmp = ((Math.pow(a, 2.0) * (angle_m * Math.PI)) * -0.011111111111111112) + (b * ((0.011111111111111112 * (angle_m * (b * Math.PI))) + (0.011111111111111112 * (angle_m * (Math.PI * (a - a))))));
} else if ((angle_m / 180.0) <= 4e-155) {
tmp = (0.011111111111111112 * (angle_m * (Math.pow(b, 2.0) * Math.PI))) + (a * ((-0.011111111111111112 * (a * (angle_m * Math.PI))) + (0.011111111111111112 * (angle_m * (Math.PI * (b - b))))));
} else if ((angle_m / 180.0) <= 1e+76) {
tmp = (angle_m * 0.011111111111111112) * ((b - a) * (Math.PI * (b + a)));
} else {
tmp = 2.0 * (((b + a) * (b - a)) * 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) <= 2e-230: tmp = ((math.pow(a, 2.0) * (angle_m * math.pi)) * -0.011111111111111112) + (b * ((0.011111111111111112 * (angle_m * (b * math.pi))) + (0.011111111111111112 * (angle_m * (math.pi * (a - a)))))) elif (angle_m / 180.0) <= 4e-155: tmp = (0.011111111111111112 * (angle_m * (math.pow(b, 2.0) * math.pi))) + (a * ((-0.011111111111111112 * (a * (angle_m * math.pi))) + (0.011111111111111112 * (angle_m * (math.pi * (b - b)))))) elif (angle_m / 180.0) <= 1e+76: tmp = (angle_m * 0.011111111111111112) * ((b - a) * (math.pi * (b + a))) else: tmp = 2.0 * (((b + a) * (b - a)) * 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) <= 2e-230) tmp = Float64(Float64(Float64((a ^ 2.0) * Float64(angle_m * pi)) * -0.011111111111111112) + Float64(b * Float64(Float64(0.011111111111111112 * Float64(angle_m * Float64(b * pi))) + Float64(0.011111111111111112 * Float64(angle_m * Float64(pi * Float64(a - a))))))); elseif (Float64(angle_m / 180.0) <= 4e-155) tmp = Float64(Float64(0.011111111111111112 * Float64(angle_m * Float64((b ^ 2.0) * pi))) + Float64(a * Float64(Float64(-0.011111111111111112 * Float64(a * Float64(angle_m * pi))) + Float64(0.011111111111111112 * Float64(angle_m * Float64(pi * Float64(b - b))))))); elseif (Float64(angle_m / 180.0) <= 1e+76) tmp = Float64(Float64(angle_m * 0.011111111111111112) * Float64(Float64(b - a) * Float64(pi * Float64(b + a)))); else tmp = Float64(2.0 * Float64(Float64(Float64(b + a) * Float64(b - a)) * 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) <= 2e-230) tmp = (((a ^ 2.0) * (angle_m * pi)) * -0.011111111111111112) + (b * ((0.011111111111111112 * (angle_m * (b * pi))) + (0.011111111111111112 * (angle_m * (pi * (a - a)))))); elseif ((angle_m / 180.0) <= 4e-155) tmp = (0.011111111111111112 * (angle_m * ((b ^ 2.0) * pi))) + (a * ((-0.011111111111111112 * (a * (angle_m * pi))) + (0.011111111111111112 * (angle_m * (pi * (b - b)))))); elseif ((angle_m / 180.0) <= 1e+76) tmp = (angle_m * 0.011111111111111112) * ((b - a) * (pi * (b + a))); else tmp = 2.0 * (((b + a) * (b - a)) * 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], 2e-230], N[(N[(N[(N[Power[a, 2.0], $MachinePrecision] * N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision] * -0.011111111111111112), $MachinePrecision] + N[(b * N[(N[(0.011111111111111112 * N[(angle$95$m * N[(b * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(0.011111111111111112 * N[(angle$95$m * N[(Pi * N[(a - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 4e-155], 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[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(0.011111111111111112 * N[(angle$95$m * N[(Pi * N[(b - b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 1e+76], N[(N[(angle$95$m * 0.011111111111111112), $MachinePrecision] * N[(N[(b - a), $MachinePrecision] * N[(Pi * N[(b + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(N[(b + a), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision] * 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 2 \cdot 10^{-230}:\\
\;\;\;\;\left({a}^{2} \cdot \left(angle\_m \cdot \pi\right)\right) \cdot -0.011111111111111112 + b \cdot \left(0.011111111111111112 \cdot \left(angle\_m \cdot \left(b \cdot \pi\right)\right) + 0.011111111111111112 \cdot \left(angle\_m \cdot \left(\pi \cdot \left(a - a\right)\right)\right)\right)\\
\mathbf{elif}\;\frac{angle\_m}{180} \leq 4 \cdot 10^{-155}:\\
\;\;\;\;0.011111111111111112 \cdot \left(angle\_m \cdot \left({b}^{2} \cdot \pi\right)\right) + a \cdot \left(-0.011111111111111112 \cdot \left(a \cdot \left(angle\_m \cdot \pi\right)\right) + 0.011111111111111112 \cdot \left(angle\_m \cdot \left(\pi \cdot \left(b - b\right)\right)\right)\right)\\
\mathbf{elif}\;\frac{angle\_m}{180} \leq 10^{+76}:\\
\;\;\;\;\left(angle\_m \cdot 0.011111111111111112\right) \cdot \left(\left(b - a\right) \cdot \left(\pi \cdot \left(b + a\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(\left(\left(b + a\right) \cdot \left(b - a\right)\right) \cdot \sin \left(\pi \cdot \frac{angle\_m}{180}\right)\right)\\
\end{array}
\end{array}
if (/.f64 angle #s(literal 180 binary64)) < 2.00000000000000009e-230Initial program 44.5%
associate-*l*44.5%
*-commutative44.5%
associate-*l*44.5%
Simplified44.5%
Taylor expanded in angle around 0 44.7%
unpow244.5%
unpow244.5%
difference-of-squares46.9%
Applied egg-rr46.3%
Taylor expanded in b around 0 47.8%
if 2.00000000000000009e-230 < (/.f64 angle #s(literal 180 binary64)) < 4.00000000000000006e-155Initial program 82.0%
associate-*l*82.0%
*-commutative82.0%
associate-*l*82.0%
Simplified82.0%
Taylor expanded in angle around 0 81.8%
unpow282.0%
unpow282.0%
difference-of-squares82.0%
Applied egg-rr81.8%
Taylor expanded in a around 0 99.4%
if 4.00000000000000006e-155 < (/.f64 angle #s(literal 180 binary64)) < 1e76Initial program 74.5%
associate-*l*74.5%
*-commutative74.5%
associate-*l*74.5%
Simplified74.5%
Taylor expanded in angle around 0 71.0%
unpow274.5%
unpow274.5%
difference-of-squares78.6%
Applied egg-rr75.1%
Taylor expanded in angle around 0 75.1%
associate-*r*75.2%
+-commutative75.2%
*-commutative75.2%
Simplified75.2%
Taylor expanded in angle around 0 75.1%
associate-*r*75.2%
*-commutative75.2%
associate-*r*75.2%
+-commutative75.2%
Simplified75.2%
if 1e76 < (/.f64 angle #s(literal 180 binary64)) Initial program 41.4%
associate-*l*41.4%
associate-*l*41.4%
Simplified41.4%
unpow241.4%
unpow241.4%
difference-of-squares43.3%
Applied egg-rr43.3%
Taylor expanded in angle around 0 50.1%
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) 2e-230)
(+
(* (* (pow a 2.0) (* angle_m PI)) -0.011111111111111112)
(*
b
(+
(* 0.011111111111111112 (* angle_m (* b PI)))
(* 0.011111111111111112 (* angle_m (* PI (- a a)))))))
(if (<= (/ angle_m 180.0) 4e-155)
(*
0.011111111111111112
(- (* angle_m (* (pow b 2.0) PI)) (* a (* a (* angle_m PI)))))
(if (<= (/ angle_m 180.0) 6e+69)
(* (* angle_m 0.011111111111111112) (* (- b a) (* PI (+ b a))))
(* 2.0 (* (* (+ b a) (- b a)) (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) <= 2e-230) {
tmp = ((pow(a, 2.0) * (angle_m * ((double) M_PI))) * -0.011111111111111112) + (b * ((0.011111111111111112 * (angle_m * (b * ((double) M_PI)))) + (0.011111111111111112 * (angle_m * (((double) M_PI) * (a - a))))));
} else if ((angle_m / 180.0) <= 4e-155) {
tmp = 0.011111111111111112 * ((angle_m * (pow(b, 2.0) * ((double) M_PI))) - (a * (a * (angle_m * ((double) M_PI)))));
} else if ((angle_m / 180.0) <= 6e+69) {
tmp = (angle_m * 0.011111111111111112) * ((b - a) * (((double) M_PI) * (b + a)));
} else {
tmp = 2.0 * (((b + a) * (b - a)) * 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) <= 2e-230) {
tmp = ((Math.pow(a, 2.0) * (angle_m * Math.PI)) * -0.011111111111111112) + (b * ((0.011111111111111112 * (angle_m * (b * Math.PI))) + (0.011111111111111112 * (angle_m * (Math.PI * (a - a))))));
} else if ((angle_m / 180.0) <= 4e-155) {
tmp = 0.011111111111111112 * ((angle_m * (Math.pow(b, 2.0) * Math.PI)) - (a * (a * (angle_m * Math.PI))));
} else if ((angle_m / 180.0) <= 6e+69) {
tmp = (angle_m * 0.011111111111111112) * ((b - a) * (Math.PI * (b + a)));
} else {
tmp = 2.0 * (((b + a) * (b - a)) * 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) <= 2e-230: tmp = ((math.pow(a, 2.0) * (angle_m * math.pi)) * -0.011111111111111112) + (b * ((0.011111111111111112 * (angle_m * (b * math.pi))) + (0.011111111111111112 * (angle_m * (math.pi * (a - a)))))) elif (angle_m / 180.0) <= 4e-155: tmp = 0.011111111111111112 * ((angle_m * (math.pow(b, 2.0) * math.pi)) - (a * (a * (angle_m * math.pi)))) elif (angle_m / 180.0) <= 6e+69: tmp = (angle_m * 0.011111111111111112) * ((b - a) * (math.pi * (b + a))) else: tmp = 2.0 * (((b + a) * (b - a)) * 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) <= 2e-230) tmp = Float64(Float64(Float64((a ^ 2.0) * Float64(angle_m * pi)) * -0.011111111111111112) + Float64(b * Float64(Float64(0.011111111111111112 * Float64(angle_m * Float64(b * pi))) + Float64(0.011111111111111112 * Float64(angle_m * Float64(pi * Float64(a - a))))))); elseif (Float64(angle_m / 180.0) <= 4e-155) tmp = Float64(0.011111111111111112 * Float64(Float64(angle_m * Float64((b ^ 2.0) * pi)) - Float64(a * Float64(a * Float64(angle_m * pi))))); elseif (Float64(angle_m / 180.0) <= 6e+69) tmp = Float64(Float64(angle_m * 0.011111111111111112) * Float64(Float64(b - a) * Float64(pi * Float64(b + a)))); else tmp = Float64(2.0 * Float64(Float64(Float64(b + a) * Float64(b - a)) * 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) <= 2e-230) tmp = (((a ^ 2.0) * (angle_m * pi)) * -0.011111111111111112) + (b * ((0.011111111111111112 * (angle_m * (b * pi))) + (0.011111111111111112 * (angle_m * (pi * (a - a)))))); elseif ((angle_m / 180.0) <= 4e-155) tmp = 0.011111111111111112 * ((angle_m * ((b ^ 2.0) * pi)) - (a * (a * (angle_m * pi)))); elseif ((angle_m / 180.0) <= 6e+69) tmp = (angle_m * 0.011111111111111112) * ((b - a) * (pi * (b + a))); else tmp = 2.0 * (((b + a) * (b - a)) * 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], 2e-230], N[(N[(N[(N[Power[a, 2.0], $MachinePrecision] * N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision] * -0.011111111111111112), $MachinePrecision] + N[(b * N[(N[(0.011111111111111112 * N[(angle$95$m * N[(b * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(0.011111111111111112 * N[(angle$95$m * N[(Pi * N[(a - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 4e-155], N[(0.011111111111111112 * N[(N[(angle$95$m * N[(N[Power[b, 2.0], $MachinePrecision] * Pi), $MachinePrecision]), $MachinePrecision] - N[(a * N[(a * N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 6e+69], N[(N[(angle$95$m * 0.011111111111111112), $MachinePrecision] * N[(N[(b - a), $MachinePrecision] * N[(Pi * N[(b + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(N[(b + a), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision] * 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 2 \cdot 10^{-230}:\\
\;\;\;\;\left({a}^{2} \cdot \left(angle\_m \cdot \pi\right)\right) \cdot -0.011111111111111112 + b \cdot \left(0.011111111111111112 \cdot \left(angle\_m \cdot \left(b \cdot \pi\right)\right) + 0.011111111111111112 \cdot \left(angle\_m \cdot \left(\pi \cdot \left(a - a\right)\right)\right)\right)\\
\mathbf{elif}\;\frac{angle\_m}{180} \leq 4 \cdot 10^{-155}:\\
\;\;\;\;0.011111111111111112 \cdot \left(angle\_m \cdot \left({b}^{2} \cdot \pi\right) - a \cdot \left(a \cdot \left(angle\_m \cdot \pi\right)\right)\right)\\
\mathbf{elif}\;\frac{angle\_m}{180} \leq 6 \cdot 10^{+69}:\\
\;\;\;\;\left(angle\_m \cdot 0.011111111111111112\right) \cdot \left(\left(b - a\right) \cdot \left(\pi \cdot \left(b + a\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(\left(\left(b + a\right) \cdot \left(b - a\right)\right) \cdot \sin \left(\pi \cdot \frac{angle\_m}{180}\right)\right)\\
\end{array}
\end{array}
if (/.f64 angle #s(literal 180 binary64)) < 2.00000000000000009e-230Initial program 44.5%
associate-*l*44.5%
*-commutative44.5%
associate-*l*44.5%
Simplified44.5%
Taylor expanded in angle around 0 44.7%
unpow244.5%
unpow244.5%
difference-of-squares46.9%
Applied egg-rr46.3%
Taylor expanded in b around 0 47.8%
if 2.00000000000000009e-230 < (/.f64 angle #s(literal 180 binary64)) < 4.00000000000000006e-155Initial program 82.0%
associate-*l*82.0%
*-commutative82.0%
associate-*l*82.0%
Simplified82.0%
Taylor expanded in angle around 0 81.8%
unpow282.0%
unpow282.0%
difference-of-squares82.0%
Applied egg-rr81.8%
Taylor expanded in a around 0 99.2%
+-commutative99.2%
*-commutative99.2%
+-commutative99.2%
associate-*r*99.2%
fma-define99.2%
distribute-rgt1-in99.2%
metadata-eval99.2%
mul0-lft99.2%
mul-1-neg99.2%
fma-neg99.2%
mul0-rgt99.2%
neg-sub099.2%
mul-1-neg99.2%
Simplified99.2%
if 4.00000000000000006e-155 < (/.f64 angle #s(literal 180 binary64)) < 5.99999999999999967e69Initial program 76.0%
associate-*l*76.0%
*-commutative76.0%
associate-*l*76.0%
Simplified76.0%
Taylor expanded in angle around 0 70.4%
unpow276.0%
unpow276.0%
difference-of-squares80.2%
Applied egg-rr74.6%
Taylor expanded in angle around 0 74.6%
associate-*r*74.7%
+-commutative74.7%
*-commutative74.7%
Simplified74.7%
Taylor expanded in angle around 0 74.6%
associate-*r*74.7%
*-commutative74.7%
associate-*r*74.7%
+-commutative74.7%
Simplified74.7%
if 5.99999999999999967e69 < (/.f64 angle #s(literal 180 binary64)) Initial program 40.6%
associate-*l*40.6%
associate-*l*40.6%
Simplified40.6%
unpow240.6%
unpow240.6%
difference-of-squares42.5%
Applied egg-rr42.5%
Taylor expanded in angle around 0 51.0%
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) 2e-230)
(*
0.011111111111111112
(- (* b (* PI (* b angle_m))) (* (pow a 2.0) (* angle_m PI))))
(if (<= (/ angle_m 180.0) 4e-155)
(*
0.011111111111111112
(- (* angle_m (* (pow b 2.0) PI)) (* a (* a (* angle_m PI)))))
(if (<= (/ angle_m 180.0) 6e+69)
(* (* angle_m 0.011111111111111112) (* (- b a) (* PI (+ b a))))
(* 2.0 (* (* (+ b a) (- b a)) (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) <= 2e-230) {
tmp = 0.011111111111111112 * ((b * (((double) M_PI) * (b * angle_m))) - (pow(a, 2.0) * (angle_m * ((double) M_PI))));
} else if ((angle_m / 180.0) <= 4e-155) {
tmp = 0.011111111111111112 * ((angle_m * (pow(b, 2.0) * ((double) M_PI))) - (a * (a * (angle_m * ((double) M_PI)))));
} else if ((angle_m / 180.0) <= 6e+69) {
tmp = (angle_m * 0.011111111111111112) * ((b - a) * (((double) M_PI) * (b + a)));
} else {
tmp = 2.0 * (((b + a) * (b - a)) * 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) <= 2e-230) {
tmp = 0.011111111111111112 * ((b * (Math.PI * (b * angle_m))) - (Math.pow(a, 2.0) * (angle_m * Math.PI)));
} else if ((angle_m / 180.0) <= 4e-155) {
tmp = 0.011111111111111112 * ((angle_m * (Math.pow(b, 2.0) * Math.PI)) - (a * (a * (angle_m * Math.PI))));
} else if ((angle_m / 180.0) <= 6e+69) {
tmp = (angle_m * 0.011111111111111112) * ((b - a) * (Math.PI * (b + a)));
} else {
tmp = 2.0 * (((b + a) * (b - a)) * 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) <= 2e-230: tmp = 0.011111111111111112 * ((b * (math.pi * (b * angle_m))) - (math.pow(a, 2.0) * (angle_m * math.pi))) elif (angle_m / 180.0) <= 4e-155: tmp = 0.011111111111111112 * ((angle_m * (math.pow(b, 2.0) * math.pi)) - (a * (a * (angle_m * math.pi)))) elif (angle_m / 180.0) <= 6e+69: tmp = (angle_m * 0.011111111111111112) * ((b - a) * (math.pi * (b + a))) else: tmp = 2.0 * (((b + a) * (b - a)) * 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) <= 2e-230) tmp = Float64(0.011111111111111112 * Float64(Float64(b * Float64(pi * Float64(b * angle_m))) - Float64((a ^ 2.0) * Float64(angle_m * pi)))); elseif (Float64(angle_m / 180.0) <= 4e-155) tmp = Float64(0.011111111111111112 * Float64(Float64(angle_m * Float64((b ^ 2.0) * pi)) - Float64(a * Float64(a * Float64(angle_m * pi))))); elseif (Float64(angle_m / 180.0) <= 6e+69) tmp = Float64(Float64(angle_m * 0.011111111111111112) * Float64(Float64(b - a) * Float64(pi * Float64(b + a)))); else tmp = Float64(2.0 * Float64(Float64(Float64(b + a) * Float64(b - a)) * 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) <= 2e-230) tmp = 0.011111111111111112 * ((b * (pi * (b * angle_m))) - ((a ^ 2.0) * (angle_m * pi))); elseif ((angle_m / 180.0) <= 4e-155) tmp = 0.011111111111111112 * ((angle_m * ((b ^ 2.0) * pi)) - (a * (a * (angle_m * pi)))); elseif ((angle_m / 180.0) <= 6e+69) tmp = (angle_m * 0.011111111111111112) * ((b - a) * (pi * (b + a))); else tmp = 2.0 * (((b + a) * (b - a)) * 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], 2e-230], N[(0.011111111111111112 * N[(N[(b * N[(Pi * N[(b * angle$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[Power[a, 2.0], $MachinePrecision] * N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 4e-155], N[(0.011111111111111112 * N[(N[(angle$95$m * N[(N[Power[b, 2.0], $MachinePrecision] * Pi), $MachinePrecision]), $MachinePrecision] - N[(a * N[(a * N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 6e+69], N[(N[(angle$95$m * 0.011111111111111112), $MachinePrecision] * N[(N[(b - a), $MachinePrecision] * N[(Pi * N[(b + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(N[(b + a), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision] * 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 2 \cdot 10^{-230}:\\
\;\;\;\;0.011111111111111112 \cdot \left(b \cdot \left(\pi \cdot \left(b \cdot angle\_m\right)\right) - {a}^{2} \cdot \left(angle\_m \cdot \pi\right)\right)\\
\mathbf{elif}\;\frac{angle\_m}{180} \leq 4 \cdot 10^{-155}:\\
\;\;\;\;0.011111111111111112 \cdot \left(angle\_m \cdot \left({b}^{2} \cdot \pi\right) - a \cdot \left(a \cdot \left(angle\_m \cdot \pi\right)\right)\right)\\
\mathbf{elif}\;\frac{angle\_m}{180} \leq 6 \cdot 10^{+69}:\\
\;\;\;\;\left(angle\_m \cdot 0.011111111111111112\right) \cdot \left(\left(b - a\right) \cdot \left(\pi \cdot \left(b + a\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(\left(\left(b + a\right) \cdot \left(b - a\right)\right) \cdot \sin \left(\pi \cdot \frac{angle\_m}{180}\right)\right)\\
\end{array}
\end{array}
if (/.f64 angle #s(literal 180 binary64)) < 2.00000000000000009e-230Initial program 44.5%
associate-*l*44.5%
*-commutative44.5%
associate-*l*44.5%
Simplified44.5%
Taylor expanded in angle around 0 44.7%
unpow244.5%
unpow244.5%
difference-of-squares46.9%
Applied egg-rr46.3%
Taylor expanded in b around 0 47.2%
+-commutative47.2%
mul-1-neg47.2%
unsub-neg47.2%
*-commutative47.2%
Simplified47.2%
if 2.00000000000000009e-230 < (/.f64 angle #s(literal 180 binary64)) < 4.00000000000000006e-155Initial program 82.0%
associate-*l*82.0%
*-commutative82.0%
associate-*l*82.0%
Simplified82.0%
Taylor expanded in angle around 0 81.8%
unpow282.0%
unpow282.0%
difference-of-squares82.0%
Applied egg-rr81.8%
Taylor expanded in a around 0 99.2%
+-commutative99.2%
*-commutative99.2%
+-commutative99.2%
associate-*r*99.2%
fma-define99.2%
distribute-rgt1-in99.2%
metadata-eval99.2%
mul0-lft99.2%
mul-1-neg99.2%
fma-neg99.2%
mul0-rgt99.2%
neg-sub099.2%
mul-1-neg99.2%
Simplified99.2%
if 4.00000000000000006e-155 < (/.f64 angle #s(literal 180 binary64)) < 5.99999999999999967e69Initial program 76.0%
associate-*l*76.0%
*-commutative76.0%
associate-*l*76.0%
Simplified76.0%
Taylor expanded in angle around 0 70.4%
unpow276.0%
unpow276.0%
difference-of-squares80.2%
Applied egg-rr74.6%
Taylor expanded in angle around 0 74.6%
associate-*r*74.7%
+-commutative74.7%
*-commutative74.7%
Simplified74.7%
Taylor expanded in angle around 0 74.6%
associate-*r*74.7%
*-commutative74.7%
associate-*r*74.7%
+-commutative74.7%
Simplified74.7%
if 5.99999999999999967e69 < (/.f64 angle #s(literal 180 binary64)) Initial program 40.6%
associate-*l*40.6%
associate-*l*40.6%
Simplified40.6%
unpow240.6%
unpow240.6%
difference-of-squares42.5%
Applied egg-rr42.5%
Taylor expanded in angle around 0 51.0%
Final simplification56.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.011111111111111112)))
(t_1
(*
0.011111111111111112
(- (* b (* PI (* b angle_m))) (* (pow a 2.0) (* angle_m PI))))))
(*
angle_s
(if (<= angle_m 3.1e-227)
t_1
(if (<= angle_m 2.6e-151)
(*
0.011111111111111112
(- (* angle_m (* (pow b 2.0) PI)) (* a (* a (* angle_m PI)))))
(if (<= angle_m 9.2e-114)
t_1
(+ (* (* b (- b a)) t_0) (* t_0 (* 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 t_0 = angle_m * (((double) M_PI) * 0.011111111111111112);
double t_1 = 0.011111111111111112 * ((b * (((double) M_PI) * (b * angle_m))) - (pow(a, 2.0) * (angle_m * ((double) M_PI))));
double tmp;
if (angle_m <= 3.1e-227) {
tmp = t_1;
} else if (angle_m <= 2.6e-151) {
tmp = 0.011111111111111112 * ((angle_m * (pow(b, 2.0) * ((double) M_PI))) - (a * (a * (angle_m * ((double) M_PI)))));
} else if (angle_m <= 9.2e-114) {
tmp = t_1;
} else {
tmp = ((b * (b - a)) * t_0) + (t_0 * (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 t_0 = angle_m * (Math.PI * 0.011111111111111112);
double t_1 = 0.011111111111111112 * ((b * (Math.PI * (b * angle_m))) - (Math.pow(a, 2.0) * (angle_m * Math.PI)));
double tmp;
if (angle_m <= 3.1e-227) {
tmp = t_1;
} else if (angle_m <= 2.6e-151) {
tmp = 0.011111111111111112 * ((angle_m * (Math.pow(b, 2.0) * Math.PI)) - (a * (a * (angle_m * Math.PI))));
} else if (angle_m <= 9.2e-114) {
tmp = t_1;
} else {
tmp = ((b * (b - a)) * t_0) + (t_0 * (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): t_0 = angle_m * (math.pi * 0.011111111111111112) t_1 = 0.011111111111111112 * ((b * (math.pi * (b * angle_m))) - (math.pow(a, 2.0) * (angle_m * math.pi))) tmp = 0 if angle_m <= 3.1e-227: tmp = t_1 elif angle_m <= 2.6e-151: tmp = 0.011111111111111112 * ((angle_m * (math.pow(b, 2.0) * math.pi)) - (a * (a * (angle_m * math.pi)))) elif angle_m <= 9.2e-114: tmp = t_1 else: tmp = ((b * (b - a)) * t_0) + (t_0 * (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) t_0 = Float64(angle_m * Float64(pi * 0.011111111111111112)) t_1 = Float64(0.011111111111111112 * Float64(Float64(b * Float64(pi * Float64(b * angle_m))) - Float64((a ^ 2.0) * Float64(angle_m * pi)))) tmp = 0.0 if (angle_m <= 3.1e-227) tmp = t_1; elseif (angle_m <= 2.6e-151) tmp = Float64(0.011111111111111112 * Float64(Float64(angle_m * Float64((b ^ 2.0) * pi)) - Float64(a * Float64(a * Float64(angle_m * pi))))); elseif (angle_m <= 9.2e-114) tmp = t_1; else tmp = Float64(Float64(Float64(b * Float64(b - a)) * t_0) + Float64(t_0 * 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) t_0 = angle_m * (pi * 0.011111111111111112); t_1 = 0.011111111111111112 * ((b * (pi * (b * angle_m))) - ((a ^ 2.0) * (angle_m * pi))); tmp = 0.0; if (angle_m <= 3.1e-227) tmp = t_1; elseif (angle_m <= 2.6e-151) tmp = 0.011111111111111112 * ((angle_m * ((b ^ 2.0) * pi)) - (a * (a * (angle_m * pi)))); elseif (angle_m <= 9.2e-114) tmp = t_1; else tmp = ((b * (b - a)) * t_0) + (t_0 * (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_] := Block[{t$95$0 = N[(angle$95$m * N[(Pi * 0.011111111111111112), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(0.011111111111111112 * N[(N[(b * N[(Pi * N[(b * angle$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[Power[a, 2.0], $MachinePrecision] * N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, N[(angle$95$s * If[LessEqual[angle$95$m, 3.1e-227], t$95$1, If[LessEqual[angle$95$m, 2.6e-151], N[(0.011111111111111112 * N[(N[(angle$95$m * N[(N[Power[b, 2.0], $MachinePrecision] * Pi), $MachinePrecision]), $MachinePrecision] - N[(a * N[(a * N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[angle$95$m, 9.2e-114], t$95$1, N[(N[(N[(b * N[(b - a), $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision] + N[(t$95$0 * N[(a * N[(b - a), $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.011111111111111112\right)\\
t_1 := 0.011111111111111112 \cdot \left(b \cdot \left(\pi \cdot \left(b \cdot angle\_m\right)\right) - {a}^{2} \cdot \left(angle\_m \cdot \pi\right)\right)\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;angle\_m \leq 3.1 \cdot 10^{-227}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;angle\_m \leq 2.6 \cdot 10^{-151}:\\
\;\;\;\;0.011111111111111112 \cdot \left(angle\_m \cdot \left({b}^{2} \cdot \pi\right) - a \cdot \left(a \cdot \left(angle\_m \cdot \pi\right)\right)\right)\\
\mathbf{elif}\;angle\_m \leq 9.2 \cdot 10^{-114}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\left(b \cdot \left(b - a\right)\right) \cdot t\_0 + t\_0 \cdot \left(a \cdot \left(b - a\right)\right)\\
\end{array}
\end{array}
\end{array}
if angle < 3.09999999999999979e-227 or 2.6e-151 < angle < 9.1999999999999997e-114Initial program 44.4%
associate-*l*44.4%
*-commutative44.4%
associate-*l*44.4%
Simplified44.4%
Taylor expanded in angle around 0 44.5%
unpow244.4%
unpow244.4%
difference-of-squares47.4%
Applied egg-rr46.9%
Taylor expanded in b around 0 47.7%
+-commutative47.7%
mul-1-neg47.7%
unsub-neg47.7%
*-commutative47.7%
Simplified47.7%
if 3.09999999999999979e-227 < angle < 2.6e-151Initial program 82.0%
associate-*l*82.0%
*-commutative82.0%
associate-*l*82.0%
Simplified82.0%
Taylor expanded in angle around 0 81.8%
unpow282.0%
unpow282.0%
difference-of-squares82.0%
Applied egg-rr81.8%
Taylor expanded in a around 0 99.2%
+-commutative99.2%
*-commutative99.2%
+-commutative99.2%
associate-*r*99.2%
fma-define99.2%
distribute-rgt1-in99.2%
metadata-eval99.2%
mul0-lft99.2%
mul-1-neg99.2%
fma-neg99.2%
mul0-rgt99.2%
neg-sub099.2%
mul-1-neg99.2%
Simplified99.2%
if 9.1999999999999997e-114 < angle Initial program 58.6%
associate-*l*58.6%
*-commutative58.6%
associate-*l*58.6%
Simplified58.6%
Taylor expanded in angle around 0 50.2%
unpow258.6%
unpow258.6%
difference-of-squares60.7%
Applied egg-rr53.3%
Taylor expanded in angle around 0 53.3%
associate-*r*53.4%
+-commutative53.4%
*-commutative53.4%
Simplified53.4%
associate-*r*53.4%
distribute-lft-in50.3%
distribute-rgt-in44.0%
*-commutative44.0%
*-commutative44.0%
associate-*l*44.0%
*-commutative44.0%
*-commutative44.0%
associate-*l*44.0%
Applied egg-rr44.0%
Final simplification49.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 (<= angle_m 1.25e-152)
(*
0.011111111111111112
(- (* angle_m (* (pow b 2.0) PI)) (* a (* a (* angle_m PI)))))
(* (* angle_m 0.011111111111111112) (* (- b 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 (angle_m <= 1.25e-152) {
tmp = 0.011111111111111112 * ((angle_m * (pow(b, 2.0) * ((double) M_PI))) - (a * (a * (angle_m * ((double) M_PI)))));
} else {
tmp = (angle_m * 0.011111111111111112) * ((b - 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 (angle_m <= 1.25e-152) {
tmp = 0.011111111111111112 * ((angle_m * (Math.pow(b, 2.0) * Math.PI)) - (a * (a * (angle_m * Math.PI))));
} else {
tmp = (angle_m * 0.011111111111111112) * ((b - 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 angle_m <= 1.25e-152: tmp = 0.011111111111111112 * ((angle_m * (math.pow(b, 2.0) * math.pi)) - (a * (a * (angle_m * math.pi)))) else: tmp = (angle_m * 0.011111111111111112) * ((b - 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 (angle_m <= 1.25e-152) tmp = Float64(0.011111111111111112 * Float64(Float64(angle_m * Float64((b ^ 2.0) * pi)) - Float64(a * Float64(a * Float64(angle_m * pi))))); else tmp = Float64(Float64(angle_m * 0.011111111111111112) * Float64(Float64(b - a) * Float64(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 (angle_m <= 1.25e-152) tmp = 0.011111111111111112 * ((angle_m * ((b ^ 2.0) * pi)) - (a * (a * (angle_m * pi)))); else tmp = (angle_m * 0.011111111111111112) * ((b - 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[angle$95$m, 1.25e-152], N[(0.011111111111111112 * N[(N[(angle$95$m * N[(N[Power[b, 2.0], $MachinePrecision] * Pi), $MachinePrecision]), $MachinePrecision] - N[(a * N[(a * N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(angle$95$m * 0.011111111111111112), $MachinePrecision] * N[(N[(b - a), $MachinePrecision] * N[(Pi * N[(b + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;angle\_m \leq 1.25 \cdot 10^{-152}:\\
\;\;\;\;0.011111111111111112 \cdot \left(angle\_m \cdot \left({b}^{2} \cdot \pi\right) - a \cdot \left(a \cdot \left(angle\_m \cdot \pi\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(angle\_m \cdot 0.011111111111111112\right) \cdot \left(\left(b - a\right) \cdot \left(\pi \cdot \left(b + a\right)\right)\right)\\
\end{array}
\end{array}
if angle < 1.2499999999999999e-152Initial program 48.4%
associate-*l*48.4%
*-commutative48.4%
associate-*l*48.4%
Simplified48.4%
Taylor expanded in angle around 0 48.5%
unpow248.4%
unpow248.4%
difference-of-squares50.5%
Applied egg-rr50.0%
Taylor expanded in a around 0 49.6%
+-commutative49.6%
*-commutative49.6%
+-commutative49.6%
associate-*r*49.6%
fma-define49.6%
distribute-rgt1-in49.6%
metadata-eval49.6%
mul0-lft49.6%
mul-1-neg49.6%
fma-neg49.6%
mul0-rgt49.6%
neg-sub049.6%
mul-1-neg49.6%
Simplified49.6%
if 1.2499999999999999e-152 < angle Initial program 57.8%
associate-*l*57.8%
*-commutative57.8%
associate-*l*57.8%
Simplified57.8%
Taylor expanded in angle around 0 49.7%
unpow257.8%
unpow257.8%
difference-of-squares60.8%
Applied egg-rr53.7%
Taylor expanded in angle around 0 53.7%
associate-*r*53.8%
+-commutative53.8%
*-commutative53.8%
Simplified53.8%
Taylor expanded in angle around 0 53.7%
associate-*r*53.8%
*-commutative53.8%
associate-*r*53.8%
+-commutative53.8%
Simplified53.8%
Final simplification51.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 (* angle_m (* PI 0.011111111111111112)))) (* angle_s (+ (* (* b (- b a)) t_0) (* t_0 (* 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 t_0 = angle_m * (((double) M_PI) * 0.011111111111111112);
return angle_s * (((b * (b - a)) * t_0) + (t_0 * (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) {
double t_0 = angle_m * (Math.PI * 0.011111111111111112);
return angle_s * (((b * (b - a)) * t_0) + (t_0 * (a * (b - a))));
}
angle\_m = math.fabs(angle) angle\_s = math.copysign(1.0, angle) def code(angle_s, a, b, angle_m): t_0 = angle_m * (math.pi * 0.011111111111111112) return angle_s * (((b * (b - a)) * t_0) + (t_0 * (a * (b - a))))
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.011111111111111112)) return Float64(angle_s * Float64(Float64(Float64(b * Float64(b - a)) * t_0) + Float64(t_0 * Float64(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) t_0 = angle_m * (pi * 0.011111111111111112); tmp = angle_s * (((b * (b - a)) * t_0) + (t_0 * (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_] := Block[{t$95$0 = N[(angle$95$m * N[(Pi * 0.011111111111111112), $MachinePrecision]), $MachinePrecision]}, N[(angle$95$s * N[(N[(N[(b * N[(b - a), $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision] + N[(t$95$0 * N[(a * N[(b - a), $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.011111111111111112\right)\\
angle\_s \cdot \left(\left(b \cdot \left(b - a\right)\right) \cdot t\_0 + t\_0 \cdot \left(a \cdot \left(b - a\right)\right)\right)
\end{array}
\end{array}
Initial program 52.1%
associate-*l*52.1%
*-commutative52.1%
associate-*l*52.1%
Simplified52.1%
Taylor expanded in angle around 0 49.0%
unpow252.1%
unpow252.1%
difference-of-squares54.6%
Applied egg-rr51.5%
Taylor expanded in angle around 0 51.5%
associate-*r*51.5%
+-commutative51.5%
*-commutative51.5%
Simplified51.5%
associate-*r*51.5%
distribute-lft-in47.5%
distribute-rgt-in45.1%
*-commutative45.1%
*-commutative45.1%
associate-*l*45.2%
*-commutative45.2%
*-commutative45.2%
associate-*l*45.2%
Applied egg-rr45.2%
Final simplification45.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 (* (* angle_m 0.011111111111111112) (* (- b 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) {
return angle_s * ((angle_m * 0.011111111111111112) * ((b - a) * (((double) M_PI) * (b + a))));
}
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b, double angle_m) {
return angle_s * ((angle_m * 0.011111111111111112) * ((b - a) * (Math.PI * (b + a))));
}
angle\_m = math.fabs(angle) angle\_s = math.copysign(1.0, angle) def code(angle_s, a, b, angle_m): return angle_s * ((angle_m * 0.011111111111111112) * ((b - a) * (math.pi * (b + a))))
angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a, b, angle_m) return Float64(angle_s * Float64(Float64(angle_m * 0.011111111111111112) * Float64(Float64(b - a) * Float64(pi * Float64(b + a))))) end
angle\_m = abs(angle); angle\_s = sign(angle) * abs(1.0); function tmp = code(angle_s, a, b, angle_m) tmp = angle_s * ((angle_m * 0.011111111111111112) * ((b - a) * (pi * (b + a)))); end
angle\_m = N[Abs[angle], $MachinePrecision]
angle\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a_, b_, angle$95$m_] := N[(angle$95$s * N[(N[(angle$95$m * 0.011111111111111112), $MachinePrecision] * N[(N[(b - a), $MachinePrecision] * N[(Pi * N[(b + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
angle\_s \cdot \left(\left(angle\_m \cdot 0.011111111111111112\right) \cdot \left(\left(b - a\right) \cdot \left(\pi \cdot \left(b + a\right)\right)\right)\right)
\end{array}
Initial program 52.1%
associate-*l*52.1%
*-commutative52.1%
associate-*l*52.1%
Simplified52.1%
Taylor expanded in angle around 0 49.0%
unpow252.1%
unpow252.1%
difference-of-squares54.6%
Applied egg-rr51.5%
Taylor expanded in angle around 0 51.5%
associate-*r*51.5%
+-commutative51.5%
*-commutative51.5%
Simplified51.5%
Taylor expanded in angle around 0 51.5%
associate-*r*51.5%
*-commutative51.5%
associate-*r*51.5%
+-commutative51.5%
Simplified51.5%
Final simplification51.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 (* (* angle_m 0.011111111111111112) (* PI (* (+ b a) (- b a))))))
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a, double b, double angle_m) {
return angle_s * ((angle_m * 0.011111111111111112) * (((double) M_PI) * ((b + a) * (b - a))));
}
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b, double angle_m) {
return angle_s * ((angle_m * 0.011111111111111112) * (Math.PI * ((b + a) * (b - a))));
}
angle\_m = math.fabs(angle) angle\_s = math.copysign(1.0, angle) def code(angle_s, a, b, angle_m): return angle_s * ((angle_m * 0.011111111111111112) * (math.pi * ((b + a) * (b - a))))
angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a, b, angle_m) return Float64(angle_s * Float64(Float64(angle_m * 0.011111111111111112) * Float64(pi * Float64(Float64(b + a) * Float64(b - a))))) end
angle\_m = abs(angle); angle\_s = sign(angle) * abs(1.0); function tmp = code(angle_s, a, b, angle_m) tmp = angle_s * ((angle_m * 0.011111111111111112) * (pi * ((b + a) * (b - a)))); end
angle\_m = N[Abs[angle], $MachinePrecision]
angle\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a_, b_, angle$95$m_] := N[(angle$95$s * N[(N[(angle$95$m * 0.011111111111111112), $MachinePrecision] * N[(Pi * N[(N[(b + a), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
angle\_s \cdot \left(\left(angle\_m \cdot 0.011111111111111112\right) \cdot \left(\pi \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right)\right)
\end{array}
Initial program 52.1%
associate-*l*52.1%
*-commutative52.1%
associate-*l*52.1%
Simplified52.1%
Taylor expanded in angle around 0 49.0%
unpow252.1%
unpow252.1%
difference-of-squares54.6%
Applied egg-rr51.5%
Taylor expanded in angle around 0 51.5%
associate-*r*51.5%
+-commutative51.5%
*-commutative51.5%
Simplified51.5%
Final simplification51.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 (* 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.1%
associate-*l*52.1%
*-commutative52.1%
associate-*l*52.1%
Simplified52.1%
Taylor expanded in angle around 0 49.0%
unpow252.1%
unpow252.1%
difference-of-squares54.6%
Applied egg-rr51.5%
herbie shell --seed 2024096
(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)))))