begin replacing ALGLIB with boost::math