Re: [ng-spice-devel] ACS converted to automake, autoconf


To ng-spice-devel@ieee.ing.uniroma1.it
From Al Davis <aldavis@ieee.org>
Date Wed, 1 Nov 2000 11:31:18 -0800
Delivered-To mailing list ng-spice-devel@ieee.ing.uniroma1.it
In-Reply-To <3A0031A6.47E6460C@gmx.de >
Mailing-List contact ng-spice-devel-help@ieee.ing.uniroma1.it; run by ezmlm
References <20001030210607.A24396@cgmd80028.chello.nl > <3A0031A6.47E6460C@gmx.de >
Reply-To ng-spice-devel@ieee.ing.uniroma1.it

On Wed, 01 Nov 2000, Manfred Metzger wrote:
> However, 'make check' fails on 47 tests. The diffs for these tests are 
>attached
> as diffs-hpux.tgz.
> 
> I also have 1 test-failure on my Linux system (Glibc 2.1.3, GCC 2.95.2).
> Attached as opamp-ol-disto.diffs.



With floating point math, you will often get small differences in
results due to subtle differences in the system.  I have tried to
handle some of them, so the current version is more consistent than
previous versions were, but still not perfect.  Spice is not any
better.

The test directory contains test cases contrived to expose
differences as much as possible.  Some of them print every iteration.
 Some try to exactly hit a switch point, so that depending on
roundoff error it could change a decision.  (the switch tests, and
some mosfet tests with Vds==0.)  I have had this for years, but only
released it to the public in the lastest release, because of its
sensitivity.

As to what is significant, I was at first concerned about some tests
on the HP that gave NaN as a result.  All other differences in this
data set are not significant.  After studying this, I believe that
this, too, is not significant, although I admit a "NaN" result can be
disconcerting.

The Linux difference is a classic example of a difference that
doesn't matter.  The files supplies with 0.28 were done on an Intel
CPU with "gcc version egcs-2.91.66 19990314 (egcs-1.1.2 release)".
When I use my other system, with an AMD CPU and "gcc version 2.95.2
19991024 (release)", I get the same difference.  When I move the
executable to the other CPU, the results don't change.

That table is a Fourier analysis of a "pure" sine wave.  As you see,
the harmonics are almost 300 dB below the fundamental.  The
difference between -292.20 and -292.12 is not significant.  In both
cases, what you see is noise.

Most of the others show something similar.  A 1 volt sine wave might
show 14 femtovolts on one and 20 femtovolts on the other.  Both are
within noise of zero.  You can see this on voltage differences, too.

When I use a FreeBSD system, I get a bunch of insignificant
differences.  (Intel CPU, gcc 2.95.2).


Now, about that NaN .....   I don't get it on any of my systems.  All
of them in this test are the phase of zero, in an AC analysis.  You
didn't get a difference on the magnitude (which prints as 0.)  My
guess is that the "arg" function on your system croaks when it is
passed  complex(0,0).  On those circuits ...  what is the real part
and imaginary part?  Both 0?  (Both 0 is correct.)

It could be that HP's arg function deliberatly returns NaN when fed
complex(0,0), since the phase cannot be determined.

I guess I am satisfied now that the NaN is OK in this case.

al.

Partial thread listing: