public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug math/5781] Slow sine function for special values on AMD64 - second attempt
       [not found] <bug-5781-131@http.sourceware.org/bugzilla/>
@ 2012-02-29 20:20 ` jsm28 at gcc dot gnu.org
  2013-04-01 12:54 ` siddhesh at redhat dot com
                   ` (18 subsequent siblings)
  19 siblings, 0 replies; 20+ messages in thread
From: jsm28 at gcc dot gnu.org @ 2012-02-29 20:20 UTC (permalink / raw)
  To: glibc-bugs

http://sourceware.org/bugzilla/show_bug.cgi?id=5781

Joseph Myers <jsm28 at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|REOPENED                    |SUSPENDED
         AssignedTo|aj at suse dot de           |unassigned at sourceware
                   |                            |dot org

--- Comment #6 from Joseph Myers <jsm28 at gcc dot gnu.org> 2012-02-29 20:19:32 UTC ---
Confirmed with current sources.  Suspending until a faster correctly rounding
implementation (such as that proposed in
http://gcc.gnu.org/ml/gcc/2012-02/msg00298.html ) is available as this is
probably not amenable to a simple local fix.

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 20+ messages in thread

* [Bug math/5781] Slow sine function for special values on AMD64 - second attempt
       [not found] <bug-5781-131@http.sourceware.org/bugzilla/>
  2012-02-29 20:20 ` [Bug math/5781] Slow sine function for special values on AMD64 - second attempt jsm28 at gcc dot gnu.org
@ 2013-04-01 12:54 ` siddhesh at redhat dot com
  2013-04-10  4:25 ` siddhesh at redhat dot com
                   ` (17 subsequent siblings)
  19 siblings, 0 replies; 20+ messages in thread
From: siddhesh at redhat dot com @ 2013-04-01 12:54 UTC (permalink / raw)
  To: glibc-bugs

http://sourceware.org/bugzilla/show_bug.cgi?id=5781

Siddhesh Poyarekar <siddhesh at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |siddhesh at redhat dot com

--- Comment #7 from Siddhesh Poyarekar <siddhesh at redhat dot com> 2013-04-01 12:54:41 UTC ---
FWIW, the function now runs much faster after the multiple precision
improvements.  The worst case is only about a 100 times slower now instead of
1000 times.

I've not looked yet, but I think there is a case for capping maximum precision
for worst case computation for sin (and all trigonometric functions) as well,
so this could get even better.

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 20+ messages in thread

* [Bug math/5781] Slow sine function for special values on AMD64 - second attempt
       [not found] <bug-5781-131@http.sourceware.org/bugzilla/>
  2012-02-29 20:20 ` [Bug math/5781] Slow sine function for special values on AMD64 - second attempt jsm28 at gcc dot gnu.org
  2013-04-01 12:54 ` siddhesh at redhat dot com
@ 2013-04-10  4:25 ` siddhesh at redhat dot com
  2013-12-03 18:40 ` jsm28 at gcc dot gnu.org
                   ` (16 subsequent siblings)
  19 siblings, 0 replies; 20+ messages in thread
From: siddhesh at redhat dot com @ 2013-04-10  4:25 UTC (permalink / raw)
  To: glibc-bugs

http://sourceware.org/bugzilla/show_bug.cgi?id=5781

Siddhesh Poyarekar <siddhesh at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|SUSPENDED                   |ASSIGNED
         AssignedTo|unassigned at sourceware    |siddhesh at redhat dot com
                   |dot org                     |

--- Comment #8 from Siddhesh Poyarekar <siddhesh at redhat dot com> 2013-04-10 04:25:05 UTC ---
Opening this since I've been working on improvements to the multiple precision
bits that should have positive effect here.  In fact as I mentioned in comment
7, improvements are already evident.

Since optimization patches can go on forever, I'm going to put a cap on it for
the resolution of this bug.  The cap is to implement findings of [1] if
applicable.

[1] http://perso.ens-lyon.fr/jean-michel.muller/TMDworstcases.pdf

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 20+ messages in thread

* [Bug math/5781] Slow sine function for special values on AMD64 - second attempt
       [not found] <bug-5781-131@http.sourceware.org/bugzilla/>
                   ` (2 preceding siblings ...)
  2013-04-10  4:25 ` siddhesh at redhat dot com
