mirror of
https://github.com/vale981/arb
synced 2025-03-06 01:41:39 -05:00
code cleanup
This commit is contained in:
parent
eb4d77d9c9
commit
89270e5d7a
1 changed files with 4 additions and 14 deletions
|
@ -404,19 +404,10 @@ _arb_sin_cos(arb_t zsin, arb_t zcos, const arf_t x, const mag_t xrad, slong prec
|
||||||
mag_t sin_err, cos_err, quadratic, comp_err, xrad_copy;
|
mag_t sin_err, cos_err, quadratic, comp_err, xrad_copy;
|
||||||
mp_limb_t A_sin, A_cos, A_exp;
|
mp_limb_t A_sin, A_cos, A_exp;
|
||||||
|
|
||||||
/* Copy xrad, for two reasons. First, we need to support aliasing,
|
/* Copy xrad to support aliasing (note: the exponent has
|
||||||
and either the sine or cosine output could be written first.
|
also been clamped earlier). */
|
||||||
Second, the exponent could still be a negative bignum when we
|
MAG_MAN(xrad_copy) = radman;
|
||||||
reach this point, and then we need to use an upper bound. */
|
MAG_EXP(xrad_copy) = radexp;
|
||||||
if (MAG_IS_LAGOM(xrad))
|
|
||||||
{
|
|
||||||
*xrad_copy = *xrad;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
MAG_MAN(xrad_copy) = MAG_ONE_HALF;
|
|
||||||
MAG_EXP(xrad_copy) = MAG_MIN_LAGOM_EXP + 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Bound computed error. */
|
/* Bound computed error. */
|
||||||
if (error != 0)
|
if (error != 0)
|
||||||
|
@ -435,7 +426,6 @@ _arb_sin_cos(arb_t zsin, arb_t zcos, const arf_t x, const mag_t xrad, slong prec
|
||||||
need to incorporate the computed error which would be slightly
|
need to incorporate the computed error which would be slightly
|
||||||
messier, and we would also need extra cases when only computing
|
messier, and we would also need extra cases when only computing
|
||||||
one of the functions. */
|
one of the functions. */
|
||||||
/* Note: the bounds on cos(x) and sin(x) are assumed to be nonzero. */
|
|
||||||
A_cos = arb_sin_cos_tab1[2 * p1_tab1][ARB_SIN_COS_TAB1_LIMBS - 1];
|
A_cos = arb_sin_cos_tab1[2 * p1_tab1][ARB_SIN_COS_TAB1_LIMBS - 1];
|
||||||
A_sin = arb_sin_cos_tab1[2 * p1_tab1 + 1][ARB_SIN_COS_TAB1_LIMBS - 1];
|
A_sin = arb_sin_cos_tab1[2 * p1_tab1 + 1][ARB_SIN_COS_TAB1_LIMBS - 1];
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue