diff options
author | pelissip <pelissip@280ebfd0-de03-0410-8827-d642c229c3f4> | 2004-11-18 14:52:59 +0000 |
---|---|---|
committer | pelissip <pelissip@280ebfd0-de03-0410-8827-d642c229c3f4> | 2004-11-18 14:52:59 +0000 |
commit | 054cdf7c885c574e6c111003c8767575a2a44666 (patch) | |
tree | 49713e889d7f8ccbdad01a07e92ff3cdf8f9c27e /asinh.c | |
parent | ef4cc77a66014090216445e952b0ccb9fc461e46 (diff) | |
download | mpfr-054cdf7c885c574e6c111003c8767575a2a44666.tar.gz |
Replace use of mpfr_save_emin_emax () / mpfr_restore_emin_emax()
by MPFR_SAVE_EXPO macros (DECL, MARK and FREE) which are faster
and thread safe.
git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@3100 280ebfd0-de03-0410-8827-d642c229c3f4
Diffstat (limited to 'asinh.c')
-rw-r--r-- | asinh.c | 12 |
1 files changed, 6 insertions, 6 deletions
@@ -22,10 +22,9 @@ MA 02111-1307, USA. */ #define MPFR_NEED_LONGLONG_H #include "mpfr-impl.h" - /* The computation of asinh is done by +/* The computation of asinh is done by * + * asinh = ln(x + sqrt(x^2 + 1)) */ - asinh = ln(x + sqrt(x^2 + 1)) - */ int mpfr_asinh (mpfr_ptr y, mpfr_srcptr x, mp_rnd_t rnd_mode) { @@ -34,6 +33,7 @@ mpfr_asinh (mpfr_ptr y, mpfr_srcptr x, mp_rnd_t rnd_mode) mp_prec_t Nx, Ny, Nt; mpfr_t t, te, ti; /* auxiliary variables */ long int err; + MPFR_SAVE_EXPO_DECL (expo); if (MPFR_UNLIKELY( MPFR_IS_SINGULAR(x) )) { @@ -71,13 +71,13 @@ mpfr_asinh (mpfr_ptr y, mpfr_srcptr x, mp_rnd_t rnd_mode) /* the optimal number of bits : see algorithms.ps */ Nt = Nt + 4 + MPFR_INT_CEIL_LOG2 (Nt); + MPFR_SAVE_EXPO_MARK (expo); + /* initialize intermediary variables */ mpfr_init2 (t, 2); mpfr_init2 (te, 2); mpfr_init2 (ti, 2); - mpfr_save_emin_emax (); - /* First computation of asinh */ do { @@ -103,7 +103,7 @@ mpfr_asinh (mpfr_ptr y, mpfr_srcptr x, mp_rnd_t rnd_mode) Ny + (rnd_mode == GMP_RNDN)) || MPFR_IS_ZERO(t))); - mpfr_restore_emin_emax (); + MPFR_SAVE_EXPO_FREE (expo); if (neg) MPFR_CHANGE_SIGN(t); |