@ 2013-12-03 18:40 ` jsm28 at gcc dot gnu.org
  2014-02-05 21:07 ` john.wilkinson at spirent dot com
                   ` (15 subsequent siblings)
  19 siblings, 0 replies; 20+ messages in thread
From: jsm28 at gcc dot gnu.org @ 2013-12-03 18:40 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=5781

Joseph Myers <jsm28 at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|normal                      |enhancement

-- 
You are receiving this mail because:
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 20+ messages in thread

* [Bug math/5781] Slow sine function for special values on AMD64 - second attempt
       [not found] <bug-5781-131@http.sourceware.org/bugzilla/>
                   ` (3 preceding siblings ...)
  2013-12-03 18:40 ` jsm28 at gcc dot gnu.org
@ 2014-02-05 21:07 ` john.wilkinson at spirent dot com
  2014-02-06  7:40 ` john.wilkinson at spirent dot com
                   ` (14 subsequent siblings)
  19 siblings, 0 replies; 20+ messages in thread
From: john.wilkinson at spirent dot com @ 2014-02-05 21:07 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=5781

John Wilkinson <john.wilkinson at spirent dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |john.wilkinson at spirent dot com

--- Comment #9 from John Wilkinson <john.wilkinson at spirent dot com> ---
I have also come across a very similar issue on i7 Intel platforms, please see
bug 16531. Calls to cos can take around 0.15 ms, 1000 times their normal time,
which is a serious problem for the real-time system we are developing.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 20+ messages in thread

* [Bug math/5781] Slow sine function for special values on AMD64 - second attempt
       [not found] <bug-5781-131@http.sourceware.org/bugzilla/>
                   ` (4 preceding siblings ...)
  2014-02-05 21:07 ` john.wilkinson at spirent dot com
@ 2014-02-06  7:40 ` john.wilkinson at spirent dot com
  2014-02-06 15:48 ` carlos at redhat dot com
                   ` (13 subsequent siblings)
  19 siblings, 0 replies; 20+ messages in thread
From: john.wilkinson at spirent dot com @ 2014-02-06  7:40 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=5781

--- Comment #10 from John Wilkinson <john.wilkinson at spirent dot com> ---
*** Bug 16531 has been marked as a duplicate of this bug. ***

-- 
You are receiving this mail because:
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 20+ messages in thread

* [Bug math/5781] Slow sine function for special values on AMD64 - second attempt
       [not found] <bug-5781-131@http.sourceware.org/bugzilla/>
                   ` (5 preceding siblings ...)
  2014-02-06  7:40 ` john.wilkinson at spirent dot com
@ 2014-02-06 15:48 ` carlos at redhat dot com
  2014-02-06 18:27 ` [Bug math/5781] Slow sine function for special values jsm28 at gcc dot gnu.org
                   ` (12 subsequent siblings)
  19 siblings, 0 replies; 20+ messages in thread
From: carlos at redhat dot com @ 2014-02-06 15:48 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=5781

Carlos O'Donell <carlos at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |carlos at redhat dot com

