public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Hugo Mills <hugo-lkml@carfax.org.uk>
To: Michal Jaegermann <michal@harddata.com>
Cc: Ian Kent <raven@themaw.net>, linux-kernel@vger.kernel.org
Subject: Re: How to use floating point in a module?
Date: Mon, 31 May 2004 21:23:09 +0100	[thread overview]
Message-ID: <20040531202308.GD10420@selene> (raw)
In-Reply-To: <20040531141253.A18246@mail.harddata.com>

[-- Attachment #1: Type: text/plain, Size: 1452 bytes --]

On Mon, May 31, 2004 at 02:12:53PM -0600, Michal Jaegermann wrote:
> On Mon, May 31, 2004 at 01:44:40PM +0800, Ian Kent wrote:
> > 
> > Why not scaled longs (or bigger), scalled to number of significant 
> > digits. The Taylor series for the trig functions might be a painfull.
> 
> Taylor series usually are painful for anything you want to calculate
> by any practical means.  Slow convergence but, for a change, quickly
> growing roundup errors and things like that.  An importance and uses
> of Taylor series lie elsewhere.
> 
> OTOH polynomial approximations, or rational ones (after all division
> is quite quick on modern processors), can be fast and surprisingly
> precise; especially if you know bounds for your arguments and that
> that range is not too wide.  Of course when doing that in a fixed
> point one needs to pay attention to possible overflows and
> structuring calculations to guard against a loss of precision is
> always a good idea.

   It's also worth pointing out that there are other, much
faster-converging, polynomial series that can be used to approximate
trig functions. Chebyshev polynomials are, I believe, pretty
well-behaved. IIRC, they are what the Sinclair Spectrum used to use.

   Hugo.

-- 
=== Hugo Mills: hugo@... carfax.org.uk | darksatanic.net | lug.org.uk ===
  PGP key: 1C335860 from wwwkeys.eu.pgp.net or http://www.carfax.org.uk
   --- Hey, Virtual Memory! Now I can have a *really big* ramdisk! ---   

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

  reply	other threads:[~2004-05-31 20:23 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-05-31  2:50 How to use floating point in a module? ndiamond
2004-05-31  4:02 ` Chris Friesen
2004-05-31  5:44 ` Ian Kent
2004-05-31  6:13   ` Peter Williams
2004-05-31 13:39   ` Horst von Brand
2004-05-31 20:12   ` Michal Jaegermann
2004-05-31 20:23     ` Hugo Mills [this message]
2004-05-31 22:43     ` Peter Williams
  -- strict thread matches above, loose matches on Subject: below --
2004-06-02  5:52 ndiamond
2004-06-02 19:31 ` Valdis.Kletnieks
2004-06-01  2:27 ndiamond
2004-06-01  0:38 ndiamond
2004-06-01 20:52 ` H. Peter Anvin
2004-05-31 20:38 Manfred Spraul
2004-05-31 21:11 ` Horst von Brand
2004-05-31  1:52 ndiamond
2004-05-31  2:18 ` Måns Rullgård
2004-05-30 22:39   ` Calvin Spealman
2004-05-31  4:28   ` Linus Torvalds
2004-05-31  3:57     ` Calvin Spealman
2004-05-31  3:59 ` Matt Mackall
2004-05-31  4:11 ` Stephen Smoogen
2004-05-31 14:55 ` Scott Robert Ladd
2004-06-01  2:11 ` Richard B. Johnson

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

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

  git send-email \
    --in-reply-to=20040531202308.GD10420@selene \
    --to=hugo-lkml@carfax.org.uk \
    --cc=linux-kernel@vger.kernel.org \
    --cc=michal@harddata.com \
    --cc=raven@themaw.net \
    /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