summaryrefslogtreecommitdiff
path: root/src/sin.c
diff options
context:
space:
mode:
authorenge <enge@211d60ee-9f03-0410-a15a-8952a2c7a4e4>2008-10-04 22:03:00 +0000
committerenge <enge@211d60ee-9f03-0410-a15a-8952a2c7a4e4>2008-10-04 22:03:00 +0000
commit09ddbbc6d17ccb51ee253cf5cc426882f2ac6f05 (patch)
tree63269d1e6d48f6960bf7122374ec538a4236e250 /src/sin.c
parentd40cf65aee9976cb8fb8ed0a7ddbc9959d6d7a76 (diff)
downloadmpc-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.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/sin.c b/src/sin.c
index c0272d7..8d37e0d 100644
--- a/src/sin.c
+++ b/src/sin.c
@@ -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);