Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3604422
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T20:59:44+00:00 2026-05-18T20:59:44+00:00

I did this in Mathematica to compute Sqrt[5]: a[0] = 2 a[n_] := a[n]

  • 0

I did this in Mathematica to compute Sqrt[5]:

a[0] = 2 
a[n_] := a[n] = a[n-1] - (a[n-1]^2-5)/2/a[n-1] 

How close is a[25] to Sqrt[5]?

N[Sqrt[5]-a[25]] // FortranForm 
4.440892098500626e-16 

And how close is a[25]^2 to 5?

N[a[25]^2-5] // FortranForm 
8.305767102358763e-42074769 

This seems odd to me. My estimate: if x is within 10^-n of Sqrt[5],
then x^2 is within 10^(-2*n) of 5, give or take. No? In fact:

a[25]^2 = (Sqrt[5]-4.440892098500626e-16)^2 ~ 5 - 2*5*4.440892098500626e-16 

(expanding (a-b)^2), so the accuracy should be only about 14 digits
(or n digits in general).

Of course, Newton’s method yielding only 15 accurate digits in 25
iterations also seems odd.

Am I losing precision too early in the calculations above? Note that:

N[Log[Sqrt[5]-a[25]]] // FortranForm 
-35.35050620855721 

agrees w/ the 15 digit precision above, even though I do N[] after
taking the Log (so it should be accurate).

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T20:59:44+00:00Added an answer on May 18, 2026 at 8:59 pm

    The problem is how Mma is calculating your sequence.

    a[n] are Rational numbers. Lets see the order of magnitude for the Numerators, in a loglog scale:

    a[0] = 2 
    a[n_] := a[n] = a[n-1] - (a[n-1]^2-5)/2/a[n-1] 
    ListPlot@Table[Log[10, Log[10, Numerator[ a[i]]]], {i, 1, 25}]
    

    alt text

    so, your numerators are increasing as a double exponential.

    The 10^-16 precision is achieved much before a[25]:

    For[i = 1, i < 5, i++,
     Print["dif[", i, "]= ", N[a[i] - Sqrt[5], 16]]
     ]
    
    dif[1]= 0.01393202250021030
    
    dif[2]= 0.00004313361132141470
    
    dif[3]= 4.160143063513508*10^-10
    
    dif[4]= 3.869915959583412*10^-20  
    

    Afterward, you have start controlling the precision for the division as the Numerator for a[5] has already 20 digits.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I did this tests and the results seems the count function scale linearly. I
I did this in the past, and can't remember the correct command (I think
i did this in msvc 2005. typedef void (*cleanup_t)(); void func(cleanup_t clean) { cleanup_t();
HI i did this code with help of Marc Gravell in Why can't I
I am stress testing a .NET web application. I did this for 2 reasons:
I am interested in writing utf-8 encoded strings to a file. I did this
How did you go about this: did you use exe and dlls or created
this is what I did. is there a better way in python? for k
I did some googling to try to answer this question but even after that
This is making me kind of crazy: I did a mysqldump of a partitioned

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.