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

02242014, 12:09 AM
(This post was last modified: 02242014 12:16 AM by Thomas Okken.)
Post: #1




Free42 with IEEE 7542008 decimal floatingpoint  interested in a sneak preview?
Hi all,
I'm working on replacing the BCD20 floatingpoint library in Free42 Decimal with the Intel Decimal FloatingPoint Math Library. Link: http://software.intel.com/enus/articles...thlibrary Link to Free42 for those who don't know what I'm talking about: http://thomasokken.com/free42/ I currently have this running on 32bit and 64bit Linux, and expect to have it working for Windows and OS X next weekend (March 1 or 2), if not sooner. Android will follow soon after; iOS will take a bit longer because I have to make some nonfloatingpointrelated changes to add proper support for the iPhone 5's larger screen, since Apple will no longer accept apps without such support. The new floatingpoint library has a slightly smaller dynamic range than BCD20 (exponents between a little under 6000 and a little over +6000, as opposed to 10000 through +9999), but it has 34digit precision, up from 25 in BCD20, and it supports denormal numbers and unbiased rounding. I haven't done any performance tests yet, but I expect the new library to be faster, since it stores numbers in a more efficient format. If anyone is interested in playing with this before the official release, drop me a line and I'll send you the 32bit and/or 64bit Linux build, or any of the others as soon as I am able to build them  or the source code, for anyone who would like to take a swing at building it themselves. Cheers!  Thomas 

02242014, 01:47 AM
Post: #2




RE: Free42 with IEEE 7542008 decimal floatingpoint  interested in a sneak preview?
Nice work. Just out of interest, what do you use for the mathematical functions?
I know you had you own implementations of many but I don't know how well they'd have come forward to the wider floats.  Pauli 

02242014, 02:33 AM
(This post was last modified: 02242014 02:47 AM by Thomas Okken.)
Post: #3




RE: Free42 with IEEE 7542008 decimal floatingpoint  interested in a sneak preview?
(02242014 01:47 AM)Paul Dale Wrote: Nice work. Just out of interest, what do you use for the mathematical functions? The Intel library provides all the functions Free42 needs; it doesn't just have arithmetic and square root, but also trigonometrics, hyperbolics, logarithms, and gamma. The new code uses all of these wherever possible, using the highestprecision format, decimal128. The higherlevel functionality, like complex numbers, matrices, numerical integration, and numerical rootfinding, is still done using the same algorithms and code as before, but everything now uses the new library for the basic operations underneath. In Free42 1.4, the first release that supported decimal floatingpoint, I basically replaced all occurrences of the C/C++ "double" type with "phloat" (silly, I know), which, in the binary builds, is #defined as "double", and in the decimal builds, is #defined as "Phloat" (note the capital P), which in turn is a C++ class that implements all the necessary constructors, assignment operators, and other operators and friend functions, so that it can be used as a dropin replacement for plain "double". All the BCD20 stuff was abstracted away by the Phloat class, and the new Free42 code basically just has a new Phloat that uses the Intel library underneath. There have been some changes to the binary/decimal conversion and display code, but that's about it.  Thomas 

02242014, 06:45 AM
Post: #4




RE: Free42 with IEEE 7542008 decimal floatingpoint  interested in a sneak preview?
I can hardly wait! For the Windows and iOS versions ;)
Werner 41CV†,42S,48GX,49G,DM42,DM41X,17BII,15CE,DM15L,12C,16CE 

02242014, 06:55 AM
Post: #5




RE: Free42 with IEEE 7542008 decimal floatingpoint  interested in a sneak preview
I'm interested in the Windows version. There's some free test capacity as long as day X hasn't come yet.
d:) 

02242014, 12:51 PM
Post: #6




RE: Free42 with IEEE 7542008 decimal floatingpoint  interested in a sneak preview?
OK, I have put up the Linux builds.
Link: http://thomasokken.com/free42/download/inteldecimal/ I will try to build the Windows version and upload it tonight, other versions to follow. I will post followups to this thread as additional versions become available.  Thomas 

02242014, 06:44 PM
Post: #7




RE: Free42 with IEEE 7542008 decimal floatingpoint  interested in a sneak preview?
This is so nice, very nice work indeed


02242014, 07:54 PM
Post: #8




RE: Free42 with IEEE 7542008 decimal floatingpoint  
02242014, 08:41 PM
Post: #9




Addendum: Free42 with IEEE 7542008 decimal floatingpoint
Quote:Because the significand is not normalized, most values with less than 34 significant digits have multiple possible representations; 1×10^{2}=0.1×10^{3}=0.01×10^{4}, etc. Zero has 12288 possible representations (24576 if you include both signed zeros).Thus maybe not a bug. Still strange. I'd definitely recommend to normalize the results. 

02242014, 10:12 PM
Post: #10




RE: Free42 with IEEE 7542008 decimal floatingpoint  interested in a sneak preview?
I hit the nonunique representation problem in the 34S. I don't remember how I solved it for display any more. Multiple representations of zero caused other issues  we couldn't just zero registers with a memory clear until after some code was added to detect this form of zero. In integer mode, a memory clear was the way to zero registers...
 Pauli 

02252014, 12:10 AM
Post: #11




