{"id":26578831,"url":"https://github.com/pprunty/hart_approximation","last_synced_at":"2025-03-23T05:17:14.317Z","repository":{"id":168300394,"uuid":"472782149","full_name":"pprunty/hart_approximation","owner":"pprunty","description":null,"archived":false,"fork":false,"pushed_at":"2023-11-23T23:41:33.000Z","size":956,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2023-11-24T00:27:45.742Z","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/pprunty.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}},"created_at":"2022-03-22T13:33:55.000Z","updated_at":"2022-03-22T13:34:15.000Z","dependencies_parsed_at":"2023-11-24T00:27:11.724Z","dependency_job_id":"8e6fe15f-9352-410f-84dc-c4524cbfcd5d","html_url":"https://github.com/pprunty/hart_approximation","commit_stats":null,"previous_names":["pprunty/hart_approximation"],"tags_count":0,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pprunty%2Fhart_approximation","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pprunty%2Fhart_approximation/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pprunty%2Fhart_approximation/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pprunty%2Fhart_approximation/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pprunty","download_url":"https://codeload.github.com/pprunty/hart_approximation/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245056898,"owners_count":20553856,"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-03-23T05:17:13.494Z","updated_at":"2025-03-23T05:17:14.307Z","avatar_url":"https://github.com/pprunty.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"Part of a college assignment...\n\n# Hart Approximation to Normal Distribution\n\nThis is a simple program that implements Hart's polynomial approximation to the Normal or Gaussian\ndistribution. The method provides a high precision approximation of the cumulative distribution\nfunction (C.D.F) whose implementation lends itself to C++ since we can use constexpressions to evaluate\nmany of the values needed for the polynomial approximation at run time. The results are comparable in \nspeed and precision to that of the Boost C++ Libraries.\n\n## Contents\n\n1. [Overview](#overview)\n2. [Requirements](#requirements)\n3. [Compilation and Usage](#compilation-and-usage)\n4. [Known Issues](#known-issues)\n\n## Overview\n\nThe Gaussian object allows calculations for the ERF, CDF and PDF of a Gaussian object with given mean\nand stdev.\n\n\n## Requirements\n\n- gcc\n- gnuplot (if you would like to produce graphics)\n- gsl (for using Sobol qrng, otherwise comment out that part of the code (L.48-56 in coord.cc))\n\n## Compilation and Usage\n\nTo compile the code simply run the following command inside a terminal in the project directory:\n\n```shell\nmake\n```\n\nTo run a test on the code, simply run the following command inside a terminal in the project directory:\n\n```shell\n./main\n```\n\nNote: I know I can add this to the Makefile as 'make plot' but I prefer to leave the commands here so I can return to them.\n\n## Results\n\nUsing Hart Approximation we see that we get very similar results to that of the Gaussian object used in the\nBoost library. Likewise, we get similar, if not better performance output using Hart Approximation.\n\n```shell\n\nNormal Distribution with mean = 0.000000 and stdev = 1.000000\n-----------------------------------------------------------\n  x           Phi(x)             Method \n-3.0    0.00134989803163        Hart approx.\n-3.0    0.00134989803163        BOOST Library.\n-2.0    0.02275013194818        Hart approx.\n-2.0    0.02275013194818        BOOST Library.\n-1.0    0.15865525393146        Hart approx.\n-1.0    0.15865525393146        BOOST Library.\n-0.5    0.30853753872599        Hart approx.\n-0.5    0.30853753872599        BOOST Library.\n 0.0    0.50000000000000        Hart approx.\n 0.0    0.50000000000000        BOOST Library.\n 0.5    0.69146246127401        Hart approx.\n 0.5    0.69146246127401        BOOST Library.\n 1.0    0.84134474606854        Hart approx.\n 1.0    0.84134474606854        BOOST Library.\n 2.0    0.97724986805182        Hart approx.\n 2.0    0.97724986805182        BOOST Library.\n 3.0    0.99865010196837        Hart approx.\n 3.0    0.99865010196837        BOOST Library.\n-----------------------------------------------------------\n\n\nNormal Distribution with mean = 1.00000000000000 and stdev = 2.00000000000000\n-----------------------------------------------------------\n  x           Phi(x)             Method \n-3.0    0.02275013194818        Hart approx.\n-3.0    0.02275013194818        BOOST Library.\n-2.0    0.06680720126886        Hart approx.\n-2.0    0.06680720126886        BOOST Library.\n-1.0    0.15865525393146        Hart approx.\n-1.0    0.15865525393146        BOOST Library.\n-0.5    0.22662735237687        Hart approx.\n-0.5    0.22662735237687        BOOST Library.\n 0.0    0.30853753872599        Hart approx.\n 0.0    0.30853753872599        BOOST Library.\n 0.5    0.40129367431708        Hart approx.\n 0.5    0.40129367431708        BOOST Library.\n 1.0    0.50000000000000        Hart approx.\n 1.0    0.50000000000000        BOOST Library.\n 2.0    0.69146246127401        Hart approx.\n 2.0    0.69146246127401        BOOST Library.\n 3.0    0.84134474606854        Hart approx.\n 3.0    0.84134474606854        BOOST Library.\n-----------------------------------------------------------\n\nCPU time used (per clock_gettime()): 0.016768 seconds.\n\n```\n\n## Known Issues\n\nNone at present.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpprunty%2Fhart_approximation","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpprunty%2Fhart_approximation","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpprunty%2Fhart_approximation/lists"}