Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #2934

Re: FixedPoint[Cos, 1.0]

From Dana DeLouis <dana.del@gmail.com>
Newsgroups comp.soft-sys.math.mathematica
Subject Re: FixedPoint[Cos, 1.0]
Date 2011-06-04 10:21 +0000
Organization Steven M. Christensen and Associates, Inc and MathTensor, Inc.
Message-ID <isd0uh$1p1$1@smc.vnet.net> (permalink)

Show all headers | View raw


Hi.  Just to mention...
On your two tests that you used:
FixedPoint[Cos, 1.0, SameTest -> (Abs[#1 - #2] < 10^-10 &)]
FixedPoint[Cos, 1.0, 40],

One of many alternatives to get a little better precision might be:

FixedPoint[Cos,1.0,SameTest->(Equal[##]&)]
0.7390851332151572`

Not great, but it=92s a little better.
We know from other posts that the value cycles between:
0.7390851332151605`
0.7390851332151608`

Another SameTest example similar to yours:

FixedPoint[Cos,1.0,SameTest->(Abs[Subtract[##]]< Power[10.5,-15]&)]
0.7390851332151605`

The two numbers above end in 605,and 608.
Interesting is that the numbers ending in 606 and 607 stop at 607.

n=0.7390851332151606`  ;
FixedPointList[Cos,n,10] 
{0.7390851332151606`,0.7390851332151607`}

n=0.7390851332151607`  ;
FixedPointList[Cos,n,10] 
{0.7390851332151607`,0.7390851332151607`}

The number ending in 607 seems to be the answer:
Cos[0.7390851332151607`]
    0.7390851332151607`

Higher precision seems to indicate 607 also.

FixedPoint[Cos,1`30,100]//N
0.7390851332151607`

= = = = = = = = = =
HTH  : >)
Dana DeLouis



On May 31, 7:49 am, J Siehler <jsieh...@gmail.com> 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?


Back to comp.soft-sys.math.mathematica | Previous | Next | Find similar | Unroll thread


Thread

Re: FixedPoint[Cos, 1.0] Dana DeLouis <dana.del@gmail.com> - 2011-06-04 10:21 +0000

csiph-web