Modify

Ticket #6367 (closed Bugs: fixed)

Opened 2 years ago

Last modified 2 years ago

new 'Added new series evaluation methods to the cyclic Bessel I, J, K and Y functions'-code leads to overflow errors with gcc 4.1.2

Reported by: t.hisch@… Owned by: johnmaddock
Milestone: To Be Determined Component: math
Version: Boost 1.48.0 Severity: Problem
Keywords: Cc:

Description

This simple code works with boost 1.47 but generates an overflow error with boost 1:47 when compiled with gcc-4.1.2

./a.out terminate called after throwing an instance of 'boost::exception_detail::clone_impl<boost::exception_detail::error_info_injector<std::overflow_error> >'

what(): Error in function boost::math::bessel_yn<e>(e,e): Overflow Error

cyl_hankel1: -25 8 Aborted

#include <boost/math/special_functions.hpp>                                                                                                                             
                                                                                                    
// Define outgoing Hankel 1 function and its derivative                                             
template <class T1, class T2>                                                                       
inline typename std::complex<double> cyl_hankel1(T1 v, T2 x)                                        
{                                                                                                   
    using namespace boost::math::policies;                                                          
    using namespace boost::math;                                                                    
                                                                                                    
    return std::complex<double>(boost::math::cyl_bessel_j(v, x), boost::math::cyl_neumann(v, x));   
}                                                                                                   
                                                                                                    
int main(void){                                                                                     
    using namespace std;                                                                            
    double r=1.0;                                                                                   
    double k=8.0;                                                                                   
    int nft_ = -25;                                                                                 
                                                                                                    
    cout << "cyl_hankel1: " << nft_ << " " << k*r << " ";                                           
    cout << abs(imag(cyl_hankel1(nft_,k*r))) << endl;                                               
    return 0;                                                                                       
  }         

Attachments

Change History

comment:1 Changed 2 years ago by t.hisch@…

Sry for the Typo. It should be: "This simple code works with boost 1.47 but generates an overflow error with boost 1.48 when compiled with gcc-4.1.2"

comment:2 Changed 2 years ago by johnmaddock

  • Status changed from new to closed
  • Resolution set to fixed

(In [76373]) Correct overflow logic in Bessel Y and add new test case. Fixes #6367.

comment:3 Changed 2 years ago by johnmaddock

(In [76377]) Document Bessel function fix. Update TODO list. Regenerate docs. Refs #6367.

comment:4 Changed 2 years ago by t.hisch@…

Thx, this seems to work!

comment:5 Changed 2 years ago by johnmaddock

(In [76445]) Merge fix for #6367. Refs #6367.

View

Add a comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
The resolution will be deleted. Next status will be 'reopened'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.