Package: libmathlib1
Version: 2004.11.04-1

There is some (probably compilation) bug in the libmathlib1 package,
that arises when using the subrutine DADMUL for multidimensional
integration.

Please, consider the following program

       program testdadmul
       implicit none
       real*8 A(3),B(3),WK(150000),pi,valor,relerr,eps,c(3),t
       integer NFNEV,IFAIL,IWK,minpt,maxpt
       external f3
c       double precision f3

       pi=dacos(-1.d0)

       A(1)=0.d0
       A(2)=0.d0
       A(3)=0.d0
       B(1)=pi
       B(2)=pi
       B(3)=pi
       c(1)=1.d0
       c(2)=1.d0
       c(3)=1.d0
       IWK=150000
       eps=1.d-3
       minpt=64
       maxpt=1000000

c       t=f3(3,c)
       write(*,*) 'calling dadmul'
       CALL DADMUL(f3,3,A,B,minpt,maxpt,eps,WK,IWK,valor,relerr,NFNEV,
     .  IFAIL)
       write(*,*)  'I=',valor,'+-',relerr,'%',NFNEV,' evals',' error
     .   ',IFAIL

        end

       real*8 function f3(Ndim,x)
       implicit none
       double precision x(3),a,b,c
       integer Ndim
       a=x(1)
       b=x(2)
       c=x(3)
       f3=(sin(a)*sin(b)*sin(c))**2
       return
       end


I compile it with the command

g77 -static -o test.x test.f  -lmathlib -lpacklib -lkernlib

and running it, I get the following output
./test.x
 calling dadmul
 I=  3.87581798+-  0.000980121412% 38115 evals error        0

The 'I' above is the value of the integral. The exact value is pi^3/8

However, if I change the lower integration limits (0.d0 originally) to

A(1)=1.d-8
A(2)=1.d-8

then I get this result

g77 -static -o test.x test.f  -lmathlib -lpacklib -lkernlib
./test.x
 calling dadmul
 I=  42336.3332+-  2.45015127% 999999 evals error        1

The I value here is completely wrong.


This is my system:

[EMAIL PROTECTED]:~$ cat /proc/version
Linux version 2.6.8-1-686 ([EMAIL PROTECTED]) (gcc version 3.3.5 (Debian
1:3.3.5-2)) #1 Thu Nov 25 04:34:30 UTC 2004

I have compiled with the versions 3.3.4 and 2.95 of g77, and
also tested it in a computer with Mandrake linux.

Then, I downloaded from the CERN the source file containing the subroutine
radmul/dadmul, and compiled it in the following way

g77 -g -static   -c -o inttegint.o inttegint.f
g77 -g -static   -c -o radmul.o radmul.f
g77 -g -static -o a.x driver.f inttegint.o radmul.o -lmathlib -lpacklib 
-lkernlib

Now the program runs OK.
./test.x
 calling dadmul
 I=  3.87578459+-  2.00515818E-16% 495 evals error        0


Thank you

Eduardo A. Menendez Proupin
Department of Physics
Faculty of Science
University of Chile
Las Palmeras 3425
�u�oa, Santiago
Chile
Phone: 56+2+678 74 11
http://fisica.ciencias.uchile.cl/~emenendez/


Reply via email to