Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inline expansion of transcendentals #2354

Closed
vicuna opened this issue Jan 13, 2000 · 1 comment
Closed

Inline expansion of transcendentals #2354

vicuna opened this issue Jan 13, 2000 · 1 comment

Comments

@vicuna
Copy link

vicuna commented Jan 13, 2000

Original bug ID: 21
Reporter: administrator
Status: closed
Resolution: fixed
Priority: normal
Severity: feature
Category: ~DO NOT USE (was: OCaml general)

Bug description

Full_Name: David McClain
Version:
OS:
Submission from: estephe.inria.fr (128.93.11.95)
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
regard...

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....

@vicuna
Copy link
Author

vicuna commented Apr 18, 2004

Comment author: administrator

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant