Looking for a fast exp(x) where -10.0<=x<=10.0

Looking for a fast exp(x) where -10.0<=x<=10.0

Post by Scott Wats » Sat, 03 Nov 1990 03:48:20



Hi y'all -

I have a need for an fast exp(x) function...

x is a float and can range inside +-10.0.

Some sort of low granularity (read: *big array*) lookup table w/
interpolation, or something...

Any ideas?

Thanks in advance


#ifdef SANE
#include <std_disclaimer.h>
#endif

--

#ifdef SANE
#include <std_disclaimer.h>
#endif

 
 
 

Looking for a fast exp(x) where -10.0<=x<=10.0

Post by Craig Hans » Sat, 03 Nov 1990 12:17:33



> I have a need for an fast exp(x) function...
> Any ideas?

Decompose your exp(x) into exp(a+b), where a and b are
the most-significant and least significant parts of x.
exp(a+b)=exp(a)*exp(b), so get exp(a) and exp(b) from
two small tables and multiply them together.

Regards,
Craig Hansen


 
 
 

Looking for a fast exp(x) where -10.0<=x<=10.0

Post by Dave Mc Mah » Sat, 03 Nov 1990 12:19:26



Quote:>Hi y'all -

>I have a need for an fast exp(x) function...

>x is a float and can range inside +-10.0.

>Some sort of low granularity (read: *big array*) lookup table w/
>interpolation, or something...

How much accuracy do you need, and how fast does it have to be?  Also, what
kind of CPU are you using and how much memory can you dedicate to a lookup
table?

   -dave

--

                                        {apple,amdahl,claris}!netcom!mcmahan

 
 
 

Looking for a fast exp(x) where -10.0<=x<=10.0

Post by Ken Turkows » Sat, 03 Nov 1990 17:28:26



Quote:>>Hi y'all -

>>I have a need for an fast exp(x) function...

>>x is a float and can range inside +-10.0.

You can calculate exp(x) in fixed-point with a series of shifts
and adds and a small lookup table using CORDIC iterations.
Convergence is linear, so you get about one bit of precision with
each iteration through a simple loop.  With 32-bit words, you can
probably get 26 bits of precision.  If you can get by with less
bits of precision, you can by with less iterations.

I don't have the references handy, but I just recently published
a paper in Graphics Gems (Academic Press, 1990) on CORDIC trigonometry.
In the references to that paper are pointer to papers by Walthers
and Chen which address exp, log, sqrt, and a host of other nonlinear
functions.
--


Applelink: TURK
UUCP: sun!apple!turk

 
 
 

Looking for a fast exp(x) where -10.0<=x<=10.0

Post by Ken W. Sarki » Tue, 06 Nov 1990 12:56:23



>I have a need for an fast exp(x) function...

Another idea I have used is the polynomial approximations as given in
Abramowitz and Stegun ``Handbook of Mathematical Functions''. For exp(x) you
can get accuracy to 2 x 10^{-10} for seven terms with 0<x<ln(2). Outside that
range use known results i.e. exp(x) = 2 x exp(x - ln(2)) for ln(2)<x<2ln(2).
The seven terms might be a bit much if you want real speed, but with other
suggestions given you may be able to tailor a useful algorithm depending on
your speed/accuracy/memory tradeoff.

--
                                Ken Sarkies

No disclaimer. My boss takes all responsibility for my big mouth.

 
 
 

1. <<<Looking for Circuits>>>

Could anyone suggest places where I can find circuits (for reference) for  
transmission of digital signals by radio wave?  Please E-mail to

Thanks in advance!

- Jason

     !!! TOGETHER, WE CAN MAKE THE CYBERSPACE A HEALTHIER MEDIA !!!
***************************************************************************
**        QQQQQQQ                                                        **
**       QQ     QQ                Jason Cheng at Queen's University      **
**      QQ       QQ              Electrical & Computing Engineering      **
**       QQ  QQ QQ                                                       **

**             QQQQ                                                      **
***************************************************************************

2. Separate out large purchases?

3. High Capacity / FAST, Instant transfer << 1GB / 2GB >> Flash Memory

4. FS: Intel based Multia

5. <<>> COMPUTER SOFTWARE / HARDWARE <<>>

6. PIC programmer acting up

7. ******>>> PLEASE HELP <<<<******

8. Converting Mac MultipleMaster to Windows

9. >>>> ADPCM wizards <<<<>>>> ADPCM wizards <<<<

10. Need for a fast exp() routine.

11. <=>=<=>CD, Amp, Speakers, Signal Porcessor<=>=<=> F.S.<=>=<=>

12. Fast log10(x) and 10^x