PDF, CDF, and percent-point/quantile functions for the normal and Student’s t distributions
Add the header to your project.
There is also support for CMake and FetchContent:
include(FetchContent)
FetchContent_Declare(dist GIT_REPOSITORY https://github.com/ankane/dist.h.git GIT_TAG v0.3.1)
FetchContent_MakeAvailable(dist)
target_link_libraries(app PRIVATE dist::dist)Include the header
#include "dist.h"normal_pdf(x, mean, std_dev);
normal_cdf(x, mean, std_dev);
normal_ppf(p, mean, std_dev);students_t_pdf(x, df);
students_t_cdf(x, df);
students_t_ppf(p, df);- Algorithm AS 241: The Percentage Points of the Normal Distribution
- Algorithm 395: Student’s t-distribution
- Algorithm 396: Student’s t-quantiles
View the changelog
Everyone is encouraged to help improve this project. Here are a few ways you can help:
- Report bugs
- Fix bugs and submit pull requests
- Write, clarify, or fix documentation
- Suggest or add new features
To get started with development:
git clone https://github.com/ankane/dist.h.git
cd dist.h
gcc -Wall -Wextra -Werror -o test/main test/main.c -lm
test/main