public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "burnus at gcc dot gnu dot org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug fortran/33197] Fortran 2008: math functions
Date: Sun, 22 Aug 2010 21:02:00 -0000	[thread overview]
Message-ID: <20100822210245.10101.qmail@sourceware.org> (raw)
In-Reply-To: <bug-33197-13404@http.gcc.gnu.org/bugzilla/>



------- Comment #39 from burnus at gcc dot gnu dot org  2010-08-22 21:02 -------
(In reply to comment #37)
> PS: NORM2 is described as "careful calculation of Euclidean norm" in the BCS
> slides and in the what's new in F2008 article. Currently, I use the trivial
> brute-force method. Maybe something more careful should be done?

As Dominique points out - the algorithm can be made more robust by doing the
calculation as
  tmp = max(abs(a))
  NORM2(a) := tmp*sqrt(dot_product(a/tmp,a/tmp))
That helps a lot for "a" finite with (a^2 > huge(a)) [overflow] ;-)

However, there is a method which only requires a single pass, cf. p. 38/39 in 
http://cpc.cs.qub.ac.uk/MRSN/higham.pdf. The algorithm by Sven Hammarling is
also used in BLAS, cf. http://www.netlib.org/blas/snrm2.f


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33197


  parent reply	other threads:[~2010-08-22 21:02 UTC|newest]

Thread overview: 46+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-08-26 18:25 [Bug fortran/33197] New: Fortran 2008: gamma() and other small changes burnus at gcc dot gnu dot org
2007-08-28 14:46 ` [Bug fortran/33197] " fxcoudert at gcc dot gnu dot org
2008-02-17 16:01 ` fxcoudert at gcc dot gnu dot org
2008-02-17 18:52 ` burnus at gcc dot gnu dot org
2008-02-17 18:57 ` fxcoudert at gcc dot gnu dot org
2008-02-17 19:09 ` burnus at gcc dot gnu dot org
2008-02-19 16:15 ` burnus at gcc dot gnu dot org
2008-02-27 18:38 ` fxcoudert at gcc dot gnu dot org
2008-02-27 21:03 ` fxcoudert at gcc dot gnu dot org
2008-02-28 17:58 ` fxcoudert at gcc dot gnu dot org
2008-03-03 23:47 ` fxcoudert at gcc dot gnu dot org
2008-03-03 23:52 ` [Bug fortran/33197] Fortran 2008: math functions " fxcoudert at gcc dot gnu dot org
2008-03-04 14:22 ` fxcoudert at gcc dot gnu dot org
2008-03-04 14:26 ` fxcoudert at gcc dot gnu dot org
2008-03-06 12:42 ` fxcoudert at gcc dot gnu dot org
2008-03-06 12:46 ` [Bug fortran/33197] Fortran 2008: math functions fxcoudert at gcc dot gnu dot org
2008-03-06 13:11 ` burnus at gcc dot gnu dot org
2008-03-06 13:16 ` fxcoudert at gcc dot gnu dot org
2008-03-06 13:50 ` burnus at gcc dot gnu dot org
2008-03-11 16:54 ` fxcoudert at gcc dot gnu dot org
2008-06-15 15:11 ` fxcoudert at gcc dot gnu dot org
2009-02-17 20:59 ` burnus at gcc dot gnu dot org
2009-05-02 13:47 ` fxcoudert at gcc dot gnu dot org
2009-05-16 17:33 ` fxcoudert at gcc dot gnu dot org
2009-05-16 18:10 ` fxcoudert at gcc dot gnu dot org
2009-07-10 11:46 ` burnus at gcc dot gnu dot org
2009-07-10 15:45 ` burnus at gcc dot gnu dot org
2009-07-10 16:17 ` burnus at gcc dot gnu dot org
2009-07-11  0:03 ` burnus at gcc dot gnu dot org
2009-07-14  7:44 ` burnus at gcc dot gnu dot org
2009-07-15  2:37 ` kargl at gcc dot gnu dot org
2009-07-15  6:08 ` burnus at gcc dot gnu dot org
2009-07-25 19:39 ` burnus at gcc dot gnu dot org
2009-07-25 19:45 ` burnus at gcc dot gnu dot org
2009-07-26 17:26 ` burnus at gcc dot gnu dot org
2009-10-02  3:52 ` ghazi at gcc dot gnu dot org
2010-05-02  8:48 ` dfranke at gcc dot gnu dot org
2010-08-19  7:28 ` burnus at gcc dot gnu dot org
2010-08-21 10:13 ` burnus at gcc dot gnu dot org
2010-08-21 10:35 ` burnus at gcc dot gnu dot org
2010-08-22 19:32 ` burnus at gcc dot gnu dot org
2010-08-22 19:34 ` burnus at gcc dot gnu dot org
2010-08-22 21:02 ` burnus at gcc dot gnu dot org [this message]
2010-08-27 19:18 ` burnus at gcc dot gnu dot org
2010-08-27 19:21 ` burnus at gcc dot gnu dot org
     [not found] <bug-33197-4@http.gcc.gnu.org/bugzilla/>
2014-06-09 10:09 ` fxcoudert at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20100822210245.10101.qmail@sourceware.org \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).