XINDEX - determine index of x with respect to an array of x values
xindex determine index of x with respect to an array of x values
Input:
nx number of x values in array ax
ax array[nx] of monotonically increasing or decreasing x values
x the value for which index is to be determined
index index determined previously (used to begin search)
Output:
index for monotonically increasing ax values, the largest index
for which ax[index]<=x, except index=0 if ax[0]>x;
for monotonically decreasing ax values, the largest index
for which ax[index]>=x, except index=0 if ax[0]