{"id":21202710,"url":"https://github.com/minoki/math-func-test","last_synced_at":"2026-04-25T08:33:07.031Z","repository":{"id":66929136,"uuid":"310832699","full_name":"minoki/math-func-test","owner":"minoki","description":null,"archived":false,"fork":false,"pushed_at":"2025-12-20T04:00:59.000Z","size":744,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-01-02T23:14:31.149Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C++","has_issues":true,"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/minoki.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":"2020-11-07T11:47:34.000Z","updated_at":"2025-12-21T07:29:23.000Z","dependencies_parsed_at":"2023-02-23T04:31:03.458Z","dependency_job_id":null,"html_url":"https://github.com/minoki/math-func-test","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/minoki/math-func-test","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/minoki%2Fmath-func-test","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/minoki%2Fmath-func-test/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/minoki%2Fmath-func-test/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/minoki%2Fmath-func-test/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/minoki","download_url":"https://codeload.github.com/minoki/math-func-test/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/minoki%2Fmath-func-test/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32255275,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-25T04:23:17.126Z","status":"ssl_error","status_checked_at":"2026-04-25T04:21:53.360Z","response_time":59,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":[],"created_at":"2024-11-20T20:17:45.963Z","updated_at":"2026-04-25T08:33:07.026Z","avatar_url":"https://github.com/minoki.png","language":"C++","funding_links":[],"categories":["C++"],"sub_categories":[],"readme":"# 数学関数がどのくらい「正しい値」から離れているかテストしてみた\n\nC言語の規格では（たとえAnnex Fの下でも）sinやexpなどの超越関数の精度を規定していない。\n\n世の中のlibm実装がどのぐらい「正しく丸められた値」から外れた値を返すのか調査してみた。\n\nリファレンス実装（「正しく丸められた値」を得るための実装）としてはMPFRを使用した。\n\n現在のところ、sin, exp, powについて検証した。\n\n## sin\n\nx=2^n (-1000\u003c=n\u003c=1000) の形の入力に対してテストした。\n\n### glibc (x86\\_64, AArch64)\n\n試した実装の中では（MPFRを除いて）最も優秀である。\n\nx=`0x1p+25`, `0x1p+938`の2つを除いて正しく丸められた答えを返した。\n「正しい丸め」と異なる結果を返した2つについても、差は1ulp以内だった。\n\n### FreeBSD (x86\\_64), Linux musl (x86\\_64, AArch64)\n\n試した範囲では、全ての入力に対して1ulp以内の答えを返した。\n\nmuslはFreeBSDの実装と全く同じ結果を返した。muslの数学関数はBSDベースだとどこかで読んだ気もする。\n\n### macOS (x86\\_64)\n\n差が1ulpを超えるものも多くみられた。\n\n### Windows mingw-w64 (x86\\_64)\n\nかなりずれている。\n\n### Windows MSVS2019 (x86\\_64)\n\n試した範囲では、全ての入力に対して1ulp以内の答えを返した。\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fminoki%2Fmath-func-test","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fminoki%2Fmath-func-test","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fminoki%2Fmath-func-test/lists"}