Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
why no big-float?
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  8 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Dave Yost  
View profile  
 More options Apr 9 1996, 3:00 am
Newsgroups: comp.lang.lisp, comp.lang.lisp.mcl
From: D...@Yost.com (Dave Yost)
Date: 1996/04/09
Subject: why no big-float?
We have bignum.  Why don't we have big-float?

Recently I was working a problem of probabilities
and resorted to using logarithms for speed of execution.
Problem was that I ended up with a logarithm that was too
big to be represented in floating point.  My solution was
to do convert all logarithms to (large) integers, do the
calculation, then convert back to log.

This suggests an implementation for big-float: use bignums
with a (settable) scale factor (which corresponds to precision).

Has anyone implemented big-float?

Dave

--
Dave Yost
    @    .com


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Erik Naggum  
View profile  
 More options Apr 9 1996, 3:00 am
Newsgroups: comp.lang.lisp, comp.lang.lisp.mcl
From: Erik Naggum <e...@naggum.no>
Date: 1996/04/09
Subject: Re: why no big-float?
[Dave Yost]

|   We have bignum.  Why don't we have big-float?
:
|   Has anyone implemented big-float?

CLISP has this.

$ clisp

> (list (lisp-implementation-type) (lisp-implementation-version))

("CLISP" "1996-03-15 (March 1996)")
> (/ 7l0)

0.14285714285714285714L0
> (float-digits *)
64
> (setf (long-float-digits) 128)
128
> (/ 7l0)

0.142857142857142857142857142857142857143L0

> (float-digits *)
128
> (quit)

it is not exactly well documented, but pretty much what you outlined.

#<Erik>
--
education is for people who can't handle reality the hard way


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
William D. Gooch  
View profile  
 More options Apr 9 1996, 3:00 am
Newsgroups: comp.lang.lisp, comp.lang.lisp.mcl
From: goo...@rwi.com (William D. Gooch)
Date: 1996/04/09
Subject: Re: why no big-float?

In article <-0904960524410...@mac1.yost.com> D...@Yost.com (Dave Yost) writes:
>We have bignum.  Why don't we have big-float?
>....
>This suggests an implementation for big-float: use bignums
>with a (settable) scale factor (which corresponds to precision).

That sounds like a rational, which "we do have," yes?

Floats are basicaly for speed, not high precision.

~~~~~~~~~~~~~~~~~~~~~~
William D. Gooch
RothWell International
goo...@rwi.com
Texas liaison for the International Programmers Guild
For information on IPG, see http://www.ipgnet.com/ipghome.htm
~~~~~~~~~~~~~~~~~~~~~~


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Erik Naggum  
View profile  
 More options Apr 9 1996, 3:00 am
Newsgroups: comp.lang.lisp, comp.lang.lisp.mcl
From: Erik Naggum <e...@naggum.no>
Date: 1996/04/09
Subject: Re: why no big-float?
[William D. Gooch]

|   Floats are basicaly for speed, not high precision.

but transcendental functions are usually implemented with floats, even
though most of them can be computed with rationals in series.  this means
that we lose precision in converting from rational to float, and may run
into Dave's original question.  on the other hand, using series to compute
transcendental functions on rationals will require a "cut-off" after a
given precision is reached.  at this point, we might as well implement
"bigflos", and Bruno Haible's CLISP already does that.  unfortunately,
CLISP is byte-compiled and not particularly fast.  it's a tough choice.

(incidentally, several packages exist for C to achieve multiprecision
arithmetic.  they are not very easy to work with.  I think CLISP has done
the right thing when using one such package for Lisp's long float.)

#<Erik>
--
education is for people who can't handle reality the hard way


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Bruno Haible  
View profile  
 More options Apr 12 1996, 3:00 am
Newsgroups: comp.lang.lisp, comp.lang.lisp.mcl, sci.math.symbolic
From: hai...@ilog.fr (Bruno Haible)
Date: 1996/04/12
Subject: Re: why no big-float?
[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: <hai...@ilog.fr>
Software Engineer                                phone: +33-1-49083585


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Richard J. Fateman  
View profile  
 More options Apr 13 1996, 3:00 am
Newsgroups: comp.lang.lisp, comp.lang.lisp.mcl, sci.math.symbolic
From: fate...@peoplesparc.cs.berkeley.edu (Richard J. Fateman)
Date: 1996/04/13
Subject: Re: why no big-float?
In article <4kmebv$...@nz12.rz.uni-karlsruhe.de>,

Bruno Haible <hai...@ilog.fr> wrote:
>[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".

There are big-float implementations on top of lisp in Macsyma
(There is a paper on Macsyma's implementation Proc. of 1776 Symsac conf.),
Reduce,MockMMA (available free from me), also.
I have also implemented an interface from AllegroCL to David Bailey's
state-of-the-art fpfun package, which is quite fast and includes
not only the usual transcendental functions but a set of other
number-theoretic bignum facilities. He has both fft-based and conventional
multiplication.
Instead of building on top of bignums (integers), he uses arrays of
IEEE floats.  Yes, the exponent space is wasted. The speed is much
improved, and on many computers these days can be parallelized
explicitly or even automatically the presence of multiple arithmetic units.

--
Richard J. Fateman
fate...@cs.berkeley.edu   http://http.cs.berkeley.edu/~fateman/


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jeffrey P. Golden  
View profile  
 More options Apr 13 1996, 3:00 am
Newsgroups: comp.lang.lisp, comp.lang.lisp.mcl, sci.math.symbolic
From: j...@math.math.unm.edu (Jeffrey P. Golden)
Date: 1996/04/13
Subject: Re: why no big-float?

Reply-To: j...@macsyma.com

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 <j...@macsyma.com>
Organization: Macsyma Inc.
Reply-To: j...@macsyma.com
URL: http://www.macsyma.com


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Will Ware  
View profile  
 More options Apr 14 1996, 3:00 am
Newsgroups: comp.lang.lisp, comp.lang.lisp.mcl, sci.math.symbolic
Followup-To: comp.lang.lisp, comp.lang.lisp.mcl, sci.math.symbolic
From: ww...@world.std.com (Will Ware)
Date: 1996/04/14
Subject: Re: why no big-float?
Jeffrey P. Golden (j...@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 <ww...@world.std.com> web <http://world.std.com/~wware/>
PGP fingerprint   45A8 722C D149 10CC   F0CF 48FB 93BF 7289


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »