From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6499 invoked by alias); 6 Mar 2008 13:50:49 -0000 Received: (qmail 6297 invoked by uid 48); 6 Mar 2008 13:50:06 -0000 Date: Thu, 06 Mar 2008 13:50:00 -0000 Message-ID: <20080306135006.6296.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug fortran/33197] Fortran 2008: math functions In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "burnus at gcc dot gnu dot org" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2008-03/txt/msg00375.txt.bz2 ------- Comment #16 from burnus at gcc dot gnu dot org 2008-03-06 13:50 ------- (In reply to comment #15) > > - Implementation of NORM2 > There are quite a few other new F2008 intrinsics, including other > transformational intrinsics, so I think it's better to focus this PR on math > intrinsics. I would regard the L2 norm as mathematical (http://mathworld.wolfram.com/L2-Norm.html) y = NORM2(x) is for rank one arrays simply: y = 0 do i=lbound(x,dim=1),ubound(x,dim=1) y = y + x(i)**2 enddo y = sqrt(y). For a rank-one, size-two array it is the same as hypot(x(1),x(2)). Actually, using hypot is an optimization one should do for size-2 arrays. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33197