summaryrefslogtreecommitdiff
path: root/node_modules/locutus/php/math/log1p.js.map
diff options
context:
space:
mode:
Diffstat (limited to 'node_modules/locutus/php/math/log1p.js.map')
-rw-r--r--node_modules/locutus/php/math/log1p.js.map1
1 files changed, 1 insertions, 0 deletions
diff --git a/node_modules/locutus/php/math/log1p.js.map b/node_modules/locutus/php/math/log1p.js.map
new file mode 100644
index 0000000..73d2962
--- /dev/null
+++ b/node_modules/locutus/php/math/log1p.js.map
@@ -0,0 +1 @@
+{"version":3,"sources":["../../../src/php/math/log1p.js"],"names":["module","exports","log1p","x","ret","n","Math","log","i","pow"],"mappings":";;AAAAA,OAAOC,OAAP,GAAiB,SAASC,KAAT,CAAgBC,CAAhB,EAAmB;AAClC;AACA;AACA;AACA;AACA;AACA;;AAEA,MAAIC,MAAM,CAAV;AACA;AACA,MAAIC,IAAI,EAAR;;AAEA,MAAIF,KAAK,CAAC,CAAV,EAAa;AACX;AACA,WAAO,MAAP;AACD;AACD,MAAIA,IAAI,CAAJ,IAASA,IAAI,CAAjB,EAAoB;AAClB,WAAOG,KAAKC,GAAL,CAAS,IAAIJ,CAAb,CAAP;AACD;AACD,OAAK,IAAIK,IAAI,CAAb,EAAgBA,IAAIH,CAApB,EAAuBG,GAAvB,EAA4B;AAC1BJ,WAAOE,KAAKG,GAAL,CAAS,CAACN,CAAV,EAAaK,CAAb,IAAkBA,CAAzB;AACD;;AAED,SAAO,CAACJ,GAAR;AACD,CAxBD","file":"log1p.js","sourcesContent":["module.exports = function log1p (x) {\n // discuss at: http://locutus.io/php/log1p/\n // original by: Brett Zamir (http://brett-zamir.me)\n // improved by: Robert Eisele (http://www.xarg.org/)\n // note 1: Precision 'n' can be adjusted as desired\n // example 1: log1p(1e-15)\n // returns 1: 9.999999999999995e-16\n\n var ret = 0\n // degree of precision\n var n = 50\n\n if (x <= -1) {\n // JavaScript style would be to return Number.NEGATIVE_INFINITY\n return '-INF'\n }\n if (x < 0 || x > 1) {\n return Math.log(1 + x)\n }\n for (var i = 1; i < n; i++) {\n ret += Math.pow(-x, i) / i\n }\n\n return -ret\n}\n"]} \ No newline at end of file