Improved the calculation in _rpam.c, now it works for both linear and
exp grid