Found my problem. It turned out the answer is: the protected division in ECJ (the one in ecj\ec\app\regression\func)and the one in Matlab, which is from GPLAB are different. The answer from ECJ protected division equals one if denominator is zero. The answer for GPLAB's protected division is numerator if denominator is zero. :) which one is better? Zheng