From: steve on
On Jan 21, 12:01 am, glen herrmannsfeldt <g...(a)ugcs.caltech.edu>
wrote:
> steve <kar...(a)comcast.net> wrote:
> > On Jan 20, 9:12?pm, glen herrmannsfeldt <g...(a)ugcs.caltech.edu> wrote:
> >> I don't want to get into any more arguments on the range reduction
> >> of trig. functions, but having to multiply by pi such that the
> >> function can then divide by pi doesn't seem so useful. ?One might
> >> hope that the value returned by ACOS(-1.D0) is appropriate for the
> >> range reduction of COS(), independent of its accuracy.
>>
> > The number of bits in pi that one might obtain from acos(-1.d0
> > is not very close to number of bits of pi needed for accurate
> > range reduction of the argument of cos().  See for example,
> > ARGUMENT REDUCTION FOR HUGE ARGUMENTS:
> > Good to the Last Bit
> > K. C. Ng and the members of the FP group of SunPro
>
> That was in the context of the FFT, where it is usual to need
> SIN and COS for arguments less than 2pi.  Even so, it is extremely
> rare in scientific computing to use trig. functions of huge arguments.
> (There are likely a few cases in number theory where they are used,
> but rarely in experimental physical sciences.  

1) You made, what appears to be, sweeping generalization. In
particular, the "..., independent of its accuracy." phrase is
specious.

2) Apparently, you've never looked at Mie scatternig theory
among other areas of scientific computing.

3) Most importantly, I quoted from KC Ng's paper concerning
an individual who developed an algorithm for accurate
range reduction. That person is Bob Corbett, who elsewhere
is this very thread states:

"I would like to second this. Although there are many
compilers that have trouble converting floating-point
constants to internal values with complete accuracy,
your odds are much better with literal constants than
with transcendental functions. "

I'll trust Bob's expertise here.

--
steve

From: glen herrmannsfeldt on
robin <robin_v(a)bigpond.com> wrote:
(snip)

> So, constants aren't?
> Since when did pi change?

I suppose you never read Carl Sagan's book "Contact" where
it seems that pi can change.

-- glen
From: glen herrmannsfeldt on
steve <kargls(a)comcast.net> wrote:
(snip)

> 2) Apparently, you've never looked at Mie scatternig theory
> among other areas of scientific computing.

1) What fraction of scientific computing is done on Mie theory?

2) Would those working on Mie theory use the existing library routines,
or write their own, most likely at more than double, or even quad,
precision?

I am specifically talking about arguments with
abs(x) .gt. 1./epsilon(x), or not so far away from that.

> 3) Most importantly, I quoted from KC Ng's paper concerning
> an individual who developed an algorithm for accurate
> range reduction. That person is Bob Corbett, who elsewhere
> is this very thread states:

> "I would like to second this. Although there are many
> compilers that have trouble converting floating-point
> constants to internal values with complete accuracy,
> your odds are much better with literal constants than
> with transcendental functions. "

I agree.

-- glen
From: Giorgio Pastore on
Ron Shepard wrote:
> In article <PHZ5n.2538$pv.9(a)news-server.bigpond.net.au>,
> "robin" <robin_v(a)bigpond.com> wrote:
>
>> | For a value 1 bit smaller in magnitude than -1.0, the acos ought to be
>> | off by quite a bit.
>>
>> If a Fortran compiler cannot store -1 accurately and precisely,
>> then you'd have something else to worry about!
>
> It seems that people aren't really reading the posts in this thread.
> Or maybe they don't understand what is being said. What Richard is
> saying...

It seems to me that you are among those who dont read. I was asking who
on the earth had trouble by defining pi=acos(-1.0) which is completely
different thing than asking the theory of square root-like functions in
the neighborhood of their branching point. And robin was also asking
something related to the specific point -1.0.


....
> You would expect that the ACOS intrinsic returns one of these
> values. That is not required by the standard, of course, but that is
> a different issue. But which one is returned is still an issue.

So, I guess you think that the value returned by sqrt(0.0) is also an
issue. Am I wrong? But did you have even one single exerience of
sqrt(0.0) returning something different from zero ? Again, I am looking
for real cases, not theory about what could happen.

....


> I find it hard to
> believe that someone has been programming for 30 years and has never
> seen this expression used for PI (or questioned why it is preferred
> over the alternatives).

Maybe because who is programing from 30 years is used to check the
value returned by acos(-1.0). :-)

> In the end, I tend to use literals for these kinds of constants.
> These can be obtained to arbitrary precision from any number of
> sources.

Ok. That is your favorite pet. I do not like it because at least a
couple of times in 30 years I had to spend one week each time to realize
that some student changed some decimal figures of pi just performing a
global change of numbers in one file :-(

In any case, I am just stating plainly my point of view, without trying
to convince you or Richard Maine that your programming style is wrong.

I have to add that I do not understand why my original reply to Richard
Maine has raised so strong reactions. In the past, I had much better
experiences in this NG.

Giorgio
From: Luka Djigas on
On Thu, 21 Jan 2010 10:08:24 +0000, Clive Page <junk(a)nospam.net>
wrote:

>
>If only the same standards if quality prevailed in their printer
>division...

Ouch! Don't be mean :-)))))))


-- Luka