{"name":"mathfn","description":"Some basic but difficult to implement mathmatical functions","version":"1.1.0","author":{"name":"Andreas Madsen","email":"amwebdk@gmail.com"},"main":"./mathfn.js","scripts":{"test":"tap test/simple/*"},"repository":{"type":"git","url":"git://github.com/AndreasMadsen/mathfn.git"},"keywords":["math","erf","gamma","beta","log"],"devDependencies":{"tap":"^12.1.0"},"license":"MIT","gitHead":"66004a96c260a451af7f99551534227fa1303bfa","bugs":{"url":"https://github.com/AndreasMadsen/mathfn/issues"},"homepage":"https://github.com/AndreasMadsen/mathfn#readme","_id":"mathfn@1.1.0","_npmVersion":"6.4.1","_nodeVersion":"12.0.0-pre","_npmUser":{"name":"andreasmadsen","email":"amwebdk@gmail.com"},"dist":{"integrity":"sha512-glxPY9PZqaoGUySN1QOVnKfnWH4Az2PnHEYMRVWUnR1RZpWTLNzdCm7RxEiEJ0SJ7G95ruF6Q2/1s/LuQnhXyg==","shasum":"5b88048479508cd693a8131125f621d8b75b8352","tarball":"http://registry-npm.ywwl.com/mathfn/download/mathfn-1.1.0.tgz","fileCount":13,"unpackedSize":31540,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcBjFmCRA9TVsSAnZWagAA6AQP/21W7FThhNoKgiqZ/ORK\nFXGb4g/F62mByzPDidQ5nxC7czOobLItPUu2gtgW1wp1fMm/3GLmw6t7kKIr\n/eu77/BPtWun0ZmxQYGEQkztH6vL7YhhGKsXSZgaDu34TZNxsmwzc+CZ1VII\nTrfWcM5ucoKBMmt6pjE61hhelmNnEkkm++C9LtBzNDAwW5C6bAb7KDE5WtQp\nqmUYZPdOkLnnReMHTxyUFh27TVNumrhSLeLEUnUoWQgLJQ98e2CiR1mO75RX\nGDcGmHRvaQ2QAyKcXxoo3SprcfCa3jmVWe4LWrjt4cT2EH7zU61TkTre6DpJ\n+Z0nJAGTpB04UGamE31GegyXx+awpDtn+KFHogjIwpYcZgjXVsWlIlFmXXWN\nA705N5Gfy/Ugn+Wr4AD2DfXasWNSUoyh/Xbx1l+8QUwlpdi1pl3Z+y7OSR5E\nOWo70rv5DL6cY6skc7sv/wFelm45b1iIGrtbJap31hoFprtBfInDg/rR4N2T\nehxp6MEUj8c5PWCiGR/jkQyOzSe5SOznGXjyroVs9PhjL7T+Dpv4S4AWHH8O\nm+FGvjp3ywUYg8syHQfmpQqfYISRkTOLj6jWR9xHoe8vtkLhzgrK2mrjW8LK\nyWyI4/TbzVTLFY7PguzGXE3ZVPadUriJsvDieIFfEbLctxJPX+QmzzmsiWjV\n0pm/\r\n=u18Z\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDbn/B6Z3WmK1wz8xNbaXEB7HNObrSs0DruRPagAuD6NQIgTI8kqH3sH9Hig4dDeDE2lS/+80D5qBaGdtyfnQ1/WcA="}],"size":11668,"noattachment":false,"key":"/mathfn/-/mathfn-1.1.0.tgz"},"maintainers":[{"name":"andreasmadsen","email":"amwebdk@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mathfn_1.1.0_1543909733848_0.645527092880223"},"_hasShrinkwrap":false,"deprecated":"Use cephes instead, for a more complete and well-tested module","readme":"# mathfn\n\n> Some basic but difficult to implement mathmatical functions<br>\n> _Note: for distribution functions please see [`distributions`](https://github.com/AndreasMadsen/distributions)_\n\n## Installation\n\n```sheel\nnpm install mathfn\n```\n\n## Example\n\n```javascript\nvar mathfn = require('mathfn');\n\nconsole.log(mathfn.erf(0)); // 0.0\n```\n\n## Documentation\n\n`mathfn` is a slowly growing collection of some difficult mathmatical functions\nthere should be included in `Math.` but isn't. This is a list of the currently\nimplemented functions and a few details.\n\n### Error functions\n\n##### `p = erf(x)` - The error function\n\nThis function is implemented using the \"Abramowitz & Stegun\" approximation\nits theortical accuracy is `1.5 * 10^-7`. However the limitations of JavaScript\nmight result in a lower accuracy.\n\n##### `p = erfc(x)` The complementary error function\n\nUnlike most implementation of `erfc(x)`, this is not calculated using `1 - erf(x)`,\nbut is an acutall approximation of `erfc(x)`.\n\n##### `p = invErf(p)` The inverse error function\n\nThis is calculated using `inverf(p) = -inverfc(p + 1)`, if you known of specific\napproximation please file an issue or pull request.\n\n##### `p = invErfc(p)` The inverse complementary error function\n\nThis uses a very common approximation of `inverfc(p)`, see source code for more\ndetails.\n\n### Gamma functions\n\n##### `p = gamma(x)` The gamma function\n\nThis acutally contains 3 diffrent approximations of `gamma(x)` which one is\nautomatically determined by the `x` value.\n\n##### `p = logGamma(x)` The logarithmic gamma function\n\nFor values less than `12` the result is calculated using `log(gamma(x))`, in\nany other case a specific approximation is used.\n\n### Beta functions\n\nThese are taken from the `jstat` library and modified to fit intro the API\npattern used in this module. Futhermore they also take advanges of the special\n`log1p` function implemented in this module.\n\n##### `p = beta(x, y)` - The beta function\n\n##### `p = logBeta(x, y)` - The logarithmic beta function\n\n##### `p = incBeta(x, a, b)` - The incomplete beta function\n\n##### `p = invIncBeta(p, a, b)` - The inverse incomplete beta function\n\n### Logarithmic functions\n\n##### `y = log1p(x)` - Calculates `y = ln(1 + x)`\n\nWhen `x` is a very small number computers calculates `ln(1 + x)` as `ln(1)` which\nis `zero` and then every thing is lost. This is a specific approximation of\n`ln(1 + x)` and should be used only in case of small values.\n\n##### `y = logFactorial(x)` - Calculates `y = ln(x!)`\n\n`x!` can quickly get very big, and exceed the limitation of the float value,\napproimating `ln(x!)` instead can in some cases solve this problem.\n\n## Testing\n\nAll functions are tested by comparing with a mathematical reference\neither _MatLab_, _Maple_ or _R_.\n\n## Thanks\n\nA special thank to John D. Cook, who writes a very good blog about some of these\nfunctions, and maintains a [stand alone implementation catalog](http://www.johndcook.com/stand_alone_code.html).\nSee also this article about regarding floating point errors in some mathematical\nfunction: http://www.johndcook.com/blog/2010/06/07/math-library-functions-that-seem-unnecessary/\n\n## License\n\n**The software is license under \"MIT\"**\n\n> Copyright (c) 2013 Andreas Madsen\n>\n> Permission is hereby granted, free of charge, to any person obtaining a copy\n> of this software and associated documentation files (the \"Software\"), to deal\n> in the Software without restriction, including without limitation the rights\n> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n> copies of the Software, and to permit persons to whom the Software is\n> furnished to do so, subject to the following conditions:\n>\n> The above copyright notice and this permission notice shall be included in\n> all copies or substantial portions of the Software.\n>\n> THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n> THE SOFTWARE.\n","publish_time":1543909734023,"_cnpm_publish_time":1543909734023,"dist-tags":{"latest":"1.2.0"}}