From: Kevin Ryde <user42@zip.com.au>
Subject: Re: GMP bignum results using double cells.
Date: Sat, 01 Mar 2003 08:45:58 +1000 [thread overview]
Message-ID: <871y1s58ih.fsf@zip.com.au> (raw)
In-Reply-To: <873cmaseb8.fsf@raven.i.defaultvalue.org> (Rob Browning's message of "Wed, 26 Feb 2003 19:27:39 -0600")
Rob Browning <rlb@defaultvalue.org> writes:
>
> The fact that all the values are so close makes me wonder if much of
> the cost is just interpreter related.
Perhaps bigger numbers would show up better. The advantages of gmp
normally increase with increasing size.
> Note that I left the same algorithm as before for the inum case.
mpn_gcd_1 would be a possibility for that, to save some code.
Probably no great difference in speed normally, though gmp does have
some nice assembler versions for K6 and Athlon.
> } else if (SCM_BIGP (y)) {
> SCM result = scm_i_mkbig ();
> SCM mx = scm_i_mkbig ();
> mpz_set_si(SCM_I_BIG_MPZ (mx), SCM_INUM (x));
> scm_remember_upto_here_1 (x);
> mpz_gcd(SCM_I_BIG_MPZ (result), SCM_I_BIG_MPZ (mx), SCM_I_BIG_MPZ (y));
Could probably use mpz_gcd_ui instead of converting x to an mpz.
Unless I've missed something basic and a conversion should be done.
In which case maybe the result variable could be pressed into service,
convert into that and call mpz_gcd(result,result,y).
_______________________________________________
Guile-devel mailing list
Guile-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/guile-devel
next prev parent reply other threads:[~2003-02-28 22:45 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-02-26 6:28 GMP bignum results using double cells Rob Browning
2003-02-26 21:54 ` Kevin Ryde
2003-02-27 1:27 ` Rob Browning
2003-02-28 22:45 ` Kevin Ryde [this message]
2003-02-27 13:33 ` Marius Vollmer
2003-02-27 16:43 ` Rob Browning
2003-02-27 17:16 ` Rob Browning
2003-02-27 17:46 ` Marius Vollmer
2003-02-27 17:55 ` Rob Browning
2003-03-01 13:43 ` Marius Vollmer
2003-03-02 0:52 ` Rob Browning
2003-03-02 1:40 ` Marius Vollmer
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=871y1s58ih.fsf@zip.com.au \
--to=user42@zip.com.au \
/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).