Expand description
Transcendental functions, called as math::hypot(x, y) the way the C sources call
hypot(x, y).
On macOS, f64::hypot and friends call the system libm, the same one C Graphviz uses, so
the port reproduces C’s last bits. On other targets Rust takes them from a different libm
(glibc on Linux, compiler-builtins’ musl port on wasm32) that disagrees in the last ulp on
some inputs, which is enough to change a force-directed layout. Every call in the port goes
through this module, and on those targets it uses [portable] implementations: a
reproduction of Apple’s hypot, and the libm crate (the musl port Rust itself uses on
wasm32) for the rest, so that every non-Apple target computes the same bits. See docs/porting/libm.md.
sqrt and mul_add are correctly rounded everywhere and stay f64 methods.
Enums§
- Profile
- Which libm this build computes with. The corpus ratchets keep one baseline per profile:
Appleresults are C’s bit for bit,Portableones document the gap to C (seedocs/porting/libm.md).
Constants§
- PORTABLE
- Whether this build uses [
portable] rather than the platform libm. Theportable-mathfeature forces it on macOS, to check the portable code against the corpus natively. - PROFILE
- The math profile of this build.