This is the mail archive of the
glibc-bugs@sourceware.org
mailing list for the glibc project.
[Bug math/5781] Slow dbl-64 sin/cos/sincos for special values
- From: "vincent-srcware at vinc17 dot net" <sourceware-bugzilla at sourceware dot org>
- To: glibc-bugs at sourceware dot org
- Date: Thu, 16 Apr 2015 13:15:01 +0000
- Subject: [Bug math/5781] Slow dbl-64 sin/cos/sincos for special values
- Auto-submitted: auto-generated
- References: <bug-5781-131 at http dot sourceware dot org/bugzilla/>
https://sourceware.org/bugzilla/show_bug.cgi?id=5781
--- Comment #17 from Vincent LefÃvre <vincent-srcware at vinc17 dot net> ---
(In reply to Petr Cervenka from comment #16)
> Simple workaround to use fast computation is to use functions from spec.
> header similar to following:
[long double versions: sinl, etc.]
This is not quite correct. These long double versions currently have a lower
worst-case time (this might change in the future), but in average they are
slower than the current double versions, with a factor around 5 - 6 from some
tests on my machine. So, use this workaround only if you want a better
worst-case time, e.g. for real-time system (this is your case[1], isn't it?).
[1] http://www.xenomai.org/pipermail/xenomai/2008-February/012416.html
The current library is slow, and libraries such as CRlibm could greatly improve
things, but hard-to-round cases would always be slower than the average cases.
So, the best implementation depends on the user's application. I suppose that
most users would be happy with a *good* correctly rounded implementation since
the loss due to correct rounding should hardly be noticeable *in average*
compared to an implementation with just a very good accuracy (something close
to 0.5 ulp). Then there are users who accept to sacrifice correct rounding and
accuracy for faster functions. IMHO, the question is whether the GNU libc
should implement such variants and provide a way for the user to select them
(but this could mean other two variants or more[2]) or the user should build
his own library based on his own requirements, e.g. with tools like MetaLibm[3]
or other future tools.
[2] This should cover the accuracy for small arguments, but users may also have
different requirements concerning the range reduction (large arguments).
[3] http://www.metalibm.org/
--
You are receiving this mail because:
You are on the CC list for the bug.