From 2a9741ed9d59fc3c3beeef5144b064278eae1136 Mon Sep 17 00:00:00 2001 From: Gunj Joshi Date: Mon, 24 Aug 2026 19:35:39 +0530 Subject: [PATCH 1/2] feat: add fft/base/fftpack/float32/rffti --- 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_pkg_readmes status: passed - task: lint_markdown_docs status: na - task: lint_markdown status: na - task: lint_package_json status: passed - task: lint_repl_help status: passed - task: lint_javascript_src status: passed - task: lint_javascript_cli status: na - task: lint_javascript_examples status: passed - task: lint_javascript_tests status: passed - task: lint_javascript_benchmarks status: passed - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: passed - task: lint_shell status: na - task: lint_typescript_declarations status: passed - task: lint_typescript_tests status: passed - task: lint_license_headers status: passed --- --- .../fft/base/fftpack/float32/rffti/README.md | 169 +++++++++++ .../float32/rffti/benchmark/benchmark.js | 101 +++++++ .../base/fftpack/float32/rffti/docs/repl.txt | 55 ++++ .../float32/rffti/docs/types/index.d.ts | 58 ++++ .../fftpack/float32/rffti/docs/types/test.ts | 95 ++++++ .../fftpack/float32/rffti/examples/index.js | 41 +++ .../base/fftpack/float32/rffti/lib/index.js | 53 ++++ .../base/fftpack/float32/rffti/lib/main.js | 176 +++++++++++ .../base/fftpack/float32/rffti/lib/rffti1.js | 185 +++++++++++ .../base/fftpack/float32/rffti/package.json | 66 ++++ .../rffti/test/fixtures/c/fftpack/Makefile | 137 +++++++++ .../rffti/test/fixtures/c/fftpack/large.json | 1 + .../rffti/test/fixtures/c/fftpack/medium.json | 1 + .../rffti/test/fixtures/c/fftpack/runner.c | 286 ++++++++++++++++++ .../rffti/test/fixtures/c/fftpack/small.json | 1 + .../base/fftpack/float32/rffti/test/test.js | 231 ++++++++++++++ 16 files changed, 1656 insertions(+) create mode 100644 lib/node_modules/@stdlib/fft/base/fftpack/float32/rffti/README.md create mode 100644 lib/node_modules/@stdlib/fft/base/fftpack/float32/rffti/benchmark/benchmark.js create mode 100644 lib/node_modules/@stdlib/fft/base/fftpack/float32/rffti/docs/repl.txt create mode 100644 lib/node_modules/@stdlib/fft/base/fftpack/float32/rffti/docs/types/index.d.ts create mode 100644 lib/node_modules/@stdlib/fft/base/fftpack/float32/rffti/docs/types/test.ts create mode 100644 lib/node_modules/@stdlib/fft/base/fftpack/float32/rffti/examples/index.js create mode 100644 lib/node_modules/@stdlib/fft/base/fftpack/float32/rffti/lib/index.js create mode 100644 lib/node_modules/@stdlib/fft/base/fftpack/float32/rffti/lib/main.js create mode 100644 lib/node_modules/@stdlib/fft/base/fftpack/float32/rffti/lib/rffti1.js create mode 100644 lib/node_modules/@stdlib/fft/base/fftpack/float32/rffti/package.json create mode 100644 lib/node_modules/@stdlib/fft/base/fftpack/float32/rffti/test/fixtures/c/fftpack/Makefile create mode 100644 lib/node_modules/@stdlib/fft/base/fftpack/float32/rffti/test/fixtures/c/fftpack/large.json create mode 100644 lib/node_modules/@stdlib/fft/base/fftpack/float32/rffti/test/fixtures/c/fftpack/medium.json create mode 100644 lib/node_modules/@stdlib/fft/base/fftpack/float32/rffti/test/fixtures/c/fftpack/runner.c create mode 100644 lib/node_modules/@stdlib/fft/base/fftpack/float32/rffti/test/fixtures/c/fftpack/small.json create mode 100644 lib/node_modules/@stdlib/fft/base/fftpack/float32/rffti/test/test.js diff --git a/lib/node_modules/@stdlib/fft/base/fftpack/float32/rffti/README.md b/lib/node_modules/@stdlib/fft/base/fftpack/float32/rffti/README.md new file mode 100644 index 000000000000..c1cfb51a4dc4 --- /dev/null +++ b/lib/node_modules/@stdlib/fft/base/fftpack/float32/rffti/README.md @@ -0,0 +1,169 @@ + + +# rffti + +> Initialize a single-precision floating-point workspace array for performing a real-valued Fourier transform. + + + +
+ +
+ + + + + +
+ +## Usage + +```javascript +var rffti = require( '@stdlib/fft/base/fftpack/float32/rffti' ); +``` + +#### rffti( N, workspace, strideW, offsetW ) + +Initializes a single-precision floating-point workspace array for performing a real-valued Fourier transform. + +```javascript +var Float32Array = require( '@stdlib/array/float32' ); + +var N = 8; +var workspace = new Float32Array( ( 2*N ) + 34 ); + +var out = rffti( N, workspace, 1, 0 ); +// returns + +var bool = ( out === workspace ); +// returns true + +var twiddleFactors = workspace.slice( N, 2*N ); +// returns [ ~0.707, ~0.707, 0, 0, 0, 0, 0, 0 ] + +var factors = workspace.slice( 2*N, ( 2*N ) + 4 ); +// returns [ 8, 2, 2, 4 ] +``` + +The function accepts the following arguments: + +- **N**: length of the sequence to transform. +- **workspace**: workspace [`Float32Array`][@stdlib/array/float32]. +- **strideW**: stride length for `workspace`. +- **offsetW**: starting index for `workspace`. + +
+ + + + + +
+ +## Notes + +- The workspace array is divided into three sections: + + ```text + size = N N 2+ceil(log2(N)/2) + ↓ ↓ ↓ + | scratch / workspace | twiddle factors | radix factor table | + ↑ ↑ ↑ + i = 0 ... N ... 2N ... + ``` + + - **scratch/workspace**: used as a scratch space when performing transforms. This section is not updated during initialization. + - **twiddle factors**: a table of reusable complex-exponential constants stored as cosine/sine pairs. + - **radix factor table**: a table containing the sequence length `N`, the number of factors into which `N` was decomposed, and the individual integer radix factors. + +- In general, a workspace array should have `2N + 34` indexed elements (as `log2(N)/2 ≤ 32` for all `2^64`). During initialization, only the sections for storing twiddle factors and the factorization of `N` are updated. + +- The radix factor table is comprised as follows: + + ```text + | sequence_length | number_of_factors | integer_factors | + ``` + +- If `N` equals `1`, the function returns early without modifying the workspace, as a single data point is its own Fourier transform. + +
+ + + +
+ +## Examples + + + +```javascript +var Float32Array = require( '@stdlib/array/float32' ); +var zeroTo = require( '@stdlib/array/zero-to' ); +var logEach = require( '@stdlib/console/log-each' ); +var rffti = require( '@stdlib/fft/base/fftpack/float32/rffti' ); + +var N = 8; +var workspace = new Float32Array( ( 2*N ) + 34 ); + +rffti( N, workspace, 1, 0 ); +console.log( 'Sequence length: %d', N ); + +console.log( 'Twiddle factors:' ); +var idx = zeroTo( N, 'float32' ); +logEach( ' workspace[ %d ] = %0.4f', idx, workspace.slice( N, 2*N ) ); + +console.log( 'Factorization:' ); +var nf = workspace[ (2*N)+1 ]; + +console.log( ' number of factors: %d', nf ); +idx = zeroTo( nf, 'float32' ); +logEach( ' factor[ %d ]: %d', idx, workspace.slice( (2*N)+2, (2*N)+2+nf ) ); +``` + +
+ + + + + +
+ +
+ + + + + + + + + + + + + + diff --git a/lib/node_modules/@stdlib/fft/base/fftpack/float32/rffti/benchmark/benchmark.js b/lib/node_modules/@stdlib/fft/base/fftpack/float32/rffti/benchmark/benchmark.js new file mode 100644 index 000000000000..78b1af2c5ae1 --- /dev/null +++ b/lib/node_modules/@stdlib/fft/base/fftpack/float32/rffti/benchmark/benchmark.js @@ -0,0 +1,101 @@ +/* +* @license Apache-2.0 +* +* Copyright (c) 2026 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 bench = require( '@stdlib/bench' ); +var format = require( '@stdlib/string/format' ); +var isnanf = require( '@stdlib/math/base/assert/is-nanf' ); +var Float32Array = require( '@stdlib/array/float32' ); +var pkg = require( './../package.json' ).name; +var rffti = require( './../lib' ); + + +// FUNCTIONS // + +/** +* Creates a benchmark function. +* +* @private +* @param {PositiveInteger} N - sequence length +* @returns {Function} benchmark function +*/ +function createBenchmark( N ) { + var workspace = new Float32Array( ( 2*N ) + 34 ); + return benchmark; + + /** + * Benchmark function. + * + * @private + * @param {Benchmark} b - benchmark instance + */ + function benchmark( b ) { + var i; + + b.tic(); + for ( i = 0; i < b.iterations; i++ ) { + rffti( N, workspace, 1, 0 ); + if ( isnanf( workspace[ N ] ) ) { + b.fail( 'should not return NaN' ); + } + } + b.toc(); + if ( isnanf( workspace[ N ] ) ) { + b.fail( 'should not return NaN' ); + } + b.pass( 'benchmark finished' ); + b.end(); + } +} + + +// MAIN // + +/** +* Main execution sequence. +* +* @private +*/ +function main() { + var lengths; + var N; + var f; + var i; + + lengths = [ + 8, + 16, + 32, + 64, + 128, + 256, + 512, + 1024 + ]; + + for ( i = 0; i < lengths.length; i++ ) { + N = lengths[ i ]; + f = createBenchmark( N ); + bench( format( '%s:N=%d', pkg, N ), f ); + } +} + +main(); diff --git a/lib/node_modules/@stdlib/fft/base/fftpack/float32/rffti/docs/repl.txt b/lib/node_modules/@stdlib/fft/base/fftpack/float32/rffti/docs/repl.txt new file mode 100644 index 000000000000..35609f414550 --- /dev/null +++ b/lib/node_modules/@stdlib/fft/base/fftpack/float32/rffti/docs/repl.txt @@ -0,0 +1,55 @@ + +{{alias}}( N, workspace, strideW, offsetW ) + Initializes a single-precision floating-point workspace array for performing + a real-valued Fourier transform. + + The workspace array is divided into three sections: + + 1. scratch/workspace: the section ranges from indices 0 to N-1 and is used + while performing transforms. This section is not updated during + initialization. + + 2. twiddle factors: the section ranges from indices N to 2N-1 and stores a + table of reusable complex exponential constants as cosine/sine pairs. + + 3. radix factor table: the section starts at index 2N and stores the + sequence length N, the number of factors into which N was decomposed, and + the individual integer radix factors. + + Any remaining array space remains as unused storage. + + Parameters + ---------- + N: integer + Length of the sequence. + + workspace: Float32Array + Workspace array. + + strideW: integer + Stride length for `workspace`. + + offsetW: integer + Starting index for `workspace`. + + Returns + ------- + out: Float32Array + Workspace array. + + Examples + -------- + > var N = 8; + > var workspace = new {{alias:@stdlib/array/float32}}( ( 2*N ) + 34 ); + > var out = {{alias}}( N, workspace, 1, 0 ) + + > var bool = ( out === workspace ) + true + > var twiddleFactors = workspace.slice( N, 2*N ) + [ ~0.707, ~0.707, 0, 0, 0, 0, 0, 0 ] + > var factors = workspace.slice( 2*N, ( 2*N ) + 4 ) + [ 8, 2, 2, 4 ] + + See Also + -------- + diff --git a/lib/node_modules/@stdlib/fft/base/fftpack/float32/rffti/docs/types/index.d.ts b/lib/node_modules/@stdlib/fft/base/fftpack/float32/rffti/docs/types/index.d.ts new file mode 100644 index 000000000000..4686b194ce28 --- /dev/null +++ b/lib/node_modules/@stdlib/fft/base/fftpack/float32/rffti/docs/types/index.d.ts @@ -0,0 +1,58 @@ +/* +* @license Apache-2.0 +* +* Copyright (c) 2026 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 + +/** +* Initializes a single-precision floating-point workspace array for performing a real-valued Fourier transform. +* +* ## Notes +* +* - The workspace array should have a length of at least `( 2*N ) + 34` elements. +* - For single-point sequences (N=1), the function returns immediately as the FFT is the identity operation. +* +* @param N - length of the sequence +* @param workspace - workspace array +* @param strideW - stride length for `workspace` +* @param offsetW - starting index for `workspace` +* @returns workspace array +* +* @example +* var Float32Array = require( '@stdlib/array/float32' ); +* +* var N = 8; +* var workspace = new Float32Array( ( 2*N ) + 34 ); +* +* var out = rffti( N, workspace, 1, 0 ); +* // returns +* +* var bool = ( out === workspace ); +* // returns true +* +* var twiddleFactors = workspace.slice( N, 2*N ); +* // returns [ ~0.707, ~0.707, 0, 0, 0, 0, 0, 0 ] +* +* var factors = workspace.slice( 2*N, ( 2*N ) + 4 ); +* // returns [ 8, 2, 2, 4 ] +*/ +declare function rffti( N: number, workspace: Float32Array, strideW: number, offsetW: number ): Float32Array; + + +// EXPORTS // + +export = rffti; diff --git a/lib/node_modules/@stdlib/fft/base/fftpack/float32/rffti/docs/types/test.ts b/lib/node_modules/@stdlib/fft/base/fftpack/float32/rffti/docs/types/test.ts new file mode 100644 index 000000000000..f55238ff456f --- /dev/null +++ b/lib/node_modules/@stdlib/fft/base/fftpack/float32/rffti/docs/types/test.ts @@ -0,0 +1,95 @@ +/* +* @license Apache-2.0 +* +* Copyright (c) 2026 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 rffti = require( './index' ); + + +// TESTS // + +// The function returns a Float32Array... +{ + const workspace = new Float32Array( ( 2*8 ) + 34 ); + + rffti( 8, workspace, 1, 0 ); // $ExpectType Float32Array +} + +// The compiler throws an error if the function is provided a first argument which is not a number... +{ + const workspace = new Float32Array( ( 2*8 ) + 34 ); + + rffti( '8', workspace, 1, 0 ); // $ExpectError + rffti( true, workspace, 1, 0 ); // $ExpectError + rffti( false, workspace, 1, 0 ); // $ExpectError + rffti( null, workspace, 1, 0 ); // $ExpectError + rffti( void 0, workspace, 1, 0 ); // $ExpectError + rffti( [], workspace, 1, 0 ); // $ExpectError + rffti( {}, workspace, 1, 0 ); // $ExpectError + rffti( ( x: number ): number => x, workspace, 1, 0 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a second argument which is not a Float32Array... +{ + rffti( 8, '50', 1, 0 ); // $ExpectError + rffti( 8, 50, 1, 0 ); // $ExpectError + rffti( 8, true, 1, 0 ); // $ExpectError + rffti( 8, false, 1, 0 ); // $ExpectError + rffti( 8, null, 1, 0 ); // $ExpectError + rffti( 8, void 0, 1, 0 ); // $ExpectError + rffti( 8, [], 1, 0 ); // $ExpectError + rffti( 8, {}, 1, 0 ); // $ExpectError + rffti( 8, ( x: number ): number => x, 1, 0 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a third argument which is not a number... +{ + const workspace = new Float32Array( ( 2*8 ) + 34 ); + + rffti( 8, workspace, '1', 0 ); // $ExpectError + rffti( 8, workspace, true, 0 ); // $ExpectError + rffti( 8, workspace, false, 0 ); // $ExpectError + rffti( 8, workspace, null, 0 ); // $ExpectError + rffti( 8, workspace, void 0, 0 ); // $ExpectError + rffti( 8, workspace, [], 0 ); // $ExpectError + rffti( 8, workspace, {}, 0 ); // $ExpectError + rffti( 8, workspace, ( x: number ): number => x, 0 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a fourth argument which is not a number... +{ + const workspace = new Float32Array( ( 2*8 ) + 34 ); + + rffti( 8, workspace, 1, '0' ); // $ExpectError + rffti( 8, workspace, 1, true ); // $ExpectError + rffti( 8, workspace, 1, false ); // $ExpectError + rffti( 8, workspace, 1, null ); // $ExpectError + rffti( 8, workspace, 1, void 0 ); // $ExpectError + rffti( 8, workspace, 1, [] ); // $ExpectError + rffti( 8, workspace, 1, {} ); // $ExpectError + rffti( 8, workspace, 1, ( x: number ): number => x ); // $ExpectError +} + +// The compiler throws an error if the function is provided an unsupported number of arguments... +{ + const workspace = new Float32Array( ( 2*8 ) + 34 ); + + rffti(); // $ExpectError + rffti( 8 ); // $ExpectError + rffti( 8, workspace ); // $ExpectError + rffti( 8, workspace, 1 ); // $ExpectError + rffti( 8, workspace, 1, 0, 123 ); // $ExpectError +} diff --git a/lib/node_modules/@stdlib/fft/base/fftpack/float32/rffti/examples/index.js b/lib/node_modules/@stdlib/fft/base/fftpack/float32/rffti/examples/index.js new file mode 100644 index 000000000000..0fd4800f9809 --- /dev/null +++ b/lib/node_modules/@stdlib/fft/base/fftpack/float32/rffti/examples/index.js @@ -0,0 +1,41 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 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 Float32Array = require( '@stdlib/array/float32' ); +var zeroTo = require( '@stdlib/array/zero-to' ); +var logEach = require( '@stdlib/console/log-each' ); +var rffti = require( './../lib' ); + +var N = 8; +var workspace = new Float32Array( ( 2*N ) + 34 ); + +rffti( N, workspace, 1, 0 ); +console.log( 'Sequence length: %d', N ); + +console.log( 'Twiddle factors:' ); +var idx = zeroTo( N, 'float32' ); +logEach( ' workspace[ %d ] = %0.4f', idx, workspace.slice( N, 2*N ) ); + +console.log( 'Factorization:' ); +var nf = workspace[ (2*N)+1 ]; + +console.log( ' number of factors: %d', nf ); +idx = zeroTo( nf, 'float32' ); +logEach( ' factor[ %d ]: %d', idx, workspace.slice( (2*N)+2, (2*N)+2+nf ) ); diff --git a/lib/node_modules/@stdlib/fft/base/fftpack/float32/rffti/lib/index.js b/lib/node_modules/@stdlib/fft/base/fftpack/float32/rffti/lib/index.js new file mode 100644 index 000000000000..ffd3416519ec --- /dev/null +++ b/lib/node_modules/@stdlib/fft/base/fftpack/float32/rffti/lib/index.js @@ -0,0 +1,53 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 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'; + +/** +* Initialize a single-precision floating-point workspace array for performing a real-valued Fourier transform. +* +* @module @stdlib/fft/base/fftpack/float32/rffti +* +* @example +* var Float32Array = require( '@stdlib/array/float32' ); +* var rffti = require( '@stdlib/fft/base/fftpack/float32/rffti' ); +* +* var N = 8; +* var workspace = new Float32Array( ( 2*N ) + 34 ); +* +* var out = rffti( N, workspace, 1, 0 ); +* // returns +* +* var bool = ( out === workspace ); +* // returns true +* +* var twiddleFactors = workspace.slice( N, 2*N ); +* // returns [ ~0.707, ~0.707, 0, 0, 0, 0, 0, 0 ] +* +* var factors = workspace.slice( 2*N, ( 2*N ) + 4 ); +* // returns [ 8, 2, 2, 4 ] +*/ + +// MODULES // + +var main = require( './main.js' ); + + +// EXPORTS // + +module.exports = main; diff --git a/lib/node_modules/@stdlib/fft/base/fftpack/float32/rffti/lib/main.js b/lib/node_modules/@stdlib/fft/base/fftpack/float32/rffti/lib/main.js new file mode 100644 index 000000000000..5254ce02428b --- /dev/null +++ b/lib/node_modules/@stdlib/fft/base/fftpack/float32/rffti/lib/main.js @@ -0,0 +1,176 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 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. +* +* +* ## Notice +* +* The original C code and copyright notice are from the [PFFFT library]{@link https://github.com/marton78/pffft/blob/0b4ee12c4ba45a4a8e567550c16d96d1679f50ce/src/fftpack.c}. The implementation follows the original, but has been modified for JavaScript. +* +* ```text +* Copyright (c) 2004 the University Corporation for Atmospheric +* Research ("UCAR"). All rights reserved. Developed by NCAR's +* Computational and Information Systems Laboratory, UCAR, +* www.cisl.ucar.edu. +* +* Redistribution and use of the Software in source and binary forms, +* with or without modification, is permitted provided that the +* following conditions are met: +* +* - Neither the names of NCAR's Computational and Information Systems +* Laboratory, the University Corporation for Atmospheric Research, +* nor the names of its sponsors or contributors may be used to +* endorse or promote products derived from this Software without +* specific prior written permission. +* +* - Redistributions of source code must retain the above copyright +* notices, this list of conditions, and the disclaimer below. +* +* - Redistributions in binary form must reproduce the above copyright +* notice, this list of conditions, and the disclaimer below in the +* documentation and/or other materials provided with the +* distribution. +* +* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +* EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO THE WARRANTIES OF +* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +* NONINFRINGEMENT. IN NO EVENT SHALL THE CONTRIBUTORS OR COPYRIGHT +* HOLDERS BE LIABLE FOR ANY CLAIM, INDIRECT, INCIDENTAL, SPECIAL, +* EXEMPLARY, OR CONSEQUENTIAL DAMAGES OR OTHER LIABILITY, WHETHER IN AN +* ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS WITH THE +* SOFTWARE. +* ``` +*/ + +'use strict'; + +// MODULES // + +var rffti1 = require( './rffti1.js' ); + + +// MAIN // + +/** +* Initializes a single-precision floating-point workspace array for performing a real-valued Fourier transform. +* +* ## Notes +* +* The workspace array is divided into three sections: +* +* ```text +* size = N N 2+ceil(log2(N)/2) +* ↓ ↓ ↓ +* | scratch / workspace | twiddle factors | radix factor table | +* ↑ ↑ ↑ +* i = 0 ... N ... 2N ... +* ``` +* +* where +* +* - **scratch/workspace**: used as a scratch space when performing transforms. This section is not updated during initialization. +* - **twiddle factors**: a table of reusable complex-exponential constants stored as cosine/sine pairs. +* - **radix factor table**: a table containing the radix factorization of `N`. +* +* In general, a workspace array should have `2N + 34` indexed elements (as `log2(N)/2 ≤ 32` for all `2^64`). During initialization, only the sections for storing twiddle factors and the factorization of `N` are updated. +* +* > Note: FFTPACK only requires `2N+15`, but we increase that number here to accommodate larger workspace arrays, where `N` may exceed `2^30` indexed elements. +* +* The first two sections each contain `N` elements, while the last section contains the sequence length, the number of integer factors, and, at most, `ceil(log2(N)/2)` integer radix factors. +* +* The factorization section is comprised as follows: +* +* ```text +* | sequence_length | number_of_factors | integer_factors | +* ``` +* +* The sequence length and number of factors (`nf`) comprise a single element each. Only the first `nf` elements in the integer factors section are written to, with the rest being unused. +* +* As for twiddle factors, these are small, reusable complex-exponential constants that appear inside each "butterfly" stage of a Cooley–Tukey–style FFT. Every arithmetic step in an FFT multiplies one intermediate value by some +* +* ```tex +* W_N^k +* ``` +* +* where `W_N^k` is an N-th root of unity. Formally, in a forward FFT, +* +* ```tex +* W_N^k = e^{-2\pi ik/N} +* ``` +* +* In a backward FFT, +* +* ```tex +* W_N^k = e^{+2\pi ik/N} +* ``` +* +* As may be observed, `W_N^k` for forward and backward FFTs is the same, except the sign of the exponent is flipped. As a consequence, both forward and backward FFT callers can reuse the same set of twiddle factors, with those performing a forward transform (e.g., `rfftf`) multiplying with `(cos,-sin)` and those performing a backward transform (e.g., `rfftb`) multiplying with `(cos,+sin)`. +* +* Because these constants only depend on the transform length `N` (and **not** on the input data), we can pre-compute and store them once, then "twiddle" them (i.e., reuse them with different indices) as we proceed through the factorization. +* +* > As a quick aside regarding the name "twiddle", early FFT papers (notably Gentleman & Sande, 1966) described how you "twiddle" one branch of each butterfly by a complex rotation before adding/subtracting. The coefficients themselves inherited the nickname "twiddle factors," and the term stuck. +* +* By reusing the workspace array when computing multiple transforms of the same length `N`, every subsequent `*f` (forward) or `*b` (backward) call can simply look up the pre-stored twiddle factors instead of recomputing sine and cosine on-the-fly. +* +* In short, twiddle factors are cached roots of unity that allow each stage of the algorithm to rotate data quickly and predictably. +* +* @param {NonNegativeInteger} N - length of the sequence to transform +* @param {Float32Array} workspace - workspace array +* @param {integer} strideW - stride length for `workspace` +* @param {NonNegativeInteger} offsetW - starting index for `workspace` +* @returns {Float32Array} workspace array +* +* @example +* var Float32Array = require( '@stdlib/array/float32' ); +* +* var N = 8; +* var workspace = new Float32Array( ( 2*N ) + 34 ); +* +* var out = rffti( N, workspace, 1, 0 ); +* // returns +* +* var bool = ( out === workspace ); +* // returns true +* +* var twiddleFactors = workspace.slice( N, 2*N ); +* // returns [ ~0.707, ~0.707, 0, 0, 0, 0, 0, 0 ] +* +* var factors = workspace.slice( 2*N, ( 2*N ) + 4 ); +* // returns [ 8, 2, 2, 4 ] +*/ +function rffti( N, workspace, strideW, offsetW ) { + var offsetT; + var offsetF; + + // When a sub-sequence is a single data point, the FFT is the identity, so no initialization necessary... + if ( N === 1 ) { + return workspace; + } + // Resolve the starting indices for storing twiddle factors and factorization results: + offsetT = offsetW + ( N*strideW ); // index offset for twiddle factors + offsetF = offsetT + ( N*strideW ); // index offset for factorization results + + // Initialize a provided workspace array: + rffti1( N, workspace, strideW, offsetT, workspace, strideW, offsetF ); + + return workspace; +} + + +// EXPORTS // + +module.exports = rffti; diff --git a/lib/node_modules/@stdlib/fft/base/fftpack/float32/rffti/lib/rffti1.js b/lib/node_modules/@stdlib/fft/base/fftpack/float32/rffti/lib/rffti1.js new file mode 100644 index 000000000000..653e500530fd --- /dev/null +++ b/lib/node_modules/@stdlib/fft/base/fftpack/float32/rffti/lib/rffti1.js @@ -0,0 +1,185 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 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. +* +* +* ## Notice +* +* The original C code and copyright notice are from the [PFFFT library]{@link https://github.com/marton78/pffft/blob/0b4ee12c4ba45a4a8e567550c16d96d1679f50ce/src/fftpack.c}. The implementation follows the original, but has been modified for JavaScript. +* +* ```text +* Copyright (c) 2004 the University Corporation for Atmospheric +* Research ("UCAR"). All rights reserved. Developed by NCAR's +* Computational and Information Systems Laboratory, UCAR, +* www.cisl.ucar.edu. +* +* Redistribution and use of the Software in source and binary forms, +* with or without modification, is permitted provided that the +* following conditions are met: +* +* - Neither the names of NCAR's Computational and Information Systems +* Laboratory, the University Corporation for Atmospheric Research, +* nor the names of its sponsors or contributors may be used to +* endorse or promote products derived from this Software without +* specific prior written permission. +* +* - Redistributions of source code must retain the above copyright +* notices, this list of conditions, and the disclaimer below. +* +* - Redistributions in binary form must reproduce the above copyright +* notice, this list of conditions, and the disclaimer below in the +* documentation and/or other materials provided with the +* distribution. +* +* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +* EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO THE WARRANTIES OF +* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +* NONINFRINGEMENT. IN NO EVENT SHALL THE CONTRIBUTORS OR COPYRIGHT +* HOLDERS BE LIABLE FOR ANY CLAIM, INDIRECT, INCIDENTAL, SPECIAL, +* EXEMPLARY, OR CONSEQUENTIAL DAMAGES OR OTHER LIABILITY, WHETHER IN AN +* ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS WITH THE +* SOFTWARE. +* ``` +*/ + +'use strict'; + +// MODULES // + +var sincosf = require( '@stdlib/math/base/special/sincosf' ).assign; +var TWO_PI = require( '@stdlib/constants/float32/two-pi' ); +var floorf = require( '@stdlib/math/base/special/floorf' ); +var f32 = require( '@stdlib/number/float64/base/to-float32' ); +var Float32Array = require( '@stdlib/array/float32' ); +var decompose = require( '@stdlib/fft/base/fftpack/float32/decompose' ); + + +// VARIABLES // + +// Define a list of initial trial factors for FFT factorization: +var TRIAL_FACTORS = new Float32Array( [ 4.0, 2.0, 3.0, 5.0 ] ); + + +// MAIN // + +/** +* Initializes a single-precision floating-point working array for applying a Fourier transform to a real-valued sequence. +* +* @private +* @param {NonNegativeInteger} N - length of the sequence +* @param {Float32Array} twiddles - array of twiddle factors +* @param {integer} strideT - stride length for `twiddles` +* @param {NonNegativeInteger} offsetT - starting index for `twiddles` +* @param {Float32Array} factors - array containing a radix factorization +* @param {integer} strideF - stride length for `factors` +* @param {NonNegativeInteger} offsetF - starting index for `factors` +* @returns {void} +*/ +function rffti1( N, twiddles, strideT, offsetT, factors, strideF, offsetF ) { + var factor; + var argld; + var argh; + var fidx; + var nf; + var fi; + var l2; + var l1; + var ld; + var st; + var it; + var im; + var M; + var m; + var k; + var j; + + // Decompose the sequence length into its radix factors: + nf = decompose( N, 4, TRIAL_FACTORS, 1, 0, factors, strideF, offsetF ); + + // If the number of radix factors is `1`, the only twiddle factor we need is `W_N^0 = 1`, which the main transform kernels already hard-code, so nothing to pre-compute... + if ( nf-1 === 0 ) { + return; + } + // Compute the master angular step (i.e., the basic angle that generates all twiddles): + argh = f32( TWO_PI / N ); + + // Define the location of the first sine term we want to compute: + im = 1; + + // Initialize a running product of factors already processed: + l1 = 1; + + // Compute the index of the first radix factor: + fidx = offsetF + ( 2*strideF ); + + // Compute the stride length for each cosine/sine pair: + st = 2 * strideT; + + // Generate twiddle factors... + for ( k = 0; k < nf-1; k++ ) { + // Resolve the next radix factor: + factor = factors[ fidx ]; + + // Compute the length of the transform after including the current radix: + l2 = f32( factor * l1 ); + + // Compute the number of the "butterfly wings" (at this stage, the data is viewed as a `factor`-point transform of sub-vectors of length `l1`; `M` describes how many such vectors fit in the full array of length `N`): + M = floorf( f32( N / l2 ) ); + + // Initialize a running offset used to step the angle: + ld = 0; + + // Iterate over each butterfly column within the current radix... + for ( j = 1; j < factor; j++ ) { + // Advance to the next column: + ld += l1; + + // Compute the angle step for this column: + argld = f32( ld * argh ); // 2π ⋅ j ⋅ li / N, which is the j-th column's base angle + + // Initialize a counter which counts from `1` to `(M/2)-1` (i.e., all non-trivial harmonics): + fi = 1.0; + + // Compute the index of the sine term: + it = offsetT + ( im*strideT ); + + // Iterate over each non-trivial harmonic in the column (note: we skip the `m=0` and `m=1` (i.e., the first cosine/sine pair, the first harmonic `W_N^0 = cos(0) + j sin(0) = 1 + j⋅0` is trivial and hard-coded by transform kernels)... + for ( m = 2; m < M; m += 2 ) { + // Compute `(cos(fi*argld), sin(fi*argld))`: + sincosf( f32( fi*argld ), twiddles, -strideT, it ); // note: `sincosf` returns the sine and cosine, in that order, so we need to use a negative stride when assigning the values to `twiddles` to ensure that cosine comes before sine in the twiddles table + + // Update for the next harmonic: + fi = f32( fi + 1.0 ); + + // Resolve the index of the next sine term: + it += st; + } + // Advance `im` by the size of the current block, skipping the cosine/sine pairs we have just written: + im += M; + } + // Update the running product of factors already processed: + l1 = l2; + + // Resolve the index of the next radix factor: + fidx += strideF; + } +} + + +// EXPORTS // + +module.exports = rffti1; diff --git a/lib/node_modules/@stdlib/fft/base/fftpack/float32/rffti/package.json b/lib/node_modules/@stdlib/fft/base/fftpack/float32/rffti/package.json new file mode 100644 index 000000000000..0d3af3f298bc --- /dev/null +++ b/lib/node_modules/@stdlib/fft/base/fftpack/float32/rffti/package.json @@ -0,0 +1,66 @@ +{ + "name": "@stdlib/fft/base/fftpack/float32/rffti", + "version": "0.0.0", + "description": "Initialize a single-precision floating-point workspace array for performing a real-valued Fourier transform.", + "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": { + "benchmark": "./benchmark", + "doc": "./docs", + "example": "./examples", + "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", + "fft", + "fftpack", + "rffti", + "fourier", + "transform", + "twiddle", + "workspace", + "initialization", + "real", + "single", + "float32" + ], + "__stdlib__": {} +} diff --git a/lib/node_modules/@stdlib/fft/base/fftpack/float32/rffti/test/fixtures/c/fftpack/Makefile b/lib/node_modules/@stdlib/fft/base/fftpack/float32/rffti/test/fixtures/c/fftpack/Makefile new file mode 100644 index 000000000000..77b6a5f13549 --- /dev/null +++ b/lib/node_modules/@stdlib/fft/base/fftpack/float32/rffti/test/fixtures/c/fftpack/Makefile @@ -0,0 +1,137 @@ +#/ +# @license Apache-2.0 +# +# Copyright (c) 2026 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. +#/ + +# VARIABLES # + +ifndef VERBOSE + QUIET := @ +endif + +# Specify the path to FFTPACK: +FFTPACK ?= + +# Specify a list of FFTPACK source files: +FFTPACK_SRC ?= + +# Determine the OS: +# +# [1]: https://en.wikipedia.org/wiki/Uname#Examples +# [2]: http://stackoverflow.com/a/27776822/2225624 +OS ?= $(shell uname) +ifneq (, $(findstring MINGW,$(OS))) + OS := WINNT +else +ifneq (, $(findstring MSYS,$(OS))) + OS := WINNT +else +ifneq (, $(findstring CYGWIN,$(OS))) + OS := WINNT +endif +endif +endif + +# Define the program used for compiling C source files: +ifdef C_COMPILER + CC := $(C_COMPILER) +else + CC := gcc +endif + +# Define the command-line options when compiling C files: +CFLAGS ?= \ + -std=c99 \ + -O3 \ + -Wall \ + -pedantic + +# Determine whether to generate [position independent code][1]: +# +# [1]: https://gcc.gnu.org/onlinedocs/gcc/Code-Gen-Options.html#Code-Gen-Options +# [2]: http://stackoverflow.com/questions/5311515/gcc-fpic-option +ifeq ($(OS), WINNT) + fPIC ?= +else + fPIC ?= -fPIC +endif + +# List of C targets: +c_targets := runner.out + + +# RULES # + +#/ +# Compiles C source files. +# +# @param {string} [C_COMPILER] - C compiler +# @param {string} [CFLAGS] - C compiler flags +# @param {(string|void)} [fPIC] - flag indicating whether to generate position independent code +# +# @example +# make +# +# @example +# make all +#/ +all: $(c_targets) + +.PHONY: all + +#/ +# Compiles C source files. +# +# @private +# @param {string} CC - C compiler +# @param {string} CFLAGS - C compiler flags +# @param {(string|void)} fPIC - flag indicating whether to generate position independent code +#/ +$(c_targets): %.out: %.c + $(QUIET) $(CC) $(CFLAGS) $(fPIC) -o $@ $(FFTPACK_SRC) $< -lm + +#/ +# Generates test fixtures. +# +# @example +# make run +#/ +run: $(c_targets) + $(QUIET) ./$< + +.PHONY: run + +#/ +# Removes generated files. +# +# @example +# make clean +#/ +clean: + $(QUIET) -rm -f *.o *.out + +.PHONY: clean + +#/ +# Removes generated test fixtures. +# +# @example +# make clean-fixtures +#/ +clean-fixtures: + $(QUIET) -rm -f *.json + +.PHONY: clean-fixtures diff --git a/lib/node_modules/@stdlib/fft/base/fftpack/float32/rffti/test/fixtures/c/fftpack/large.json b/lib/node_modules/@stdlib/fft/base/fftpack/float32/rffti/test/fixtures/c/fftpack/large.json new file mode 100644 index 000000000000..b67ca11dc982 --- /dev/null +++ b/lib/node_modules/@stdlib/fft/base/fftpack/float32/rffti/test/fixtures/c/fftpack/large.json @@ -0,0 +1 @@ +{"lengths":[402,655,452,749,499,819,277,274,645,554],"offsets":[0,402,1057,1509,2258,2757,3576,3853,4127,4772],"twiddles":[0.99987787,0.0156291779,0.99951148,0.0312545374,0.99890089,0.0468722656,0.998046279,0.0624785386,0.996947944,0.0780695528,0.995606005,0.0936414972,0.99402082,0.109190561,0.992192864,0.124712951,0.990122497,0.140204877,0.987810314,0.155662552,0.985256732,0.171082199,0.982462525,0.186460078,0.979428351,0.201792374,0.976154864,0.217075393,0.972642899,0.232305363,0.968893349,0.247478604,0.96490711,0.262591392,0.960685194,0.277640015,0.956228554,0.292620838,0.951538324,0.307530135,0.946615696,0.32236436,0.941461742,0.337119788,0.936077833,0.351792902,0.930465281,0.366380066,0.924625397,0.380877703,0.91855967,0.395282328,0.912269533,0.409590364,0.905756533,0.423798382,0.899022281,0.437902838,0.892068446,0.451900333,0.884896636,0.465787411,0.8775087,0.479560763,0.869906366,0.493216932,0.862091541,0.50675261,0.854066133,0.52016449,0.84583205,0.533449292,0.837391376,0.546603799,0.82874608,0.559624791,0.819898427,0.572508991,0.810850441,0.585253417,0.801604331,0.597854912,0.792162418,0.610310316,0.78252703,0.622616589,0.772700489,0.634770751,0.76268518,0.646769941,0.752483487,0.658611059,0.742098033,0.670291364,0.731531262,0.681807876,0.720785856,0.693157792,0.709864318,0.704338431,0.698769391,0.715346992,0.687503755,0.726180851,0.676070213,0.736837208,0.664471447,0.747313678,0.652710378,0.75760752,0.640789866,0.767716348,0.628712833,0.777637601,0.616482198,0.787368834,0.604101002,0.796907783,0.591572165,0.806252062,0.578898847,0.815399349,0.566084146,0.824347436,0.553131104,0.83309418,0.540042996,0.841637433,0.526822925,0.849975049,0.513474107,0.858105063,0.49999997,0.866025448,0.486403584,0.873734236,0.472688466,0.881229639,0.458857864,0.888509691,0.444915086,0.895572782,0.430863708,0.902417004,0.416706979,0.909040868,0.402448565,0.915442586,0.388091832,0.921620727,0.37364018,0.92757374,0.359097391,0.933300078,0.344466835,0.938798487,0.329752058,0.944067597,0.314956814,0.949105978,0.300084531,0.953912616,0.285139054,0.95848614,0.270123929,0.962825537,0.255042672,0.966929793,0.239899263,0.970797777,0.224697113,0.974428654,0.209440202,0.977821469,0.194132119,0.980975389,0.178776488,0.983889699,0.163377315,0.986563683,0.147938102,0.988996625,0.132462874,0.99118799,0.116955295,0.993137181,0.101419017,0.994843781,0.0858580843,0.996307373,0.0702760592,0.997527599,0.0546769835,0.998504102,0.0390645526,0.999236703,0.0234424621,0.999725163,0.00781476125,0.999969482,0,0.99951148,0.0312545374,0.998046279,0.0624785386,0.995606005,0.0936414972,0.992192864,0.124712951,0.987810314,0.155662552,0.982462525,0.186460078,0.976154864,0.217075393,0.968893349,0.247478604,0.960685194,0.277640015,0.951538324,0.307530135,0.941461742,0.337119788,0.930465281,0.366380066,0.91855967,0.395282328,0.905756533,0.423798382,0.892068446,0.451900333,0.8775087,0.479560763,0.862091541,0.50675261,0.84583205,0.533449292,0.82874608,0.559624791,0.810850441,0.585253417,0.792162418,0.610310316,0.772700489,0.634770751,0.752483487,0.658611059,0.731531262,0.681807876,0.709864318,0.704338431,0.687503755,0.726180851,0.664471447,0.747313678,0.640789866,0.767716348,0.616482198,0.787368834,0.591572165,0.806252062,0.566084146,0.824347436,0.540042996,0.841637433,0.513474107,0.858105063,0,0.998046279,0.0624785386,0.992192864,0.124712951,0.982462525,0.186460078,0.968893349,0.247478604,0.951538324,0.307530135,0.930465281,0.366380066,0.905756533,0.423798382,0.8775087,0.479560763,0.84583205,0.533449292,0.810850441,0.585253417,0.772700489,0.634770751,0.731531262,0.681807876,0.687503755,0.726180851,0.640789866,0.767716348,0.591572165,0.806252062,0.540042996,0.841637433,0.486403584,0.873734236,0.430863708,0.902417004,0.37364018,0.92757374,0.314956814,0.949105978,0.255042672,0.966929793,0.194132119,0.980975389,0.132462874,0.99118799,0.0702760592,0.997527599,0.00781476125,0.999969482,-0.0546771921,0.998504102,-0.116955377,0.993137181,-0.178776696,0.983889699,-0.239899352,0.970797777,-0.30008474,0.953912556,-0.359097451,0.933300078,-0.416707158,0.909040749,-0.472688645,0.88122952,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0.999953985,0.00959250238,0.999815941,0.0191841219,0.999585927,0.0287739784,0.999263942,0.0383611843,0.998849988,0.0479448587,0.998344123,0.057524126,0.997746408,0.067098096,0.997056842,0.0766658932,0.996275544,0.0862266421,0.995402575,0.0957794413,0.994437993,0.105323441,0.993381977,0.114857748,0.992234468,0.124381475,0.990995705,0.133893758,0.989665747,0.143393725,0.988244653,0.152880505,0.986732721,0.162353218,0.985129952,0.171810985,0.983436525,0.181252927,0.981652617,0.190678209,0.979778349,0.200085938,0.977813959,0.209475264,0.975759566,0.218845323,0.973615408,0.22819522,0.971381664,0.237524122,0.969058514,0.246831179,0.966646194,0.256115496,0.964144945,0.26537627,0.961554945,0.274612635,0.958876491,0.283823729,0.956109762,0.293008685,0.953255117,0.3021667,0.950312734,0.31129691,0.947282851,0.32039845,0.944165885,0.329470545,0.940961957,0.338512301,0.937671483,0.347522885,0.93429476,0.35650149,0.930832028,0.365447313,0.927283645,0.374359518,0.923649907,0.383237273,0.919931233,0.392079741,0.916127861,0.400886148,0.912240207,0.40965569,0.908268631,0.418387502,0.904213428,0.42708081,0.900075078,0.435734838,0.895853877,0.444348782,0.891550243,0.452921778,0.887164593,0.46145314,0.882697284,0.469942033,0.878148735,0.478387713,0.873519361,0.486789376,0.8688097,0.495146155,0.86402005,0.503457427,0.859150887,0.511722386,0.854202628,0.519940257,0.849175811,0.528110266,0.844070852,0.536231697,0.838888168,0.544303775,0.833628356,0.552325785,0.828291833,0.560296953,0.822879076,0.568216562,0.817390561,0.576083899,0.811826885,0.583898187,0,0.999815941,0.0191841219,0.999263942,0.0383611843,0.998344123,0.057524126,0.997056842,0.0766658932,0.995402575,0.0957794413,0.993381977,0.114857748,0.990995705,0.133893758,0.988244653,0.152880505,0.985129952,0.171810985,0.981652617,0.190678209,0.977813959,0.209475264,0.973615408,0.22819522,0.969058514,0.246831179,0.964144945,0.26537627,0.958876491,0.283823729,0.953255117,0.3021667,0.947282851,0.32039845,0.940961957,0.338512301,0.93429476,0.35650149,0.927283645,0.374359518,0.919931233,0.392079741,0.912240207,0.40965569,0.904213428,0.42708081,0.895853877,0.444348782,0.887164593,0.46145314,0.878148735,0.478387713,0.8688097,0.495146155,0.859150887,0.511722386,0.849175811,0.528110266,0.838888168,0.544303775,0.828291833,0.560296953,0.817390561,0.576083899,0.806188464,0.591658771,0.794689655,0.607015967,0.782898366,0.622149646,0.770818889,0.637054384,0.758455694,0.651724637,0.74581337,0.666154981,0.732896507,0.680340171,0.719709873,0.694274902,0.706258416,0.707954168,0.692546904,0.721372843,0.678580582,0.734525979,0.664364457,0.747408748,0.649903774,0.760016501,0.635203958,0.77234447,0.620270312,0.784388125,0.605108321,0.796143115,0.589723706,0.807605088,0.574122012,0.818769753,0.558308959,0.829633117,0.54229039,0.840191126,0.526072204,0.850439906,0.509660602,0.860375583,0.493061215,0.86999464,0.476280391,0.879293442,0.45932427,0.88826865,0.442199081,0.896916926,0.424911141,0.905235052,0.407466799,0.913220048,0.389872462,0.920868874,0.372134656,0.928178728,0.354259878,0.935146987,0.336254686,0.94177109,0.318125755,0.948048532,0,0.999585927,0.0287739784,0.998344123,0.057524126,0.996275544,0.0862266421,0.993381977,0.114857748,0.989665747,0.14339374,0.985129952,0.171810985,0.979778349,0.200085938,0.973615408,0.22819522,0.966646194,0.256115526,0.958876491,0.283823758,0.950312734,0.31129691,0.940961957,0.338512301,0.930832028,0.365447342,0.919931233,0.392079741,0.908268631,0.418387502,0.895853877,0.444348782,0.882697284,0.469942063,0.86880964,0.495146215,0.854202628,0.519940317,0.838888168,0.544303834,0.822879076,0.568216562,0.806188464,0.591658771,0.78883028,0.614611089,0.770818889,0.637054384,0.752169132,0.658970118,0.732896447,0.680340171,0.713016927,0.701146841,0.692546904,0.721372843,0.671503425,0.741001487,0.649903774,0.760016501,0.627766013,0.77840209,0.605108321,0.796143115,0.581949592,0.813224852,0.558308899,0.829633176,0.534205854,0.845354438,0.509660482,0.860375643,0.484693021,0.874684334,0.459324151,0.888268709,0.433574945,0.901117504,0.40746668,0.913220048,0.381021082,0.924566329,0.354259878,0.935146987,0.327205271,0.944953263,0.29987973,0.953976989,0.272305846,0.962210774,0.244506449,0.969647646,0.216504589,0.976281583,0.188323423,0.982107043,0.159986317,0.987119257,0.131516725,0.991313934,0.102938212,0.994687736,0.074274458,0.997237861,0.045549199,0.998962104,0.0167862196,0.999859095,-0.0119906608,0.999928117,-0.0407574922,0.999169052,-0.0694906935,0.997582614,-0.0981663465,0.995169997,-0.126760706,0.991933346,-0.155250102,0.987875223,-0.183610916,0.982999027,-0.211819693,0.97730875,-0.239853054,0.970809221,-0.267687798,0.963505685,-0.295300841,0.955404341,0,0.999263942,0.0383611843,0.997056842,0.0766658932,0.993381977,0.114857748,0.988244653,0.152880505,0.981652617,0.190678209,0.973615408,0.22819522,0.964144945,0.26537627,0.953255117,0.3021667,0.940961957,0.338512301,0.927283645,0.374359518,0.912240207,0.40965569,0.895853877,0.444348782,0.878148735,0.478387713,0.859150887,0.511722386,0.838888168,0.544303775,0.817390561,0.576083899,0.794689655,0.607015967,0.770818889,0.637054384,0.74581337,0.666154981,0.719709873,0.694274902,0.692546904,0.721372843,0.664364457,0.747408748,0.635203958,0.77234447,0.605108321,0.796143115,0.574122012,0.818769753,0.54229039,0.840191126,0.509660602,0.860375583,0.476280391,0.879293442,0.442199081,0.896916926,0.407466799,0.913220048,0.372134656,0.928178728,0.336254686,0.94177109,0.29987973,0.953976989,0.263063312,0.964778602,0.225859612,0.974159837,0.188323423,0.982107043,0.150510013,0.988608479,0.112475142,0.993654549,0.0742745772,0.997237802,0.0359646752,0.999353051,-0.00239817472,0.999997139,-0.0407574922,0.999169052,-0.0790568143,0.9968701,-0.117239751,0.993103623,-0.155250102,0.987875223,-0.193031892,0.98119247,-0.230529532,0.973065317,-0.267687798,0.963505685,-0.304451883,0.952527702,-0.34076789,0.94014746,-0.376582235,0.926383197,-0.411842197,0.911255181,-0.44649601,0.894785643,-0.480492204,0.876999021,-0.51378125,0.857921243,-0.546313941,0.837580502,-0.578042448,0.81600672,-0.608919978,0.793231666,-0.638901055,0.769288898,-0.66794163,0.744213641,-0.695998907,0.71804285,-0.72303158,0.690814972,-0.748999894,0.662570119,-0.773865581,0.633349895,-0.797591984,0.603197336,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0.999903381,0.0139004048,0.999613583,0.0277981237,0.999130547,0.0416904725,0.998454511,0.0555747636,0.997585535,0.0694483146,0.996523798,0.0833084509,0.995269537,0.0971524864,0.993822873,0.110977747,0.992184222,0.124781571,0.990353882,0.138561264,0.988332093,0.152314216,0.98611939,0.166037709,0.98371613,0.179729134,0.981122792,0.19338581,0.978339851,0.207005143,0.975367904,0.220584452,0.972207427,0.234121144,0.968859136,0.24761261,0.965323627,0.261056215,0.961601555,0.274449378,0.957693696,0.287789524,0.953600764,0.301074058,0.949323595,0.314300388,0.944862962,0.327466011,0.94021976,0.340568334,0.935394883,0.353604883,0.930389285,0.366573095,0.92520386,0.379470468,0.91983968,0.392294496,0.91429776,0.405042768,0.908579171,0.417712718,0.902684987,0.430301994,0.896616399,0.442808092,0.890374601,0.455228627,0.883960664,0.467561245,0.87737602,0.479803473,0.870621741,0.491953015,0.863699317,0.504007459,0.856609941,0.515964568,0.849355102,0.527821898,0.841936052,0.539577305,0.834354341,0.551228464,0.826611459,0.562772989,0.818708837,0.574208915,0.810648024,0.585533798,0.802430511,0.596745551,0.794057965,0.607842028,0.785532057,0.618821025,0.776854277,0.629680455,0.768026412,0.640418172,0.759050131,0.651032209,0.749927163,0.661520422,0.740659356,0.671880782,0.731248319,0.682111323,0.721696079,0.692210078,0.712004364,0.702175081,0,0.999613583,0.0277981237,0.998454511,0.0555747636,0.996523798,0.0833084509,0.993822873,0.110977747,0.990353882,0.138561264,0.98611939,0.166037709,0.981122792,0.19338581,0.975367904,0.220584452,0.968859136,0.24761261,0.961601555,0.274449378,0.953600764,0.301074058,0.944862962,0.327466011,0.935394883,0.353604883,0.92520386,0.379470468,0.91429776,0.405042768,0.902684987,0.430301994,0.890374601,0.455228627,0.87737602,0.479803473,0.863699317,0.504007459,0.849355102,0.527821898,0.834354341,0.551228464,0.818708837,0.574208915,0.802430511,0.596745551,0.785532057,0.618821025,0.768026412,0.640418172,0.749927163,0.661520422,0.731248319,0.682111323,0.712004364,0.702175081,0.692210078,0.721696079,0.671880722,0.740659356,0.65103215,0.759050131,0.629680395,0.776854277,0.607841969,0.794058025,0.585533798,0.810648024,0.562772989,0.826611519,0.539577246,0.841936111,0.515964448,0.85661,0.491952986,0.870621741,0.467561185,0.883960724,0.442808092,0.896616399,0.417712688,0.908579171,0.392294437,0.91983968,0.366573066,0.930389285,0.340568304,0.94021976,0.314300418,0.949323595,0.287789494,0.957693696,0.261056155,0.965323627,0.234121144,0.972207427,0.207005084,0.978339851,0.179729149,0.98371613,0.152314186,0.988332152,0.124781497,0.992184222,0.0971524864,0.995269537,0.0694482699,0.997585535,0.0416903794,0.999130607,0.0139003843,0.999903381,0,0.999130547,0.0416904725,0.996523798,0.0833084509,0.992184222,0.124781571,0.98611939,0.166037709,0.978339851,0.207005128,0.968859136,0.24761261,0.957693696,0.287789494,0.944862962,0.327466011,0.930389285,0.366573095,0.91429776,0.405042738,0.896616399,0.442808092,0.87737602,0.479803473,0.856609941,0.515964568,0.834354401,0.551228404,0.810648024,0.585533798,0.785532057,0.618821025,0.759050131,0.651032209,0.731248319,0.682111323,0.702175081,0.712004364,0.671880782,0.740659297,0.640418172,0.768026412,0.607841969,0.794058025,0.574208856,0.818708837,0.539577246,0.841936111,0.504007459,0.863699317,0.467561185,0.883960724,0.430301964,0.902684987,0.392294526,0.91983968,0.353604853,0.935394883,0.314300418,0.949323595,0.274449348,0.961601555,0.234121144,0.972207427,0.193385854,0.981122792,0.152314186,0.988332152,0.110977769,0.993822873,0.0694482699,0.997585535,0.0277981274,0.999613583,-0.0139003526,0.999903381,-0.0555747822,0.998454511,-0.0971524566,0.995269537,-0.138561308,0.990353882,-0.179729119,0.98371613,-0.220584393,0.975367904,-0.261056215,0.965323567,-0.301073998,0.953600764,-0.340568393,0.94021976,-0.379470438,0.92520386,-0.417712778,0.908579111,-0.455228657,0.890374601,-0.491952956,0.8706218,-0.527821839,0.849355102,-0.562773108,0.8266114,-0.59674561,0.802430511,-0.629680455,0.776854277,-0.661520362,0.749927223,-0.692210019,0.721696138,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0.999964833,0.00838866737,0.999859273,0.0167767443,0.999683321,0.0251636431,0.999437094,0.0335487686,0.999120474,0.0419315323,0.99873358,0.0503113493,0.998276412,0.0586876236,0.997748971,0.0670597628,0.997151315,0.0754271895,0.996483505,0.0837893039,0.99574554,0.0921455249,0.994937539,0.100495271,0.994059503,0.108837932,0.993111551,0.117172934,0.992093682,0.125499681,0.991005957,0.133817628,0.989848554,0.142126143,0.988621473,0.150424644,0.987324834,0.158712566,0.985958695,0.166989326,0.984523177,0.17525433,0.983018398,0.183506995,0.981444418,0.191746756,0.979801416,0.199973032,0.978089392,0.208185211,0.976308584,0.216382757,0.974459112,0.224565074,0.972541034,0.232731581,0.970554471,0.240881711,0.96849966,0.249014884,0.966376662,0.257130563,0.964185715,0.265228122,0.961926877,0.273307025,0.959600329,0.281366706,0.957206249,0.289406568,0.954744875,0.297426075,0.952216268,0.305424631,0.949620664,0.313401729,0.946958184,0.321356744,0.944229126,0.329289138,0.941433609,0.337198406,0.938571811,0.345083892,0.935644031,0.352945119,0.932650387,0.360781491,0.92959106,0.36859253,0.926466346,0.376377583,0.923276484,0.38413614,0.920021594,0.391867697,0.916701972,0.399571657,0.913317859,0.407247514,0.909869432,0.4148947,0.90635699,0.42251271,0.902780771,0.430100948,0,0.999859273,0.0167767443,0.999437094,0.0335487686,0.99873358,0.0503113493,0.997748971,0.0670597628,0.996483505,0.0837893039,0.994937539,0.100495271,0.993111551,0.117172934,0.991005957,0.133817628,0.988621473,0.150424644,0.985958695,0.166989326,0.983018398,0.183506995,0.979801416,0.199973032,0.976308584,0.216382757,0.972541034,0.232731581,0.96849966,0.249014884,0.964185715,0.265228122,0.959600329,0.281366706,0.954744875,0.297426075,0.949620664,0.313401729,0.944229126,0.329289138,0.938571811,0.345083892,0.932650387,0.360781491,0.926466346,0.376377583,0.920021594,0.391867697,0.913317859,0.407247514,0.90635699,0.42251271,0.899141073,0.437658936,0.891672015,0.452682018,0.883952022,0.467577666,0.875983179,0.482341677,0.867767751,0.496969968,0.859308064,0.511458337,0.850606561,0.525802732,0.841665566,0.539999187,0.832487702,0.554043591,0.823075473,0.56793201,0.813431621,0.581660569,0.803558707,0.595225513,0.793459713,0.608622789,0.783137321,0.621848822,0.772594452,0.634899795,0.761834204,0.647772074,0.750859499,0.660461962,0.739673436,0.672966003,0.728279114,0.685280621,0.716679811,0.697402358,0.704878867,0.709327698,0.692879379,0.721053481,0.680684984,0.732576251,0.66829896,0.743892848,0.655724764,0.754999995,0.642966032,0.765894711,0.63002634,0.776573777,0,0.999683321,0.0251636431,0.99873358,0.0503113493,0.997151315,0.0754271895,0.994937539,0.100495271,0.992093682,0.125499696,0.988621473,0.150424644,0.984523177,0.17525433,0.979801416,0.199973032,0.974459112,0.224565089,0.96849966,0.249014914,0.961926818,0.273307055,0.954744875,0.297426075,0.946958184,0.321356744,0.938571811,0.345083892,0.92959106,0.36859253,0.920021594,0.391867697,0.909869432,0.41489473,0.899141073,0.437658966,0.887843251,0.46014604,0.875983119,0.482341707,0.863568306,0.50423187,0.850606501,0.525802791,0.837106049,0.547040641,0.823075473,0.56793201,0.808523595,0.588463783,0.793459713,0.608622789,0.777893245,0.628396451,0.761834204,0.647772074,0.745292604,0.666737497,0.728279114,0.685280621,0.710804284,0.703389823,0.692879379,0.721053481,0.674515665,0.738260508,0.655724764,0.755000055,0.636518598,0.771261394,0.616909266,0.787034273,0.596909285,0.802308738,0.576531231,0.817075133,0.5557881,0.831323981,0.534692943,0.845046461,0.513259172,0.858233631,0.491500407,0.870877326,0.469430357,0.882969499,0.44706288,0.894502521,0.4244124,0.905469,0.401493132,0.915862024,0.378319591,0.925675035,0.35490647,0.934901834,0.33126846,0.94353652,0.30742079,0.95157367,0.283378392,0.959008157,0.259156555,0.965835333,0.234770462,0.972050846,0,0.999437094,0.0335487686,0.997748971,0.0670597628,0.994937539,0.100495271,0.991005957,0.133817628,0.985958695,0.166989326,0.979801416,0.199973032,0.972541034,0.232731581,0.964185715,0.265228122,0.954744875,0.297426075,0.944229126,0.329289138,0.932650387,0.360781491,0.920021594,0.391867697,0.90635699,0.42251271,0.891672015,0.452682018,0.875983179,0.482341677,0.859308064,0.511458337,0.841665566,0.539999187,0.823075473,0.56793201,0.803558707,0.595225513,0.783137321,0.621848822,0.761834204,0.647772074,0.739673436,0.672966003,0.716679811,0.697402358,0.692879379,0.721053481,0.66829896,0.743892848,0.642966032,0.765894711,0.616909266,0.787034273,0.590157986,0.807287812,0.562742293,0.82663238,0.534693003,0.845046341,0.506041706,0.862509012,0.476820767,0.879000545,0.447062999,0.894502461,0.41680181,0.908997416,0.386071473,0.922468901,0.35490647,0.934901834,0.323341906,0.946282208,0.291413218,0.956597269,0.259156555,0.965835333,0.226608112,0.97398603,0.193804428,0.98104018,0.16078268,0.986989856,0.127579913,0.991828322,0.0942335129,0.995550096,0.0607809052,0.998151124,0.0272599813,0.999628365,-0.00629163021,0.999980211,-0.0398362763,0.999206245,-0.0733359605,0.997307301,-0.106753074,0.994285583,-0.140050009,0.990144432,-0.173189372,0.984888554,-0.206133649,0.97852385,0,0.999120474,0.0419315323,0.996483505,0.0837893039,0.992093682,0.125499681,0.985958695,0.166989326,0.978089392,0.208185211,0.96849966,0.249014884,0.957206249,0.289406568,0.944229126,0.329289138,0.92959106,0.368592501,0.913317859,0.407247514,0.895438075,0.445186138,0.875983179,0.482341677,0.854987383,0.518648803,0.832487702,0.554043591,0.808523595,0.588463724,0.783137321,0.621848822,0.756373465,0.654140055,0.728279173,0.685280561,0.698903739,0.715215743,0.66829896,0.743892848,0.636518598,0.771261334,0.603618622,0.797273219,0.569656789,0.821882665,0.534693003,0.845046341,0.498788595,0.866723657,0.462006897,0.886876345,0.424412519,0.905468941,0.386071473,0.922468901,0.347051412,0.937846124,0.30742088,0.95157367,0.267249495,0.963627398,0.226608112,0.97398603,0.185568124,0.982631385,0.144201592,0.989548326,0.102581531,0.994724572,0.0607810244,0.998151124,0.0188734811,0.999821901,-0.023067141,0.999733925,-0.0649671853,0.997887373,-0.106753074,0.994285583,-0.148351058,0.988934755,-0.189688087,0.981844425,-0.230691567,0.973026931,-0.27128914,0.96249789,-0.311409503,0.950275779,-0.350982219,0.936382115,-0.389937431,0.920841336,-0.428206712,0.903680801,-0.465722799,0.88493067,-0.502419829,0.864623785,-0.538232923,0.842796147,-0.573099256,0.819485962,-0.606957495,0.794734299,0,0.99873358,0.0503113493,0.994937539,0.100495271,0.988621473,0.150424644,0.979801416,0.199973032,0.96849966,0.249014914,0.954744875,0.297426075,0.938571811,0.345083892,0.920021594,0.391867697,0.899141073,0.437658966,0.875983119,0.482341707,0.850606501,0.525802791,0.823075473,0.56793201,0.793459713,0.608622789,0.761834204,0.647772074,0.728279114,0.685280621,0.692879379,0.721053481,0.655724764,0.755000055,0.616909266,0.787034273,0.576531231,0.817075133,0.534692943,0.845046461,0.491500407,0.870877326,0.44706288,0.894502521,0.401493132,0.915862024,0.35490647,0.934901834,0.30742079,0.95157367,0.259156555,0.965835333,0.210235804,0.977650702,0.16078268,0.986989856,0.11092221,0.993829072,0.0607809052,0.998151124,0.0104855327,0.999945045,-0.0398362763,0.999206245,-0.0900571868,0.995936573,-0.140050113,0.990144432,-0.189688206,0.981844366,-0.238845959,0.971057475,-0.287398636,0.957811058,-0.335223496,0.942138612,-0.382199198,0.924079955,-0.42820695,0.903680682,-0.473129988,0.880992651,-0.516854703,0.856073141,-0.559270322,0.828985333,-0.600269556,0.799797773,-0.639748216,0.768584549,-0.677606523,0.735424638,-0.713748574,0.700402021,-0.748082817,0.663605392,-0.780522406,0.625127792,-0.81098491,0.585067034,-0.839393377,0.543524384,-0.865675747,0.500605106,-0.88976568,0.45641765,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0.999970555,0.00767170172,0.999882281,0.0153429527,0.999735177,0.0230132993,0.999529183,0.0306822918,0.999264359,0.0383494794,0.998940766,0.0460144095,0.998558342,0.0536766313,0.998117208,0.061335694,0.997617245,0.0689911395,0.99705863,0.0766425356,0.996441305,0.0842894241,0.995765328,0.0919313431,0.995030761,0.0995678455,0.994237661,0.107198499,0.993385971,0.114822842,0.992475867,0.12244042,0.991507351,0.130050793,0.990480423,0.137653515,0.989395261,0.145248145,0.988251865,0.152834207,0.987050235,0.160411283,0.98579061,0.167978927,0.984472871,0.175536677,0.983097255,0.183084086,0.981663764,0.19062072,0.980172515,0.198146135,0.978623509,0.205659911,0.977016985,0.213161558,0.975352883,0.220650673,0.973631442,0.228126809,0.97185266,0.235589504,0.970016658,0.243038327,0.968123615,0.250472844,0.966173589,0.257892638,0.964166701,0.265297234,0.962103009,0.272686213,0.959982753,0.280059189,0.957805932,0.287415653,0.955572784,0.294755191,0.953283429,0.302077383,0.950937927,0.309381783,0.948536456,0.316668004,0.946079135,0.323935568,0.943566144,0.331184089,0.94099766,0.33841309,0.938373744,0.345622182,0.935694635,0.352810949,0.932960451,0.359978914,0.930171311,0.36712572,0.927327454,0.374250919,0.924429059,0.381354064,0.921476185,0.388434798,0.918469131,0.395492673,0.915408015,0.402527243,0.912293017,0.40953815,0.909124315,0.416524917,0.905902088,0.423487186,0.902626574,0.430424541,0.899297893,0.437336564,0.895916343,0.444222867,0.892482042,0.451082975,0.888995171,0.457916558,0.885456026,0.4647232,0.881864727,0.471502453,0.878221571,0.47825399,0.87452668,0.484977365,0.870780349,0.491672188,0.866982758,0.498338103,0.863134146,0.504974663,0.85923475,0.511581481,0.85528475,0.518158257,0.851284444,0.524704456,0.847234011,0.5312199,0.843133688,0.537703991,0.838983774,0.544156432,0.834784508,0.550576806,0.830536067,0.556964874,0.826238751,0.5633201,0.821892798,0.569642127,0.817498505,0.575930715,0.813056111,0.582185388,0.808565795,0.588405728,0.804027975,0.594591498,0.799442768,0.60074228,0.794810534,0.606857657,0.790131509,0.612937331,0.785405993,0.618980944,0.780634224,0.624988198,0.7758165,0.630958617,0.770953119,0.636891842,0.766044438,0.642787635,0.761090577,0.64864558,0.756092012,0.654465377,0.751048863,0.660246611,0.745961547,0.665988982,0.740830362,0.671692193,0.735655546,0.677355826,0.730437398,0.682979643,0.725176275,0.688563228,0.719872534,0.694106281,0.714526355,0.699608505,0.709138155,0.705069542,0.703708172,0.710489094,0.698236823,0.715866864,0.692724347,0.721202493,0.687171102,0.726495624,0.681577384,0.731746018,0.675943613,0.736953318,0.670270026,0.742117286,0.66455704,0.747237563,0.658804893,0.752313852,0.653013945,0.757345855,0.64718461,0.762333333,0.641317189,0.76727587,0.635411978,0.772173285,0.629469395,0.777025282,0.623489797,0.781831503,0.617473483,0.786591709,0.61142081,0.791305602,0.605332136,0.795973003,0.599207819,0.800593495,0.593048275,0.8051669,0.586853862,0.809692919,0.580624819,0.814171255,0.574361682,0.818601668,0.56806469,0.822983861,0.561734319,0.827317715,0.555370867,0.831602812,0.548974693,0.835838974,0.542546272,0.840025961,0.536085784,0.844163477,0.529593885,0.848251283,0.523070753,0.852289259,0.516516924,0.856276989,0.509932578,0.860214412,0.50331831,0.864101112,0,0.999882281,0.0153429527,0.999529183,0.0306822918,0.998940766,0.0460144095,0.998117208,0.061335694,0.99705863,0.0766425356,0.995765328,0.0919313431,0.994237661,0.107198499,0.992475867,0.12244042,0.990480423,0.137653515,0.988251865,0.152834207,0.98579061,0.167978927,0.983097255,0.183084086,0.980172515,0.198146135,0.977016985,0.213161558,0.973631442,0.228126809,0.970016658,0.243038327,0.966173589,0.257892638,0.962103009,0.272686213,0.957805932,0.287415653,0.953283429,0.302077383,0.948536456,0.316668004,0.943566144,0.331184089,0.938373744,0.345622182,0.932960451,0.359978914,0.927327454,0.374250919,0.921476185,0.388434798,0.915408015,0.402527243,0.909124315,0.416524917,0.902626574,0.430424541,0.895916343,0.444222867,0.888995171,0.457916558,0.881864727,0.471502453,0.87452668,0.484977365,0.866982758,0.498338103,0.85923475,0.511581481,0.851284444,0.524704456,0.843133688,0.537703991,0.834784508,0.550576806,0.826238751,0.5633201,0.817498505,0.575930715,0.808565795,0.588405728,0.799442768,0.60074228,0.790131509,0.612937331,0.780634224,0.624988198,0.770953119,0.636891842,0.761090577,0.64864558,0.751048863,0.660246611,0.740830362,0.671692193,0.730437398,0.682979643,0.719872534,0.694106281,0.709138155,0.705069542,0.698236823,0.715866864,0.687171102,0.726495624,0.675943613,0.736953318,0.66455704,0.747237563,0.653013945,0.757345855,0.641317189,0.76727587,0.629469395,0.777025282,0.617473483,0.786591709,0.605332136,0.795973003,0.593048275,0.8051669,0.580624819,0.814171255,0.56806469,0.822983861,0.555370867,0.831602812,0.542546272,0.840025961,0.529593885,0.848251283,0.516516924,0.856276989,0.50331831,0.864101112,0.490001202,0.871721745,0.476568729,0.879137218,0.46302408,0.886345685,0.449370414,0.893345535,0.435610861,0.9001351,0.421748877,0.906712711,0.407787591,0.913076818,0.393730313,0.919225991,0.379580319,0.925158799,0.365340978,0.930873752,0.351015627,0.936369598,0.336607635,0.941644967,0.322120428,0.946698725,0.307557344,0.951529562,0.292921871,0.956136405,0.278217465,0.960518122,0.263447523,0.964673698,0.248615578,0.96860224,0.233725116,0.972302735,0.218779489,0.975774348,0.203782484,0.979016185,0.188737512,0.98202759,0.173648104,0.984807789,0.158517808,0.987356126,0.143350199,0.989672005,0.128148839,0.991754949,0.112917319,0.993604362,0.0976592079,0.995219886,0.0823781043,0.996601164,0.0670776144,0.997747779,0.0517613292,0.998659492,0.0364328586,0.999336123,0.0210958123,0.999777436,0.00575379934,0.99998343,-0.00958956871,0.999954045,-0.0249306802,0.999689162,-0.0402660407,0.999189019,-0.055591803,0.998453557,-0.0709044784,0.997483134,-0.0862004608,0.996277809,-0.101476148,0.994837999,-0.116727948,0.993163943,-0.131952271,0.991256058,-0.147145525,0.989114881,-0.162304133,0.986740768,-0.177424535,0.984134436,-0.192503169,0.98129636,-0.207536489,0.978227258,-0.222520947,0.974927902,-0.237453029,0.971399009,-0.252329201,0.967641473,-0.267146081,0.963656068,-0.281899959,0.959443808,-0.296587467,0.955005705,-0.311205149,0.950342774,-0.325749576,0.945456088,-0.340217322,0.940346837,-0.354604959,0.935016215,-0.368909121,0.929465473,-0.383126438,0.923695922,-0.397253543,0.917708874,-0.411287129,0.911505818,-0.425224036,0.905088127,-0.439060569,0.898457468,-0.452793986,0.891615152,-0.466420591,0.884563088,-0.479937583,0.877302647,-0.493341386,0.869835794,0,0.999735177,0.0230132993,0.998940766,0.0460144095,0.997617245,0.0689911395,0.995765328,0.0919313431,0.993385971,0.114822842,0.990480423,0.137653515,0.987050235,0.160411283,0.983097255,0.183084086,0.978623509,0.205659911,0.973631442,0.228126809,0.968123615,0.250472844,0.962103009,0.272686213,0.955572784,0.294755191,0.948536456,0.316668004,0.94099766,0.33841309,0.932960451,0.359978914,0.924429059,0.381354064,0.915408015,0.402527243,0.905902088,0.423487186,0.895916343,0.444222867,0.885456026,0.4647232,0.87452668,0.484977365,0.863134146,0.504974663,0.851284444,0.524704456,0.838983774,0.544156432,0.826238751,0.5633201,0.813056111,0.582185388,0.799442768,0.60074228,0.785405993,0.618980944,0.770953119,0.636891842,0.756092012,0.654465377,0.740830362,0.671692193,0.725176275,0.688563228,0.709138155,0.705069542,0.692724347,0.721202493,0.675943613,0.736953318,0.658804893,0.752313852,0.641317189,0.76727587,0.623489797,0.781831503,0.605332136,0.795973003,0.586853862,0.809692919,0.56806469,0.822983861,0.548974693,0.835838974,0.529593885,0.848251283,0.509932578,0.860214412,0,0.998940766,0.0460144095,0.995765328,0.0919313431,0.990480423,0.137653515,0.983097255,0.183084086,0.973631442,0.228126809,0.962103009,0.272686213,0.948536456,0.316668004,0.932960451,0.359978914,0.915408015,0.402527243,0.895916343,0.444222867,0.87452668,0.484977365,0.851284444,0.524704456,0.826238751,0.5633201,0.799442768,0.60074228,0.770953119,0.636891842,0.740830362,0.671692193,0.709138155,0.705069542,0.675943613,0.736953318,0.641317189,0.76727587,0.605332136,0.795973003,0.56806469,0.822983861,0.529593885,0.848251283,0.490001202,0.871721745,0.449370414,0.893345535,0.407787591,0.913076818,0.365340978,0.930873752,0.322120428,0.946698725,0.278217465,0.960518122,0.233725116,0.972302735,0.188737512,0.98202759,0.143350199,0.989672005,0.0976592079,0.995219886,0.0517613292,0.998659492,0.00575379934,0.99998343,-0.0402660407,0.999189019,-0.0862004608,0.996277809,-0.131952271,0.991256058,-0.177424535,0.984134436,-0.222520947,0.974927902,-0.267146081,0.963656068,-0.311205149,0.950342774,-0.354604959,0.935016215,-0.397253543,0.917708874,-0.439060569,0.898457468,-0.479937583,0.877302647,0,0.997617245,0.0689911395,0.990480423,0.137653515,0.978623509,0.205659896,0.962103009,0.272686213,0.94099766,0.33841306,0.915408015,0.402527243,0,0.990480423,0.137653515,0.962103009,0.272686213,0.915408015,0.402527243,0.851284444,0.524704456,0.770953178,0.636891842,0.675943673,0.736953318,0,0.978623509,0.205659911,0.915408015,0.402527243,0.813056111,0.582185388,0.675943613,0.736953318,0.509932578,0.860214412,0.322120428,0.946698725,0,0.962103009,0.272686213,0.851284444,0.524704456,0.675943673,0.736953318,0.449370414,0.893345535,0.188737631,0.982027531,-0.0862003416,0.996277809,0,0.94099766,0.33841309,0.770953119,0.636891842,0.509932578,0.860214412,0.188737512,0.98202759,-0.154729441,0.987956882,-0.479937583,0.877302647,0,0.915408015,0.402527243,0.675943613,0.736953318,0.322120428,0.946698725,-0.0862004608,0.996277809,-0.479937583,0.877302647,-0.792476892,0.609901965,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0.999737084,0.0229293238,0.998948514,0.0458465926,0.997634649,0.0687397495,0.995796204,0.0915967673,0.993434131,0.114405625,0.990549684,0.137154311,0.987144411,0.159830883,0.983220041,0.182423413,0.97877872,0.204920039,0.973822713,0.227308899,0.968354642,0.249578238,0.962377369,0.271716297,0.955894113,0.293711543,0.94890815,0.315552324,0.941423297,0.337227196,0.933443367,0.358724743,0.924972653,0.380033642,0.916015565,0.401142746,0.906576812,0.42204088,0.896661341,0.442717135,0.886274397,0.463160545,0.875421405,0.483360469,0.864108145,0.50330621,0.852340519,0.522987247,0.840124667,0.542393386,0.827467084,0.561514258,0.814374387,0.580339909,0.800853431,0.598860383,0.786911428,0.617065966,0.772555649,0.634947062,0.757793605,0.652494311,0.742633104,0.669698477,0.727082133,0.686550498,0.711148858,0.703041494,0.694841623,0.719162822,0.678169012,0.734905958,0.661139786,0.750262737,0.643762946,0.765224934,0.626047611,0.779784799,0.60800308,0.793934643,0.589638889,0.807667017,0.570964634,0.820974648,0.551990092,0.833850682,0.532725275,0.846288204,0.513180435,0.858280778,0.493365705,0.869821966,0.473291546,0.880905867,0.452968627,0.891526461,0.432407439,0.901678324,0.411618888,0.911356091,0.390613884,0.920554638,0.369403481,0.929269075,0.347998857,0.937494934,0.326411217,0.945227861,0.304651976,0.952463746,0.282732517,0.959198773,0.260664403,0.965429485,0.238459229,0.971152484,0.216128662,0.976364911,0.193684444,0.981063902,0.171138391,0.985247016,0.148502335,0.988912046,0.125788212,0.992057145,0.103007935,0.994680524,0.0801734999,0.996780932,0.0572969019,0.998357177,0.0343901813,0.999408484,0.0114653734,0.999934256,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0.999952555,0.00974121876,0.999810219,0.0194815118,0.999572992,0.0292199571,0.999240935,0.0389556289,0.998814046,0.048687607,0.998292387,0.0584149584,0.997676015,0.068136774,0.996964931,0.0778521225,0.996159256,0.08756008,0.995259047,0.0972597301,0.994264364,0.106950156,0.993175387,0.11663042,0.991992116,0.126299635,0.990714788,0.135956839,0.989343345,0.145601168,0.987878084,0.15523167,0.986319065,0.164847434,0.984666467,0.174447566,0.982920408,0.184031129,0.981081069,0.193597257,0.979148686,0.203144982,0.97712332,0.212673455,0.975005269,0.222181737,0.972794712,0.231668919,0.970491767,0.241134152,0.968096793,0.250576496,0.965609968,0.259995043,0.963031471,0.269388914,0.9603616,0.278757215,0.957600594,0.28809911,0.95474875,0.297413617,0.951806247,0.306699932,0.948773444,0.315957129,0.945650637,0.325184345,0.942438066,0.334380716,0.939136088,0.343545347,0.935745001,0.352677375,0.932265103,0.361775935,0.928696692,0.370840162,0.925040185,0.379869223,0.921295941,0.388862193,0.917464256,0.397818297,0.913545489,0.406736612,0.909539998,0.415616393,0.905448258,0.424456686,0.901270568,0.433256716,0.897007346,0.442015618,0.892659009,0.450732589,0.888225973,0.459406823,0.883708656,0.468037426,0.879107475,0.476623595,0.874422848,0.485164583,0.869655252,0.493659496,0.864805162,0.502107561,0.859872997,0.510508001,0.854859233,0.518859982,0.849764347,0.527162731,0.844588816,0.535415471,0.839333177,0.543617368,0.833997786,0.551767766,0.82858336,0.559865713,0.823090255,0.567910552,0.817519069,0.575901508,0.811870337,0.583837807,0.806144476,0.591718733,0.800342202,0.599543452,0.794463933,0.607311308,0.788510323,0.615021527,0.78248179,0.622673452,0.776379049,0.630266249,0.770202696,0.637799203,0.763953209,0.645271659,0.757631242,0.652682841,0.751237333,0.660032153,0.744772196,0.667318821,0.738236368,0.674542129,0.731630504,0.681701422,0.724955142,0.688796103,0.718210995,0.695825338,0.71139878,0.702788591,0.704518974,0.709685147,0.697572351,0.716514349,0.690559566,0.723275542,0.683481216,0.729968071,0.676338017,0.736591399,0.669130623,0.74314481,0.661859691,0.749627709,0.654525995,0.7560395,0.647130251,0.762379467,0.639672995,0.768647134,0.63215512,0.774841845,0.624577224,0.780963063,0.616940081,0.787010133,0.609244347,0.792982519,0.601490855,0.798879683,0.593680263,0.80470103,0.585813284,0.810446084,0.577890754,0.816114128,0.569913387,0.821704745,0.561881959,0.82721746,0.553797185,0.832651615,0.5456599,0.838006735,0.537470758,0.843282342,0.529230654,0.848478019,0.520940363,0.853593051,0.512600601,0.8586272,0.50421226,0.86357975,0,0.999810219,0.0194815118,0.999240935,0.0389556289,0.998292387,0.0584149584,0.996964931,0.0778521225,0.995259047,0.0972597301,0.993175387,0.11663042,0.990714788,0.135956839,0.987878084,0.15523167,0.984666467,0.174447566,0.981081069,0.193597257,0.97712332,0.212673455,0.972794712,0.231668919,0.968096793,0.250576496,0.963031471,0.269388914,0.957600594,0.28809911,0.951806247,0.306699932,0.945650637,0.325184345,0.939136088,0.343545347,0.932265103,0.361775935,0.925040185,0.379869223,0.917464256,0.397818297,0.909539998,0.415616393,0.901270568,0.433256716,0.892659009,0.450732589,0.883708656,0.468037426,0.874422848,0.485164583,0.864805162,0.502107561,0.854859233,0.518859982,0.844588816,0.535415471,0.833997786,0.551767766,0.823090255,0.567910552,0.811870337,0.583837807,0.800342202,0.599543452,0.788510323,0.615021527,0.776379049,0.630266249,0.763953209,0.645271659,0.751237333,0.660032153,0.738236368,0.674542129,0.724955142,0.688796103,0.71139878,0.702788591,0.697572351,0.716514349,0.683481216,0.729968071,0.669130623,0.74314481,0.654525995,0.7560395,0.639672995,0.768647134,0.624577224,0.780963063,0.609244347,0.792982519,0.593680263,0.80470103,0.577890754,0.816114128,0.561881959,0.82721746,0.5456599,0.838006735,0.529230654,0.848478019,0.512600601,0.8586272,0.495775938,0.868450463,0.478763133,0.877944112,0.461568624,0.887104511,0.444198906,0.895928204,0.426660568,0.904411852,0.408960283,0.912552178,0.391104698,0.9203462,0.373100728,0.927790821,0.354955167,0.934883296,0.336674869,0.941620946,0.318266809,0.948001206,0.2997379,0.954021573,0.281095266,0.959679902,0.26234591,0.964973927,0.243496984,0.969901681,0.224555507,0.974461317,0.20552893,0.978651047,0.18642433,0.98246932,0.167248979,0.985914707,0.14801015,0.988985837,0.128715128,0.991681635,0.109371252,0.994000971,0.0899858698,0.995943069,0.0705663264,0.997507095,0.0511198826,0.998692513,0.031654153,0.999498904,0.0121764075,0.999925852,-0.00730595831,0.999973297,-0.0267855506,0.99964118,-0.0462549776,0.998929679,-0.0657068491,0.997838974,-0.0851337761,0.996369541,-0.10452839,0.994521916,-0.123883449,0.992296755,-0.143191367,0.989695013,-0.162444934,0.986717582,-0.18163684,0.983365655,-0.200759813,0.979640484,-0.219806582,0.975543499,-0.238769904,0.97107619,-0.257642627,0.966240287,-0.276417524,0.961037636,-0.295087516,0.955470204,-0.313645631,0.949540138,-0.332084566,0.943249643,-0.350397468,0.936601102,-0.368577361,0.92959708,-0.386617362,0.922240198,-0.404510587,0.914533317,-0.422250301,0.906479299,-0.439829856,0.898081124,-0.45724225,0.889342189,-0.474481285,0.880265594,-0.491540045,0.870854974,0,0.999572992,0.0292199571,0.998292387,0.0584149584,0.996159256,0.08756008,0.993175387,0.11663042,0.989343345,0.145601153,0.984666467,0.174447566,0.979148686,0.203144982,0.972794712,0.231668919,0.965609968,0.259995043,0.957600594,0.28809908,0.948773444,0.315957129,0.939136088,0.343545347,0.928696692,0.370840132,0.917464256,0.397818297,0.905448258,0.424456656,0.892659009,0.450732589,0.879107475,0.476623595,0.864805162,0.502107561,0.849764347,0.527162731,0.833997846,0.551767707,0.817519069,0.575901508,0,0.998292387,0.0584149584,0.993175387,0.11663042,0.984666467,0.174447566,0.972794712,0.231668919,0.957600594,0.28809908,0.939136088,0.343545347,0.917464256,0.397818297,0.892659009,0.450732589,0.864805162,0.502107561,0.833997846,0.551767707,0.800342202,0.599543452,0.763953209,0.645271659,0.724955142,0.688796043,0.683481216,0.729968071,0.639673054,0.768647075,0.593680263,0.80470103,0.5456599,0.838006735,0.495775938,0.868450463,0.444198906,0.895928204,0.391104788,0.920346141,0.336674869,0.941620946,0,0.996159256,0.08756008,0.984666467,0.174447566,0.965609968,0.259995043,0.939136088,0.343545347,0.905448258,0.424456686,0.864805162,0.502107561,0.817519069,0.575901508,0.763953209,0.645271659,0.704518974,0.709685147,0.639672995,0.768647134,0.569913387,0.821704745,0.495775938,0.868450463,0.417830199,0.908525109,0.336674869,0.941620946,0.252933383,0.967483699,0.167248979,0.985914707,0.0802798495,0.996772349,-0.00730595831,0.999973297,-0.094835639,0.995492935,-0.18163684,0.983365655,-0.267042786,0.963684678,0,0.993175387,0.11663042,0.972794712,0.231668919,0.939136088,0.343545347,0.892659009,0.450732589,0.833997846,0.551767707,0.763953209,0.645271659,0.683481216,0.729968071,0.593680263,0.80470103,0.495775938,0.868450463,0.391104788,0.920346141,0.281095266,0.959679902,0.167248979,0.985914707,0.0511200018,0.998692513,-0.0657068491,0.997838974,-0.181636721,0.983365715,-0.295087516,0.955470204,-0.404510587,0.914533317,-0.508412421,0.861113727,-0.605374694,0.795940638,-0.694074094,0.719903588,-0.773300052,0.634040236,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0.999935687,0.0113412468,0.999742746,0.0226810351,0.999421239,0.0340179056,0.998971164,0.0453503989,0.998392582,0.0566770621,0.997685552,0.0679964349,0.996850252,0.079307057,0.995886683,0.0906074792,0.994795024,0.101896249,0.993575394,0.113171913,0.992228031,0.124433018,0.990752995,0.135678113,0.989150465,0.146905765,0.987420797,0.158114523,0.985564053,0.16930294,0.983580589,0.180469573,0.981470585,0.191612989,0.979234338,0.202731773,0.976872087,0.213824481,0.974384248,0.224889666,0.971771061,0.235925928,0.969032824,0.246931851,0.966170013,0.25790602,0.963182867,0.268846989,0.960071921,0.279753387,0.956837416,0.290623814,0.953479826,0.301456869,0.949999571,0.312251121,0.946397185,0.323005199,0.942673028,0.333717793,0.938827634,0.344387412,0.934861481,0.355012715,0.930775046,0.36559239,0.926568925,0.376125008,0.922243595,0.386609286,0.917799652,0.397043794,0.913237691,0.407427251,0.90855819,0.417758316,0.903761864,0.428035647,0.898849308,0.438257873,0.893821061,0.448423773,0.888677895,0.458531976,0.883420408,0.4685812,0.878049314,0.478570163,0.872565269,0.488497555,0.866968989,0.498362124,0.861261189,0.508162558,0.855442584,0.517897666,0.849513948,0.527566135,0.843476057,0.537166715,0.837329686,0.546698272,0.831075609,0.556159437,0.824714601,0.565549135,0.818247497,0.574866056,0.811675191,0.584109008,0.804998457,0.593276858,0.798218191,0.602368414,0.791335285,0.611382425,0.784350514,0.620317876,0.777264893,0.629173517,0.770079315,0.637948155,0.762794614,0.646640837,0.755411863,0.655250251,0.747931957,0.663775444,0.74035579,0.672215223,0.732684433,0.680568516,0.724918783,0.68883431,0.71705997,0.697011471,0.709108829,0.705099046,0.701066494,0.713095903,0.692934036,0.721000969,0.68471241,0.72881335,0.676402748,0.736531973,0.668006063,0.744155824,0.659523427,0.75168401,0.650955975,0.759115517,0.642304838,0.766449273,0.633570969,0.773684561,0.62475574,0.780820251,0.615860045,0.787855566,0.606885135,0.794789553,0.597832263,0.801621199,0.588702381,0.808349848,0.579496861,0.814974487,0.570216775,0.821494281,0.560863316,0.827908397,0.551437736,0.834216058,0.541941226,0.840416372,0.532374978,0.846508622,0.522740304,0.852491975,0.513038397,0.858365655,0.503270388,0.864129007,0.493437767,0.869781137,0.483541638,0.875321329,0.473583251,0.880749047,0.463564038,0.886063397,0.453485191,0.891263843,0.443347901,0.896349609,0.433153689,0.9013201,0.422903776,0.9061746,0.412599355,0.910912573,0.402241975,0.915533423,0.391832858,0.920036435,0.381373316,0.924421132,0.37086463,0.928686917,0.360308349,0.932833254,0.349705726,0.936859608,0.339057982,0.9407655,0.328366756,0.944550276,0.317633301,0.948213637,0.306858867,0.951755047,0.296045095,0.955173969,0.285193205,0.958470047,0.274304539,0.961642861,0.263380706,0.964691997,0.252423018,0.967616975,0.241432711,0.970417559,0.23041147,0.973093271,0.21936059,0.975643873,0.208281398,0.978068948,0.197175518,0.980368197,0.186044276,0.982541382,0.174889103,0.984588146,0.163711309,0.98650831,0.15251258,0.988301516,0.141294241,0.989967644,0.130057603,0.991506457,0.118804358,0.992917657,0.107535832,0.994201183,0.0962533504,0.995356858,0.0849586129,0.996384501,0.073652938,0.997283936,0.0623376779,0.9980551,0.0510145202,0.998697937,0.0396847948,0.999212265,0.0283499677,0.999598086,0.0170113742,0.99985528,0.00567071186,0.999983907,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]} diff --git a/lib/node_modules/@stdlib/fft/base/fftpack/float32/rffti/test/fixtures/c/fftpack/medium.json b/lib/node_modules/@stdlib/fft/base/fftpack/float32/rffti/test/fixtures/c/fftpack/medium.json new file mode 100644 index 000000000000..84f3e2f626a1 --- /dev/null +++ b/lib/node_modules/@stdlib/fft/base/fftpack/float32/rffti/test/fixtures/c/fftpack/medium.json @@ -0,0 +1 @@ +{"lengths":[48,122,29,78,70,40,100,47,101,49],"offsets":[0,48,170,199,277,347,387,487,534,635],"twiddles":[0.991444886,0.1305262,0.965925813,0.258819044,0.923879504,0.382683456,0.866025388,0.5,0.793353319,0.60876143,0,0,0.965925813,0.258819044,0.866025388,0.5,0.707106769,0.707106769,0.49999997,0.866025448,0.258819073,0.965925813,0,0,0.923879504,0.382683456,0.707106769,0.707106769,0.382683426,0.923879504,-4.37113883e-08,1,-0.382683516,0.923879504,0,0,0.866025388,0.5,0,0.49999997,0.866025448,0,-4.37113883e-08,1,0,0,0,0,0.998674095,0.0514787547,0.994699895,0.102821,0.988087893,0.15389058,0.978855669,0.204552069,0.967027724,0.254671127,0.952635348,0.304114848,0.935716808,0.35275209,0.916316926,0.400453925,0.894487083,0.447093785,0.870285273,0.492548078,0.84377557,0.536696196,0.81502831,0.579421163,0.784119785,0.620609522,0.751131892,0.660152137,0.716152191,0.697944164,0.679273307,0.733885407,0.640593171,0.76788044,0.600214303,0.799839258,0.558243752,0.829676986,0.5147928,0.857314646,0.469976753,0.882678807,0.423914403,0.905702233,0.376727909,0.92632395,0.328542292,0.944489241,0.279485554,0.960149884,0.229687676,0.973264396,0.179280698,0.983797967,0.128398299,0.991722703,0.0771754086,0.997017503,0.0257478673,0.999668479,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0.996757329,0.0804665685,0.987050235,0.160411283,0.970941842,0.239315674,0.948536456,0.316668004,0.919979453,0.391966611,0.885456026,0.4647232,0.845190108,0.534465849,0.799442768,0.60074228,0.748510778,0.663122654,0.692724347,0.721202433,0.632445395,0.774604976,0.56806469,0.822983861,0.49999997,0.866025448,0.428692549,0.903450429,0.35460487,0.935016274,0.278217465,0.960518122,0.200025693,0.979790628,0.120536685,0.992708862,0.0402659513,0.999189019,0,0.987050235,0.160411283,0.948536456,0.316668004,0.885456026,0.4647232,0.799442768,0.60074228,0.692724347,0.721202433,0.56806469,0.822983861,0,0.948536456,0.316668004,0.799442768,0.60074228,0.56806469,0.822983861,0.278217465,0.960518122,-0.0402659215,0.999189019,-0.354604959,0.935016215,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0.995974302,0.0896393061,0.983929574,0.178556889,0.963962853,0.266036838,0.936234891,0.351374835,0.90096885,0.433883756,0.858448803,0.51289928,0.809017003,0.587785244,0.753071487,0.657938719,0.691062689,0.722794831,0.623489797,0.781831503,0.550897002,0.834573269,0.473868698,0.880595505,0.393025041,0.919527769,0.309016973,0.95105654,0.222520977,0.974927902,0.134233281,0.99094975,0.0448648036,0.998993039,0,0.983929574,0.178556889,0.936234891,0.351374835,0.858448803,0.51289928,0,0.936234891,0.351374835,0.753071487,0.657938719,0.473868698,0.880595505,0,0.858448803,0.51289928,0.473868698,0.880595505,-0.0448647738,0.998993099,0,0.753071487,0.657938719,0.134233281,0.99094975,-0.550896943,0.834573269,0,0,0,0,0,0,0,0,0.987688363,0.156434476,0.95105654,0.309017003,0.891006529,0.453990519,0.809017003,0.587785244,0.707106769,0.707106769,0.587785244,0.809017003,0.453990519,0.891006529,0.309016973,0.95105654,0.156434372,0.987688363,0,0,0.95105654,0.309017003,0.809017003,0.587785244,0,0.809017003,0.587785244,0.309016973,0.95105654,0,0.587785244,0.809017003,-0.309017032,0.95105648,0,0,0,0,0,0,0.998026729,0.0627905205,0.992114723,0.125333235,0.982287228,0.187381327,0.968583167,0.248689905,0.95105654,0.309017003,0.92977649,0.368124574,0.904827058,0.425779313,0.876306653,0.481753707,0.844327927,0.535826862,0.809017003,0.587785244,0.770513237,0.637424052,0.728968561,0.684547126,0,0.992114723,0.125333235,0.968583167,0.248689905,0.92977649,0.368124574,0.876306653,0.481753707,0.809017003,0.587785244,0.728968561,0.684547126,0.637423933,0.770513296,0.535826743,0.844327927,0.425779194,0.904827118,0.309016973,0.95105654,0.187381223,0.982287288,0.0627903789,0.998026729,0,0.982287228,0.187381327,0.92977649,0.368124574,0.844327927,0.535826862,0.728968561,0.684547126,0.587785184,0.809017062,0.425779194,0.904827118,0.24868983,0.968583167,0.0627903789,0.998026729,-0.125333443,0.992114663,-0.309017152,0.95105648,-0.481753796,0.876306593,-0.637424171,0.770513117,0,0.968583167,0.248689905,0.876306653,0.481753707,0,0.876306653,0.481753707,0.535826743,0.844327927,0,0.728968561,0.684547126,0.0627903789,0.998026729,0,0.535826743,0.844327927,-0.425779372,0.904826999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0.991789997,0.127877161,0.967294872,0.253654599,0.926916778,0.375267029,0,0.967294872,0.253654599,0.871318698,0.49071756,0.718349338,0.695682585,0,0.926916778,0.375267029,0.718349338,0.695682585,0.404783279,0.914412677,0,0.871318698,0.49071756,0.518392503,0.855142772,0.0320515111,0.999486208,0,0.801413596,0.598110557,0.284527481,0.958667874,-0.345365226,0.938468337,0,0.718349338,0.695682585,0.0320515111,0.999486208,-0.672300994,0.740277886,0,0,0,0,0,0,0,0]} diff --git a/lib/node_modules/@stdlib/fft/base/fftpack/float32/rffti/test/fixtures/c/fftpack/runner.c b/lib/node_modules/@stdlib/fft/base/fftpack/float32/rffti/test/fixtures/c/fftpack/runner.c new file mode 100644 index 000000000000..9ff53d6c36d2 --- /dev/null +++ b/lib/node_modules/@stdlib/fft/base/fftpack/float32/rffti/test/fixtures/c/fftpack/runner.c @@ -0,0 +1,286 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 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. +*/ + +/** +* Generate FFTPACK test fixtures. +* +* ## Notes +* +* - Run this script from the directory in which fixtures should be written. +* +*/ + +#include +#include +#include + +/** +* Define prototypes for external functions. +*/ +extern void rffti( int n, float *wsave ); + +/** +* Generates a random number on the interval [0,1]. +* +* @return random number +*/ +float rand_float( void ) { + int r = rand(); + return (float)r / ( (float)RAND_MAX + 1.0f ); +} + +/** +* Generates an array of pseudorandom integers drawn from a uniform distribution. +* +* ## Notes +* +* - WARNING: the method used here is not particularly robust, as some integer values may be sampled more frequently than others. +* +* +* @param out output array +* @param len array length +* @param a lower bound (inclusive) +* @param b upper bound (exclusive) +*/ +void rand_array_i32( int *out, const unsigned int len, const int a, const int b ) { + unsigned int i; + unsigned int r; + float delta; + + delta = (float)b - (float)a; + + for ( i = 0; i < len; i++ ) { + r = (unsigned int)( delta * rand_float() ); // truncation + out[ i ] = (int)( a + r ); + } +} + +/** +* Writes an array of floats to a file as a series of comma-separated values. +* +* @param f file to write to +* @param x array of floats +* @param len array length +*/ +void write_array_f32( FILE *f, const float *x, const unsigned int len ) { + unsigned int i; + + for ( i = 0; i < len; i++ ) { + fprintf( f, "%.9g", x[ i ] ); + if ( i < len-1 ) { + fprintf( f, "," ); + } + } +} + +/** +* Writes an array of integers to a file as a series of comma-separated values. +* +* @param f file to write to +* @param x array of integers +* @param len array length +*/ +void write_array_i32( FILE *f, const int *x, const unsigned int len ) { + unsigned int i; + + for ( i = 0; i < len; i++ ) { + fprintf( f, "%d", x[ i ] ); + if ( i < len-1 ) { + fprintf( f, "," ); + } + } +} + +/** +* Writes a named array of floats to a file as JSON. +* +* @param f file to write to +* @param name array name +* @param x data +* @param len array length +*/ +void write_named_array_f32( FILE *f, const char *name, const float *x, const unsigned int len ) { + fprintf( f, "\"%s\":[", name ); + write_array_f32( f, x, len ); + fprintf( f, "]" ); +} + +/** +* Writes a named array of integers to a file as JSON. +* +* @param f file to write to +* @param name array name +* @param x data +* @param len array length +*/ +void write_named_array_i32( FILE *f, const char *name, const int *x, const unsigned int len ) { + fprintf( f, "\"%s\":[", name ); + write_array_i32( f, x, len ); + fprintf( f, "]" ); +} + +/** +* Writes data to a file as JSON. +* +* ## Notes +* +* - This function SHOULD be tailored to the input data (e.g., input types, output types, number of arguments, etc) and may vary from use case to use case. +* +* +* @param f file to write to +* @param lengths sequence lengths +* @param offsets twiddle offsets +* @param twiddles twiddle factors +* @param num number of sequence lengths +* @param total total number of twiddle values +*/ +void write_data_as_json( FILE *f, const int *lengths, const int *offsets, const float *twiddles, const unsigned int num, const unsigned int total ) { + fprintf( f, "{" ); + write_named_array_i32( f, "lengths", lengths, num ); + fprintf( f, "," ); + write_named_array_i32( f, "offsets", offsets, num ); + fprintf( f, "," ); + write_named_array_f32( f, "twiddles", twiddles, total ); + fprintf( f, "}\n" ); +} + +/** +* Generates test fixtures. +* +* @param lengths sequence lengths +* @param offsets twiddle offsets into flat output array +* @param num number of sequence lengths +* @param total total number of twiddle values +* @param name output filename +*/ +void generate( const int *lengths, const int *offsets, const unsigned int num, const unsigned int total, const char *name ) { + unsigned int i; + unsigned int j; + float *twiddles; + float *wsave; + FILE *f; + int off; + int n; + + // Allocate an output array: + twiddles = (float*) malloc( total * sizeof(float) ); + if ( twiddles == NULL ) { + printf( "Error allocating memory.\n" ); + exit( 1 ); + } + + // Generate fixture data: + for ( i = 0; i < num; i++ ) { + n = lengths[ i ]; + wsave = (float*) calloc( 2*n + 15, sizeof(float) ); + if ( wsave == NULL ) { + printf( "Error allocating memory.\n" ); + exit( 1 ); + } + rffti( n, wsave ); + + // Copy twiddle region into flat array (N values starting at wsave[n]): + off = offsets[ i ]; + for ( j = 0; j < (unsigned int)n; j++ ) { + twiddles[ off + j ] = wsave[ n + j ]; + } + free( wsave ); + } + // Open a new file: + f = fopen( name, "w" ); + if ( f == NULL ) { + printf( "Error opening file.\n" ); + exit( 1 ); + } + + // Write data as JSON: + write_data_as_json( f, lengths, offsets, twiddles, num, total ); + + // Close the file: + fclose( f ); + + // Free allocated memory: + free( twiddles ); +} + +/** +* Computes offsets into a flat twiddle array for each sequence length. +* +* @param offsets output array of offsets +* @param lengths sequence lengths +* @param num number of sequence lengths +* @return total number of twiddle values +*/ +unsigned int compute_offsets( int *offsets, const int *lengths, const unsigned int num ) { + unsigned int total; + unsigned int i; + + total = 0; + for ( i = 0; i < num; i++ ) { + offsets[ i ] = total; + total += lengths[ i ]; + } + return total; +} + +/** +* Main execution sequence. +*/ +int main( void ) { + unsigned int total; + unsigned int num; + int *lengths; + int *offsets; + + // Use the current time to seed the random number generator: + srand( time( NULL ) ); + + // Define the number of sequence lengths per range: + num = 10; + + // Allocate arrays: + lengths = (int*) malloc( num * sizeof(int) ); + if ( lengths == NULL ) { + printf( "Error allocating memory.\n" ); + exit( 1 ); + } + offsets = (int*) malloc( num * sizeof(int) ); + if ( offsets == NULL ) { + printf( "Error allocating memory.\n" ); + exit( 1 ); + } + + // Generate fixture data: + rand_array_i32( lengths, num, 2, 16 ); + total = compute_offsets( offsets, lengths, num ); + generate( lengths, offsets, num, total, "small.json" ); + + rand_array_i32( lengths, num, 16, 128 ); + total = compute_offsets( offsets, lengths, num ); + generate( lengths, offsets, num, total, "medium.json" ); + + rand_array_i32( lengths, num, 128, 1024 ); + total = compute_offsets( offsets, lengths, num ); + generate( lengths, offsets, num, total, "large.json" ); + + // Free allocated memory: + free( lengths ); + free( offsets ); + + return 0; +} diff --git a/lib/node_modules/@stdlib/fft/base/fftpack/float32/rffti/test/fixtures/c/fftpack/small.json b/lib/node_modules/@stdlib/fft/base/fftpack/float32/rffti/test/fixtures/c/fftpack/small.json new file mode 100644 index 000000000000..6c3ff37c4e9a --- /dev/null +++ b/lib/node_modules/@stdlib/fft/base/fftpack/float32/rffti/test/fixtures/c/fftpack/small.json @@ -0,0 +1 @@ +{"lengths":[5,10,7,2,6,2,11,14,9,6],"offsets":[0,5,15,22,24,30,32,43,57,66],"twiddles":[0,0,0,0,0,0.809017003,0.587785244,0.309016973,0.95105654,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0.49999997,0.866025448,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0.90096885,0.433883756,0.623489797,0.781831503,0.222520858,0.974927902,0,0,0,0,0,0,0,0,0.766044438,0.642787635,0,0.173648104,0.984807789,0,0,0,0,0.49999997,0.866025448,0,0,0,0]} diff --git a/lib/node_modules/@stdlib/fft/base/fftpack/float32/rffti/test/test.js b/lib/node_modules/@stdlib/fft/base/fftpack/float32/rffti/test/test.js new file mode 100644 index 000000000000..d4a89a7d87b4 --- /dev/null +++ b/lib/node_modules/@stdlib/fft/base/fftpack/float32/rffti/test/test.js @@ -0,0 +1,231 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 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 Float32Array = require( '@stdlib/array/float32' ); +var isAlmostSameValue = require( '@stdlib/number/float32/base/assert/is-almost-same-value' ); +var rffti = require( './../lib' ); + + +// FIXTURES // + +var small = require( './fixtures/c/fftpack/small.json' ); +var medium = require( './fixtures/c/fftpack/medium.json' ); +var large = require( './fixtures/c/fftpack/large.json' ); + + +// TESTS // + +tape( 'main export is a function', function test( t ) { + t.ok( true, __filename ); + t.strictEqual( typeof rffti, 'function', 'main export is a function' ); + t.end(); +}); + +tape( 'the function has an arity of 4', function test( t ) { + t.strictEqual( rffti.length, 4, 'returns expected value' ); + t.end(); +}); + +tape( 'the function returns a reference to the workspace array', function test( t ) { + var workspace; + var out; + var N; + + N = 8; + workspace = new Float32Array( ( 2*N ) + 34 ); + out = rffti( N, workspace, 1, 0 ); + + t.strictEqual( out, workspace, 'same reference' ); + t.end(); +}); + +tape( 'the function correctly initializes twiddle factors (small sequence lengths)', function test( t ) { + var workspace; + var expected; + var lengths; + var offsets; + var ulps; + var off; + var y; + var e; + var N; + var i; + var k; + + lengths = small.lengths; + offsets = small.offsets; + expected = small.twiddles; + + ulps = 1; + for ( k = 0; k < lengths.length; k++ ) { + N = lengths[ k ]; + off = offsets[ k ]; + workspace = new Float32Array( ( 2*N ) + 34 ); + rffti( N, workspace, 1, 0 ); + + t.strictEqual( workspace[ N-1 ], 0.0, 'returns expected value' ); + for ( i = 0; i < N; i++ ) { + y = workspace[ N+i ]; + e = expected[ off+i ]; + t.strictEqual( isAlmostSameValue( y, e, ulps ), true, 'within '+ulps+' ULPs. N: '+N+'. y: '+y+'. E: '+e ); + } + } + t.end(); +}); + +tape( 'the function correctly initializes twiddle factors (medium sequence lengths)', function test( t ) { + var workspace; + var expected; + var lengths; + var offsets; + var ulps; + var off; + var y; + var e; + var N; + var i; + var k; + + lengths = medium.lengths; + offsets = medium.offsets; + expected = medium.twiddles; + + ulps = 1; + for ( k = 0; k < lengths.length; k++ ) { + N = lengths[ k ]; + off = offsets[ k ]; + workspace = new Float32Array( ( 2*N ) + 34 ); + rffti( N, workspace, 1, 0 ); + + t.strictEqual( workspace[ N-1 ], 0.0, 'returns expected value' ); + for ( i = 0; i < N; i++ ) { + y = workspace[ N+i ]; + e = expected[ off+i ]; + t.strictEqual( isAlmostSameValue( y, e, ulps ), true, 'within '+ulps+' ULPs. N: '+N+'. y: '+y+'. E: '+e ); + } + } + t.end(); +}); + +tape( 'the function correctly initializes twiddle factors (large sequence lengths)', function test( t ) { + var workspace; + var expected; + var lengths; + var offsets; + var ulps; + var off; + var y; + var e; + var N; + var i; + var k; + + lengths = large.lengths; + offsets = large.offsets; + expected = large.twiddles; + + ulps = 1; + for ( k = 0; k < lengths.length; k++ ) { + N = lengths[ k ]; + off = offsets[ k ]; + workspace = new Float32Array( ( 2*N ) + 34 ); + rffti( N, workspace, 1, 0 ); + + t.strictEqual( workspace[ N-1 ], 0.0, 'returns expected value' ); + for ( i = 0; i < N; i++ ) { + y = workspace[ N+i ]; + e = expected[ off+i ]; + t.strictEqual( isAlmostSameValue( y, e, ulps ), true, 'within '+ulps+' ULPs. N: '+N+'. y: '+y+'. E: '+e ); + } + } + t.end(); +}); + +tape( 'the function does not modify the scratch region of the workspace', function test( t ) { + var workspace; + var N; + var i; + + N = 8; + workspace = new Float32Array( ( 2*N ) + 34 ); + + for ( i = 0; i < workspace.length; i++ ) { + workspace[ i ] = i + 1.0; + } + rffti( N, workspace, 1, 0 ); + for ( i = 0; i < N; i++ ) { + t.strictEqual( workspace[ i ], i + 1.0, 'returns expected value' ); + } + t.end(); +}); + +tape( 'the function does not modify the workspace when N is 1', function test( t ) { + var workspace; + var expected; + var N; + var i; + + N = 1; + workspace = new Float32Array( ( 2*N ) + 34 ); + for ( i = 0; i < workspace.length; i++ ) { + workspace[ i ] = i + 1.0; + } + expected = new Float32Array( workspace ); + + rffti( N, workspace, 1, 0 ); + + t.deepEqual( workspace, expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function correctly handles stride and offset parameters', function test( t ) { + var workspace; + var expected; + var stride; + var offset; + var nf; + var N; + var i; + + N = 8; + stride = 2; + offset = 3; + workspace = new Float32Array( offset + ( ( ( 2*N ) + 34 ) * stride ) ); + + rffti( N, workspace, stride, offset ); + + t.strictEqual( workspace[ offset + ( 2*N * stride ) ], N, 'returns expected value' ); + + nf = workspace[ offset + ( ( ( 2*N ) + 1 ) * stride ) ]; + t.strictEqual( nf, 2, 'returns expected value' ); + t.strictEqual( workspace[ offset + ( ( ( 2*N ) + 2 ) * stride ) ], 2, 'returns expected value' ); + t.strictEqual( workspace[ offset + ( ( ( 2*N ) + 3 ) * stride ) ], 4, 'returns expected value' ); + + expected = new Float32Array( ( 2*N ) + 34 ); + rffti( N, expected, 1, 0 ); + + for ( i = 0; i < N; i++ ) { + t.strictEqual( workspace[ offset + ( ( N+i ) * stride ) ], expected[ N+i ], 'returns expected value' ); + } + t.end(); +}); From dc06b555e8da7ed90beaa4a98b1d9342ba038483 Mon Sep 17 00:00:00 2001 From: Athan Date: Tue, 25 Aug 2026 01:46:59 -0700 Subject: [PATCH 2/2] refactor: remove float32 emulation for integer ops In FFTPACK, they reinterpret the workspace memory as an `int` array. As a consequence, we should emulate integer ops, not float ops. In this case, this just means floor division. Signed-off-by: Athan --- .../@stdlib/fft/base/fftpack/float32/rffti/lib/rffti1.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/node_modules/@stdlib/fft/base/fftpack/float32/rffti/lib/rffti1.js b/lib/node_modules/@stdlib/fft/base/fftpack/float32/rffti/lib/rffti1.js index 653e500530fd..5015415708e6 100644 --- a/lib/node_modules/@stdlib/fft/base/fftpack/float32/rffti/lib/rffti1.js +++ b/lib/node_modules/@stdlib/fft/base/fftpack/float32/rffti/lib/rffti1.js @@ -62,7 +62,7 @@ var sincosf = require( '@stdlib/math/base/special/sincosf' ).assign; var TWO_PI = require( '@stdlib/constants/float32/two-pi' ); -var floorf = require( '@stdlib/math/base/special/floorf' ); +var floor = require( '@stdlib/math/base/special/floor' ); var f32 = require( '@stdlib/number/float64/base/to-float32' ); var Float32Array = require( '@stdlib/array/float32' ); var decompose = require( '@stdlib/fft/base/fftpack/float32/decompose' ); @@ -135,10 +135,10 @@ function rffti1( N, twiddles, strideT, offsetT, factors, strideF, offsetF ) { factor = factors[ fidx ]; // Compute the length of the transform after including the current radix: - l2 = f32( factor * l1 ); + l2 = factor * l1; // Compute the number of the "butterfly wings" (at this stage, the data is viewed as a `factor`-point transform of sub-vectors of length `l1`; `M` describes how many such vectors fit in the full array of length `N`): - M = floorf( f32( N / l2 ) ); + M = floor( N / l2 ); // Initialize a running offset used to step the angle: ld = 0;