MathGroup Archive 2011

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: FixedPoint[Cos, 1.0]

  • To: mathgroup at smc.vnet.net
  • Subject: [mg119364] Re: FixedPoint[Cos, 1.0]
  • From: Szabolcs Horvát <szhorvat at gmail.com>
  • Date: Wed, 1 Jun 2011 04:30:54 -0400 (EDT)
  • References: <is2kjq$qrm$1@smc.vnet.net>

On 2011.05.31. 13:49, J Siehler wrote:
> My numerical analysis students this past term pointed out to me that
> the command
>
> FixedPoint[Cos, 1.0]
>
> which is the first example in the Information for FixedPoint doesn't
> ever finish running (or, not in any reasonable amount of time).  We
> tried this on serveral versions of Mathematica (6.x, 7.x, and 8.x),
> all on OS X, and got the same nonresult.
>
> It can be forced by specifying something like FixedPoint[Cos, 1.0,
> SameTest ->  (Abs[#1 - #2]<  10^-10&)] or FixedPoint[Cos, 1.0, 40],
> but it seems like that should be unnecessary, and the form given in
> the documentation should work.  Can anybody else confirm this
> behavior?  Am I missing something totally obvious here?
>

On Windows / Pentium M it finishes if I pass a machine number (1.0) to 
it.  It does not finish if I pass it a number with fixed precision (e.g. 
1.0`10) because the Precision of the result keeps increasing with 
successive applications of Cos.

I'm curious, on your machine will the function keep oscillating between 
two values?  What (and how many) values do you get if you do e.g.

Union@Take[Length@FixedPointList[Cos, 1.0, 1000], -10]

?

  -- Szabolcs



  • Prev by Date: Problem in creating a demonstration
  • Next by Date: Re: Evaluation control in Compile[]
  • Previous by thread: Re: Problem in creating a demonstration
  • Next by thread: Re: FixedPoint[Cos, 1.0]