[WP-34S] DEG and RAD - diffs
06-06-2014, 05:42 PM
Post: #25
 Thomas Klemm Senior Member Posts: 2,003 Joined: Dec 2013
RE: [WP-34S] DEG and RAD - diffs
(06-06-2014 04:24 PM)Claudio L. Wrote:  Now what if you are trying to calculate sin(3e-10)?

Compare it to all the angles in the list until one is smaller than 3e-10.
That will be $$\tan^{-1}(10^{-10})$$ which is a little bit smaller than 1e-10.
Thus we can subtract $$3\cdot\tan^{-1}(10^{-10})$$. And then we can go on with the remainder ...
As you may notice there will be no cancellation due to adding or subtracting big values.

Quote:However, you can avoid that by starting the loop with 1e-9 radians

In fact this is very similar to what you do.

Quote: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.

You can do without using the constant K. Calculate:
$\tan(\theta)=\frac{K\cdot\sin(\theta)}{K\cdot\cos(\theta)}$
From this you can calculate:
$\sin(\theta)=\frac{\tan(\theta)}{\sqrt{1+\tan(\theta)^2}}$

How normal do you consider the implementation used in most HP-calculators?

Cheers
Thomas
 « Next Oldest | Next Newest »