Skip to content

hypot function in cfavml #14

@skewballfox

Description

@skewballfox

mentioned in #13 this would be a useful operation to have for (float) operations in cfavml itself. for subnormal or large numbers, computing it directly will lead to underflow or overflow. I'm in the process of adapting the implementation laid out here. link to copy on rust playground, the versions worth looking at are lines 73 and 87.

The tldr is to get the abs max of the inputs (hi), factor out the nearest 2 power < hi, and scale the subnormal inputs. Working on testing for subnormal inputs because I'm still trying to wrap my head around the scaling part.

I don't think this should be part of simd register, partially because this only make sense for float types, but it can't be handled separately the way cosine is. Should we create a separate trait for common floating point ops?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions