diff --git a/lib/node_modules/@stdlib/constants/float32/fourth-root-eps/README.md b/lib/node_modules/@stdlib/constants/float32/fourth-root-eps/README.md new file mode 100644 index 000000000000..75d7d0da1438 --- /dev/null +++ b/lib/node_modules/@stdlib/constants/float32/fourth-root-eps/README.md @@ -0,0 +1,135 @@ + + +# FLOAT32_FOURTH_ROOT_EPS + +> [Fourth root][nth-root] of [single-precision floating-point epsilon][@stdlib/constants/float32/eps]. + +
+ +## Usage + +```javascript +var FLOAT32_FOURTH_ROOT_EPS = require( '@stdlib/constants/float32/fourth-root-eps' ); +``` + +#### FLOAT32_FOURTH_ROOT_EPS + +[Fourth root][nth-root] of [single-precision floating-point epsilon][@stdlib/constants/float32/eps]. + +```javascript +var bool = ( FLOAT32_FOURTH_ROOT_EPS === 0.018581360578536987 ); +// returns true +``` + +
+ + + +
+ +## Examples + + + +```javascript +var FLOAT32_FOURTH_ROOT_EPS = require( '@stdlib/constants/float32/fourth-root-eps' ); + +var out = FLOAT32_FOURTH_ROOT_EPS; +// returns 0.018581360578536987 +``` + +
+ + + + + +* * * + +
+ +## C APIs + + + +
+ +
+ + + + + +
+ +### Usage + +```c +#include "stdlib/constants/float32/fourth_root_eps.h" +``` + +#### STDLIB_CONSTANT_FLOAT32_FOURTH_ROOT_EPS + +Macro for the [fourth root][nth-root] of [single-precision floating-point epsilon][@stdlib/constants/float32/eps]. + +
+ + + + + +
+ +
+ + + + + +
+ +
+ + + +
+ + + + + + + + + + + + + + diff --git a/lib/node_modules/@stdlib/constants/float32/fourth-root-eps/docs/repl.txt b/lib/node_modules/@stdlib/constants/float32/fourth-root-eps/docs/repl.txt new file mode 100644 index 000000000000..1951282b3393 --- /dev/null +++ b/lib/node_modules/@stdlib/constants/float32/fourth-root-eps/docs/repl.txt @@ -0,0 +1,11 @@ + +{{alias}} + Fourth root of single-precision floating-point epsilon. + + Examples + -------- + > {{alias}} + 0.018581360578536987 + + See Also + -------- diff --git a/lib/node_modules/@stdlib/constants/float32/fourth-root-eps/docs/types/index.d.ts b/lib/node_modules/@stdlib/constants/float32/fourth-root-eps/docs/types/index.d.ts new file mode 100644 index 000000000000..c763b13fb8fb --- /dev/null +++ b/lib/node_modules/@stdlib/constants/float32/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 single-precision floating-point epsilon. +* +* @example +* var eps = FLOAT32_FOURTH_ROOT_EPS; +* // returns 0.018581360578536987 +*/ +declare const FLOAT32_FOURTH_ROOT_EPS: number; + + +// EXPORTS // + +export = FLOAT32_FOURTH_ROOT_EPS; diff --git a/lib/node_modules/@stdlib/constants/float32/fourth-root-eps/docs/types/test.ts b/lib/node_modules/@stdlib/constants/float32/fourth-root-eps/docs/types/test.ts new file mode 100644 index 000000000000..d2fb2bcf6072 --- /dev/null +++ b/lib/node_modules/@stdlib/constants/float32/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 FLOAT32_FOURTH_ROOT_EPS = require( './index' ); + + +// TESTS // + +// The export is a number... +{ + // eslint-disable-next-line @typescript-eslint/no-unused-expressions + FLOAT32_FOURTH_ROOT_EPS; // $ExpectType number +} diff --git a/lib/node_modules/@stdlib/constants/float32/fourth-root-eps/examples/index.js b/lib/node_modules/@stdlib/constants/float32/fourth-root-eps/examples/index.js new file mode 100644 index 000000000000..4c934f4cd3a6 --- /dev/null +++ b/lib/node_modules/@stdlib/constants/float32/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 FLOAT32_FOURTH_ROOT_EPS = require( './../lib' ); + +console.log( FLOAT32_FOURTH_ROOT_EPS ); +// => 0.018581360578536987 diff --git a/lib/node_modules/@stdlib/constants/float32/fourth-root-eps/include/stdlib/constants/float32/fourth_root_eps.h b/lib/node_modules/@stdlib/constants/float32/fourth-root-eps/include/stdlib/constants/float32/fourth_root_eps.h new file mode 100644 index 000000000000..a27df0ee4d5f --- /dev/null +++ b/lib/node_modules/@stdlib/constants/float32/fourth-root-eps/include/stdlib/constants/float32/fourth_root_eps.h @@ -0,0 +1,27 @@ +/** +* @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. +*/ + +#ifndef STDLIB_CONSTANTS_FLOAT32_FOURTH_ROOT_EPS_H +#define STDLIB_CONSTANTS_FLOAT32_FOURTH_ROOT_EPS_H + +/** +* Macro for the fourth root of single-precision floating-point epsilon. +*/ +#define STDLIB_CONSTANT_FLOAT32_FOURTH_ROOT_EPS 0.018581360578536987f + +#endif // !STDLIB_CONSTANTS_FLOAT32_FOURTH_ROOT_EPS_H diff --git a/lib/node_modules/@stdlib/constants/float32/fourth-root-eps/lib/index.js b/lib/node_modules/@stdlib/constants/float32/fourth-root-eps/lib/index.js new file mode 100644 index 000000000000..6fadd764189c --- /dev/null +++ b/lib/node_modules/@stdlib/constants/float32/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 single-precision floating-point epsilon. +* +* @module @stdlib/constants/float32/fourth-root-eps +* @type {number} +* +* @example +* var FLOAT32_FOURTH_ROOT_EPS = require( '@stdlib/constants/float32/fourth-root-eps' ); +* // returns 0.018581360578536987 +*/ + + +// MAIN // + +/** +* Fourth root of single-precision floating-point epsilon. +* +* ```tex +* \sqrt{\sqrt{\frac{1}{2^{23}}}} +* ``` +* +* @constant +* @type {number} +* @default 0.018581360578536987 +* @see [IEEE 754]{@link https://en.wikipedia.org/wiki/IEEE_754-1985} +* @see [Machine Epsilon]{@link https://en.wikipedia.org/wiki/Machine_epsilon} +*/ +var FLOAT32_FOURTH_ROOT_EPS = 0.018581360578536987; + + +// EXPORTS // + +module.exports = FLOAT32_FOURTH_ROOT_EPS; diff --git a/lib/node_modules/@stdlib/constants/float32/fourth-root-eps/manifest.json b/lib/node_modules/@stdlib/constants/float32/fourth-root-eps/manifest.json new file mode 100644 index 000000000000..844d692f6439 --- /dev/null +++ b/lib/node_modules/@stdlib/constants/float32/fourth-root-eps/manifest.json @@ -0,0 +1,36 @@ +{ + "options": {}, + "fields": [ + { + "field": "src", + "resolve": true, + "relative": true + }, + { + "field": "include", + "resolve": true, + "relative": true + }, + { + "field": "libraries", + "resolve": false, + "relative": false + }, + { + "field": "libpath", + "resolve": true, + "relative": false + } + ], + "confs": [ + { + "src": [], + "include": [ + "./include" + ], + "libraries": [], + "libpath": [], + "dependencies": [] + } + ] +} diff --git a/lib/node_modules/@stdlib/constants/float32/fourth-root-eps/package.json b/lib/node_modules/@stdlib/constants/float32/fourth-root-eps/package.json new file mode 100644 index 000000000000..8acb4c92caeb --- /dev/null +++ b/lib/node_modules/@stdlib/constants/float32/fourth-root-eps/package.json @@ -0,0 +1,72 @@ +{ + "name": "@stdlib/constants/float32/fourth-root-eps", + "version": "0.0.0", + "description": "Fourth root of single-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", + "dbl", + "floating-point", + "float", + "float32", + "32bit", + "32-bit", + "ieee754", + "epsilon", + "eps", + "number", + "sqrt", + "fourth", + "root" + ] +} diff --git a/lib/node_modules/@stdlib/constants/float32/fourth-root-eps/test/test.js b/lib/node_modules/@stdlib/constants/float32/fourth-root-eps/test/test.js new file mode 100644 index 000000000000..2d881b5a4e27 --- /dev/null +++ b/lib/node_modules/@stdlib/constants/float32/fourth-root-eps/test/test.js @@ -0,0 +1,42 @@ +/** +* @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 sqrtf = require( '@stdlib/math/base/special/sqrtf' ); +var float64ToFloat32 = require( '@stdlib/number/float64/base/to-float32' ); +var FLOAT32_FOURTH_ROOT_EPS = require( './../lib' ); + + +// TESTS // + +tape( 'main export is a number', function test( t ) { + t.ok( true, __filename ); + t.strictEqual( typeof FLOAT32_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 float (2**-23)', function test( t ) { + var expected = sqrtf( sqrtf( float64ToFloat32( pow( 2, -23 ) ) ) ); + t.equal( FLOAT32_FOURTH_ROOT_EPS, expected, 'equals sqrtf( sqrtf(2**-23) )' ); + t.end(); +});