--- Comment #11 from Carlos O'Donell <carlos at redhat dot com> ---
(In reply to John Wilkinson from comment #9)
> I have also come across a very similar issue on i7 Intel platforms, please
> see bug 16531. Calls to cos can take around 0.15 ms, 1000 times their normal
> time, which is a serious problem for the real-time system we are developing.

The default libm functions never guarantee constant runtime. You will have this
same problem for many of the functions provided by the library.

However we are working on enhancing libm to include something like what you're
looking for. Please have look at and comment:
https://sourceware.org/glibc/wiki/libm

-- 
You are receiving this mail because:
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 20+ messages in thread

* [Bug math/5781] Slow sine function for special values
       [not found] <bug-5781-131@http.sourceware.org/bugzilla/>
                   ` (6 preceding siblings ...)
  2014-02-06 15:48 ` carlos at redhat dot com
@ 2014-02-06 18:27 ` jsm28 at gcc dot gnu.org
  2014-02-06 18:29 ` [Bug math/5781] Slow dbl-64 sin/cos/sincos " jsm28 at gcc dot gnu.org
                   ` (11 subsequent siblings)
  19 siblings, 0 replies; 20+ messages in thread
From: jsm28 at gcc dot gnu.org @ 2014-02-06 18:27 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=5781

Joseph Myers <jsm28 at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|Slow sine function for      |Slow sine function for
                   |special values on AMD64 -   |special values
                   |second attempt              |

-- 
You are receiving this mail because:
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 20+ messages in thread

* [Bug math/5781] Slow dbl-64 sin/cos/sincos for special values
       [not found] <bug-5781-131@http.sourceware.org/bugzilla/>
                   ` (7 preceding siblings ...)
  2014-02-06 18:27 ` [Bug math/5781] Slow sine function for special values jsm28 at gcc dot gnu.org
@ 2014-02-06 18:29 ` jsm28 at gcc dot gnu.org
  2014-02-06 18:31 ` jsm28 at gcc dot gnu.org
                   ` (10 subsequent siblings)
  19 siblings, 0 replies; 20+ messages in thread
From: jsm28 at gcc dot gnu.org @ 2014-02-06 18:29 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=5781

Joseph Myers <jsm28 at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|Slow sine function for      |Slow dbl-64 sin/cos/sincos
                   |special values              |for special values

--- Comment #12 from Joseph Myers <jsm28 at gcc dot gnu.org> ---
Really the issue for sin/cos/sincos is the same, so retitling the bug.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 20+ messages in thread

* [Bug math/5781] Slow dbl-64 sin/cos/sincos for special values
       [not found] <bug-5781-131@http.sourceware.org/bugzilla/>
                   ` (8 preceding siblings ...)
  2014-02-06 18:29 ` [Bug math/5781] Slow dbl-64 sin/cos/sincos " jsm28 at gcc dot gnu.org
@ 2014-02-06 18:31 ` jsm28 at gcc dot gnu.org
  2014-02-07  8:22 ` john.wilkinson at spirent dot com
                   ` (9 subsequent siblings)
  19 siblings, 0 replies; 20+ messages in thread
From: jsm28 at gcc dot gnu.org @ 2014-02-06 18:31 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=5781

Joseph Myers <jsm28 at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |octoploid at yandex dot com

--- Comment #13 from Joseph Myers <jsm28 at gcc dot gnu.org> ---
*** Bug 14412 has been marked as a duplicate of this bug. ***

-- 
You are receiving this mail because:
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 20+ messages in thread

* [Bug math/5781] Slow dbl-64 sin/cos/sincos for special values
       [not found] <bug-5781-131@http.sourceware.org/bugzilla/>
                   ` (9 preceding siblings ...)
  2014-02-06 18:31 ` jsm28 at gcc dot gnu.org
@ 2014-02-07  8:22 ` john.wilkinson at spirent dot com
  2014-02-07 14:57 ` carlos at redhat dot com
                   ` (8 subsequent siblings)
  19 siblings, 0 replies; 20+ messages in thread
From: john.wilkinson at spirent dot com @ 2014-02-07  8:22 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=5781

--- Comment #14 from John Wilkinson <john.wilkinson at spirent dot com> ---
(In reply to Carlos O'Donell from comment #11)
> However we are working on enhancing libm to include something like what
> you're looking for. Please have look at and comment:
> https://sourceware.org/glibc/wiki/libm

Thanks that looks useful. Is there a release schedule?

-- 
You are receiving this mail because:
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 20+ messages in thread

* [Bug math/5781] Slow dbl-64 sin/cos/sincos for special values
       [not found] <bug-5781-131@http.sourceware.org/bugzilla/>
                   ` (10 preceding siblings ...)
  2014-02-07  8:22 ` john.wilkinson at spirent dot com
@ 2014-02-07 14:57 ` carlos at redhat dot com
  2014-02-14  9:51 ` grugh at centrum dot cz
                   ` (7 subsequent siblings)
  19 siblings, 0 replies; 20+ messages in thread
From: carlos at redhat dot com @ 2014-02-07 14:57 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=5781

--- Comment #15 from Carlos O'Donell <carlos at redhat dot com> ---
(In reply to John Wilkinson from comment #14)
> (In reply to Carlos O'Donell from comment #11)
> > However we are working on enhancing libm to include something like what
> > you're looking for. Please have look at and comment:
> > https://sourceware.org/glibc/wiki/libm
> 
> Thanks that looks useful. Is there a release schedule?

Not yet. I'll update the wiki when I can commit resources. That doesn't stop
others from joining in the discussion, or adding notes to the wiki like use
cases and requirements.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 20+ messages in thread

* [Bug math/5781] Slow dbl-64 sin/cos/sincos for special values
       [not found] <bug-5781-131@http.sourceware.org/bugzilla/>
                   ` (11 preceding siblings ...)
  2014-02-07 14:57 ` carlos at redhat dot com
@ 2014-02-14  9:51 ` grugh at centrum dot cz
  2014-06-17 18:55 ` fweimer at redhat dot com
                   ` (6 subsequent siblings)
  19 siblings, 0 replies; 20+ messages in thread
From: grugh at centrum dot cz @ 2014-02-14  9:51 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=5781

--- Comment #16 from Petr Cervenka <grugh at centrum dot cz> ---
Simple workaround to use fast computation is to use functions from spec. header
similar to following:

#ifndef FAST_MATH_H
#define    FAST_MATH_H

#include <cmath>

inline double fast_sin(long double x) {
    return sinl(x);
}

inline double fast_cos(long double x) {
    return cosl(x);
}

inline double fast_tan(long double x) {
    return tanl(x);
}

inline double fast_asin(long double x) {
    return asinl(x);
}

inline double fast_acos(long double x) {
    return acosl(x);
}

inline double fast_atan(long double x) {
    return atanl(x);
}

inline double fast_atan2(long double x, long double y) {
    return atan2l(x, y);
}

inline double fast_sinh(long double x) {
    return sinhl(x);
}

inline double fast_cosh(long double x) {
    return coshl(x);
}

inline double fast_asinh(long double x) {
    return asinhl(x);
}

inline double fast_acosh(long double x) {
    return acoshl(x);
}

inline double fast_pow(long double x, long double y) {
    return powl(x, y);
}

inline double fast_sqrt(long double x) {
    return sqrtl(x);
}

inline double fast_exp(long double x) {
    return expl(x);
}

inline double fast_log(long double x) {
    return logl(x);
}

inline double fast_log10(long double x) {
    return log10l(x);
}

#endif    /* FAST_MATH_H */

-- 
You are receiving this mail because:
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 20+ messages in thread

* [Bug math/5781] Slow dbl-64 sin/cos/sincos for special values
       [not found] <bug-5781-131@http.sourceware.org/bugzilla/>
                   ` (12 preceding siblings ...)
  2014-02-14  9:51 ` grugh at centrum dot cz
@ 2014-06-17 18:55 ` fweimer at redhat dot com
  2015-04-16 11:37 ` vincent-srcware at vinc17 dot net
                   ` (5 subsequent siblings)
  19 siblings, 0 replies; 20+ messages in thread
From: fweimer at redhat dot com @ 2014-06-17 18:55 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=5781

Florian Weimer <fweimer at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
              Flags|                            |security-

-- 
You are receiving this mail because:
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 20+ messages in thread

* [Bug math/5781] Slow dbl-64 sin/cos/sincos for special values
       [not found] <bug-5781-131@http.sourceware.org/bugzilla/>
                   ` (13 preceding siblings ...)
  2014-06-17 18:55 ` fweimer at redhat dot com
@ 2015-04-16 11:37 ` vincent-srcware at vinc17 dot net
  2015-04-24 20:36 ` joseph at codesourcery dot com
                   ` (4 subsequent siblings)
  19 siblings, 0 replies; 20+ messages in thread
From: vincent-srcware at vinc17 dot net @ 2015-04-16 11:37 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=5781

Vincent Lefèvre <vincent-srcware at vinc17 dot net> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |vincent-srcware at vinc17 dot net

-- 
You are receiving this mail because:
You are on the CC list for the bug.
>From glibc-bugs-return-28027-listarch-glibc-bugs=sources.redhat.com@sourceware.org Thu Apr 16 11:45:44 2015
Return-Path: <glibc-bugs-return-28027-listarch-glibc-bugs=sources.redhat.com@sourceware.org>
Delivered-To: listarch-glibc-bugs@sources.redhat.com
Received: (qmail 42805 invoked by alias); 16 Apr 2015 11:45:43 -0000
Mailing-List: contact glibc-bugs-help@sourceware.org; run by ezmlm
Precedence: bulk
List-Id: <glibc-bugs.sourceware.org>
List-Subscribe: <mailto:glibc-bugs-subscribe@sourceware.org>
List-Post: <mailto:glibc-bugs@sourceware.org>
List-Help: <mailto:glibc-bugs-help@sourceware.org>, <http://sourceware.org/lists.html#faqs>
Sender: glibc-bugs-owner@sourceware.org
Delivered-To: mailing list glibc-bugs@sourceware.org
Received: (qmail 42726 invoked by uid 48); 16 Apr 2015 11:45:40 -0000
From: "vincent-srcware at vinc17 dot net" <sourceware-bugzilla@sourceware.org>
To: glibc-bugs@sourceware.org
Subject: [Bug math/16526] Missing underflow exception from sincos
Date: Thu, 16 Apr 2015 11:45:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: glibc
X-Bugzilla-Component: math
X-Bugzilla-Version: unspecified
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: vincent-srcware at vinc17 dot net
X-Bugzilla-Status: NEW
X-Bugzilla-Priority: P2
X-Bugzilla-Assigned-To: unassigned at sourceware dot org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Flags: security-
X-Bugzilla-Changed-Fields: cc
Message-ID: <bug-16526-131-qzOH5NQrx9@http.sourceware.org/bugzilla/>
In-Reply-To: <bug-16526-131@http.sourceware.org/bugzilla/>
References: <bug-16526-131@http.sourceware.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Bugzilla-URL: http://sourceware.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2015-04/txt/msg00085.txt.bz2
Content-length: 421

https://sourceware.org/bugzilla/show_bug.cgi?id=16526

Vincent Lefèvre <vincent-srcware at vinc17 dot net> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |vincent-srcware at vinc17 dot net

-- 
You are receiving this mail because:
You are on the CC list for the bug.
>From glibc-bugs-return-28028-listarch-glibc-bugs=sources.redhat.com@sourceware.org Thu Apr 16 13:15:06 2015
Return-Path: <glibc-bugs-return-28028-listarch-glibc-bugs=sources.redhat.com@sourceware.org>
Delivered-To: listarch-glibc-bugs@sources.redhat.com
Received: (qmail 88650 invoked by alias); 16 Apr 2015 13:15:06 -0000
Mailing-List: contact glibc-bugs-help@sourceware.org; run by ezmlm
Precedence: bulk
List-Id: <glibc-bugs.sourceware.org>
List-Subscribe: <mailto:glibc-bugs-subscribe@sourceware.org>
List-Post: <mailto:glibc-bugs@sourceware.org>
List-Help: <mailto:glibc-bugs-help@sourceware.org>, <http://sourceware.org/lists.html#faqs>
Sender: glibc-bugs-owner@sourceware.org
Delivered-To: mailing list glibc-bugs@sourceware.org
Received: (qmail 88537 invoked by uid 48); 16 Apr 2015 13:15:01 -0000
From: "vincent-srcware at vinc17 dot net" <sourceware-bugzilla@sourceware.org>
To: glibc-bugs@sourceware.org
Subject: [Bug math/5781] Slow dbl-64 sin/cos/sincos for special values
Date: Thu, 16 Apr 2015 13:15:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: glibc
X-Bugzilla-Component: math
X-Bugzilla-Version: unspecified
X-Bugzilla-Keywords:
X-Bugzilla-Severity: enhancement
X-Bugzilla-Who: vincent-srcware at vinc17 dot net
X-Bugzilla-Status: ASSIGNED
X-Bugzilla-Priority: P2
X-Bugzilla-Assigned-To: siddhesh at redhat dot com
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Flags: security-
X-Bugzilla-Changed-Fields:
Message-ID: <bug-5781-131-oWjIJknrT0@http.sourceware.org/bugzilla/>
In-Reply-To: <bug-5781-131@http.sourceware.org/bugzilla/>
References: <bug-5781-131@http.sourceware.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Bugzilla-URL: http://sourceware.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2015-04/txt/msg00086.txt.bz2
Content-length: 1941

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.
>From glibc-bugs-return-28029-listarch-glibc-bugs=sources.redhat.com@sourceware.org Thu Apr 16 13:52:46 2015
Return-Path: <glibc-bugs-return-28029-listarch-glibc-bugs=sources.redhat.com@sourceware.org>
Delivered-To: listarch-glibc-bugs@sources.redhat.com
Received: (qmail 41551 invoked by alias); 16 Apr 2015 13:52:46 -0000
Mailing-List: contact glibc-bugs-help@sourceware.org; run by ezmlm
Precedence: bulk
List-Id: <glibc-bugs.sourceware.org>
List-Subscribe: <mailto:glibc-bugs-subscribe@sourceware.org>
List-Post: <mailto:glibc-bugs@sourceware.org>
List-Help: <mailto:glibc-bugs-help@sourceware.org>, <http://sourceware.org/lists.html#faqs>
Sender: glibc-bugs-owner@sourceware.org
Delivered-To: mailing list glibc-bugs@sourceware.org
Received: (qmail 41516 invoked by uid 48); 16 Apr 2015 13:52:43 -0000
From: "vincent-srcware at vinc17 dot net" <sourceware-bugzilla@sourceware.org>
To: glibc-bugs@sourceware.org
Subject: [Bug math/13932] dbl-64 pow unexpectedly slow for some inputs
Date: Thu, 16 Apr 2015 13:52:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: glibc
X-Bugzilla-Component: math
X-Bugzilla-Version: unspecified
X-Bugzilla-Keywords:
X-Bugzilla-Severity: enhancement
X-Bugzilla-Who: vincent-srcware at vinc17 dot net
X-Bugzilla-Status: NEW
X-Bugzilla-Priority: P2
X-Bugzilla-Assigned-To: siddhesh at redhat dot com
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Flags: security-
X-Bugzilla-Changed-Fields: cc
Message-ID: <bug-13932-131-zxLyractuV@http.sourceware.org/bugzilla/>
In-Reply-To: <bug-13932-131@http.sourceware.org/bugzilla/>
References: <bug-13932-131@http.sourceware.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Bugzilla-URL: http://sourceware.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2015-04/txt/msg00087.txt.bz2
Content-length: 421

https://sourceware.org/bugzilla/show_bug.cgi?id=13932

Vincent Lefèvre <vincent-srcware at vinc17 dot net> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |vincent-srcware at vinc17 dot net

-- 
You are receiving this mail because:
You are on the CC list for the bug.
>From glibc-bugs-return-28030-listarch-glibc-bugs=sources.redhat.com@sourceware.org Thu Apr 16 14:00:28 2015
Return-Path: <glibc-bugs-return-28030-listarch-glibc-bugs=sources.redhat.com@sourceware.org>
Delivered-To: listarch-glibc-bugs@sources.redhat.com
Received: (qmail 55211 invoked by alias); 16 Apr 2015 14:00:28 -0000
Mailing-List: contact glibc-bugs-help@sourceware.org; run by ezmlm
Precedence: bulk
List-Id: <glibc-bugs.sourceware.org>
List-Subscribe: <mailto:glibc-bugs-subscribe@sourceware.org>
List-Post: <mailto:glibc-bugs@sourceware.org>
List-Help: <mailto:glibc-bugs-help@sourceware.org>, <http://sourceware.org/lists.html#faqs>
Sender: glibc-bugs-owner@sourceware.org
Delivered-To: mailing list glibc-bugs@sourceware.org
Received: (qmail 55108 invoked by uid 48); 16 Apr 2015 14:00:21 -0000
From: "vincent-srcware at vinc17 dot net" <sourceware-bugzilla@sourceware.org>
To: glibc-bugs@sourceware.org
Subject: [Bug math/13932] dbl-64 pow unexpectedly slow for some inputs
Date: Thu, 16 Apr 2015 14:00:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: glibc
X-Bugzilla-Component: math
X-Bugzilla-Version: unspecified
X-Bugzilla-Keywords:
X-Bugzilla-Severity: enhancement
X-Bugzilla-Who: vincent-srcware at vinc17 dot net
X-Bugzilla-Status: NEW
X-Bugzilla-Priority: P2
X-Bugzilla-Assigned-To: siddhesh at redhat dot com
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Flags: security-
X-Bugzilla-Changed-Fields:
Message-ID: <bug-13932-131-VMNEAYWFTe@http.sourceware.org/bugzilla/>
In-Reply-To: <bug-13932-131@http.sourceware.org/bugzilla/>
References: <bug-13932-131@http.sourceware.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Bugzilla-URL: http://sourceware.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2015-04/txt/msg00088.txt.bz2
Content-length: 995

https://sourceware.org/bugzilla/show_bug.cgi?id=13932

--- Comment #10 from Vincent Lefèvre <vincent-srcware at vinc17 dot net> ---
(In reply to Paul Pluzhnikov from comment #2)
> # x86_64:
> ./elf/ld.so --library-path .:math:dlfcn /tmp/test_pow64
> pow(0.562500, 1.5): 0.000990 calls/usec
> pow(0.563250, 1.5): 12.753271 calls/usec
> ratio:  12887

Note that mathematically x^1.5 = sqrt(x)^3.

Now, 0.562500 is a perfect square:

? sqrt(0.562500)
%1 = 0.75000000000000000000000000000000000000

This is probably related to the slowness. Unless the implementation tries to
provide the correct inexact flag (which I doubt), I don't see a theoretical
reason for which it would be slow in rounding to nearest. It would be very
different in a directed rounding mode since this is an exact case. Still, this
could be a corner case for an algorithm that doesn't expect exact results or
something like that.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
>From glibc-bugs-return-28032-listarch-glibc-bugs=sources.redhat.com@sourceware.org Thu Apr 16 19:33:55 2015
Return-Path: <glibc-bugs-return-28032-listarch-glibc-bugs=sources.redhat.com@sourceware.org>
Delivered-To: listarch-glibc-bugs@sources.redhat.com
Received: (qmail 12223 invoked by alias); 16 Apr 2015 19:33:55 -0000
Mailing-List: contact glibc-bugs-help@sourceware.org; run by ezmlm
Precedence: bulk
List-Id: <glibc-bugs.sourceware.org>
List-Subscribe: <mailto:glibc-bugs-subscribe@sourceware.org>
List-Post: <mailto:glibc-bugs@sourceware.org>
List-Help: <mailto:glibc-bugs-help@sourceware.org>, <http://sourceware.org/lists.html#faqs>
Sender: glibc-bugs-owner@sourceware.org
Delivered-To: mailing list glibc-bugs@sourceware.org
Received: (qmail 12172 invoked by uid 48); 16 Apr 2015 19:33:52 -0000
From: "daniel at iogearbox dot net" <sourceware-bugzilla@sourceware.org>
To: glibc-bugs@sourceware.org
Subject: [Bug libc/18271] Expose new bpf(2) system call
Date: Thu, 16 Apr 2015 19:33:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: glibc
X-Bugzilla-Component: libc
X-Bugzilla-Version: unspecified
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: daniel at iogearbox dot net
X-Bugzilla-Status: NEW
X-Bugzilla-Priority: P2
X-Bugzilla-Assigned-To: unassigned at sourceware dot org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields: cc
Message-ID: <bug-18271-131-nq1rruwd0w@http.sourceware.org/bugzilla/>
In-Reply-To: <bug-18271-131@http.sourceware.org/bugzilla/>
References: <bug-18271-131@http.sourceware.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 7bit
X-Bugzilla-URL: http://sourceware.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2015-04/txt/msg00090.txt.bz2
Content-length: 399

https://sourceware.org/bugzilla/show_bug.cgi?id\x18271

Daniel Borkmann <daniel at iogearbox dot net> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |daniel at iogearbox dot net

--
You are receiving this mail because:
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 20+ messages in thread

* [Bug math/5781] Slow dbl-64 sin/cos/sincos for special values
       [not found] <bug-5781-131@http.sourceware.org/bugzilla/>
                   ` (14 preceding siblings ...)
  2015-04-16 11:37 ` vincent-srcware at vinc17 dot net
@ 2015-04-24 20:36 ` joseph at codesourcery dot com
  2021-03-11 14:44 ` wdijkstr at arm dot com
                   ` (3 subsequent siblings)
  19 siblings, 0 replies; 20+ messages in thread
From: joseph at codesourcery dot com @ 2015-04-24 20:36 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=5781

--- Comment #18 from joseph at codesourcery dot com <joseph at codesourcery dot com> ---
As I outlined in 
<https://sourceware.org/ml/libc-alpha/2013-07/msg00444.html>, and as 
described in the discussion of accuracy goals in the glibc manual, I don't 
think functions such as sin and cos should try to be correctly rounded, 
only functions such as crsin and crcos (if added).

-- 
You are receiving this mail because:
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 20+ messages in thread

* [Bug math/5781] Slow dbl-64 sin/cos/sincos for special values
       [not found] <bug-5781-131@http.sourceware.org/bugzilla/>
                   ` (15 preceding siblings ...)
  2015-04-24 20:36 ` joseph at codesourcery dot com
@ 2021-03-11 14:44 ` wdijkstr at arm dot com
  2021-03-11 21:12 ` joseph at codesourcery dot com
                   ` (2 subsequent siblings)
  19 siblings, 0 replies; 20+ messages in thread
From: wdijkstr at arm dot com @ 2021-03-11 14:44 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=5781

Wilco <wdijkstr at arm dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |wdijkstr at arm dot com

--- Comment #19 from Wilco <wdijkstr at arm dot com> ---
This was fixed by a series of commits starting from
19a8b9a300f2f1f0012aff0f2b70b09430f50d9e

All slow paths have now been removed from all math functions.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 20+ messages in thread

* [Bug math/5781] Slow dbl-64 sin/cos/sincos for special values
       [not found] <bug-5781-131@http.sourceware.org/bugzilla/>
                   ` (16 preceding siblings ...)
  2021-03-11 14:44 ` wdijkstr at arm dot com
@ 2021-03-11 21:12 ` joseph at codesourcery dot com
  2021-03-12  4:54 ` siddhesh at sourceware dot org
  2021-03-15  3:00 ` siddhesh at sourceware dot org
  19 siblings, 0 replies; 20+ messages in thread
From: joseph at codesourcery dot com @ 2021-03-11 21:12 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=5781

--- Comment #20 from joseph at codesourcery dot com <joseph at codesourcery dot com> ---
If you log in to Bugzilla with your @gcc.gnu.org address you should have 
access to mark bugs RESOLVED / FIXED with target milestone set to the 
first release that will have the fix, rather than just commenting that 
they are fixed.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 20+ messages in thread

* [Bug math/5781] Slow dbl-64 sin/cos/sincos for special values
       [not found] <bug-5781-131@http.sourceware.org/bugzilla/>
                   ` (17 preceding siblings ...)
  2021-03-11 21:12 ` joseph at codesourcery dot com
@ 2021-03-12  4:54 ` siddhesh at sourceware dot org
  2021-03-15  3:00 ` siddhesh at sourceware dot org
  19 siblings, 0 replies; 20+ messages in thread
From: siddhesh at sourceware dot org @ 2021-03-12  4:54 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=5781

Siddhesh Poyarekar <siddhesh at sourceware dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |FIXED
             Status|ASSIGNED                    |RESOLVED
   Target Milestone|---                         |2.33

--- Comment #21 from Siddhesh Poyarekar <siddhesh at sourceware dot org> ---
The last commit to remove slow paths appears to be this one:

commit f67f9c9af228f6b84579cb8c86312d3a7a206a55
Author: Anssi Hannula <anssi.hannula@bitwise.fi>
Date:   Mon Jan 27 12:45:10 2020 +0200

    ieee754: Remove slow paths from asin and acos

So this was finished in 2.33.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 20+ messages in thread

* [Bug math/5781] Slow dbl-64 sin/cos/sincos for special values
       [not found] <bug-5781-131@http.sourceware.org/bugzilla/>
                   ` (18 preceding siblings ...)
  2021-03-12  4:54 ` siddhesh at sourceware dot org
@ 2021-03-15  3:00 ` siddhesh at sourceware dot org
  19 siblings, 0 replies; 20+ messages in thread
From: siddhesh at sourceware dot org @ 2021-03-15  3:00 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=5781

Siddhesh Poyarekar <siddhesh at sourceware dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|2.33                        |2.34

--- Comment #22 from Siddhesh Poyarekar <siddhesh at sourceware dot org> ---
I just noticed that the last slow path removal patches went in with Wilco's
comment 19.  Adjusting target milestone.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 20+ messages in thread

end of thread, other threads:[~2021-03-15  3:00 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-5781-131@http.sourceware.org/bugzilla/>
2012-02-29 20:20 ` [Bug math/5781] Slow sine function for special values on AMD64 - second attempt jsm28 at gcc dot gnu.org
2013-04-01 12:54 ` siddhesh at redhat dot com
2013-04-10  4:25 ` siddhesh at redhat dot com
2013-12-03 18:40 ` jsm28 at gcc dot gnu.org
2014-02-05 21:07 ` john.wilkinson at spirent dot com
2014-02-06  7:40 ` john.wilkinson at spirent dot com
2014-02-06 15:48 ` carlos at redhat dot com
2014-02-06 18:27 ` [Bug math/5781] Slow sine function for special values jsm28 at gcc dot gnu.org
2014-02-06 18:29 ` [Bug math/5781] Slow dbl-64 sin/cos/sincos " jsm28 at gcc dot gnu.org
2014-02-06 18:31 ` jsm28 at gcc dot gnu.org
2014-02-07  8:22 ` john.wilkinson at spirent dot com
2014-02-07 14:57 ` carlos at redhat dot com
2014-02-14  9:51 ` grugh at centrum dot cz
2014-06-17 18:55 ` fweimer at redhat dot com
2015-04-16 11:37 ` vincent-srcware at vinc17 dot net
2015-04-24 20:36 ` joseph at codesourcery dot com
2021-03-11 14:44 ` wdijkstr at arm dot com
2021-03-11 21:12 ` joseph at codesourcery dot com
2021-03-12  4:54 ` siddhesh at sourceware dot org
2021-03-15  3:00 ` siddhesh at sourceware dot org

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 read-only IMAP folder(s) and NNTP newsgroup(s).