[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Sparse + complex arithmetic inconsistency
From: |
David Bateman |
Subject: |
Re: Sparse + complex arithmetic inconsistency |
Date: |
Fri, 30 Mar 2007 14:13:19 +0200 |
User-agent: |
Thunderbird 1.5.0.7 (X11/20060921) |
Michael Goffioul wrote:
> On 3/30/07, David Bateman <address@hidden> wrote:
>> Or a slightly modification
>>
>> #include <math.h>
>> #include <complex.h>
>> #include <stdio.h>
>> int main(int argc, char *argv[])
>> {
>> complex double b=1,c=I*1,d = 1+I*1,z = 0.;
>> // This should produce (inf,0), not (nan,nan).
>> printf("(%f,%f) / (%f,%f) -> (%f,%f)\n",
>> creal(b),cimag(b),creal(z),cimag(z),creal(b/z),cimag(b/z));
>> // This should produce (0,inf), not (nan,nan).
>> printf("(%f,%f) / (%f,%f) -> (%f,%f)\n",
>> creal(c),cimag(c),creal(z),cimag(z),creal(c/z),cimag(c/z));
>> // This should produce (inf,inf), not (nan,nan).
>> printf("(%f,%f) / (%f,%f) -> (%f,%f)\n",
>> creal(d),cimag(d),creal(z),cimag(z),creal(d/z),cimag(d/z));
>> return 0;
>> }
>>
>> that all return (nan,nan) for me.
>
> I already reported this kind of problem some months ago. This is
> due to the complex arthmetic implementation and it also appears
> under MSVC. See
> http://www.nabble.com/Sparse-matrix-problem-tf2844890.html#a8149128
>
> You can even illustrate the problem without the use of sparse
> matrices, like:
>
> [1+i 1+i] ./ [0 i]
>
> Michael.
>
Following the bug report trail from this thread leads to
https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=221319
and then
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30482
which leads to
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24581
and
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28408
No resolution from the GCC people is proposed, and all of the above bugs
are open. Hopefully, one day the gcc/g++ complex classes will be
mathematically correct :-(
D.
--
David Bateman address@hidden
Motorola Labs - Paris +33 1 69 35 48 04 (Ph)
Parc Les Algorithmes, Commune de St Aubin +33 6 72 01 06 33 (Mob)
91193 Gif-Sur-Yvette FRANCE +33 1 69 35 77 01 (Fax)
The information contained in this communication has been classified as:
[x] General Business Information
[ ] Motorola Internal Use Only
[ ] Motorola Confidential Proprietary
- Debian packages for Octave 2.9.10 available in experimental, Rafael Laboissiere, 2007/03/29
- Re: Debian packages for Octave 2.9.10 available in experimental, David Bateman, 2007/03/29
- Re: [Pkg-octave-devel] Re: Debian packages for Octave 2.9.10 available in experimental, Rafael Laboissiere, 2007/03/29
- Re: [Pkg-octave-devel] Re: Debian packages for Octave 2.9.10 available in experimental, David Bateman, 2007/03/29
- Re: [Pkg-octave-devel] Re: Debian packages for Octave 2.9.10 available in experimental, Rafael Laboissiere, 2007/03/30
- Re: [Pkg-octave-devel] Re: Debian packages for Octave 2.9.10 available in experimental, David Bateman, 2007/03/30
- Sparse + complex arithmetic inconsistency, Rafael Laboissiere, 2007/03/30
- Re: Sparse + complex arithmetic inconsistency, David Bateman, 2007/03/30
- Re: Sparse + complex arithmetic inconsistency, David Bateman, 2007/03/30
- Re: Sparse + complex arithmetic inconsistency, Michael Goffioul, 2007/03/30
- Re: Sparse + complex arithmetic inconsistency,
David Bateman <=
- Re: Sparse + complex arithmetic inconsistency, Rafael Laboissiere, 2007/03/30
- Re: Sparse + complex arithmetic inconsistency, Michael Goffioul, 2007/03/30
- Re: Sparse + complex arithmetic inconsistency, Rafael Laboissiere, 2007/03/30
- Re: Sparse + complex arithmetic inconsistency, John W. Eaton, 2007/03/31
- Re: Sparse + complex arithmetic inconsistency, David Bateman, 2007/03/31
- Re: Sparse + complex arithmetic inconsistency, Rafael Laboissiere, 2007/03/31
- Re: Sparse + complex arithmetic inconsistency, Paul Kienzle, 2007/03/31
- Re: Sparse + complex arithmetic inconsistency, David Bateman, 2007/03/31