Mathematica 9 is now available
Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2005
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2005

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

Search the Archive

Re: FixedPoint stops "when elements no longer change"?

  • To: mathgroup at smc.vnet.net
  • Subject: [mg62898] Re: FixedPoint stops "when elements no longer change"?
  • From: "Steven T. Hatton" <hattons at globalsymmetry.com>
  • Date: Thu, 8 Dec 2005 00:04:28 -0500 (EST)
  • References: <dn0v44$8ge$1@smc.vnet.net> <dn36v5$318$1@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

Jean-Marc Gulliet wrote:


> 
> Hi Steven,
> 
> Try the following:
> 
> In[16]:=
> l = FixedPointList[Cos, 1.];
> 
> In[17]:=
> NumberForm[l, Floor[$MachinePrecision] + 1]

Is there any particular reason you used Floor + 1 instead of Ceiling?

This is from the commandline UI:

In[1]:= Information[$MachinePrecision]
$MachinePrecision gives the number of decimal digits of precision used for
   machine-precision numbers.

Attributes[$MachinePrecision] = {Protected}
 
$MachinePrecision = 15.954589770191003

Interestingly, I get a different result in the FrontEnd:

$MachinePrecision=15.9546


This is the final difference from both UIs:

In[3]:= l[[-1]] - l[[-2]]

                  -16
Out[3]= 1.11022 10


> 
> In[9]:=
> l[[-1]] - l[[-2]]
> 
> Out[9]=
> 1.1102230246251565*^-16
> 
> $MachineEpsilon gives the smallest machine-precision number which can be
> added to 1.0 to give a result that is distinguishable from 1.0.
> 
> In[11]:=
> $MachineEpsilon
> 
> Out[11]=
> 2.220446049250313*^-16
> 
> In[12]:=
> l[[-1]] - l[[-2]] < $MachineEpsilon
> 
> Out[12]=
> True
> 
> In[18]:=
> $Version
> 
> Out[18]=
> "5.2 for Microsoft Windows (June 20, 2005)"

Both the FrontEnd and the commandline give the same result for
$MachineEpsilon:

In[3]:= $MachineEpsilon

                  -16
Out[3]= 2.22045 10

In[4]:= $Version       

Out[4]= 5.2 for Linux (June 20, 2005)

$ /usr/sbin/hwinfo --cpu
01: None 00.0: 10103 CPU                                        
  [Created at cpu.290]
  Unique ID: rdCR.j8NaKXDZtZ6
  Hardware Class: cpu
  Arch: Intel
  Vendor: "GenuineIntel"
  Model: 15.2.4 "Intel(R) Pentium(R) 4 CPU 2.40GHz"
  Features:
fpu,vme,de,pse,tsc,msr,pae,mce,cx8,sep,mtrr,pge,mca,cmov,pat,pse36,clflush,dts,acpi,mmx,fxsr,sse,sse2,ss,ht,tm
  Clock: 2392 MHz
  Cache: 512 kb
  Units/Processor: 1
  Config Status: cfg=no, avail=yes, need=no, active=unknown

I wonder why your numbers are different from mine.  Hardware, or software?
-- 
The Mathematica Wiki: http://www.mathematica-users.org/
Math for Comp Sci http://www.ifi.unizh.ch/math/bmwcs/master.html
Math for the WWW: http://www.w3.org/Math/


  • Prev by Date: Re: Types in Mathematica, a practical example
  • Next by Date: Re: Re: Re: Types in Mathematica, a practical example
  • Previous by thread: Re: FixedPoint stops "when elements no longer change"?
  • Next by thread: Re: FixedPoint stops "when elements no longer change"?