diff options
author | zimmerma <zimmerma@211d60ee-9f03-0410-a15a-8952a2c7a4e4> | 2005-04-21 06:19:55 +0000 |
---|---|---|
committer | zimmerma <zimmerma@211d60ee-9f03-0410-a15a-8952a2c7a4e4> | 2005-04-21 06:19:55 +0000 |
commit | c5363efca4c4acd3f6535df6b3db06b1c949f164 (patch) | |
tree | 1b50dfdcbed92924b7a0b9388743318adaaddfc3 /sqr.c | |
parent | 85a425e3fe604b227833f9d178e502ef49af40cf (diff) | |
download | mpc-c5363efca4c4acd3f6535df6b3db06b1c949f164.tar.gz |
use mpfr_sqr (a, b, r) instead of mpfr_mul (a, b, b, r)
git-svn-id: svn://scm.gforge.inria.fr/svn/mpc/trunk@37 211d60ee-9f03-0410-a15a-8952a2c7a4e4
Diffstat (limited to 'sqr.c')
-rw-r--r-- | sqr.c | 5 |
1 files changed, 2 insertions, 3 deletions
@@ -43,14 +43,13 @@ mpc_sqr (mpc_ptr a, mpc_srcptr b, mpc_rnd_t rnd) /* first check for real resp. purely imaginary number */ if (MPFR_IS_ZERO (MPC_IM(b))) { - inex_re = mpfr_mul (MPC_RE(a), MPC_RE(b), MPC_RE(b), MPC_RND_RE(rnd)); + inex_re = mpfr_sqr (MPC_RE(a), MPC_RE(b), MPC_RND_RE(rnd)); inex_im = mpfr_set_ui (MPC_IM(a), 0, GMP_RNDN); return MPC_INEX(inex_re, inex_im); } if (MPFR_IS_ZERO (MPC_RE(b))) { - inex_re = -mpfr_mul (MPC_RE(a), MPC_IM(b), MPC_IM(b), - INV_RND (MPC_RND_RE(rnd))); + inex_re = -mpfr_sqr (MPC_RE(a), MPC_IM(b), INV_RND (MPC_RND_RE(rnd))); mpfr_neg (MPC_RE(a), MPC_RE(a), GMP_RNDN); inex_im = mpfr_set_ui (MPC_IM(a), 0, GMP_RNDN); return MPC_INEX(inex_re, inex_im); |