d33a75e1f9e1960ddf6d75393b73c3130be21897dd53da6442fb0d07ab701c685aa4712a1c405b07130aa6e8c8e26ecdbf0c1654e902fb0256a78f0eac047e 510 B

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