Re: Errors cancel sometimes



On Thu, 17 Jan 2008 07:35:44 -0600, pete wrote
(in article <478F59AF.136C@xxxxxxxxxxxxxx>):

The output from my_log10 on my machine, makes fs_log10
look like it is a much more accurate function than it is.
For divisors with different numbers of zeros,
it doesn't work out as well, still not too bad, but not this good.
I think it's just some cases of all the errors canceling out.
I thought that it was remarkable, so I'm remarking on it.

There was a time when such things were taught to first and second year
CS and Engineering candidates, in courses called "Numerical Computing"
or "Numerical Analysis" and the results were not thought to be
remarkable.

Today, it seems that there is very little in print on the subject of
accurate calculations in a computer, and most are left with David
Goldberg's "What Every Computer Scientist Should Know About Floating
Point Arithmetic", which although it isn't bad, isn't all that
approachable by many, plus it really only hits the high points. Very
few programmers today even know of it, much less read it.

Once upon a time, excellent textbooks like "Computer Methods for
Mathematical Computations", by Forsythe, Malcom and Moler, 1977 were
used. Note: George E. Forsythe was the Chairman of Stanford's CS
Department and died while the book was being written. I note that
there are a few copies of it available used at Amazon, and for cheap.
It's from the "Prentice-Hall Series in Automatic Computation", and if
you look the titles in that series up, or happen to remember, quite a
few of them were and are golden.

Something that would turn off many readers today is that the code
examples (relatively sparse, it's not a cut and paste code book, it's
actual theory and some demonstrations) are in old-school ANSI Fortran.
The majority of the text is mathematics, not code though.

A similar book in the same P-H series, "Floating-Point Computation", by
Sterbenz is harder to find, and goes for $200 a copy used. Since it
focused on floating point on the IBM 360, it's probably not most modern
programmer's cup of tea either. It is referenced in [Goldberg] above.

"Some Aspects of Floating Point Computation", by Feldstein and Goodman
was published in 1989, and reportedly extends Sterbenz' work, but I
don't have a copy.

I am not aware of any currently available textbooks that cover the same
elements of accurate numerical calculations on a computer as well.
Most titles I am aware of that focus in this area were published
pre-1990 or even much earlier. There is are some later works in the
last few years, by Leader, or Burden, or Sauer, all of which are over
$100, and all seem to focus heavily on MatLab. I suspect the CS
education community has given up on teaching this stuff as part of a
core curriculum anymore, and have decided that it is safer to trust
MatLab to get the details right than to teach students how to do the
calculations themselves.

I'd be happy to have any pointers to more modern works that cover the
material in depth, rather than simply how to use an application to do
it for you.



--
Randy Howard (2reply remove FOOBAR)
"The power of accurate observation is called cynicism by those
who have not got it." - George Bernard Shaw





.



Relevant Pages

  • Re: TDD: Test-Driven Design or Test-Driven Development?
    ... design idea, and conflating it. ... > requires one to implement floating point calculations. ... This decision may affect how the calculations are coded. ... Please describe the Test Driven Development process that you think we are ...
    (comp.object)
  • Re: INT defect: Please try this on 2007 for me
    ... binary floating point representation and calculations. ... the low-order bits you should not be using Excel. ... as 40000.847999999 when formatted to 15 significant digits. ...
    (microsoft.public.excel.worksheet.functions)
  • Re: Program Computes incorrectly under VPC.
    ... >>owners of this software that it should not be used for floating point math. ... > NONE of the spreadsheets in the world today have EVER ... > calculations, ... > percentage of algorithms will fail in VPC. ...
    (microsoft.public.mac.virtualpc)
  • Re: IEEE Decimal Float on Itanium
    ... I'm guessing you're contemplating some specific application here, and probably something involving PL/I. ... Currency calculations. ... switched a billing and management system from its floating point implementation over to integer calculations eons back. ...
    (comp.os.vms)