From: Adhemerval Zanella Netto <adhemerval.zanella@linaro.org>
To: Morten Welinder <mwelinder@gmail.com>,
Alejandro Colomar <alx@kernel.org>
Cc: linux-man@vger.kernel.org, libc-alpha@sourceware.org,
jsm-csl@polyomino.org.uk, newbie-02@gmx.de
Subject: Re: Man page issues: logb, significand, cbrt, log2, log10, exp10
Date: Mon, 4 Mar 2024 09:17:16 -0300 [thread overview]
Message-ID: <354cee2d-6581-4f10-9c08-92c625a97b70@linaro.org> (raw)
In-Reply-To: <CANv4PNm0xvB-GVb+z1yXPRVfeZYHU9533+VRTQfysjaycSbHBw@mail.gmail.com>
On 02/03/24 23:02, Morten Welinder wrote:
> Thanks.
>
> There is (was?) already crlibm out there.
> https://core-math.gitlabpages.inria.fr/ No particular need for wheel
> reinvention here.
>
> FWIW, it appears that the author of the glibc exp10 implementation
> agrees with me that the implementation is sub-standard:
>
> https://codebrowser.dev/glibc/glibc/math/e_exp10.c.html
This code was not used by any port and we recently removed to avoid this
very issue [1]. The exp10 implementation used by all ports
is at sysdeps/ieee754/dbl-64/e_exp10.c (i386/m68k are exceptions and my
plan to eventually remove this implementation in favor the generic
one [2]).
And the exp10 implementation was recently improved [3], with the
author suggesting the worst-case error in round-to- should be
nearest to 0.513 ULP (I am not sure if he did some empirical testing
to verify this value, at least with libm-test-ulps the resuts are
bounded to 2 ulp max).
>
> /* This is a very stupid and inprecise implementation. It'll get
> replaced sometime (soon?). */
> return __ieee754_exp (M_LN10 * arg);
>
>
> Compare with musl:
>
> https://github.com/rofl0r/musl/blob/master/src/math/exp10.c
>
[1] https://sourceware.org/git/?p=glibc.git;a=commit;h=9c61303ebbdc6e727c89591bff3229c9fbfa438b
[2] https://sourceware.org/pipermail/libc-alpha/2024-January/154107.html
[3] https://sourceware.org/git/?p=glibc.git;a=commit;h=63d0a35d5f223a3f4b68190567b7d4d44545bce5
next prev parent reply other threads:[~2024-03-04 12:17 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-03-01 0:28 Man page issues: logb, significand, cbrt, log2, log10, exp10 Morten Welinder
2024-03-01 0:53 ` Alejandro Colomar
2024-03-02 21:17 ` Morten Welinder
2024-03-02 21:54 ` Alejandro Colomar
2024-03-03 2:02 ` Morten Welinder
2024-03-03 2:21 ` Alejandro Colomar
2024-03-03 11:46 ` Vincent Lefevre
2024-03-03 12:21 ` Alejandro Colomar
2024-03-03 22:26 ` Morten Welinder
2024-03-04 12:17 ` Adhemerval Zanella Netto [this message]
2024-03-04 17:52 ` logb() vs floor(log2()) (was: Man page issues: logb, significand, cbrt, log2, log10, exp10) Alejandro Colomar
2024-03-04 18:47 ` logb() vs floor(log2()) Adhemerval Zanella Netto
2024-03-04 22:16 ` Alejandro Colomar
2024-03-04 23:23 ` logb() vs floor(log2()) (was: Man page issues: logb, significand, cbrt, log2, log10, exp10) Alejandro Colomar
2024-03-05 0:46 ` Man page issues: logb, significand, cbrt, log2, log10, exp10 Alejandro Colomar
2024-03-05 1:05 ` Alejandro Colomar
2024-03-05 1:18 ` Alejandro Colomar
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=354cee2d-6581-4f10-9c08-92c625a97b70@linaro.org \
--to=adhemerval.zanella@linaro.org \
--cc=alx@kernel.org \
--cc=jsm-csl@polyomino.org.uk \
--cc=libc-alpha@sourceware.org \
--cc=linux-man@vger.kernel.org \
--cc=mwelinder@gmail.com \
--cc=newbie-02@gmx.de \
/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 NNTP newsgroup(s).