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 /acosh.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 'acosh.c')
-rw-r--r-- | acosh.c | 23 |
1 files changed, 7 insertions, 16 deletions
@@ -22,15 +22,13 @@ MA 02111-1307, USA. */ #define MPFR_NEED_LONGLONG_H #include "mpfr-impl.h" - /* The computation of acosh is done by - - acosh= ln(x + sqrt(x^2-1)) - */ +/* The computation of acosh is done by * + * acosh= ln(x + sqrt(x^2-1)) */ int mpfr_acosh (mpfr_ptr y, mpfr_srcptr x , mp_rnd_t rnd_mode) { - + MPFR_SAVE_EXPO_DECL (expo); int inexact = 0; int comp; @@ -68,14 +66,12 @@ mpfr_acosh (mpfr_ptr y, mpfr_srcptr x , mp_rnd_t rnd_mode) { /* Declaration of the intermediary variables */ mpfr_t t, te, ti; - /* Declaration of the size variables */ mp_prec_t Nx = MPFR_PREC(x); /* Precision of input variable */ mp_prec_t Ny = MPFR_PREC(y); /* Precision of output variable */ + mp_prec_t Nt; /* Precision of the intermediary variable */ + int err; /* Precision of error */ - mp_prec_t Nt; /* Precision of the intermediary variable */ - int err; /* Precision of error */ - /* compute the precision of intermediary variable */ Nt = MAX(Nx, Ny); /* the optimal number of bits : see algorithms.ps */ @@ -86,7 +82,7 @@ mpfr_acosh (mpfr_ptr y, mpfr_srcptr x , mp_rnd_t rnd_mode) mpfr_init (te); mpfr_init (ti); - mpfr_save_emin_emax (); + MPFR_SAVE_EXPO_MARK (expo); /* First computation of acosh */ do @@ -122,7 +118,7 @@ mpfr_acosh (mpfr_ptr y, mpfr_srcptr x , mp_rnd_t rnd_mode) mpfr_clear (te); } - mpfr_restore_emin_emax (); + MPFR_SAVE_EXPO_FREE (expo); return mpfr_check_range (y, inexact, rnd_mode); } @@ -132,8 +128,3 @@ mpfr_acosh (mpfr_ptr y, mpfr_srcptr x , mp_rnd_t rnd_mode) - - - - - |