Skip to content

Commit bb3742b

Browse files
committed
fix(math/base/special/erfcf): update copyright year to 2026 and add missing files
- Update copyright year from 2025 to 2026 in all source files - Fix Makefile indentation in src/Makefile (tabs instead of spaces) - Add missing examples/c/Makefile for C example compilation - Add copyright notice to LICENSE file - Create benchmark/c/benchmark.c with proper implementation --- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: passed - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: passed - task: lint_javascript_cli status: na - task: lint_javascript_examples status: passed - task: lint_javascript_tests status: passed - task: lint_javascript_benchmarks status: passed - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: missing_dependencies - task: lint_c_examples status: missing_dependencies - task: lint_c_benchmarks status: missing_dependencies - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: passed - task: lint_typescript_tests status: passed - task: lint_license_headers status: passed ---
1 parent cdeb37c commit bb3742b

30 files changed

Lines changed: 374 additions & 47 deletions

lib/node_modules/@stdlib/math/base/special/erfcf/LICENSE

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
<!--
2+
3+
@license Apache-2.0
4+
5+
Copyright (c) 2026 The Stdlib Authors.
6+
7+
-->
18

29
Apache License
310
Version 2.0, January 2004

lib/node_modules/@stdlib/math/base/special/erfcf/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
33
@license Apache-2.0
44
5-
Copyright (c) 2025 The Stdlib Authors.
5+
Copyright (c) 2026 The Stdlib Authors.
66
77
Licensed under the Apache License, Version 2.0 (the "License");
88
you may not use this file except in compliance with the License.

