Post Reply 
[WP-34S] DEG and RAD - diffs
06-06-2014, 04:24 PM (This post was last modified: 06-06-2014 04:36 PM by Claudio L..)
Post: #23
RE: [WP-34S] DEG and RAD - diffs
(06-06-2014 06:07 AM)Thomas Klemm Wrote:  
(06-06-2014 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.

This depends on how CORDIC is implemented. It's not a problem with the method used in this article.

Cheers
Thomas

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(3e-10)?

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 1e-9 radians, and that would give you all the digits you need (and yes, it's 1e-9 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
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
[WP-34S] DEG and RAD - diffs - pito - 06-05-2014, 12:08 AM
RE: DEG and RAD - diffs - Paul Dale - 06-05-2014, 12:53 AM
RE: DEG and RAD - diffs - pito - 06-05-2014, 06:27 AM
RE: [WP-34S] DEG and RAD - diffs - pito - 06-05-2014, 01:38 PM
RE: [WP-34S] DEG and RAD - diffs - Dieter - 06-05-2014, 11:12 AM
RE: [WP-34S] DEG and RAD - diffs - pito - 06-05-2014, 06:04 PM
RE: [WP-34S] DEG and RAD - diffs - pito - 06-05-2014, 07:57 PM
RE: [WP-34S] DEG and RAD - diffs - pito - 06-05-2014, 10:07 PM
RE: [WP-34S] DEG and RAD - diffs - Dieter - 06-06-2014, 05:27 PM
RE: [WP-34S] DEG and RAD - diffs - Claudio L. - 06-06-2014 04:24 PM
RE: [WP-34S] DEG and RAD - diffs - pito - 06-07-2014, 12:57 PM



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