MathAction #23 using exp as a symbol in **



#23 using exp as a symbol in **
last edited 17 years ago by alfredo

Submitted by : (unknown) at: 2007年11月17日T22:13:48-08:00 (18 years ago)
Name :
Axiom Version :
Category : Severity : Status :
Optional subject :
Optional comment :

trigcat.spad
WS> ElementaryFunctionCategory(): Category == with
WS> log : $ -> $ ++ log(x) returns the natural logarithm of x.
WS> exp : $ -> $ ++ exp(x) returns %e to the power x.
WS> "**": (,ドル $) -> $ ++ x**y returns x to the power y.
WS> add
WS> if $ has Monoid then
WS> x ** y == exp(y * log x)
etc
The more such stuff I see, the better is my live experience,
the more efficient is bug identification progress.
Much thanks!
Vladimir
Sunday, January 16, 2005, 7:08:49 PM, you write:
WS> The error apparently comes from EXPR where the implementation is
WS> x**y == exp(y * log(x))
WS> so exp^log(x) is computed as
 
WS> exp(log(x) * log(exp))
WS> which should be ok, but then the system handles log exp and tries to 
simplify it
WS> to the identity map, and not finding the argument.
WS> William
WS> ---
>> 
>> Simpler:
>> 
>> (1) -> exp^3
>> 
>> 3
>> (1) exp
>> Type: Polynomial Integer
>> (2) -> a^log(x)
>> 
>> log(x)
>> (2) a
>> Type: Expression Integer
>> (3) -> exp^log(x)
>> 
>> >> System error:
>> Cannot take first of an empty list
>> 
>> protected-symbol-warn called with (NIL)
>>
------------------------------------------------------------
prior post information --2005年1月17日 22:40:21 -0600
On the other hand, even though as Vladimir Bondareko reported:
> integrate(log^log(z), z)
> 
> >> System error:
> Cannot take first of an empty list
(14) -> log^(log(z))
 Function Selection for log
 Arguments: VARIABLE z
 -> no appropriate log found in Variable z
 -> no appropriate log found in Symbol
 -> no appropriate log found in Variable z
 -> no appropriate log found in Symbol
 Modemaps from Associated Packages
 no modemaps
 Remaining General Modemaps
 [1] FortranExpression(D1,D2,D3) -> FortranExpression(D1,D2,D3)
 from FortranExpression(D1,D2,D3)
 if D1: LIST SYMBOL and D2: LIST SYMBOL and D3 has FMTC
 [2] D -> D from D if D has ELEMFUN
 [1] signature: EXPR INT -> EXPR INT
 implemented: slot $$ from EXPR INT
 Function Selection for ^
 Arguments: (VARIABLE log,EXPR INT)
 [1] signature: (EXPR INT,EXPR INT) -> EXPR INT
 implemented: slot $$$ from EXPR INT
 log(z)
 (14) log
 Type: Expression Integer
(17) -> log^exp(x)
 Function Selection for exp
 Arguments: VARIABLE x
 [1] signature: EXPR INT -> EXPR INT
 implemented: slot $$ from EXPR INT
 Function Selection for ^
 Arguments: (VARIABLE log,EXPR INT)
 [1] signature: (EXPR INT,EXPR INT) -> EXPR INT
 implemented: slot $$$ from EXPR INT
 x
 %e
 (17) log
 Type: Expression Integer
-----------------------------------------------------------------------
Note that both works, and note that when looking for the function ^, the
interpreter recognized VARIABLE log.
-----------------------------------------------------------------------
(17) -> exp^log(x)
 Function Selection for log
 Arguments: VARIABLE x
 [1] signature: EXPR INT -> EXPR INT
 implemented: slot $$ from EXPR INT
 Function Selection for ^
 Arguments: (SYMBOL,EXPR INT)
 [1] signature: (EXPR INT,EXPR INT) -> EXPR INT
 implemented: slot $$$ from EXPR INT
 >> System error:
 Cannot take first of an empty list
protected-symbol-warn called with (NIL)
-----------------------------------------------------------------------
Note that that when looking for the function ^, the interpreter recognized exp
as a SYMBOL, not a VARIABLE as in the case of log.
-----------------------------------------------------------------------
 (18) log
 Type: Variable log
(19) -> exp
 (19) exp
 Type: Symbol
-----------------------------------------------------------------------
On the other hand, "correcting" the difference does not help
-----------------------------------------------------------------------
(3) -> exp:=exp::Variable(exp)
 (3) exp
 Type: Variable exp
(4) -> exp^log(x)
 Function Selection for log
 Arguments: VARIABLE x
 [1] signature: EXPR INT -> EXPR INT
 implemented: slot $$ from EXPR INT
 Function Selection for ^
 Arguments: (VARIABLE exp,EXPR INT)
 [1] signature: (EXPR INT,EXPR INT) -> EXPR INT
 implemented: slot $$$ from EXPR INT
 >> System error:
 Cannot take first of an empty list
protected-symbol-warn called with (NIL)
(4) -> exp
 (4) exp
 Type: Variable exp
(5) )clear all
(1) -> exp(log(x)*log(exp))
 log(exp)log(x)
 (1) %e
 Type: Expression Integer
The implementation x**y = exp(y*log(x)) seems not to be the problem. Clearly
this points to an interpreter bug due to different treatment for log and exp
that runs deep. The error messages originates from lisp, so it may be an error
in LISP (such as a missing quote).
Whether the original 
 integrate(log^log(z),z)
is related to this is not clear.
Bug already existed in NAG version. So may be one of the known ones.
property change --2005年1月17日 22:40:32 -0600
Status: closed => open 
... --kratt6, 2007年12月28日 14:31:14 -0800
Category: Axiom Mathematics => Axiom Library 
fixed in FriCAS revision 393 --kratt6, 2008年9月27日 00:08:20 -0700
Status: open => fixed somewhere 
Fixed in OpenAxiom --gdr, 2008年10月13日 19:43:26 -0700
From Fricas --alfredo, 2008年10月16日 13:26:18 -0700
http://fricas.svn.sourceforge.net/viewvc/fricas?view=rev&revision=393
... --alfredo, 2008年10月16日 13:26:57 -0700
Status: fixed somewhere => fix proposed 



Subject: Be Bold !!
( 15 subscribers )
Please rate this page:

AltStyle によって変換されたページ (->オリジナル) /