f # time size 8 a n1 b n2 c n3 d . . .
This subroutine will generate a piecewise cubic spline curve, the smoothest possible through all specified points.
size – number of points in the table. Must be a power of 2 or power-of-2 plus 1 (see f statement).
a, b, c ... - ordinate values of the function.
n1, n2, n3 ... - length of each segment measured in stored values. May not be zero, but may be fractional. A particular segment may or may not actually store any values; stored values will be generated at integral points from the beginning of the function. The sum n1 + n2 + ... will normally equal size for fully specified functions.
GEN08 constructs a stored table from segments of cubic polynomial functions. Each segment runs between two specified points but depends as well on their neighbors on each side. Neighboring segments will agree in both value and slope at their common point. (The common slope is that of a parabola through that point and its two neighbors). The slope at the two ends of the function is constrained to be zero (flat).
Hint: to make a discontinuity in slope or value in the function as stored, arrange a series of points in the interval between two stored values; likewise for a non-zero boundary slope.
f 1 0 65 8 0 16 0 16 1 16 0 16 0
This example creates a curve with a smooth hump in the middle, going briefly negative outside the hump then flat at its ends.
f 2 0 65 8 0 16 0 .1 0 15.9 1 15.9 0 .1 0 16 0
This example is similar, but does not go negative.