From 47d75488aad0d1002da22db22ea6737d4a345054 Mon Sep 17 00:00:00 2001 From: hrshya Date: Wed, 2 Apr 2025 02:01:43 +0530 Subject: [PATCH 1/3] feat: add constants/float16/fourth-root-eps --- .../float16/fourth-root-eps/README.md | 77 +++++++++++++++++++ .../float16/fourth-root-eps/docs/repl.txt | 11 +++ .../fourth-root-eps/docs/types/index.d.ts | 33 ++++++++ .../fourth-root-eps/docs/types/test.ts | 28 +++++++ .../float16/fourth-root-eps/examples/index.js | 24 ++++++ .../float16/fourth-root-eps/lib/index.js | 53 +++++++++++++ .../float16/fourth-root-eps/package.json | 73 ++++++++++++++++++ .../float16/fourth-root-eps/test/test.js | 41 ++++++++++ 8 files changed, 340 insertions(+) create mode 100644 lib/node_modules/@stdlib/constants/float16/fourth-root-eps/README.md create mode 100644 lib/node_modules/@stdlib/constants/float16/fourth-root-eps/docs/repl.txt create mode 100644 lib/node_modules/@stdlib/constants/float16/fourth-root-eps/docs/types/index.d.ts create mode 100644 lib/node_modules/@stdlib/constants/float16/fourth-root-eps/docs/types/test.ts create mode 100644 lib/node_modules/@stdlib/constants/float16/fourth-root-eps/examples/index.js create mode 100644 lib/node_modules/@stdlib/constants/float16/fourth-root-eps/lib/index.js create mode 100644 lib/node_modules/@stdlib/constants/float16/fourth-root-eps/package.json create mode 100644 lib/node_modules/@stdlib/constants/float16/fourth-root-eps/test/test.js diff --git a/lib/node_modules/@stdlib/constants/float16/fourth-root-eps/README.md b/lib/node_modules/@stdlib/constants/float16/fourth-root-eps/README.md new file mode 100644 index 000000000000..3ced6016339e --- /dev/null +++ b/lib/node_modules/@stdlib/constants/float16/fourth-root-eps/README.md @@ -0,0 +1,77 @@ + + +# FLOAT16_FOURTH_ROOT_EPS + +> [Fourth root][nth-root] of [half-precision floating-point epsilon][@stdlib/constants/float16/eps]. + +
+ +## Usage + +```javascript +var FLOAT16_FOURTH_ROOT_EPS = require( '@stdlib/constants/float16/fourth-root-eps' ); +``` + +#### FLOAT16_FOURTH_ROOT_EPS + +[Fourth root][nth-root] of [half-precision floating-point epsilon][@stdlib/constants/float16/eps]. + +```javascript +var bool = ( FLOAT16_FOURTH_ROOT_EPS === 0.1767766952966369 ); +// returns true +``` + +
+ + + +
+ +## Examples + + + +```javascript +var FLOAT16_FOURTH_ROOT_EPS = require( '@stdlib/constants/float16/fourth-root-eps' ); + +var out = FLOAT16_FOURTH_ROOT_EPS; +// returns 0.1767766952966369 +``` + +
+ + + + + + + + + + + + \ No newline at end of file diff --git a/lib/node_modules/@stdlib/constants/float16/fourth-root-eps/docs/repl.txt b/lib/node_modules/@stdlib/constants/float16/fourth-root-eps/docs/repl.txt new file mode 100644 index 000000000000..e4d51e9977b6 --- /dev/null +++ b/lib/node_modules/@stdlib/constants/float16/fourth-root-eps/docs/repl.txt @@ -0,0 +1,11 @@ + +{{alias}} + Fourth root of half-precision floating-point epsilon. + + Examples + -------- + > {{alias}} + 0.1767766952966369 + + See Also + -------- diff --git a/lib/node_modules/@stdlib/constants/float16/fourth-root-eps/docs/types/index.d.ts b/lib/node_modules/@stdlib/constants/float16/fourth-root-eps/docs/types/index.d.ts new file mode 100644 index 000000000000..14da68284ad3 --- /dev/null +++ b/lib/node_modules/@stdlib/constants/float16/fourth-root-eps/docs/types/index.d.ts @@ -0,0 +1,33 @@ +/* +* @license Apache-2.0 +* +* Copyright (c) 2025 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +// TypeScript Version: 4.1 + +/** +* Fourth root of half-precision floating-point epsilon. +* +* @example +* var eps = FLOAT16_FOURTH_ROOT_EPS; +* // returns 0.1767766952966369 +*/ +declare const FLOAT16_FOURTH_ROOT_EPS: number; + + +// EXPORTS // + +export = FLOAT16_FOURTH_ROOT_EPS; \ No newline at end of file diff --git a/lib/node_modules/@stdlib/constants/float16/fourth-root-eps/docs/types/test.ts b/lib/node_modules/@stdlib/constants/float16/fourth-root-eps/docs/types/test.ts new file mode 100644 index 000000000000..31e78296ce1b --- /dev/null +++ b/lib/node_modules/@stdlib/constants/float16/fourth-root-eps/docs/types/test.ts @@ -0,0 +1,28 @@ +/* +* @license Apache-2.0 +* +* Copyright (c) 2025 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +import FLOAT16_FOURTH_ROOT_EPS = require( './index' ); + + +// TESTS // + +// The export is a number... +{ + // eslint-disable-next-line @typescript-eslint/no-unused-expressions + FLOAT16_FOURTH_ROOT_EPS; // $ExpectType number +} \ No newline at end of file diff --git a/lib/node_modules/@stdlib/constants/float16/fourth-root-eps/examples/index.js b/lib/node_modules/@stdlib/constants/float16/fourth-root-eps/examples/index.js new file mode 100644 index 000000000000..ed2c6e828862 --- /dev/null +++ b/lib/node_modules/@stdlib/constants/float16/fourth-root-eps/examples/index.js @@ -0,0 +1,24 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2025 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +var FLOAT16_FOURTH_ROOT_EPS = require( './../lib' ); + +console.log( FLOAT16_FOURTH_ROOT_EPS ); +// => 0.1767766952966369 \ No newline at end of file diff --git a/lib/node_modules/@stdlib/constants/float16/fourth-root-eps/lib/index.js b/lib/node_modules/@stdlib/constants/float16/fourth-root-eps/lib/index.js new file mode 100644 index 000000000000..2b701959271e --- /dev/null +++ b/lib/node_modules/@stdlib/constants/float16/fourth-root-eps/lib/index.js @@ -0,0 +1,53 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2025 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +/** +* Fourth root of half-precision floating-point epsilon. +* +* @module @stdlib/constants/float16/fourth-root-eps +* @type {number} +* +* @example +* var FLOAT16_FOURTH_ROOT_EPS = require( '@stdlib/constants/float16/fourth-root-eps' ); +* // returns 0.1767766952966369 +*/ + + +// MAIN // + +/** +* Fourth root of half-precision floating-point epsilon. +* +* ```tex +* \sqrt{\sqrt{\frac{1}{2^{10}}}} +* ``` +* +* @constant +* @type {number} +* @default 0.1767766952966369 +* @see [IEEE 754]{@link https://en.wikipedia.org/wiki/IEEE_754-1985} +* @see [Half-precision floating-point format]{@link https://en.wikipedia.org/wiki/Half-precision_floating-point_format} +*/ +var FLOAT16_FOURTH_ROOT_EPS = 0.1767766952966369; + + +// EXPORTS // + +module.exports = FLOAT16_FOURTH_ROOT_EPS; \ No newline at end of file diff --git a/lib/node_modules/@stdlib/constants/float16/fourth-root-eps/package.json b/lib/node_modules/@stdlib/constants/float16/fourth-root-eps/package.json new file mode 100644 index 000000000000..9c85104df2de --- /dev/null +++ b/lib/node_modules/@stdlib/constants/float16/fourth-root-eps/package.json @@ -0,0 +1,73 @@ +{ + "name": "@stdlib/constants/float16/fourth-root-eps", + "version": "0.0.0", + "description": "Fourth root of half-precision floating-point epsilon.", + "license": "Apache-2.0", + "author": { + "name": "The Stdlib Authors", + "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" + }, + "contributors": [ + { + "name": "The Stdlib Authors", + "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" + } + ], + "main": "./lib", + "directories": { + "doc": "./docs", + "example": "./examples", + "include": "./include", + "lib": "./lib", + "test": "./test" + }, + "types": "./docs/types", + "scripts": {}, + "homepage": "https://github.com/stdlib-js/stdlib", + "repository": { + "type": "git", + "url": "git://github.com/stdlib-js/stdlib.git" + }, + "bugs": { + "url": "https://github.com/stdlib-js/stdlib/issues" + }, + "dependencies": {}, + "devDependencies": {}, + "engines": { + "node": ">=0.10.0", + "npm": ">2.7.0" + }, + "os": [ + "aix", + "darwin", + "freebsd", + "linux", + "macos", + "openbsd", + "sunos", + "win32", + "windows" + ], + "keywords": [ + "stdlib", + "stdmath", + "constant", + "const", + "mathematics", + "math", + "double", + "dbl", + "floating-point", + "float", + "float16", + "16bit", + "16-bit", + "ieee754", + "epsilon", + "eps", + "number", + "sqrt", + "fourth", + "root" + ] +} \ No newline at end of file diff --git a/lib/node_modules/@stdlib/constants/float16/fourth-root-eps/test/test.js b/lib/node_modules/@stdlib/constants/float16/fourth-root-eps/test/test.js new file mode 100644 index 000000000000..0130573a5ee5 --- /dev/null +++ b/lib/node_modules/@stdlib/constants/float16/fourth-root-eps/test/test.js @@ -0,0 +1,41 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2025 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var tape = require( 'tape' ); +var pow = require( '@stdlib/math/base/special/pow' ); +var sqrt = require( '@stdlib/math/base/special/sqrt' ); +var FLOAT16_FOURTH_ROOT_EPS = require( './../lib' ); + + +// TESTS // + +tape( 'main export is a number', function test( t ) { + t.ok( true, __filename ); + t.strictEqual( typeof FLOAT16_FOURTH_ROOT_EPS, 'number', 'main export is a number' ); + t.end(); +}); + +tape( 'the exported value equals the fourth root of the difference between one and the smallest value greater than one which is representable as a double (2**-10)', function test( t ) { + var expected = sqrt( sqrt( pow( 2, -10 ) ) ); + t.equal( FLOAT16_FOURTH_ROOT_EPS, expected, 'equals sqrt( sqrt(2**-10) )' ); + t.end(); +}); \ No newline at end of file From f9ff3d2b75dedb1cd77ca5ef60e7b40ac6b40763 Mon Sep 17 00:00:00 2001 From: hrshya Date: Wed, 2 Apr 2025 02:15:19 +0530 Subject: [PATCH 2/3] fix: resolve lint issues --- .../@stdlib/constants/float16/fourth-root-eps/README.md | 3 ++- .../constants/float16/fourth-root-eps/docs/types/index.d.ts | 2 +- .../constants/float16/fourth-root-eps/docs/types/test.ts | 2 +- .../constants/float16/fourth-root-eps/examples/index.js | 2 +- .../@stdlib/constants/float16/fourth-root-eps/lib/index.js | 2 +- .../@stdlib/constants/float16/fourth-root-eps/package.json | 2 +- 6 files changed, 7 insertions(+), 6 deletions(-) diff --git a/lib/node_modules/@stdlib/constants/float16/fourth-root-eps/README.md b/lib/node_modules/@stdlib/constants/float16/fourth-root-eps/README.md index 3ced6016339e..31a28d917212 100644 --- a/lib/node_modules/@stdlib/constants/float16/fourth-root-eps/README.md +++ b/lib/node_modules/@stdlib/constants/float16/fourth-root-eps/README.md @@ -71,7 +71,8 @@ var out = FLOAT16_FOURTH_ROOT_EPS; - \ No newline at end of file + diff --git a/lib/node_modules/@stdlib/constants/float16/fourth-root-eps/docs/types/index.d.ts b/lib/node_modules/@stdlib/constants/float16/fourth-root-eps/docs/types/index.d.ts index 14da68284ad3..83a387057831 100644 --- a/lib/node_modules/@stdlib/constants/float16/fourth-root-eps/docs/types/index.d.ts +++ b/lib/node_modules/@stdlib/constants/float16/fourth-root-eps/docs/types/index.d.ts @@ -30,4 +30,4 @@ declare const FLOAT16_FOURTH_ROOT_EPS: number; // EXPORTS // -export = FLOAT16_FOURTH_ROOT_EPS; \ No newline at end of file +export = FLOAT16_FOURTH_ROOT_EPS; diff --git a/lib/node_modules/@stdlib/constants/float16/fourth-root-eps/docs/types/test.ts b/lib/node_modules/@stdlib/constants/float16/fourth-root-eps/docs/types/test.ts index 31e78296ce1b..92afae54438c 100644 --- a/lib/node_modules/@stdlib/constants/float16/fourth-root-eps/docs/types/test.ts +++ b/lib/node_modules/@stdlib/constants/float16/fourth-root-eps/docs/types/test.ts @@ -25,4 +25,4 @@ import FLOAT16_FOURTH_ROOT_EPS = require( './index' ); { // eslint-disable-next-line @typescript-eslint/no-unused-expressions FLOAT16_FOURTH_ROOT_EPS; // $ExpectType number -} \ No newline at end of file +} diff --git a/lib/node_modules/@stdlib/constants/float16/fourth-root-eps/examples/index.js b/lib/node_modules/@stdlib/constants/float16/fourth-root-eps/examples/index.js index ed2c6e828862..ea153c4c2dd0 100644 --- a/lib/node_modules/@stdlib/constants/float16/fourth-root-eps/examples/index.js +++ b/lib/node_modules/@stdlib/constants/float16/fourth-root-eps/examples/index.js @@ -21,4 +21,4 @@ var FLOAT16_FOURTH_ROOT_EPS = require( './../lib' ); console.log( FLOAT16_FOURTH_ROOT_EPS ); -// => 0.1767766952966369 \ No newline at end of file +// => 0.1767766952966369 diff --git a/lib/node_modules/@stdlib/constants/float16/fourth-root-eps/lib/index.js b/lib/node_modules/@stdlib/constants/float16/fourth-root-eps/lib/index.js index 2b701959271e..bb7e0bdd0dd9 100644 --- a/lib/node_modules/@stdlib/constants/float16/fourth-root-eps/lib/index.js +++ b/lib/node_modules/@stdlib/constants/float16/fourth-root-eps/lib/index.js @@ -50,4 +50,4 @@ var FLOAT16_FOURTH_ROOT_EPS = 0.1767766952966369; // EXPORTS // -module.exports = FLOAT16_FOURTH_ROOT_EPS; \ No newline at end of file +module.exports = FLOAT16_FOURTH_ROOT_EPS; diff --git a/lib/node_modules/@stdlib/constants/float16/fourth-root-eps/package.json b/lib/node_modules/@stdlib/constants/float16/fourth-root-eps/package.json index 9c85104df2de..feb181e8ae01 100644 --- a/lib/node_modules/@stdlib/constants/float16/fourth-root-eps/package.json +++ b/lib/node_modules/@stdlib/constants/float16/fourth-root-eps/package.json @@ -70,4 +70,4 @@ "fourth", "root" ] -} \ No newline at end of file +} From 5a08286983daaa9a3e971c029b4cba0102ad858b Mon Sep 17 00:00:00 2001 From: hrshya Date: Wed, 2 Apr 2025 02:20:48 +0530 Subject: [PATCH 3/3] fix: resolve lint issues --- .../@stdlib/constants/float16/fourth-root-eps/package.json | 1 - .../@stdlib/constants/float16/fourth-root-eps/test/test.js | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/node_modules/@stdlib/constants/float16/fourth-root-eps/package.json b/lib/node_modules/@stdlib/constants/float16/fourth-root-eps/package.json index feb181e8ae01..55938560e983 100644 --- a/lib/node_modules/@stdlib/constants/float16/fourth-root-eps/package.json +++ b/lib/node_modules/@stdlib/constants/float16/fourth-root-eps/package.json @@ -17,7 +17,6 @@ "directories": { "doc": "./docs", "example": "./examples", - "include": "./include", "lib": "./lib", "test": "./test" }, diff --git a/lib/node_modules/@stdlib/constants/float16/fourth-root-eps/test/test.js b/lib/node_modules/@stdlib/constants/float16/fourth-root-eps/test/test.js index 0130573a5ee5..d9de55746ede 100644 --- a/lib/node_modules/@stdlib/constants/float16/fourth-root-eps/test/test.js +++ b/lib/node_modules/@stdlib/constants/float16/fourth-root-eps/test/test.js @@ -38,4 +38,4 @@ tape( 'the exported value equals the fourth root of the difference between one a var expected = sqrt( sqrt( pow( 2, -10 ) ) ); t.equal( FLOAT16_FOURTH_ROOT_EPS, expected, 'equals sqrt( sqrt(2**-10) )' ); t.end(); -}); \ No newline at end of file +});