Post Reply 
[Prime] Missing trigonometric/hyperbolic functions, possible navigational enhancement
11-05-2015, 06:49 AM
Post: #13
RE: [Prime] Missing trigonometric/hyperbolic functions, possible navigational enhancement

>But first, the spec glibly says "reduce range"
>(eg from 362 degrees to 2 degrees, or 25 h to 1 h).
>If there could be a reduce range function, that would
>be great as I could just call it and carry on.

Range reducing is performed automatically by the trig functions before calculating the sin/cos/tan.
In order to preserve accuracy as much as possible the reduction is performed on 31 significant digits (as opposed to the normal 15). And is done in such a was as to be as fast as possible (basically, a fast modulo).
The reduction is done, not on 360°, but on 45° as the trig function only calculates for angles in the 0 to 45° range.
Once the angle is reduced to 45°, it is finally converted to radians and the real trig function is executed.

Doing a pre-reduce of the input would not lead to speed up or accuracy improvement, but to the reverse as temporary objects would need to be created and the intermediate result would have lost some of its precision (because user numbers have only 12 digits).
The only time where you would see a gain is if you were to do a lot of calculations based on the same very large number...
However, if you have an angle in the 1e30 range, well, you do NOT have an angle as you only have a number with precision in the 1e18 range (30-12) while your angle is in the 1e2 range, so you have in reality no idea what angle you are working with and your calculation does not make sense...


Although I work for the HP calculator group, the views and opinions I post here are my own. I do not speak for HP.
Find all posts by this user
Quote this message in a reply
Post Reply 

Messages In This Thread
RE: [Prime] Missing trigonometric/hyperbolic functions, possible navigational enhancement - cyrille de brébisson - 11-05-2015 06:49 AM

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