This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Re: accuracy of intrinsic SUM function
On Mon, Aug 27, 2012 at 05:45:38PM +0200, Schorsch MCMLX wrote:
> Meanwhile, I've slightly modifed code posted by Paul van Delst to
> comp.lang.fortran in 2009 in order to measure performance:
>
> variable
> SUBROUTINE Begin_Timing( Timing ) ! In/Output
> TYPE(Timing_type), INTENT(IN OUT) :: Timing
> CALL SYSTEM_CLOCK(COUNT_RATE=Timing%Hertz,COUNT=Timing%Begin_Clock)
If you are on a UNIX or UNIX-like system (e.g., linux or FreeBSD)
that includes getrusage(), then use cpu_time(). cpu_time() will
have microsecond resolution.
> Here's my new pairwise and double-double (referred to as hiDD in the
> figures) code. The pairwise code can be speeded up a little bit by
> using selects instead of ifs...:
>
Thanks for the code example. I've simply removed it to
keep this brief.
> P.S.: if the list does not receive attachments, please let me know,
> then I'll copy the raw data in here...
I've looked at your graphs, and don't understand the errors
that you measured. In SUMS_ND-MN48-SD4_GF471W7x64.png, you
show SUMrecu with an error within +-40 ULP. This makes no sense
to me in that one normally measures errors in the significand.
If you have a result that matches the exact result to the last
bit, then you have 0 ULP in your result. Any deviation in your
result from the exact result is some positive number of ULP.
See, for example,
http://ljk.imag.fr/membres/Carine.Lucas/TPScilab/JMMuller/ulp-toms.pdf
for various definitions of ULP.
--
Steve