summaryrefslogtreecommitdiff
path: root/node_modules/locutus/php/math/tanh.js
diff options
context:
space:
mode:
Diffstat (limited to 'node_modules/locutus/php/math/tanh.js')
-rw-r--r--node_modules/locutus/php/math/tanh.js12
1 files changed, 12 insertions, 0 deletions
diff --git a/node_modules/locutus/php/math/tanh.js b/node_modules/locutus/php/math/tanh.js
new file mode 100644
index 0000000..b447719
--- /dev/null
+++ b/node_modules/locutus/php/math/tanh.js
@@ -0,0 +1,12 @@
+"use strict";
+
+module.exports = function tanh(arg) {
+ // discuss at: http://locutus.io/php/tanh/
+ // original by: Onno Marsman (https://twitter.com/onnomarsman)
+ // imprived by: Robert Eisele (http://www.xarg.org/)
+ // example 1: tanh(5.4251848798444815)
+ // returns 1: 0.9999612058841574
+
+ return 1 - 2 / (Math.exp(2 * arg) + 1);
+};
+//# sourceMappingURL=tanh.js.map \ No newline at end of file