octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #35024] magnitude abs(a) != sqrt(a_r^2 + a_i^2


From: Jordi Gutiérrez Hermoso
Subject: [Octave-bug-tracker] [bug #35024] magnitude abs(a) != sqrt(a_r^2 + a_i^2)
Date: Fri, 09 Dec 2011 15:29:38 +0000
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.13) Gecko/20110109 Waterpanther/3.6.13

Follow-up Comment #6, bug #35024 (project octave):

What could abs() be possibly doing other than squaring each element (which has
no rounding error here, the numbers are too small) add the elements (also no
rounding error) and then calling sqrt()?

If abs() is not calling sqrt(), then what is it doing? Because that's the only
place where I can imagine roundoff error could occur, since it's the only part
that doesn't do integer arithmetic with small numbers (i.e. without roundoff
error). It must be doing something other than calling sqrt(13), because the
result is not identical to sqrt(13).

The abs() function is delegated to the C++ implementation... it calls the
std::complex<double>::abs() defined in the C++ standard header <complex>. So
what how is the Windows compiler defining this function?

    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?35024>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]