Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Transcendental approximations

Status
Not open for further replies.

josh_

Newbie level 6
Newbie level 6
Joined
Sep 27, 2004
Messages
11
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
136
Hi all,

I'm looking to do some simple low-level approximations of sin, atan, 2^x, and log2 x for a CPU I'm making. So far I've got a simplified MacLaurin polynomial
for sine, which seems to produce quite a good result (8 terms --> 16 decimal place accuracy at pi/2, 16 terms --> 41 dec. place, 24 terms --> 64 dec. place) with no powers past 2 and no factorials.
For arctangent, I have a similar MacLaurin polynomial, but it degenerates quickly past pi/12. Any ideas?

As far as 2^x and log2 go, I'm in the dark. Any hints would be appreciated.

Thanks!
-- Josh
 

2^x should be very simple if you are working in binary. Just notice
2^0=0
2^1=10
2^2=100...

As far as log_2(x) is concerned, I'll refer you to Feynman's method. Look in the section "An Algorithm For Logarithms" in (and you can pick up on that)
**broken link removed**

I hope that helps...
Chirkut
 

chirkut_iis said:
2^x should be very simple if you are working in binary. Just notice
2^0=0
2^1=10
2^2=100...
Yes, but 2^3.14159 is...?
Remember, this is floating-point. Sorry if I wasn't clear on that.

As far as log_2(x) is concerned, I'll refer you to Feynman's method. Look in the section "An Algorithm For Logarithms" in (and you can pick up on that)
h**p://www.kurzweilai.net/meme/frame.html?main=/articles/art0504.html?m%3D3

I hope that helps...
Chirkut

Great, I'll look into the log2 link. Thanks!

-- Josh

P.S. Anyone know how to do a good approximation to arctangent?
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top