From: Jeffrey P. Golden
Subject: Re: why no big-float?
Date: 
Message-ID: <4kp8s1$68b@lynx.unm.edu>
Reply-To: ···@macsyma.com

> Date: 12 Apr 1996 20:27:43 GMT
> From: ······@ilog.fr (Bruno Haible)
> Newsgroups: comp.lang.lisp,comp.lang.lisp.mcl,sci.math.symbolic
> Subject: Re: why no big-float?
> Organization: University of Karlsruhe, Germany
> Summary: get CLN
> Keywords: lisp, bignum, cln, gmp, clisp, bigfloat, 7
> Originator: ······@ma2s2
> 
> [Dave Yost]
> >|   Has anyone implemented big-float?
> 
> [Erik Naggum]
> > CLISP has this.
> 
> Other Common Lisp implementations can get this feature as well. CLISP's
> bignum and bigfloat library is now available as a separate package,
> a library which was put together with the intent of being incorporated
> into Lisp implementations and math packages.
> ftp://ma2s2.mathematik.uni-karlsruhe.de/pub/gnu/cln.tar.z. `cln' stands
> for "Common Lisp Numbers".
> 
> > > (setf (long-float-digits) 128)
> > 128
> > > (/ 7l0)
> > 0.142857142857142857142857142857142857143L0
> 
> This is easy. The "hard" stuff are the transcendental functions:
> 
> > (setf (long-float-digits) 1024)
> 1024
> > (- (+ (/ (sin (* 2/7 pi))) (/ (sin (* 4/7 pi)))) (/ (sin (* 6/7 pi))))
> -2.225073858507201383090232717332404064219215980462331830553327416887204434
> 813918195854283159012511020564067339731035811005152434161553460108856012385
> 377718821130777993532002330479610147442583636071921565046942503734208375250
> 806650616658158948720491179968591639648500635908770118304874799780887753749
> 94945158045L-308
> 
> (Btw: Can any symbolic computer algebra system prove that the exact value
> of sin(2/7*pi)^-1 + sin(4/7*pi)^-1 - sin(6/7*pi)^-1 is zero?)
> 
> Bruno Haible                                     email: <······@ilog.fr>
> Software Engineer                                phone: +33-1-49083585


Macsyma has had bigfloats in Lisp for about 21 years, and in Common Lisp 
ever since Macsyma was ported to Common Lisp about 11 years ago.

Moreover Macsyma gives more accurate bigfloat results than you show above:

-----------------------------------------------------------------------------
(c1) expr: sin(2/7*%pi)^-1 + sin(4/7*%pi)^-1 - sin(6/7*%pi)^-1;
                      1           1          1
(d1)              ---------- - -------- + --------
                      3 %pi        %pi        %pi
                  cos(-----)   sin(---)   cos(---)
                       14           7         14

(c2) bfloat(expr);
(d2)                           0.0b0

/* The following is not a proof since it is based on a heuristic procedure 
   which analyzes the constituent parts of expressions and determines the 
   number of digits necessary to compute an expression to such that if the 
   expression is not equivalent to zero you'll get a non-zero result. 
   Obviously this doesn't work for all expressions in which case the 
   procedure punts. */

(c3) sign(expr);
(d3)                            zero

/* But a proof is easy to come by by just simplifying: */

(c4) trigreduce(ratsimp(expr));
(d4)                             0
-----------------------------------------------------------------------------

From: Jeffrey P. Golden <···@macsyma.com>
Organization: Macsyma Inc.
Reply-To: ···@macsyma.com
URL: http://www.macsyma.com
From: Will Ware
Subject: Re: why no big-float?
Date: 
Message-ID: <DpvA0z.2xD@world.std.com>
Jeffrey P. Golden (···@math.math.unm.edu) wrote:
: Macsyma has had bigfloats in Lisp for about 21 years, and in Common Lisp 
: ever since Macsyma was ported to Common Lisp about 11 years ago.

Is there a freeware version of Macsyma (or anything roughly equivalent)
around? Something in Common Lisp would be lovely, but I'd be interested
in anything that would run on my Linux box. Thanks.
-- 
-------------------------------------------------------------
Will Ware <·····@world.std.com> web <http://world.std.com/~wware/>
PGP fingerprint   45A8 722C D149 10CC   F0CF 48FB 93BF 7289