Algorithm to find square root of an algorithm
This is based on Newtons method.
private static double ss(double num)
{
double x0,x1=1;
if(num<0)
{
System.out.println("Negative Input not valid");
}
do
{
x0=x1;
x1=(1/2.0)*( x0 + num/x0);
}while((x1-x0)>0.00000000000009 || x0-x1>0.00000000000009);
return x1;
}