Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.forth > #135651

ddfloat library: the behavior of >dd

From marcel hendrix <mhx@iae.nl>
Newsgroups comp.lang.forth
Subject ddfloat library: the behavior of >dd
Date 2026-09-10 19:33 +0200
Organization A noiseless patient Spider
Message-ID <117uplc$160ff$1@dont-email.me> (permalink)

Show all headers | View raw


( I'm starting a new thread because "Getting the exponent of an x87 
float" is becoming unwieldy large )

I ported D. Bailey's fp library functions to iForth in 2006. However,
because there was no convenient way to test the accuracy of the 
double-double results, it has been unclear if the result were really 
accurate up to 106 bits, and if not, if there were bugs in my 
implementation.

The most convenient way to test D. Bailey's package is to compare its 
output to MATLAB, because I can then use the vpa() function (a variable 
precision arithmetic package) through iForth's COM interface on Windows.

As this will involve string manipulation I have to make sure the >DD
function is robust. I encounter some problems that may or may not have 
been covered in the "Getting the exponent of an x87 float" thread.

Here is the list so far:
   s" 9999999999999999999999999999999999999999999999999999d0"   >dd 
ddfe. 1.00000000000000001224290705471e50   not ok
   s" 8999999999999999999999999999999999999999999999999999d0"   >dd 
ddfe. 9.00000000000000066309858349023e49   not ok
   s" .9999999999999999999999999999999999999999999999999999d0"  >dd 
ddfe. 1.000000000000000100000000000000e0   not ok
   s" 0.99999999999999999999d44" 			       >dd ddfe. 
1.00000000000000000000208925819e44   not ok
   s" 0.99999999999999999999d34"                                >dd 
ddfe. 1.00000000000000000001814749767e34   not ok
   s" 0.99999999999999999999d30"                                >dd 
ddfe. 9.99999999999999999972820130815e29   not ok
   s" 0.99999999999999999999d28"                                >dd ddfe.
0.99999999999999999999000000000e28   ok
   s" 0.9999999999999999999999999999999999999999999999999999d0" >dd ddfe.
1.000000000000000000000000000000e0   ok
   s" 1.9999999999999999999999999999999999999999999999999999d0" >dd 
ddfe. 2.000000000000000000000000000000e0   ok

... which hints that the exponent should not exceed +30 and that the 
number must start with "[optional sign][0<=digit<9]".

   s" 0.00000000000000000000001d" >dd ddfe. 
1.000000000000000000005091539406e-23  not ok
   s" 0.000000000000000000001d"   >dd ddfe.
0.999999999999999999988259524950e-21  not ok

The mantissa should be smaller than 30 decimals?

   s" 0.0000000000000000001d"     >dd ddfe. 
0.999999999999999999995600113174e-19  not ok
   s" 0.00000000000000001d"       >dd ddfe. 
9.999999999999999999645978009888e-18  not ok
   s" 0.000000000000001d"         >dd ddfe. 
1.000000000000000000000000000000e-15  ok
   s" 0.0000000000000001d"        >dd ddfe. 
9.999999999999999999699073446189e-17  not ok
   s" 1.000000000000000d-16"      >dd ddfe. 
1.000000000000000000028598854846e-16  not ok
   s" 1.000000000000000d-15"      >dd ddfe. 
1.000000000000000000052694643620e-15  not ok
   s" 1.000000000000000d-5"       >dd ddfe. 
1.000000000000000000007126988157e-5   not ok
   s" 1.000000000000000d-1"       >dd ddfe. 
9.999999999999999999661186821098e-2   not ok

... which suggests that a negative exponent (or a number between  0 and 
1e-16) is a problem.

   s" 1e-30"                      >dd ddfe. 
1.000000000000000000000000000000e-30  ok
   s" 1.0e-30"                    >dd ddfe. 
0.999999999999999999986447472844e-30  not ok

... which tells me that there might be a problem when a decimal point is 
used, or that a buffer is overwritten.

If I get reports  that >dd ddfe. processes all of these fine on other 
Forths it may be advantageous to fix >dd ddfe. Otherwise, I'd better go 
straight for the MPFR libraries.

-marcel

Back to comp.lang.forth | Previous | Next — Next in thread | Find similar | Unroll thread


Thread

ddfloat library: the behavior of >dd marcel hendrix <mhx@iae.nl> - 2026-09-10 19:33 +0200
  Re: ddfloat library: the behavior of >dd Krishna Myneni <krishna.myneni@ccreweb.org> - 2026-09-10 13:35 -0500
    Re: ddfloat library: the behavior of >dd marcel hendrix <mhx@iae.nl> - 2026-09-10 22:10 +0200
      Re: ddfloat library: the behavior of >dd Krishna Myneni <krishna.myneni@ccreweb.org> - 2026-09-10 16:51 -0500
  Re: ddfloat library: the behavior of >dd dxf <dxforth@gmail.com> - 2026-09-11 12:16 +1000
    Re: ddfloat library: the behavior of >dd marcel hendrix <mhx@iae.nl> - 2026-09-11 12:05 +0200
      Re: ddfloat library: the behavior of >dd marcel hendrix <mhx@iae.nl> - 2026-09-12 00:27 +0200
        Re: ddfloat library: the behavior of >dd Krishna Myneni <krishna.myneni@ccreweb.org> - 2026-09-11 20:29 -0500
          Re: ddfloat library: the behavior of >dd dxf <dxforth@gmail.com> - 2026-09-12 12:02 +1000
            Re: ddfloat library: the behavior of >dd Krishna Myneni <krishna.myneni@ccreweb.org> - 2026-09-12 10:24 -0500
          Re: ddfloat library: the behavior of >dd marcel hendrix <mhx@iae.nl> - 2026-09-12 10:45 +0200
            Re: ddfloat library: the behavior of >dd dxf <dxforth@gmail.com> - 2026-09-12 19:51 +1000
            Re: ddfloat library: the behavior of >dd dxf <dxforth@gmail.com> - 2026-09-12 22:47 +1000
              Re: ddfloat library: the behavior of >dd dxf <dxforth@gmail.com> - 2026-09-13 03:14 +1000
                Re: ddfloat library: the behavior of >dd Krishna Myneni <krishna.myneni@ccreweb.org> - 2026-09-12 13:02 -0500
                Re: ddfloat library: the behavior of >dd dxf <dxforth@gmail.com> - 2026-09-13 15:44 +1000
                Re: ddfloat library: the behavior of >dd marcel hendrix <mhx@iae.nl> - 2026-09-13 09:00 +0200
                Re: ddfloat library: the behavior of >dd dxf <dxforth@gmail.com> - 2026-09-13 20:33 +1000
                Re: ddfloat library: the behavior of >dd dxf <dxforth@gmail.com> - 2026-09-14 13:28 +1000
                Re: ddfloat library: the behavior of >dd marcel hendrix <mhx@iae.nl> - 2026-09-14 10:09 +0200
                Re: ddfloat library: the behavior of >dd dxf <dxforth@gmail.com> - 2026-09-14 20:00 +1000
                Re: ddfloat library: the behavior of >dd marcel hendrix <mhx@iae.nl> - 2026-09-14 12:22 +0200
                Re: ddfloat library: the behavior of >dd dxf <dxforth@gmail.com> - 2026-09-14 21:59 +1000
                Re: ddfloat library: the behavior of >dd marcel hendrix <mhx@iae.nl> - 2026-09-14 14:26 +0200
                Re: ddfloat library: the behavior of >dd dxf <dxforth@gmail.com> - 2026-09-15 01:32 +1000
                Re: ddfloat library: the behavior of >dd marcel hendrix <mhx@iae.nl> - 2026-09-14 21:08 +0200
                Re: ddfloat library: the behavior of >dd Krishna Myneni <krishna.myneni@ccreweb.org> - 2026-09-14 15:25 -0500
                Re: ddfloat library: the behavior of >dd dxf <dxforth@gmail.com> - 2026-09-15 13:11 +1000
                Re: ddfloat library: the behavior of >dd marcel hendrix <mhx@iae.nl> - 2026-09-15 14:06 +0200
                Re: ddfloat library: the behavior of >dd dxf <dxforth@gmail.com> - 2026-09-16 00:05 +1000
                Re: ddfloat library: the behavior of >dd anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2026-09-14 15:00 +0000
                Re: ddfloat library: the behavior of >dd marcel hendrix <mhx@iae.nl> - 2026-09-14 21:15 +0200
                Re: ddfloat library: the behavior of >dd Krishna Myneni <krishna.myneni@ccreweb.org> - 2026-09-14 15:29 -0500
                Re: ddfloat library: the behavior of >dd anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2026-09-14 20:58 +0000
                Re: ddfloat library: the behavior of >dd Krishna Myneni <krishna.myneni@ccreweb.org> - 2026-09-15 07:33 -0500
                Re: ddfloat library: the behavior of >dd anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2026-09-15 15:53 +0000
                Re: ddfloat library: the behavior of >dd Krishna Myneni <krishna.myneni@ccreweb.org> - 2026-09-15 15:23 -0500
                Re: ddfloat library: the behavior of >dd Krishna Myneni <krishna.myneni@ccreweb.org> - 2026-09-15 17:53 -0500

csiph-web