]> git.ipfire.org Git - thirdparty/glibc.git/commit
Implement C23 rootn.
authorJoseph Myers <josmyers@redhat.com>
Wed, 14 May 2025 10:51:46 +0000 (10:51 +0000)
committerJoseph Myers <josmyers@redhat.com>
Wed, 14 May 2025 10:51:46 +0000 (10:51 +0000)
commit06caf53adfae0c93062edd62f83eed16ab5cec0b
tree75282662b640f39f04d13b7ba79eb3e9fb79e5ea
parent36189c76fb9c0b281de23381ae5a462a7e102ee6
Implement C23 rootn.

C23 adds various <math.h> function families originally defined in TS
18661-4.  Add the rootn functions, which compute the Yth root of X for
integer Y (with a domain error if Y is 0, even if X is a NaN).  The
integer exponent has type long long int in C23; it was intmax_t in TS
18661-4, and as with other interfaces changed after their initial
appearance in the TS, I don't think we need to support the original
version of the interface.

As with pown and compoundn, I strongly encourage searching for worst
cases for ulps error for these implementations (necessarily
non-exhaustively, given the size of the input space).  I also expect a
custom implementation for a given format could be much faster as well
as more accurate, although the implementation is simpler than those
for pown and compoundn.

This completes adding to glibc those TS 18661-4 functions (ignoring
DFP) that are included in C23.  See
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118592 regarding the C23
mathematical functions (not just the TS 18661-4 ones) missing built-in
functions in GCC, where such functions might usefully be added.

Tested for x86_64 and x86, and with build-many-glibcs.py.
48 files changed:
NEWS
manual/math.texi
math/Makefile
math/Versions
math/auto-libm-test-in
math/auto-libm-test-out-rootn [new file with mode: 0644]
math/bits/mathcalls.h
math/gen-auto-libm-tests.c
math/gen-tgmath-tests.py
math/libm-test-rootn.inc [new file with mode: 0644]
math/s_rootn_template.c [new file with mode: 0644]
math/test-tgmath.c
math/tgmath.h
sysdeps/ieee754/ldbl-128ibm-compat/Versions
sysdeps/ieee754/ldbl-opt/Makefile
sysdeps/ieee754/ldbl-opt/nldbl-rootn.c [new file with mode: 0644]
sysdeps/mach/hurd/i386/libm.abilist
sysdeps/mach/hurd/x86_64/libm.abilist
sysdeps/unix/sysv/linux/aarch64/libm.abilist
sysdeps/unix/sysv/linux/alpha/libm.abilist
sysdeps/unix/sysv/linux/arc/libm.abilist
sysdeps/unix/sysv/linux/arm/be/libm.abilist
sysdeps/unix/sysv/linux/arm/le/libm.abilist
sysdeps/unix/sysv/linux/csky/libm.abilist
sysdeps/unix/sysv/linux/hppa/libm.abilist
sysdeps/unix/sysv/linux/i386/libm.abilist
sysdeps/unix/sysv/linux/loongarch/lp64/libm.abilist
sysdeps/unix/sysv/linux/m68k/coldfire/libm.abilist
sysdeps/unix/sysv/linux/m68k/m680x0/libm.abilist
sysdeps/unix/sysv/linux/microblaze/be/libm.abilist
sysdeps/unix/sysv/linux/microblaze/le/libm.abilist
sysdeps/unix/sysv/linux/mips/mips32/libm.abilist
sysdeps/unix/sysv/linux/mips/mips64/libm.abilist
sysdeps/unix/sysv/linux/or1k/libm.abilist
sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libm.abilist
sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libm.abilist
sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libm.abilist
sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libm.abilist
sysdeps/unix/sysv/linux/riscv/rv32/libm.abilist
sysdeps/unix/sysv/linux/riscv/rv64/libm.abilist
sysdeps/unix/sysv/linux/s390/s390-32/libm.abilist
sysdeps/unix/sysv/linux/s390/s390-64/libm.abilist
sysdeps/unix/sysv/linux/sh/be/libm.abilist
sysdeps/unix/sysv/linux/sh/le/libm.abilist
sysdeps/unix/sysv/linux/sparc/sparc32/libm.abilist
sysdeps/unix/sysv/linux/sparc/sparc64/libm.abilist
sysdeps/unix/sysv/linux/x86_64/64/libm.abilist
sysdeps/unix/sysv/linux/x86_64/x32/libm.abilist