pow.3: Add note on performance characteristics of pow

Message ID CAESRpQB5K9U1sBreXUrNa4tPB69cwxC+fdu1bUr5BkU-dtxJMQ@mail.gmail.com
State Not applicable
Headers

Commit Message

Manuel López-Ibáñez Oct. 17, 2014, 1:51 p.m. UTC
  On 17 October 2014 09:58, Siddhesh Poyarekar <siddhesh@redhat.com> wrote:
>> > +inputs. The inputs that produce such behavior are different for
>> > +.BR powf (),
>> > +.BR pow ()
>> > +and
>> > +.BR powl ().
>> > +
>
> The slow fallback is only taken for pow, not powf or powl.

Updated patch inline:

 .\" http://sources.redhat.com/bugzilla/show_bug.cgi?id=6776

and attached in case gmail messes it up.

Cheers,

Manuel.
diff --git a/man3/pow.3 b/man3/pow.3
index d0a2ea8..1b05292 100644
--- a/man3/pow.3
+++ b/man3/pow.3
@@ -320,6 +320,18 @@ The variant returning
 also conforms to
 SVr4, 4.3BSD, C89.
 .SH BUGS
+On 64-bits,
+.\"
+.\" https://sourceware.org/bugzilla/show_bug.cgi?id=13932
+.BR pow ()
+may be more than 10,000 times slower for some (rare) inputs than for other nearby
+inputs.  This only affects 
+.BR pow (),
+and not 
+.BR powf ()
+nor
+.BR powl ().
+
 In glibc 2.9 and earlier,
 .\"
 .\" http://sources.redhat.com/bugzilla/show_bug.cgi?id=6776
  

Comments

Manuel López-Ibáñez Oct. 30, 2014, 11:30 p.m. UTC | #1
I think this hasn't been committed yet:

https://sourceware.org/ml/libc-alpha/2014-10/msg00389.html

Cheers,

Manuel.
  
Michael Kerrisk \(man-pages\) Nov. 11, 2014, 12:58 p.m. UTC | #2
Hello Manuel,

On 10/17/2014 03:51 PM, Manuel López-Ibáñez wrote:
> On 17 October 2014 09:58, Siddhesh Poyarekar <siddhesh@redhat.com> wrote:
>>>> +inputs. The inputs that produce such behavior are different for
>>>> +.BR powf (),
>>>> +.BR pow ()
>>>> +and
>>>> +.BR powl ().
>>>> +
>>
>> The slow fallback is only taken for pow, not powf or powl.
> 
> Updated patch inline:
> 
> diff --git a/man3/pow.3 b/man3/pow.3
> index d0a2ea8..1b05292 100644
> --- a/man3/pow.3
> +++ b/man3/pow.3
> @@ -320,6 +320,18 @@ The variant returning
>  also conforms to
>  SVr4, 4.3BSD, C89.
>  .SH BUGS
> +On 64-bits,
> +.\"
> +.\" https://sourceware.org/bugzilla/show_bug.cgi?id=13932
> +.BR pow ()
> +may be more than 10,000 times slower for some (rare) inputs than for
> other nearby
> +inputs.  This only affects
> +.BR pow (),
> +and not
> +.BR powf ()
> +nor
> +.BR powl ().
> +
>  In glibc 2.9 and earlier,
>  .\"
>  .\" http://sources.redhat.com/bugzilla/show_bug.cgi?id=6776
> 
> and attached in case gmail messes it up.

Thanks for revising the patch. I've applied it.

Cheers,

Michael
  

Patch

diff --git a/man3/pow.3 b/man3/pow.3
index d0a2ea8..1b05292 100644
--- a/man3/pow.3
+++ b/man3/pow.3
@@ -320,6 +320,18 @@  The variant returning
 also conforms to
 SVr4, 4.3BSD, C89.
 .SH BUGS
+On 64-bits,
+.\"
+.\" https://sourceware.org/bugzilla/show_bug.cgi?id=13932
+.BR pow ()
+may be more than 10,000 times slower for some (rare) inputs than for
other nearby
+inputs.  This only affects
+.BR pow (),
+and not
+.BR powf ()
+nor
+.BR powl ().
+
 In glibc 2.9 and earlier,
 .\"