Skip to content

Commit 1d2c5e3

Browse files
authored
Restore original fdlibm copyright on sincos files (#265)
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.
1 parent 0edf8d6 commit 1d2c5e3

File tree

2 files changed

+23
-5
lines changed

2 files changed

+23
-5
lines changed

src/s_sincos.c

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
/* @(#)s_sincos.c 5.1 13/07/15 */
2-
/*
2+
/* See openlibm LICENSE.md for full license details.
3+
*
4+
* ====================================================
5+
* This file is derived from fdlibm:
6+
* Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
7+
* Developed at SunPro, a Sun Microsystems, Inc. business.
8+
* Permission to use, copy, modify, and distribute this
9+
* software is freely granted, provided that this notice
10+
* is preserved.
11+
*
312
* ====================================================
413
* Copyright (C) 2013 Elliot Saba. All rights reserved.
514
*
@@ -25,7 +34,7 @@
2534
* Borrow liberally from s_sin.c and s_cos.c, merging
2635
* efforts where applicable and returning their values in
2736
* appropriate variables, thereby slightly reducing the
28-
* amount of work relative to just calling sin/cos(x)
37+
* amount of work relative to just calling sin/cos(x)
2938
* separately
3039
*
3140
* Special cases:

src/s_sincosf.c

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
/* s_sincosf.c -- float version of s_sincos.c
22
*
3+
* ====================================================
4+
* This file is derived from fdlibm:
5+
* Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
6+
* Developed at SunPro, a Sun Microsystems, Inc. business.
7+
* Permission to use, copy, modify, and distribute this
8+
* software is freely granted, provided that this notice
9+
* is preserved.
10+
*
11+
* ====================================================
312
* Copyright (C) 2013 Elliot Saba
413
* Developed at the University of Washington
514
*
@@ -115,14 +124,14 @@ sincosf(float x, float * s, float * c) {
115124
/* |x| ~<= 9*pi/4 */
116125
if(ix<=0x40e231d5) {
117126
/* |x| ~> 7*pi/4 */
118-
if(ix<=0x40afeddf) {
127+
if(ix<=0x40afeddf) {
119128
if(hx>0) {
120129
__kernel_sincosdf( x - sc3pio2, c, &k_s );
121130
*s = -k_s;
122131
} else {
123132
__kernel_sincosdf( x + sc3pio2, &k_c, s );
124133
*c = -k_c;
125-
}
134+
}
126135
}
127136
else {
128137
if( hx > 0 ) {
@@ -148,7 +157,7 @@ sincosf(float x, float * s, float * c) {
148157
case 1:
149158
__kernel_sincosdf( -y, c, s );
150159
break;
151-
case 2:
160+
case 2:
152161
__kernel_sincosdf( -y, s, &k_c);
153162
*c = -k_c;
154163
break;

0 commit comments

Comments
 (0)