musl - an implementation of the standard library for Linux-based systems
Go to file
Szabolcs Nagy 71d23b3103 math: extensive log*.c cleanup
The log, log2 and log10 functions share a lot of code and to a lesser
extent log1p too. A small part of the code was kept separately in
__log1p.h, but since it did not capture much of the common code and
it was inlined anyway, it did not solve the issue properly. Now the
log functions have significant code duplication, which may be resolved
later, until then they need to be modified together.

logl, log10l, log2l, log1pl:
* Fix the sign when the return value should be -inf.
* Remove the volatile hack from log10l (seems unnecessary)

log1p, log1pf:
* Change the handling of small inputs: only |x|<2^-53 is special
  (then it is enough to return x with the usual subnormal handling)
  this fixes the sign of log1p(0) in downward rounding.
* Do not handle the k==0 case specially (other than skipping the
  elaborate argument reduction)
* Do not handle 1+x close to power-of-two specially (this code was
  used rarely, did not give much speed up and the precision wasn't
  better than the general)
* Fix the correction term formula (c=1-(u-x) was used incorrectly
  when x<1 but (double)(x+1)==2, this was not a critical issue)
* Use the exact same method for calculating log(1+f) as in log
  (except in log1p the c correction term is added to the result).

log, logf, log10, log10f, log2, log2f:
* Use double_t and float_t consistently.
* Now the first part of log10 and log2 is identical to log (until the
  return statement, hopefully this makes maintainence easier).
* Most special case formulas were removed (close to power-of-two and
  k==0 cases), they increase the code size without providing precision
  or performance benefits (and obfuscate the code).
  Only x==1 is handled specially so in downward rounding mode the
  sign of zero is correct (the general formula happens to give -0).
* For x==0 instead of -1/0.0 or -two54/0.0, return -1/(x*x) to force
  raising the exception at runtime.
* Arg reduction code is changed (slightly simplified)
* The thresholds for arg reduction to [sqrt(2)/2,sqrt(2)] are now
  consistently the [0x3fe6a09e00000000,0x3ff6a09dffffffff] and the
  [0x3f3504f3,0x3fb504f2] intervals for double and float reductions
  respectively (the exact threshold values are not critical)
* Remove the obsolete comment for the FLT_EVAL_METHOD!=0 case in log2f
  (The same code is used for all eval methods now, on i386 slightly
  simpler code could be used, but we have asm there anyway)

all:
* Fix signed int arithmetics (using unsigned for bitmanipulation)
* Fix various comments
2013-10-28 01:16:14 +00:00
arch add missing i386 syscall numbers 2013-09-26 14:17:36 -04:00
crt add function types to arm crt assembly 2013-08-15 14:52:27 -04:00
dist add another example option to dist/config.mak 2012-04-24 16:49:11 -04:00
include add legacy ftime function and sys/timeb.h 2013-10-25 14:15:08 -04:00
lib
src math: extensive log*.c cleanup 2013-10-28 01:16:14 +00:00
tools replace system's install command with a shell script 2013-08-17 22:21:11 -04:00
.gitignore
configure remove -Wcast-align from --enable-warnings 2013-08-28 05:08:16 -04:00
COPYRIGHT add arm-optimized memcpy implementation from bionic libc 2013-08-14 03:06:21 -04:00
INSTALL fix some documentation typos 2013-08-22 22:40:30 -04:00
Makefile fix regression in creation of ldso symlink 2013-08-31 11:36:56 -04:00
README update documentation 2012-10-26 20:14:19 -04:00
WHATSNEW release notes for 0.9.14 2013-09-23 17:00:53 -04:00

musl libc - a new standard library to power a new generation of
Linux-based devices. musl is lightweight, fast, simple, free, and
strives to be correct in the sense of standards-conformance and
safety.

musl is an alternative to glibc, eglibc, uClibc, dietlibc, and klibc.
For reasons why one might prefer musl, please see the FAQ and libc
comparison chart on the project website,

    http://www.musl-libc.org/

For installation instructions, see the INSTALL file.

Please refer to the COPYRIGHT file for details on the copyright and
license status of code included in musl (standard MIT license).



Greetings!

The 0.9.x release series for musl features interface coverage for all
interfaces defined in ISO C99 and POSIX 2008 base, along with a number
of non-standardized interfaces for compatibility with Linux, BSD, and
glibc functionality. As the release series progresses, we are
gradually adding support for incomplete functionality in existing
interfaces, additional functions that are deemed to be important due
to their use in real-world software, and support for new library and
language features in C11 such as thread-local storage, which is now
supported on all targets. In addition, support for additional target
cpu architectures is being added.

The number of packages build successfully against musl - either
out-of-the-box or with minor patches to address portability errors -
has exceeded 5000 and is steadily growing. In addition to application
compatibility testing, unit testing has been conducted using three
separate test frameworks and numerous additional standalone test cases
to verify the correctness of the implementation.

Included with this package is a gcc wrapper script (musl-gcc) which
allows you to build musl-linked programs using an existing gcc 3.x or
4.x toolchain on the host. There are also now at several mini
distributions (in the form of build scripts) which provide a
self-hosting musl-based toolchain and system root. These are much
better options than the wrapper script if you wish to use dynamic
linking or build packages with many library dependencies. See the musl
website for details.

The musl project is actively seeking contributors, mostly in the areas
of porting, testing, and application compatibility improvement. For
bug reports, support requests, or to get involved in development,
please visit #musl on Freenode IRC or subscribe to the musl mailing
list by sending a blank email to musl-subscribe AT lists DOT openwall
DOT com.

Thank you for using musl.

Cheers,

Rich Felker / dalias