Skip to content

Commit 930dc9d

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 930dc9d

33 files changed

Lines changed: 498 additions & 77 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: 126 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,126 @@
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+
# VARIABLES #
20+
21+
ifndef VERBOSE
22+
QUIET := @
23+
else
24+
QUIET :=
25+
endif
26+
27+
# Determine the OS ([1][1], [2][2]).
28+
#
29+
# [1]: https://en.wikipedia.org/wiki/Uname#Examples
30+
# [2]: http://stackoverflow.com/a/27776822/2225624
31+
OS ?= $(shell uname)
32+
ifneq (, $(findstring MINGW,$(OS)))
33+
OS := WINNT
34+
else
35+
ifneq (, $(findstring MSYS,$(OS)))
36+
OS := WINNT
37+
else
38+
ifneq (, $(findstring CYGWIN,$(OS)))
39+
OS := WINNT
40+
else
41+
ifneq (, $(findstring Windows_NT,$(OS)))
42+
OS := WINNT
43+
endif
44+
endif
45+
endif
46+
endif
47+
48+
# Define the program used for compiling C source files:
49+
ifdef C_COMPILER
50+
CC := $(C_COMPILER)
51+
else
52+
CC := gcc
53+
endif
54+
55+
# Define the command-line options when compiling C files:
56+
CFLAGS ?= \
57+
-std=c99 \
58+
-O3 \
59+
-Wall \
60+
-pedantic
61+
62+
# Determine whether to generate position independent code ([1][1], [2][2]).
63+
#
64+
# [1]: https://gcc.gnu.org/onlinedocs/gcc/Code-Gen-Options.html#Code-Gen-Options
65+
# [2]: http://stackoverflow.com/questions/5311515/gcc-fpic-option
66+
ifeq ($(OS), WINNT)
67+
fPIC ?=
68+
else
69+
fPIC ?= -fPIC
70+
endif
71+
72+
# List of C targets:
73+
c_targets := benchmark.out
74+
75+
76+
# RULES #
77+
78+
#/
79+
# Compiles C source files.
80+
#
81+
# @param {string} [C_COMPILER] - C compiler (e.g., `gcc`)
82+
# @param {string} [CFLAGS] - C compiler options
83+
# @param {(string|void)} [fPIC] - compiler flag indicating whether to generate position independent code (e.g., `-fPIC`)
84+
#
85+
# @example
86+
# make
87+
#
88+
# @example
89+
# make all
90+
#/
91+
all: $(c_targets)
92+
93+
.PHONY: all
94+
95+
#/
96+
# Compiles C source files.
97+
#
98+
# @private
99+
# @param {string} CC - C compiler
100+
# @param {string} CFLAGS - C compiler flags
101+
# @param {(string|void)} fPIC - compiler flag indicating whether to generate position independent code
102+
#/
103+
$(c_targets): %.out: %.c
104+
$(QUIET) $(CC) $(CFLAGS) $(fPIC) -o $@ $< -lm
105+
106+
#/
107+
# Runs compiled benchmarks.
108+
#
109+
# @example
110+
# make run
111+
#/
112+
run: $(c_targets)
113+
$(QUIET) ./$<
114+
115+
.PHONY: run
116+
117+
#/
118+
# Removes generated files.
119+
#
120+
# @example
121+
# make clean
122+
#/
123+
clean:
124+
$(QUIET) -rm -f *.o *.out
125+
126+
.PHONY: clean
Lines changed: 142 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,142 @@
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.h>
20+
#include <stdio.h>
21+
#include <math.h>
22+
#include <time.h>
23+
#include <sys/time.h>
24+
25+
#define NAME "erfcf"
26+
#define ITERATIONS 1000000
27+
#define REPEATS 3
28+
29+
/**
30+
* Define prototypes for local functions.
31+
*/
32+
static void print_version( void );
33+
static void print_summary( int total, int passing );
34+
static void print_results( double elapsed );
35+
static double tic( void );
36+
static float rand_float( void );
37+
static double benchmark( void );
38+
39+
/**
40+
* Prints the TAP version.
41+
*/
42+
static void print_version( void ) {
43+
printf( "TAP version 13\n" );
44+
}
45+
46+
/**
47+
* Prints the TAP summary.
48+
*
49+
* @param total total number of tests
50+
* @param passing total number of passing tests
51+
*/
52+
static void print_summary( int total, int passing ) {
53+
printf( "#\n" );
54+
printf( "1..%d\n", total ); // TAP plan
55+
printf( "# total %d\n", total );
56+
printf( "# pass %d\n", passing );
57+
printf( "#\n" );
58+
printf( "# ok\n" );
59+
}
60+
61+
/**
62+
* Prints benchmarks results.
63+
*
64+
* @param elapsed elapsed time in seconds
65+
*/
66+
static void print_results( double elapsed ) {
67+
double rate = (double)ITERATIONS / elapsed;
68+
printf( " ---\n" );
69+
printf( " iterations: %d\n", ITERATIONS );
70+
printf( " elapsed: %0.9f\n", elapsed );
71+
printf( " rate: %0.9f\n", rate );
72+
printf( " ...\n" );
73+
}
74+
75+
/**
76+
* Returns a clock time.
77+
*
78+
* @return clock time
79+
*/
80+
static double tic( void ) {
81+
struct timeval now;
82+
gettimeofday( &now, NULL );
83+
return (double)now.tv_sec + (double)now.tv_usec/1.0e6;
84+
}
85+
86+
/**
87+
* Generates a random number on the interval [0,1).
88+
*
89+
* @return random number
90+
*/
91+
static float rand_float( void ) {
92+
int r = rand();
93+
return (float)r / ( (float)RAND_MAX + 1.0f );
94+
}
95+
96+
/**
97+
* Runs a benchmark.
98+
*
99+
* @return elapsed time in seconds
100+
*/
101+
static double benchmark( void ) {
102+
double elapsed;
103+
float x;
104+
float y;
105+
double t;
106+
int i;
107+
108+
t = tic();
109+
for ( i = 0; i < ITERATIONS; i++ ) {
110+
x = ( rand_float() * 10.0f ) - 5.0f;
111+
y = stdlib_base_erfcf( x );
112+
if ( y != y ) {
113+
printf( "should not return NaN\n" );
114+
break;
115+
}
116+
}
117+
elapsed = tic() - t;
118+
if ( y != y ) {
119+
printf( "should not return NaN\n" );
120+
}
121+
return elapsed;
122+
}
123+
124+
/**
125+
* Main execution sequence.
126+
*/
127+
int main( void ) {
128+
double elapsed;
129+
int i;
130+
131+
// Use the current time to seed the random number generator:
132+
srand( time( NULL ) );
133+
134+
print_version();
135+
for ( i = 0; i < REPEATS; i++ ) {
136+
printf( "# c::%s\n", NAME );
137+
elapsed = benchmark();
138+
print_results( elapsed );
139+
printf( "ok %d benchmark finished\n", i+1 );
140+
}
141+
print_summary( REPEATS, REPEATS );
142+
}

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/repl.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
The complementary error function is defined as
77

8-
erfc(x) = 1 - erf(x) = (2/√π) ∫_x^∞ exp(-t²) dt
8+
erfc(x) = 1 - erf(x) = (2/√π) ∫_x^∞ exp(-t²) dt
99

1010
Parameters
1111
----------

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;

0 commit comments

Comments
 (0)