feat: add fft/base/fftpack/rfftf#12002
Draft
gunjjoshi wants to merge 1 commit intostdlib-js:developfrom
Draft
Conversation
---
type: pre_commit_static_analysis_report
description: Results of running static analysis checks when committing changes.
report:
- task: lint_filenames
status: passed
- task: lint_editorconfig
status: passed
- task: lint_markdown
status: na
- task: lint_package_json
status: na
- task: lint_repl_help
status: na
- task: lint_javascript_src
status: passed
- task: lint_javascript_cli
status: na
- task: lint_javascript_examples
status: na
- task: lint_javascript_tests
status: na
- task: lint_javascript_benchmarks
status: na
- task: lint_python
status: na
- task: lint_r
status: na
- task: lint_c_src
status: na
- task: lint_c_examples
status: na
- task: lint_c_benchmarks
status: na
- task: lint_c_tests_fixtures
status: na
- task: lint_shell
status: na
- task: lint_typescript_declarations
status: passed
- task: lint_typescript_tests
status: na
- task: lint_license_headers
status: passed
---
Member
Author
|
Opened this draft PR to discuss the implementation or ask questions, if any, and to track progress. |
gunjjoshi
commented
May 8, 2026
Comment on lines
+65
to
+66
| var TAUR = -0.5; // cos( 2π/3 ) | ||
| var TAUI = 0.866025403784439; // sin( 2π/3 ) |
Member
Author
There was a problem hiding this comment.
I could have used math/base/special/sin and math/base/special/cos here, but instead I have hardcoded the exact constants used in pffft (Ref: https://github.com/marton78/pffft/blob/master/src/fftpack.c#L1308), to be as close as possible, to the actual results. Using math/base/special/sin and math/base/special/cos leads to slightly off results. If we are fine with that, I'll replace these hardcoded constants with stdlib functions.
Member
Author
There was a problem hiding this comment.
Not must difference for sin, but there is some difference for cos:
In [5]: var cos = require('@stdlib/math/base/special/cos')
Out[5]: [Function: cos]
In [6]: cos((2*pi)/3)
Out[6]: -0.4999999999999998
In [7]: var cos = require('@stdlib/math/base/special/cosf')
Out[7]: [Function: cosf]
In [8]: var pi = require('@stdlib/constants/float32/pi')
Out[8]: 3.1415927410125732
In [9]: cos((2*pi)/3)
Out[9]: -0.5000000596046448
In [10]:
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
type: pre_commit_static_analysis_report
description: Results of running static analysis checks when committing changes. report:
Resolves None.
Description
This pull request:
fft/base/fftpack/rfftf, which is a part of fftpack.fft/base/fftpack#4121.Related Issues
This pull request has the following related issues:
None.
Questions
No.
Other
No.
Checklist
AI Assistance
If you answered "yes" above, how did you use AI assistance?
Disclosure
Used AI to understand the implementation, reason about specific choices and to help write equations and explanations in implementation comments. Also referred it to understand the working of FFTs.
@stdlib-js/reviewers