# Thread: implementing square root function

1. ## implementing square root function

Hi guys, Im facing a serious problem and not finding an optimal way to solve it , I have to implement square root function that gets in its input double x , double toleration and the output must be the value of square root of value x , I musn't use any already built up function like pow or square , I just must use operation / + - *

the toleration parameter is actually how much error deviation possibility , I mean lets assume toleration is 0.1 , and value x is 10 then 3+0.1 is acceptable and 3-0.1 also acceptable .. toleration is the deviation of your error from the correct value of the square root of x ..

thanks alot!

2. Originally Posted by Salem
didn't understand anything there, wtf it's really complicated ..

3. It is mathematics that I was taught in school when I was 15 years old. Anyway, you don't really need to understand the maths beyond knowing that it is an iterative method that is kind of a sophisticated take on the "guess and check" strategy; just implement the given recurrence relation with an initial guess.

4. Originally Posted by laserlight
It is mathematics that I was taught in school when I was 15 years old. Anyway, you don't really need to understand the maths beyond knowing that it is an iterative method that is kind of a sophisticated take on the "guess and check" strategy; just implement the given recurrence relation with an initial guess.
I may didn't understand the algorithm itself, it sounds complicated for me but actually from your words it's not, could you explain it for me in brief words? thanks

5. No, work through the Wikipedia example instead. It provides a better explanation of what to implement than I could say "in brief words".

6. Lazy people are like horses! You can lead them to water; but, you can't make them drink.

Hint: The sample Julia code should help anyone who has the ability to learn to code!

Tim S.

7. > didn't understand anything there, wtf it's really complicated
Try spending more than an hour studying the material before bouncing back with your "feed me" with food already chewed shtick.

That's being generous.