I ran into a weird bug with Linear Fit.vi today. It's not a big deal (I don't expect users to stumble onto it during normal operation), but my boss found it when I was demoing the software, and I thought I'd check and see if I'm doing something wrong, or if it's actually a bug in the implementation.
I've attached a VI that reproduces the problem. If you feed the Linear Fit.vi multiple copies of the same point, eg (1,1), for some points the output is not reliably the same. For example, if you input two (1, 1.2) points, it returns NaN for both slope and offset. Sounds good. But if three copies of that point are entered, it returns a slope of 0 and an offset of 1.0. This process continues for various numbers of points, with it changing between NaN, and (0, 1.0) in no obvious pattern. The behavior appears to be different for different starting values.
Is this the expected execution? I would prefer a reliable NaN for any number of matching input points. Is my example doing something funny that gives me these results?
Thanks!
Drew