[WP34S] DEG and RAD  diffs

06062014, 04:24 PM
(This post was last modified: 06062014 04:36 PM by Claudio L..)
Post: #23




RE: [WP34S] DEG and RAD  diffs
(06062014 06:07 AM)Thomas Klemm Wrote:(06062014 01:31 AM)Claudio L. Wrote: However, CORDIC accumulate angles from large to small, adding smaller and smaller numbers to bring a target to zero. This is really bad for precision, because it forces you to start adding large terms first that cancel each other. Of course it depends on how you implement it, but the method is the same and has the same drawbacks. In your article you start with 0.1 radians for the angle rotation, and go down 0.1, 0.01, 0.001. First of all, that sequence will not converge for all numbers. EDIT: I just noticed your article does repetition. You can indeed achieve convergence by repeating rotations with the same angle. But it's bad for speed! There is a maximum ratio between a rotation angle and the next that can't be exceeded, and is a requisite for convergence. Binary cordic uses a ratio of 2, where each angle is half of the previous, and that guarantees convergence. a 1/10 ratio does not converge. There's multiple papers (I already added a link to a very good one on a previous post) where researchers propose different sequences of angles and prove that 'theirs is better'. newRPL uses 1.0, 0.5,0.2,0.2,0.1, 0.05,0.02,0.02,0.01... known as a 5,2,2,1 This sequence is proven on that paper to converge for both normal an hyperbolics. Now what if you are trying to calculate sin(3e10)? If you start your rotations with 0.1 radians, and go smaller, you will get a lot of errors. That's why I said it's bad for small angles. However, you can avoid that by starting the loop with 1e9 radians, and that would give you all the digits you need (and yes, it's 1e9 because you always start with an angle larger than your initial argument, otherwise does not converge). But starting the loop with smaller angles means the constants K=Product(cos(Alphai)) changes for each case, hence you need a whole lot of constants to handle this case properly. EDIT: With the method you described, you don't know how many repetitions so you have to compute the constants every time, alongside your other calculations. This is bad for speed and not how you'd normally implement CORDIC. Claudio 

« Next Oldest  Next Newest »

User(s) browsing this thread: 1 Guest(s)