Skip to content

hypot(): simple sqrt(u*u + v*v) this is not the same as the original mlib provides #10906

@denizzzka

Description

@denizzzka

Module std.math.algebraic provides well known function hypot(). Internally it returns just:

return ratio * sqrt(u*u + v*v);

But as I know the purpose of hypot() function's within the original implementation in mlib was significant accelerating executon of the hypotenuse length by reusing intermediate values ​​in calculations appeared during calculation of power and then root. Also CPUs (x86?) provided instruction for this.

Has anything changed since then? (Maybe modern compilers automatically replace by some intrinsic code like sqrt(u*u + v*v)?)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions