Created attachment 130537 [details] graphics of the description above given: 3 points x1/y1; x2/y2; x3/y3 generate: a graph through theses 3 points apply: trendline to approximate this graph; for approximation use second degree polynom for approximation show: formula of the trendline formula is wrong for approximation trendline with second degree polynom approximation (hint: e.g. third degree does not show the mistake) example: (A1/B1) = (-2/4) (A2/B2) = (0/0) (A3/B3) = (2/4) graph through these three points is a normal parabola y(x)=x² trendline looks o.k. but it shows the formula y(x)=4*x²-16*x+16 (wrong!) y(0)=4*0²-16*0+16 (wrong)
it seems you're using an old version of LibreOffice. Could you please try to reproduce it with the latest version of LibreOffice from https://www.libreoffice.org/download/libreoffice-fresh/ ? I have set the bug's status to 'NEEDINFO'. Please change it back to 'UNCONFIRMED' if the bug is still present in the latest version.
problem description in brief: error in approximation formula formula is derived from trendline trendline looks o.k. error applies to approximation with second degree polynom
one of the later Libre Office calc versions (5.1.6.2) shows the same bug
Are you using a *line chart* ? See the LibreOffice Help : https://help.libreoffice.org/Chart/Trend_Lines "If you insert a trend line to a chart type that uses categories, like Line or Column, then the numbers 1, 2, 3, … are used as x-values to calculate the trend line. For such charts the XY chart type might be more suitable." You must use X/Y chart for this purpose.
sorry sirs, the question is not "more suitable" - no matter if chosen "curve" or "line" chart the resulting formula is wrong! - mathematical background: to approximate 3 given x/y points the resulting formula with second square polynom finds all these given points exactly!!! - the correct resulting formula for the 3 points (-2/4) (0/0) (2/4) would be y(x)=x² - the wrong trendline formula found by calc is: y(x) = 4x²-16x+16 - try with (0/0); does y(x)=4x²-16x+16 hit (0/0)? No! - does y(x)=x² hit (0/0) Yes! This bug is serious and I would appreciate if you try see the math behind it and check then what you get from cal Thanks lot!
(In reply to andi from comment #5) > - no matter if chosen "curve" or "line" chart the resulting formula is wrong! > > - mathematical background: to approximate 3 given x/y points the resulting > formula with second square polynom finds all these given points exactly!!! > > - the correct resulting formula for the 3 points (-2/4) (0/0) (2/4) would be > y(x)=x² > > - the wrong trendline formula found by calc is: y(x) = 4x²-16x+16 > - try with (0/0); does y(x)=4x²-16x+16 hit (0/0)? No! > - does y(x)=x² hit (0/0) Yes! As said in the help, with a line chart, trendline equation use 1, 2, 3... as X points. So your 3 points are not (-2/4) (0/0) (2/4) but (1/4) (2/0) (3/4) and (2/0) gives 4*2^2-16*2+16 = 0 If there is a bug here, he is in the help. (not enough explicit)
o.k., I got the concept now and had a wrong understanding of how the trandline is calculated. It is not calculated with the given points (x1/y1) ...(xn/yn) but with (1/y1) ..(n/yn) Thanks for this clarification! I set the status to "resolved". Thanks again!
Since there is no specific commit fixing this issue, setting to WORKSFORME. Or if I understood the discussion correctly it's actually working as expected so NOTABUG is correct here. Feel free to update if you disagree.