BUG with AUTOSIMPLIFY() flag
07-29-2018, 06:56 PM (This post was last modified: 07-30-2018 04:23 PM by compsystems.)
Post: #1 compsystems Senior Member Posts: 1,342 Joined: Dec 2013
BUG with AUTOSIMPLIFY() flag
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 x, y;        assume( x, symbol ); // purge(x);        assume( y, symbol ); // 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 := [ y = x^2, y = 2*x + 3 ]; 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*x + 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
 « Next Oldest | Next Newest »

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