To use the complex version of sqrt(), you will need to make the value into a complex number FIRST, then call sqrt(), e.g.
Code:
    complex<double> num = sqrt(complex<double>(-2.0 * sigma * sigma * log(1.0 - x), 0));
Otherwise, it will just call the regular sqrt(double) function, which of course doesn't understand how to deal with the negative value.

--
Mats