This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH v3 4/9] Add new pow implementation
- From: Joseph Myers <joseph at codesourcery dot com>
- To: Szabolcs Nagy <szabolcs dot nagy at arm dot com>
- Cc: GNU C Library <libc-alpha at sourceware dot org>, <nd at arm dot com>
- Date: Mon, 2 Jul 2018 21:58:43 +0000
- Subject: Re: [PATCH v3 4/9] Add new pow implementation
- References: <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