Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0000021OCaml~DO NOT USE (was: OCaml general)public2000-01-13 10:002004-04-18 16:39
Assigned To 
PlatformOSOS Version
Product Version 
Target VersionFixed in Version 
Summary0000021: Inline expansion of transcendentals
DescriptionFull_Name: David McClain
Submission from: (
Submitted by: xleroy

Since I do a great deal of bluk math processing, it would sure be nice if
many of the simpler transcendental functions could be inlined by OCAMLOPT.
I'm speaking primarily of round_to_int, sin, cos, tan, asin, acos, atan,
atan2, log, exp, sqrt, etc.

I modified the 2.02 compiler to support these and found that the necessary
changes were really quite easy to make. But I don't look forward to making
these same mods every time a new compiler is released.

Of course I am working on Pentium class machines which have these functions
available in hardware. Other arhitectures might not be so kind in this

David McClain

[Added in a later message]

I can appreciate the desire to keep the language pure and proper, but I must
say that in nearly 30 years of experience I have never been tempted to take
the sin of 2^64. I would suggest that an inline version of the basic
transcendentals be made available along the same lines that unsafe_get and
unsafe_set are made available for array access. They are inlined for speed,
and provide little or no error checking. Their use is flagged by the
prominent "unsafe" prefix in the source text, and the option is available to
the end user as to when to use them....

TagsNo tags attached.
Attached Files

- Relationships

-  Notes
administrator (administrator)
2004-04-18 16:39

Wish granted in 3.07 (option -ffast-math to ocamlopt)

- Issue History
Date Modified Username Field Change
2005-11-18 10:14 administrator New Issue
2017-02-23 16:36 doligez Category OCaml general => -OCaml general
2017-03-03 17:55 doligez Category -OCaml general => -(deprecated) general
2017-03-03 18:01 doligez Category -(deprecated) general => ~deprecated (was: OCaml general)
2017-03-06 17:04 doligez Category ~deprecated (was: OCaml general) => ~DO NOT USE (was: OCaml general)

Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker