Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.
Hi all, please see this major site announcement: https://www.boards.ie/discussion/2058427594/boards-ie-2026

Calculation Of Roots

  • 13-05-2006 02:03PM
    #1
    Closed Accounts Posts: 6,151 ✭✭✭


    Purely out of curiousity, i was just wondering if anyone knows how exactly Caluclators and computers calculate roots of numbers?
    Is it simply a case of a Binary search or is there more a more efficient method to do the job?


Comments

  • Closed Accounts Posts: 1,475 ✭✭✭Son Goku


    Call x the square root.

    Lets say x^2 = b.
    x can be found using new_x = (1/2)(guess_x + b/(guess_x)).
    And then you perform this process over and over again.

    So let's say we want to find the square root of 26.
    (Whose root is 5.099.........)

    x^2 = 26, so b = 26.

    Our first guess will be x = 1, so

    new_x = (1/2)(1 + 26/1) = 27/2 = 13.5

    13.5 becomes our new guess_x.
    So, again:
    new_x = (1/2)(13.5 + 26/13.5) = 7.7129........

    Again:
    new_x = (1/2)(7.7129 + 26/7.7129) = 5.54193..........

    So you get closer and closer to the root.

    A calculator does this process about 200 times to get a square root for you.


  • Registered Users, Registered Users 2 Posts: 3,608 ✭✭✭breadmonkey


    On a barely related note, how do you prove the formula for the roots of a quadratic equation? I knew it many moons ago but have forgotten.


  • Registered Users, Registered Users 2 Posts: 1,080 ✭✭✭Crumbs


    On a barely related note, how do you prove the formula for the roots of a quadratic equation? I knew it many moons ago but have forgotten.
    Start with ax² + bx + c = 0

    Divide across by a (where a≠0) and then complete the square on the first two terms.

    The rest is left as an exercise to the reader.


  • Closed Accounts Posts: 6,151 ✭✭✭Thomas_S_Hunterson


    Son Goku wrote:
    Call x the square root.

    Lets say x^2 = b.
    x can be found using new_x = (1/2)(guess_x + b/(guess_x)).
    And then you perform this process over and over again.

    So let's say we want to find the square root of 26.
    (Whose root is 5.099.........)

    x^2 = 26, so b = 26.

    Our first guess will be x = 1, so

    new_x = (1/2)(1 + 26/1) = 27/2 = 13.5

    13.5 becomes our new guess_x.
    So, again:
    new_x = (1/2)(13.5 + 26/13.5) = 7.7129........

    Again:
    new_x = (1/2)(7.7129 + 26/7.7129) = 5.54193..........

    So you get closer and closer to the root.

    A calculator does this process about 200 times to get a square root for you.
    Ahhhh makes sense to see it with figures, thanks a mil


Advertisement
Advertisement