Free42 with IEEE 7542008 decimal floatingpoint  interested in a sneak preview?

03172014, 11:40 AM
Post: #81




RE: Free42 with IEEE 7542008 decimal floatingpoint  interested in a sneak preview?
(03162014 01:45 PM)Werner Wrote: in DEG mode: I'm not surprised here. 180 + 10^31 is pushing the number of digits in double precision whereas 10^31 isn't stretching anything. In single precision there doesn't seem to be an issue thankfully. I know the 34S trigonometric functions don't do the usual full reduction to the first octant before evaluating the functions. I brute force things with a longer series  it is smaller codewise. There is also the conversion to radians involved to disturb the results a bit. In summary: * not unexpected, * doesn't impact single precision, * will take space to fix. Is it worthwhile trying? I'll see if I can come up with something nice and simple.  Pauli 

03172014, 01:29 PM
Post: #82




RE: Free42 with IEEE 7542008 decimal floatingpoint  interested in a sneak preview?
(03172014 11:08 AM)JF Garnier Wrote: I noted that there is also a similar issue in the reverse situation: OK, I'll add code to handle powers of 10 in LOG. (I'm amazed that code isn't there already, since testing for exact powers of 10 is so easy in decimal. Continuity issues maybe?) 

03172014, 10:03 PM
Post: #83




Free42 with IEEE 7542008 decimal floatingpoint  interested in a sneak preview?
(03162014 03:06 PM)Thomas Okken Wrote: By the way, where can I find out what formatting is supported on this forum? I thought it was strictly plain text here until I saw your [b] tags. :)Besides the obvious buttons of the editor there are some hidden features:
Cheers Thomas 

03182014, 12:55 AM
(This post was last modified: 03182014 01:34 AM by Thomas Okken.)
Post: #84




RE: Free42 with IEEE 7542008 decimal floatingpoint  interested in a sneak preview?
(03172014 01:29 PM)Thomas Okken Wrote:(03172014 11:08 AM)JF Garnier Wrote: I noted that there is also a similar issue in the reverse situation: In order to make sure LOG doesn't just return exact results for exact powers of 10, but also satisfies 10^{n} ≤ x < 10^{n+1} → n ≤ LOG(x) < n+1 which is necessary for code like FWIW to work reliably, I'm thinking of this argument reduction code: Code: function log10(x) { 

03182014, 01:03 AM
Post: #85




RE: Free42 with IEEE 7542008 decimal floatingpoint  interested in a sneak preview?
(03172014 10:03 PM)Thomas Klemm Wrote: Besides the obvious buttons of the editor there are some hidden features: [...] Thanks! :) BTW, the "obvious buttons" weren't obvious to me because I was using Firefox with NoScript at home, and NoScript nixes those buttons, unless you tell it not to. My mistake!  Thomas 

03182014, 07:16 AM
Post: #86




RE:Free42 with IEEE 7542008 decimal floatingpoint  interested in a sneak preview?
(03172014 01:29 PM)Thomas Okken Wrote: In order to make sure LOG doesn't just return exact results for exact powers of 10, but also satisfies This is not possible. On a real 42S, LOG(9.99999999999) = 1, exactly. Meaning it is the closest number to the exact result. The same holds for any precision. On Free42 Decimal34, LOG(1e341) is 34 and LOG(1e331) is 33, exactly, and that's what the result should be. Extracting the exponent should rather be done dividing by the mantissa, that can be determined as follows (thanks to Dieter): Code:
Werner 41CV†,42S,48GX,49G,DM42,DM41X,17BII,15CE,DM15L,12C,16CE 

03182014, 07:57 AM
Post: #87




RE: Free42 with IEEE 7542008 decimal floatingpoint  interested in a sneak preview?
(03182014 07:16 AM)Werner Wrote:(03172014 01:29 PM)Thomas Okken Wrote: 10^{n} ≤ x < 10^{n+1} → n ≤ LOG(x) < n+1This is not possible. I tend to agree with Werner, and the condition above is not needed. Strictly speaking, all we need is that 10^x is exact for x an integer, and it will be nice that LOG(x) is an integer for x exactly a power of ten. JF 

03182014, 08:08 AM
Post: #88




RE:Free42 with IEEE 7542008 decimal floatingpoint  interested in a sneak preview?
(03172014 11:40 AM)Paul Dale Wrote: I know the 34S trigonometric functions don't do the usual full reduction to the first octant before evaluating the functions. I brute force things with a longer series  it is smaller codewise. There is also the conversion to radians involved to disturb the results a bit. Strange that singe precision works, if you don't do the range reduction to the first octant. For me personally, these things are much more important than having 34 digits most of the time. Accuracy over precision, anytime. And of course the venerable 42S gets it right. And Free42, latest version. range reduction to 45° Werner 41CV†,42S,48GX,49G,DM42,DM41X,17BII,15CE,DM15L,12C,16CE 

03182014, 08:51 AM
Post: #89




RE: Free42 with IEEE 7542008 decimal floatingpoint  interested in a sneak preview?
It isn't that strange that single precision works properly here: internally I always use a higher precision regardless of the single/double precision mode setting. A bit of brute force here saves a lot of code space and thinking time.
I agree accuracy over precision too, that has been my goal all along. I'm not sure we can justify the space to do the octant reduction separately in degrees, radians and gradians and I suspect doing this after the conversion to radians has occurred will result in this problem. Fortunately, it is documented that double precision results can be incorrect in the latter digits for some (most?) functions Double precision was a bit of an after thought which allowed keystroke programs to produce reasonably accurate single precision results  at least that was its intention.  Pauli 

03182014, 09:22 AM
Post: #90




RE: Free42 with IEEE 7542008 decimal floatingpoint  interested in a sneak preview?
In that case, might I humbly request that you do consider it for the 43S?
Werner 41CV†,42S,48GX,49G,DM42,DM41X,17BII,15CE,DM15L,12C,16CE 

03182014, 09:49 AM
Post: #91




RE: Free42 with IEEE 7542008 decimal floatingpoint  interested in a sneak preview?
(03182014 09:22 AM)Werner Wrote: In that case, might I humbly request that you do consider it for the 43S? That sounds more than reasonable. We'll have space there. We will have space on the 31S as well so I guess I'll have to implement it. I've had a bit of an idea about how to do this without using lots of space. Not sure if it will work or not yet...  Pauli 

03182014, 03:23 PM
Post: #92




RE: Free42 with IEEE 7542008 decimal floatingpoint  interested in a sneak preview?
(03182014 07:16 AM)Werner Wrote: On a real 42S, LOG(9.99999999999) = 1, exactly. Meaning it is the closest number to the exact result. The same holds for any precision. On Free42 Decimal34, LOG(1e341) is 34 and LOG(1e331) is 33, exactly, and that's what the result should be. Good point. I don't want to return incorrect results just for the convenience of a flawed algorithm! OK, I'll fix LOG like this: use the bid128_ilogb and bid128_scalbn functions to pull out the exponent and normalize the mantissa to the range [1, 10), then use bid128_log10 on the normalized mantissa, and finally add the exponent to the result. That will return exact results for powers of ten, without introducing numerical inconsistencies. 

03252014, 08:48 AM
Post: #93




RE: Free42 with IEEE 7542008 decimal floatingpoint  interested in a sneak preview?
The 31S will have appropriate range reduction code in degrees mode but not in radians (it doesn't support gradians). The code space for this is likely more than we want to commit to on the 34S but I coded the gradians modulo reduction too for future use.
 Pauli (03162014 01:45 PM)Werner Wrote: in DEG mode: 

« Next Oldest  Next Newest »

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