atan, float and special values



I had a look at the simplifying function for the atan function. Some
observations:

1.

For the following arguments 0, 1, -1, sqrt(3), -sqrt(3), 1/sqrt(3),
-1/sqrt(3) the special values of the function atan are implemented.

The simplification depends for all special values on the option variable
%piargs. The default value of %piargs is TRUE and the simplification is
done by Maxima. 

%piargs is not documented to influence the special values of the inverse
trigonometric functions. I think especially for the argument zero the
simplification should not be suppressed by %piargs. Now we have

(%i11) atan(0),%piargs:false;
(%o11) atan(0)

We have this behavior for the trigonometric functions too:

(%i12) tan(0),%piargs:false;
(%o12) tan(0)

(%i13) sin(0),%piargs:false;
(%o13) sin(0)

Perhaps, we should go a step further and implement %piargs only for the
documented case, which are integer multiples of %pi, %pi/2, ...
(excluding the zero).

2.

I think the implementation of the option variable $float makes it
necessary to pass all expressions with rationals through the simplifier.
I am guilty too not to have followed this rule in all places and to have
changed code in the wrong direction. I think I have found a good example
with the atan function to show the problem:

First, what the option variable $float is supposed to do:

(%i19) %pi/4,float;
(%o19) 0.25*%pi

This is the simplification for the arguments 1 and -1:

(%i22) atan([1,-1]);
(%o22) [%pi/4,-%pi/4]

And now the inconsistent results with the evaluation flag $float:

(%i23) atan([1,-1]),float;
(%o23) [%pi/4,-0.25*%pi]

The case atan(1) does not simplify as expected. The reason is, that in
simp-%atan we return for the case atan(1) a constant expression which
does not go through the simplifier.

3. 

The function atan does not handle any of the infinities and
indeterminates:

(%i27) atan([inf,minf,infinity,ind,und]);
(%o27) [atan(inf),atan(minf),atan(infinity),atan(ind),atan(und)]

At least we should handle cases like

   atan(inf)  -> %pi/2
   atan(minf) -> -%pi/2

and perhaps

   atan(und)  -> und

Dieter Kaiser