behavior of 'taylor' when Taylor series is undefined
Subject: behavior of 'taylor' when Taylor series is undefined
From: Stavros Macrakis
Date: Fri, 21 Dec 2012 16:51:44 -0500
Throwing an error seems like the right thing when the result is undefined
(e.g. taylor of abs/signum). For programmatic use, errcatch does pretty
much the right thing (except that I don't know how you suppress printing an
error message), and a textual error message plus the guilty argument are
saved in 'error' (which is not ideal as a structured error message, but not
too bad).
Not sure what you mean by throwing a noun form; do you mean that 'error'
should be set to [<error msg>,'taylor(abs(x),x,0,1)] instead of [<error
msg>,abs(x)]? That seems fine.
-s
On Tue, Dec 18, 2012 at 12:50 PM, Robert Dodier <robert.dodier at gmail.com>wrote:
> I wonder what should be the behavior of 'taylor' when no Taylor series
> exists. (There is nothing documented for that case and the existing
> implementation doesn't seem to handle it.) I can see a few possibilities:
>
> * trigger an error
> * return a 'taylor(...) noun expression
> * throw something, perhaps a noun expression
>
> About triggering an error, that is what 'sum' and 'integrate' do when
> the sum or integral is divergent. An error is correct in a sense but
> less useful from a programming point of view -- not clear how to recover
> from it automatically.
>
> Returning a noun expression suggests that the Taylor series exists but
> it wasn't able to calculate it. I guess that leaves open the door to
> impose some interpretation on the noun expression after the fact, but
> that seems remote -- what different interpretation could there be?
>
> Throwing something allows for the caller (or anybody farther down the
> call stack) to handle the problem automatically. Throwing a noun
> expression allows the handler to extract info about the failed call.
>
> At this point, I think throwing a 'taylor(...) noun expression is my
> preference. Only point against it is that it's unfamiliar to users.
>
> Comments?
>
> best,
>
> Robert Dodier
>
> _______________________________________________
> Maxima mailing list
> Maxima at math.utexas.edu
> http://www.math.utexas.edu/mailman/listinfo/maxima
>