I gave it a further try to resolve the inconsistencies observed. I did commit addition files to
github.com/Matttab/spline-examples
including a translation to GNU octave of SPLINE_FEED for 4 input arguments generating a 2nd order polynomial and for SPLINE_FEED using 6 input arguments generating the most commonly used 3rd order polynomial.
I agree with previous posts - it is a Bezier type of spline going from startpoint at P0=(x0,y0) to the endpoint P3=(x3,y3). The interior points P1 and P2 are not way points, but so-called control points, defining the actual shape of the curve.
File Attachment:
An example fit of one cubic spline segment to 4 way points and the subsequent high-resolution interpolation is given on github.
The required control points can be calculated from the derivatives of your spline at the start and end of each segment. For any G5 move, the first Point x1,y1 will define the initial slope. This should match the slope of any precedent straight line G1 move, or any precedent G5 slope at end point. The second Point x2,y2 will define the end slope. This should match the slope of any subsequent straight line G1 move, or any subsequent G5 slope at start point.
For any repeated and smoothly attached spline segment G5(P,Q), the initial slope will already be defined by the previous G5 P and Q arguments. This is why I,J are only required for the first segment in a multi-segment spline.
As far as I understand it, I,J, P, and Q are actually absolute coordinates. However, I,J relative to x0,y0 define the initial slope and P,Q, relative to x3,y3 define the end slope - that's the relative interpretation.