Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0004638OCamlOCaml generalpublic2008-11-05 17:132011-05-29 12:14
ReporterChristophe Troestler 
Assigned Toxleroy 
PrioritynormalSeverityfeatureReproducibilityalways
StatusclosedResolutionfixed 
PlatformOSOS Version
Product Version3.11.0+beta 
Target VersionFixed in Version3.12.0+dev 
Summary0004638: Provide expm1 and log1p
DescriptionThe functions expm1 and log1p are important in some situations to avoid loss of precision. It will be nice to have them available in OCaml by default.
TagsNo tags attached.
Attached Files

- Relationships

-  Notes
(0004718)
xleroy (administrator)
2008-11-09 10:20

I agree expm1 and log1p are useful. The problem is that these functions are not in the C89 standard ("ANSI C"), only in C99. In particular, Microsoft's standard library does not implement them. So, we have a cross-platform portability issue here.

In the meantime, there exists numerically-accurate implementations in terms of regular exp() and log(), due to W. Kahan himself:
  http://www.plunk.org/~hatch/rightway.php [^]
Maybe these would be good enough for your application.


(0004794)
Christophe Troestler (reporter)
2008-12-11 15:58
edited on: 2008-12-11 15:58

Thanks for your prompt reply. Since I use Linux, I did a direct binding to the C function but maybe, for windows, a binding to fdlibm http://www.netlib.org/fdlibm/ [^] can maybe envisioned?

(0004896)
xleroy (administrator)
2009-04-01 18:11

Tentative implementation in CVS trunk. Use Kahan's magic formulae if the C library doesn't provide the functions. Scheduled for inclusion in release 3.12.0.

- Issue History
Date Modified Username Field Change
2008-11-05 17:13 Christophe Troestler New Issue
2008-11-09 10:20 xleroy Note Added: 0004718
2008-11-09 10:20 xleroy Status new => acknowledged
2008-12-11 15:58 Christophe Troestler Note Added: 0004794
2008-12-11 15:58 Christophe Troestler Note Edited: 0004794
2009-03-31 13:47 xleroy Status acknowledged => assigned
2009-03-31 13:47 xleroy Assigned To => xleroy
2009-04-01 18:11 xleroy Note Added: 0004896
2009-04-01 18:11 xleroy Status assigned => resolved
2009-04-01 18:11 xleroy Resolution open => fixed
2009-04-01 18:11 xleroy Fixed in Version => 3.12.0+dev
2011-05-29 12:14 xleroy Status resolved => closed


Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker