Thanks for the second post. I verified everything that you reported although I am sure that there is no bug involved...Origin is mathematically correct in everything that was done.
So, I copy/pasted your raw (un-logged data) into a worksheet named Data1 containing columns A(X) and B(Y) and ran the following script:
get Data1_A -e npts;
The script is not pretty but it works. It essentially implements your formula. We generally don't provide complete scripts but this was easy enough to do given your formula. All I did was add the for loop and change your variable names. X1, X2, Y1, and Y2 are reserved system variables in Origin.
The script typed out the correct result in the script window:
I hope this is helpful.
[This message has been edited by Gary Lane (edited 02-07-2000).]