On 5/28/13 10:11 PM, Peter Li wrote:
> In src/test/agrad/rev/inv_sqrt_test.cpp:
>
>> @@ -0,0 +1,15 @@
>> +#include <stan/agrad/rev/inv_sqrt.hpp>
>> +#include <test/agrad/util.hpp>
>> +#include <gtest/gtest.h>
>> +
>> +TEST(AgradRev,inv_sqrt) {
>
> Ah, so I should include if statements inside sqrt and pow that throws an exception when a sqrt is taken of a negative
> number?

For now, just follow the behavior of the std lib and
return sqrt(-1) if that's the input.  It will return
NaN and set the appropriate error flag.

- Bob