• Re: Double Double Precision Reference Tools

    From Krishna Myneni@krishna.myneni@ccreweb.org to comp.lang.forth on Fri Sep 18 06:15:02 2026
    From Newsgroup: comp.lang.forth

    On 9/16/26 6:24 AM, Krishna Myneni wrote:
    Owing to the recent discussion in other threads about conversion words
    in Forth from

    1. decimal string to a double double precision floating point number,
    2. double double fp number to an output string,

    it is helpful to have some reference tools to check against, for both
    cases.

    I have written two short Fortran 90 programs to provide reference outputs:

    dp2_to_ddr.f90 -- read two dp numbers and output the double double ddr_to_dp2.f90 -- read double double input and output the two dp numbers

    The programs are used with David Bailey's Fortran package
    ddfun-04.tar.gz, which may be found at his home page:

    https://www.davidhbailey.com/dhbsoftware/

    The package contents have also been placed at the following link:

    https://ccreweb.org/software/ddfun/


    I've revised and renamed the two programs:

    dp2_to_ddr.f90 --> dp2_to_dd.f90
    ddr_to_dp2.f90 --> dd_to_dp2.f90

    The renaming change better aligns with the terminology used in the ddfun package.

    The revisions use direct access to the two double precision values of a
    double double variable, instead of computing them. There's no change in behavior (as far as I can tell) for the two programs.

    The link for the two revised programs is

    https://ccreweb.org/software/ddfun/dd_to_dp2/

    --
    KM

    --- Synchronet 3.22a-Linux NewsLink 1.2
  • From Krishna Myneni@krishna.myneni@ccreweb.org to comp.lang.forth on Sun Sep 20 14:57:18 2026
    From Newsgroup: comp.lang.forth

    On 9/18/26 6:15 AM, Krishna Myneni wrote:
    On 9/16/26 6:24 AM, Krishna Myneni wrote:
    Owing to the recent discussion in other threads about conversion words
    in Forth from

    1. decimal string to a double double precision floating point number,
    2. double double fp number to an output string,

    it is helpful to have some reference tools to check against, for both
    cases.

    I have written two short Fortran 90 programs to provide reference
    outputs:

    dp2_to_ddr.f90 -- read two dp numbers and output the double double
    ddr_to_dp2.f90 -- read double double input and output the two dp numbers

    The programs are used with David Bailey's Fortran package
    ddfun-04.tar.gz, which may be found at his home page:

    https://www.davidhbailey.com/dhbsoftware/

    The package contents have also been placed at the following link:

    https://ccreweb.org/software/ddfun/


    I've revised and renamed the two programs:

    dp2_to_ddr.f90 --> dp2_to_dd.f90
    ddr_to_dp2.f90 --> dd_to_dp2.f90

    The renaming change better aligns with the terminology used in the ddfun package.

    The revisions use direct access to the two double precision values of a double double variable, instead of computing them. There's no change in behavior (as far as I can tell) for the two programs.

    The link for the two revised programs is

    https://ccreweb.org/software/ddfun/dd_to_dp2/


    For those who use Windows and don't have gfortran available, I've spent
    some time porting the ddfun-v04 code to compile under the Silverfrost
    Fortran 95 compiler for Windows. I used the trial/evaluation version,
    aka the personal edition, of their FTN95 compiler, which I had been
    playing with for a couple of days. I had to rewrite some code in a few subroutines in ddfuna.f90 for dd numbers to be properly output (through
    the ddwrite interface) due to FTN95 compiler optimizations. Maybe the optimizations can be turned off, but I didn't know how. I also had to
    account for the compiler-dependent KIND parameter in declaring a REAL.

    In addition to being able to build the executable for ddfuntest.f90,
    which demos the use of double double arithmetic *and* the computation a
    large number of double double special functions, and measures their
    error, one can use it to make Win32 exe files for the double double
    tools, dp2_to_dd.f90 and dd_to_dp2.exe.

    The port may be found at the same link,

    https://ccreweb.org/software/ddfun

    in the ddfun-v04/ftn95 subdirectory. Please see the file,

    readme-build-ftn95.txt

    within this folder for notes on changes to the original package code,
    and the build instructions for ddfuntest.exe. The dd_to_dp2 executables
    may be built in the same way.

    --
    Krishna Myneni








    --- Synchronet 3.22a-Linux NewsLink 1.2