Skip to content

Commit 40e80dd

Browse files
committed
fix: fixed minor change in kernel file of rempio2f
--- 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: na - 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: na - task: lint_javascript_tests status: na - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: passed - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: na - task: lint_typescript_tests status: na - task: lint_license_headers status: passed ---
1 parent eee9832 commit 40e80dd

File tree

2 files changed

+11
-9
lines changed

2 files changed

+11
-9
lines changed

lib/node_modules/@stdlib/math/base/special/rempio2f/lib/kernel_rempio2f.js

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -42,13 +42,15 @@ var zeros = require( '@stdlib/array/base/zeros' );
4242

4343
// Table of constants for 2/π (first few terms for single precision):
4444
var IPIO2 = [
45-
0xA2F983, 0x6E4E44, 0x1529FC, 0x2757D1
45+
0xA2F983, 0x6E4E44, 0x1529FC, 0x2757D1, 0xF534DD, 0xC0DB62, 0x95993C, 0xD8B3D3, 0x4A9D0D
4646
];
4747

4848
// π/2 for single precision (24-bit precision):
4949
var PIO2 = [
50-
1.570796326, // 0x3fc90fda
51-
4.960468e-8 // 0x33522168
50+
1.570796251, // 0x3fc90fda
51+
4.960468e-8, // 0x33522168
52+
2.5893025e-8, // 0x32d849ba
53+
1.9539925e-11 // 0x2f2e71d2
5254
];
5355
var TWO24 = 1.6777216e7; // 0x4b800000
5456
var TWON24 = 5.9604645e-8; // 0x33800000
@@ -87,8 +89,8 @@ function compute( x, y, jz, q, q0, jk, jv, jx, f ) {
8789
var j;
8890
var z;
8991

90-
// Number of terms in PIO2 (2 for single precision):
91-
jp = PIO2.length - 1; // 1 (0-based index)
92+
// `jp+1` is the number of terms in `PIO2[]` needed:
93+
jp = jk;
9294

9395
// Distill `q[]` into `IQ[]` in reverse order...
9496
z = q[jz];
@@ -187,7 +189,7 @@ function compute( x, y, jz, q, q0, jk, jv, jx, f ) {
187189
* @private
188190
* @param {Array<number>} x - input value array
189191
* @param {(Array|TypedArray|Object)} y - remainder array (single value)
190-
* @param {PositiveInteger} e0 - the exponent of `x[0]` (must be <= 16360)
192+
* @param {PositiveInteger} e0 - the exponent of `x[0]` (must be <= 127)
191193
* @param {PositiveInteger} nx - dimension of `x[]`
192194
* @returns {number} last three binary digits of `N`
193195
*/
@@ -203,7 +205,7 @@ function kernelRempio2f( x, y, e0, nx ) {
203205
var m;
204206

205207
// Initialize `jk` for single-precision:
206-
jk = IPIO2.length - 1; // 3 (0-based index)
208+
jk = 3;
207209

208210
// Determine `jx`, `jv`, `q0`:
209211
jx = nx - 1;

lib/node_modules/@stdlib/math/base/special/rempio2f/src/main.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,9 @@ static const int32_t EXPONENT_MASK = 0x7f800000; // Exponent mask (0x7f8
5959
// Table of constants for `2/π` (96 hex digits, 115 decimal):
6060
// Integer array containing the (24*i)-th to (24*i+23)-th bit of `2/π` after the binary point.
6161
// The corresponding floating value is `IPIO2[i] * 2^(-24(i+1))`.
62-
// For single precision (e0 <= 8188, jk = 3), this table has sufficient terms.
62+
// For single precision (e0 <= 127, jk = 3), this table has sufficient terms.
6363
static const int32_t IPIO2[] = {
64-
0xA2F983, 0x6E4E44, 0x1529FC, 0x2757D1
64+
0xA2F983, 0x6E4E44, 0x1529FC, 0x2757D1, 0xF534DD, 0xC0DB62, 0x95993C, 0xD8B3D3, 0x4A9D0D
6565
};
6666

6767
/**

0 commit comments

Comments
 (0)