Ticket #2877: bessel.patch
File bessel.patch, 616 bytes (added by , 14 years ago) |
---|
-
bessel.hpp
244 244 if(v == 0.5f) 245 245 { 246 246 // common special case, note try and avoid overflow in exp(x): 247 T e = exp(x / 2); 248 return e * (e / sqrt(2 * x * constants::pi<T>())); 247 if(x >= tools::log_max_value<T>()) 248 { 249 T e = exp(x / 2); 250 return e * (e / sqrt(2 * x * constants::pi<T>())); 251 } 252 return sqrt(2 / (x * constants::pi<T>())) * sinh(x); 249 253 } 250 254 if(policies::digits<T, Policy>() <= 64) 251 255 {