
(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 16 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 (* (+ b a) (- b a))))
(*
angle_s
(if (<= (/ angle_m 180.0) 2e+60)
(pow
(*
(cbrt (+ b a))
(cbrt
(*
(- b a)
(sin
(*
(* (cbrt PI) (pow (cbrt PI) 2.0))
(* 2.0 (* angle_m 0.005555555555555556)))))))
3.0)
(if (<= (/ angle_m 180.0) 5e+170)
(* t_0 (* 2.0 (fabs (sin (* angle_m (* PI 0.005555555555555556))))))
(*
t_0
(*
2.0
(*
(sin (* (/ angle_m 180.0) (pow (sqrt PI) 2.0)))
(cos (/ PI (/ 180.0 angle_m)))))))))))angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a, double b, double angle_m) {
double t_0 = (b + a) * (b - a);
double tmp;
if ((angle_m / 180.0) <= 2e+60) {
tmp = pow((cbrt((b + a)) * cbrt(((b - a) * sin(((cbrt(((double) M_PI)) * pow(cbrt(((double) M_PI)), 2.0)) * (2.0 * (angle_m * 0.005555555555555556))))))), 3.0);
} else if ((angle_m / 180.0) <= 5e+170) {
tmp = t_0 * (2.0 * fabs(sin((angle_m * (((double) M_PI) * 0.005555555555555556)))));
} else {
tmp = t_0 * (2.0 * (sin(((angle_m / 180.0) * pow(sqrt(((double) M_PI)), 2.0))) * cos((((double) M_PI) / (180.0 / angle_m)))));
}
return angle_s * tmp;
}
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b, double angle_m) {
double t_0 = (b + a) * (b - a);
double tmp;
if ((angle_m / 180.0) <= 2e+60) {
tmp = Math.pow((Math.cbrt((b + a)) * Math.cbrt(((b - a) * Math.sin(((Math.cbrt(Math.PI) * Math.pow(Math.cbrt(Math.PI), 2.0)) * (2.0 * (angle_m * 0.005555555555555556))))))), 3.0);
} else if ((angle_m / 180.0) <= 5e+170) {
tmp = t_0 * (2.0 * Math.abs(Math.sin((angle_m * (Math.PI * 0.005555555555555556)))));
} else {
tmp = t_0 * (2.0 * (Math.sin(((angle_m / 180.0) * Math.pow(Math.sqrt(Math.PI), 2.0))) * Math.cos((Math.PI / (180.0 / angle_m)))));
}
return angle_s * tmp;
}
angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a, b, angle_m) t_0 = Float64(Float64(b + a) * Float64(b - a)) tmp = 0.0 if (Float64(angle_m / 180.0) <= 2e+60) tmp = Float64(cbrt(Float64(b + a)) * cbrt(Float64(Float64(b - a) * sin(Float64(Float64(cbrt(pi) * (cbrt(pi) ^ 2.0)) * Float64(2.0 * Float64(angle_m * 0.005555555555555556))))))) ^ 3.0; elseif (Float64(angle_m / 180.0) <= 5e+170) tmp = Float64(t_0 * Float64(2.0 * abs(sin(Float64(angle_m * Float64(pi * 0.005555555555555556)))))); else tmp = Float64(t_0 * Float64(2.0 * Float64(sin(Float64(Float64(angle_m / 180.0) * (sqrt(pi) ^ 2.0))) * cos(Float64(pi / Float64(180.0 / angle_m)))))); end return Float64(angle_s * tmp) end
angle\_m = N[Abs[angle], $MachinePrecision]
angle\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a_, b_, angle$95$m_] := Block[{t$95$0 = N[(N[(b + a), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision]}, N[(angle$95$s * If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 2e+60], N[Power[N[(N[Power[N[(b + a), $MachinePrecision], 1/3], $MachinePrecision] * N[Power[N[(N[(b - a), $MachinePrecision] * N[Sin[N[(N[(N[Power[Pi, 1/3], $MachinePrecision] * N[Power[N[Power[Pi, 1/3], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[(2.0 * N[(angle$95$m * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision], 3.0], $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 5e+170], N[(t$95$0 * N[(2.0 * N[Abs[N[Sin[N[(angle$95$m * N[(Pi * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$0 * N[(2.0 * N[(N[Sin[N[(N[(angle$95$m / 180.0), $MachinePrecision] * N[Power[N[Sqrt[Pi], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(Pi / N[(180.0 / angle$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]]
\begin{array}{l}
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
\begin{array}{l}
t_0 := \left(b + a\right) \cdot \left(b - a\right)\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;\frac{angle\_m}{180} \leq 2 \cdot 10^{+60}:\\
\;\;\;\;{\left(\sqrt[3]{b + a} \cdot \sqrt[3]{\left(b - a\right) \cdot \sin \left(\left(\sqrt[3]{\pi} \cdot {\left(\sqrt[3]{\pi}\right)}^{2}\right) \cdot \left(2 \cdot \left(angle\_m \cdot 0.005555555555555556\right)\right)\right)}\right)}^{3}\\
\mathbf{elif}\;\frac{angle\_m}{180} \leq 5 \cdot 10^{+170}:\\
\;\;\;\;t\_0 \cdot \left(2 \cdot \left|\sin \left(angle\_m \cdot \left(\pi \cdot 0.005555555555555556\right)\right)\right|\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0 \cdot \left(2 \cdot \left(\sin \left(\frac{angle\_m}{180} \cdot {\left(\sqrt{\pi}\right)}^{2}\right) \cdot \cos \left(\frac{\pi}{\frac{180}{angle\_m}}\right)\right)\right)\\
\end{array}
\end{array}
\end{array}
if (/.f64 angle #s(literal 180 binary64)) < 1.9999999999999999e60Initial program 56.9%
associate-*l*56.9%
*-commutative56.9%
associate-*l*56.9%
Simplified56.9%
add-cube-cbrt56.6%
pow356.6%
2-sin56.6%
associate-*r*56.6%
div-inv57.8%
metadata-eval57.8%
Applied egg-rr57.8%
unpow257.8%
unpow257.8%
difference-of-squares60.3%
metadata-eval60.3%
div-inv60.1%
associate-*l*60.1%
2-sin60.1%
associate-*l*74.7%
cbrt-prod74.5%
Applied egg-rr74.8%
add-cube-cbrt75.9%
pow275.9%
Applied egg-rr75.9%
if 1.9999999999999999e60 < (/.f64 angle #s(literal 180 binary64)) < 4.99999999999999977e170Initial program 33.3%
associate-*l*33.3%
*-commutative33.3%
associate-*l*33.3%
Simplified33.3%
unpow233.3%
unpow233.3%
difference-of-squares33.3%
Applied egg-rr33.3%
Taylor expanded in angle around 0 47.1%
*-commutative47.1%
div-inv56.7%
metadata-eval56.7%
*-commutative56.7%
associate-*r*47.2%
expm1-log1p-u31.1%
expm1-undefine31.1%
*-commutative31.1%
Applied egg-rr31.1%
expm1-define31.1%
*-commutative31.1%
associate-*r*31.1%
*-commutative31.1%
Simplified31.1%
expm1-log1p-u31.1%
expm1-log1p-u31.1%
*-rgt-identity31.1%
add-sqr-sqrt26.5%
sqrt-unprod59.9%
pow259.9%
Applied egg-rr60.1%
*-commutative60.1%
*-commutative60.1%
associate-*r*60.1%
unpow260.1%
rem-sqrt-square60.1%
*-commutative60.1%
rem-square-sqrt60.1%
unpow260.1%
associate-*r*60.1%
unpow260.1%
rem-square-sqrt60.1%
Simplified60.1%
if 4.99999999999999977e170 < (/.f64 angle #s(literal 180 binary64)) Initial program 43.5%
associate-*l*43.5%
*-commutative43.5%
associate-*l*43.5%
Simplified43.5%
unpow243.5%
unpow243.5%
difference-of-squares43.5%
Applied egg-rr43.5%
add-sqr-sqrt44.0%
pow244.0%
Applied egg-rr44.0%
clear-num50.1%
un-div-inv50.8%
Applied egg-rr50.8%
Final simplification71.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 (- (pow b 2.0) (pow a 2.0))))
(*
angle_s
(if (<= t_0 -5e-261)
(*
0.011111111111111112
(+
(* a (- (* angle_m (* PI (- b b))) (* a (* angle_m PI))))
(* angle_m (* PI (pow b 2.0)))))
(if (<= t_0 2e+301)
(* (pow b 2.0) (sin (* PI (* angle_m 0.011111111111111112))))
(if (<= t_0 INFINITY)
(+
(* -0.011111111111111112 (* (pow a 2.0) (* angle_m PI)))
(*
b
(+
(* 0.011111111111111112 (* angle_m (* b PI)))
(* 0.011111111111111112 (* angle_m (* PI (- a a)))))))
(* 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) {
double t_0 = pow(b, 2.0) - pow(a, 2.0);
double tmp;
if (t_0 <= -5e-261) {
tmp = 0.011111111111111112 * ((a * ((angle_m * (((double) M_PI) * (b - b))) - (a * (angle_m * ((double) M_PI))))) + (angle_m * (((double) M_PI) * pow(b, 2.0))));
} else if (t_0 <= 2e+301) {
tmp = pow(b, 2.0) * sin((((double) M_PI) * (angle_m * 0.011111111111111112)));
} else if (t_0 <= ((double) INFINITY)) {
tmp = (-0.011111111111111112 * (pow(a, 2.0) * (angle_m * ((double) M_PI)))) + (b * ((0.011111111111111112 * (angle_m * (b * ((double) M_PI)))) + (0.011111111111111112 * (angle_m * (((double) M_PI) * (a - a))))));
} else {
tmp = 0.011111111111111112 * (angle_m * (((double) M_PI) * ((b + 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 = Math.pow(b, 2.0) - Math.pow(a, 2.0);
double tmp;
if (t_0 <= -5e-261) {
tmp = 0.011111111111111112 * ((a * ((angle_m * (Math.PI * (b - b))) - (a * (angle_m * Math.PI)))) + (angle_m * (Math.PI * Math.pow(b, 2.0))));
} else if (t_0 <= 2e+301) {
tmp = Math.pow(b, 2.0) * Math.sin((Math.PI * (angle_m * 0.011111111111111112)));
} else if (t_0 <= Double.POSITIVE_INFINITY) {
tmp = (-0.011111111111111112 * (Math.pow(a, 2.0) * (angle_m * Math.PI))) + (b * ((0.011111111111111112 * (angle_m * (b * Math.PI))) + (0.011111111111111112 * (angle_m * (Math.PI * (a - a))))));
} else {
tmp = 0.011111111111111112 * (angle_m * (Math.PI * ((b + 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 = math.pow(b, 2.0) - math.pow(a, 2.0) tmp = 0 if t_0 <= -5e-261: tmp = 0.011111111111111112 * ((a * ((angle_m * (math.pi * (b - b))) - (a * (angle_m * math.pi)))) + (angle_m * (math.pi * math.pow(b, 2.0)))) elif t_0 <= 2e+301: tmp = math.pow(b, 2.0) * math.sin((math.pi * (angle_m * 0.011111111111111112))) elif t_0 <= math.inf: tmp = (-0.011111111111111112 * (math.pow(a, 2.0) * (angle_m * math.pi))) + (b * ((0.011111111111111112 * (angle_m * (b * math.pi))) + (0.011111111111111112 * (angle_m * (math.pi * (a - a)))))) else: tmp = 0.011111111111111112 * (angle_m * (math.pi * ((b + 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((b ^ 2.0) - (a ^ 2.0)) tmp = 0.0 if (t_0 <= -5e-261) tmp = Float64(0.011111111111111112 * Float64(Float64(a * Float64(Float64(angle_m * Float64(pi * Float64(b - b))) - Float64(a * Float64(angle_m * pi)))) + Float64(angle_m * Float64(pi * (b ^ 2.0))))); elseif (t_0 <= 2e+301) tmp = Float64((b ^ 2.0) * sin(Float64(pi * Float64(angle_m * 0.011111111111111112)))); elseif (t_0 <= Inf) tmp = Float64(Float64(-0.011111111111111112 * Float64((a ^ 2.0) * Float64(angle_m * pi))) + Float64(b * Float64(Float64(0.011111111111111112 * Float64(angle_m * Float64(b * pi))) + Float64(0.011111111111111112 * Float64(angle_m * Float64(pi * Float64(a - a))))))); else tmp = Float64(0.011111111111111112 * Float64(angle_m * Float64(pi * Float64(Float64(b + 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 = (b ^ 2.0) - (a ^ 2.0); tmp = 0.0; if (t_0 <= -5e-261) tmp = 0.011111111111111112 * ((a * ((angle_m * (pi * (b - b))) - (a * (angle_m * pi)))) + (angle_m * (pi * (b ^ 2.0)))); elseif (t_0 <= 2e+301) tmp = (b ^ 2.0) * sin((pi * (angle_m * 0.011111111111111112))); elseif (t_0 <= Inf) tmp = (-0.011111111111111112 * ((a ^ 2.0) * (angle_m * pi))) + (b * ((0.011111111111111112 * (angle_m * (b * pi))) + (0.011111111111111112 * (angle_m * (pi * (a - a)))))); else tmp = 0.011111111111111112 * (angle_m * (pi * ((b + 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[(N[Power[b, 2.0], $MachinePrecision] - N[Power[a, 2.0], $MachinePrecision]), $MachinePrecision]}, N[(angle$95$s * If[LessEqual[t$95$0, -5e-261], N[(0.011111111111111112 * N[(N[(a * N[(N[(angle$95$m * N[(Pi * N[(b - b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(a * N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(angle$95$m * N[(Pi * N[Power[b, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 2e+301], N[(N[Power[b, 2.0], $MachinePrecision] * N[Sin[N[(Pi * N[(angle$95$m * 0.011111111111111112), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, Infinity], N[(N[(-0.011111111111111112 * N[(N[Power[a, 2.0], $MachinePrecision] * N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision]), $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], 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)
\\
\begin{array}{l}
t_0 := {b}^{2} - {a}^{2}\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_0 \leq -5 \cdot 10^{-261}:\\
\;\;\;\;0.011111111111111112 \cdot \left(a \cdot \left(angle\_m \cdot \left(\pi \cdot \left(b - b\right)\right) - a \cdot \left(angle\_m \cdot \pi\right)\right) + angle\_m \cdot \left(\pi \cdot {b}^{2}\right)\right)\\
\mathbf{elif}\;t\_0 \leq 2 \cdot 10^{+301}:\\
\;\;\;\;{b}^{2} \cdot \sin \left(\pi \cdot \left(angle\_m \cdot 0.011111111111111112\right)\right)\\
\mathbf{elif}\;t\_0 \leq \infty:\\
\;\;\;\;-0.011111111111111112 \cdot \left({a}^{2} \cdot \left(angle\_m \cdot \pi\right)\right) + 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{else}:\\
\;\;\;\;0.011111111111111112 \cdot \left(angle\_m \cdot \left(\pi \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right)\right)\\
\end{array}
\end{array}
\end{array}
if (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) < -4.99999999999999981e-261Initial program 53.3%
associate-*l*53.3%
*-commutative53.3%
associate-*l*53.3%
Simplified53.3%
unpow253.3%
unpow253.3%
difference-of-squares53.3%
Applied egg-rr53.3%
Taylor expanded in angle around 0 50.2%
Taylor expanded in angle around 0 53.4%
Taylor expanded in a around 0 63.9%
if -4.99999999999999981e-261 < (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) < 2.00000000000000011e301Initial program 65.2%
associate-*l*65.2%
*-commutative65.2%
associate-*l*65.2%
Simplified65.2%
Taylor expanded in b around inf 65.9%
*-commutative65.9%
associate-*r*65.9%
*-commutative65.9%
*-commutative65.9%
Simplified65.9%
pow165.9%
2-sin65.9%
count-265.9%
distribute-rgt-out65.9%
*-commutative65.9%
metadata-eval65.9%
Applied egg-rr65.9%
unpow165.9%
*-commutative65.9%
associate-*l*65.7%
Simplified65.7%
if 2.00000000000000011e301 < (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) < +inf.0Initial program 41.3%
associate-*l*41.3%
*-commutative41.3%
associate-*l*41.3%
Simplified41.3%
unpow241.3%
unpow241.3%
difference-of-squares41.3%
Applied egg-rr41.3%
Taylor expanded in angle around 0 35.6%
Taylor expanded in angle around 0 58.2%
Taylor expanded in b around 0 75.3%
if +inf.0 < (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) Initial program 0.0%
associate-*l*0.0%
*-commutative0.0%
associate-*l*0.0%
Simplified0.0%
unpow20.0%
unpow20.0%
difference-of-squares77.8%
Applied egg-rr77.8%
Taylor expanded in angle around 0 77.8%
Taylor expanded in angle around 0 88.9%
Final simplification67.8%
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a b angle_m)
:precision binary64
(let* ((t_0 (* (+ b a) (- b a)))
(t_1 (- (pow b 2.0) (pow a 2.0)))
(t_2 (* 0.005555555555555556 (* angle_m PI))))
(*
angle_s
(if (<= t_1 (- INFINITY))
(*
0.011111111111111112
(+
(* a (- (* angle_m (* PI (- b b))) (* a (* angle_m PI))))
(* angle_m (* PI (pow b 2.0)))))
(if (<= t_1 2e+301)
(* 2.0 (* (* t_0 (sin t_2)) (cos t_2)))
(if (<= t_1 INFINITY)
(+
(* -0.011111111111111112 (* (pow a 2.0) (* angle_m PI)))
(*
b
(+
(* 0.011111111111111112 (* angle_m (* b PI)))
(* 0.011111111111111112 (* angle_m (* PI (- a a)))))))
(* 0.011111111111111112 (* angle_m (* PI t_0)))))))))angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a, double b, double angle_m) {
double t_0 = (b + a) * (b - a);
double t_1 = pow(b, 2.0) - pow(a, 2.0);
double t_2 = 0.005555555555555556 * (angle_m * ((double) M_PI));
double tmp;
if (t_1 <= -((double) INFINITY)) {
tmp = 0.011111111111111112 * ((a * ((angle_m * (((double) M_PI) * (b - b))) - (a * (angle_m * ((double) M_PI))))) + (angle_m * (((double) M_PI) * pow(b, 2.0))));
} else if (t_1 <= 2e+301) {
tmp = 2.0 * ((t_0 * sin(t_2)) * cos(t_2));
} else if (t_1 <= ((double) INFINITY)) {
tmp = (-0.011111111111111112 * (pow(a, 2.0) * (angle_m * ((double) M_PI)))) + (b * ((0.011111111111111112 * (angle_m * (b * ((double) M_PI)))) + (0.011111111111111112 * (angle_m * (((double) M_PI) * (a - a))))));
} else {
tmp = 0.011111111111111112 * (angle_m * (((double) M_PI) * t_0));
}
return angle_s * tmp;
}
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b, double angle_m) {
double t_0 = (b + a) * (b - a);
double t_1 = Math.pow(b, 2.0) - Math.pow(a, 2.0);
double t_2 = 0.005555555555555556 * (angle_m * Math.PI);
double tmp;
if (t_1 <= -Double.POSITIVE_INFINITY) {
tmp = 0.011111111111111112 * ((a * ((angle_m * (Math.PI * (b - b))) - (a * (angle_m * Math.PI)))) + (angle_m * (Math.PI * Math.pow(b, 2.0))));
} else if (t_1 <= 2e+301) {
tmp = 2.0 * ((t_0 * Math.sin(t_2)) * Math.cos(t_2));
} else if (t_1 <= Double.POSITIVE_INFINITY) {
tmp = (-0.011111111111111112 * (Math.pow(a, 2.0) * (angle_m * Math.PI))) + (b * ((0.011111111111111112 * (angle_m * (b * Math.PI))) + (0.011111111111111112 * (angle_m * (Math.PI * (a - a))))));
} else {
tmp = 0.011111111111111112 * (angle_m * (Math.PI * t_0));
}
return angle_s * tmp;
}
angle\_m = math.fabs(angle) angle\_s = math.copysign(1.0, angle) def code(angle_s, a, b, angle_m): t_0 = (b + a) * (b - a) t_1 = math.pow(b, 2.0) - math.pow(a, 2.0) t_2 = 0.005555555555555556 * (angle_m * math.pi) tmp = 0 if t_1 <= -math.inf: tmp = 0.011111111111111112 * ((a * ((angle_m * (math.pi * (b - b))) - (a * (angle_m * math.pi)))) + (angle_m * (math.pi * math.pow(b, 2.0)))) elif t_1 <= 2e+301: tmp = 2.0 * ((t_0 * math.sin(t_2)) * math.cos(t_2)) elif t_1 <= math.inf: tmp = (-0.011111111111111112 * (math.pow(a, 2.0) * (angle_m * math.pi))) + (b * ((0.011111111111111112 * (angle_m * (b * math.pi))) + (0.011111111111111112 * (angle_m * (math.pi * (a - a)))))) else: tmp = 0.011111111111111112 * (angle_m * (math.pi * t_0)) return angle_s * tmp
angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a, b, angle_m) t_0 = Float64(Float64(b + a) * Float64(b - a)) t_1 = Float64((b ^ 2.0) - (a ^ 2.0)) t_2 = Float64(0.005555555555555556 * Float64(angle_m * pi)) tmp = 0.0 if (t_1 <= Float64(-Inf)) tmp = Float64(0.011111111111111112 * Float64(Float64(a * Float64(Float64(angle_m * Float64(pi * Float64(b - b))) - Float64(a * Float64(angle_m * pi)))) + Float64(angle_m * Float64(pi * (b ^ 2.0))))); elseif (t_1 <= 2e+301) tmp = Float64(2.0 * Float64(Float64(t_0 * sin(t_2)) * cos(t_2))); elseif (t_1 <= Inf) tmp = Float64(Float64(-0.011111111111111112 * Float64((a ^ 2.0) * Float64(angle_m * pi))) + Float64(b * Float64(Float64(0.011111111111111112 * Float64(angle_m * Float64(b * pi))) + Float64(0.011111111111111112 * Float64(angle_m * Float64(pi * Float64(a - a))))))); else tmp = Float64(0.011111111111111112 * Float64(angle_m * Float64(pi * t_0))); end return Float64(angle_s * tmp) end
angle\_m = abs(angle); angle\_s = sign(angle) * abs(1.0); function tmp_2 = code(angle_s, a, b, angle_m) t_0 = (b + a) * (b - a); t_1 = (b ^ 2.0) - (a ^ 2.0); t_2 = 0.005555555555555556 * (angle_m * pi); tmp = 0.0; if (t_1 <= -Inf) tmp = 0.011111111111111112 * ((a * ((angle_m * (pi * (b - b))) - (a * (angle_m * pi)))) + (angle_m * (pi * (b ^ 2.0)))); elseif (t_1 <= 2e+301) tmp = 2.0 * ((t_0 * sin(t_2)) * cos(t_2)); elseif (t_1 <= Inf) tmp = (-0.011111111111111112 * ((a ^ 2.0) * (angle_m * pi))) + (b * ((0.011111111111111112 * (angle_m * (b * pi))) + (0.011111111111111112 * (angle_m * (pi * (a - a)))))); else tmp = 0.011111111111111112 * (angle_m * (pi * t_0)); end tmp_2 = angle_s * tmp; end
angle\_m = N[Abs[angle], $MachinePrecision]
angle\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a_, b_, angle$95$m_] := Block[{t$95$0 = N[(N[(b + a), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[Power[b, 2.0], $MachinePrecision] - N[Power[a, 2.0], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(0.005555555555555556 * N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision]}, N[(angle$95$s * If[LessEqual[t$95$1, (-Infinity)], N[(0.011111111111111112 * N[(N[(a * N[(N[(angle$95$m * N[(Pi * N[(b - b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(a * N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(angle$95$m * N[(Pi * N[Power[b, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 2e+301], N[(2.0 * N[(N[(t$95$0 * N[Sin[t$95$2], $MachinePrecision]), $MachinePrecision] * N[Cos[t$95$2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, Infinity], N[(N[(-0.011111111111111112 * N[(N[Power[a, 2.0], $MachinePrecision] * N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision]), $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], N[(0.011111111111111112 * N[(angle$95$m * N[(Pi * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]), $MachinePrecision]]]]
\begin{array}{l}
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
\begin{array}{l}
t_0 := \left(b + a\right) \cdot \left(b - a\right)\\
t_1 := {b}^{2} - {a}^{2}\\
t_2 := 0.005555555555555556 \cdot \left(angle\_m \cdot \pi\right)\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_1 \leq -\infty:\\
\;\;\;\;0.011111111111111112 \cdot \left(a \cdot \left(angle\_m \cdot \left(\pi \cdot \left(b - b\right)\right) - a \cdot \left(angle\_m \cdot \pi\right)\right) + angle\_m \cdot \left(\pi \cdot {b}^{2}\right)\right)\\
\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+301}:\\
\;\;\;\;2 \cdot \left(\left(t\_0 \cdot \sin t\_2\right) \cdot \cos t\_2\right)\\
\mathbf{elif}\;t\_1 \leq \infty:\\
\;\;\;\;-0.011111111111111112 \cdot \left({a}^{2} \cdot \left(angle\_m \cdot \pi\right)\right) + 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{else}:\\
\;\;\;\;0.011111111111111112 \cdot \left(angle\_m \cdot \left(\pi \cdot t\_0\right)\right)\\
\end{array}
\end{array}
\end{array}
if (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) < -inf.0Initial program 47.0%
associate-*l*47.0%
*-commutative47.0%
associate-*l*47.0%
Simplified47.0%
unpow247.0%
unpow247.0%
difference-of-squares47.0%
Applied egg-rr47.0%
Taylor expanded in angle around 0 43.9%
Taylor expanded in angle around 0 50.1%
Taylor expanded in a around 0 67.1%
if -inf.0 < (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) < 2.00000000000000011e301Initial program 64.7%
associate-*l*64.7%
*-commutative64.7%
associate-*l*64.7%
Simplified64.7%
unpow264.7%
unpow264.7%
difference-of-squares64.7%
Applied egg-rr64.7%
Taylor expanded in angle around inf 65.2%
*-commutative65.2%
Simplified65.2%
if 2.00000000000000011e301 < (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) < +inf.0Initial program 41.3%
associate-*l*41.3%
*-commutative41.3%
associate-*l*41.3%
Simplified41.3%
unpow241.3%
unpow241.3%
difference-of-squares41.3%
Applied egg-rr41.3%
Taylor expanded in angle around 0 35.6%
Taylor expanded in angle around 0 58.2%
Taylor expanded in b around 0 75.3%
if +inf.0 < (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) Initial program 0.0%
associate-*l*0.0%
*-commutative0.0%
associate-*l*0.0%
Simplified0.0%
unpow20.0%
unpow20.0%
difference-of-squares77.8%
Applied egg-rr77.8%
Taylor expanded in angle around 0 77.8%
Taylor expanded in angle around 0 88.9%
Final simplification68.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 (- (pow b 2.0) (pow a 2.0))))
(*
angle_s
(if (<= t_0 (- INFINITY))
(*
0.011111111111111112
(+
(* a (- (* angle_m (* PI (- b b))) (* a (* angle_m PI))))
(* angle_m (* PI (pow b 2.0)))))
(if (<= t_0 2e+301)
(* t_0 (sin (* 0.011111111111111112 (* angle_m PI))))
(if (<= t_0 INFINITY)
(+
(* -0.011111111111111112 (* (pow a 2.0) (* angle_m PI)))
(*
b
(+
(* 0.011111111111111112 (* angle_m (* b PI)))
(* 0.011111111111111112 (* angle_m (* PI (- a a)))))))
(* 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) {
double t_0 = pow(b, 2.0) - pow(a, 2.0);
double tmp;
if (t_0 <= -((double) INFINITY)) {
tmp = 0.011111111111111112 * ((a * ((angle_m * (((double) M_PI) * (b - b))) - (a * (angle_m * ((double) M_PI))))) + (angle_m * (((double) M_PI) * pow(b, 2.0))));
} else if (t_0 <= 2e+301) {
tmp = t_0 * sin((0.011111111111111112 * (angle_m * ((double) M_PI))));
} else if (t_0 <= ((double) INFINITY)) {
tmp = (-0.011111111111111112 * (pow(a, 2.0) * (angle_m * ((double) M_PI)))) + (b * ((0.011111111111111112 * (angle_m * (b * ((double) M_PI)))) + (0.011111111111111112 * (angle_m * (((double) M_PI) * (a - a))))));
} else {
tmp = 0.011111111111111112 * (angle_m * (((double) M_PI) * ((b + 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 = Math.pow(b, 2.0) - Math.pow(a, 2.0);
double tmp;
if (t_0 <= -Double.POSITIVE_INFINITY) {
tmp = 0.011111111111111112 * ((a * ((angle_m * (Math.PI * (b - b))) - (a * (angle_m * Math.PI)))) + (angle_m * (Math.PI * Math.pow(b, 2.0))));
} else if (t_0 <= 2e+301) {
tmp = t_0 * Math.sin((0.011111111111111112 * (angle_m * Math.PI)));
} else if (t_0 <= Double.POSITIVE_INFINITY) {
tmp = (-0.011111111111111112 * (Math.pow(a, 2.0) * (angle_m * Math.PI))) + (b * ((0.011111111111111112 * (angle_m * (b * Math.PI))) + (0.011111111111111112 * (angle_m * (Math.PI * (a - a))))));
} else {
tmp = 0.011111111111111112 * (angle_m * (Math.PI * ((b + 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 = math.pow(b, 2.0) - math.pow(a, 2.0) tmp = 0 if t_0 <= -math.inf: tmp = 0.011111111111111112 * ((a * ((angle_m * (math.pi * (b - b))) - (a * (angle_m * math.pi)))) + (angle_m * (math.pi * math.pow(b, 2.0)))) elif t_0 <= 2e+301: tmp = t_0 * math.sin((0.011111111111111112 * (angle_m * math.pi))) elif t_0 <= math.inf: tmp = (-0.011111111111111112 * (math.pow(a, 2.0) * (angle_m * math.pi))) + (b * ((0.011111111111111112 * (angle_m * (b * math.pi))) + (0.011111111111111112 * (angle_m * (math.pi * (a - a)))))) else: tmp = 0.011111111111111112 * (angle_m * (math.pi * ((b + 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((b ^ 2.0) - (a ^ 2.0)) tmp = 0.0 if (t_0 <= Float64(-Inf)) tmp = Float64(0.011111111111111112 * Float64(Float64(a * Float64(Float64(angle_m * Float64(pi * Float64(b - b))) - Float64(a * Float64(angle_m * pi)))) + Float64(angle_m * Float64(pi * (b ^ 2.0))))); elseif (t_0 <= 2e+301) tmp = Float64(t_0 * sin(Float64(0.011111111111111112 * Float64(angle_m * pi)))); elseif (t_0 <= Inf) tmp = Float64(Float64(-0.011111111111111112 * Float64((a ^ 2.0) * Float64(angle_m * pi))) + Float64(b * Float64(Float64(0.011111111111111112 * Float64(angle_m * Float64(b * pi))) + Float64(0.011111111111111112 * Float64(angle_m * Float64(pi * Float64(a - a))))))); else tmp = Float64(0.011111111111111112 * Float64(angle_m * Float64(pi * Float64(Float64(b + 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 = (b ^ 2.0) - (a ^ 2.0); tmp = 0.0; if (t_0 <= -Inf) tmp = 0.011111111111111112 * ((a * ((angle_m * (pi * (b - b))) - (a * (angle_m * pi)))) + (angle_m * (pi * (b ^ 2.0)))); elseif (t_0 <= 2e+301) tmp = t_0 * sin((0.011111111111111112 * (angle_m * pi))); elseif (t_0 <= Inf) tmp = (-0.011111111111111112 * ((a ^ 2.0) * (angle_m * pi))) + (b * ((0.011111111111111112 * (angle_m * (b * pi))) + (0.011111111111111112 * (angle_m * (pi * (a - a)))))); else tmp = 0.011111111111111112 * (angle_m * (pi * ((b + 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[(N[Power[b, 2.0], $MachinePrecision] - N[Power[a, 2.0], $MachinePrecision]), $MachinePrecision]}, N[(angle$95$s * If[LessEqual[t$95$0, (-Infinity)], N[(0.011111111111111112 * N[(N[(a * N[(N[(angle$95$m * N[(Pi * N[(b - b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(a * N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(angle$95$m * N[(Pi * N[Power[b, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 2e+301], N[(t$95$0 * N[Sin[N[(0.011111111111111112 * N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, Infinity], N[(N[(-0.011111111111111112 * N[(N[Power[a, 2.0], $MachinePrecision] * N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision]), $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], 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)
\\
\begin{array}{l}
t_0 := {b}^{2} - {a}^{2}\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_0 \leq -\infty:\\
\;\;\;\;0.011111111111111112 \cdot \left(a \cdot \left(angle\_m \cdot \left(\pi \cdot \left(b - b\right)\right) - a \cdot \left(angle\_m \cdot \pi\right)\right) + angle\_m \cdot \left(\pi \cdot {b}^{2}\right)\right)\\
\mathbf{elif}\;t\_0 \leq 2 \cdot 10^{+301}:\\
\;\;\;\;t\_0 \cdot \sin \left(0.011111111111111112 \cdot \left(angle\_m \cdot \pi\right)\right)\\
\mathbf{elif}\;t\_0 \leq \infty:\\
\;\;\;\;-0.011111111111111112 \cdot \left({a}^{2} \cdot \left(angle\_m \cdot \pi\right)\right) + 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{else}:\\
\;\;\;\;0.011111111111111112 \cdot \left(angle\_m \cdot \left(\pi \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right)\right)\\
\end{array}
\end{array}
\end{array}
if (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) < -inf.0Initial program 47.0%
associate-*l*47.0%
*-commutative47.0%
associate-*l*47.0%
Simplified47.0%
unpow247.0%
unpow247.0%
difference-of-squares47.0%
Applied egg-rr47.0%
Taylor expanded in angle around 0 43.9%
Taylor expanded in angle around 0 50.1%
Taylor expanded in a around 0 67.1%
if -inf.0 < (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) < 2.00000000000000011e301Initial program 64.7%
associate-*l*64.7%
*-commutative64.7%
associate-*l*64.7%
Simplified64.7%
*-commutative64.7%
sub-neg64.7%
distribute-lft-in64.7%
2-sin64.7%
associate-*r*64.7%
div-inv65.1%
metadata-eval65.1%
Applied egg-rr65.2%
distribute-lft-out65.2%
sub-neg65.2%
*-commutative65.2%
associate-*l*65.2%
*-commutative65.2%
*-commutative65.2%
associate-*r*65.3%
associate-*r*65.3%
metadata-eval65.3%
Simplified65.3%
if 2.00000000000000011e301 < (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) < +inf.0Initial program 41.3%
associate-*l*41.3%
*-commutative41.3%
associate-*l*41.3%
Simplified41.3%
unpow241.3%
unpow241.3%
difference-of-squares41.3%
Applied egg-rr41.3%
Taylor expanded in angle around 0 35.6%
Taylor expanded in angle around 0 58.2%
Taylor expanded in b around 0 75.3%
if +inf.0 < (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) Initial program 0.0%
associate-*l*0.0%
*-commutative0.0%
associate-*l*0.0%
Simplified0.0%
unpow20.0%
unpow20.0%
difference-of-squares77.8%
Applied egg-rr77.8%
Taylor expanded in angle around 0 77.8%
Taylor expanded in angle around 0 88.9%
Final simplification68.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 (- (pow b 2.0) (pow a 2.0)))
(t_1 (* 0.011111111111111112 (* angle_m PI))))
(*
angle_s
(if (or (<= t_0 (- INFINITY)) (not (<= t_0 2e+301)))
(pow (* (cbrt (+ b a)) (cbrt (* (- b a) t_1))) 3.0)
(* t_0 (sin t_1))))))angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a, double b, double angle_m) {
double t_0 = pow(b, 2.0) - pow(a, 2.0);
double t_1 = 0.011111111111111112 * (angle_m * ((double) M_PI));
double tmp;
if ((t_0 <= -((double) INFINITY)) || !(t_0 <= 2e+301)) {
tmp = pow((cbrt((b + a)) * cbrt(((b - a) * t_1))), 3.0);
} else {
tmp = t_0 * sin(t_1);
}
return angle_s * tmp;
}
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b, double angle_m) {
double t_0 = Math.pow(b, 2.0) - Math.pow(a, 2.0);
double t_1 = 0.011111111111111112 * (angle_m * Math.PI);
double tmp;
if ((t_0 <= -Double.POSITIVE_INFINITY) || !(t_0 <= 2e+301)) {
tmp = Math.pow((Math.cbrt((b + a)) * Math.cbrt(((b - a) * t_1))), 3.0);
} else {
tmp = t_0 * Math.sin(t_1);
}
return angle_s * tmp;
}
angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a, b, angle_m) t_0 = Float64((b ^ 2.0) - (a ^ 2.0)) t_1 = Float64(0.011111111111111112 * Float64(angle_m * pi)) tmp = 0.0 if ((t_0 <= Float64(-Inf)) || !(t_0 <= 2e+301)) tmp = Float64(cbrt(Float64(b + a)) * cbrt(Float64(Float64(b - a) * t_1))) ^ 3.0; else tmp = Float64(t_0 * sin(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[(0.011111111111111112 * N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision]}, N[(angle$95$s * If[Or[LessEqual[t$95$0, (-Infinity)], N[Not[LessEqual[t$95$0, 2e+301]], $MachinePrecision]], N[Power[N[(N[Power[N[(b + a), $MachinePrecision], 1/3], $MachinePrecision] * N[Power[N[(N[(b - a), $MachinePrecision] * t$95$1), $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision], 3.0], $MachinePrecision], N[(t$95$0 * N[Sin[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 := 0.011111111111111112 \cdot \left(angle\_m \cdot \pi\right)\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_0 \leq -\infty \lor \neg \left(t\_0 \leq 2 \cdot 10^{+301}\right):\\
\;\;\;\;{\left(\sqrt[3]{b + a} \cdot \sqrt[3]{\left(b - a\right) \cdot t\_1}\right)}^{3}\\
\mathbf{else}:\\
\;\;\;\;t\_0 \cdot \sin t\_1\\
\end{array}
\end{array}
\end{array}
if (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) < -inf.0 or 2.00000000000000011e301 < (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) Initial program 41.2%
associate-*l*41.2%
*-commutative41.2%
associate-*l*41.2%
Simplified41.2%
add-cube-cbrt41.2%
pow341.2%
2-sin41.2%
associate-*r*41.2%
div-inv43.6%
metadata-eval43.6%
Applied egg-rr43.6%
unpow243.6%
unpow243.6%
difference-of-squares47.6%
metadata-eval47.6%
div-inv46.8%
associate-*l*46.8%
2-sin46.8%
associate-*l*70.1%
cbrt-prod70.0%
Applied egg-rr70.8%
Taylor expanded in angle around 0 79.5%
if -inf.0 < (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) < 2.00000000000000011e301Initial program 64.7%
associate-*l*64.7%
*-commutative64.7%
associate-*l*64.7%
Simplified64.7%
*-commutative64.7%
sub-neg64.7%
distribute-lft-in64.7%
2-sin64.7%
associate-*r*64.7%
div-inv65.1%
metadata-eval65.1%
Applied egg-rr65.2%
distribute-lft-out65.2%
sub-neg65.2%
*-commutative65.2%
associate-*l*65.2%
*-commutative65.2%
*-commutative65.2%
associate-*r*65.3%
associate-*r*65.3%
metadata-eval65.3%
Simplified65.3%
Final simplification72.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 (- (pow b 2.0) (pow a 2.0))))
(*
angle_s
(if (or (<= t_0 (- INFINITY)) (not (<= t_0 2e+301)))
(pow
(*
(cbrt (+ b a))
(cbrt (* (- b a) (* PI (* angle_m 0.011111111111111112)))))
3.0)
(* t_0 (sin (* 0.011111111111111112 (* angle_m 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 = pow(b, 2.0) - pow(a, 2.0);
double tmp;
if ((t_0 <= -((double) INFINITY)) || !(t_0 <= 2e+301)) {
tmp = pow((cbrt((b + a)) * cbrt(((b - a) * (((double) M_PI) * (angle_m * 0.011111111111111112))))), 3.0);
} else {
tmp = t_0 * sin((0.011111111111111112 * (angle_m * ((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.pow(b, 2.0) - Math.pow(a, 2.0);
double tmp;
if ((t_0 <= -Double.POSITIVE_INFINITY) || !(t_0 <= 2e+301)) {
tmp = Math.pow((Math.cbrt((b + a)) * Math.cbrt(((b - a) * (Math.PI * (angle_m * 0.011111111111111112))))), 3.0);
} else {
tmp = t_0 * Math.sin((0.011111111111111112 * (angle_m * 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 = Float64((b ^ 2.0) - (a ^ 2.0)) tmp = 0.0 if ((t_0 <= Float64(-Inf)) || !(t_0 <= 2e+301)) tmp = Float64(cbrt(Float64(b + a)) * cbrt(Float64(Float64(b - a) * Float64(pi * Float64(angle_m * 0.011111111111111112))))) ^ 3.0; else tmp = Float64(t_0 * sin(Float64(0.011111111111111112 * Float64(angle_m * 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[(N[Power[b, 2.0], $MachinePrecision] - N[Power[a, 2.0], $MachinePrecision]), $MachinePrecision]}, N[(angle$95$s * If[Or[LessEqual[t$95$0, (-Infinity)], N[Not[LessEqual[t$95$0, 2e+301]], $MachinePrecision]], N[Power[N[(N[Power[N[(b + a), $MachinePrecision], 1/3], $MachinePrecision] * N[Power[N[(N[(b - a), $MachinePrecision] * N[(Pi * N[(angle$95$m * 0.011111111111111112), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision], 3.0], $MachinePrecision], N[(t$95$0 * N[Sin[N[(0.011111111111111112 * N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]]
\begin{array}{l}
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
\begin{array}{l}
t_0 := {b}^{2} - {a}^{2}\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_0 \leq -\infty \lor \neg \left(t\_0 \leq 2 \cdot 10^{+301}\right):\\
\;\;\;\;{\left(\sqrt[3]{b + a} \cdot \sqrt[3]{\left(b - a\right) \cdot \left(\pi \cdot \left(angle\_m \cdot 0.011111111111111112\right)\right)}\right)}^{3}\\
\mathbf{else}:\\
\;\;\;\;t\_0 \cdot \sin \left(0.011111111111111112 \cdot \left(angle\_m \cdot \pi\right)\right)\\
\end{array}
\end{array}
\end{array}
if (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) < -inf.0 or 2.00000000000000011e301 < (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) Initial program 41.2%
associate-*l*41.2%
*-commutative41.2%
associate-*l*41.2%
Simplified41.2%
add-cube-cbrt41.2%
pow341.2%
2-sin41.2%
associate-*r*41.2%
div-inv43.6%
metadata-eval43.6%
Applied egg-rr43.6%
unpow243.6%
unpow243.6%
difference-of-squares47.6%
metadata-eval47.6%
div-inv46.8%
associate-*l*46.8%
2-sin46.8%
associate-*l*70.1%
cbrt-prod70.0%
Applied egg-rr70.8%
Taylor expanded in angle around 0 79.5%
*-commutative79.5%
*-commutative79.5%
associate-*l*79.5%
Simplified79.5%
if -inf.0 < (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) < 2.00000000000000011e301Initial program 64.7%
associate-*l*64.7%
*-commutative64.7%
associate-*l*64.7%
Simplified64.7%
*-commutative64.7%
sub-neg64.7%
distribute-lft-in64.7%
2-sin64.7%
associate-*r*64.7%
div-inv65.1%
metadata-eval65.1%
Applied egg-rr65.2%
distribute-lft-out65.2%
sub-neg65.2%
*-commutative65.2%
associate-*l*65.2%
*-commutative65.2%
*-commutative65.2%
associate-*r*65.3%
associate-*r*65.3%
metadata-eval65.3%
Simplified65.3%
Final simplification72.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 (cbrt (+ b a))))
(*
angle_s
(if (<= (- (pow b 2.0) (pow a 2.0)) 2e+301)
(pow
(*
t_0
(cbrt
(* (- b a) (sin (* PI (* 2.0 (* angle_m 0.005555555555555556)))))))
3.0)
(pow
(* t_0 (cbrt (* (- b a) (* PI (* angle_m 0.011111111111111112)))))
3.0)))))angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a, double b, double angle_m) {
double t_0 = cbrt((b + a));
double tmp;
if ((pow(b, 2.0) - pow(a, 2.0)) <= 2e+301) {
tmp = pow((t_0 * cbrt(((b - a) * sin((((double) M_PI) * (2.0 * (angle_m * 0.005555555555555556))))))), 3.0);
} else {
tmp = pow((t_0 * cbrt(((b - a) * (((double) M_PI) * (angle_m * 0.011111111111111112))))), 3.0);
}
return angle_s * tmp;
}
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b, double angle_m) {
double t_0 = Math.cbrt((b + a));
double tmp;
if ((Math.pow(b, 2.0) - Math.pow(a, 2.0)) <= 2e+301) {
tmp = Math.pow((t_0 * Math.cbrt(((b - a) * Math.sin((Math.PI * (2.0 * (angle_m * 0.005555555555555556))))))), 3.0);
} else {
tmp = Math.pow((t_0 * Math.cbrt(((b - a) * (Math.PI * (angle_m * 0.011111111111111112))))), 3.0);
}
return angle_s * tmp;
}
angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a, b, angle_m) t_0 = cbrt(Float64(b + a)) tmp = 0.0 if (Float64((b ^ 2.0) - (a ^ 2.0)) <= 2e+301) tmp = Float64(t_0 * cbrt(Float64(Float64(b - a) * sin(Float64(pi * Float64(2.0 * Float64(angle_m * 0.005555555555555556))))))) ^ 3.0; else tmp = Float64(t_0 * cbrt(Float64(Float64(b - a) * Float64(pi * Float64(angle_m * 0.011111111111111112))))) ^ 3.0; end return Float64(angle_s * tmp) end
angle\_m = N[Abs[angle], $MachinePrecision]
angle\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a_, b_, angle$95$m_] := Block[{t$95$0 = N[Power[N[(b + a), $MachinePrecision], 1/3], $MachinePrecision]}, N[(angle$95$s * If[LessEqual[N[(N[Power[b, 2.0], $MachinePrecision] - N[Power[a, 2.0], $MachinePrecision]), $MachinePrecision], 2e+301], N[Power[N[(t$95$0 * N[Power[N[(N[(b - a), $MachinePrecision] * N[Sin[N[(Pi * N[(2.0 * N[(angle$95$m * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision], 3.0], $MachinePrecision], N[Power[N[(t$95$0 * N[Power[N[(N[(b - a), $MachinePrecision] * N[(Pi * N[(angle$95$m * 0.011111111111111112), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision], 3.0], $MachinePrecision]]), $MachinePrecision]]
\begin{array}{l}
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
\begin{array}{l}
t_0 := \sqrt[3]{b + a}\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;{b}^{2} - {a}^{2} \leq 2 \cdot 10^{+301}:\\
\;\;\;\;{\left(t\_0 \cdot \sqrt[3]{\left(b - a\right) \cdot \sin \left(\pi \cdot \left(2 \cdot \left(angle\_m \cdot 0.005555555555555556\right)\right)\right)}\right)}^{3}\\
\mathbf{else}:\\
\;\;\;\;{\left(t\_0 \cdot \sqrt[3]{\left(b - a\right) \cdot \left(\pi \cdot \left(angle\_m \cdot 0.011111111111111112\right)\right)}\right)}^{3}\\
\end{array}
\end{array}
\end{array}
if (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) < 2.00000000000000011e301Initial program 58.8%
associate-*l*58.8%
*-commutative58.8%
associate-*l*58.8%
Simplified58.8%
add-cube-cbrt58.5%
pow358.5%
2-sin58.5%
associate-*r*58.5%
div-inv59.4%
metadata-eval59.4%
Applied egg-rr59.4%
unpow259.4%
unpow259.4%
difference-of-squares59.4%
metadata-eval59.4%
div-inv58.5%
associate-*l*58.5%
2-sin58.5%
associate-*l*66.5%
cbrt-prod66.4%
Applied egg-rr67.3%
if 2.00000000000000011e301 < (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) Initial program 35.3%
associate-*l*35.3%
*-commutative35.3%
associate-*l*35.3%
Simplified35.3%
add-cube-cbrt35.3%
pow335.3%
2-sin35.3%
associate-*r*35.3%
div-inv38.5%
metadata-eval38.5%
Applied egg-rr38.5%
unpow238.5%
unpow238.5%
difference-of-squares46.6%
metadata-eval46.6%
div-inv46.6%
associate-*l*46.6%
2-sin46.6%
associate-*l*68.9%
cbrt-prod68.7%
Applied egg-rr68.7%
Taylor expanded in angle around 0 84.8%
*-commutative84.8%
*-commutative84.8%
associate-*l*84.9%
Simplified84.9%
Final simplification71.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 (* (+ b a) (- b a))))
(*
angle_s
(if (<= (/ angle_m 180.0) 4e+18)
(pow
(*
(cbrt (+ b a))
(cbrt
(* (- b a) (sin (* PI (* 2.0 (* angle_m 0.005555555555555556)))))))
3.0)
(if (<= (/ angle_m 180.0) 5e+170)
(* t_0 (* 2.0 (fabs (sin (* angle_m (* PI 0.005555555555555556))))))
(*
t_0
(*
2.0
(*
(sin (* (/ angle_m 180.0) (pow (sqrt PI) 2.0)))
(cos (/ PI (/ 180.0 angle_m)))))))))))angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a, double b, double angle_m) {
double t_0 = (b + a) * (b - a);
double tmp;
if ((angle_m / 180.0) <= 4e+18) {
tmp = pow((cbrt((b + a)) * cbrt(((b - a) * sin((((double) M_PI) * (2.0 * (angle_m * 0.005555555555555556))))))), 3.0);
} else if ((angle_m / 180.0) <= 5e+170) {
tmp = t_0 * (2.0 * fabs(sin((angle_m * (((double) M_PI) * 0.005555555555555556)))));
} else {
tmp = t_0 * (2.0 * (sin(((angle_m / 180.0) * pow(sqrt(((double) M_PI)), 2.0))) * cos((((double) M_PI) / (180.0 / angle_m)))));
}
return angle_s * tmp;
}
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b, double angle_m) {
double t_0 = (b + a) * (b - a);
double tmp;
if ((angle_m / 180.0) <= 4e+18) {
tmp = Math.pow((Math.cbrt((b + a)) * Math.cbrt(((b - a) * Math.sin((Math.PI * (2.0 * (angle_m * 0.005555555555555556))))))), 3.0);
} else if ((angle_m / 180.0) <= 5e+170) {
tmp = t_0 * (2.0 * Math.abs(Math.sin((angle_m * (Math.PI * 0.005555555555555556)))));
} else {
tmp = t_0 * (2.0 * (Math.sin(((angle_m / 180.0) * Math.pow(Math.sqrt(Math.PI), 2.0))) * Math.cos((Math.PI / (180.0 / angle_m)))));
}
return angle_s * tmp;
}
angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a, b, angle_m) t_0 = Float64(Float64(b + a) * Float64(b - a)) tmp = 0.0 if (Float64(angle_m / 180.0) <= 4e+18) tmp = Float64(cbrt(Float64(b + a)) * cbrt(Float64(Float64(b - a) * sin(Float64(pi * Float64(2.0 * Float64(angle_m * 0.005555555555555556))))))) ^ 3.0; elseif (Float64(angle_m / 180.0) <= 5e+170) tmp = Float64(t_0 * Float64(2.0 * abs(sin(Float64(angle_m * Float64(pi * 0.005555555555555556)))))); else tmp = Float64(t_0 * Float64(2.0 * Float64(sin(Float64(Float64(angle_m / 180.0) * (sqrt(pi) ^ 2.0))) * cos(Float64(pi / Float64(180.0 / angle_m)))))); end return Float64(angle_s * tmp) end
angle\_m = N[Abs[angle], $MachinePrecision]
angle\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a_, b_, angle$95$m_] := Block[{t$95$0 = N[(N[(b + a), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision]}, N[(angle$95$s * If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 4e+18], N[Power[N[(N[Power[N[(b + a), $MachinePrecision], 1/3], $MachinePrecision] * N[Power[N[(N[(b - a), $MachinePrecision] * N[Sin[N[(Pi * N[(2.0 * N[(angle$95$m * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision], 3.0], $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 5e+170], N[(t$95$0 * N[(2.0 * N[Abs[N[Sin[N[(angle$95$m * N[(Pi * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$0 * N[(2.0 * N[(N[Sin[N[(N[(angle$95$m / 180.0), $MachinePrecision] * N[Power[N[Sqrt[Pi], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(Pi / N[(180.0 / angle$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]]
\begin{array}{l}
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
\begin{array}{l}
t_0 := \left(b + a\right) \cdot \left(b - a\right)\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;\frac{angle\_m}{180} \leq 4 \cdot 10^{+18}:\\
\;\;\;\;{\left(\sqrt[3]{b + a} \cdot \sqrt[3]{\left(b - a\right) \cdot \sin \left(\pi \cdot \left(2 \cdot \left(angle\_m \cdot 0.005555555555555556\right)\right)\right)}\right)}^{3}\\
\mathbf{elif}\;\frac{angle\_m}{180} \leq 5 \cdot 10^{+170}:\\
\;\;\;\;t\_0 \cdot \left(2 \cdot \left|\sin \left(angle\_m \cdot \left(\pi \cdot 0.005555555555555556\right)\right)\right|\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0 \cdot \left(2 \cdot \left(\sin \left(\frac{angle\_m}{180} \cdot {\left(\sqrt{\pi}\right)}^{2}\right) \cdot \cos \left(\frac{\pi}{\frac{180}{angle\_m}}\right)\right)\right)\\
\end{array}
\end{array}
\end{array}
if (/.f64 angle #s(literal 180 binary64)) < 4e18Initial program 58.4%
associate-*l*58.4%
*-commutative58.4%
associate-*l*58.4%
Simplified58.4%
add-cube-cbrt58.0%
pow358.0%
2-sin58.0%
associate-*r*58.0%
div-inv59.3%
metadata-eval59.3%
Applied egg-rr59.3%
unpow259.3%
unpow259.3%
difference-of-squares62.0%
metadata-eval62.0%
div-inv61.7%
associate-*l*61.7%
2-sin61.7%
associate-*l*77.1%
cbrt-prod76.9%
Applied egg-rr77.1%
if 4e18 < (/.f64 angle #s(literal 180 binary64)) < 4.99999999999999977e170Initial program 32.1%
associate-*l*32.1%
*-commutative32.1%
associate-*l*32.1%
Simplified32.1%
unpow232.1%
unpow232.1%
difference-of-squares32.1%
Applied egg-rr32.1%
Taylor expanded in angle around 0 44.1%
*-commutative44.1%
div-inv47.7%
metadata-eval47.7%
*-commutative47.7%
associate-*r*43.7%
expm1-log1p-u26.1%
expm1-undefine26.1%
*-commutative26.1%
Applied egg-rr26.1%
expm1-define26.1%
*-commutative26.1%
associate-*r*26.1%
*-commutative26.1%
Simplified26.1%
expm1-log1p-u26.1%
expm1-log1p-u26.1%
*-rgt-identity26.1%
add-sqr-sqrt18.6%
sqrt-unprod48.0%
pow248.0%
Applied egg-rr48.1%
*-commutative48.1%
*-commutative48.1%
associate-*r*48.1%
unpow248.1%
rem-sqrt-square48.1%
*-commutative48.1%
rem-square-sqrt48.1%
unpow248.1%
associate-*r*48.1%
unpow248.1%
rem-square-sqrt48.1%
Simplified48.1%
if 4.99999999999999977e170 < (/.f64 angle #s(literal 180 binary64)) Initial program 43.5%
associate-*l*43.5%
*-commutative43.5%
associate-*l*43.5%
Simplified43.5%
unpow243.5%
unpow243.5%
difference-of-squares43.5%
Applied egg-rr43.5%
add-sqr-sqrt44.0%
pow244.0%
Applied egg-rr44.0%
clear-num50.1%
un-div-inv50.8%
Applied egg-rr50.8%
Final simplification70.1%
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a b angle_m)
:precision binary64
(let* ((t_0 (* (+ b a) (- b a))))
(*
angle_s
(if (<= (/ angle_m 180.0) 2e-105)
(*
0.011111111111111112
(- (* b (* angle_m (* b PI))) (* PI (* angle_m (pow a 2.0)))))
(if (<= (/ angle_m 180.0) 5e+170)
(* t_0 (* 2.0 (* angle_m (* PI 0.005555555555555556))))
(if (<= (/ angle_m 180.0) 1e+226)
(* t_0 (* 2.0 (sin (/ PI (/ 180.0 angle_m)))))
(*
(* 0.011111111111111112 (* angle_m (* PI t_0)))
(cos (* (/ angle_m 180.0) PI)))))))))angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a, double b, double angle_m) {
double t_0 = (b + a) * (b - a);
double tmp;
if ((angle_m / 180.0) <= 2e-105) {
tmp = 0.011111111111111112 * ((b * (angle_m * (b * ((double) M_PI)))) - (((double) M_PI) * (angle_m * pow(a, 2.0))));
} else if ((angle_m / 180.0) <= 5e+170) {
tmp = t_0 * (2.0 * (angle_m * (((double) M_PI) * 0.005555555555555556)));
} else if ((angle_m / 180.0) <= 1e+226) {
tmp = t_0 * (2.0 * sin((((double) M_PI) / (180.0 / angle_m))));
} else {
tmp = (0.011111111111111112 * (angle_m * (((double) M_PI) * t_0))) * cos(((angle_m / 180.0) * ((double) M_PI)));
}
return angle_s * tmp;
}
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b, double angle_m) {
double t_0 = (b + a) * (b - a);
double tmp;
if ((angle_m / 180.0) <= 2e-105) {
tmp = 0.011111111111111112 * ((b * (angle_m * (b * Math.PI))) - (Math.PI * (angle_m * Math.pow(a, 2.0))));
} else if ((angle_m / 180.0) <= 5e+170) {
tmp = t_0 * (2.0 * (angle_m * (Math.PI * 0.005555555555555556)));
} else if ((angle_m / 180.0) <= 1e+226) {
tmp = t_0 * (2.0 * Math.sin((Math.PI / (180.0 / angle_m))));
} else {
tmp = (0.011111111111111112 * (angle_m * (Math.PI * t_0))) * Math.cos(((angle_m / 180.0) * Math.PI));
}
return angle_s * tmp;
}
angle\_m = math.fabs(angle) angle\_s = math.copysign(1.0, angle) def code(angle_s, a, b, angle_m): t_0 = (b + a) * (b - a) tmp = 0 if (angle_m / 180.0) <= 2e-105: tmp = 0.011111111111111112 * ((b * (angle_m * (b * math.pi))) - (math.pi * (angle_m * math.pow(a, 2.0)))) elif (angle_m / 180.0) <= 5e+170: tmp = t_0 * (2.0 * (angle_m * (math.pi * 0.005555555555555556))) elif (angle_m / 180.0) <= 1e+226: tmp = t_0 * (2.0 * math.sin((math.pi / (180.0 / angle_m)))) else: tmp = (0.011111111111111112 * (angle_m * (math.pi * t_0))) * math.cos(((angle_m / 180.0) * math.pi)) return angle_s * tmp
angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a, b, angle_m) t_0 = Float64(Float64(b + a) * Float64(b - a)) tmp = 0.0 if (Float64(angle_m / 180.0) <= 2e-105) tmp = Float64(0.011111111111111112 * Float64(Float64(b * Float64(angle_m * Float64(b * pi))) - Float64(pi * Float64(angle_m * (a ^ 2.0))))); elseif (Float64(angle_m / 180.0) <= 5e+170) tmp = Float64(t_0 * Float64(2.0 * Float64(angle_m * Float64(pi * 0.005555555555555556)))); elseif (Float64(angle_m / 180.0) <= 1e+226) tmp = Float64(t_0 * Float64(2.0 * sin(Float64(pi / Float64(180.0 / angle_m))))); else tmp = Float64(Float64(0.011111111111111112 * Float64(angle_m * Float64(pi * t_0))) * cos(Float64(Float64(angle_m / 180.0) * pi))); end return Float64(angle_s * tmp) end
angle\_m = abs(angle); angle\_s = sign(angle) * abs(1.0); function tmp_2 = code(angle_s, a, b, angle_m) t_0 = (b + a) * (b - a); tmp = 0.0; if ((angle_m / 180.0) <= 2e-105) tmp = 0.011111111111111112 * ((b * (angle_m * (b * pi))) - (pi * (angle_m * (a ^ 2.0)))); elseif ((angle_m / 180.0) <= 5e+170) tmp = t_0 * (2.0 * (angle_m * (pi * 0.005555555555555556))); elseif ((angle_m / 180.0) <= 1e+226) tmp = t_0 * (2.0 * sin((pi / (180.0 / angle_m)))); else tmp = (0.011111111111111112 * (angle_m * (pi * t_0))) * cos(((angle_m / 180.0) * pi)); end tmp_2 = angle_s * tmp; end
angle\_m = N[Abs[angle], $MachinePrecision]
angle\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a_, b_, angle$95$m_] := Block[{t$95$0 = N[(N[(b + a), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision]}, N[(angle$95$s * If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 2e-105], N[(0.011111111111111112 * N[(N[(b * N[(angle$95$m * N[(b * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(Pi * N[(angle$95$m * N[Power[a, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 5e+170], N[(t$95$0 * N[(2.0 * N[(angle$95$m * N[(Pi * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 1e+226], N[(t$95$0 * N[(2.0 * N[Sin[N[(Pi / N[(180.0 / angle$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(0.011111111111111112 * N[(angle$95$m * N[(Pi * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Cos[N[(N[(angle$95$m / 180.0), $MachinePrecision] * Pi), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]), $MachinePrecision]]
\begin{array}{l}
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
\begin{array}{l}
t_0 := \left(b + a\right) \cdot \left(b - a\right)\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;\frac{angle\_m}{180} \leq 2 \cdot 10^{-105}:\\
\;\;\;\;0.011111111111111112 \cdot \left(b \cdot \left(angle\_m \cdot \left(b \cdot \pi\right)\right) - \pi \cdot \left(angle\_m \cdot {a}^{2}\right)\right)\\
\mathbf{elif}\;\frac{angle\_m}{180} \leq 5 \cdot 10^{+170}:\\
\;\;\;\;t\_0 \cdot \left(2 \cdot \left(angle\_m \cdot \left(\pi \cdot 0.005555555555555556\right)\right)\right)\\
\mathbf{elif}\;\frac{angle\_m}{180} \leq 10^{+226}:\\
\;\;\;\;t\_0 \cdot \left(2 \cdot \sin \left(\frac{\pi}{\frac{180}{angle\_m}}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(0.011111111111111112 \cdot \left(angle\_m \cdot \left(\pi \cdot t\_0\right)\right)\right) \cdot \cos \left(\frac{angle\_m}{180} \cdot \pi\right)\\
\end{array}
\end{array}
\end{array}
if (/.f64 angle #s(literal 180 binary64)) < 1.99999999999999993e-105Initial program 56.6%
associate-*l*56.6%
*-commutative56.6%
associate-*l*56.6%
Simplified56.6%
unpow256.6%
unpow256.6%
difference-of-squares59.5%
Applied egg-rr59.5%
Taylor expanded in angle around 0 57.8%
Taylor expanded in angle around 0 62.6%
Taylor expanded in b around 0 61.7%
+-commutative61.7%
mul-1-neg61.7%
unsub-neg61.7%
distribute-lft-out61.7%
*-commutative61.7%
distribute-rgt1-in61.7%
metadata-eval61.7%
mul0-lft61.7%
sin-061.7%
distribute-rgt-out61.7%
sin-061.7%
Simplified61.6%
if 1.99999999999999993e-105 < (/.f64 angle #s(literal 180 binary64)) < 4.99999999999999977e170Initial program 47.1%
associate-*l*47.1%
*-commutative47.1%
associate-*l*47.1%
Simplified47.1%
unpow247.1%
unpow247.1%
difference-of-squares51.1%
Applied egg-rr51.1%
Taylor expanded in angle around 0 53.9%
*-commutative53.9%
div-inv56.3%
metadata-eval56.3%
*-commutative56.3%
associate-*r*53.6%
expm1-log1p-u41.9%
expm1-undefine20.0%
*-commutative20.0%
Applied egg-rr20.0%
expm1-define41.9%
*-commutative41.9%
associate-*r*41.9%
*-commutative41.9%
Simplified41.9%
Taylor expanded in angle around 0 57.3%
*-commutative57.3%
rem-square-sqrt57.3%
unpow257.3%
associate-*r*57.4%
unpow257.4%
rem-square-sqrt57.4%
Simplified57.4%
if 4.99999999999999977e170 < (/.f64 angle #s(literal 180 binary64)) < 9.99999999999999961e225Initial program 39.6%
associate-*l*39.6%
*-commutative39.6%
associate-*l*39.6%
Simplified39.6%
unpow239.6%
unpow239.6%
difference-of-squares39.6%
Applied egg-rr39.6%
Taylor expanded in angle around 0 31.5%
clear-num24.2%
un-div-inv24.4%
Applied egg-rr36.3%
if 9.99999999999999961e225 < (/.f64 angle #s(literal 180 binary64)) Initial program 44.5%
unpow244.5%
unpow244.5%
difference-of-squares44.5%
Applied egg-rr44.5%
Taylor expanded in angle around 0 45.2%
Final simplification58.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 (* (+ b a) (- b a))))
(*
angle_s
(if (<= (/ angle_m 180.0) 2e-105)
(*
0.011111111111111112
(- (* b (* angle_m (* b PI))) (* PI (* angle_m (pow a 2.0)))))
(if (<= (/ angle_m 180.0) 5e+170)
(* t_0 (* 2.0 (* angle_m (* PI 0.005555555555555556))))
(if (<= (/ angle_m 180.0) 1e+226)
(* t_0 (* 2.0 (sin (/ PI (/ 180.0 angle_m)))))
(*
(* 0.011111111111111112 (* t_0 (* angle_m PI)))
(cos (* (/ angle_m 180.0) PI)))))))))angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a, double b, double angle_m) {
double t_0 = (b + a) * (b - a);
double tmp;
if ((angle_m / 180.0) <= 2e-105) {
tmp = 0.011111111111111112 * ((b * (angle_m * (b * ((double) M_PI)))) - (((double) M_PI) * (angle_m * pow(a, 2.0))));
} else if ((angle_m / 180.0) <= 5e+170) {
tmp = t_0 * (2.0 * (angle_m * (((double) M_PI) * 0.005555555555555556)));
} else if ((angle_m / 180.0) <= 1e+226) {
tmp = t_0 * (2.0 * sin((((double) M_PI) / (180.0 / angle_m))));
} else {
tmp = (0.011111111111111112 * (t_0 * (angle_m * ((double) M_PI)))) * cos(((angle_m / 180.0) * ((double) M_PI)));
}
return angle_s * tmp;
}
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b, double angle_m) {
double t_0 = (b + a) * (b - a);
double tmp;
if ((angle_m / 180.0) <= 2e-105) {
tmp = 0.011111111111111112 * ((b * (angle_m * (b * Math.PI))) - (Math.PI * (angle_m * Math.pow(a, 2.0))));
} else if ((angle_m / 180.0) <= 5e+170) {
tmp = t_0 * (2.0 * (angle_m * (Math.PI * 0.005555555555555556)));
} else if ((angle_m / 180.0) <= 1e+226) {
tmp = t_0 * (2.0 * Math.sin((Math.PI / (180.0 / angle_m))));
} else {
tmp = (0.011111111111111112 * (t_0 * (angle_m * Math.PI))) * Math.cos(((angle_m / 180.0) * Math.PI));
}
return angle_s * tmp;
}
angle\_m = math.fabs(angle) angle\_s = math.copysign(1.0, angle) def code(angle_s, a, b, angle_m): t_0 = (b + a) * (b - a) tmp = 0 if (angle_m / 180.0) <= 2e-105: tmp = 0.011111111111111112 * ((b * (angle_m * (b * math.pi))) - (math.pi * (angle_m * math.pow(a, 2.0)))) elif (angle_m / 180.0) <= 5e+170: tmp = t_0 * (2.0 * (angle_m * (math.pi * 0.005555555555555556))) elif (angle_m / 180.0) <= 1e+226: tmp = t_0 * (2.0 * math.sin((math.pi / (180.0 / angle_m)))) else: tmp = (0.011111111111111112 * (t_0 * (angle_m * math.pi))) * math.cos(((angle_m / 180.0) * math.pi)) return angle_s * tmp
angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a, b, angle_m) t_0 = Float64(Float64(b + a) * Float64(b - a)) tmp = 0.0 if (Float64(angle_m / 180.0) <= 2e-105) tmp = Float64(0.011111111111111112 * Float64(Float64(b * Float64(angle_m * Float64(b * pi))) - Float64(pi * Float64(angle_m * (a ^ 2.0))))); elseif (Float64(angle_m / 180.0) <= 5e+170) tmp = Float64(t_0 * Float64(2.0 * Float64(angle_m * Float64(pi * 0.005555555555555556)))); elseif (Float64(angle_m / 180.0) <= 1e+226) tmp = Float64(t_0 * Float64(2.0 * sin(Float64(pi / Float64(180.0 / angle_m))))); else tmp = Float64(Float64(0.011111111111111112 * Float64(t_0 * Float64(angle_m * pi))) * cos(Float64(Float64(angle_m / 180.0) * pi))); end return Float64(angle_s * tmp) end
angle\_m = abs(angle); angle\_s = sign(angle) * abs(1.0); function tmp_2 = code(angle_s, a, b, angle_m) t_0 = (b + a) * (b - a); tmp = 0.0; if ((angle_m / 180.0) <= 2e-105) tmp = 0.011111111111111112 * ((b * (angle_m * (b * pi))) - (pi * (angle_m * (a ^ 2.0)))); elseif ((angle_m / 180.0) <= 5e+170) tmp = t_0 * (2.0 * (angle_m * (pi * 0.005555555555555556))); elseif ((angle_m / 180.0) <= 1e+226) tmp = t_0 * (2.0 * sin((pi / (180.0 / angle_m)))); else tmp = (0.011111111111111112 * (t_0 * (angle_m * pi))) * cos(((angle_m / 180.0) * pi)); end tmp_2 = angle_s * tmp; end
angle\_m = N[Abs[angle], $MachinePrecision]
angle\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a_, b_, angle$95$m_] := Block[{t$95$0 = N[(N[(b + a), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision]}, N[(angle$95$s * If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 2e-105], N[(0.011111111111111112 * N[(N[(b * N[(angle$95$m * N[(b * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(Pi * N[(angle$95$m * N[Power[a, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 5e+170], N[(t$95$0 * N[(2.0 * N[(angle$95$m * N[(Pi * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 1e+226], N[(t$95$0 * N[(2.0 * N[Sin[N[(Pi / N[(180.0 / angle$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(0.011111111111111112 * N[(t$95$0 * N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Cos[N[(N[(angle$95$m / 180.0), $MachinePrecision] * Pi), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]), $MachinePrecision]]
\begin{array}{l}
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
\begin{array}{l}
t_0 := \left(b + a\right) \cdot \left(b - a\right)\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;\frac{angle\_m}{180} \leq 2 \cdot 10^{-105}:\\
\;\;\;\;0.011111111111111112 \cdot \left(b \cdot \left(angle\_m \cdot \left(b \cdot \pi\right)\right) - \pi \cdot \left(angle\_m \cdot {a}^{2}\right)\right)\\
\mathbf{elif}\;\frac{angle\_m}{180} \leq 5 \cdot 10^{+170}:\\
\;\;\;\;t\_0 \cdot \left(2 \cdot \left(angle\_m \cdot \left(\pi \cdot 0.005555555555555556\right)\right)\right)\\
\mathbf{elif}\;\frac{angle\_m}{180} \leq 10^{+226}:\\
\;\;\;\;t\_0 \cdot \left(2 \cdot \sin \left(\frac{\pi}{\frac{180}{angle\_m}}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(0.011111111111111112 \cdot \left(t\_0 \cdot \left(angle\_m \cdot \pi\right)\right)\right) \cdot \cos \left(\frac{angle\_m}{180} \cdot \pi\right)\\
\end{array}
\end{array}
\end{array}
if (/.f64 angle #s(literal 180 binary64)) < 1.99999999999999993e-105Initial program 56.6%
associate-*l*56.6%
*-commutative56.6%
associate-*l*56.6%
Simplified56.6%
unpow256.6%
unpow256.6%
difference-of-squares59.5%
Applied egg-rr59.5%
Taylor expanded in angle around 0 57.8%
Taylor expanded in angle around 0 62.6%
Taylor expanded in b around 0 61.7%
+-commutative61.7%
mul-1-neg61.7%
unsub-neg61.7%
distribute-lft-out61.7%
*-commutative61.7%
distribute-rgt1-in61.7%
metadata-eval61.7%
mul0-lft61.7%
sin-061.7%
distribute-rgt-out61.7%
sin-061.7%
Simplified61.6%
if 1.99999999999999993e-105 < (/.f64 angle #s(literal 180 binary64)) < 4.99999999999999977e170Initial program 47.1%
associate-*l*47.1%
*-commutative47.1%
associate-*l*47.1%
Simplified47.1%
unpow247.1%
unpow247.1%
difference-of-squares51.1%
Applied egg-rr51.1%
Taylor expanded in angle around 0 53.9%
*-commutative53.9%
div-inv56.3%
metadata-eval56.3%
*-commutative56.3%
associate-*r*53.6%
expm1-log1p-u41.9%
expm1-undefine20.0%
*-commutative20.0%
Applied egg-rr20.0%
expm1-define41.9%
*-commutative41.9%
associate-*r*41.9%
*-commutative41.9%
Simplified41.9%
Taylor expanded in angle around 0 57.3%
*-commutative57.3%
rem-square-sqrt57.3%
unpow257.3%
associate-*r*57.4%
unpow257.4%
rem-square-sqrt57.4%
Simplified57.4%
if 4.99999999999999977e170 < (/.f64 angle #s(literal 180 binary64)) < 9.99999999999999961e225Initial program 39.6%
associate-*l*39.6%
*-commutative39.6%
associate-*l*39.6%
Simplified39.6%
unpow239.6%
unpow239.6%
difference-of-squares39.6%
Applied egg-rr39.6%
Taylor expanded in angle around 0 31.5%
clear-num24.2%
un-div-inv24.4%
Applied egg-rr36.3%
if 9.99999999999999961e225 < (/.f64 angle #s(literal 180 binary64)) Initial program 44.5%
Taylor expanded in angle around 0 45.2%
associate-*r*45.2%
Simplified45.2%
unpow244.5%
unpow244.5%
difference-of-squares44.5%
Applied egg-rr45.2%
Final simplification58.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 (* (+ b a) (- b a))))
(*
angle_s
(if (<= (/ angle_m 180.0) 5e-98)
(*
0.011111111111111112
(+
(* a (- (* angle_m (* PI (- b b))) (* a (* angle_m PI))))
(* angle_m (* PI (pow b 2.0)))))
(if (<= (/ angle_m 180.0) 5e+170)
(* t_0 (* 2.0 (* angle_m (* PI 0.005555555555555556))))
(if (<= (/ angle_m 180.0) 1e+226)
(* t_0 (* 2.0 (sin (/ PI (/ 180.0 angle_m)))))
(*
(* 0.011111111111111112 (* t_0 (* angle_m PI)))
(cos (* (/ angle_m 180.0) PI)))))))))angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a, double b, double angle_m) {
double t_0 = (b + a) * (b - a);
double tmp;
if ((angle_m / 180.0) <= 5e-98) {
tmp = 0.011111111111111112 * ((a * ((angle_m * (((double) M_PI) * (b - b))) - (a * (angle_m * ((double) M_PI))))) + (angle_m * (((double) M_PI) * pow(b, 2.0))));
} else if ((angle_m / 180.0) <= 5e+170) {
tmp = t_0 * (2.0 * (angle_m * (((double) M_PI) * 0.005555555555555556)));
} else if ((angle_m / 180.0) <= 1e+226) {
tmp = t_0 * (2.0 * sin((((double) M_PI) / (180.0 / angle_m))));
} else {
tmp = (0.011111111111111112 * (t_0 * (angle_m * ((double) M_PI)))) * cos(((angle_m / 180.0) * ((double) M_PI)));
}
return angle_s * tmp;
}
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b, double angle_m) {
double t_0 = (b + a) * (b - a);
double tmp;
if ((angle_m / 180.0) <= 5e-98) {
tmp = 0.011111111111111112 * ((a * ((angle_m * (Math.PI * (b - b))) - (a * (angle_m * Math.PI)))) + (angle_m * (Math.PI * Math.pow(b, 2.0))));
} else if ((angle_m / 180.0) <= 5e+170) {
tmp = t_0 * (2.0 * (angle_m * (Math.PI * 0.005555555555555556)));
} else if ((angle_m / 180.0) <= 1e+226) {
tmp = t_0 * (2.0 * Math.sin((Math.PI / (180.0 / angle_m))));
} else {
tmp = (0.011111111111111112 * (t_0 * (angle_m * Math.PI))) * Math.cos(((angle_m / 180.0) * Math.PI));
}
return angle_s * tmp;
}
angle\_m = math.fabs(angle) angle\_s = math.copysign(1.0, angle) def code(angle_s, a, b, angle_m): t_0 = (b + a) * (b - a) tmp = 0 if (angle_m / 180.0) <= 5e-98: tmp = 0.011111111111111112 * ((a * ((angle_m * (math.pi * (b - b))) - (a * (angle_m * math.pi)))) + (angle_m * (math.pi * math.pow(b, 2.0)))) elif (angle_m / 180.0) <= 5e+170: tmp = t_0 * (2.0 * (angle_m * (math.pi * 0.005555555555555556))) elif (angle_m / 180.0) <= 1e+226: tmp = t_0 * (2.0 * math.sin((math.pi / (180.0 / angle_m)))) else: tmp = (0.011111111111111112 * (t_0 * (angle_m * math.pi))) * math.cos(((angle_m / 180.0) * math.pi)) return angle_s * tmp
angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a, b, angle_m) t_0 = Float64(Float64(b + a) * Float64(b - a)) tmp = 0.0 if (Float64(angle_m / 180.0) <= 5e-98) tmp = Float64(0.011111111111111112 * Float64(Float64(a * Float64(Float64(angle_m * Float64(pi * Float64(b - b))) - Float64(a * Float64(angle_m * pi)))) + Float64(angle_m * Float64(pi * (b ^ 2.0))))); elseif (Float64(angle_m / 180.0) <= 5e+170) tmp = Float64(t_0 * Float64(2.0 * Float64(angle_m * Float64(pi * 0.005555555555555556)))); elseif (Float64(angle_m / 180.0) <= 1e+226) tmp = Float64(t_0 * Float64(2.0 * sin(Float64(pi / Float64(180.0 / angle_m))))); else tmp = Float64(Float64(0.011111111111111112 * Float64(t_0 * Float64(angle_m * pi))) * cos(Float64(Float64(angle_m / 180.0) * pi))); end return Float64(angle_s * tmp) end
angle\_m = abs(angle); angle\_s = sign(angle) * abs(1.0); function tmp_2 = code(angle_s, a, b, angle_m) t_0 = (b + a) * (b - a); tmp = 0.0; if ((angle_m / 180.0) <= 5e-98) tmp = 0.011111111111111112 * ((a * ((angle_m * (pi * (b - b))) - (a * (angle_m * pi)))) + (angle_m * (pi * (b ^ 2.0)))); elseif ((angle_m / 180.0) <= 5e+170) tmp = t_0 * (2.0 * (angle_m * (pi * 0.005555555555555556))); elseif ((angle_m / 180.0) <= 1e+226) tmp = t_0 * (2.0 * sin((pi / (180.0 / angle_m)))); else tmp = (0.011111111111111112 * (t_0 * (angle_m * pi))) * cos(((angle_m / 180.0) * pi)); end tmp_2 = angle_s * tmp; end
angle\_m = N[Abs[angle], $MachinePrecision]
angle\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a_, b_, angle$95$m_] := Block[{t$95$0 = N[(N[(b + a), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision]}, N[(angle$95$s * If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 5e-98], N[(0.011111111111111112 * N[(N[(a * N[(N[(angle$95$m * N[(Pi * N[(b - b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(a * N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(angle$95$m * N[(Pi * N[Power[b, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 5e+170], N[(t$95$0 * N[(2.0 * N[(angle$95$m * N[(Pi * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 1e+226], N[(t$95$0 * N[(2.0 * N[Sin[N[(Pi / N[(180.0 / angle$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(0.011111111111111112 * N[(t$95$0 * N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Cos[N[(N[(angle$95$m / 180.0), $MachinePrecision] * Pi), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]), $MachinePrecision]]
\begin{array}{l}
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
\begin{array}{l}
t_0 := \left(b + a\right) \cdot \left(b - a\right)\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;\frac{angle\_m}{180} \leq 5 \cdot 10^{-98}:\\
\;\;\;\;0.011111111111111112 \cdot \left(a \cdot \left(angle\_m \cdot \left(\pi \cdot \left(b - b\right)\right) - a \cdot \left(angle\_m \cdot \pi\right)\right) + angle\_m \cdot \left(\pi \cdot {b}^{2}\right)\right)\\
\mathbf{elif}\;\frac{angle\_m}{180} \leq 5 \cdot 10^{+170}:\\
\;\;\;\;t\_0 \cdot \left(2 \cdot \left(angle\_m \cdot \left(\pi \cdot 0.005555555555555556\right)\right)\right)\\
\mathbf{elif}\;\frac{angle\_m}{180} \leq 10^{+226}:\\
\;\;\;\;t\_0 \cdot \left(2 \cdot \sin \left(\frac{\pi}{\frac{180}{angle\_m}}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(0.011111111111111112 \cdot \left(t\_0 \cdot \left(angle\_m \cdot \pi\right)\right)\right) \cdot \cos \left(\frac{angle\_m}{180} \cdot \pi\right)\\
\end{array}
\end{array}
\end{array}
if (/.f64 angle #s(literal 180 binary64)) < 5.00000000000000018e-98Initial program 56.4%
associate-*l*56.4%
*-commutative56.4%
associate-*l*56.4%
Simplified56.4%
unpow256.4%
unpow256.4%
difference-of-squares59.2%
Applied egg-rr59.2%
Taylor expanded in angle around 0 57.6%
Taylor expanded in angle around 0 62.3%
Taylor expanded in a around 0 63.0%
if 5.00000000000000018e-98 < (/.f64 angle #s(literal 180 binary64)) < 4.99999999999999977e170Initial program 47.9%
associate-*l*47.9%
*-commutative47.9%
associate-*l*47.9%
Simplified47.9%
unpow247.9%
unpow247.9%
difference-of-squares51.9%
Applied egg-rr51.9%
Taylor expanded in angle around 0 54.8%
*-commutative54.8%
div-inv57.2%
metadata-eval57.2%
*-commutative57.2%
associate-*r*54.4%
expm1-log1p-u42.6%
expm1-undefine20.4%
*-commutative20.4%
Applied egg-rr20.4%
expm1-define42.6%
*-commutative42.6%
associate-*r*42.6%
*-commutative42.6%
Simplified42.6%
Taylor expanded in angle around 0 58.3%
*-commutative58.3%
rem-square-sqrt58.3%
unpow258.3%
associate-*r*58.3%
unpow258.3%
rem-square-sqrt58.3%
Simplified58.3%
if 4.99999999999999977e170 < (/.f64 angle #s(literal 180 binary64)) < 9.99999999999999961e225Initial program 39.6%
associate-*l*39.6%
*-commutative39.6%
associate-*l*39.6%
Simplified39.6%
unpow239.6%
unpow239.6%
difference-of-squares39.6%
Applied egg-rr39.6%
Taylor expanded in angle around 0 31.5%
clear-num24.2%
un-div-inv24.4%
Applied egg-rr36.3%
if 9.99999999999999961e225 < (/.f64 angle #s(literal 180 binary64)) Initial program 44.5%
Taylor expanded in angle around 0 45.2%
associate-*r*45.2%
Simplified45.2%
unpow244.5%
unpow244.5%
difference-of-squares44.5%
Applied egg-rr45.2%
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
(let* ((t_0 (* (+ b a) (- b a))))
(*
angle_s
(if (<= (/ angle_m 180.0) 2e-105)
(*
0.011111111111111112
(- (* b (* angle_m (* b PI))) (* PI (* angle_m (pow a 2.0)))))
(if (<= (/ angle_m 180.0) 5e+170)
(* t_0 (* 2.0 (* angle_m (* PI 0.005555555555555556))))
(if (<= (/ angle_m 180.0) 1e+226)
(* t_0 (* 2.0 (sin (/ PI (/ 180.0 angle_m)))))
(* 0.011111111111111112 (* t_0 (* angle_m 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 = (b + a) * (b - a);
double tmp;
if ((angle_m / 180.0) <= 2e-105) {
tmp = 0.011111111111111112 * ((b * (angle_m * (b * ((double) M_PI)))) - (((double) M_PI) * (angle_m * pow(a, 2.0))));
} else if ((angle_m / 180.0) <= 5e+170) {
tmp = t_0 * (2.0 * (angle_m * (((double) M_PI) * 0.005555555555555556)));
} else if ((angle_m / 180.0) <= 1e+226) {
tmp = t_0 * (2.0 * sin((((double) M_PI) / (180.0 / angle_m))));
} else {
tmp = 0.011111111111111112 * (t_0 * (angle_m * ((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 = (b + a) * (b - a);
double tmp;
if ((angle_m / 180.0) <= 2e-105) {
tmp = 0.011111111111111112 * ((b * (angle_m * (b * Math.PI))) - (Math.PI * (angle_m * Math.pow(a, 2.0))));
} else if ((angle_m / 180.0) <= 5e+170) {
tmp = t_0 * (2.0 * (angle_m * (Math.PI * 0.005555555555555556)));
} else if ((angle_m / 180.0) <= 1e+226) {
tmp = t_0 * (2.0 * Math.sin((Math.PI / (180.0 / angle_m))));
} else {
tmp = 0.011111111111111112 * (t_0 * (angle_m * 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 = (b + a) * (b - a) tmp = 0 if (angle_m / 180.0) <= 2e-105: tmp = 0.011111111111111112 * ((b * (angle_m * (b * math.pi))) - (math.pi * (angle_m * math.pow(a, 2.0)))) elif (angle_m / 180.0) <= 5e+170: tmp = t_0 * (2.0 * (angle_m * (math.pi * 0.005555555555555556))) elif (angle_m / 180.0) <= 1e+226: tmp = t_0 * (2.0 * math.sin((math.pi / (180.0 / angle_m)))) else: tmp = 0.011111111111111112 * (t_0 * (angle_m * 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 = Float64(Float64(b + a) * Float64(b - a)) tmp = 0.0 if (Float64(angle_m / 180.0) <= 2e-105) tmp = Float64(0.011111111111111112 * Float64(Float64(b * Float64(angle_m * Float64(b * pi))) - Float64(pi * Float64(angle_m * (a ^ 2.0))))); elseif (Float64(angle_m / 180.0) <= 5e+170) tmp = Float64(t_0 * Float64(2.0 * Float64(angle_m * Float64(pi * 0.005555555555555556)))); elseif (Float64(angle_m / 180.0) <= 1e+226) tmp = Float64(t_0 * Float64(2.0 * sin(Float64(pi / Float64(180.0 / angle_m))))); else tmp = Float64(0.011111111111111112 * Float64(t_0 * Float64(angle_m * 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 = (b + a) * (b - a); tmp = 0.0; if ((angle_m / 180.0) <= 2e-105) tmp = 0.011111111111111112 * ((b * (angle_m * (b * pi))) - (pi * (angle_m * (a ^ 2.0)))); elseif ((angle_m / 180.0) <= 5e+170) tmp = t_0 * (2.0 * (angle_m * (pi * 0.005555555555555556))); elseif ((angle_m / 180.0) <= 1e+226) tmp = t_0 * (2.0 * sin((pi / (180.0 / angle_m)))); else tmp = 0.011111111111111112 * (t_0 * (angle_m * 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[(N[(b + a), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision]}, N[(angle$95$s * If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 2e-105], N[(0.011111111111111112 * N[(N[(b * N[(angle$95$m * N[(b * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(Pi * N[(angle$95$m * N[Power[a, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 5e+170], N[(t$95$0 * N[(2.0 * N[(angle$95$m * N[(Pi * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 1e+226], N[(t$95$0 * N[(2.0 * N[Sin[N[(Pi / N[(180.0 / angle$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.011111111111111112 * N[(t$95$0 * N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]), $MachinePrecision]]
\begin{array}{l}
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
\begin{array}{l}
t_0 := \left(b + a\right) \cdot \left(b - a\right)\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;\frac{angle\_m}{180} \leq 2 \cdot 10^{-105}:\\
\;\;\;\;0.011111111111111112 \cdot \left(b \cdot \left(angle\_m \cdot \left(b \cdot \pi\right)\right) - \pi \cdot \left(angle\_m \cdot {a}^{2}\right)\right)\\
\mathbf{elif}\;\frac{angle\_m}{180} \leq 5 \cdot 10^{+170}:\\
\;\;\;\;t\_0 \cdot \left(2 \cdot \left(angle\_m \cdot \left(\pi \cdot 0.005555555555555556\right)\right)\right)\\
\mathbf{elif}\;\frac{angle\_m}{180} \leq 10^{+226}:\\
\;\;\;\;t\_0 \cdot \left(2 \cdot \sin \left(\frac{\pi}{\frac{180}{angle\_m}}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;0.011111111111111112 \cdot \left(t\_0 \cdot \left(angle\_m \cdot \pi\right)\right)\\
\end{array}
\end{array}
\end{array}
if (/.f64 angle #s(literal 180 binary64)) < 1.99999999999999993e-105Initial program 56.6%
associate-*l*56.6%
*-commutative56.6%
associate-*l*56.6%
Simplified56.6%
unpow256.6%
unpow256.6%
difference-of-squares59.5%
Applied egg-rr59.5%
Taylor expanded in angle around 0 57.8%
Taylor expanded in angle around 0 62.6%
Taylor expanded in b around 0 61.7%
+-commutative61.7%
mul-1-neg61.7%
unsub-neg61.7%
distribute-lft-out61.7%
*-commutative61.7%
distribute-rgt1-in61.7%
metadata-eval61.7%
mul0-lft61.7%
sin-061.7%
distribute-rgt-out61.7%
sin-061.7%
Simplified61.6%
if 1.99999999999999993e-105 < (/.f64 angle #s(literal 180 binary64)) < 4.99999999999999977e170Initial program 47.1%
associate-*l*47.1%
*-commutative47.1%
associate-*l*47.1%
Simplified47.1%
unpow247.1%
unpow247.1%
difference-of-squares51.1%
Applied egg-rr51.1%
Taylor expanded in angle around 0 53.9%
*-commutative53.9%
div-inv56.3%
metadata-eval56.3%
*-commutative56.3%
associate-*r*53.6%
expm1-log1p-u41.9%
expm1-undefine20.0%
*-commutative20.0%
Applied egg-rr20.0%
expm1-define41.9%
*-commutative41.9%
associate-*r*41.9%
*-commutative41.9%
Simplified41.9%
Taylor expanded in angle around 0 57.3%
*-commutative57.3%
rem-square-sqrt57.3%
unpow257.3%
associate-*r*57.4%
unpow257.4%
rem-square-sqrt57.4%
Simplified57.4%
if 4.99999999999999977e170 < (/.f64 angle #s(literal 180 binary64)) < 9.99999999999999961e225Initial program 39.6%
associate-*l*39.6%
*-commutative39.6%
associate-*l*39.6%
Simplified39.6%
unpow239.6%
unpow239.6%
difference-of-squares39.6%
Applied egg-rr39.6%
Taylor expanded in angle around 0 31.5%
clear-num24.2%
un-div-inv24.4%
Applied egg-rr36.3%
if 9.99999999999999961e225 < (/.f64 angle #s(literal 180 binary64)) Initial program 44.5%
associate-*l*44.5%
*-commutative44.5%
associate-*l*44.5%
Simplified44.5%
unpow244.5%
unpow244.5%
difference-of-squares44.5%
Applied egg-rr44.5%
Taylor expanded in angle around 0 23.3%
*-commutative23.3%
div-inv19.9%
metadata-eval19.9%
*-commutative19.9%
associate-*r*15.3%
expm1-log1p-u43.3%
expm1-undefine39.3%
*-commutative39.3%
Applied egg-rr39.3%
expm1-define43.3%
*-commutative43.3%
associate-*r*43.3%
*-commutative43.3%
Simplified43.3%
Taylor expanded in angle around 0 41.0%
associate-*r*41.0%
*-commutative41.0%
Simplified41.0%
Final simplification58.1%
angle\_m = (fabs.f64 angle) angle\_s = (copysign.f64 #s(literal 1 binary64) angle) (FPCore (angle_s a b angle_m) :precision binary64 (* angle_s (* (* (+ b a) (- b a)) (* 2.0 (* 0.005555555555555556 (* angle_m PI))))))
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a, double b, double angle_m) {
return angle_s * (((b + a) * (b - a)) * (2.0 * (0.005555555555555556 * (angle_m * ((double) M_PI)))));
}
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b, double angle_m) {
return angle_s * (((b + a) * (b - a)) * (2.0 * (0.005555555555555556 * (angle_m * Math.PI))));
}
angle\_m = math.fabs(angle) angle\_s = math.copysign(1.0, angle) def code(angle_s, a, b, angle_m): return angle_s * (((b + a) * (b - a)) * (2.0 * (0.005555555555555556 * (angle_m * math.pi))))
angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a, b, angle_m) return Float64(angle_s * Float64(Float64(Float64(b + a) * Float64(b - a)) * Float64(2.0 * Float64(0.005555555555555556 * Float64(angle_m * pi))))) end
angle\_m = abs(angle); angle\_s = sign(angle) * abs(1.0); function tmp = code(angle_s, a, b, angle_m) tmp = angle_s * (((b + a) * (b - a)) * (2.0 * (0.005555555555555556 * (angle_m * pi)))); end
angle\_m = N[Abs[angle], $MachinePrecision]
angle\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a_, b_, angle$95$m_] := N[(angle$95$s * N[(N[(N[(b + a), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision] * N[(2.0 * N[(0.005555555555555556 * N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
angle\_s \cdot \left(\left(\left(b + a\right) \cdot \left(b - a\right)\right) \cdot \left(2 \cdot \left(0.005555555555555556 \cdot \left(angle\_m \cdot \pi\right)\right)\right)\right)
\end{array}
Initial program 53.1%
associate-*l*53.1%
*-commutative53.1%
associate-*l*53.1%
Simplified53.1%
unpow253.1%
unpow253.1%
difference-of-squares55.9%
Applied egg-rr55.9%
Taylor expanded in angle around 0 53.0%
Taylor expanded in angle around 0 58.2%
Final simplification58.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 (* (* (+ b a) (- b a)) (* 2.0 (* angle_m (* PI 0.005555555555555556))))))
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 * (((b + a) * (b - a)) * (2.0 * (angle_m * (((double) M_PI) * 0.005555555555555556))));
}
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 * (((b + a) * (b - a)) * (2.0 * (angle_m * (Math.PI * 0.005555555555555556))));
}
angle\_m = math.fabs(angle) angle\_s = math.copysign(1.0, angle) def code(angle_s, a, b, angle_m): return angle_s * (((b + a) * (b - a)) * (2.0 * (angle_m * (math.pi * 0.005555555555555556))))
angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a, b, angle_m) return Float64(angle_s * Float64(Float64(Float64(b + a) * Float64(b - a)) * Float64(2.0 * Float64(angle_m * Float64(pi * 0.005555555555555556))))) end
angle\_m = abs(angle); angle\_s = sign(angle) * abs(1.0); function tmp = code(angle_s, a, b, angle_m) tmp = angle_s * (((b + a) * (b - a)) * (2.0 * (angle_m * (pi * 0.005555555555555556)))); 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[(N[(b + a), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision] * N[(2.0 * N[(angle$95$m * N[(Pi * 0.005555555555555556), $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(\left(b + a\right) \cdot \left(b - a\right)\right) \cdot \left(2 \cdot \left(angle\_m \cdot \left(\pi \cdot 0.005555555555555556\right)\right)\right)\right)
\end{array}
Initial program 53.1%
associate-*l*53.1%
*-commutative53.1%
associate-*l*53.1%
Simplified53.1%
unpow253.1%
unpow253.1%
difference-of-squares55.9%
Applied egg-rr55.9%
Taylor expanded in angle around 0 53.0%
*-commutative53.0%
div-inv52.7%
metadata-eval52.7%
*-commutative52.7%
associate-*r*52.7%
expm1-log1p-u43.1%
expm1-undefine16.2%
*-commutative16.2%
Applied egg-rr16.2%
expm1-define43.1%
*-commutative43.1%
associate-*r*43.1%
*-commutative43.1%
Simplified43.1%
Taylor expanded in angle around 0 58.2%
*-commutative58.2%
rem-square-sqrt58.2%
unpow258.2%
associate-*r*58.2%
unpow258.2%
rem-square-sqrt58.2%
Simplified58.2%
Final simplification58.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 (* 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 53.1%
associate-*l*53.1%
*-commutative53.1%
associate-*l*53.1%
Simplified53.1%
unpow253.1%
unpow253.1%
difference-of-squares55.9%
Applied egg-rr55.9%
Taylor expanded in angle around 0 53.0%
Taylor expanded in angle around 0 58.2%
Final simplification58.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) (* 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 53.1%
associate-*l*53.1%
*-commutative53.1%
associate-*l*53.1%
Simplified53.1%
unpow253.1%
unpow253.1%
difference-of-squares55.9%
Applied egg-rr55.9%
Taylor expanded in angle around 0 53.0%
Taylor expanded in angle around 0 58.2%
associate-*r*58.2%
+-commutative58.2%
*-commutative58.2%
+-commutative58.2%
Simplified58.2%
Final simplification58.2%
herbie shell --seed 2024077
(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)))))