def cubic(x):
ax = abs(asarray(x))<EOL>res = zeros_like(ax)<EOL>cond1 = less(ax, <NUM_LIT:1>)<EOL>if cond1.any():<EOL><INDENT>ax1 = ax[cond1]<EOL>res[cond1] = <NUM_LIT> / <NUM_LIT:3> - <NUM_LIT:1.0> / <NUM_LIT:2> * ax1 ** <NUM_LIT:2> * (<NUM_LIT:2> - ax1)<EOL><DEDENT>cond2 = ~cond1 & less(ax, <NUM_LIT:2>)<EOL>if cond2.any():<EOL><INDENT>ax2 = ax[cond2]<EOL>res[cond2] = <NUM_LIT:1.0> / <NUM_LIT:6> * (<NUM_LIT:2> - ax2) ** <NUM_LIT:3><EOL><DEDENT>return res<EOL>
A cubic B-spline.

    This is a special case of `bspline`, and equivalent to ``bspline(x, 3)``.