{"id":19337671,"url":"https://github.com/sheetjs/maths","last_synced_at":"2025-04-23T01:31:03.543Z","repository":{"id":7490451,"uuid":"8839442","full_name":"SheetJS/maths","owner":"SheetJS","description":"Collection of Math Functions for NodeJS","archived":false,"fork":false,"pushed_at":"2020-07-04T00:50:39.000Z","size":140,"stargazers_count":19,"open_issues_count":0,"forks_count":2,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-04-19T08:38:24.280Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/SheetJS.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":"2013-03-17T18:48:10.000Z","updated_at":"2025-01-11T01:17:05.000Z","dependencies_parsed_at":"2022-08-29T21:31:02.058Z","dependency_job_id":null,"html_url":"https://github.com/SheetJS/maths","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/SheetJS%2Fmaths","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SheetJS%2Fmaths/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SheetJS%2Fmaths/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SheetJS%2Fmaths/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SheetJS","download_url":"https://codeload.github.com/SheetJS/maths/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250352220,"owners_count":21416458,"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":"2024-11-10T03:15:05.870Z","updated_at":"2025-04-23T01:31:03.519Z","avatar_url":"https://github.com/SheetJS.png","language":"JavaScript","readme":"maths\n=====\n\nPanoply of Math Functions for NodeJS.\n\nTo build this, `npm install -g voc` and `voc README.md`\n\n# Code\n\n```json\u003epackage.json\n{\n  \"version\": \"0.1.0\",\n  \"dependencies\": {\n```\n\n## Gamma Function\n\n[substack's gamma library](https://npmjs.org/package/gamma) provides the regular\ngamma function:\n\n```json\u003epackage.json\n    \"gamma\":\"\",\n```\n\nThe `gamma` function takes a single real parameter.\n\n```js\u003emaths.js\nvar gamma = require('gamma');\nexports.gamma = gamma;\n```\n\nBoth matlab and Excel use the function name `gammaln` to refer to the natural \nlog of the gamma function. Mathematica uses the name `LogGamma` and scipy uses \nthe name `loggamma`.  Both names will be used:\n\n```\nexports.gammaln = gamma.log;\nexports.loggamma = gamma.log;\n```\n\n## Gamma's Friends\n\nThe regular beta function is a straightforward manipulation of gamma:\n\n```js\u003emaths.js\nvar beta = function(a,b) { return (gamma(a)*gamma(b))/gamma(a+b); };\nvar betaln = function(a,b) { return gamma.log(a)+gamma.log(b)-gamma.log(a+b); };\nbeta.log = betaln;\nexports.beta = beta;\nexports.betaln = betaln;\n```\n\nThe lesser-known Pochhammer symbol is even simpler (uses Mathematica order):\n\n```\nvar pochhammer = function(a,n) { return gamma(a+n) / gamma(a); };\nvar pochhammerln = function(a,n) { return gamma.log(a+n) - gamma.log(a); };\npochhammer.log = pochhammerln;\nexports.pochhammer = pochhammer;\nexports.pochhammerln = pochhammerln;\n```\n\n\n## Bessel Functions\n\n[SheetJS's bessel library](https://npmjs.org/package/gamma) provides the Bessel\nfunctions:\n\n```json\u003epackage.json\n    \"bessel\":\"\",\n```\n\nThe bessel functions accept the parameters `(x, n)` where `n` is the order of \nthe solution and `x` is the point at which to evaluate:\n\n```js\u003emaths.js\nvar bessel = require('bessel');\nexports.besselj = bessel.besselj;\nexports.bessely = bessel.bessely;\nexports.besseli = bessel.besseli;\nexports.besselk = bessel.besselk;\n```\n\n## Fractions\n\n[SheetJS's frac library](https://npm.im/frac) provides the frac function for\nrational approximations to numbers:\n\n```json\u003epackage.json\n    \"frac\":\"\",\n```\n\nThe frac function accept the parameters `(x, D, m)` where `x` is the number you\nwish to approximate, `D` is an upper bound on the denominator, and `m` is a flag\nindicating that you want mixed rather than improper fractions:\n\n```js\u003emaths.js\nvar frac = require('frac');\nexports.frac = frac;\n```\n\n## Miscellaneous\n\n```json\u003epackage.json\n    \"voc\":\"\"\n  },\n  \"name\": \"maths\",\n  \"author\": \"SheetJS\",\n  \"description\": \"Panoply of Math Functions for NodeJS\",\n  \"keywords\": [\"math\", \"maths\", \"specfun\", \"scimath\"],\n  \"repository\":{ \"type\": \"git\", \"url\": \"https://github.com/SheetJS/maths.git\" },\n  \"main\": \"maths.js\"\n}\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsheetjs%2Fmaths","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsheetjs%2Fmaths","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsheetjs%2Fmaths/lists"}