Post Reply 
Bug in CAS mode with function defined as definite integral
05-12-2023, 11:07 AM (This post was last modified: 05-12-2023 03:10 PM by GafSlaffe.)
Post: #1
Bug in CAS mode with function defined as definite integral
I found an interesting bug with HP Prime memory management when using CAS mode to define variable as function using definite integral. Executing int(1,u,0,1) in CAS mode works and there is no problems. Defining fun2:=(x)->int(1,u,0,1) CAS variable also works.

If we execute fun2(1) while it returns correct value, it creates new CAS variable. With it's name not really constant it changes during any operations and view changes of the calculator. After executing it again we see another CAS variable the same behaviour. This behaviour is independent of the integral itself it simply must be definite integral. What's even more interesting is that it fails to run a third time and instead of result it returns fun2(1) and doesn't add any more CAS variables, however this behaviour seems to depend on integral itself and with some integrals it continuous to return correct values even after third execution while also creating those weird CAS variables with each execution.

Additionally I also found an interesting behaviour with define key if we define function as int(1,U,0,X) it suggests X and U as input variables while ∫(1,U,0,X) suggests correctly only X as input variable. If we define ∫(1,U,0,X) as fun(X) using define key and execute this function in HOME it works perfectly fine. If we execute it in CAS mode it returns correct result but also creates those new CAS variables that should not exist after each execution.

This was tested on virtual calculator 2.1.14730 version on PC windows 10.
On my hardware rev D 2.1.14603 executing fun2(1) also creates such variables and returns correct values however other behaviour was not tested on it because sadly I actually need my hardware calculator for regular calculations and have only one and this bug is probably connected to memory leaks and overwriting memory and I don't want to risk it considering HP Prime is known to have problems with it's memory management.

   
Find all posts by this user
Quote this message in a reply
05-12-2023, 08:39 PM
Post: #2
RE: Bug in CAS mode with function defined as definite integral
Hi, GafSlaffe

I had observed the same memory leak issue, which get "fixed" with a hardware reset.

(05-19-2021 04:56 PM)Albert Chan Wrote:  Parameters of function also required declared as local variables.
I had discovered this when checking memory of Cas variables.

I would have guessed parameters local by default ... weird.
Find all posts by this user
Quote this message in a reply
Post Reply 




User(s) browsing this thread: 1 Guest(s)