unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
From: Betoes <betoes@member.fsf.org>
Subject: Re: Floating Point?
Date: Mon, 8 Sep 2003 11:43:59 -0300	[thread overview]
Message-ID: <20030908144359.GA2046@milla.autsens.localnet> (raw)
In-Reply-To: <Pine.GSO.4.21.0309061236500.11544-100000@harper.uchicago.edu>

On Sat, Sep 06, 2003 at 01:10:21PM -0500, Peter S. Christopher wrote:
> Hi there listers,
> 
> 	I've been thinking about how to make my floating point
> calculations go faster. I thought that my FP calculations where so slow

I have doubt about the speed of floating point calculations too, but
because of arbitrary precision of guile floating point
arthmetics... Does it have a way to turn off this feature? Does it
really have influence on speedy calculations?

Redefinitions of math functions would be woth, but an expensive way to
increase such speed...

Any idea?

> because of excessive allocation. i.e. if a and b are floats then 
> (+ a b) will return a *NEW* float with the value a+b in it. Is this
> true? If this where true I thought that I could speed up my calculations
> by replacing the normal operands (+,-,*,/) by versions that don't allocate
> new cells (a-la (reg+, reg-, reg*, reg/)). Something like
> 
> (reg+ temp_1 a b) 
> 
> would evaluate to 
> 
> SCM_REAL_VALUE(temp_1) = 	
>     scm_num2dbl(a, FUNC_NAME)+scm_num2dbl(b, FUNC_NAME);
> 
> in some C extension function. This would prevent the allocation of the
> additional doubles. The real advantage, of course, would be in expressions
> like
> 
> (let ((register-1 0.0))
>    (do ((i 0 (+ i 1))
>        ((> i big-huge-number))
>      (set-my-double-array i
>        (reg+ register-1 5.7 (reg* register-1 3.1 i))))))
> 
> where this loop sets element i of my-double-array to 3.1*i+5.7. By my
> reasoning (which may be suspect) this would save me many-many cell
> allocations (2*big-huge-number to be exact).
> 
> 	So how far off base am I? And, does anyone have other ideas on how
> to improve my floating point performance (within the guile world that is).
> 
> Thanks for any help,
> Pete Christopher


_______________________________________________
Guile-user mailing list
Guile-user@gnu.org
http://mail.gnu.org/mailman/listinfo/guile-user


  reply	other threads:[~2003-09-08 14:43 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-09-06 18:10 Floating Point? Peter S. Christopher
2003-09-08 14:43 ` Betoes [this message]
2003-09-09  7:52   ` tomas
2003-09-09  9:26     ` David Allouche
2003-09-09 14:34       ` Peter S. Christopher
2003-09-09 21:15         ` Robert Uhl

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20030908144359.GA2046@milla.autsens.localnet \
    --to=betoes@member.fsf.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).