Barton Willis | 1 Dec 2005 14:36
Favicon

advice on lognumer


I would like to modify log so that it uses the CL log function
for complex double float arguments. Doing this isn't difficult,
but I don't know what to do with things like log(1.2 + %i*5.6)
when 'lognumer' is true. If you don't know, lognumer makes
log *sometimes* behave as log composed with abs.

(%i1) lognumer : true$
(%i2) float(log(-5));
(%o2) 1.6094379124341003

bfloat (and rectform) ignores lognumer:

(%i3) bfloat(log(-5));
(%o3) 3.141592653589793B0*%i+1.6094379124341B0

log is really messed up when lognegint == true
and lognumer == true:

(%i4) lognegint : true$
(%i5) log(-5);
(%o5) log(5)+%i*%pi
(%i6) log(-5.0);
(%o6) 1.6094379124341003

The function 'plog' matches my expectations:

(%i7) plog(-5);
(%o7) log(5)+%i*%pi
(%i8) plog(-5.0);
(Continue reading)

Raymond Toy | 1 Dec 2005 15:35
Picon
Favicon

Re: emaxima: case sensitivity and more

>>>>> "Klaus" == Schnitzlein  <Prof.> writes:

    Klaus> using emaxima I encountered that lower case letters are generally
    Klaus> transformed into capital letters in the TeX output.
    Klaus> Is there a way to prevent this?

I'm not familiar with emaxima, so I can't help there.

    Klaus> Moreover, I recognized that sometimes variables consisting of a letter
    Klaus> and a number, i.e. c1, are represented as C_1 in TeX-output, but this
    Klaus> is not true for any number.
    Klaus> How can I understand that or how can I fix this problem?

What version of maxima are you running.  The current CVS version does
this:

tex(abc123) -> $$abc_{123}$$

    Klaus> In addition, greek letters are as far as I know are converted to their
    Klaus> representative TeX-analogue, i.e. Phi --> \Phi. Is this true for
    Klaus> every greek character?

A quick look through src/mactex.lisp says these lowercase variables
are converted to lowercase TeX Greek characters:

    alpha beta gamma delta epsilon zeta eta theta iota kappa mu nu xi
    pi rho sigma tau upsilon phi chi psi omega

I can't remember if this is all of the Greek letters or not.  The
following uppercase variables are converted to uppercase Greek
(Continue reading)

Albert Reiner | 1 Dec 2005 16:52
Picon
Favicon

Re: emaxima: case sensitivity and more

[Raymond Toy <raymond.toy <at> ericsson.com>, Thu, 01 Dec 2005 09:35:49 -0500]:
> I can't remember if this is all of the Greek letters or not.  The

lambda is missing (which might not be surprising).

>     Gamma Delta Theta Lambda Xi Pi Sigma Upsilon Phi Psi Omega
> 
> I think all the other uppercase letters are the same as the uppercase
> Roman letters, so nothing special is done for them.

nit: They look the same as some unrelated Roman letter (and only with
poor typography).

Albert.
Robert Dodier | 1 Dec 2005 16:53
Picon

Re: advice on lognumer

On 12/1/05, Barton Willis <willisb <at> unk.edu> wrote:
>
> I would like to modify log so that it uses the CL log function
> for complex double float arguments. Doing this isn't difficult,
> but I don't know what to do with things like log(1.2 + %i*5.6)
> when 'lognumer' is true. If you don't know, lognumer makes
> log *sometimes* behave as log composed with abs.

maybe we can just cut out lognumer.
it makes a mess, and i'm not seeing the usefulness of it.

robert
Ryan Krauss | 1 Dec 2005 16:45
Picon

Re: emaxima: case sensitivity and more

lambda and omicron are the only two greek letters not in that list.

On 12/1/05, Raymond Toy <raymond.toy <at> ericsson.com> wrote:
> >>>>> "Klaus" == Schnitzlein  <Prof.> writes:
>
>     Klaus> using emaxima I encountered that lower case letters are generally
>     Klaus> transformed into capital letters in the TeX output.
>     Klaus> Is there a way to prevent this?
>
> I'm not familiar with emaxima, so I can't help there.
>
>     Klaus> Moreover, I recognized that sometimes variables consisting of a letter
>     Klaus> and a number, i.e. c1, are represented as C_1 in TeX-output, but this
>     Klaus> is not true for any number.
>     Klaus> How can I understand that or how can I fix this problem?
>
> What version of maxima are you running.  The current CVS version does
> this:
>
> tex(abc123) -> $$abc_{123}$$
>
>     Klaus> In addition, greek letters are as far as I know are converted to their
>     Klaus> representative TeX-analogue, i.e. Phi --> \Phi. Is this true for
>     Klaus> every greek character?
>
> A quick look through src/mactex.lisp says these lowercase variables
> are converted to lowercase TeX Greek characters:
>
>     alpha beta gamma delta epsilon zeta eta theta iota kappa mu nu xi
>     pi rho sigma tau upsilon phi chi psi omega
(Continue reading)

