{"id":28000669,"url":"https://github.com/sysprog21/compute-pi","last_synced_at":"2025-05-08T23:54:08.513Z","repository":{"id":72389244,"uuid":"69045476","full_name":"sysprog21/compute-pi","owner":"sysprog21","description":"Leibniz formula for π","archived":false,"fork":false,"pushed_at":"2019-10-02T18:30:56.000Z","size":20,"stargazers_count":11,"open_issues_count":0,"forks_count":106,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-05-08T23:54:04.057Z","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":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sysprog21.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2016-09-23T17:14:56.000Z","updated_at":"2025-02-23T04:28:35.000Z","dependencies_parsed_at":"2023-06-14T17:00:41.408Z","dependency_job_id":null,"html_url":"https://github.com/sysprog21/compute-pi","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sysprog21%2Fcompute-pi","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sysprog21%2Fcompute-pi/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sysprog21%2Fcompute-pi/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sysprog21%2Fcompute-pi/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sysprog21","download_url":"https://codeload.github.com/sysprog21/compute-pi/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253166484,"owners_count":21864471,"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","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":"2025-05-08T23:54:07.880Z","updated_at":"2025-05-08T23:54:08.508Z","avatar_url":"https://github.com/sysprog21.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 採用離散積分的方法求圓周率，並著手透過 SIMD 指令作效能最佳化\n\nAuthored by Lee Chao Yuan `\u003ccharles620016@gmail.com\u003e`\n\n![](https://raw.githubusercontent.com/charles620016/embedded-fall2015/master/hw1-computePi/screenshot/integral.png)\n\n## 相關連結\n\n* [開發紀錄與效能分析](https://charles620016.hackpad.com/Charles-Week-1-kBMD0GhbC7d)\n* [Leibniz formula for π](https://en.wikipedia.org/wiki/Leibniz_formula_for_%CF%80)\n\n## Baseline 版本\n\n```c\ndouble computePi_v1(size_t N)\n{\n    double pi = 0.0;\n    double dt = 1.0 / N;                // dt = (b-a)/N, b = 1, a = 0\n    for (size_t i = 0; i \u003c N; i++) {\n        double x = (double) i / N;      // x = ti = a+(b-a)*i/N = i/N\n        pi += dt / (1.0 + x * x);       // integrate 1/(1+x^2), i = 0....N\n    }\n    return pi * 4.0;\n}\n```\n\n## Benchmarking\n\n![](https://raw.githubusercontent.com/charles620016/embedded-fall2015/master/hw1-computePi/screenshot/time_command.png)\n\n![](https://raw.githubusercontent.com/charles620016/embedded-fall2015/master/hw1-computePi/screenshot/Wall-clock_time.png)\n\n![](https://raw.githubusercontent.com/charles620016/embedded-fall2015/master/hw1-computePi/screenshot/CPU_time.png)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsysprog21%2Fcompute-pi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsysprog21%2Fcompute-pi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsysprog21%2Fcompute-pi/lists"}