We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a209eaa commit 10dee49Copy full SHA for 10dee49
069_sqrt/sqrt.c
@@ -29,7 +29,8 @@ static double mySqrt(double n)
29
/* f(x) = (x - x0)f'(x0) - f(x0) = 0 First order of Tylor series */
30
double x = 1.0;
31
while (fabs(x * x - n) > 1e-8) {
32
- x = x - (x * x - n) / (2 * x);
+ // x = x - (x * x - n) / (2 * x);
33
+ x = (x - n / x) / 2;
34
}
35
return x;
36
0 commit comments