caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: David Chase <chase@world.std.com>
To: caml-list@inria.fr
Subject: Re: Coyote Gulch test in Caml (was Re: [Caml-list] speed )
Date: Mon, 20 Jan 2003 16:23:22 -0500	[thread overview]
Message-ID: <5.2.0.9.0.20030120161510.066e4598@pop.theWorld.com> (raw)
In-Reply-To: <20030118155054.C22850@speakeasy.org>

At 03:50 PM 1/18/2003 -0800, Shawn Wagner wrote:
>On Sat, Jan 18, 2003 at 05:49:47PM -0500, Oleg wrote:
>> On Saturday 04 January 2003 01:31 pm, Xavier Leroy wrote:
>> > Apparently, the ocamlopt-generated code
>> > offers less instruction-level parallelism than the g++-generated code
>> > for the float computations.  Still, I haven't really understood where
>> > the factor of 2 comes from.  
>
>> Just as wild guess: the code contains calls to "sin" and "cos" on the same 
>> value. Perhaps GCC manages to optimize those into one call to "sincos"
>
>It doesn't. I tried making a C++ version that does when I was fooling around
>with it. Didn't really help. The single greatest speed increase I got (Which
>did something like cut the runtime in half) was -ffast-math, which cuts out
>the trig function calls in favor of direct use of the proper x86
>instructions. But the inlined-sincos (__sincos()) in glibc causes a segfault
>on my athlon when I tried using it. :P

Just a silly question, but if you want sin and cos to go faster,
how much accuracy are you willing to trade away for improved
performance?  Just for example, by using the Pentium instructions,
you reduce the number of (accurate) significant bits in the result
from 53 (IEEE double) to 13 (for some inputs between zero and 2*PI).
(If you are using 64-bit mantissas, the worst case is only 4 bits of
accuracy.)

I've noticed over the years that people focus on speed over many other
things, usually because they can measure it.  Well, we can measure
accuracy of transcendental functions, too, so I thought I would
ask the question.  How much is enough for your application?  Of the
languages being benchmarked, which one has the most accurate
transcendental functions?  Is this less important than speed?

David Chase


-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


  reply	other threads:[~2003-01-20 21:23 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-01-03 16:00 [Caml-list] speed onlyclimb
2003-01-03 11:38 ` [Caml-list] speed Clemens Hintze
2003-01-03 11:47 ` [Caml-list] speed Noel Welsh
2003-01-02 16:45   ` Chet Murthy
2003-01-03 13:32 ` Xavier Leroy
2003-01-02 17:52   ` Chet Murthy
2003-01-03 14:53     ` Sven Luther
2003-01-03 15:28       ` Erol Akarsu
2003-01-02 17:53   ` Coyote Gulch test in Caml (was Re: [Caml-list] speed ) Chet Murthy
2003-01-03 15:10     ` Shawn Wagner
2003-01-03 15:56       ` Oleg
2003-01-04 18:31       ` Xavier Leroy
2003-01-18 22:49         ` Oleg
2003-01-18 23:50           ` Shawn Wagner
2003-01-20 21:23             ` David Chase [this message]
2003-01-20 21:39               ` Nickolay Semyonov-Kolchin
2003-01-21  0:54                 ` Brian Hurt
2003-01-21 13:09                 ` David Chase
2003-01-21 13:15                   ` Daniel Andor
2003-01-21 20:26                   ` Nickolay Semyonov-Kolchin
2003-01-19 10:33           ` Siegfried Gonzi
2003-01-19 10:34           ` Siegfried Gonzi
2003-01-21  9:56           ` [Caml-list] Re: Coyote Gulch test in Caml Xavier Leroy
2003-01-21 15:57             ` Brian Hurt
2003-01-27 16:58             ` Daniel Andor
2003-01-28  8:27               ` Christian Lindig
2003-01-05  1:13   ` [Caml-list] speed Brian Hurt
2003-01-05  1:48     ` Michael Vanier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5.2.0.9.0.20030120161510.066e4598@pop.theWorld.com \
    --to=chase@world.std.com \
    --cc=caml-list@inria.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).