Re: How to use floating point in a module?

From: Hugo Mills (hugo-lkml_at_carfax.org.uk)
Date: 05/31/04

  • Next message: Manfred Spraul: "Re: How to use floating point in a module?"
    Date:	Mon, 31 May 2004 21:23:09 +0100
    To: Michal Jaegermann <michal@harddata.com>
    
    
    

    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! ---   
    
    

    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/



  • Next message: Manfred Spraul: "Re: How to use floating point in a module?"

    Relevant Pages

    • Re: How to use floating point in a module?
      ... The Taylor series for the trig functions might be a painfull. ... Trascendental functions are _not_ computed by series in practice, ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: How to use floating point in a module?
      ... The Taylor series for the trig functions might be a painfull. ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: Best processors for trig?
      ... Taylor series ... You can also look at CORDIC functions. ... calculate all the normal trig functions to high precision using CORDIC ...
      (comp.arch.embedded)
    • Re: tetration and logaritms
      ... and from looking at the first terms of this taylor series we see that we can get series reversion which of course gives exp- 1. ... finally 5/8 and 13/30 in the upper-left corner. ... to find the polynomials in h. ... We simply take the coefficients ...
      (sci.math)
    • Re: How to use floating point in a module?
      ... The Taylor series for the trig functions might be a painfull. ... > My guess is that finding some fixed-point libraries, ... To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/ ...
      (Linux-Kernel)