mirror of
https://sourceware.org/git/glibc.git
synced 2024-11-10 07:10:06 +00:00
bf27d3973d
without wrapper on aarch64: logf reciprocal-throughput: 2.2x faster logf latency: 1.9x faster old worst case error: 0.89 ulp new worst case error: 0.82 ulp aarch64 .text size: -356 bytes aarch64 .rodata size: +240 bytes Uses double precision arithmetics and a lookup table to allow smaller polynomial and avoid the use of division. Data is in a separate translation unit with fixed layout to prevent the compiler generating suboptimal literal access. Errors are handled inline according to POSIX rules, but this patch keeps the wrapper with SVID compatible error handling. Needs libm-test-ulps adjustment for clogf in non-nearest rounding mode. * math/Makefile (type-float-routines): Add e_logf_data. * sysdeps/ieee754/flt-32/e_logf.c: New implementation. * sysdeps/ieee754/flt-32/e_logf_data.c: New file. * sysdeps/ieee754/flt-32/math_config.h (__logf_data): Define. (LOGF_TABLE_BITS, LOGF_POLY_ORDER): Define. * sysdeps/i386/fpu/e_logf_data.c: New file. * sysdeps/ia64/fpu/e_logf_data.c: New file. * sysdeps/m68k/m680x0/fpu/e_logf_data.c: New file.
45 lines
1.7 KiB
C
45 lines
1.7 KiB
C
/* Data definition for logf.
|
|
Copyright (C) 2017 Free Software Foundation, Inc.
|
|
This file is part of the GNU C Library.
|
|
|
|
The GNU C Library is free software; you can redistribute it and/or
|
|
modify it under the terms of the GNU Lesser General Public
|
|
License as published by the Free Software Foundation; either
|
|
version 2.1 of the License, or (at your option) any later version.
|
|
|
|
The GNU C Library is distributed in the hope that it will be useful,
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
Lesser General Public License for more details.
|
|
|
|
You should have received a copy of the GNU Lesser General Public
|
|
License along with the GNU C Library; if not, see
|
|
<http://www.gnu.org/licenses/>. */
|
|
|
|
#include "math_config.h"
|
|
|
|
const struct logf_data __logf_data = {
|
|
.tab = {
|
|
{ 0x1.661ec79f8f3bep+0, -0x1.57bf7808caadep-2 },
|
|
{ 0x1.571ed4aaf883dp+0, -0x1.2bef0a7c06ddbp-2 },
|
|
{ 0x1.49539f0f010bp+0, -0x1.01eae7f513a67p-2 },
|
|
{ 0x1.3c995b0b80385p+0, -0x1.b31d8a68224e9p-3 },
|
|
{ 0x1.30d190c8864a5p+0, -0x1.6574f0ac07758p-3 },
|
|
{ 0x1.25e227b0b8eap+0, -0x1.1aa2bc79c81p-3 },
|
|
{ 0x1.1bb4a4a1a343fp+0, -0x1.a4e76ce8c0e5ep-4 },
|
|
{ 0x1.12358f08ae5bap+0, -0x1.1973c5a611cccp-4 },
|
|
{ 0x1.0953f419900a7p+0, -0x1.252f438e10c1ep-5 },
|
|
{ 0x1p+0, 0x0p+0 },
|
|
{ 0x1.e608cfd9a47acp-1, 0x1.aa5aa5df25984p-5 },
|
|
{ 0x1.ca4b31f026aap-1, 0x1.c5e53aa362eb4p-4 },
|
|
{ 0x1.b2036576afce6p-1, 0x1.526e57720db08p-3 },
|
|
{ 0x1.9c2d163a1aa2dp-1, 0x1.bc2860d22477p-3 },
|
|
{ 0x1.886e6037841edp-1, 0x1.1058bc8a07ee1p-2 },
|
|
{ 0x1.767dcf5534862p-1, 0x1.4043057b6ee09p-2 },
|
|
},
|
|
.ln2 = 0x1.62e42fefa39efp-1,
|
|
.poly = {
|
|
-0x1.00ea348b88334p-2, 0x1.5575b0be00b6ap-2, -0x1.ffffef20a4123p-2,
|
|
}
|
|
};
|