public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Joseph Myers <josmyers@redhat.com>
To: Vincent Lefevre <vincent@vinc17.net>
Cc: libc-alpha@sourceware.org
Subject: Re: document the fact that "Known Maximum Errors" might not be maximal
Date: Fri, 16 Feb 2024 17:22:22 +0000 (UTC)	[thread overview]
Message-ID: <f06586e8-6485-af16-6ed5-d31ede915365@redhat.com> (raw)
In-Reply-To: <20240216094334.GA3653@qaa.vinc17.org>

On Fri, 16 Feb 2024, Vincent Lefevre wrote:

> BTW, the manual contains
> 
> fmaf	-	-	-	-	-
> fma	-	-	-	-	-
> fmal	-	-	-	-	-
> fmaf128	-	-	-	-	-
> fma_ldoublef	-	-	-	-	-
> fma_ldouble	-	-	-	-	-
> fma_ldoublel	-	-	-	-	-
> fma_ldoublef128	-	-	-	-	-
> 
> However, correct rounding is required for these functions.

IBM long double doesn't have such a thing as correct rounding, so we allow 
errors of up to 3ulp (the documented accuracy for IBM long double 
division) for functions expected to be correctly rounded for otehr 
formats.

> And I can't see any reference to f128, ldoublef, etc. in the manual
> except in this table.

See

@deftypefunx _FloatN fmafN (_Float@var{N} @var{x}, _Float@var{N} @var{y}, _Float@var{N} @var{z})
@deftypefunx _FloatNx fmafNx (_Float@var{N}x @var{x}, _Float@var{N}x @var{y}, _Float@var{N}x @var{z})

in the manual for fmaf128 (which should always be correctly rounded, since 
_Float128 is always IEEE binary128).

The "_ldouble" suffix is how libm-test-ulps indicates the argument type 
for narrowing functions that are parametrized by two types (that is, it's 
an implementation detail that ideally wouldn't appear in the manual at 
all).  IBM long double arguments (thus, float or double returns - 
functions {f,d}{add,sub,mul,div,sqrt,fma}l) is the only case where the 
narrowing functions should ever have results that are not correctly 
rounded.

-- 
Joseph S. Myers
josmyers@redhat.com


      parent reply	other threads:[~2024-02-16 17:22 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-16  8:48 Paul Zimmermann
2024-02-16  9:43 ` Vincent Lefevre
2024-02-16 10:02   ` Paul Zimmermann
2024-02-16 10:22     ` Vincent Lefevre
2024-02-16 10:54       ` Paul Zimmermann
2024-02-16 12:39         ` Vincent Lefevre
2024-02-16 17:32           ` Joseph Myers
2024-02-16 17:22   ` 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=f06586e8-6485-af16-6ed5-d31ede915365@redhat.com \
    --to=josmyers@redhat.com \
    --cc=libc-alpha@sourceware.org \
    --cc=vincent@vinc17.net \
    /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).