Code Comments
Programming Forum and web based access to our favorite programming groups.hi evrybody! I'm developing a program to analyzing radiation pattern of microstrip antennas using the moment methods. the same code it's been ported to Mathematica (Wolfram Research) running the 2 code I discover that there is some difference in the result now I'm debugging all the variable and I'm writing a program in VB to do that, cause the variable it's so much! now I wonder which compiler is more accurate, Fortran or Mathematica?? in both code I'm using the max dimension for the real and complex variables (in fortran: Real(8) and Double Complex, right?) because if fortran it's more accurate than Mathematica I stop immediatly to check the billion variables!!!! thank to all!! bye from Rome! Marco ps the machine is a PC with windows2k I've read somewhere that the core of mathematica it's been written in C but I don't know how they have treated the accuracy of the number.
Post Follow-up to this message"GioX®" <spamstop@email.it> wrote: >hi evrybody! >I'm developing a program to analyzing radiation pattern of microstrip >antennas using the moment methods. > >the same code it's been ported to Mathematica (Wolfram Research) > >running the 2 code I discover that there is some difference in the result >now I'm debugging all the variable and I'm writing a program in VB to do >that, cause the variable it's so much! > >now I wonder which compiler is more accurate, Fortran or Mathematica?? > >in both code I'm using the max dimension for the real and complex variables >(in fortran: Real(8) and Double Complex, right?) Which Fortran compiler are you using? Is your code written in Fortran 77, 90, or 95? Some compilers, including Lahey/Fujitsu and Absoft, support quadr uple precision (Real(16)). With Lahey, you can use the -quad option when compilin g and do not need to change your code (although this approach is not portable across compilers). A free trial of the Lahey compiler is available -- see http://www.lahey.com . If your Fortran 90 compiler does not support quad precision, you can try Alan Miller's code at http://users.bigpond.net.au/amiller/quad.html . Quad precision will be slower than double. Are you sure that your problems are due to lack of numerical precision? It's good to compile your code with many compilers and with debugging options turned on. ----== Posted via Newsfeed.Com - Unlimited-Uncensored-Secure Usenet News==-- -- http://www.newsfeed.com The #1 Newsgroup Service in the World! >100,000 News groups ---= 19 East/West-Coast Specialized Servers - Total Privacy via Encryption = ---
Post Follow-up to this message"beliavsky@aol.com" <beliavsky@127.0.0.1:7501> ha scritto nel messaggio news:4156c245$1_1@127.0.0.1... > > "GioX®" <spamstop@email.it> wrote: variables > > Which Fortran compiler are you using? Is your code written in Fortran 77, > 90, or 95? Some compilers, including Lahey/Fujitsu and Absoft, support quadruple > precision (Real(16)). With Lahey, you can use the -quad option when compiling > and do not need to change your code (although this approach is not portable > across compilers). A free trial of the Lahey compiler is available -- see > http://www.lahey.com . I'm using FORTRAN 90, with MS Dev Studio (FortranPowerStation4.0) > If your Fortran 90 compiler does not support quad precision, you can try > Alan Miller's code at http://users.bigpond.net.au/amiller/quad.html . > > Quad precision will be slower than double. > > Are you sure that your problems are due to lack of numerical precision? yes, for sure... > It's good to compile your code with many compilers and with debugging options > turned on. now I try LF with quad precision and I'll post the result thanks! Marco
Post Follow-up to this message"GioX®" <spamstop@email.it> wrote in message news:2rnvquF1a5ereU1@uni-berlin.de... > "beliavsky@aol.com" <beliavsky@127.0.0.1:7501> ha scritto nel messaggio > news:4156c245$1_1@127.0.0.1... result do > variables 77, > quadruple > compiling > portable see > > I'm using FORTRAN 90, with MS Dev Studio (FortranPowerStation4.0) > > > yes, for sure... > > options > > now I try LF with quad precision and I'll post the result > thanks! > > Marco Don't forget to look for constants or variables which you have forgotten to declare in full precision. LF may have an option to promote constants, in case you missed them. Intel Fortran also has 128-bit quad precision.
Post Follow-up to this message"GioX®" <spamstop@email.it> wrote: >I'm using FORTRAN 90, with MS Dev Studio (FortranPowerStation4.0) This compiler has a poor reputation. One Fortran expert opined "This is one of the worst compilers on the planet." Google "worst Microsoft fortran compiler planet" in comp.lang.fortran for more info. If your code is standard Fortran 90 any Fortran 90 or 95 compiler should handle it, but if you used any MS Fortran extensions it will be easie st to migrate to Compaq Visual Fortran or Intel Visual Fortran. It's important to use a solid compiler. ----== Posted via Newsfeed.Com - Unlimited-Uncensored-Secure Usenet News==-- -- http://www.newsfeed.com The #1 Newsgroup Service in the World! >100,000 News groups ---= 19 East/West-Coast Specialized Servers - Total Privacy via Encryption = ---
Post Follow-up to this message"beliavsky@aol.com" <beliavsky@127.0.0.1:7501> ha scritto nel messaggio news:4156e4b2$1_1@127.0.0.1... > > "GioX®" <spamstop@email.it> wrote: > > > This compiler has a poor reputation. One Fortran expert opined "This is one > of the worst compilers on the planet." > Google "worst Microsoft fortran compiler planet" in comp.lang.fortran for > more info. If your code is standard Fortran 90 any Fortran 90 or 95 compiler > should handle it, but if you used any MS Fortran extensions it will be easiest > to migrate to Compaq Visual Fortran or Intel Visual Fortran. > It's important to use a solid compiler. > yessss! I've got the right result now! I've tried with LF compiler (trial) but the result was identical to the MS compiler but with option -quad I have the same result of mathematica (almost!), and the difference between two software now go from 0 to 6.9E-18, and I think it's a mathematica's fault cause when it encounters a number smaller than 1E-20, it round to 0, but I don't know how to set to don't do that but how can mathematica be so precise??! thanks for the help! bye! Marco
Post Follow-up to this messageGioX® wrote: > but how can mathematica be so precise??! It uses arbitrary-precision math. This sounds great in principle, but in practice it tends to be very slow. cheers, Rich -- Dr Richard H D Townsend Bartol Research Institute University of Delaware [ Delete VOID for valid email address ]
Post Follow-up to this message"GioX®" <spamstop@email.it> wrote in message news:2rnqr8F1c3g28U1@uni-berlin.de... > hi evrybody! > I'm developing a program to analyzing radiation pattern of microstrip > antennas using the moment methods. > > the same code it's been ported to Mathematica (Wolfram Research) > > running the 2 code I discover that there is some difference in the result > now I'm debugging all the variable and I'm writing a program in VB to do > that, cause the variable it's so much! > > now I wonder which compiler is more accurate, Fortran or Mathematica?? > > in both code I'm using the max dimension for the real and complex variables > (in fortran: Real(8) and Double Complex, right?) > > because if fortran it's more accurate than I stop immediatly to > check the billion variables!!!! > > thank to all!! > bye from Rome! > Marco > > ps > the machine is a PC with windows2k > I've read somewhere that the core of mathematica it's been written in C but > I don't know how they have treated the accuracy of the number. > > In numerics, Mathematica is always superior to fortran. Ditto for Matlab. -- Ciao, Gerry T.
Post Follow-up to this messagePowered by vBulletin
Copyright 2000-2006 Jelsoft Enterprises Limited.