lib/node_modules/@stdlib/math/base/special/erfcf/benchmark/benchmark.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**
22
* @license Apache-2.0
33
*
4-
* Copyright (c) 2025 The Stdlib Authors.
4+
* Copyright (c) 2026 The Stdlib Authors.
55
*
66
* Licensed under the Apache License, Version 2.0 (the "License");
77
* you may not use this file except in compliance with the License.
@@ -38,13 +38,12 @@ bench( pkg, benchmark );
3838
* @param {Object} b - benchmark instance
3939
*/
4040
function benchmark( b ) {
41+
var opts = {
42+
'dtype': 'float32'
43+
};
4144
var x;
4245
var y;
4346
var i;
44-
45-
var opts = {
46-
'dtype': 'float32'
47-
};
4847
x = uniform( 100, -5.0, 5.0, opts );
4948

5049
b.tic();

lib/node_modules/@stdlib/math/base/special/erfcf/benchmark/benchmark.native.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**
22
* @license Apache-2.0
33
*
4-
* Copyright (c) 2025 The Stdlib Authors.
4+
* Copyright (c) 2026 The Stdlib Authors.
55
*
66
* Licensed under the Apache License, Version 2.0 (the "License");
77
* you may not use this file except in compliance with the License.
@@ -25,6 +25,7 @@ var bench = require( '@stdlib/bench' );
2525
var uniform = require( '@stdlib/random/array/uniform' );
2626
var isnanf = require( '@stdlib/math/base/assert/is-nanf' );
2727
var tryRequire = require( '@stdlib/utils/try-require' );
28+
var format = require( '@stdlib/string/format' );
2829
var pkg = require( './../package.json' ).name;
2930

3031

@@ -38,7 +39,7 @@ var opts = {
3839

3940
// MAIN //
4041

41-
bench( pkg+'::native', opts, benchmark );
42+
bench( format( '%s::native', pkg ), opts, benchmark );
4243

4344
/**
4445
* Benchmark function.
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
#/
2+
# @license Apache-2.0
3+
#
4+
# Copyright (c) 2026 The Stdlib Authors.
5+
#
6+
# Licensed under the Apache License, Version 2.0 (the "License");
7+
# you may not use this file except in compliance with the License.
8+
# You may obtain a copy of the License at
9+
#
10+
# http://www.apache.org/licenses/LICENSE-2.0
11+
#
12+
# Unless required by applicable law or agreed to in writing, software
13+
# distributed under the License is distributed on an "AS IS" BASIS,
14+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
# See the License for the specific language governing permissions and
16+
# limitations under the License.
17+
#/
18+
19+
#/
20+
# Makefile for compiling C benchmark files.
21+
#
22+
# ## Notes
23+
#
24+
# - This Makefile is a stub for running C benchmark files. The actual work is done in the top-level Makefile.
25+
#
26+
#/
27+
28+
29+
# DEPENDENCIES #
30+
31+
include $(TOOLS_MAKE_LIB_DIR)/benchmark/c.mk
Lines changed: 143 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,143 @@
1+
/**
2+
* @license Apache-2.0
3+
*
4+
* Copyright (c) 2026 The Stdlib Authors.
5+
*
6+
* Licensed under the Apache License, Version 2.0 (the "License");
7+
* you may not use this file except in compliance with the License.
8+
* You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing, software
13+
* distributed under the License is distributed on an "AS IS" BASIS,
14+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
* See the License for the specific language governing permissions and
16+
* limitations under the License.
17+
*/
18+
19+
#include "stdlib/math/base/special/erfcf.h"
20+
#include <stdlib.h>
21+
#include <stdio.h>
22+
#include <math.h>
23+
#include <time.h>
24+
#include <sys/time.h>
25+
26+
#define NAME "erfcf"
27+
#define ITERATIONS 1000000
28+
#define REPEATS 3
29+
30+
/**
31+
* Define prototypes for local functions.
32+
*/
33+
static void print_version( void );
34+
static void print_summary( int total, int passing );
35+
static void print_results( double elapsed );
36+
static double tic( void );
37+
static float rand_float( void );
38+
static double benchmark( void );
39+
40+
/**
41+
* Prints the TAP version.
42+
*/
43+
static void print_version( void ) {
44+
printf( "TAP version 13\n" );
45+
}
46+
47+
/**
48+
* Prints the TAP summary.
49+
*
50+
* @param total total number of tests
51+
* @param passing total number of passing tests
52+
*/
53+
static void print_summary( int total, int passing ) {
54+
printf( "#\n" );
55+
printf( "1..%d\n", total ); // TAP plan
56+
printf( "# total %d\n", total );
57+
printf( "# pass %d\n", passing );
58+
printf( "#\n" );
59+
printf( "# ok\n" );
60+
}
61+
62+
/**
63+
* Prints benchmarks results.
64+
*
65+
* @param elapsed elapsed time in seconds
66+
*/
67+
static void print_results( double elapsed ) {
68+
double rate = (double)ITERATIONS / elapsed;
69+
printf( " ---\n" );
70+
printf( " iterations: %d\n", ITERATIONS );
71+
printf( " elapsed: %0.9f\n", elapsed );
72+
printf( " rate: %0.9f\n", rate );
73+
printf( " ...\n" );
74+
}
75+
76+
/**
77+
* Returns a clock time.
78+
*
79+
* @return clock time
80+
*/
81+
static double tic( void ) {
82+
struct timeval now;
83+
gettimeofday( &now, NULL );
84+
return (double)now.tv_sec + (double)now.tv_usec/1.0e6;
85+
}
86+
87+
/**
88+
* Generates a random number on the interval [0,1).
89+
*
90+
* @return random number
91+
*/
92+
static float rand_float( void ) {
93+
int r = rand();
94+
return (float)r / ( (float)RAND_MAX + 1.0f );
95+
}
96+
97+
/**
98+
* Runs a benchmark.
99+
*
100+
* @return elapsed time in seconds
101+
*/
102+
static double benchmark( void ) {
103+
double elapsed;
104+
float x;
105+
float y;
106+
double t;
107+
int i;
108+
109+
t = tic();
110+
for ( i = 0; i < ITERATIONS; i++ ) {
111+
x = ( rand_float() * 10.0f ) - 5.0f;
112+
y = stdlib_base_erfcf( x );
113+
if ( y != y ) {
114+
printf( "should not return NaN\n" );
115+
break;
116+
}
117+
}
118+
elapsed = tic() - t;
119+
if ( y != y ) {
120+
printf( "should not return NaN\n" );
121+
}
122+
return elapsed;
123+
}
124+
125+
/**
126+
* Main execution sequence.
127+
*/
128+
int main( void ) {
129+
double elapsed;
130+
int i;
131+
132+
// Use the current time to seed the random number generator:
133+
srand( time( NULL ) );
134+
135+
print_version();
136+
for ( i = 0; i < REPEATS; i++ ) {
137+
printf( "# c::%s\n", NAME );
138+
elapsed = benchmark();
139+
print_results( elapsed );
140+
printf( "ok %d benchmark finished\n", i+1 );
141+
}
142+
print_summary( REPEATS, REPEATS );
143+
}

lib/node_modules/@stdlib/math/base/special/erfcf/binding.gyp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# @license Apache-2.0
22
#
3-
# Copyright (c) 2025 The Stdlib Authors.
3+
# Copyright (c) 2026 The Stdlib Authors.
44
#
55
# Licensed under the Apache License, Version 2.0 (the "License");
66
# you may not use this file except in compliance with the License.

lib/node_modules/@stdlib/math/base/special/erfcf/docs/types/index.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
* @license Apache-2.0
33
*
4-
* Copyright (c) 2025 The Stdlib Authors.
4+
* Copyright (c) 2026 The Stdlib Authors.
55
*
66
* Licensed under the Apache License, Version 2.0 (the "License");
77
* you may not use this file except in compliance with the License.
@@ -61,4 +61,4 @@ declare function erfcf( x: number ): number;
6161

6262
// EXPORTS //
6363

64-
export = erfcf;
64+
export = erfcf;

lib/node_modules/@stdlib/math/base/special/erfcf/docs/types/test.ts

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
* @license Apache-2.0
33
*
4-
* Copyright (c) 2025 The Stdlib Authors.
4+
* Copyright (c) 2026 The Stdlib Authors.
55
*
66
* Licensed under the Apache License, Version 2.0 (the "License");
77
* you may not use this file except in compliance with the License.
@@ -23,22 +23,22 @@ import erfcf = require( './index' );
2323

2424
// The function returns a number...
2525
{
26-
erfcf( 8 ); // $ExpectType number
26+
erfcf( 8 ); // $ExpectType number
2727
}
2828

2929
// The compiler throws an error if the function is provided a value other than a number...
3030
{
31-
erfcf( true ); // $ExpectError
32-
erfcf( false ); // $ExpectError
33-
erfcf( null ); // $ExpectError
34-
erfcf( undefined ); // $ExpectError
35-
erfcf( '5' ); // $ExpectError
36-
erfcf( [] ); // $ExpectError
37-
erfcf( {} ); // $ExpectError
38-
erfcf( ( x: number ): number => x ); // $ExpectError
31+
erfcf( true ); // $ExpectError
32+
erfcf( false ); // $ExpectError
33+
erfcf( null ); // $ExpectError
34+
erfcf( undefined ); // $ExpectError
35+
erfcf( '5' ); // $ExpectError
36+
erfcf( [] ); // $ExpectError
37+
erfcf( {} ); // $ExpectError
38+
erfcf( ( x: number ): number => x ); // $ExpectError
3939
}
4040

4141
// The compiler throws an error if the function is provided insufficient arguments...
4242
{
43-
erfcf(); // $ExpectError
44-
}
43+
erfcf(); // $ExpectError
44+
}

0 commit comments

Comments
 (0)