------- Comment #3 from paul dot richard dot thomas at cea dot fr 2006-06-21 07:19 ------- Subject: RE: Intrinsic MOD incorrect for large arg1/arg2 and slow.
FX, I do not have the slightest idea! I wrote various versions using BUILT_IN_FMOD and got bogged down in a discussion about the use of built-in fast-math versions. These seem to me to have more useful arithmetical properties, as well as being faster. I lost interest after that. I am stuck with a build problem that is causing me to scratch my head. PRECISION and RANGE do not seem to be known to the build any more and, in consequence it goes down in flames at selected_int/real_kind.f90. This is with a completely clean build. I cannot see any obvious culprit yet but we will see! Paul > -----Message d'origine----- > De : fxcoudert at gcc dot gnu dot org > [mailto:[EMAIL PROTECTED] > Envoyé : mardi 20 juin 2006 14:23 > À : THOMAS Paul Richard 169137 > Objet : [Bug fortran/24518] Intrinsic MOD incorrect for large > arg1/arg2 > and slow. > > > > > ------- Comment #2 from fxcoudert at gcc dot gnu dot org > 2006-06-20 12:22 ------- > Why exactly aren't we using BUILT_IN_FMOD{F,,L}? > > $ cat a.f90 > real*8 :: x = 10.0e9 > do i = 10, 22 > x = 10d0 * x > print '(a,i2,a,g14.8," = ",g14.8)', "mod (10**",i,", 1.7_8) = ", & > fmod (x, 1.7_8), mod > (x, 1.7_8); > end do > end > $ cat a.c > #include <math.h> > double fmod_ (double *x, double *y) > { return fmod(*x,*y); } > $ gfortran a.f90 a.c && ./a.out > mod (10**10, 1.7_8) = 1.3000026 = 1.3000026 > mod (10**11, 1.7_8) = 1.1000261 = 1.1000261 > mod (10**12, 1.7_8) = 0.80026120 = 0.80026150 > mod (10**13, 1.7_8) = 1.2026123 = 1.2026138 > mod (10**14, 1.7_8) = 0.12612289 = 0.12609863 > mod (10**15, 1.7_8) = 1.2612289 = 1.2607422 > mod (10**16, 1.7_8) = 0.71228945 = 5.8125000 > mod (10**17, 1.7_8) = 0.32289469 = -50.687500 > mod (10**18, 1.7_8) = 1.5289470 = 364.00000 > mod (10**19, 1.7_8) = 1.6894697 = -.70000000E+20 > mod (10**20, 1.7_8) = 1.5946971 = -.70000000E+21 > mod (10**21, 1.7_8) = 0.64697063 = -.70000000E+22 > mod (10**22, 1.7_8) = 0.86970627 = -.70000000E+23 > > It's actually slower: 55% slower at -O0 and 230% slower at > -O2, on a loop with > real(kind=8) variables modulo. But then, we're already > testing whether the > division can be represented by an integer, we could call fmod > only in the case > where it's not possible. Opinions? > > > -- > > fxcoudert at gcc dot gnu dot org changed: > > What |Removed |Added > -------------------------------------------------------------- > -------------- > CC| |fxcoudert at > gcc dot gnu dot > | |org > Last reconfirmed|2006-01-24 04:26:11 |2006-06-20 12:22:57 > date| | > > > http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24518 > > ------- You are receiving this mail because: ------- > You reported the bug, or are watching the reporter. > -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24518