libm

A port of MUSL's libm to Rust. (by rust-lang)

Libm Alternatives

Similar projects and alternatives to libm

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a better libm alternative or higher similarity.

libm reviews and mentions

Posts with mentions or reviews of libm. We have used some of these posts to build our list of alternatives and similar projects. The last one was on 2022-02-08.
  • `libm-0.2.6` dependency fails to build for Mac M1
    1 project | /r/rust | 25 Apr 2023
    Yes I took a look at build.rs. There's nothing here that stands out to me. Building the project on my Ubuntu machine works btw.
  • Rust f64::tan() twice as slow as Go math.Tan()
    2 projects | /r/rust | 8 Feb 2022
    The more interesting code is the "kernel" tangent function https://github.com/rust-lang/libm/blob/master/src/math/k_tan.rs . I don't see any numerical analysis of accuracy in either the Rust lib or the MUSL source lib, but from one of the comments it looks like it's intended to be within 1ULP, which is what I'd expect.
  • Slow performance in Rust compared to Go and C# with math, especially f64::tan()
    2 projects | /r/rust | 7 Feb 2022
    It's nowhere near complete, but: https://github.com/rust-lang/libm
  • Algorithm to compute Trigonometric functions
    1 project | /r/algorithms | 13 Jan 2022
    Inaccurate fast implementations use polynomial approximation. Accurate implementations use high-powered argument reduction and then polynomial approximation. Everything is polynomial approximation.
  • Porting Rust's std to rustix
    6 projects | /r/rust | 4 Jan 2022
    It looks like https://github.com/rust-lang/libm/pull/249 may be a fix for this.
  • ELI5: How does calculator know and use pi if even super computers can't know all the digits. Does it use like first 100 digits?
    1 project | /r/explainlikeimfive | 16 May 2021
    In order to be standards-compliant, computer math libraries need to have a lot more digits of pi than should be strictly necessary. Accurately calculating sine in the upper reaches of double precision floats requires computer to have a table of about 100 digits of pi (or rather pi/2 for technically reasons) and 500 digits of 2/pi - here is an example.
  • Cross-platform deterministic physics with Unity DOTS physics and soft floats
    5 projects | /r/Unity3D | 15 Feb 2021
    So, fixed-point numbers weren't the solution to the problem either. The next thing I came across was the Rapier physics engine. It promises cross-platform determinism all IEEE 754-2008 compliant platforms. Although it's written in Rust, creating C# bindings was fairly easy, and I could use it in Unity after a few hours. But Rapier is still in early stages of development, which means that (at the time of writing this) it lacked many features, like raycasting, which would have been necessary for my project. Also, it's only deterministic on IEEE 754-2008 compliant platforms. But I couldn't really find any information on which processors support it. Even if I did, I still wanted to have deterministic physics on all platforms, not just on "most of them". But I still wondered does how Rapier achieve cross-platform floating point determinism. Supporting only IEEE 754-2008 compliant platforms is one thing, but the mathematical functions I mentioned above (sqrt, trigonometry, etc.) must also be deterministic. I found out that it uses libm, which implements all of these functions in software. It was primarily designed for embedded systems without FPUs, but it turns out it's also pretty useful for making this part of floating point math deterministic. But after all, the basic mathematical operations of floats are still not deterministic. Unless... How about emulating the behavior of floats in software? It should be possible to write a program that works on the byte representation of a float, doing all operations using integer arithmentic... right?
  • A note from our sponsor - WorkOS
    workos.com | 23 Apr 2024
    The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning. Learn more →

Stats

Basic libm repo stats
8
497
5.5
12 days ago

rust-lang/libm is an open source project licensed under Apache License 2.0 which is an OSI approved license.

The primary programming language of libm is Rust.


Sponsored
SaaSHub - Software Alternatives and Reviews
SaaSHub helps you find the best software and product alternatives
www.saashub.com