RE: Free42 with IEEE 7542008 decimal floatingpoint  interested in a sneak preview?
(02242014 07:54 PM)Thomas Klemm Wrote: Is there a place where you want us to report bugs? You can use this thread, or the Free42 forum, or email me. Link to Free42 forum: http://groups.google.com/group/free42discuss My email: thomas_okken@yahoo.com (02242014 07:54 PM)Thomas Klemm Wrote: 1E34 This appears to be a quirk in the bid128_to_string() function in the Intel library. Numerically, there doesn't appear to be a problem: these zeroes with nonzero exponents do compare equal to regular zero and to each other. I added a couple of lines in the display code, to make it ignore the exponent when the mantissa is zero; the updated code is on my web site now, under the same URL as before.  Thomas 

02252014, 12:19 AM
Post: #12




RE: Free42 with IEEE 7542008 decimal floatingpoint  interested in a sneak preview?
The Windows build is going to take a bit longer than I thought. The Intel code won't compile in Visual C++ 6.0, so I may have to go back to VC++ 2010 or 2012. That means more work for me, and possibly the end of XP support. Argh! More tomorrow...


02252014, 07:31 AM
Post: #13




RE: Free42 with IEEE 7542008 decimal floatingpoint  interested in a sneak preview?
(02252014 12:19 AM)Thomas Okken Wrote: and possibly the end of XP support. XP is doomed anyway: 42 and counting. :) Greetings, Massimo +×÷ ↔ left is right and right is wrong 

02252014, 09:51 PM
Post: #14




RE: Free42 with IEEE 7542008 decimal floatingpoint  interested in a sneak preview?
(02252014 12:19 AM)Thomas Okken Wrote: The Intel code won't compile in Visual C++ 6.0, so I may have to go back to VC++ 2010 or 2012. That means more work for me, and possibly the end of XP support.Don't worry, XP is no problem, at least with VC++ 2010. Marcus von Cube Wehrheim, Germany http://www.mvcsys.de http://wp34s.sf.net http://mvcsys.de/doc/basiccompare.html 

02262014, 12:22 AM
(This post was last modified: 02262014 01:42 AM by Thomas Okken.)
Post: #15




RE: Free42 with IEEE 7542008 decimal floatingpoint  interested in a sneak preview?
(02252014 09:51 PM)Marcus von Cube Wrote:(02252014 12:19 AM)Thomas Okken Wrote: The Intel code won't compile in Visual C++ 6.0, so I may have to go back to VC++ 2010 or 2012. That means more work for me, and possibly the end of XP support.Don't worry, XP is no problem, at least with VC++ 2010. That's good to know. I'll try that then; if it compiles the Intel code, I should be good to go. Thanks for the tip! 

02262014, 12:42 AM
Post: #16




RE: Free42 with IEEE 7542008 decimal floatingpoint  interested in a sneak preview?
I had a bit of a poke around the Intel Decimal FloatingPoint Math Library last night hoping to find a faster implementation of logarithms for the 34S firmware. Lots of large tables and relatively straightforward functions. I suspect that this will be fast and large  suitable for desktop PCs but not so good for handheld devices. Oh well.
 Pauli 

02262014, 01:20 AM
Post: #17




RE: Free42 with IEEE 7542008 decimal floatingpoint  interested in a sneak preview?
(02262014 12:42 AM)Paul Dale Wrote: I had a bit of a poke around the Intel Decimal FloatingPoint Math Library last night hoping to find a faster implementation of logarithms for the 34S firmware. Lots of large tables and relatively straightforward functions. I suspect that this will be fast and large  suitable for desktop PCs but not so good for handheld devices. Oh well. It's certainly a lot larger than BCD20. The Free42 executables are gaining a lot of weight! The Linux builds of the library for x86 and amd64 are around 6 megabytes; about 5.5 MB for amd64 and 7 MB for x86. I haven't tried building it for ARM yet, but I expect something close to that higher number. Not something I would have wanted to use on 68k Palm devices... but on iOS or Android smartphones, no problem. 

02262014, 04:18 AM
Post: #18




RE: Free42 with IEEE 7542008 decimal floatingpoint  interested in a sneak preview?
The code didn't seem to support ARM out of the box. I couldn't be bothered added the defines to make it do so. It will be quite a bit larger on ARM than x86 and probably a bit larger even using THUMB (which the 34S does).
Better increase the flash size on the 43S so it will fit  Pauli 

02262014, 10:15 AM
Post: #19




RE: Free42 with IEEE 7542008 decimal floatingpoint  interested in a sneak preview?
Poking around some more and this decimal maths library requires a large amount of binary support too  supporting both probably wouldn't include much, if any, extra library code.
 Pauli 

03012014, 09:14 PM
(This post was last modified: 03012014 09:15 PM by Thomas Okken.)
Post: #20




RE: Free42 with IEEE 7542008 decimal floatingpoint  interested in a sneak preview?
I uploaded the Windows build. I used VC++ 2008 to compile the Intel library and Free42 proper.
I have only tested this on Windows 7, but I assume it will work in XP, too, though maybe that will require bundling the VC++ 2008 runtime. Since this thread is now on its second page, here's the download link again: http://thomasokken.com/free42/download/inteldecimal/ 

« Next Oldest  Next Newest »

User(s) browsing this thread: