Skip to content

Commit f8b10ff

Browse files
committed
"fixed some issues"
1 parent 3e2e301 commit f8b10ff

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

lib/node_modules/@stdlib/math/base/special/cosc/benchmark/c/native/benchmark.c

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,17 @@
2323
#include <time.h>
2424
#include <sys/time.h>
2525

26-
#define NAME "cosc"
26+
#define NAME "sinc_derivative"
2727
#define ITERATIONS 1000000
2828
#define REPEATS 3
2929

30+
double sinc_derivative(double x) {
31+
if( x == 0.0) {
32+
return 0.0;
33+
}
34+
return (cos ( x ) * x - sin( x ) ) / ( x * x );
35+
}
36+
3037
/**
3138
* Prints the TAP version.
3239
*/
@@ -99,7 +106,7 @@ static double benchmark( void ) {
99106
t = tic();
100107
for ( i = 0; i < ITERATIONS; i++ ) {
101108
x = ( 2.0 * rand_double() ) - 2.0;
102-
y = stdlib_base_cosc( x );
109+
y = sinc_derivative( x );
103110
if ( y != y ) {
104111
printf( "should not return NaN\n" );
105112
break;

lib/node_modules/@stdlib/math/base/special/cosc/lib/main.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
// MODULES //
2222

2323
var sinpi = require( '@stdlib/math/base/special/sinpi' );
24-
var cospi=require('@stdlib/math/base/special/cospi');
24+
var cospi =require('@stdlib/math/base/special/cospi');
2525
var isnan = require( '@stdlib/math/base/assert/is-nan' );
2626
var isInfinite = require( '@stdlib/math/base/assert/is-infinite' );
2727
var PI = require( '@stdlib/constants/float64/pi' );
@@ -80,7 +80,7 @@ function cosc( x ) {
8080
if ( x === 0.0 ) {
8181
return 0.0;
8282
}
83-
return ( cospi( x ) - ( sinpi( x ) / ( PI*x ) ) ) / x;
83+
return ( cospi( x ) - ( sinpi( x ) / ( PI * x ) ) ) / x;
8484
}
8585

8686

0 commit comments

Comments
 (0)