diff options
author | enge <enge@211d60ee-9f03-0410-a15a-8952a2c7a4e4> | 2008-10-04 22:03:00 +0000 |
---|---|---|
committer | enge <enge@211d60ee-9f03-0410-a15a-8952a2c7a4e4> | 2008-10-04 22:03:00 +0000 |
commit | 09ddbbc6d17ccb51ee253cf5cc426882f2ac6f05 (patch) | |
tree | 63269d1e6d48f6960bf7122374ec538a4236e250 /src/sin.c | |
parent | d40cf65aee9976cb8fb8ed0a7ddbc9959d6d7a76 (diff) | |
download | mpc-09ddbbc6d17ccb51ee253cf5cc426882f2ac6f05.tar.gz |
sin: lower precision for sign determination
sqr: use internal MPFR_SIGN macro instead of mpfr_signbit
git-svn-id: svn://scm.gforge.inria.fr/svn/mpc/trunk@247 211d60ee-9f03-0410-a15a-8952a2c7a4e4
Diffstat (limited to 'src/sin.c')
-rw-r--r-- | src/sin.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -89,8 +89,8 @@ mpc_sin (mpc_ptr rop, mpc_srcptr op, mpc_rnd_t rnd) /* sin(x -i*Inf) = +Inf*(sin(x) -i*cos(x)) */ /* sin(x +i*Inf) = +Inf*(sin(x) +i*cos(x)) */ - mpfr_init (x); - mpfr_init (y); + mpfr_init2 (x, 2); + mpfr_init2 (y, 2); mpfr_sin_cos (x, y, MPC_RE (op), GMP_RNDZ); mpfr_set_inf (MPC_RE (rop), MPFR_SIGN (x)); mpfr_set_inf (MPC_IM (rop), MPFR_SIGN (y)*MPFR_SIGN (MPC_IM (op))); @@ -105,7 +105,7 @@ mpc_sin (mpc_ptr rop, mpc_srcptr op, mpc_rnd_t rnd) /* sin(x +0*i) = sin(x) +0*i*cos(x) */ if (mpfr_cmp_ui (MPC_IM(op), 0) == 0) { - mpfr_init (x); + mpfr_init2 (x, 2); mpfr_sin_cos (MPC_RE (rop), x, MPC_RE (op), MPC_RND_RE (rnd)); mpfr_mul (MPC_IM(rop), MPC_IM(op), x, MPC_RND_IM(rnd)); mpfr_clear (x); |