From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fee84,f719c3b6c27bc1fe,start X-Google-Attributes: gidfee84,public X-Google-ArrivalTime: 1993-10-08 22:29:56 PST Path: gmd.de!xlink.net!rz.uni-karlsruhe.de!news.uni-stuttgart.de!ivdds6!fhcn1 From: fhcn1@ivdds6.energietechnik.uni-stuttgart.de (Claus Nagel) Newsgroups: comp.unix.osf.osf1 Subject: DEC Fortran exp()-function ---slow--- Date: 9 Oct 1993 05:20:14 GMT Organization: University of Stuttgart, Institute IVD, GERMANY Distribution: world Message-ID: <295hme$mg5@info2.rus.uni-stuttgart.de> NNTP-Posting-Host: ivdds6.ivd.uni-stuttgart.de Problem with exp-function in DEC-Fortran for AXP/OSF1 (DFAO) There's a great difference in program-running-time whether using the Fortran-function exp() or not. If explicitly give a constant and use the "**"-Operator the runtime is extremly shorter than using the libraryfunction. Is anyone out there with an idea how to solve the problem without changing all of the exp()-calls. Any help appreciated. environment, program and results ================================ DEC Alpha 3500 AXP, DEC OSF/1 V1.2, DEC Fortran V3.3-342 for AXP/OSF1 ----- program with "manually" build the exponent -------------------- PROGRAM expman REAL sum r1 = 5.5 DO 10 i=1,200000 if (i .GT. 1000) r1 = 10. sum = 2.7182818**(r1*3.0) 10 CONTINUE STOP END ----- program with using the exp() ---------------------------------- PROGRAM expexp REAL sum r1 = 5.5 DO 10 i=1,200000 if (i .GT. 1000) r1 = 10. sum = exp(r1*3.0) 10 CONTINUE STOP END ----- f77-call ------------------------------------------------------ % f77 -o expman expman.f % f77 -o expexp expexp.f % f77 ... -v ... => /usr/lib/cmplrs/fort/decfort -o /tmp/forAAA026963.o expexp.f /usr/bin/cc -o expexp -v /usr/lib/cmplrs/fort/for_main.o \ /tmp/forAAA026963.o -O4 -nocount -lUfor -lfor -lFutil -lm -lots /usr/lib/cmplrs/cc/ld -o expexp -G 8 -g0 -O4 -call_shared -nocount \ /usr/lib/cmplrs/cc/crt0.o -count /usr/lib/cmplrs/fort/for_main.o \ /tmp/forAAA026963.o -nocount -lUfor -lfor -lFutil -lm -lots -nocount -lc 0.0u 0.0s 0:00 84% 0+0k 0+4io 0pf+0w ----- results (time mm:ss) ------------------------------------------ expman 00:10 00:10 00:05 00:05 1.0 expexp 05:06 05:17 02:38 02:35 30.6-31.6 (differences are because of other programs running, relation is the same) ############################################################################# #postal University of Stuttgart (Germany), # #address: Institute of Process Engineering and Power Plant Technology (IVD),# # Claus Nagel, Pfaffenwaldring 23, D-70550 Stuttgart . # #phone: 49 711 685 -3751, -3563, -3487 _ - |\ # #fax: 49 711 685 3491 - | \ # #e-mail: nagel@ivd.uni-stuttgart.de | \ */ O # # claus.nagel@rus.uni-stuttgart.de .__|___\|_. \* # ########################################################~~~\_______/~~~######