[Maxima] SF  Full bigfloat precision for Gamma after the second call
macrakis at alum.mit.edu
Tue Oct 14 12:46:22 CDT 2008
On Tue, Oct 14, 2008 at 1:18 PM, Raymond Toy <raymond.toy at ericsson.com>wrote:
> Stavros Macrakis wrote:
> > I repeat: neither Lisp nor Maxima code should EVER look at bigfloat%pi,
> > which is an internal variable used as a cache by fppi.
> Whatever you might think, what I'm showing is, in fact, relevant. The
> call to zot eventually asks for a 438 bit value of pi. That is the
> value that is cached in bigfloat%pi. The last 36 digits are flat out
> wrong. If the cached value is wrong, the value of bfloat(%pi) is also
> wrong. There's no avoiding that issue.
Only if the cached value is being used incorrectly. fppi can do whatever it
wants to bigfloat%pi as long as fppi is correct.... I repeat: can you
demonstrate the bug using the correct interface, (fppi)?
(%i1) zot(z,fpprec):= bfloat(%pi*z/sin(%pi*z))$
(%i4) :lisp (fppi)
(%i4) :lisp ($bfloat '$%pi)
((BIGFLOAT SIMP 215)
(%i4) :lisp (displa ($bfloat '$%pi))
I haven't read your code, but I would recommend the following code if you
are setting a local value of fpprec:
(defmacro bind-fpprec (val expr)
`(let (($fpprec) (fpprec) (bigfloatzero) (bigfloatone) (bfhalf) (bfmhalf))
(fpprec1 nil ,val)
And don't forget that $fpprec is decimal digits, while fpprec is binary
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Maxima