Numerical summation of series



Richard Fateman wrote:
>   
>> -----Original Message-----
>> From: maxima-bounces at math.utexas.edu [mailto:maxima-
>> bounces at math.utexas.edu] On Behalf Of Michel Van den Bergh
>> Sent: Monday, December 25, 2006 7:40 AM
>> To: maxima at math.utexas.edu
>> Subject: Re: [Maxima] Numerical summation of series
>>
>> But I am not very familiar with the conventions in
>> Maxima. How do you specify for example the required precision of a
>> numerical operation?
>>     
>
> All rational operations are done exactly.
>
> Read about fpprec for control of floating point precision with bfloats.
>
>   
I don't understand bfloats all that well. And the manual does not seem
to explain them in any
depth. I thought fpprec gave the current number of significant digits of
bfloats.
This is not the same as the required precision of a numerical operation
(which I think
normally should be less than fpprec, to accomodate for rounding errors).
Have I misunderstood
this?

Perhaps the correct strategy is to temporarily increase fpprec during a
computation and to reset
it afterwards?

>> How do you signal an error (such as division by
>> zero)?
>>     
>
> I think you want to ask about how to CATCH an error, since signaling
> division by zero is done by dividing by zero.  
> This is probably best done by writing in common lisp, underneath the Maxima
> language.
>
> If you suspect that division by zero will occur, it may pay to just check
> before each division.
>
> RJF
>
>
>   

That goes without saying. But then one still has to inform the user that
an unusual condition has occured.
Normally this is done by throwing some kind of exception. Or else by
setting some status variable.

Regards,
Michel