From 3044d0c0ba0a5549274e9317f1d9ed16d9413b5b Mon Sep 17 00:00:00 2001 From: Neerajpathak07 Date: Sun, 16 Mar 2025 18:01:40 +0530 Subject: [PATCH 1/3] add-gamma-lanczos-sumf --- .../float32/gamma-lanczos-g/README.md | 153 ++++++++++++++++++ .../float32/gamma-lanczos-g/docs/repl.txt | 12 ++ .../gamma-lanczos-g/docs/types/index.d.ts | 33 ++++ .../gamma-lanczos-g/docs/types/test.ts | 28 ++++ .../float32/gamma-lanczos-g/examples/index.js | 24 +++ .../constants/float32/gamma_lanczos_g.h | 27 ++++ .../float32/gamma-lanczos-g/lib/index.js | 52 ++++++ .../float32/gamma-lanczos-g/manifest.json | 36 +++++ .../float32/gamma-lanczos-g/package.json | 71 ++++++++ .../float32/gamma-lanczos-g/test/test.js | 39 +++++ 10 files changed, 475 insertions(+) create mode 100644 lib/node_modules/@stdlib/constants/float32/gamma-lanczos-g/README.md create mode 100644 lib/node_modules/@stdlib/constants/float32/gamma-lanczos-g/docs/repl.txt create mode 100644 lib/node_modules/@stdlib/constants/float32/gamma-lanczos-g/docs/types/index.d.ts create mode 100644 lib/node_modules/@stdlib/constants/float32/gamma-lanczos-g/docs/types/test.ts create mode 100644 lib/node_modules/@stdlib/constants/float32/gamma-lanczos-g/examples/index.js create mode 100644 lib/node_modules/@stdlib/constants/float32/gamma-lanczos-g/include/stdlib/constants/float32/gamma_lanczos_g.h create mode 100644 lib/node_modules/@stdlib/constants/float32/gamma-lanczos-g/lib/index.js create mode 100644 lib/node_modules/@stdlib/constants/float32/gamma-lanczos-g/manifest.json create mode 100644 lib/node_modules/@stdlib/constants/float32/gamma-lanczos-g/package.json create mode 100644 lib/node_modules/@stdlib/constants/float32/gamma-lanczos-g/test/test.js diff --git a/lib/node_modules/@stdlib/constants/float32/gamma-lanczos-g/README.md b/lib/node_modules/@stdlib/constants/float32/gamma-lanczos-g/README.md new file mode 100644 index 000000000000..dd6f23c0161d --- /dev/null +++ b/lib/node_modules/@stdlib/constants/float32/gamma-lanczos-g/README.md @@ -0,0 +1,153 @@ + + +# FLOAT32_GAMMA_LANCZOS_G + +> Arbitrary constant `g` to be used in Lanczos approximation functions. + +
+ +
+ + + +
+ +## Usage + +```javascript +var FLOAT32_GAMMA_LANCZOS_G = require( '@stdlib/constants/float32/gamma-lanczos-g' ); +``` + +#### FLOAT32_GAMMA_LANCZOS_G + +Arbitrary constant `g` to be used in [Lanczos approximation][lanczos-approximation] functions. + +```javascript +var bool = ( FLOAT32_GAMMA_LANCZOS_G === 10.900510787963867 ); +// returns true +``` + +
+ + + +
+ +## Examples + + + +```javascript +var FLOAT32_GAMMA_LANCZOS_G = require( '@stdlib/constants/float32/gamma-lanczos-g' ); + +console.log( FLOAT32_GAMMA_LANCZOS_G ); +// => 10.900510787963867 +``` + +
+ + + + + +* * * + +
+ +## C APIs + + + +
+ +
+ + + + + +
+ +### Usage + +```c +#include "stdlib/constants/float32/gamma_lanczos_g.h" +``` + +#### STDLIB_CONSTANT_FLOAT32_GAMMA_LANCZOS_G + +Macro for the arbitrary constant `g` to be used in [Lanczos approximation][lanczos-approximation] functions. + +
+ + + + + +
+ +
+ + + + + +
+ +
+ + + +
+ + + +* * * + +
+ +## References + +- Pugh, Glendon R. 2004. "An analysis of the Lanczos gamma approximation." PhD thesis, University of British Columbia. [<https://web.viu.ca/pughg/phdThesis/phdThesis.pdf>][@pugh:2004a]. + +
+ + + + + + + + + + + + + + diff --git a/lib/node_modules/@stdlib/constants/float32/gamma-lanczos-g/docs/repl.txt b/lib/node_modules/@stdlib/constants/float32/gamma-lanczos-g/docs/repl.txt new file mode 100644 index 000000000000..cac51d707dbd --- /dev/null +++ b/lib/node_modules/@stdlib/constants/float32/gamma-lanczos-g/docs/repl.txt @@ -0,0 +1,12 @@ + +{{alias}} + Arbitrary constant `g` to be used in Lanczos approximation functions. + + Examples + -------- + > {{alias}} + 10.900510787963867 + + See Also + -------- + diff --git a/lib/node_modules/@stdlib/constants/float32/gamma-lanczos-g/docs/types/index.d.ts b/lib/node_modules/@stdlib/constants/float32/gamma-lanczos-g/docs/types/index.d.ts new file mode 100644 index 000000000000..87254cb623a5 --- /dev/null +++ b/lib/node_modules/@stdlib/constants/float32/gamma-lanczos-g/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 + +/** +* Arbitrary constant `g` to be used in Lanczos approximation functions. +* +* @example +* var g = FLOAT32_GAMMA_LANCZOS_G; +* // returns 10.900510787963867 +*/ +declare const FLOAT32_GAMMA_LANCZOS_G: number; + + +// EXPORTS // + +export = FLOAT32_GAMMA_LANCZOS_G; diff --git a/lib/node_modules/@stdlib/constants/float32/gamma-lanczos-g/docs/types/test.ts b/lib/node_modules/@stdlib/constants/float32/gamma-lanczos-g/docs/types/test.ts new file mode 100644 index 000000000000..17f7105b216d --- /dev/null +++ b/lib/node_modules/@stdlib/constants/float32/gamma-lanczos-g/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_GAMMA_LANCZOS_G = require( './index' ); + + +// TESTS // + +// The export is a number... +{ + // eslint-disable-next-line @typescript-eslint/no-unused-expressions + FLOAT32_GAMMA_LANCZOS_G; // $ExpectType number +} diff --git a/lib/node_modules/@stdlib/constants/float32/gamma-lanczos-g/examples/index.js b/lib/node_modules/@stdlib/constants/float32/gamma-lanczos-g/examples/index.js new file mode 100644 index 000000000000..10bc21015bd4 --- /dev/null +++ b/lib/node_modules/@stdlib/constants/float32/gamma-lanczos-g/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_GAMMA_LANCZOS_G = require( './../lib' ); + +console.log( FLOAT32_GAMMA_LANCZOS_G ); +// => 10.900510787963867 diff --git a/lib/node_modules/@stdlib/constants/float32/gamma-lanczos-g/include/stdlib/constants/float32/gamma_lanczos_g.h b/lib/node_modules/@stdlib/constants/float32/gamma-lanczos-g/include/stdlib/constants/float32/gamma_lanczos_g.h new file mode 100644 index 000000000000..5d072a8e1e6a --- /dev/null +++ b/lib/node_modules/@stdlib/constants/float32/gamma-lanczos-g/include/stdlib/constants/float32/gamma_lanczos_g.h @@ -0,0 +1,27 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2022 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_GAMMA_LANCZOS_G_H +#define STDLIB_CONSTANTS_FLOAT32_GAMMA_LANCZOS_G_H + +/** +* Macro for the arbitrary constant `g` to be used in Lanczos approximation functions. +*/ +#define STDLIB_CONSTANT_FLOAT32_GAMMA_LANCZOS_G 10.90051099999999983f + +#endif // !STDLIB_CONSTANTS_FLOAT32_GAMMA_LANCZOS_G_H diff --git a/lib/node_modules/@stdlib/constants/float32/gamma-lanczos-g/lib/index.js b/lib/node_modules/@stdlib/constants/float32/gamma-lanczos-g/lib/index.js new file mode 100644 index 000000000000..abf537a48ff6 --- /dev/null +++ b/lib/node_modules/@stdlib/constants/float32/gamma-lanczos-g/lib/index.js @@ -0,0 +1,52 @@ +/** +* @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'; + +/** +* Arbitrary constant `g` to be used in Lanczos approximation functions. +* +* @module @stdlib/constants/float32/gamma-lanczos-g +* @type {number} +* +* @example +* var FLOAT32_GAMMA_LANCZOS_G = require( '@stdlib/constants/float32/gamma-lanczos-g' ); +* // returns 10.900510787963867 +*/ + +// MODULES // + +var float64ToFloat32 = require( '@stdlib/number/float64/base/to-float32' ); + + +// MAIN // + +/** +* Arbitrary constant `g` to be used in Lanczos approximation functions. +* +* @constant +* @type {number} +* @default 10.900510787963867 +* @see [Lanczos Approximation]{@link https://en.wikipedia.org/wiki/Lanczos_approximation} +*/ +var FLOAT32_GAMMA_LANCZOS_G = float64ToFloat32( 10.900511 ); + + +// EXPORTS // + +module.exports = FLOAT32_GAMMA_LANCZOS_G; diff --git a/lib/node_modules/@stdlib/constants/float32/gamma-lanczos-g/manifest.json b/lib/node_modules/@stdlib/constants/float32/gamma-lanczos-g/manifest.json new file mode 100644 index 000000000000..844d692f6439 --- /dev/null +++ b/lib/node_modules/@stdlib/constants/float32/gamma-lanczos-g/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/gamma-lanczos-g/package.json b/lib/node_modules/@stdlib/constants/float32/gamma-lanczos-g/package.json new file mode 100644 index 000000000000..fffb8d71af38 --- /dev/null +++ b/lib/node_modules/@stdlib/constants/float32/gamma-lanczos-g/package.json @@ -0,0 +1,71 @@ +{ + "name": "@stdlib/constants/float32/gamma-lanczos-g", + "version": "0.0.0", + "description": "Arbitrary constant `g` to be used in Lanczos approximation functions.", + "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", + "float", + "real", + "floating-point", + "float64", + "64bit", + "64-bit", + "ieee754", + "gamma", + "lanczos", + "approx", + "approximation", + "number" + ] +} diff --git a/lib/node_modules/@stdlib/constants/float32/gamma-lanczos-g/test/test.js b/lib/node_modules/@stdlib/constants/float32/gamma-lanczos-g/test/test.js new file mode 100644 index 000000000000..f8e822fccebf --- /dev/null +++ b/lib/node_modules/@stdlib/constants/float32/gamma-lanczos-g/test/test.js @@ -0,0 +1,39 @@ +/** +* @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 FLOAT32_GAMMA_LANCZOS_G = require( './../lib' ); + + +// TESTS // + +tape( 'main export is a number', function test( t ) { + t.ok( true, __filename ); + t.strictEqual( typeof FLOAT32_GAMMA_LANCZOS_G, 'number', 'main export is a number' ); + t.end(); +}); + +tape( 'the exported value equals `10.900510787963867`', function test( t ) { + var expected = 10.900510787963867; + t.strictEqual( FLOAT32_GAMMA_LANCZOS_G, expected, 'equals 10.900510787963867' ); + t.end(); +}); From 8e14b743ef92bc0a6d9ea3eb323b796aa1d38a85 Mon Sep 17 00:00:00 2001 From: stdlib-bot <82920195+stdlib-bot@users.noreply.github.com> Date: Sun, 16 Mar 2025 12:37:05 +0000 Subject: [PATCH 2/3] chore: update copyright years --- .../include/stdlib/constants/float32/gamma_lanczos_g.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/node_modules/@stdlib/constants/float32/gamma-lanczos-g/include/stdlib/constants/float32/gamma_lanczos_g.h b/lib/node_modules/@stdlib/constants/float32/gamma-lanczos-g/include/stdlib/constants/float32/gamma_lanczos_g.h index 5d072a8e1e6a..f01f21766d30 100644 --- a/lib/node_modules/@stdlib/constants/float32/gamma-lanczos-g/include/stdlib/constants/float32/gamma_lanczos_g.h +++ b/lib/node_modules/@stdlib/constants/float32/gamma-lanczos-g/include/stdlib/constants/float32/gamma_lanczos_g.h @@ -1,7 +1,7 @@ /** * @license Apache-2.0 * -* Copyright (c) 2022 The Stdlib Authors. +* 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. From e48af67e618fb4683b4e35feb33aaf8d61aa84f5 Mon Sep 17 00:00:00 2001 From: Neerajpathak07 Date: Tue, 18 Mar 2025 15:16:43 +0530 Subject: [PATCH 3/3] chore: fix define value --- .../include/stdlib/constants/float32/gamma_lanczos_g.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/node_modules/@stdlib/constants/float32/gamma-lanczos-g/include/stdlib/constants/float32/gamma_lanczos_g.h b/lib/node_modules/@stdlib/constants/float32/gamma-lanczos-g/include/stdlib/constants/float32/gamma_lanczos_g.h index f01f21766d30..8cf266894b42 100644 --- a/lib/node_modules/@stdlib/constants/float32/gamma-lanczos-g/include/stdlib/constants/float32/gamma_lanczos_g.h +++ b/lib/node_modules/@stdlib/constants/float32/gamma-lanczos-g/include/stdlib/constants/float32/gamma_lanczos_g.h @@ -22,6 +22,6 @@ /** * Macro for the arbitrary constant `g` to be used in Lanczos approximation functions. */ -#define STDLIB_CONSTANT_FLOAT32_GAMMA_LANCZOS_G 10.90051099999999983f +#define STDLIB_CONSTANT_FLOAT32_GAMMA_LANCZOS_G 10.900511f #endif // !STDLIB_CONSTANTS_FLOAT32_GAMMA_LANCZOS_G_H