Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 12 Aug 2012 23:04:08 -0000
From:      Stephen Montgomery-Smith <stephen@missouri.edu>
To:        Peter Jeremy <peter@rulingia.com>
Cc:        Diane Bruce <db@db.net>, Bruce Evans <brde@optusnet.com.au>, John Baldwin <jhb@freebsd.org>, David Chisnall <theraven@freebsd.org>, Bruce Evans <bde@freebsd.org>, Steve Kargl <sgk@troutmask.apl.washington.edu>, David Schultz <das@freebsd.org>, Warner Losh <imp@bsdimp.com>
Subject:   Re: Use of C99 extra long double math functions after r236148
Message-ID:  <50131E9D.6030603@missouri.edu>
Resent-Message-ID: <20120812230359.GL20453@server.rulingia.com>
In-Reply-To: <20120727210559.GF31169@server.rulingia.com>
References:  <20120717225328.GA86902@server.rulingia.com> <20120717232740.GA95026@troutmask.apl.washington.edu> <20120718001337.GA87817@server.rulingia.com> <20120718123627.D1575@besplex.bde.org> <20120722121219.GC73662@server.rulingia.com> <500DAD41.5030104@missouri.edu> <20120724113214.G934@besplex.bde.org> <501204AD.30605@missouri.edu> <20120727032611.GB25690@server.rulingia.com> <20120727155521.E4712@besplex.bde.org> <20120727210559.GF31169@server.rulingia.com>

next in thread | previous in thread | raw e-mail | index | archive | help
Bruce and I have continued a discussion at 
http://www.freebsd.org/cgi/query-pr.cgi?pr=170206.

I sure wish we could have a mailing list like freebsd-numerics to have 
these discussions.  Then we could do things like change the subject 
line, so that we didn't have to follow everything.

The idea of when you add a bunch of numbers that you start with the 
smallest first - I can see that being effective when all the numbers 
have the same signs.  But I can also see it being quite disastrous when 
the numbers have different signs.

I am trying to avoid "catastrophic loss of relative error" whereas you 
guys all seem to be after that last little bit of ULP.  I guess it is a 
different mind set.

If you are adding four numbers that are all positive, and you fail to 
add them from smallest to largest, the worst you will get is to increase 
your ULP to something like 4.

But if you have numbers of different signs, like
-1, 1, 1e-100
you definitely want to add the numbers of largest absolute value before 
you add the number with smallest absolute value.  If you add from 
smallest to largest (either in the absolute value sense, or in the 
signed sense), you get a relative error of infinity.

That is what I mean by "catastrophic loss of relative error."

I remember having this long argument with Steve about how a ULP of 10 
seemed just fine to me.

And for most applications, when you compute clog(z), and |z| is close to 
1, but z is not close to one, almost always you are not going to know 
the real and imaginary part of z exactly (it will be the result of some 
other computation), and so the huge relative error in computing clog(z) 
will represent a true lack of knowledge, not some artifact of the 
computational method.

Indeed, that is why, even if I could compute clog(z) perfectly, I would 
never use clog to compute casinh(z) using the formula 
clog(z+csqrt(z*z+1)).  This is because I also wouldn't have a good bound 
on |z+sqrt(z*z+1)|-1.

All this talk about not wanting to be on the wrong part of the Riemann 
surface just seems like you are living in dream land.  You could always 
come up with some kind of difficult analytic function for which near 
perfect resolution is going to be made difficult.  For example,
catanh(z) - I*PI/4
will never be calculable with good accuracy for |z| close to 1, unless 
you write a very special function for it.





Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?50131E9D.6030603>