{"id":28508992,"url":"https://github.com/tryggvigy/cdflib_wasm","last_synced_at":"2025-07-12T23:32:37.594Z","repository":{"id":40402887,"uuid":"263466358","full_name":"tryggvigy/cdflib_wasm","owner":"tryggvigy","description":"cdflib in WebAssembly. Compute cumulative distribution functions, inverses, and parameters of statistical distributions","archived":false,"fork":false,"pushed_at":"2023-01-06T05:44:25.000Z","size":2134,"stargazers_count":4,"open_issues_count":9,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-07-02T22:36:31.770Z","etag":null,"topics":["cdflib","cumulative-distribution-function"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tryggvigy.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}},"created_at":"2020-05-12T22:29:13.000Z","updated_at":"2025-05-04T20:43:11.000Z","dependencies_parsed_at":"2023-02-05T11:16:26.190Z","dependency_job_id":null,"html_url":"https://github.com/tryggvigy/cdflib_wasm","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/tryggvigy/cdflib_wasm","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tryggvigy%2Fcdflib_wasm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tryggvigy%2Fcdflib_wasm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tryggvigy%2Fcdflib_wasm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tryggvigy%2Fcdflib_wasm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tryggvigy","download_url":"https://codeload.github.com/tryggvigy/cdflib_wasm/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tryggvigy%2Fcdflib_wasm/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264586781,"owners_count":23632679,"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":["cdflib","cumulative-distribution-function"],"created_at":"2025-06-08T22:07:05.509Z","updated_at":"2025-07-12T23:32:37.282Z","avatar_url":"https://github.com/tryggvigy.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# cdflib_wasm\n\ncdflib_wasm is a WebAssembly packaging of the [cdflib library](http://www.netlib.org/random/)\nas it appears in the [presto](https://github.com/scottransom/presto/blob/master/src/dcdflib.c) project.\n\n\u003e This library contains routines to compute cumulative distribution\n\u003e functions, inverses, and parameters of the distribution for the\n\u003e following set of statistical distributions:\n\n    (1) Beta\n    (2) Binomial\n    (3) Chi-square\n    (4) Noncentral Chi-square\n    (5) F\n    (6) Noncentral F\n    (7) Gamma\n    (8) Negative Binomial\n    (9) Normal\n    (10) Poisson\n    (11) Student's t\n    (12) Noncentral Student's t\n\n\u003e Given values of all but one parameter of a distribution, the other is\n\u003e computed. These calculations are done with C pointers to Doubles.\n\n_\u003csub\u003ehttp://www.netlib.org/random/ dcdflib.c README file\u003c/sub\u003e_\n\n## Install\n\n```bash\nnpm install cdflib_wasm\n```\n\n## Usage\n\nFor good practice, cdflib compiles asyncronously by default.\nYou must therefore wait for the `.compiled` promise to be resolved.\n\n```js\nconst CdfLibWrapper = require(\"cdflib_wasm\");\nconst cdflib = new CdfLibWrapper();\nawait cdflib.compiled;\ncdflib.cdft_1(18, -2.10092204024096);\n```\n\nIt is possible to syncronously compile cdflib.\n\n```js\nconst cdflib = new CdfLibWrapper({ compileSync: true });\ncdflib.cdft_1(18, -2.10092204024096);\n```\n\n## Table of Content\n\n| Functions           | Documentation                                                      |\n| ------------------- | ------------------------------------------------------------------ |\n| [`cdfbet`](#cdfbet) | Calculates parameters of the beta distribution.                    |\n| [`cdfbin`](#cdfbin) | Calculates parameters of the binomial distribution.                |\n| [`cdfchi`](#cdfchi) | Calculates parameters of the chi-square distribution.              |\n| [`cdfchn`](#cdfchn) | Calculates parameters of the non-central chi-square distribution.  |\n| [`cdff`](#cdff)     | Calculates parameters of the F distribution.                       |\n| [`cdffnc`](#cdffnc) | Calculates parameters of the non-central F distribution.           |\n| [`cdfgam`](#cdfgam) | Calculates parameters of the gamma distribution.                   |\n| [`cdfnbn`](#cdfnbn) | Calculates parameters of the negative binomial distribution.       |\n| [`cdfnor`](#cdfnor) | Calculates parameters of the normal distribution.                  |\n| [`cdfpoi`](#cdfpoi) | Calculates parameters of the Poisson distribution.                 |\n| [`cdft`](#cdft)     | Calculates parameters of the student's t distribution.             |\n| [`cdftnc`](#cdftnc) | Calculates parameters of the non-central student's t distribution. |\n\n## Documentation\n\n### cdfbet\n\nCalculates any one parameter of the beta distribution given values for the others.\n\n    P \u003c--\u003e The integral from 0 to X of the chi-square\n            distribution.\n            Input range: [0, 1].\n\n    X \u003c--\u003e Upper limit of integration of beta density.\n        Input range: [0, 1].\n        Search range: [0, 1]\n\n    A \u003c--\u003e The first parameter of the beta density.\n        Input range: (0, +infinity).\n        Search range: [1D-100, 1D100]\n\n    B \u003c--\u003e The second parameter of the beta density.\n        Input range: (0, +infinity).\n        Search range: [1D-100, 1D100]\n\n#### cdfbet_1(double x, double a, double b): double\n\n`cdfbet_1` Calculates P from X, A and B\n\n```js\nconst p = cdflib.cdfbet_1(x, a, b);\n```\n\n#### cdfbet_2(double p, double a, double b): double\n\n`cdfbet_2` Calculate X from P, A and B\n\n```js\nconst x = cdflib.cdfbet_2(p, a, b);\n```\n\n#### cdfbet_3(double p, double b, double x): double\n\n`cdfbet_3` Calculate A from P, X and B\n\n```js\nconst a = cdflib.cdfbet_3(p, b, x);\n```\n\n#### cdfbet_4(double a, double p, double x): double\n\n`cdfbet_4` Calculate B from P, X and A\n\n```js\nconst b = cdflib.cdfbet_4(a, p, x);\n```\n\n### cdfbin\n\nCalculates any one parameter of the binomial distribution given values for the others.\n\n    P \u003c--\u003e The cumulation from 0 to S of the binomial distribution.\n        (Probablility of S or fewer successes in XN trials each\n        with probability of success PR.)\n        Input range: [0, 1].\n\n    S \u003c--\u003e The number of successes observed.\n        Input range: [0, XN]\n        Search range: [0, XN]\n\n    XN  \u003c--\u003e The number of binomial trials.\n            Input range: (0, +infinity).\n            Search range: [1E-100, 1E100]\n\n    PR  \u003c--\u003e The probability of success in each binomial trial.\n            Input range: [0, 1].\n            Search range: [0, 1]\n\n#### cdfbin_1(double s, double xn, double pr): double\n\n`cdfbin_1` Calculate P from S, XN, PR\n\n```js\nconst p = cdflib.cdfbin_1(s, xn, pr);\n```\n\n#### cdfbin_2(double p, double xn, double pr): double\n\n`cdfbin_2` Calculate S from P, XN, PR\n\n```js\nconst s = cdflib.cdfbin_2(p, xn, pr);\n```\n\n#### cdfbin_3(double p, double s, double pr): double\n\n`cdfbin_3` Calculate XN from P, S, PR\n\n```js\nconst xn = cdflib.cdfbin_3(p, s, pr);\n```\n\n#### cdfbin_4(double p, double s, double xn): double\n\n`cdfbin_4` Calculate PR from P, S and XN\n\n```js\nconst pr = cdflib.cdfbin_4(p, s, xn);\n```\n\n### cdfchi\n\nCalculates any one parameter of the chi-squared distribution given values for the others.\n\n    P \u003c--\u003e The integral from 0 to X of the chi-square\n        distribution.\n        Input range: [0, 1].\n\n    X \u003c--\u003e Upper limit of integration of the non-central\n        chi-square distribution.\n        Input range: [0, +infinity).\n        Search range: [0, 1E100]\n\n    DF \u003c--\u003e Degrees of freedom of the\n            chi-square distribution.\n            Input range: (0, +infinity).\n            Search range: [ 1E-100, 1E100]\n\n#### cdfchi_1(double x, double df): double\n\n`cdfchi_1` Calculate P from X and DF\n\n```js\nconst p = cdflib.cdfchi_1(x, df);\n```\n\n#### cdfchi_2(double p, double df): double\n\n`cdfchi_2` Calculate X from P and DF\n\n```js\nconst x = cdflib.cdfchi_2(p, df);\n```\n\n#### cdfchi_3(double p, double x): double\n\n`cdfchi_3` Calculate DF from P and X\n\n```js\nconst df = cdflib.cdfchi_3(p, x);\n```\n\n### cdfchn\n\nCalculates any one parameter of the non-central chi-squared distribution given values for the others.\n\n    P \u003c--\u003e The integral from 0 to X of the non-central chi-square\n        distribution.\n        Input range: [0, 1-1E-16).\n\n    X \u003c--\u003e Upper limit of integration of the non-central\n        chi-square distribution.\n        Input range: [0, +infinity).\n        Search range: [0, 1E100]\n\n    DF \u003c--\u003e Degrees of freedom of the non-central\n            chi-square distribution.\n            Input range: (0, +infinity).\n            Search range: [ 1E-100, 1E100]\n\n    NC \u003c--\u003e Non-centrality parameter of the non-central\n            chi-square distribution.\n            Input range: [0, +infinity).\n            Search range: [0, 1E4]\n\n**Warning**\nThe computation time required for this routine is proportional to the noncentrality parameter (NC). Very large values of this parameter can consume immense computer resources. This is why the search range is bounded by 10,000.\n\n#### cdfchn_1(double x, double df, double nc): double\n\n`cdfchn_1` Calculate P from X and DF\n\n```js\nconst p = cdflib.cdfchn_1(x, df, nc);\n```\n\n#### cdfchn_2(double p, double df, double nc): double\n\n`cdfchn_2` Calculate X from P, DF and NC\n\n```js\nconst x = cdflib.cdfchn_2(p, df, nc);\n```\n\n#### cdfchn_3(double x, double p, double nc): double\n\n`cdfchn_3` Calculate DF from P, X and NC\n\n```js\nconst df = cdflib.cdfchn_3(x, p, nc);\n```\n\n#### cdfchn_4(double x, double df, double p): double\n\n`cdfchn_4` Calculate NC from P, X and DF\n\n```js\nconst pnonc = cdflib.cdfchn_4(x, df, p);\n```\n\n### cdff\n\nCalculates any one parameter of the F distribution given values for the others.\n\n    P \u003c--\u003e The integral from 0 to F of the f-density.\n            Input range: [0, 1].\n\n    F \u003c--\u003e Upper limit of integration of the f-density.\n            Input range: [0, +infinity).\n            Search range: [0, 1E100]\n\n    DFN \u003c --\u003e Degrees of freedom of the numerator sum of squares.\n            Input range: (0, +infinity).\n            Search range: [ 1E-100, 1E100]\n\n    DFD \u003c --\u003e Degrees of freedom of the denominator sum of squares.\n            Input range: (0, +infinity).\n            Search range: [ 1E-100, 1E100]\n\n**Warning**\nThe value of the cumulative F distribution is not necessarily\nmonotone in either degrees of freedom. There thus may be two\nvalues that provide a given CDF value. This routine assumes\nmonotonicity and will find an arbitrary one of the two values.\n\n#### cdff_1(double dfn, double dfd, double f): double\n\n`cdff_1` Calculate P from F, DFN and DFD\n\n```js\nconst p = cdflib.cdff_1(dfc, dfd, f);\n```\n\n#### cdff_2(double dfn, double dfd, double p): double\n\n`cdff_2` Calculate F from P, DFN and DFD\n\n```js\nconst f = cdflib.cdff_2(dfn, dfd, p);\n```\n\n#### cdff_3(double p, double dfd, double f): double\n\n`cdff_3` Calculate DFN from P, F and DFD\n\n```js\nconst dfn = cdflib.cdff_3(p, dfd, f);\n```\n\n#### cdff_4(double dfn, double p, double f): double\n\n`cdff_4` Calculate DFD from P, F and DFN\n\n```js\nconst dfd = cdflib.cdff_4(dfn, p, f);\n```\n\n### cdffnc\n\nCalculates any one parameter of the Non-central F distribution given values for the others.\n\n    P \u003c--\u003e The integral from 0 to F of the non-central f-density.\n            Input range: [0, 1-1E-16).\n\n    F \u003c--\u003e Upper limit of integration of the non-central f-density.\n            Input range: [0, +infinity).\n            Search range: [0, 1E100]\n\n    DFN \u003c --\u003e Degrees of freedom of the numerator sum of squares.\n            Input range: (0, +infinity).\n            Search range: [ 1E-100, 1E100]\n\n    DFD \u003c --\u003e Degrees of freedom of the denominator sum of squares.\n            Must be in range: (0, +infinity).\n            Input range: (0, +infinity).\n            Search range: [ 1E-100, 1E100]\n\n    NC \u003c-\u003e The non-centrality parameter\n            Input range: [0, infinity)\n            Search range: [0, 1E4]\n\n**Warning**\n\nThe computation time required for this routine is proportional\nto the noncentrality parameter (PNONC). Very large values of\nthis parameter can consume immense computer resources. This is\nwhy the search range is bounded by 10,000.\n\n**Warning**\n\nThe value of the cumulative noncentral F distribution is not\nnecessarily monotone in either degrees of freedom. There thus\nmay be two values that provide a given CDF value. This routine\nassumes monotonicity and will find an arbitrary one of the two\nvalues.\n\n#### cdffnc_1(double dfn, double dfd, double nc, double f): double\n\n`cdffnc_1` Calculate P from F, DFN, DFD and NC\n\n```js\nconst p = cdflib.cdffnc_1(dfc, dfd, nc, f);\n```\n\n#### cdffnc_2(double dfn, double dfd, double nc, double p): double\n\n`cdffnc_2` Calculate F from P, DFN, DFD and NC\n\n```js\nconst f = cdflib.cdffnc_2(dfn, dfd, nc, p);\n```\n\n#### cdffnc_3(double p, double dfd, double nc, double f): double\n\n`cdffnc_3` Calculate DFN from P, F, DFD and NC\n\n```js\nconst dfn = cdflib.cdffnc_3(p, dfd, nc, f);\n```\n\n#### cdffnc_4(double dfn, double p, double nc, double f): double\n\n`cdffnc_4` Calculate DFD from P, F, DFN and NC\n\n```js\nconst dfd = cdflib.cdffnc_4(dfn, p, nc, f);\n```\n\n#### cdffnc_5(double dfn, double dfd, double p, double f): double\n\n`cdffnc_5` Calculate NC from P, F, DFN and DFD\n\n```js\nconst pnonc = cdflib.cdffnc_5(dfn, dfd, p, f);\n```\n\n### cdfgam\n\nCalculates any one parameter of the gamma\ndistribution given values for the others.\n\n    P \u003c--\u003e The integral from 0 to X of the gamma density.\n        Input range: [0, 1].\n\n    X \u003c--\u003e The upper limit of integration of the gamma density.\n        Input range: [0, +infinity).\n        Search range: [0, 1E100]\n\n    SHAPE \u003c--\u003e The shape parameter of the gamma density.\n            Input range: (0, +infinity).\n            Search range: [1E-100, 1E100]\n\n    SCALE \u003c--\u003e The scale parameter of the gamma density.\n            Input range: (0, +infinity).\n            Search range: (1E-100, 1E100]\n\n#### cdfgam_1(double scale, double shape, double x): double\n\n`cdfgam_1` Calculate P from X, SHAPE and SCALE\n\n```js\nconst p = cdflib.cdfgam_1(scale, shape, x);\n```\n\n#### cdfgam_2(double scale, double shape, double p): double\n\n`cdfgam_2` Calculate X from P, SHAPE and SCALE\n\n```js\nconst x = cdflib.cdfgam_2(scale, shape, p);\n```\n\n#### cdfgam_3(double scale, double p, double x): double\n\n`cdfgam_3` Calculate SHAPE from P, X and SCALE\n\n```js\nconst shape = cdflib.cdfgam_3(scale, p, x);\n```\n\n#### cdfgam_4(double p, double shape, double x): double\n\n`cdfgam_4` Calculate SCALE from P, X and SHAPE\n\n```js\nconst scale = cdflib.cdfgam_4(p, shape, x);\n```\n\n### cdfnbn\n\nCalculates any one parameter of the negative binomial\ndistribution given values for the others.\n\nThe cumulative negative binomial distribution returns the\nprobability that there will be F or fewer failures before the\nXNth success in binomial trials each of which has probability of\nsuccess PR.\n\nThe individual term of the negative binomial is the probability of\nS failures before XN successes and is\n`Choose(S, XN+S-1) * PR^(XN) * (1-PR)^S`\n\n    P \u003c--\u003e The cumulation from 0 to S of the  negative\n        binomial distribution.\n        Input range: [0, 1].\n\n    S \u003c--\u003e The upper limit of cumulation of the binomial distribution.\n        There are F or fewer failures before the XNth success.\n        Input range: [0, +infinity).\n        Search range: [0, 1E100]\n\n    XN  \u003c--\u003e The number of successes.\n            Input range: [0, +infinity).\n            Search range: [0, 1E100]\n\n    PR  \u003c--\u003e The probability of success in each binomial trial.\n            Input range: [0, 1].\n            Search range: [0, 1].\n\n#### cdfnbn_1(double s, double xn, double pr): double\n\n`cdfnbn_1` Calculate P from S, XN, PR\n\n```js\nconst p = cdflib.cdfnbn_1(s, xn, pr);\n```\n\n#### cdfnbn_2(double p, double xn, double pr): double\n\n`cdfnbn_2` Calculate S from P, XN, PR\n\n```js\nconst s = cdflib.cdfnbn_2(p, xn, pr);\n```\n\n#### cdfnbn_3(double s, double p, double pr): double\n\n`cdfnbn_3` Calculate XN from P, S, PR\n\n```js\nconst xn = cdflib.cdfnbn_3(s, p, pr);\n```\n\n#### cdfnbn_4(double s, double p, double xn): double\n\n`cdfnbn_4` Calculate PR from P, S and XN\n\n```js\nconst pr = cdflib.cdfnbn_4(s, p, xn);\n```\n\n### cdfnor\n\nCalculates any one parameter of the normal distribution given values for the others.\n\n    P \u003c--\u003e The integral from -infinity to X of the normal density.\n        Input range: (0, 1].\n\n    X \u003c --\u003e Upper limit of integration of the normal-density.\n            Input range: ( -infinity, +infinity)\n\n    MEAN \u003c--\u003e The mean of the normal density.\n            Input range: (-infinity, +infinity)\n\n    STD \u003c--\u003e Standard Deviation of the normal density.\n            Input range: (0, +infinity).\n\n**Note**\nThe normal density is proportional to\n`exp( - 0.5 * (( X - MEAN)/STD)**2)`\n\n#### cdfnor_1(double mean, double std, double x): double\n\n`cdfnor_1` Calculate P from X, MEAN and STD\n\n```js\nconst p = cdflib.cdfnor_1(mean, std, x);\n```\n\n#### cdfnor_2(double mean, double p, double std): double\n\n`cdfnor_2` Calculate X from P, MEAN and STD\n\n```js\nconst x = cdflib.cdfnor_2(mean, p, std);\n```\n\n#### cdfnor_3(double p, double std, double x): double\n\n`cdfnor_3` Calculate MEAN from P, X and STD\n\n```js\nconst mean = cdflib.cdfnor_3(p, std, x);\n```\n\n#### cdfnor_4(double mean, double p, double x): double\n\n`cdfnor_4` Calculate STD from P, X and MEAN\n\n```js\nconst sd = cdflib.cdfnor_4(mean, p, x);\n```\n\n### cdfpoi\n\nCalculates any one parameter of the Poisson distribution given values for the others.\n\n    P \u003c--\u003e The cumulation from 0 to S of the poisson density.\n            Input range: [0, 1].\n\n    S \u003c--\u003e Upper limit of cumulation of the Poisson.\n            Input range: [0, +infinity).\n            Search range: [0, 1E100]\n\n    XLAM \u003c--\u003e Mean of the Poisson distribution.\n            Input range: [0, +infinity).\n            Search range: [0, 1E100]\n\n#### cdfpoi_1(double s, double xlam): double\n\n`cdfpoi_1` Calculate P from S and XLAM\n\n```js\nconst p = cdflib.cdfpoi_1(s, xlam);\n```\n\n#### cdfpoi_2(double p, double xlam): double\n\n`cdfpoi_2` Calculate A from P and XLAM\n\n```js\nconst a = cdflib.cdfpoi_2(p, xlam);\n```\n\n#### cdfpoi_3(double p, double s): double\n\n`cdfpoi_3` Calculate XLAM from P and S\n\n```js\nconst xlam = cdflib.cdfpoi_3(p, s);\n```\n\n### cdft\n\nCalculates any one parameter of the student's t distribution given values for the others.\n\n    P \u003c--\u003e The integral from -infinity to t of the t-density.\n            Input range: (0, 1].\n\n    T \u003c--\u003e Upper limit of integration of the t-density.\n            Input range: ( -infinity, +infinity).\n            Search range: [ -1E100, 1E100 ]\n\n    DF \u003c--\u003e Degrees of freedom of the t-distribution.\n            Input range: (0 , +infinity).\n            Search range: [1e-100, 1E10]\n\n#### cdft_1(double df, double t): double\n\n`cdft_1` Calculate P from T and DF\n\n```js\nconst p = cdflib.cdft_1(df, t);\n```\n\n#### cdft_2(double df, double p): double\n\n`cdft_2` Calculate T from P and DF\n\n```js\nconst t = cdflib.cdft_2(p, df);\n```\n\n#### cdft_3(double p, double t): double\n\n`cdft_3` Calculate DF from P and T\n\n```js\nconst df = cdflib.cdft_3(p, t);\n```\n\n### cdftnc\n\nCalculates any one parameter of the non-central student's t distribution given values for the others.\n\n    P \u003c--\u003e The integral from -infinity to t of the noncentral t-den\n        Input range: (0, 1].\n\n    T \u003c--\u003e Upper limit of integration of the noncentral t-density.\n        Input range: ( -infinity, +infinity).\n        Search range: [ -1E100, 1E100 ]\n\n    DF \u003c--\u003e Degrees of freedom of the noncentral t-distribution.\n            Input range: (0 , +infinity).\n            Search range: [1e-100, 1E10]\n\n    NC \u003c--\u003e Noncentrality parameter of the noncentral t-distribution.\n                Input range: [-infinity , +infinity).\n                Search range: [-1e4, 1E4]\n\n#### cdftnc_1(double df, double nc, double t): double\n\n`cdftnc_1` Calculate P from T, DF, NC\n\n```js\nconst p = cdflib.cdftnc_1(df, nc, t);\n```\n\n#### cdftnc_2(double df, double nc, double p): double\n\n`cdftnc_2` Calculate T from P, DF, NC\n\n```js\nconst t = cdflib.cdftnc_2(df, nc, p);\n```\n\n#### cdftnc_3(double p, double nc, double t): double\n\n`cdftnc_3` Calculate DF from P, NC, T\n\n```js\nconst df = cdflib.cdftnc_3(p, nc, t);\n```\n\n#### cdftnc_4(double df, double p, double t): double\n\n`cdftnc_4` Calculate NC from P, DF, T\n\n```js\nconst pnonc = cdflib.cdftnc_4(df, p, t);\n```\n\n# Credits\n\n- [presto](https://github.com/scottransom/presto) for the cdflib C source\n- [node-cephes](https://github.com/nearform/node-cephes) which I heavily borrow the wasm packaging from.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftryggvigy%2Fcdflib_wasm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftryggvigy%2Fcdflib_wasm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftryggvigy%2Fcdflib_wasm/lists"}