From: Joseph Myers <joseph@codesourcery.com>
To: Szabolcs Nagy <szabolcs.nagy@arm.com>
Cc: GNU C Library <libc-alpha@sourceware.org>, <nd@arm.com>
Subject: Re: [PATCH v3 4/9] Add new pow implementation
Date: Mon, 02 Jul 2018 21:58:00 -0000 [thread overview]
Message-ID: <alpine.DEB.2.20.1807022155190.3430@digraph.polyomino.org.uk> (raw)
In-Reply-To: <f75d0424-8d93-0daf-3198-87b117d45f16@arm.com>
On Fri, 29 Jun 2018, Szabolcs Nagy wrote:
> +#if POW_LOG_POLY_ORDER == 8
> + p = ar3
> + * (A[1] + r * A[2] + ar2 * (A[3] + r * A[4] + ar2 * (A[5] + r * A[6])));
Should have parentheses here around the RHS of the assignment to ensure
the indentation is preserved (see the GNU Coding Standards).
> +/* Handle inputs that may overflow or underflow when computing the result
> + that is scale*(1+tmp), the exponent bits of scale might have overflown
> + into the sign bit so that needs correction before sbits is used as a
> + double, ki is only used to determine the sign of the exponent. */
> +static inline double
> +specialcase (double_t tmp, uint64_t sbits, uint64_t ki)
Same comment applies as for exp about properly defining the semantics of
the function arguments and results.
> + /* Without fma the worst case error is 0.25/N ulp larger. */
> + /* Worst case error is less than 0.5+1.11/N+(abs poly error * 2^53) ulp. */
> +#if EXP_POLY_ORDER == 4
> + tmp = tail + r + r2 * C2 + r * r2 * (C3 + r * C4);
> +#elif EXP_POLY_ORDER == 5
> + tmp = tail + r + r2 * (C2 + r * C3) + r2 * r2 * (C4 + r * C5);
> +#elif EXP_POLY_ORDER == 6
> + tmp = tail + r + r2 * (0.5 + r * C3) + r2 * r2 * (C4 + r * C5 + r2 * C6);
Same comment as before about not having such variants without a clear
explanation of why different architectures should use different choices.
--
Joseph S. Myers
joseph@codesourcery.com
prev parent reply other threads:[~2018-07-02 21:58 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-06-29 12:51 Szabolcs Nagy
2018-07-02 21:58 ` Joseph Myers [this message]
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=alpine.DEB.2.20.1807022155190.3430@digraph.polyomino.org.uk \
--to=joseph@codesourcery.com \
--cc=libc-alpha@sourceware.org \
--cc=nd@arm.com \
--cc=szabolcs.nagy@arm.com \
/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 read-only IMAP folder(s) and NNTP newsgroup(s).