Skip to content

Conversation

anandkaranubc
Copy link
Contributor

Resolves None

Description

What is the purpose of this pull request?

This pull request:

  • Adds tests to validate kernelCos against the Julia implementation.

Related Issues

Does this pull request have any related issues?

This pull request:

  • resolves None

Questions

Any questions for reviewers of this pull request?

No.

Other

Any other information relevant to this pull request? This may include screenshots, references, and/or implementation notes.

No.

Checklist

Please ensure the following tasks are completed before submitting this pull request.


@stdlib-js/reviewers

@stdlib-bot stdlib-bot added Math Issue or pull request specific to math functionality. Needs Review A pull request which needs code review. labels Mar 7, 2025
@anandkaranubc
Copy link
Contributor Author

Once this is approved, I will do the same for kernelSin and kernelTan

@stdlib-bot
Copy link
Contributor

stdlib-bot commented Mar 7, 2025

Coverage Report

Package Statements Branches Functions Lines
math/base/special/kernel-cos $\color{red}326/330$
$\color{green}+98.79\%$
$\color{red}9/11$
$\color{green}+81.82\%$
$\color{green}4/4$
$\color{green}+100.00\%$
$\color{red}326/330$
$\color{green}+98.79\%$

The above coverage report was generated for the changes in this PR.

---
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: na
  - 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: na
  - task: lint_typescript_tests
    status: na
  - task: lint_license_headers
    status: passed
---
@anandkaranubc anandkaranubc requested a review from kgryte March 8, 2025 01:26
anandkaranubc and others added 2 commits March 8, 2025 09:58
---
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: na
  - task: lint_javascript_cli
    status: na
  - task: lint_javascript_examples
    status: na
  - task: lint_javascript_tests
    status: passed
  - 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: na
  - task: lint_typescript_tests
    status: na
  - task: lint_license_headers
    status: passed
---
delta = abs( out - expected[ i ] );

// NOTE: the tolerance here is larger than for the JavaScript implementation due to compiler optimizations which may be performed resulting in result divergence. For discussion, see https://github.com/stdlib-js/stdlib/pull/2298#discussion_r1624765205
tol = EPS * abs( expected[ i ] );
Copy link
Contributor Author

@anandkaranubc anandkaranubc Mar 8, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If CFLAGS="-ffp-contract=off" is used while building the native add-on, I can confirm that adding this is not needed.

@anandkaranubc anandkaranubc changed the title test: validate kernelCos against Julia implementation test: validate implementation against Julia test fixtures Mar 10, 2025
@kgryte kgryte added Tests Pull requests specifically adding tests. and removed Needs Review A pull request which needs code review. labels Mar 10, 2025
Copy link
Member

@kgryte kgryte left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@kgryte kgryte merged commit a12b502 into stdlib-js:develop Mar 10, 2025
31 checks passed
@anandkaranubc anandkaranubc deleted the test/kernel-cos branch May 10, 2025 14:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Math Issue or pull request specific to math functionality. Tests Pull requests specifically adding tests.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants