Re: Sine code for ANSI C
From: Dan Pop (Dan.Pop_at_cern.ch)
Date: 05/11/04
- Next message: James Kuyper: "Re: if(a);"
- Previous message: Dan Pop: "Re: Function Overloading"
- In reply to: P.J. Plauger: "Re: Sine code for ANSI C"
- Next in thread: P.J. Plauger: "Re: Sine code for ANSI C"
- Reply: P.J. Plauger: "Re: Sine code for ANSI C"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 11 May 2004 14:28:56 GMT
In <W1wlc.78210$G_.55362@nwrddc02.gnilink.net> "P.J. Plauger" <pjp@dinkumware.com> writes:
>"osmium" <r124c4u102@comcast.net> wrote in message
>news:c75iuo$i40p9$1@ID-179017.news.uni-berlin.de...
>
>> CBFalconer writes:
>>
>> > "P.J. Plauger" wrote:
>> > >
>> > ... snip ...
>> > > coefficients. But doing proper argument reduction is an open
>> > > ended exercise in frustration. Just reducing the argument modulo
>> > > 2*pi quickly accumulates errors unless you do arithmetic to
>> > > many extra bits of precision.
>> >
>> > And that problem is inherent. Adding precision bits for the
>> > reduction will not help, because the input value doesn't have
>> > them. It is the old problem of differences of similar sized
>> > quantities.
>>
>> Huh? If I want the phase of an oscillator after 50,000 radians are you
>> saying that is not computable? Please elaborate.
>>
>> There was a thread hereabouts many months ago on this very subject and
>AFAIK
>> no one suggested that it was not computable, it just couldn't be done with
>> doubles. And I see no inherent problems.
>
>Right. This difference of opinion highlights two conflicting
>interpretations of floating-point numbers:
>
>1) They're fuzzy. Assume the first discarded bit is
>somewhere between zero and one. With this viewpoint,
>CBFalconer is correct that there's no point in trying
>to compute a sine accurately for large arguments --
>all the good bits get lost.
>
>2) They are what they are. Assume that every floating-point
>representation exactly represents some value, however that
>representation arose. With this viewpoint, osmium is correct
>that there's a corresponding sine that is worth computing
>to full machine precision.
>
>I've gone to both extremes over the past several decades.
>Our latest math library, still in internal development,
>can get exact function values for *all* argument values.
>It uses multi-precision argument reduction that can gust
>up to over 4,000 bits [sic]. "The Standard C Library"
>represents an intermediate viewpoint -- it stays exact
>until about half the fraction bits go away.
>
>I still haven't decided how hard we'll try to preserve
>precision for large arguments in the next library we ship.
Why bother? Floating point numbers *are* fuzzy. Whoever sticks to the
second interpretation has no more clues about floating point than the
guys who expect 0.1 to be accurately represented in binary floating point.
Dan
-- Dan Pop DESY Zeuthen, RZ group Email: Dan.Pop@ifh.de
- Next message: James Kuyper: "Re: if(a);"
- Previous message: Dan Pop: "Re: Function Overloading"
- In reply to: P.J. Plauger: "Re: Sine code for ANSI C"
- Next in thread: P.J. Plauger: "Re: Sine code for ANSI C"
- Reply: P.J. Plauger: "Re: Sine code for ANSI C"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|