stan-dev/stan — pull request #871 by syclik (2014-08-14 04:38:26+00:00)
Title: Feature/issue 854 ibeta nan

#### Summary:

Make `stan::math::ibeta` more safe by throwing exceptions with NaN inputs.

#### Intended Effect:

`stan::math::ibeta` now throws std::domain_error exceptions on NaN inputs for any of its 3 arguments.
This fixes the behavior to be more correct. Under certain parameter values, `stan::math::ibeta` was returning 0 for NaN inputs.

The code fix was to add calls to `check_not_nan` for each of the 3 parameters. The underlying boost math ibeta function checks the bounds of the parameters.

#### How to Verify:

See unit test in src/test/unit/math/functions/ibeta_test.cpp.

#### Side Effects:

None. It would have been difficult to have stumbled on this behavior.

#### Documentation:

Added some C++ level API doc.

#### Reviewer Suggestions:

Anyone.