HP Forums
BUG with AUTOSIMPLIFY() flag - Printable Version

+- HP Forums (https://www.hpmuseum.org/forum)
+-- Forum: HP Calculators (and very old HP Computers) (/forum-3.html)
+--- Forum: HP Prime (/forum-5.html)
+--- Thread: BUG with AUTOSIMPLIFY() flag (/thread-11141.html)



BUG with AUTOSIMPLIFY() flag - compsystems - 07-29-2018 06:56 PM

Hello, the following program with simplify: Maximum must print (x^2-2*x-3) = 0 and not (-2*x-3+x^2) = (2*x+3-2*x-3). The xcas programs are assuming simplify: none.

I think the AUTOSIMPLIFY() xcas command must be incorporated to control the output of the print

Thanks

place manually [shift][cas] simplify: Maximum
PHP Code:
#cas
        
test_simplify_flag():=
    
BEGIN
        
        local  list0
,expr0;
        
local xy;
        
assumexsymbol ); // purge(x);
        
assumeysymbol ); // purge(y);
        
        
autosimplify(2); // nop=none, 1=regroup, 2=simplify
        
print;
        print(
"Solving a system of two equations.  
Solve the  following system  [ y=x², y=2x+3 ]"
);

        
list0 := [ x^22*]; print(list0);

        print(
""); print("> substitute y = x² in y = 2·x + 3");
        
expr0 := subst(list0(2),list0(1)); print(expr0);

        print(
""); print("> substract 2·x + 3");
        
expr0 := expr0-(2*3); print(expr0);
        Return 
"Done";
    
END;
#end 

test_simplify_flag(); print (-2*x-3+x^2) = (2*x+3-2*x-3) and not x^2-2*x-3= 0