MPFR-based correctness testing for Mojo 🔥

This project is a proof of concept (PoC) that demonstrates how we can use the MPFR library as a “gold standard” to test the correctness of mathematical functions implemented in Mojo. MPFR is an efficient C library for multiple-precision floating-point computations with correct rounding. It is used to test numerical routines in projects such as CORE-MATH, LLVM-libc, and RLIBM. By comparing the outputs of our custom Mojo functions with MPFR, we can ensure that our implementations are correctly rounded or at least as accurate as possible within specific memory or latency requirements. Main Features: - Provides a routine to convert MPFR values into lower-precision floating-point types (like float16 and bfloat16), avoiding double rounding errors. - Supports correctness testing under multiple IEEE 754 rounding modes. - Includes utilities to change and check rounding mode at runtime. Project Repository 🔗 github.com/leandrolcampos/mpfr-for-mojo
GitHub
GitHub - leandrolcampos/mpfr-for-mojo: MPFR-based testing for Mojo ...
MPFR-based testing for Mojo 🔥. Contribute to leandrolcampos/mpfr-for-mojo development by creating an account on GitHub.
4 Replies
Robert
Robert•2mo ago
This looks cool awesome work :mojonightly: đź‘Ś
Caroline
Caroline•4w ago
Hi @Leandro Campos, any interest in talking about this project in our upcoming community meeting on February 3rd?
Leandro Campos
Leandro CamposOP•4w ago
Hi @Caroline! I’d love to talk about this project in a community meeting, but I’d prefer not to do it at the next one. I’d like to finish the tasks in the project roadmap first so I can share results and discuss next steps. Is that okay? Thanks for the opportunity!
Caroline
Caroline•4w ago
Sounds good! No worries

Did you find this page helpful?