I do auto ranging based on a step size per number unit. So if your function runs from 0 to 5 and you ask for 5 steps per number, then you would end up with 5*5+1 = 26 max steps. The +1 comes from the initial value at the start of the range, then you would do 5 steps in the 1 interval, 5 steps in the 2 interval, and so on.
Source code is here:
The example program, you pass in the starting value, the start and end points, the step per unit, and the function you are interpolating.
The object does the rest with the interface below:
The Object Interface to the Runge-Kutta module.
Once you create an object you can retrieve all the properties and data values for the object.
When you are done, you dispose the object to free the memory.
The output for the example from the book, exact same values.