{"_id":"compute-erfinv","_rev":"12-6941c904bc277767ddbe11717c70cdfd","name":"compute-erfinv","description":"Inverse error function.","dist-tags":{"latest":"3.0.1"},"versions":{"0.0.0":{"name":"compute-erfinv","version":"0.0.0","description":"Inverse error function.","author":{"name":"Athan Reines","email":"kgryte@gmail.com"},"contributors":[{"name":"Athan Reines","email":"kgryte@gmail.com"}],"scripts":{"test":"mocha","test-cov":"istanbul cover ./node_modules/.bin/_mocha --dir ./reports/coverage -- -R spec","coveralls":"istanbul cover ./node_modules/.bin/_mocha --dir ./reports/coveralls/coverage --report lcovonly -- -R spec && cat ./reports/coveralls/coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js && rm -rf ./reports/coveralls"},"main":"./lib","repository":{"type":"git","url":"git://github.com/compute-io/erfinv.git"},"keywords":["compute.io","compute","computation","statistics","stats","erf","inverse error function","error function"],"bugs":{"url":"https://github.com/compute-io/erfinv/issues"},"dependencies":{"compute-polynomial":"^1.0.0"},"devDependencies":{"chai":"1.x.x","mocha":"1.x.x","coveralls":"^2.11.1","istanbul":"^0.3.0"},"licenses":[{"type":"MIT","url":"http://www.opensource.org/licenses/MIT"}],"gitHead":"fbb3bed16e9c4d7c881ac710f6c169b047d233bb","homepage":"https://github.com/compute-io/erfinv","_id":"compute-erfinv@0.0.0","_shasum":"7770da27519c02b03eb4eb38e1486457a1bdaa67","_from":".","_npmVersion":"1.5.0-alpha-1","_npmUser":{"name":"kgryte","email":"kgryte@gmail.com"},"maintainers":[{"name":"kgryte","email":"kgryte@gmail.com"}],"dist":{"shasum":"7770da27519c02b03eb4eb38e1486457a1bdaa67","tarball":"https://registry.npmjs.org/compute-erfinv/-/compute-erfinv-0.0.0.tgz","integrity":"sha512-J9+UG4yrAMCvdsoDSCob2qF5XPBxH1iBer3y6qzzkGhRNVQa6coNgnRo/aq8gCXoP4v8YWSxkJjsFJJ3w8wbfw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBcq7JBFjj8GXflE38VhL6tHJlskRwVu0+iJm9E3bfTFAiEAhQ/7wH5XQPCDRGyWz/F6OC6KEDPNQJ1xoDOgo4nb40s="}]}},"1.0.0":{"name":"compute-erfinv","version":"1.0.0","description":"Inverse error function.","author":{"name":"Athan Reines","email":"kgryte@gmail.com"},"contributors":[{"name":"Athan Reines","email":"kgryte@gmail.com"}],"scripts":{"test":"mocha","test-cov":"istanbul cover ./node_modules/.bin/_mocha --dir ./reports/coverage -- -R spec","coveralls":"istanbul cover ./node_modules/.bin/_mocha --dir ./reports/coveralls/coverage --report lcovonly -- -R spec && cat ./reports/coveralls/coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js && rm -rf ./reports/coveralls"},"main":"./lib","repository":{"type":"git","url":"git://github.com/compute-io/erfinv.git"},"keywords":["compute.io","compute","computation","statistics","stats","erf","inverse error function","error function"],"bugs":{"url":"https://github.com/compute-io/erfinv/issues"},"dependencies":{"compute-polynomial":"^1.0.0"},"devDependencies":{"chai":"1.x.x","mocha":"1.x.x","coveralls":"^2.11.1","istanbul":"^0.3.0"},"licenses":[{"type":"MIT","url":"http://www.opensource.org/licenses/MIT"}],"gitHead":"c8e5ed77d6eaf4a53d359ef04247526a8eeab64d","homepage":"https://github.com/compute-io/erfinv","_id":"compute-erfinv@1.0.0","_shasum":"59e7bf355821dd3d4213504c170c9e870d561845","_from":".","_npmVersion":"1.5.0-alpha-1","_npmUser":{"name":"kgryte","email":"kgryte@gmail.com"},"maintainers":[{"name":"kgryte","email":"kgryte@gmail.com"}],"dist":{"shasum":"59e7bf355821dd3d4213504c170c9e870d561845","tarball":"https://registry.npmjs.org/compute-erfinv/-/compute-erfinv-1.0.0.tgz","integrity":"sha512-Z+Ib0/C7234Dxe1siC3wct1u31MaK6gWZde0hbRGIwnj91ShoZ+GoP4Y0c2Y5BOmYYjnCkihe7lb89xPuZrYFQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCID92g2kTHK8GKWrkxMvsjsnLiD21JzZbU0c5srzajgHAAiBkmbRXoZgMtRCAhvNzfnfaRvFw+pdJU62x49bbRhQurQ=="}]}},"1.0.1":{"name":"compute-erfinv","version":"1.0.1","description":"Inverse error function.","author":{"name":"Athan Reines","email":"kgryte@gmail.com"},"contributors":[{"name":"Athan Reines","email":"kgryte@gmail.com"}],"scripts":{"test":"mocha","test-cov":"istanbul cover ./node_modules/.bin/_mocha --dir ./reports/coverage -- -R spec","coveralls":"istanbul cover ./node_modules/.bin/_mocha --dir ./reports/coveralls/coverage --report lcovonly -- -R spec && cat ./reports/coveralls/coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js && rm -rf ./reports/coveralls"},"main":"./lib","repository":{"type":"git","url":"git://github.com/compute-io/erfinv.git"},"keywords":["compute.io","compute","computation","statistics","stats","erf","inverse error function","error function"],"bugs":{"url":"https://github.com/compute-io/erfinv/issues"},"dependencies":{"compute-polynomial":"^1.0.0"},"devDependencies":{"chai":"1.x.x","mocha":"1.x.x","coveralls":"^2.11.1","istanbul":"^0.3.0"},"licenses":[{"type":"MIT","url":"http://www.opensource.org/licenses/MIT"}],"gitHead":"d2e1c3d7eb9d02fa776d098495c20fc1ad5b657f","homepage":"https://github.com/compute-io/erfinv","_id":"compute-erfinv@1.0.1","_shasum":"8bbb7928be7976c08250003c11f90ba2403df43b","_from":".","_npmVersion":"1.5.0-alpha-1","_npmUser":{"name":"kgryte","email":"kgryte@gmail.com"},"maintainers":[{"name":"kgryte","email":"kgryte@gmail.com"}],"dist":{"shasum":"8bbb7928be7976c08250003c11f90ba2403df43b","tarball":"https://registry.npmjs.org/compute-erfinv/-/compute-erfinv-1.0.1.tgz","integrity":"sha512-VQi7/7AhKQoN2THDRL73MRWNqrXilxQd8UZaTDPjmuapGM7mBhn4F3UDfIWzzsrGEQWVTpcLzx55kt813eEolg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC2mkp6K6ZjkKGkPgK3zu/ponNFmT0zFVnAETKn4ZSWpwIhALuLjGc7YSwy5GKqGxaDKWyQC5fDuHOa1NxdGKVGuxfs"}]}},"2.0.0":{"name":"compute-erfinv","version":"2.0.0","description":"Inverse error function.","author":{"name":"Athan Reines","email":"kgryte@gmail.com"},"contributors":[{"name":"Athan Reines","email":"kgryte@gmail.com"},{"name":"Philipp Burckhardt","email":"pburckhardt@outlook.com"}],"scripts":{"test":"mocha","test-cov":"istanbul cover ./node_modules/.bin/_mocha --dir ./reports/coverage -- -R spec","coveralls":"istanbul cover ./node_modules/.bin/_mocha --dir ./reports/coveralls/coverage --report lcovonly -- -R spec && cat ./reports/coveralls/coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js && rm -rf ./reports/coveralls"},"main":"./lib","repository":{"type":"git","url":"git://github.com/compute-io/erfinv.git"},"keywords":["compute.io","compute","computation","statistics","stats","erf","inverse error function","error function","erfinv","mathematics","math","matrix","matrices","array","arrays","accessor","dstructs"],"bugs":{"url":"https://github.com/compute-io/erfinv/issues"},"dependencies":{"compute-polynomial":"^1.1.0","compute-reverse":"^1.1.0","compute-array-constructors":"^1.0.0","dstructs-matrix":"^2.0.0","utils-deep-get":"^1.0.0","utils-deep-set":"^1.0.1","validate.io-array":"^1.0.6","validate.io-array-like":"^1.0.1","validate.io-boolean-primitive":"^1.0.0","validate.io-function":"^1.0.2","validate.io-matrix-like":"^1.0.2","validate.io-number-primitive":"^1.0.0","validate.io-object":"^1.0.4","validate.io-string-primitive":"^1.0.0"},"devDependencies":{"chai":"3.x.x","coveralls":"^2.11.1","istanbul":"^0.3.0","jshint":"2.x.x","jshint-stylish":"2.x.x","mocha":"2.x.x"},"license":"MIT","gitHead":"ef044f380391af8f4b28702410cbdbe01811e6b1","homepage":"https://github.com/compute-io/erfinv#readme","_id":"compute-erfinv@2.0.0","_shasum":"847c202718d6fbb058cf4732d1638229c48d1f06","_from":".","_npmVersion":"2.8.3","_nodeVersion":"0.10.29","_npmUser":{"name":"kgryte","email":"kgryte@gmail.com"},"dist":{"shasum":"847c202718d6fbb058cf4732d1638229c48d1f06","tarball":"https://registry.npmjs.org/compute-erfinv/-/compute-erfinv-2.0.0.tgz","integrity":"sha512-h8DBOmZuNdBMHxCOLCr+ytVeOxNQ1ehw+2zBkkl4bWN+huksXcBnJmxDa87N+40rXx/QreZlMOpB2IbshbEByw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAD4f1lB2firU01kmxzt9W5rsiH/yfFgCjtdoLVUU/CkAiEA/h66ugeZJU7hC2Pga54q8emchw7qM5wODS3h1tFWVI0="}]},"maintainers":[{"name":"kgryte","email":"kgryte@gmail.com"}]},"3.0.0":{"name":"compute-erfinv","version":"3.0.0","description":"Inverse error function.","author":{"name":"Athan Reines","email":"kgryte@gmail.com"},"contributors":[{"name":"Athan Reines","email":"kgryte@gmail.com"},{"name":"Philipp Burckhardt","email":"pburckhardt@outlook.com"}],"scripts":{"test":"mocha","test-cov":"istanbul cover ./node_modules/.bin/_mocha --dir ./reports/coverage -- -R spec","coveralls":"istanbul cover ./node_modules/.bin/_mocha --dir ./reports/coveralls/coverage --report lcovonly -- -R spec && cat ./reports/coveralls/coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js && rm -rf ./reports/coveralls"},"main":"./lib","repository":{"type":"git","url":"git://github.com/compute-io/erfinv.git"},"keywords":["compute.io","compute","computation","statistics","stats","erf","inverse error function","error function","erfinv","mathematics","math","matrix","matrices","array","arrays","accessor","dstructs","deep","set","get","deepset"],"bugs":{"url":"https://github.com/compute-io/erfinv/issues"},"dependencies":{"compute-array-constructors":"^1.0.0","compute-polynomial":"^1.1.0","dstructs-matrix":"^2.0.0","utils-deep-get":"^1.0.0","utils-deep-set":"^1.0.1","validate.io-array-like":"^1.0.1","validate.io-boolean-primitive":"^1.0.0","validate.io-function":"^1.0.2","validate.io-matrix-like":"^1.0.2","validate.io-nan":"^1.0.3","validate.io-number-primitive":"^1.0.0","validate.io-object":"^1.0.4","validate.io-string-primitive":"^1.0.0","validate.io-typed-array-like":"^1.0.0"},"devDependencies":{"chai":"3.x.x","coveralls":"^2.11.1","istanbul":"^0.3.0","jshint":"2.x.x","jshint-stylish":"2.x.x","mocha":"2.x.x"},"license":"MIT","gitHead":"6e0dad2317b5af8616e21d6f179d5504d65b4446","homepage":"https://github.com/compute-io/erfinv#readme","_id":"compute-erfinv@3.0.0","_shasum":"f36fce6d86c258424dd9e04ac02c8c858ba2ea4e","_from":".","_npmVersion":"2.8.3","_nodeVersion":"0.12.7","_npmUser":{"name":"kgryte","email":"kgryte@gmail.com"},"dist":{"shasum":"f36fce6d86c258424dd9e04ac02c8c858ba2ea4e","tarball":"https://registry.npmjs.org/compute-erfinv/-/compute-erfinv-3.0.0.tgz","integrity":"sha512-XKBw3kC4JnPd9F3gcP/AG+xMNvgpaIzrhROmRCdjF6aIggTb+kvlLQjF7cWZLmItIER5XBiCjVObedCW0VVztA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAFvoIys0qFnq6SmbzMAn7rSs1LAgYWi55A7R3JvynciAiB0cI0vAD+peyDXBZs2Y0F6UEpGxGlqu/moNl8ijqGF7w=="}]},"maintainers":[{"name":"kgryte","email":"kgryte@gmail.com"},{"name":"planeshifter","email":"pgb@andrew.cmu.edu"}]},"3.0.1":{"name":"compute-erfinv","version":"3.0.1","description":"Inverse error function.","author":{"name":"Athan Reines","email":"kgryte@gmail.com"},"contributors":[{"name":"Athan Reines","email":"kgryte@gmail.com"},{"name":"Philipp Burckhardt","email":"pburckhardt@outlook.com"}],"scripts":{"test":"mocha","test-cov":"istanbul cover ./node_modules/.bin/_mocha --dir ./reports/coverage -- -R spec","coveralls":"istanbul cover ./node_modules/.bin/_mocha --dir ./reports/coveralls/coverage --report lcovonly -- -R spec && cat ./reports/coveralls/coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js && rm -rf ./reports/coveralls"},"main":"./lib","repository":{"type":"git","url":"git://github.com/compute-io/erfinv.git"},"keywords":["compute.io","compute","computation","statistics","stats","erf","inverse error function","error function","erfinv","mathematics","math","matrix","matrices","array","arrays","accessor","dstructs","deep","set","get","deepset"],"bugs":{"url":"https://github.com/compute-io/erfinv/issues"},"dependencies":{"compute-array-constructors":"^1.0.0","compute-polynomial":"^1.1.0","dstructs-matrix":"^2.0.0","utils-deep-get":"^1.0.0","utils-deep-set":"^1.0.1","validate.io-array-like":"^1.0.1","validate.io-boolean-primitive":"^1.0.0","validate.io-function":"^1.0.2","validate.io-matrix-like":"^1.0.2","validate.io-nan":"^1.0.3","validate.io-number-primitive":"^1.0.0","validate.io-object":"^1.0.4","validate.io-string-primitive":"^1.0.0","validate.io-typed-array-like":"^1.0.0"},"devDependencies":{"chai":"3.x.x","coveralls":"^2.11.1","istanbul":"^0.3.0","jshint":"2.x.x","jshint-stylish":"2.x.x","mocha":"2.x.x"},"license":"MIT","gitHead":"5d6a3a1bc9001c382b62e556a24bd8ea9caae803","homepage":"https://github.com/compute-io/erfinv#readme","_id":"compute-erfinv@3.0.1","_shasum":"b207509275bf122ee12dff2b7e445b9b14776f75","_from":".","_npmVersion":"2.14.7","_nodeVersion":"4.2.3","_npmUser":{"name":"kgryte","email":"kgryte@gmail.com"},"dist":{"shasum":"b207509275bf122ee12dff2b7e445b9b14776f75","tarball":"https://registry.npmjs.org/compute-erfinv/-/compute-erfinv-3.0.1.tgz","integrity":"sha512-1T2mWz4npWCtbfZboiuC7dqSEBgvdmJgDNlW124zi2DOgLj5wiRndJQgZdeHQapPmU9S37c4HL0m+PN6Wx/oKw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIB9+3QItnHFf/+31PFXeL9ZHM7FUs5m3xsnhEPM5JaXmAiEAzPB2hRCOBslIibfso0L4dlWBc7N1FQz15MjnbP2ahu8="}]},"maintainers":[{"name":"kgryte","email":"kgryte@gmail.com"},{"name":"planeshifter","email":"pgb@andrew.cmu.edu"}]}},"readme":"erfinv\n===\n[![NPM version][npm-image]][npm-url] [![Build Status][travis-image]][travis-url] [![Coverage Status][coveralls-image]][coveralls-url] [![Dependencies][dependencies-image]][dependencies-url]\n\n> [Inverse error function](https://en.wikipedia.org/wiki/Error_function#Inverse_functions). \n\nThe [inverse error function](https://en.wikipedia.org/wiki/Error_function#Inverse_functions) is defined in terms of the [Maclaurin series](http://mathworld.wolfram.com/MaclaurinSeries.html)\n\n<div class=\"equation\" align=\"center\" data-raw-text=\"\n    \\operatorname{erf}^{-1}(z)=\\sum_{k=0}^\\infty\\frac{c_k}{2k+1}\\left (\\frac{\\sqrt{\\pi}}{2}z\\right )^{2k+1}\" data-equation=\"eq:inverse_error_function\">\n\t<img src=\"https://cdn.rawgit.com/compute-io/erfinv/47176c1d9a8c9694cb7ef83c21c18bf2a89af333/docs/img/eqn.svg\" alt=\"Equation of the inverse error function.\">\n\t<br>\n</div>\n\nwhere `c_0 = 1` and \n\n<div class=\"equation\" align=\"center\" data-raw-text=\"\n    c_k=\\sum_{m=0}^{k-1}\\frac{c_m c_{k-1-m}}{(m+1)(2m+1)} = \\left\\{1,1,\\frac{7}{6},\\frac{127}{90},\\frac{4369}{2520},\\frac{34807}{16200},\\ldots\\right\\}\" data-equation=\"eq:inverse_error_function_series_coefficients\">\n\t<img src=\"https://cdn.rawgit.com/compute-io/erfinv/47176c1d9a8c9694cb7ef83c21c18bf2a89af333/docs/img/eqn2.svg\" alt=\"Equation of the coefficients.\">\n\t<br>\n</div>\n\n\n## Installation\n\n``` bash\n$ npm install compute-erfinv\n```\n\nFor use in the browser, use [browserify](https://github.com/substack/node-browserify).\n\n\n## Usage\n\n``` javascript\nvar erfinv = require( 'compute-erfinv' );\n```\n\n#### erfinv( x[, options] )\n\nEvaluates the [inverse error function](https://en.wikipedia.org/wiki/Error_function#Inverse_functions). `x` may be either a [`number`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number), an [`array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array), a [`typed array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Typed_arrays), or a [`matrix`](https://github.com/dstructs/matrix). All numeric values __must__ reside on the interval `[-1,1]`.\n\n``` javascript\nvar matrix = require( 'dstructs-matrix' ),\n\tdata,\n\tmat,\n\tout,\n\ti;\n\nout = erfinv( 0.5 );\n// returns ~0.47694\n\nout = erfinv( [ 0, 0.2, 0.5, 0.8, 1 ] );\n// returns [ 0, 0.17914, 0.47694, 0.90619, +infinity ]\n\ndata = [ 0, 0.5, 1 ];\nout = erfinv( data );\n// returns [ 0, 0.47694, +infinity ]\n\ndata = new Float32Array( data );\nout = erfinv( data );\n// returns Float64Array(  [ 0, 0.47694, +infinity ] )\n\ndata = new Float64Array( 4 );\nfor ( i = 0; i < 4; i++ ) {\n\tdata[ i ] = i / 2;\n}\nmat = matrix( data, [2,2], 'float64' );\n/*\n\t[ 0    0.25\n\t  0.5  0.75 ]\n*/\n\nout = erfinv( mat );\n/*\n\t[  0      ~0.2253\n\t  ~0.4769 ~0.8134 ]\n*/\n```\n\nThe function accepts the following `options`:\n\n* \t__accessor__: accessor `function` for accessing `array` values.\n* \t__dtype__: output [`typed array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Typed_arrays) or [`matrix`](https://github.com/dstructs/matrix) data type. Default: `float64`.\n*\t__copy__: `boolean` indicating if the `function` should return a new data structure. Default: `true`.\n*\t__path__: [deepget](https://github.com/kgryte/utils-deep-get)/[deepset](https://github.com/kgryte/utils-deep-set) key path.\n*\t__sep__: [deepget](https://github.com/kgryte/utils-deep-get)/[deepset](https://github.com/kgryte/utils-deep-set) key path separator. Default: `'.'`.\n\nFor non-numeric `arrays`, provide an accessor `function` for accessing `array` values.\n\n``` javascript\nvar data = [\n\t['beep', 0],\n\t['boop', 0.2],\n\t['bip', 0.5],\n\t['bap', 0.8],\n\t['baz', 1]\n];\n\nfunction getValue( d, i ) {\n\treturn d[ 1 ];\n}\n\nvar out = erfinv( data, {\n\t'accessor': getValue\n});\n// returns [ 0, 0.17914, 0.47694, 0.90619, +infinity ]\n```\n\nTo [deepset](https://github.com/kgryte/utils-deep-set) an object `array`, provide a key path and, optionally, a key path separator.\n\n``` javascript\nvar data = [\n\t{'x':[0,0]},\n\t{'x':[1,0.25]},\n\t{'x':[2,0.5]},\n\t{'x':[3,0.75]},\n\t{'x':[4,1]}\n];\n\nvar out = erfinv( data, 'x|1', '|' );\n/*\n\t[\n\t\t{'x':[0,0]},\n\t\t{'x':[1,0.2253]},\n\t\t{'x':[2,0.4769]},\n\t\t{'x':[3,0.8134]},\n\t\t{'x':[4,+infinity]}\n\t]\n*/\n\nvar bool = ( data === out );\n// returns true\n```\n\nBy default, when provided a [`typed array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Typed_arrays) or [`matrix`](https://github.com/dstructs/matrix), the output data structure is `float64` in order to preserve precision. To specify a different data type, set the `dtype` option (see [`matrix`](https://github.com/dstructs/matrix) for a list of acceptable data types).\n\n``` javascript\nvar data, out;\n\ndata = new float64Array( [0, 0.25, 0.5] );\n\nout = erfinv( data, {\n\t'dtype': 'int32'\n});\n// returns Int32Array( [0,0,0] )\n\n// Works for plain arrays, as well...\nout = erfinv( [0, 0.25, 0.5], {\n\t'dtype': 'uint8'\n});\n// returns Uint8Array( [0,0,0] )\n```\n\nBy default, the function returns a new data structure. To mutate the input data structure (e.g., when input values can be discarded or when optimizing memory usage), set the `copy` option to `false`.\n\n``` javascript\nvar data,\n\tbool,\n\tmat,\n\tout,\n\ti;\n\nvar data = [ 0, 0.2, 0.5, 0.8, 1 ];\n\nvar out = erfinv( data, {\n\t'copy': false\n});\n// returns [ 0, 0.17914, 0.47694, 0.90619, +infinity ]\n\nbool = ( data === out );\n// returns true\n\ndata = new Float64Array( 4 );\nfor ( i = 0; i < 4; i++ ) {\n\tdata[ i ] = i / 4;\n}\nmat = matrix( data, [2,2], 'float64' );\n/*\n\t[  0    0.25\n\t   0.5  0.75 ]\n*/\n\nout = erfinv( mat, {\n\t'copy': false\n});\n/*\n\t[  0      ~0.2253\n\t  ~0.4769 ~0.8134 ]\n*/\n\nbool = ( mat === out );\n// returns true\n```\n\n\n## Notes\n\n*\tIf an element is __not__ a numeric value, the evaluated [inverse error function](https://en.wikipedia.org/wiki/Error_function#Inverse_functions) is `NaN`.\n\n\t``` javascript\n\tvar data, out;\n\n\tout = erfinv( null );\n\t// returns NaN\n\n\tout = erfinv( true );\n\t// returns NaN\n\n\tout = erfinv( {'a':'b'} );\n\t// returns NaN\n\n\tout = erfinv( [ true, null, [] ] );\n\t// returns [ NaN, NaN, NaN ]\n\n\tfunction getValue( d, i ) {\n\t\treturn d.x;\n\t}\n\tdata = [\n\t\t{'x':true},\n\t\t{'x':[]},\n\t\t{'x':{}},\n\t\t{'x':null}\n\t];\n\n\tout = erfinv( data, {\n\t\t'accessor': getValue\n\t});\n\t// returns [ NaN, NaN, NaN, NaN ]\n\n\tout = erfinv( data, {\n\t\t'path': 'x'\n\t});\n\t/*\n\t\t[\n\t\t\t{'x':NaN},\n\t\t\t{'x':NaN},\n\t\t\t{'x':NaN,\n\t\t\t{'x':NaN}\n\t\t]\n\t*/\n\t```\n\n*\tBe careful when providing a data structure which contains non-numeric elements and specifying an `integer` output data type, as `NaN` values are cast to `0`.\n\n\t``` javascript\n\tvar out = erfinv( [ true, null, [] ], {\n\t\t'dtype': 'int8'\n\t});\n\t// returns Int8Array( [0,0,0] );\n\t```\n\n\n## Examples\n\n``` javascript\nvar matrix = require( 'dstructs-matrix' ),\n\terfinv = require( 'compute-erfinv' );\n\nvar data,\n\tmat,\n\tout,\n\ttmp,\n\ti;\n\n// Plain arrays...\ndata = new Array( 100 );\nfor ( i = 0; i < data.length; i++ ) {\n\tdata[ i ] = ( Math.random() - 0.5 ) * 2;\n}\nout = erfinv( data );\n\n// Object arrays (accessors)...\nfunction getValue( d ) {\n\treturn d.x;\n}\nfor ( i = 0; i < data.length; i++ ) {\n\tdata[ i ] = {\n\t\t'x': data[ i ]\n\t};\n}\nout = erfinv( data, {\n\t'accessor': getValue\n});\n\n// Deep set arrays...\nfor ( i = 0; i < data.length; i++ ) {\n\tdata[ i ] = {\n\t\t'x': [ i, data[ i ].x ]\n\t};\n}\nout = erfinv( data, {\n\t'path': 'x/1',\n\t'sep': '/'\n});\n\n// Typed arrays...\ndata = new Int32Array( 10 );\nfor ( i = 0; i < data.length; i++ ) {\n\tdata[ i ] = ( Math.random() - 0.5 ) * 2;\n}\ntmp = erfinv( data );\nout = '';\nfor ( i = 0; i < data.length; i++ ) {\n\tout += tmp[ i ];\n\tif ( i < data.length-1 ) {\n\t\tout += ',';\n\t}\n}\n\n// Matrices...\nmat = matrix( data, [5,2], 'int32' );\nout = erfinv( mat );\n\n// Matrices (custom output data type)...\nout = erfinv( mat, {\n\t'dtype': 'uint8'\n});\n```\n\nTo run the example code from the top-level application directory,\n\n``` bash\n$ node ./examples/index.js\n```\n\n\n## Tests\n\n### Unit\n\nUnit tests use the [Mocha](http://mochajs.org) test framework with [Chai](http://chaijs.com) assertions. To run the tests, execute the following command in the top-level application directory:\n\n``` bash\n$ make test\n```\n\nAll new feature development should have corresponding unit tests to validate correct functionality.\n\n\n### Test Coverage\n\nThis repository uses [Istanbul](https://github.com/gotwarlost/istanbul) as its code coverage tool. To generate a test coverage report, execute the following command in the top-level application directory:\n\n``` bash\n$ make test-cov\n```\n\nIstanbul creates a `./reports/coverage` directory. To access an HTML version of the report,\n\n``` bash\n$ make view-cov\n```\n\n\n---\n## License\n\n[MIT license](http://opensource.org/licenses/MIT)\n\n\n## Copyright\n\nCopyright &copy; 2014-2015. The [Compute.io](https://github.com/compute-io) Authors.\n\n\n[npm-image]: http://img.shields.io/npm/v/compute-erfinv.svg\n[npm-url]: https://npmjs.org/package/compute-erfinv\n\n[travis-image]: http://img.shields.io/travis/compute-io/erfinv/master.svg\n[travis-url]: https://travis-ci.org/compute-io/erfinv\n\n[coveralls-image]: https://img.shields.io/coveralls/compute-io/erfinv/master.svg\n[coveralls-url]: https://coveralls.io/r/compute-io/erfinv?branch=master\n\n[dependencies-image]: http://img.shields.io/david/compute-io/erfinv.svg\n[dependencies-url]: https://david-dm.org/compute-io/erfinv\n\n[dev-dependencies-image]: http://img.shields.io/david/dev/compute-io/erfinv.svg\n[dev-dependencies-url]: https://david-dm.org/dev/compute-io/erfinv\n\n[github-issues-image]: http://img.shields.io/github/issues/compute-io/erfinv.svg\n[github-issues-url]: https://github.com/compute-io/erfinv/issues\n","maintainers":[{"name":"kgryte","email":"kgryte@gmail.com"},{"name":"planeshifter","email":"pgb@andrew.cmu.edu"}],"time":{"modified":"2022-06-13T20:28:02.828Z","created":"2014-09-20T09:52:11.104Z","0.0.0":"2014-09-20T09:52:11.104Z","1.0.0":"2014-09-20T09:52:33.139Z","1.0.1":"2014-09-20T18:19:13.671Z","2.0.0":"2015-06-19T07:24:46.808Z","3.0.0":"2015-07-22T16:33:14.053Z","3.0.1":"2016-01-30T22:41:55.540Z"},"homepage":"https://github.com/compute-io/erfinv#readme","keywords":["compute.io","compute","computation","statistics","stats","erf","inverse error function","error function","erfinv","mathematics","math","matrix","matrices","array","arrays","accessor","dstructs","deep","set","get","deepset"],"repository":{"type":"git","url":"git://github.com/compute-io/erfinv.git"},"contributors":[{"name":"Athan Reines","email":"kgryte@gmail.com"},{"name":"Philipp Burckhardt","email":"pburckhardt@outlook.com"}],"author":{"name":"Athan Reines","email":"kgryte@gmail.com"},"bugs":{"url":"https://github.com/compute-io/erfinv/issues"},"readmeFilename":"README.md","license":"MIT"}