News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests
NB: Posting URL's See here: Posted URL Change

Main Menu

Playing with DoubleDouble presicion

Started by HSE, February 20, 2023, 05:42:06 AM

Previous topic - Next topic

TimoVJL

#30
Perhaps same idea ?
http://web.mit.edu/tabbott/Public/quaddouble-debian/qd-2.3.4-old/docs/qd.pdf

EDIT 2023-11-19
QDC was a QD fork in C, but never finished  :sad:
May the source be with you

Biterider

Hi Timo
The idea of extending double-double to quad-double is appealing  :thumbsup:
But before getting into that, wouldn't it be wiser to explore extending double-double with REAL10 instead of REAL8? This would give the same algorithm 8 digits more precision without increasing the complexity using today's existing x86 hardware.

Biterider


NoCforMe

Hey, that's clever! And even I can understand how it works. Kewl.
Assembly language programming should be fun. That's why I do it.

jack

it's an interesting subject, but some years ago I tested the performance of dd vs soft-float and soft-float was a bit faster
just now I did a very simple test of qd vs my kindergarten mp float routines and mine was about 45% slower than qd

NoCforMe

Um, what exactly is "soft-float"? It certainly can't be floating-point implemented in software if it's faster than "hard-float".
Assembly language programming should be fun. That's why I do it.

HSE

Quote from: TimoVJL on November 18, 2023, 08:16:44 PMPerhaps same idea ?
http://web.mit.edu/tabbott/Public/quaddouble-debian/qd-2.3.4-old/docs/qd.pdf

Exactly same idea.

Apparently nobody is using qd, probably because range of exponents anyway is that of REAL8. That trigger the circle few used - hardly accepted for publication - few used.

The easy thing could be to use Lawrence Berkeley National Laboratory libraries, but they have now another licenses. I don't remember what was, just not or fun. 

Equations in Assembly: SmplMath

HSE

Hi Biterider,

Quote from: Biterider on November 18, 2023, 09:14:46 PMBut before getting into that, wouldn't it be wiser to explore extending double-double with REAL10 instead of REAL8?

In the FPU, calculations between REAL10 numbers don't always have REAL10 precision (never trascendental functions, IIRC).

To make calculations between REAL8 numbers and to obtain always REAL8 precision, the FPU use REAL10 as internal representation.

No problem with REAL10 if you solve calculations by hand, instead of FPU  :biggrin:  :biggrin:

HSE
Equations in Assembly: SmplMath

jack

#37
Alan Miller implemented dd and qd in FORTRAN https://jblevins.org/mirror/amiller/#nas should be easy enough to translate the code to your favorite language
btw, here's SoftFloat http://www.jhauser.us/arithmetic/SoftFloat.html

NoCforMe

Quote from: jack on November 19, 2023, 09:56:04 AMbtw, here's SoftFloat

Thanks (turned that into a clickable link for you; just posting URLs doesn't make them into links here anymore)

But but but ... if it's implemented in software, how could it possibly be faster than a FPU?
Assembly language programming should be fun. That's why I do it.

jack

not faster than the FPU but faster than dd
btw, the quad_nas.f90 only need 2 small changes for it to compile with gfortran
change line 51 from   INTEGER, PARAMETER    :: r10 = 3
to INTEGER, PARAMETER    :: r10 = real(10)
and line 1464 to 0.0000000000000000000_r10 ,  0.000000000000000000_r10      , &

HSE

Hi jack,


Quote from: jack on November 19, 2023, 09:56:04 AMAlan Miller implemented dd and qd in FORTRAN https://jblevins.org/mirror/amiller/#nas should be easy enough to translate the code to your favorite language
btw, here's SoftFloat http://www.jhauser.us/arithmetic/SoftFloat.html

No.  :eusa_naughty:

QuoteThe latest release of SoftFloat implements five floating-point formats: 16-bit half-precision, 32-bit single-precision, 64-bit double-precision, 80-bit double-extended-precision, and 128-bit quadruple-precision

That don't have double-double-precision nor quadruple-double-precision.

HSE
Equations in Assembly: SmplMath

jack

128-bit is the same as double-double  :bgrin:
but SoftFloat doesn't come with string to float and vice versa conversion routines, I need to look and see what I used

HSE

Equations in Assembly: SmplMath

jack

dd and Soft-128 both give about 33-34 decimal digits the difference being that Soft-128 has a larger exponent range
for Soft-float you can use https://github.com/jwiegley/gdtoa for the conversions

HSE

Quote from: jack on November 19, 2023, 11:02:47 AMdd and Soft-128 both

They are 2 diferents formats.

Double-double-precision (Real8,Real8) use FPU, then is very fast (same idea is used in Quadruple-double-precision (Real8,Real8,Real8,Real8)).

Quadruple-precision (Real16 or Soft-128) requiere a library to execute some kind of emulation in memory, that is very slow.


Quote from: jack on November 19, 2023, 11:02:47 AMyou can use https://github.com/jwiegley/gdtoa for the conversions

You can convert numbers between any format you can think, if they fit inside format range, eventualy loosing precision.
Equations in Assembly: SmplMath