musl/src/math/j1f.c, branch master musl - an implementation of the standard library for Linux-based systems fix threshold constants in j0f, y0f, j1f, y1f 2017年03月15日T04:15:28+00:00 Szabolcs Nagy nsz@port70.net 2017年03月15日T01:55:49+00:00 8cba1dc46c8f29261aa441e70bac798f2c2c0f58 partly following freebsd rev 279491 https://svnweb.freebsd.org/base?view=revision&revision=279491 (musl had some of the fixes before freebsd). the change should not matter much for j0f, y0f, but it improves j1f and y1f in [2.5,~3.75] (that is [0x40200000,~0x40700000]). near roots (e.g. around 3.8317 for j1f) there are still large ulp errors. dropped code that tried to raise inexact.
partly following freebsd rev 279491
https://svnweb.freebsd.org/base?view=revision&revision=279491
(musl had some of the fixes before freebsd).
the change should not matter much for j0f, y0f, but it improves
j1f and y1f in [2.5,~3.75] (that is [0x40200000,~0x40700000]).
near roots (e.g. around 3.8317 for j1f) there are still large
ulp errors.
dropped code that tried to raise inexact.
math: define _GNU_SOURCE when implementing non-standard math functions 2013年12月12日T03:42:11+00:00 Szabolcs Nagy nsz@port70.net 2013年12月12日T03:42:11+00:00 ec411999a0262c8e3e6be53ae11ad761776a2fc1 this makes the prototypes in math.h are visible so they are checked agaist the function definitions
this makes the prototypes in math.h are visible so they are checked agaist
the function definitions
math: use double_t for temporaries to avoid stores on i386 2013年05月15日T23:08:52+00:00 Szabolcs Nagy nsz@port70.net 2013年05月15日T23:08:52+00:00 e216951f509b71da193da2fc63e25b998740d58b When FLT_EVAL_METHOD!=0 (only i386 with x87 fp) the excess precision of an expression must be removed in an assignment. (gcc needs -fexcess-precision=standard or -std=c99 for this) This is done by extra load/store instructions which adds code bloat when lot of temporaries are used and it makes the result less precise in many cases. Using double_t and float_t avoids these issues on i386 and it makes no difference on other archs. For now only a few functions are modified where the excess precision is clearly beneficial (mostly polynomial evaluations with temporaries). object size differences on i386, gcc-4.8: old new __cosdf.o 123 95 __cos.o 199 169 __sindf.o 131 95 __sin.o 225 203 __tandf.o 207 151 __tan.o 605 499 erff.o 1470 1416 erf.o 1703 1649 j0f.o 1779 1745 j0.o 2308 2274 j1f.o 1602 1568 j1.o 2286 2252 tgamma.o 1431 1424 math/*.o 64164 63635
When FLT_EVAL_METHOD!=0 (only i386 with x87 fp) the excess
precision of an expression must be removed in an assignment.
(gcc needs -fexcess-precision=standard or -std=c99 for this)
This is done by extra load/store instructions which adds code
bloat when lot of temporaries are used and it makes the result
less precise in many cases.
Using double_t and float_t avoids these issues on i386 and
it makes no difference on other archs.
For now only a few functions are modified where the excess
precision is clearly beneficial (mostly polynomial evaluations
with temporaries).
object size differences on i386, gcc-4.8:
 old new
__cosdf.o 123 95
__cos.o 199 169
__sindf.o 131 95
__sin.o 225 203
__tandf.o 207 151
__tan.o 605 499
erff.o 1470 1416
erf.o 1703 1649
j0f.o 1779 1745
j0.o 2308 2274
j1f.o 1602 1568
j1.o 2286 2252
tgamma.o 1431 1424
math/*.o 64164 63635
math: bessel cleanup (j1.c and j1f.c) 2013年01月01日T21:11:28+00:00 Szabolcs Nagy nsz@port70.net 2013年01月01日T21:11:28+00:00 5bb6b24952e3f95ede42b60ac64a33ac34b8e272 a common code path in j1 and y1 was factored out so the resulting object code is a bit smaller unsigned int arithmetics is used for bit manipulation j1(-inf) now returns 0 instead of -0 an incorrect threshold in the common code of j1f and y1f got fixed (this caused spurious overflow and underflow exceptions) the else branch in pone and pzero functions are fixed (so code analyzers dont warn about uninitialized values)
a common code path in j1 and y1 was factored out so the resulting
object code is a bit smaller
unsigned int arithmetics is used for bit manipulation
j1(-inf) now returns 0 instead of -0
an incorrect threshold in the common code of j1f and y1f got fixed
(this caused spurious overflow and underflow exceptions)
the else branch in pone and pzero functions are fixed
(so code analyzers dont warn about uninitialized values)
code cleanup of named constants 2012年03月19日T22:41:19+00:00 nsz nsz@port70.net 2012年03月19日T22:41:19+00:00 0cbb65479147ecdaa664e88cc2a5a925f3de502f zero, one, two, half are replaced by const literals The policy was to use the f suffix for float consts (1.0f), but don't use suffix for long double consts (these consts can be exactly represented as double).
zero, one, two, half are replaced by const literals
The policy was to use the f suffix for float consts (1.0f),
but don't use suffix for long double consts (these consts
can be exactly represented as double).
math cleanup: use 1.0f instead of (float)1.0 2012年03月13日T19:24:23+00:00 nsz nsz@port70.net 2012年03月13日T19:24:23+00:00 8d0a6f7a1c47b280647f292e6864b85b72c71f2e
first commit of the new libm! 2012年03月13日T05:17:53+00:00 Rich Felker dalias@aerifal.cx 2012年03月13日T05:17:53+00:00 b69f695acedd4ce2798ef9ea28d834ceccc789bd thanks to the hard work of Szabolcs Nagy (nsz), identifying the best (from correctness and license standpoint) implementations from freebsd and openbsd and cleaning them up! musl should now fully support c99 float and long double math functions, and has near-complete complex math support. tgmath should also work (fully on gcc-compatible compilers, and mostly on any c99 compiler). based largely on commit 0376d44a890fea261506f1fc63833e7a686dca19 from nsz's libm git repo, with some additions (dummy versions of a few missing long double complex functions, etc.) by me. various cleanups still need to be made, including re-adding (if they're correct) some asm functions that were dropped.
thanks to the hard work of Szabolcs Nagy (nsz), identifying the best
(from correctness and license standpoint) implementations from freebsd
and openbsd and cleaning them up! musl should now fully support c99
float and long double math functions, and has near-complete complex
math support. tgmath should also work (fully on gcc-compatible
compilers, and mostly on any c99 compiler).
based largely on commit 0376d44a890fea261506f1fc63833e7a686dca19 from
nsz's libm git repo, with some additions (dummy versions of a few
missing long double complex functions, etc.) by me.
various cleanups still need to be made, including re-adding (if
they're correct) some asm functions that were dropped.

AltStyle によって変換されたページ (->オリジナル) /