{"id":23870498,"url":"https://github.com/inkydragon/core-math","last_synced_at":"2025-10-29T06:55:04.743Z","repository":{"id":270768501,"uuid":"909361266","full_name":"inkydragon/core-math","owner":"inkydragon","description":"Unofficial mirror of CORE-MATH: https://gitlab.inria.fr/core-math/core-math","archived":false,"fork":false,"pushed_at":"2025-06-07T04:46:58.000Z","size":201472,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-29T06:54:54.490Z","etag":null,"topics":["correct-rounding","libm"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/inkydragon.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-12-28T13:25:00.000Z","updated_at":"2025-06-07T04:47:56.000Z","dependencies_parsed_at":"2025-10-06T01:43:50.435Z","dependency_job_id":null,"html_url":"https://github.com/inkydragon/core-math","commit_stats":null,"previous_names":["inkydragon/core-math"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/inkydragon/core-math","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/inkydragon%2Fcore-math","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/inkydragon%2Fcore-math/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/inkydragon%2Fcore-math/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/inkydragon%2Fcore-math/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/inkydragon","download_url":"https://codeload.github.com/inkydragon/core-math/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/inkydragon%2Fcore-math/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":281577711,"owners_count":26524886,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-29T02:00:06.901Z","response_time":59,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["correct-rounding","libm"],"created_at":"2025-01-03T14:00:06.829Z","updated_at":"2025-10-29T06:54:59.735Z","avatar_url":"https://github.com/inkydragon.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# The CORE-MATH project\n\nCORE-MATH Mission: provide on-the-shelf open-source mathematical\nfunctions with correct rounding that can be integrated into current\nmathematical libraries (GNU libc, Intel Math Library, AMD Libm,\nNewlib, OpenLibm, Musl, Apple Libm, llvm-libc, CUDA libm, ROCm).\n\nHomepage: https://core-math.gitlabpages.inria.fr/\n\n\n## Quick guide\n\n### Exhaustive checks\n\nTo run an exhaustive check of a single-precision single-argument\nfunction, run:\n\n    ./check.sh --exhaustive [rounding_modes] $FUN\n\nwhere:\n- `$FUN` can be `acosf`, `asinf`, etc.\n- `[rounding_modes]` can be a selection of `--rndn` (round to\n  nearest), `--rndz` (toward zero), `--rndu` (upwards), `--rndd`\n  (downwards). The default is all four.\n\nThis command is sensitive to the following environment variables:\n- `CC`\n- `CFLAGS`\n- OpenMP variables such as `OMP_NUM_THREADS`\n\nNote: on Debian, you need the libomp-dev package to use clang.\n\n### Worst case checks\n\nThese checks are available for bivariate single-precision functions,\nand double-precision functions.\n\n    ./check.sh --worst [rounding_modes] $FUN\n\n### Special checks\n\nThese checks are available for functions where some interesting worst\ncases can be automatically (and cheaply) computed (at the time of\nwriting, only `hypotf` and `cbrt`).\n\n    ./check.sh --special [rounding_modes] $FUN\n\n### Performance measurements\n\nPerformance measurement scripts rely on the Linux perf framework. You\nmight need to run the command:\n\n    echo -1 \u003e /proc/sys/kernel/perf_event_paranoid\n\nas root before running the following commands.\n\nTo evaluate the reciprocal throughput of some function, run:\n\n    ./perf.sh acosf\n\nIt outputs two numbers: the performance of core-math, and the one the\nlibc, in cycles/call. You can also evaluate the performance of some\nother libm (given by a static .a archive, typically llvmlibc), by\nsetting the `LIBM` environment variable to the absolute path of the .a\nfile. In the case, `./perf.sh` will output three numbers: the\nperformances of core-math, standard libm, given libm.\n\nTo evaluate performance of all supported functions, run:\n\n    ./perf-all.sh\n\nYou can also set the `PERF_ARGS` environment variable to `--latency`\nto get latency instead of reciprocal throughput.\n\nWhen you run ./perf.sh acosf, it does the following:\n\n   $ export OPENMP=-fopenmp\n   $ cd src/binary32/acos\n   $ make clean\n   $ make CFLAGS=\"-O3 -march=native\"\n   $ ./perf --file /tmp/randoms.dat --reference --count 1000000\n   $ perf stat ./perf --file /tmp/randoms.dat --count 1000000 --repeat 1000\n\nand it reports the number of cycles given by perf (divided by 10^9).\n\n## Layout\n\nEach function `$NAME` has a dedicated directory\n`src/$TYPE/$SHORT_NAME`, where `$TYPE` can be `binary{32,64,80,128}`\nand `$SHORT_NAME` is the function name without its type suffix\n(`acos`, `asin`, etc.). This directory contains the following files:\n- `$NAME.c`: a standalone implementation of function `cr_$NAME`\n- other support files\n\n\n## How to add support for a new function?\n\nYou can take inspiration from a similar function of the same bitsize\nand/or arity.\n\nFor example, suppose you want to add support for a binary64 bivariate\nfunction `foo`. In `src/binary64/foo`, you will need the following\nfiles:\n- `foo.c`: defining `cr_foo`\n- `foo.wc`: the worst cases to be tested\n- `foo_mpfr.c`: defining `ref_foo`, using MPFR\n- `Makefile`: defining `FUNCTION_UNDER_TEST`, and including `../support/Makefile.bivariate`\n- `function_under_test.h`: defining `{cr,ref}_function_under_test`\n\nIn addition, in `src/generic/foo`, you will need the following file:\n- `random_under_test.h`: defining a function `random_under_test`,\n  which samples suitable inputs for `foo`\n\n## Notes\n\nThe CORE-MATH code assumes all double-precision computations are rounded to\ndouble precision. On x86 processors where these computations are performed\non the x87 FPU, the user should set up the rounding precision to double\nprecision (on Linux it is set to double-extended by default).\n\nThere might be some contradictions between correct rounding and some optional\nrequirements of the POSIX standard. In such a case, CORE-MATH chooses to\nreturn the correctly rounded result.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finkydragon%2Fcore-math","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Finkydragon%2Fcore-math","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finkydragon%2Fcore-math/lists"}