[fpc-devel] DAMath for 64-bit FreePascal and Delphi

Jonas Maebe jonas.maebe at elis.ugent.be
Fri Feb 8 16:50:41 CET 2013


Since the zlib license is compatible with the (modified) LGPL, it  
should be possible to reuse parts of that unit to improve/replace  
parts of our softfloat code in rtl/inc/softpu.pp (used on win64 and  
pretty every non-x86 platform).



Path: aioe.org!.POSTED!not-for-mail
From: WE at completely.invalid (Wolfgang Ehrhardt)
Newsgroups: comp.lang.pascal.misc
Subject: ANN: DAMath for 64-bit FreePascal and Delphi
Date: Wed, 06 Feb 2013 08:40:38 GMT
Organization: Aioe.org NNTP Server
Lines: 32
Message-ID: <5112162f.5321175 at news.aioe.org>
NNTP-Posting-Host: 2H8GDv+gP2BXBhuPU9DKHA.user.speranza.aioe.org
X-Complaints-To: abuse at aioe.org
X-Notice: Filtered by postfilter v. 0.8.2
X-Newsreader: Forte Free Agent 1.21/32.243
Xref: aioe.org comp.lang.pascal.misc:305

The DAMath archive contains units for double precision accurate
mathematical methods without using multi precision arithmetic or
assembler. The main purpose is to make the AMath functions
available for 64-bit system without Extended Precision or 387-FPU,
but they can be used with 32-bit systems.

Native Delphi has made some of progress for the 64-bit numerical
math routines (there still great inaccuracies for some functions in
specific ranges), but unfortunately native FreePascal shows some very
bad results: On Win64 from the 53 bits of double precision it looses
up to

- 28 bits for trigonometric functions (sin,cos etc, range <= 1e10)

- 26 bits for lnxp1 (range 0..1e-4), despite the fact that lnxp1
   is specifically designed for small arguments

- 13 bits for sinh (whole range)

- 13 bits for exp (arg range 500..700)

and more examples.


On Win7/64 the 64-bit DAMath one argument elementary transcendental
functions and power have peak relative errors < 4.4e-16, the RMS
values are < 1.3e-16.


DAMath is open source (zlib license) available from
<http://wolfgang-ehrhardt.de/misc_en.html#damath>



More information about the fpc-devel mailing list