Skip to content

Commit

Permalink
Restore original fdlibm copyright on sincos files (#265)
Browse files Browse the repository at this point in the history
These files are derived from the original fdlibm sin/cos files.
While we do already preserve that license notice in LICENSE.md
(so there's no actual license compliance issue here), it's
cleaner to have the copyright notice in the file as well, in
case somebody copies the file out of the repo.
  • Loading branch information
Keno authored Oct 18, 2022
1 parent 0edf8d6 commit 1d2c5e3
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 5 deletions.
13 changes: 11 additions & 2 deletions src/s_sincos.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
/* @(#)s_sincos.c 5.1 13/07/15 */
/*
/* See openlibm LICENSE.md for full license details.
*
* ====================================================
* This file is derived from fdlibm:
* Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
* Developed at SunPro, a Sun Microsystems, Inc. business.
* Permission to use, copy, modify, and distribute this
* software is freely granted, provided that this notice
* is preserved.
*
* ====================================================
* Copyright (C) 2013 Elliot Saba. All rights reserved.
*
Expand All @@ -25,7 +34,7 @@
* Borrow liberally from s_sin.c and s_cos.c, merging
* efforts where applicable and returning their values in
* appropriate variables, thereby slightly reducing the
* amount of work relative to just calling sin/cos(x)
* amount of work relative to just calling sin/cos(x)
* separately
*
* Special cases:
Expand Down
15 changes: 12 additions & 3 deletions src/s_sincosf.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
/* s_sincosf.c -- float version of s_sincos.c
*
* ====================================================
* This file is derived from fdlibm:
* Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
* Developed at SunPro, a Sun Microsystems, Inc. business.
* Permission to use, copy, modify, and distribute this
* software is freely granted, provided that this notice
* is preserved.
*
* ====================================================
* Copyright (C) 2013 Elliot Saba
* Developed at the University of Washington
*
Expand Down Expand Up @@ -115,14 +124,14 @@ sincosf(float x, float * s, float * c) {
/* |x| ~<= 9*pi/4 */
if(ix<=0x40e231d5) {
/* |x| ~> 7*pi/4 */
if(ix<=0x40afeddf) {
if(ix<=0x40afeddf) {
if(hx>0) {
__kernel_sincosdf( x - sc3pio2, c, &k_s );
*s = -k_s;
} else {
__kernel_sincosdf( x + sc3pio2, &k_c, s );
*c = -k_c;
}
}
}
else {
if( hx > 0 ) {
Expand All @@ -148,7 +157,7 @@ sincosf(float x, float * s, float * c) {
case 1:
__kernel_sincosdf( -y, c, s );
break;
case 2:
case 2:
__kernel_sincosdf( -y, s, &k_c);
*c = -k_c;
break;
Expand Down

0 comments on commit 1d2c5e3

Please sign in to comment.