Ticket #6151: laplace.patch

File laplace.patch, 571 bytes (added by Yan Zhou <zhouyan@…>, 11 years ago)

fix the bug

  • boost/math/distributions/laplace.hpp

     
    213213   }
    214214
    215215   // Cdf interval value
    216    if (-x < location)
    217       result = exp( (-x-location)/scale )/2;
     216   if (-x < -location)
     217      result = exp( (-x+location)/scale )/2;
    218218   else
    219       result = 1 - exp( (location+x)/scale )/2;
     219      result = 1 - exp( (-location+x)/scale )/2;
    220220
    221221   return result;
    222222} // cdf complement