That the first is 0 and the second is 0.0 seems correct to me: exact inputs
should give exact outputs; inexact inputs should give inexact outputs.
But I agree that sqrt(2.0)*sqrt(2) should give 1.0, not 1.414*sqrt(2).
Presumably the simplifier doesn't currently do this because it often
requires a second pass over the expression.
The simplest approach would resimplify anything of the form <float>*<stuff>
with numer=t. But that would, e.g. give sqrt(2.0)*%e^(%i*%pi*n) =>
sqrt(2.0)*%e^(3.14*%i*n). Substituting an integer for *n* into that gives
a result with a non-zero imaginary part.
-s
On Mon, Dec 24, 2012 at 11:56 AM, Richard Fateman <fateman at eecs.berkeley.edu
> wrote:
> 1-sqrt(2)*sin(atan(1));
> 1.0-sqrt(2.0)*sin(atan(1.0));
> 1.0-sqrt(2.0)*sin(atan(1));
> 1-sqrt(2)*sin(atan(1.0));
>
> All return different expressions.
> Hint: the first one is 0.
>
> RJF
>
> ______________________________**_________________
> Maxima mailing list
> Maxima at math.utexas.edu
> http://www.math.utexas.edu/**mailman/listinfo/maxima<http://www.math.utexas.edu/mailman/listinfo/maxima>
>