aboutsummaryrefslogtreecommitdiff
path: root/include/complex.h
Commit message (Collapse)AuthorAgeFilesLines
* Remove $FreeBSD$: two-line .h patternWarner Losh2023-08-161-2/+0
| | | | Remove /^\s*\*\n \*\s+\$FreeBSD\$$\n/
* spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSDWarner Losh2023-05-121-1/+1
| | | | | | | | | The SPDX folks have obsoleted the BSD-2-Clause-FreeBSD identifier. Catch up to that fact and revert to their recommended match of BSD-2-Clause. Discussed with: pfg MFC After: 3 days Sponsored by: Netflix
* Implementations of cexpl()Steve Kargl2021-11-051-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The change implements cexpl() for both ld80 and ld128 architectures. Testing was done on x86_64 and aarch64 systems. Along the way sincos[fl]() use an optimization that reduces the argument to being done one rather than twice. This optimization actually pointed to a bug in the ld128 version of sincosl(), which is now fixed. In addition, the minmax polynomial coefficients for sincosl() have been updated. A concise log of the file-by-file changes follows. * include/complex.h: . Add a prototype for cexpl(). * lib/msun/Makefile: . Add s_cexpl.c to the build. . Setup a link for cexpl.3 to cexp.3. * lib/msun/Symbol.map: . Expose cexpl symbol in libm shared library. * lib/msun/ld128/s_cexpl.c: * Implementation of cexpl() for 128-bit long double architectures. Tested on an aarch64 system. * lib/msun/ld80/s_cexpl.c: * Implementation of cexpl() for Intel 80-bit long double. * lib/msun/man/cexp.3: . Document cexpl(). * lib/msun/man/complex.3: . Add a BUGS section about cpow[fl]. * lib/msun/src/s_cexp.c: . Include float.h for weak references on 53-bit long double targets. . Use sincos() to reduce argument reduction cost. * lib/msun/src/s_cexpf.c: . Use sincosf() to reduce argument reduction cost. * lib/msun/src/k_sincosl.h: . Catch up with the new minmax polynomial coefficients for the kernel for the 128-bit cosl() implementation. . BUG FIX: *cs was used where *sn should have been. This means that sinl() was no computed correctly when iy != 0. * lib/msun/src/s_cosl.c: . Include fpmath.h to get access to IEEEl2bits. . Replace M_PI_4 with pio4, a 64-bit or 113-bit approximation for pi / 4. PR: 216862 MFC after: 1 week
* msun: add ld80/ld128 powl, cpow, cpowf, cpowl from openbsdMatt Macy2018-07-151-0/+4
| | | | | | | | | | | | | | | | | | | | | | This corresponds to the latest status (hasn't changed in 9+ years) from openbsd of ld80/ld128 powl, and source cpowf, cpow, cpowl (the complex power functions for float complex, double complex, and long double complex) which are required for C99 compliance and were missing from FreeBSD. Also required for some numerical codes using complex numbered Hamiltonians. Thanks to jhb for tracking down the issue with making weak_reference compile on powerpc. When asked to review, bde said "I don't like it" - but provided no actionable feedback or superior implementations. Discussed with: jhb Submitted by: jmd Differential Revision: https://reviews.freebsd.org/D15919 Notes: svn path=/head/; revision=336299
* Add implementations for clog(3), clogf(3), and clog(3).Konstantin Belousov2018-05-131-0/+4
| | | | | | | | | PR: 216863 Submitted by: bde, Steven G. Kargl <sgk@troutmask.apl.washington.edu> MFC after: 2 weeks Notes: svn path=/head/; revision=333577
* include: General further adoption of SPDX licensing ID tags.Pedro F. Giffuni2017-11-251-0/+2
| | | | | | | | | | | | | | | Mainly focus on files that use BSD 2-Clause license, however the tool I was using mis-identified many licenses so this was mostly a manual - error prone - task. 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. Notes: svn path=/head/; revision=326192
* Add new catrigl.c (r313761) APIs to include/complex.hMahdi Mokhtari2017-02-181-0/+12
| | | | | | | | | Reviewed by: bde, emaste Approved by: bde, emaste (src committers) Differential Revision: https://reviews.freebsd.org/D9615 Notes: svn path=/head/; revision=313923
* I'm happy to finally commit stephen@'s implementations of cacos,David Schultz2013-05-301-0/+12
| | | | | | | | | | | cacosh, casin, casinh, catan, and catanh. Thanks to stephen@ and bde@ for working on these. Submitted by: stephen@ Reviewed by: bde Notes: svn path=/head/; revision=251121
* Add C11 macros CMPLX(), CMPLXF() and CMPLXL().Ed Schouten2013-05-251-0/+12
| | | | | | | | | Clang allows us to initialize complex numbers using an array initializer, casted to a complex type. GCC has a builtin called __builtin_complex(). Notes: svn path=/head/; revision=250990
* Only use the static assertion when __generic is available.Ed Schouten2012-01-171-0/+3
| | | | | | | Reported by: tijl Notes: svn path=/head/; revision=230278
* Remove redundant inclusion of <sys/cdefs.h>.Ed Schouten2012-01-051-2/+0
| | | | | | | Mea culpa. Notes: svn path=/head/; revision=229594
* Make _Complex_I a proper float _Complex when using GCC 4.2.Ed Schouten2012-01-051-1/+5
| | | | | | | | | | | | | | | | | | | | | It turns out our GCC has quite an interesting bug: typeof(1.0fi) != float _Complex typeof((float _Complex)1.0fi) != float _Complex typeof((float _Complex)1.0i) == float _Complex In other words: if casting to an equal size, GCC seems to take a shortcut. By casting down from a double to a float, GCC doesn't take this shortcut, yielding the proper type. To prevent foot-shooting, add a _Static_assert() to guarantee that _Complex_I is always a float _Complex. I'm not going to MFC this part of the diff. MFC after: 2 weeks Notes: svn path=/head/; revision=229590
* Add c{cos,sin,tan}{,h}{,f} functions. This is joint work withDavid Schultz2011-10-171-1/+13
| | | | | | | bde and kargl. Notes: svn path=/head/; revision=226458
* Add missing declarations that I intended to commit with r219359.David Schultz2011-03-071-0/+2
| | | | | | | Not sure why we have math.h in lib/msun/ and complex.h in include/. Notes: svn path=/head/; revision=219379
* Implement cproj{,f,l}().David Schultz2008-08-071-0/+4
| | | | Notes: svn path=/head/; revision=181377
* Annotate creal(), cimag(), and conj() with __pure2.David Schultz2008-08-071-9/+10
| | | | Notes: svn path=/head/; revision=181375
* Implement csqrtl().David Schultz2008-03-301-0/+2
| | | | Notes: svn path=/head/; revision=177761
* Hook hypotl() and cabsl() up to the build.David Schultz2008-03-301-1/+2
| | | | Notes: svn path=/head/; revision=177760
* Implement and document csqrt(3) and csqrtf(3).David Schultz2007-12-151-1/+3
| | | | Notes: svn path=/head/; revision=174617
* Implement carg(3) and cargf(3).David Schultz2007-12-121-0/+2
| | | | | | | Rotting in an old src tree since: March 2005 Notes: svn path=/head/; revision=174561
* Stop defining '_Complex' in a C99 environment, it is supposed to be a keyword.Stefan Farfeleder2004-08-141-0/+2
| | | | Notes: svn path=/head/; revision=133725
* Use tabulators after '#define'.Stefan Farfeleder2004-08-141-5/+5
| | | | Notes: svn path=/head/; revision=133724
* Add implementations for cimag{,f,l}, creal{,f,l} and conj{,f,l}. They areStefan Farfeleder2004-05-301-6/+12
| | | | | | | | | | needed for cases where GCC's builtin functions cannot be used and for compilers that don't know about them. Approved by: das (mentor) Notes: svn path=/head/; revision=129864
* Remove the macros for creal{,f} and cimag{,f}. They failed to convert theirStefan Farfeleder2004-05-301-7/+0
| | | | | | | | | | | | arguments to the needed type and so the result type depended on the argument type. Fixing them isn't really worth the effort because GCC emits the same assembler code with or without them. Not minded by: ru Approved by: das (mentor) Notes: svn path=/head/; revision=129861
* Breath deep and take __P out of the system include files.Warner Losh2002-03-231-6/+6
| | | | | | | | | # This appears to not break X11, but I'm having problems compiling the # glide part of the server with or without this patch, so I can't tell # for sure. Notes: svn path=/head/; revision=93032
* Added skeleton <complex.h> (aligned with the POSIX.1-200x), mostlyRuslan Ermilov2001-06-131-0/+60
to fix the "-nostdinc WARNS=X" breakage caused by broken prototypes for cabs() and cabsl() in <math.h>. Reimplemented cabs() and cabsl() using new complex numbers types and moved prototypes from <math.h> to <complex.h>. Notes: svn path=/head/; revision=78172