Skip to content

Commit da1a8a8

Browse files
committed
Merge branch 'develop' of https://github.com/stdlib-js/stdlib into develop
2 parents ad7c705 + 14a166d commit da1a8a8

File tree

95 files changed

+276
-188
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

95 files changed

+276
-188
lines changed

lib/node_modules/@stdlib/math/base/special/ceiln/manifest.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
"@stdlib/math/base/napi/binary",
4242
"@stdlib/math/base/special/abs",
4343
"@stdlib/math/base/special/ceil",
44+
"@stdlib/math/base/special/pow",
4445
"@stdlib/math/base/assert/is-nan",
4546
"@stdlib/math/base/assert/is-infinite",
4647
"@stdlib/constants/float64/max-base10-exponent",
@@ -65,6 +66,7 @@
6566
"dependencies": [
6667
"@stdlib/math/base/special/abs",
6768
"@stdlib/math/base/special/ceil",
69+
"@stdlib/math/base/special/pow",
6870
"@stdlib/math/base/assert/is-nan",
6971
"@stdlib/math/base/assert/is-infinite",
7072
"@stdlib/constants/float64/max-base10-exponent",
@@ -89,6 +91,7 @@
8991
"dependencies": [
9092
"@stdlib/math/base/special/abs",
9193
"@stdlib/math/base/special/ceil",
94+
"@stdlib/math/base/special/pow",
9295
"@stdlib/math/base/assert/is-nan",
9396
"@stdlib/math/base/assert/is-infinite",
9497
"@stdlib/constants/float64/max-base10-exponent",

lib/node_modules/@stdlib/math/base/special/ceiln/src/ceiln.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
#include "stdlib/math/base/special/ceiln.h"
2020
#include "stdlib/math/base/special/ceil.h"
2121
#include "stdlib/math/base/special/abs.h"
22+
#include "stdlib/math/base/special/pow.h"
2223
#include "stdlib/math/base/assert/is_nan.h"
2324
#include "stdlib/math/base/assert/is_infinite.h"
2425
#include "stdlib/constants/float64/max_base10_exponent.h"
@@ -27,7 +28,6 @@
2728
#include "stdlib/constants/float64/max_safe_integer.h"
2829
#include "stdlib/constants/float64/pinf.h"
2930
#include <stdint.h>
30-
#include <math.h>
3131

3232

3333
// VARIABLES //
@@ -90,14 +90,14 @@ double stdlib_base_ceiln( const double x, const int32_t n ) {
9090
}
9191
// If we overflow, return `x`, as the number of digits to the right of the decimal is too small (i.e., `x` is too large / lacks sufficient fractional precision) for there to be any effect when rounding...
9292
if ( n < STDLIB_CONSTANT_FLOAT64_MIN_BASE10_EXPONENT ) {
93-
s = pow( 10.0, -( n + STDLIB_CONSTANT_FLOAT64_MAX_BASE10_EXPONENT ) ); // TODO: replace use of `pow` once have stdlib equivalent
93+
s = stdlib_base_pow( 10.0, -( n + STDLIB_CONSTANT_FLOAT64_MAX_BASE10_EXPONENT ) );
9494
y = ( x * HUGE_VALUE ) * s; // order of operation matters!
9595
if ( stdlib_base_is_infinite( y ) ) {
9696
return x;
9797
}
9898
return ( stdlib_base_ceil( y ) / HUGE_VALUE ) / s;
9999
}
100-
s = pow( 10.0, -n ); // TODO: replace use of `pow` once have stdlib equivalent
100+
s = stdlib_base_pow( 10.0, -n );
101101
y = x * s;
102102
if ( stdlib_base_is_infinite( y ) ) {
103103
return x;
Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
/**
2+
* @license Apache-2.0
3+
*
4+
* Copyright (c) 2025 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+
* This script compiles modules for evaluating polynomial functions. If any polynomial coefficients change, this script should be rerun to update the compiled files.
21+
*/
22+
'use strict';
23+
24+
// MODULES //
25+
26+
var resolve = require( 'path' ).resolve;
27+
var writeFileSync = require( '@stdlib/fs/write-file' ).sync;
28+
var currentYear = require( '@stdlib/time/current-year' );
29+
var licenseHeader = require( '@stdlib/_tools/licenses/header' );
30+
var compile = require( '@stdlib/math/base/tools/evalpoly-compile' );
31+
32+
33+
// VARIABLES //
34+
35+
// Polynomial coefficients ordered in ascending degree...
36+
var SIN_COEF = [
37+
-1.66666666666666307295e-1, // 0xbfc5555555555548
38+
8.33333333332211858878e-3, // 0x3f8111111110f7d0
39+
-1.98412698295895385996e-4, // 0xbf2a01a019bfdf03
40+
2.75573136213857245213e-6, // 0x3ec71de3567d48a1
41+
-2.50507477628578072866e-8, // 0xbe5ae5e5a9291f5d
42+
1.58962301576546568060e-10 // 0x3de5d8fd1fd19ccd
43+
];
44+
var COS_COEF = [
45+
4.16666666666665929218e-2, // 0x3fa555555555554b
46+
-1.38888888888730564116e-3, // 0xbf56c16c16c14f91
47+
2.48015872888517045348e-5, // 0x3efa01a019c844f5
48+
-2.75573141792967388112e-7, // 0xbe927e4f7eac4bc6
49+
2.08757008419747316778e-9, // 0x3e21ee9d7b4e3f05
50+
-1.13585365213876817300e-11 // 0xbda8fa49a0861a9b
51+
];
52+
53+
// Header to add to output files:
54+
var header = licenseHeader( 'Apache-2.0', 'js', {
55+
'year': currentYear(),
56+
'copyright': 'The Stdlib Authors'
57+
});
58+
header += '\n/* This is a generated file. Do not edit directly. */\n';
59+
60+
61+
// MAIN //
62+
63+
/**
64+
* Main execution sequence.
65+
*
66+
* @private
67+
*/
68+
function main() {
69+
var fpath;
70+
var opts;
71+
var str;
72+
73+
opts = {
74+
'encoding': 'utf8'
75+
};
76+
77+
fpath = resolve( __dirname, 'polyval_sin.js' );
78+
str = header + compile( SIN_COEF );
79+
writeFileSync( fpath, str, opts );
80+
81+
fpath = resolve( __dirname, 'polyval_cos.js' );
82+
str = header + compile( COS_COEF );
83+
writeFileSync( fpath, str, opts );
84+
}
85+
86+
main();

lib/node_modules/@stdlib/math/base/special/cos/scripts/cephes/index.js

Lines changed: 2 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,12 @@
3434

3535
// MODULES //
3636

37-
var evalpoly = require( '@stdlib/math/base/tools/evalpoly' ).factory; // TODO: replace with compiled polyval functions
3837
var floor = require( '@stdlib/math/base/special/floor' );
3938
var ldexp = require( '@stdlib/math/base/special/ldexp' );
4039
var isnan = require( '@stdlib/math/base/assert/is-nan' );
4140
var isinfinite = require( '@stdlib/math/base/assert/is-infinite' );
41+
var polyvalSIN = require( './polyval_sin.js' );
42+
var polyvalCOS = require( './polyval_cos.js' );
4243

4344

4445
// VARIABLES //
@@ -47,29 +48,6 @@ var DP1 = 7.85398125648498535156e-1; // 0x3fe921fb40000000, Pi/4 split into thre
4748
var DP2 = 3.77489470793079817668e-8; // 0x3e64442d00000000,
4849
var DP3 = 2.69515142907905952645e-15; // 0x3ce8469898cc5170,
4950
var PIO4 = 7.85398163397448309616E-1; // 4/pi
50-
var SIN_COEF = [
51-
-1.66666666666666307295e-1, // 0xbfc5555555555548
52-
8.33333333332211858878e-3, // 0x3f8111111110f7d0
53-
-1.98412698295895385996e-4, // 0xbf2a01a019bfdf03
54-
2.75573136213857245213e-6, // 0x3ec71de3567d48a1
55-
-2.50507477628578072866e-8, // 0xbe5ae5e5a9291f5d
56-
1.58962301576546568060e-10 // 0x3de5d8fd1fd19ccd
57-
];
58-
var COS_COEF = [
59-
4.16666666666665929218e-2, // 0x3fa555555555554b
60-
-1.38888888888730564116e-3, // 0xbf56c16c16c14f91
61-
2.48015872888517045348e-5, // 0x3efa01a019c844f5
62-
-2.75573141792967388112e-7, // 0xbe927e4f7eac4bc6
63-
2.08757008419747316778e-9, // 0x3e21ee9d7b4e3f05
64-
-1.13585365213876817300e-11 // 0xbda8fa49a0861a9b
65-
];
66-
67-
68-
// FUNCTIONS //
69-
70-
// Compile functions to evaluate polynomial functions based on the above coefficients...
71-
var polyvalSIN = evalpoly( SIN_COEF );
72-
var polyvalCOS = evalpoly( COS_COEF );
7351

7452

7553
// MAIN //
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
/**
2+
* @license Apache-2.0
3+
*
4+
* Copyright (c) 2025 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+
/* This is a generated file. Do not edit directly. */
20+
'use strict';
21+
22+
// MAIN //
23+
24+
/**
25+
* Evaluates a polynomial.
26+
*
27+
* ## Notes
28+
*
29+
* - The implementation uses [Horner's rule][horners-method] for efficient computation.
30+
*
31+
* [horners-method]: https://en.wikipedia.org/wiki/Horner%27s_method
32+
*
33+
* @private
34+
* @param {number} x - value at which to evaluate the polynomial
35+
* @returns {number} evaluated polynomial
36+
*/
37+
function evalpoly( x ) {
38+
if ( x === 0.0 ) {
39+
return 0.041666666666666595;
40+
}
41+
return 0.041666666666666595 + (x * (-0.0013888888888873056 + (x * (0.000024801587288851704 + (x * (-2.755731417929674e-7 + (x * (2.087570084197473e-9 + (x * -1.1358536521387682e-11))))))))); // eslint-disable-line max-len
42+
}
43+
44+
45+
// EXPORTS //
46+
47+
module.exports = evalpoly;
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
/**
2+
* @license Apache-2.0
3+
*
4+
* Copyright (c) 2025 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+
/* This is a generated file. Do not edit directly. */
20+
'use strict';
21+
22+
// MAIN //
23+
24+
/**
25+
* Evaluates a polynomial.
26+
*
27+
* ## Notes
28+
*
29+
* - The implementation uses [Horner's rule][horners-method] for efficient computation.
30+
*
31+
* [horners-method]: https://en.wikipedia.org/wiki/Horner%27s_method
32+
*
33+
* @private
34+
* @param {number} x - value at which to evaluate the polynomial
35+
* @returns {number} evaluated polynomial
36+
*/
37+
function evalpoly( x ) {
38+
if ( x === 0.0 ) {
39+
return -0.1666666666666663;
40+
}
41+
return -0.1666666666666663 + (x * (0.008333333333322118 + (x * (-0.0001984126982958954 + (x * (0.0000027557313621385722 + (x * (-2.5050747762857807e-8 + (x * 1.5896230157654656e-10))))))))); // eslint-disable-line max-len
42+
}
43+
44+
45+
// EXPORTS //
46+
47+
module.exports = evalpoly;

lib/node_modules/@stdlib/namespace/lib/namespace/base/strided/d.js

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -567,7 +567,7 @@ ns.push({
567567
'type': 'Function',
568568
'related': [
569569
'@stdlib/stats/base/dmean',
570-
'@stdlib/stats/base/dnanmeanpn',
570+
'@stdlib/stats/strided/dnanmeanpn',
571571
'@stdlib/stats/base/meanpn',
572572
'@stdlib/stats/base/smeanpn'
573573
]
@@ -697,7 +697,7 @@ ns.push({
697697
'type': 'Function',
698698
'related': [
699699
'@stdlib/stats/strided/dmax',
700-
'@stdlib/stats/base/dnanmin',
700+
'@stdlib/stats/strided/dnanmin',
701701
'@stdlib/stats/base/min',
702702
'@stdlib/stats/base/smin'
703703
]
@@ -882,7 +882,7 @@ ns.push({
882882
'related': [
883883
'@stdlib/stats/strided/dmin',
884884
'@stdlib/stats/base/dmskmax',
885-
'@stdlib/stats/base/dnanmin',
885+
'@stdlib/stats/strided/dnanmin',
886886
'@stdlib/stats/base/dnanmskmin',
887887
'@stdlib/stats/base/mskmin',
888888
'@stdlib/stats/base/smskmin'
@@ -997,7 +997,7 @@ ns.push({
997997
'type': 'Function',
998998
'related': [
999999
'@stdlib/stats/strided/dmax',
1000-
'@stdlib/stats/base/dnanmin',
1000+
'@stdlib/stats/strided/dnanmin',
10011001
'@stdlib/stats/base/nanmax',
10021002
'@stdlib/stats/base/snanmax'
10031003
]
@@ -1044,8 +1044,8 @@ ns.push({
10441044

10451045
ns.push({
10461046
'alias': 'base.strided.dnanmeanpn',
1047-
'path': '@stdlib/stats/base/dnanmeanpn',
1048-
'value': require( '@stdlib/stats/base/dnanmeanpn' ),
1047+
'path': '@stdlib/stats/strided/dnanmeanpn',
1048+
'value': require( '@stdlib/stats/strided/dnanmeanpn' ),
10491049
'type': 'Function',
10501050
'related': [
10511051
'@stdlib/stats/base/dmeanpn',
@@ -1083,8 +1083,8 @@ ns.push({
10831083

10841084
ns.push({
10851085
'alias': 'base.strided.dnanmin',
1086-
'path': '@stdlib/stats/base/dnanmin',
1087-
'value': require( '@stdlib/stats/base/dnanmin' ),
1086+
'path': '@stdlib/stats/strided/dnanmin',
1087+
'value': require( '@stdlib/stats/strided/dnanmin' ),
10881088
'type': 'Function',
10891089
'related': [
10901090
'@stdlib/stats/strided/dmin',
@@ -1102,7 +1102,7 @@ ns.push({
11021102
'related': [
11031103
'@stdlib/stats/strided/dminabs',
11041104
'@stdlib/stats/strided/dnanmaxabs',
1105-
'@stdlib/stats/base/dnanmin',
1105+
'@stdlib/stats/strided/dnanmin',
11061106
'@stdlib/stats/base/nanminabs',
11071107
'@stdlib/stats/base/snanminabs'
11081108
]
@@ -1129,7 +1129,7 @@ ns.push({
11291129
'type': 'Function',
11301130
'related': [
11311131
'@stdlib/stats/base/dmskmin',
1132-
'@stdlib/stats/base/dnanmin',
1132+
'@stdlib/stats/strided/dnanmin',
11331133
'@stdlib/stats/base/dnanmskmax',
11341134
'@stdlib/stats/base/nanmskmin',
11351135
'@stdlib/stats/base/snanmskmin'
@@ -1235,7 +1235,7 @@ ns.push({
12351235
'type': 'Function',
12361236
'related': [
12371237
'@stdlib/stats/strided/dnanmax',
1238-
'@stdlib/stats/base/dnanmin',
1238+
'@stdlib/stats/strided/dnanmin',
12391239
'@stdlib/stats/base/drange',
12401240
'@stdlib/stats/base/nanrange',
12411241
'@stdlib/stats/base/snanrange'
@@ -1779,7 +1779,7 @@ ns.push({
17791779
'value': require( '@stdlib/stats/base/dsnanmeanpn' ),
17801780
'type': 'Function',
17811781
'related': [
1782-
'@stdlib/stats/base/dnanmeanpn',
1782+
'@stdlib/stats/strided/dnanmeanpn',
17831783
'@stdlib/stats/base/dsmeanpn',
17841784
'@stdlib/stats/base/dsnanmean',
17851785
'@stdlib/stats/base/nanmeanpn',

0 commit comments

Comments
 (0)