Skip to content

RFC: Add support for computing the reciprocal square root (rsqrt) #221

@kgryte

Description

@kgryte

Checklist

Please ensure the following tasks are completed before submitting a feature request.

  • Read and understood the Code of Conduct.
  • Searched for existing issues and pull requests.
  • The issue name begins with RFC:.

Description

Description of the feature request.

This RFC proposes adding support for computing the reciprocal square root (i.e., 1/sqrt(x)). The implementation is trivial:

/**
* @param {number} x - input value
* @returns {number} reciprocal square root
*/
function rsqrt( x ) {
    return 1.0 / sqrt( x );
}

The rationale behind providing this API is to provide a declarative interface, rather than imperatively writing out the intended behavior. As the implementation is small, modern compilers should readily inline the implementation, thus not affecting performance if used within other implementations.

Package: @stdlib/math/base/special/rsqrt
Alias: rsqrt.

Related Issues

Does this feature request have any related issues?

No.

Questions

Any questions for reviewers?

No.

Other

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

No.

Metadata

Metadata

Assignees

No one assigned

    Labels

    FeatureIssue or pull request for adding a new feature.Good First IssueA good first issue for new contributors!Help WantedExtra attention is needed.MathIssue or pull request specific to math functionality.RFCRequest for comments. Feature requests and proposed changes.difficulty: 1Low degree of difficulty. Should be straightforward to implement and/or resolve.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions