Re: Q: how to compute modulo Pi for large arguments?

From: Axel Vogt (nonail_at_axelvogt.de)
Date: 06/01/04


Date: Tue, 01 Jun 2004 20:40:34 +0200


Russell Wallace wrote:
>
> On Sun, 30 May 2004 19:37:57 +0200, Axel Vogt <nonail@axelvogt.de>
> wrote:
>
> >May be that is a naive question in numerics ...
> >
> >Given a positive real or natural number x <= 1E308 i want the
> >the remainder of x/Pi with precision of ~ 15 - 18 digits. And
> >want to use it for periodics of large arguments in a C pgm.
>
> Is that going to be possible?
>
> Suppose x ~= 1E300. Now, given that you mentioned 1E308 and C, I
> assume you're talking about 64-bit floating point.
>
> But that's only got ~16 digits of precision at the best of times. So
> the error in the input is going to be on the order of 1E284, isn't it?
> Someone with more expertise in numerical analysis please correct me if
> I'm missing something, but as far as I can see you'd need a format
> that can represent 1E300 with an error << pi, i.e. one that has more
> than 300 digits of precision?

Yes, i am aware of the presentation problem (or how that is
named): 10^n and 1 + 10^n certainly have a different sinus.

A check with MSVC against Maple shows that already for n=7
exactness falls to 13 digits (and not as they say in their
help it would be around n=19). Using 'gsl_sf_sin' behaves
much better (GSL can partially be interfaced with Maple),
0.5*10^10 is still exact for the 14th digit.



Relevant Pages

  • Re: float bug? perl 5.8, DBI and oracle 10.2.0
    ... precision numbers in oracle, you've got 38 decimal digits to play ... and with minimal coaxing perl will handle them as ... digits from a 32 bit floating point number - I'll go out on a limb ... and hazard that one can expect 12 or so digits from a 64 bit floating ...
    (perl.dbi.users)
  • RE: float bug? perl 5.8, DBI and oracle 10.2.0
    ... I would not characterise 32-bit signed integers as giving 10 digits ... truncate and tell people you get 9 digits of precision. ... perl 5.8, DBI and oracle 10.2.0 ... Floating point values are typically stored in 64 bits or sometimes 96 ...
    (perl.dbi.users)
  • Re: float bug? perl 5.8, DBI and oracle 10.2.0
    ... I would not characterise 32-bit signed integers as giving 10 digits ... truncate and tell people you get 9 digits of precision. ... perl 5.8, DBI and oracle 10.2.0 ... Floating point values are typically stored in 64 bits or sometimes 96 ...
    (perl.dbi.users)
  • Re: 15 Significant Digits Limitation a Mistake for Spatial Informa
    ... DP does not restrict to 15 decimal digits. ... Input and output precision are more tightly linked in Excel ... Decimal data type or roll your own extended precision data types. ...
    (microsoft.public.excel)
  • Re: Salamin-Brent algorithm
    ... fraction-representing digits, which is of course ... might have thought one could dispose of because ... since one's precision is so increasing with the ... S-B algorithm)? ...
    (sci.math)