Skip to content
This repository was archived by the owner on Apr 28, 2025. It is now read-only.
This repository was archived by the owner on Apr 28, 2025. It is now read-only.

Internal usage of f64 in some f32 functions #118

Closed
@korken89

Description

@korken89

Hi, I had a look over the library and something struck me as odd.

For example in sinf and k_sinf the input arguments are being cast up into f64, which will incur a significant run-time cost on no_std systems which only has an single precision floating point unit.
Moreover, the calculation being done in, for example here:
https://github.com/japaric/libm/blob/3932e2ea8e7e8f782cea6b243c3032d415b8afeb/src/math/sinf.rs#L62
The f64 is only used for sums, which does not need the extra precision given by f64.

This looks like a copy/paste bug to me, but I would like to hear your reasoning about this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions