FitPoly returning wrong function for some overdetermined systems

clinton shared this problem 6 years ago

The FitPoly command is occasionally returning incorrect functions when provided with points fitting a lower degree curve.

For example,

  1. FitPoly[{(0,0),(-1,1),(1,-1)},2]

should return -x, but returns x.

  1. FitPoly[{(0,0),(-1,1),(1,-1)},1]

returns the correct value -x.

Other examples include

  1. FitPoly[{(1,-1),(0,0),(-1,-1),(2,-4)},3]

This seems to be an issue when the leading coefficient is -1 and the degree is one higher than necessary; the leading coefficient is missing its -1 sign term.

For example,

  1. FitPoly[{(0,1),(1,2),(2,1),(3,-2)},3]

returns x^2+2x+1 instead of -x^2+2x+1.

Best Answer

Thanks, fixed for 5.0.346.0

Comments (1)


Thanks, fixed for 5.0.346.0

© 2023 International GeoGebra Institute