Suppose x is sqrt(2)/2
(about 0.707). Your function recursively calls itself with the parameter sqrt(1-x*x)
, which is equal to x
. This will lead to a stack overflow due to infinite recursion.
The same will happen for other values of x
around that value.