Karim BELABAS on Thu, 06 Nov 2003 20:46:50 +0100

[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: Experimenting with the Alpha build.

On Thu, 6 Nov 2003, Phil Carmody wrote:
> I was wondering if -ffast-math would do to Pari/GP/GMP on the alpha.
> The speed-ups weren't significant on the whole (I should have tried
> -mno-ieee too perhaps)

This is expected: there's almost no floating point code in PARI (everything
is emulated using 'unsigned long' arithmetic). Might be considered a

There are lots of variables of type 'double', but they are used in parts of
the code which is negligible timewise. And never where stability / accuracy
is important. I.e --fast-math should be a no-op with respect to performances
or results.

> and did cause just one test to fail:

This component of the result is quite useless [ debugging output which has
stuck here for the past 10 years or so... ]. It is actually computed from

  sqrt(disc) / PI,  where  PI is #define'd to 3.141592653589

which is probably computed "incorrectly" with --fast-math, e.g 1./ PI is
presumably precomputed.

Note: this value is converted to a t_REAL D, say, used in a trivial
computation h / (L * D) where h is the class number and L is a very rough
approximation of L(1, chi) (obtained through ulong arithmetic). This
component should be relatively close to 1 ( certainly in [0.5, 1.5] ),
and this is all we care about.

Note that GP will never output a result where this parameter has a dubious
value: it will restart the main relation loop instead, or recompute things
properly to higher accuracy. Hence outputing it serves no purpose.

I have just dumped this part of the result in CVS. Same goes for bnfinit, and
a few other diagnostics which have cluttered outputs for no good reason
( bnfisprincipal / bnrisprincipal ).

The minor backward incompatibility should not pose a problem, since I do not
see any situation where this component would need to be accessed.


Karim Belabas                     Tel: (+33) (0)1 69 15 57 48
Dép. de Mathématiques, Bât. 425   Fax: (+33) (0)1 69 15 60 19
Université Paris-Sud              http://www.math.u-psud.fr/~belabas/
F-91405 Orsay (France)            http://pari.math.u-bordeaux.fr/  [PARI/GP]