Bug 418597 - Incorrect plot on function (x-0.7)^2+3*(x-0.7)
Summary: Incorrect plot on function (x-0.7)^2+3*(x-0.7)
Status: RESOLVED FIXED
Alias: None
Product: kalgebra
Classification: Applications
Component: general (other bugs)
Version First Reported In: 19.12
Platform: Debian testing Linux
: NOR normal
Target Milestone: ---
Assignee: Aleix Pol
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-03-07 21:49 UTC by Alexander Kernozhitsky
Modified: 2020-03-16 18:50 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alexander Kernozhitsky 2020-03-07 21:49:08 UTC
STEPS TO REPRODUCE
1. Make a plot with the function "(x-0.7)^2+3*(x-0.7)"

OBSERVED RESULT
The function never passes through zero.

EXPECTED RESULT
The function must pass through zero when x = 0.7.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: 
(available in About System)
KDE Plasma Version: 5.17.5
KDE Frameworks Version: 5.62.0
Qt Version: 5.12.5
Comment 1 MatFi 2020-03-08 12:59:30 UTC
Observed something similar. Seems to be a problem with the parser:
Your equation 
(x-0.7)^2+3*(x-0.7) 
evaluates to 
(x-0.7)^2+x+0.7
when typed in the calculator. 
Actually KAlgebra seems to ignore any factor before and after a bract containing a variable:
1+43*(x+1)
=x+2
Comment 2 Aleix Pol 2020-03-16 18:49:52 UTC
Git commit b6d775bbe32aabed2631d124c419313a70bfd1a2 by Aleix Pol.
Committed on 16/03/2020 at 18:48.
Pushed by apol into branch 'master'.

Don't try to optimize out certain polynomials

M  +1    -1    analitza/polynomial.cpp
M  +1    -1    analitza/polynomial.h
M  +1    -0    analitza/tests/analitzatest.cpp

https://commits.kde.org/analitza/b6d775bbe32aabed2631d124c419313a70bfd1a2
Comment 3 Aleix Pol 2020-03-16 18:50:09 UTC
Problem fixed, thank you very much for reporting! :)