axiom-developer
[Top][All Lists]

 From: wyscc Subject: [Axiom-developer] [#119 solve returns wrong answers and multiple answers to same trig problem] Why Complex Float? Date: Thu, 10 Mar 2005 07:16:25 -0600

Changes
--

<pre>From: wyscc, Thur, 10 Mar 2005 08:16:00</pre>

Of course you don't, from a mathematical view point, and the problem is
apparently the Interpreter needs help. If you put the argument into
<code>Float</code> or the expression into <code>Expression Float</code>, Axiom
will oblige.
\begin{axiom}
asin(1/2::Float)
asin(1/2)::Expression Float
\end{axiom}
But in fact, even coercion to <code>Complex Float</code> won't always work.
\begin{axiom}
asin(%i/2)
asin(%i/2)::Complex Float
\end{axiom}
There is no modemap from <code>Expression Integer</code> to <code>Complex
Float</code> (Use hyperdoc <code>Browse, Selectable</code> to search, with wild
character in the name field).  This is reasonable since it is not possible in
general to evaluate numerically a symbolic expression. I believe the
Interpreter actually tries this:
\begin{axiom}
asin(1/2)$Float asin(1/2)$(Complex Float)
\end{axiom}
which succeed in both cases because <code>asin</code> has modemaps in those
domains. Exactly why it was able to change a  non-existing coercion in one case
but not the other is unclear, but this seems to be because the Interpreter code
is not as categorical as the compiler code and these smart'' coercions may be
done case by case. But even this reasoning has problem:

\begin{axiom}
asin(%i/2::Complex Float)  -- easiest
asin(%i/2)::Expression Complex Float::Complex Float -- harder
asin(%i/2)\$(Complex Float)  -- doesn't work
\end{axiom}

--