aboutsummaryrefslogtreecommitdiff
path: root/lib/msun/bsdsrc
Commit message (Collapse)AuthorAgeFilesLines
* Remove unused variables in msun/bsdsrc/b_tgamma.cSteve Kargl2025-08-091-1/+1
| | | | | PR: 288736 MFC after: 3 days
* lib/msun: Cleanup after $FreeBSD$ removalSteve Kargl2024-01-284-4/+0
| | | | | | | Remove no longer needed explicit inclusion of sys/cdefs.h. PR: 276669 MFC after: 1 week
* lib: Remove ancient SCCS tags.Warner Losh2023-11-274-5/+0
| | | | | | | | Remove ancient SCCS tags from the tree, automated scripting, with two minor fixup to keep things compiling. All the common forms in the tree were removed with a perl script. Sponsored by: Netflix
* Remove $FreeBSD$: one-line .c patternWarner Losh2023-08-163-6/+0
| | | | Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/
* Remove $FreeBSD$: one-line .h patternWarner Losh2023-08-161-1/+0
| | | | Remove /^\s*\*+\s*\$FreeBSD\$.*$\n/
* * lib/msun/Makefile:Mark Murray2021-12-153-395/+369
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | . Disconnect b_exp.c and b_log.c from the build. * lib/msun/bsdsrc/b_exp.c: . Replace scalb() usage with C99's ldexp(). . Replace finite(x) usage with C99's isfinite(). . Whitespace changes towards style(9). . Remove include of "mathimpl.h". It is no longer needed. . Remove #if 0 ... #endif code, which has been present since svn r93211 (2002-03-26). . New minimax polynomial coefficients. . Add comments to explain origins of some constants. . Use ansi-C prototype. Remove K&R prototype. Add static to prototype. * lib/msun/bsdsrc/b_log.c: . Remove include of "mathimpl.h". It is no longer needed. . Fix comments to actually describe the code. . Reduce minimax polynomial from degree 4 to degree 3. This uses newly computed coefficients. . Use ansi-C prototype. Remove K&R prototype. Add static to prototype. . Remove volatile in declaration of u1. . Alphabetize decalaration list. . Whitespace changes towards style(9). . In argument reduction of x to g and m, replace use of logb() and ldexp() with a single call to frexp(). Add code to get 1 <= g < 2. . Remove #if 0 ... #endif code, which has been present since svn r93211 (2002-03-26). . The special case m == -1022, replace logb() with ilogb(). * lib/msun/bsdsrc/b_tgamma.c: . Update comments. Fix comments where needed. . Add float.h to get LDBL_MANT_DIG for weak reference of tgammal to tgamma. . Remove include of "mathimpl.h". It is no longer needed. . Use "math.h" instead of <math.h>. . Add '#include math_private.h" . Add struct Double from mathimpl.h and include b_log.c and b_exp.c. . Remove forward declarations of neg_gam(), small_gam(), smaller_gam, large_gam() and ratfun_gam() by re-arranging the code to move these function above their first reference. . New minimax coefficients for polynomial in large_gam(). . New splitting of a0 into a0hi nd a0lo, which include additional bits of precision. . Use ansi-C prototype. Remove K&R prototype. . Replace the TRUNC() macro with a simple cast of a double entities to float before assignment (functional changes). . Replace sin(M_PI*z) with sinpi(z) and cos(M_PI*(0.5-z)) with cospi(0.5-z). Submitted by: Steve Kargl Differential Revision: https://reviews.freebsd.org/D33444 Reviewed by: pfg
* msun: drop clause 3 from the Berkeley license.Pedro F. Giffuni2019-12-273-18/+6
| | | | | | | | | | | Per the University California Regents letter, drop the so-called "advertisement" clause. Discussed with: bde, kargl (2017) Differential Revision: https://reviews.freebsd.org/D22928 Notes: svn path=/head/; revision=356106
* Remove an unused incude from lib/msun/bsdsrc/b_log.c.Dimitry Andric2017-12-071-1/+0
| | | | | | | | Submitted by: Steve Kargl MFC after: 3 days Notes: svn path=/head/; revision=326670
* spdx: initial adoption of licensing ID tags.Pedro F. Giffuni2017-11-184-3/+11
| | | | | | | | | | | | | | | | | | | | The Software Package Data Exchange (SPDX) group provides a specification to make it easier for automated tools to detect and summarize well known opensource licenses. We are gradually adopting the specification, noting that the tags are considered only advisory and do not, in any way, superceed or replace the license texts. Special thanks to Wind River for providing access to "The Duke of Highlander" tool: an older (2014) run over FreeBSD tree was useful as a starting point. Initially, only tag files that use BSD 4-Clause "Original" license. RelNotes: yes Differential Revision: https://reviews.freebsd.org/D13133 Notes: svn path=/head/; revision=325966
* Fix some non-standard variable declarations.David Schultz2011-10-161-10/+10
| | | | Notes: svn path=/head/; revision=226414
* Eliminate some warnings.David Schultz2008-02-223-9/+3
| | | | Notes: svn path=/head/; revision=176449
* Fix tgamma() on some special args:Bruce Evans2007-05-021-14/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (1) tgamma(-Inf) returned +Inf and failed to raise any exception, but should always have raised an exception, and should behave like tgamma(negative integer). (2) tgamma(negative integer) returned +Inf and raised divide-by-zero, but should return NaN and raise "invalid" on any IEEEish system. (3) About half of the 2**52 negative intgers between -2**53 and -2**52 were misclassified as non-integers by using floor(x + 0.5) to round to nearest, so tgamma(x) was wrong (+-0 instead of +Inf and now NaN) on these args. The floor() expression is hard to use since rounding of (x + 0.5) may give x or x + 1, depending on |x| and the current rounding mode. The fixed version uses ceil(x) to classify x before operating on x and ends up being more efficient since ceil(x) is needed anyway. (4) On at least the problematic args in (3), tgamma() raised a spurious inexact. (5) tgamma(large positive) raised divide-by-zero but should raise overflow. (6) tgamma(+Inf) raised divide-by-zero but should not raise any exception. (7) Raise inexact for tiny |x| in a way that has some chance of not being optimized away. The fix for (5) and (6), and probably for (2), also prevents -O optimizing away the exception. PR: 112180 (2) Standards: Annex F in C99 (IEC 60559 binding) requires (1), (2) and (6). Notes: svn path=/head/; revision=169212
* Document (in a comment) the current (slightly broken) handling of specialBruce Evans2007-05-021-6/+9
| | | | | | | | | | | | | | | | | | | | | | | | | values in more detail, and change the style of this comment to be closer to fdlibm and C99: - tgamma(-Inf) was undocumented and is wrong (+Inf, should be NaN) - tgamma(negative integer) is as intended (+Inf) but not best for IEEE-754 (NaN) - tgamma(-0) was documented as being wrong (+Inf) but was correct (-Inf) - documentation of setting of exceptions (overflow, etc.) was more complete here than in most of libm, but was further from matching the actual setting than in most of libm, due to various bugs here (primarily, always evaluating +Inf one/zero and getting unwanted divide-by-zero exceptions from this). Now the actual behaviour with gcc -O0 is documented. Optimization still breaks setting of exceptions all over libm, so nothing can depend on this working. - tgamma(NaN)'s exception was documented as being wrong (invalid) but was correct (no exception with IEEEish NaNs). Finish (?) rev.1.5. gamma was not renamed to tgamma in one place. Finish (?) rev.1.6. errno.h was not completely removed. Notes: svn path=/head/; revision=169209
* Removed an unused declaration which was so old that it wasn't a prototypeBruce Evans2005-11-181-4/+6
| | | | | | | | | and thus just broke building at any nonzero WARNS level. Fixed nearby style bugs. Notes: svn path=/head/; revision=152566
* Fixed aliasing bugs in TRUNC() by using the fdlibm macros for accessBruce Evans2005-09-193-12/+26
| | | | | | | | | | | | | | | | | | | | | | | to doubles as bits. fdlibm-1.1 had similar aliasing bugs, but these were fixed by NetBSD or Cygnus before a modified version of fdlibm was imported in 1994. TRUNC() is only used by tgamma() and some implementation-detail functions. The aliasing bugs were detected by compiling with gcc -O2 but don't seem to have broken tgamma() on i386's or amd64's. They broke my modified version of tgamma(). Moved the definition of TRUNC() to mathimpl.h so that it can be fixed in one place, although the general version is even slower than necessary because it has to operate on pointers to volatiles to handle its arg sometimes being volatile. Inefficiency of the fdlibm macros slows down libm generally, and tgamma() is a relatively unimportant part of libm. The macros act as if on 32-bit words in memory, so they are hard to optimize to direct actions on 64-bit double registers for (non-i386) machines where this is possible. The optimization is too hard for gcc on amd64's, and declaring variables as volatile makes it impossible. Notes: svn path=/head/; revision=150318
* GC unused declarationDavid Schultz2004-12-161-1/+0
| | | | Notes: svn path=/head/; revision=138925
* Cosmetic changes only:David Schultz2004-12-163-45/+15
| | | | | | | | | | | - style - remove unused variables - de-support VAX Inspired by: bin/42388 Notes: svn path=/head/; revision=138924
* Remove some kludges designed to ensure that the compiler didn't roundDavid Schultz2004-05-172-87/+10
| | | | | | | | | | | | | constants the wrong way on the VAX. Instead, use C99 hexadecimal floating-point constants, which are guaranteed to be exact on binary IEEE machines. (The correct hexadecimal values were already provided in the source, but not used.) Also, convert the constants to lowercase to work around a gcc bug that wasn't fixed until gcc 3.4.0. Prompted by: stefanf Notes: svn path=/head/; revision=129312
* Correct typos, mostly s/ a / an / where appropriate. Some whitespace cleanup,Jens Schweikhardt2003-01-011-1/+1
| | | | | | | especially in troff files. Notes: svn path=/head/; revision=108533
* Assume __STDC__, remove non-__STDC__ code.Alfred Perlstein2002-05-281-4/+0
| | | | | | | Submitted by: keramida Notes: svn path=/head/; revision=97407
* Resurrect Lite1's gamma() as C99's tgamma(). Minimal changes.Bruce Evans2002-03-263-5/+9
| | | | Notes: svn path=/head/; revision=93211
* Remove __P() usage.David E. O'Brien2002-03-212-7/+8
| | | | Notes: svn path=/head/; revision=92917
* Fix SCM ID's.David E. O'Brien2002-03-213-9/+7
| | | | Notes: svn path=/head/; revision=92887
* Add __FBSDID()s to libmMatthew Dillon2001-09-303-0/+9
| | | | Notes: svn path=/head/; revision=84210
* Remove trailing whitespace.Rodney W. Grimes1995-05-302-11/+11
| | | | Notes: svn path=/head/; revision=8870
* BSD 4.4 Lite Lib SourcesRodney W. Grimes1994-05-274-0/+1123
Notes: svn path=/cvs2svn/branches/unlabeled-1.1.1/; revision=1573