[Aimmath-commit] AIM/WEB-INF/maple/aim AnswerHints.mpl,1.1,1.2
Brought to you by:
gustav_delius,
npstrick
|
From: <mo...@us...> - 2003-10-13 21:16:13
|
Update of /cvsroot/aimmath/AIM/WEB-INF/maple/aim
In directory sc8-pr-cvs1:/tmp/cvs-serv7632
Modified Files:
AnswerHints.mpl
Log Message:
improvements to Hints/CheckSigns
Index: AnswerHints.mpl
===================================================================
RCS file: /cvsroot/aimmath/AIM/WEB-INF/maple/aim/AnswerHints.mpl,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** AnswerHints.mpl 10 Oct 2003 15:42:44 -0000 1.1
--- AnswerHints.mpl 13 Oct 2003 21:15:58 -0000 1.2
***************
*** 19,24 ****
is equal to @rightans@.
",
! proc(ans,rightans)
! local And,elt,relt,absans,absrightans,Member;
if type(rightans,InertExpr) then
--- 19,24 ----
is equal to @rightans@.
",
! proc(_ans,_rightans)
! local ans,rightans,And,elt,relt,absans,absrightans,Member;
if type(rightans,InertExpr) then
***************
*** 37,40 ****
--- 37,43 ----
end:
+ # this converts answers like exp(1)^x to exp(x)
+ ans:=simplify(_ans); rightans:=simplify(_rightans);
+
try
if type({ans,rightans},{set(list)}) then
***************
*** 58,67 ****
nops(ans)=nops(rightans) and
`Hints/CheckSigns`([op(ans)],[op(rightans)]);
! elif type({ans,rightans},set(`+`)) or
! type({ans,rightans},set(`*`)) then
! return `Hints/CheckSigns`({op(ans)},{op(rightans)})
elif type({ans,rightans},set(algebraic)) then
return `aim/Test`(abs(ans),abs(rightans))
! fi:
catch : end:
return false;
--- 61,74 ----
nops(ans)=nops(rightans) and
`Hints/CheckSigns`([op(ans)],[op(rightans)]);
! elif type({ans,rightans},set(`+`)) or
! type({ans,rightans},set(`*`))then
! return `Hints/CheckSigns`({op(ans)},{op(rightans)})
! # check if just one of the two is a product and look for x vs -x
! elif (type(rightans,`*`) and member(-1,{op(rightans)})) or
! (type(ans,`*`) and member(-1,{op(ans)})) then
! return `Hints/CheckSigns`(abs(ans),abs(rightans))
elif type({ans,rightans},set(algebraic)) then
return `aim/Test`(abs(ans),abs(rightans))
! fi:
catch : end:
return false;
|