Richard Fateman | 1 Dec 2005 17:19
Picon
Favicon

Re: advice on lognumer

As a general rule, it is probably a mistake to
say
"I don't know what this does, so I'll take it out of Maxima".

It would be supportive of a change if you could say
"The commercial Macsyma made this change".  Then
at least the 20 years or so of development of Symbolics
and Macsyma Inc came to the same conclusion.

In this case lognumer is still in Macsyma.  It is
set to false by default, and thus does no harm, except
to make some programs clumsy, I gather.

I suspect that lognumer somehow comes from the needs of calculus
students who haven't learned about complex numbers and
use Macsyma for their homework.

RJF

Robert Dodier wrote:

> On 12/1/05, Barton Willis <willisb <at> unk.edu> wrote:
> 
>>I would like to modify log so that it uses the CL log function
>>for complex double float arguments. Doing this isn't difficult,
>>but I don't know what to do with things like log(1.2 + %i*5.6)
>>when 'lognumer' is true. If you don't know, lognumer makes
>>log *sometimes* behave as log composed with abs.
> 
> 
(Continue reading)

Robert Dodier | 1 Dec 2005 18:03
Picon

Re: advice on lognumer

On 12/1/05, Richard Fateman <fateman <at> cs.berkeley.edu> wrote:

> As a general rule, it is probably a mistake to say
> "I don't know what this does, so I'll take it out of Maxima".

agreed, i guess, except that it's clear enough what
lognumer does; the question is whether what it does is useful.

> In this case lognumer is still in Macsyma.  It is
> set to false by default, and thus does no harm, except
> to make some programs clumsy, I gather.

there is definitely some harm, namely that its continued
presence makes it more difficult to program correct
algorithms for evaluation of logarithms.

> I suspect that lognumer somehow comes from the needs of
> calculus students who haven't learned about complex numbers
> and use Macsyma for their homework.

well, that doesn't seem like a pressing need, then.

backwards compatibility takes a back seat to consistency
and correctness, in my not so humble opinion.

for what it's worth,
robert dodier
Richard Fateman | 1 Dec 2005 18:29
Picon
Favicon

Re: advice on lognumer

I think we can make lognumer really hard to change to true
by adding it to some list kept by msetq.

I think that the "killer application" for maxima, if there is
one, is education., so needs of calc students may, in fact,
be important in that context.
RJF
Barton Willis | 1 Dec 2005 19:54
Favicon

Re: advice on lognumer

maxima-admin <at> math.utexas.edu wrote on 12/01/2005 11:29:36 AM:

> I think we can make lognumer really hard to change to true
> by adding it to some list kept by msetq.
> 
> I think that the "killer application" for maxima, if there is
> one, is education., so needs of calc students may, in fact,
> be important in that context.
> RJF

(0) I think some Maxima features were added just because
somebody thought it was cute at the moment. Inertia 
preserves the feature. I don't know, but it doesn't
seem that every Maxima feature was subject to a rigorous 
review.

(1) The 'logabs' option should keep calculus students
and teachers happy. 

(2) When lognumer is true, I sill don't know what to
do with log(1.23 + %i * 0.97). That's my question. 

Barton
Richard Fateman | 1 Dec 2005 20:16
Picon
Favicon

Re: advice on lognumer

How are features removed from other open source
code (e.g. linux?)

There are many features of macsyma/maxima that are
preserved because of inertia, and some of them have
even been preserved in Mathematica. 
At one point I thought about writing a manual marking
certain features with a small icon of a toilet, meaning
"this is a feature we would like to flush".

lognumer hasn't bothered me, but perhaps you could
issue a warning message and drop the imaginary part.

There are times when you might end up computing
log(-3.0 + 1.0d-300* %i)  ... where the imaginary part
is really the result of roundoff somewhere.

in commercial macsyma,  log(-3)  or bfloat(log(-3))
ignore the lognumer flag and return  + %i*%pi or
a numerical approximation. They also ignore the logabs flag.



RJF






Barton Willis wrote:
maxima-admin <at> math.utexas.edu wrote on 12/01/2005 11:29:36 AM:
I think we can make lognumer really hard to change to true by adding it to some list kept by msetq. I think that the "killer application" for maxima, if there is one, is education., so needs of calc students may, in fact, be important in that context. RJF
(0) I think some Maxima features were added just because somebody thought it was cute at the moment. Inertia preserves the feature. I don't know, but it doesn't seem that every Maxima feature was subject to a rigorous review. (1) The 'logabs' option should keep calculus students and teachers happy. (2) When lognumer is true, I sill don't know what to do with log(1.23 + %i * 0.97). That's my question. Barton

Gmane