[BUG?] Wrong numeric result with CAS fsolve/zeros/solve
12-19-2016, 04:15 AM
Post: #1
 danielmewes Junior Member Posts: 29 Joined: Dec 2014
[BUG?] Wrong numeric result with CAS fsolve/zeros/solve

and can confirm that all of the following result in the wrong root 0 on the Prime:
zeros(x^4 - 3x^3 - 2.75x^2 + 12x - 5)
solve(x^4 - 3x^3 - 2.75x^2 + 12x - 5 = 0)
fsolve(x^4 - 3x^3 - 2.75x^2 + 12x - 5 = 0)
-> [2.5, 2., -2., 0]

The correct result would be:
-> [2.5, 2., -2., 0.5]

Firmware version: 2016 08 29 (10637)

The same commands work correctly with giac 1.2.2.

Also, the exact version works on the Prime:
zeros(x^4 - 3x^3 - (275/100)*x^2 + 12x - 5)
-> [2, -2, 5/2, 1/2]

This looks more significant than a small rounding error.
12-19-2016, 07:53 AM
Post: #2
 danielmewes Junior Member Posts: 29 Joined: Dec 2014
RE: [BUG?] Wrong numeric result with CAS fsolve/zeros/solve
Another case that's not affected is when I give a parameter range to solve:
solve(x^4 - 3x^3 - 2.75x^2 + 12x - 5 = 0, x=(-3)..3)
12-19-2016, 04:37 PM
Post: #3
 parisse Senior Member Posts: 1,086 Joined: Dec 2013
RE: [BUG?] Wrong numeric result with CAS fsolve/zeros/solve
This has been fixed in the source code, I forgot to report it here.
12-19-2016, 06:47 PM
Post: #4
 Jan_D Member Posts: 69 Joined: Nov 2016
RE: [BUG?] Wrong numeric result with CAS fsolve/zeros/solve
I have the Android app and noticed the same problem in version 8151.

I had reasons to believe that the bug had been solved in the most recent update, but now I have updated my app to version 2016 12 08 (11226), CAS Version: 1.1.2 – 11, and I still have the same problems.

http://h30434.www3.hp.com/t5/Calculators...-p/5269068
12-20-2016, 03:18 AM
Post: #5
 danielmewes Junior Member Posts: 29 Joined: Dec 2014
RE: [BUG?] Wrong numeric result with CAS fsolve/zeros/solve
Jan, the calculator firmware is lagging a bit behind the latest CAS source code. I think we have to wait for a future update until the fix actually ships.
12-20-2016, 01:14 PM
Post: #6
 Jan_D Member Posts: 69 Joined: Nov 2016
RE: [BUG?] Wrong numeric result with CAS fsolve/zeros/solve
(12-20-2016 03:18 AM)danielmewes Wrote:  Jan, the calculator firmware is lagging a bit behind the latest CAS source code. I think we have to wait for a future update until the fix actually ships.
Hello Danielmewes,

Can you, or anyone else, explain why Maké in message 12 of this thread:

http://h30434.www3.hp.com/t5/Calculators...068/page/2

can get the correct factorisation of the polynomial with version 10077 on his calculator, whereas I, on my Android app, and the most recent update,
version 2016 12 08 (11226), CAS version 1.1.2 – 11,
get the wrong factorisation, namely a factor x instead of (x-1.0)?
12-20-2016, 01:54 PM (This post was last modified: 12-20-2016 01:55 PM by toml_12953.)
Post: #7
 toml_12953 Senior Member Posts: 1,344 Joined: Dec 2013
RE: [BUG?] Wrong numeric result with CAS fsolve/zeros/solve
(12-19-2016 04:15 AM)danielmewes Wrote:  I was reading this post in another forum http://forum.hp-prime.de/showthread.php?tid=183

and can confirm that all of the following result in the wrong root 0 on the Prime:
zeros(x^4 - 3x^3 - 2.75x^2 + 12x - 5)
solve(x^4 - 3x^3 - 2.75x^2 + 12x - 5 = 0)
fsolve(x^4 - 3x^3 - 2.75x^2 + 12x - 5 = 0)
-> [2.5, 2., -2., 0]

The correct result would be:
-> [2.5, 2., -2., 0.5]

Firmware version: 2016 08 29 (10637)

The same commands work correctly with giac 1.2.2.

Also, the exact version works on the Prime:
zeros(x^4 - 3x^3 - (275/100)*x^2 + 12x - 5)
-> [2, -2, 5/2, 1/2]

This looks more significant than a small rounding error.

On the Windows Virtual Calculator (build 11226), it's weird but the second function (solve) gets it right but the first and third get it wrong, as you have noted.

Tom L

Tom L
...other than that, Mrs. Lincoln, what did you think of the play?
 « Next Oldest | Next Newest »

User(s) browsing this thread: 1 Guest(s)
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 1, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.25881707668304443, "perplexity": 7930.154224117207}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2020-16/segments/1585370496227.25/warc/CC-MAIN-20200329201741-20200329231741-00199.warc.gz"}