id,summary,reporter,owner,description,type,status,milestone,component,version,severity,resolution,keywords,cc 11535,standard integrate_times function causes tiny time steps,gaiwa84@…,karsten,"Hello! While implementing a new algorithm, I discovered that the function boost::numeric::odeint::detail::integrate_times(...) produces tiny time steps due to numerical accuracy issues (the relative error dt/t < 1e-18 for type long double with 18 significant digits). After changing the function as below, the runge_kutta4 algorithm became about 15% faster for my problem at the same accuracy. But maybe I am missing the reason for the old implementation? Here is the new code with the old stuff commented out: {{{ /* * integrate_times for simple stepper */ template< class Stepper , class System , class State , class TimeIterator , class Time , class Observer > size_t integrate_times( Stepper stepper , System system , State &start_state , TimeIterator start_time , TimeIterator end_time , Time dt , Observer observer , stepper_tag ) { BOOST_USING_STD_MIN(); typename odeint::unwrap_reference< Observer >::type &obs = observer; size_t steps = 0; Time current_dt = dt; while( true ) { Time current_time = *start_time++; obs( start_state , current_time ); if( start_time == end_time ) break; // while( less_with_sign( current_time , *start_time , current_dt ) ) // { current_dt = min BOOST_PREVENT_MACRO_SUBSTITUTION ( dt , *start_time - current_time ); stepper.do_step( system , start_state , current_time , current_dt ); // current_time += current_dt; current_time = *start_time; //THIS IS NEW! steps++; // } } return steps; } }}}",Bugs,new,To Be Determined,odeint,Boost 1.58.0,Optimization,,,