[WP34S] DEG and RAD  diffs

06062014, 07:53 PM
Post: #27




RE: [WP34S] DEG and RAD  diffs
(06062014 05:42 PM)Thomas Klemm Wrote: You can do without using the constant K. Calculate: That seems easy to do, but then you have to do a division, a multiplication and a square root, on top of your sin/cos which both come together from CORDIC. The square root alone will take about half the time of the sin, so you'd increase your time by 50%. Yes, this will be faster than having to compute the constants alongside but still much worse than having a precomputed constant ready. Also, when x is close to zero, doing sqrt(1+x^2) is really bad for precision. The x^2 "spreads" your useful digits throughout your exponent range, then the square root compresses them back, and you lost about half of them at the end (see what I meant with "small angles are tougher on precision loss"). For hyperbolics, I'm using the doubleangle formulae with much better results since you don't have the square roots. For now, I'd rather have the constants precalculated, so after CORDIC, one multiplication and I got the final result. However, if we run out of space in ROM and I have to remove my constants, we'll have no choice but to use that trick (thanks, BTW). I'm not sure a similar trick will work well for hyperbolics, exp() and ln(), though. Claudio 

« Next Oldest  Next Newest »

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