#include DEFUN_DLD (atan32, args, nargout,"atan with integer arithmetic") // for x=z*32767 -1 <= z <= 1 the value of // y = 28878.761*arctan((z+1)/2) will be computed { static int i0 = -32767; static int i1 = +22800; static int i2 = +13357; int x = args(0).int_value(); int r ; r = i1+((i0*x)>>18); r = i2+((x*r)>>16); return octave_value_list (octave_value(r)); }