1 | ;
|
2 | var $ = require('../internals/export');
|
3 | var expm1 = require('../internals/math-expm1');
|
4 |
|
5 | // eslint-disable-next-line es/no-math-cosh -- required for testing
|
6 | var $cosh = Math.cosh;
|
7 | var abs = Math.abs;
|
8 | var E = Math.E;
|
9 |
|
10 | var FORCED = !$cosh || $cosh(710) === Infinity;
|
11 |
|
12 | // `Math.cosh` method
|
13 | // https://tc39.es/ecma262/#sec-math.cosh
|
14 | $({ target: 'Math', stat: true, forced: FORCED }, {
|
15 | cosh: function cosh(x) {
|
16 | var t = expm1(abs(x) - 1) + 1;
|
17 | return (t + 1 / (t * E * E)) * (E / 2);
|
18 | }
|
19 | });
|