```python
import math


def sqrt_newton(num):
    y = num / 2.0
    while abs(y * y - num) > 0.00000001:
        y = ((y * 1.0) + (1.0 * num) / y) / 2.0000
    return y


def sqrt_binary_search(num):
    y = num / 2.0
    low = 0.0
    up = num * 1.0
    while abs(y * y - num) > 0.00000001:
        if (y * y > num):
            up = y
            y = low + (y - low) / 2
        else:
            low = y
            y = up - (up - y) / 2
    return y


print(sqrt_binary_search(2))
print(sqrt_newton(2))
print(math.sqrt(2))
```
