asinh.js 999 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. import { factory } from '../../utils/factory.js';
  2. import { asinhNumber } from '../../plain/number/index.js';
  3. var name = 'asinh';
  4. var dependencies = ['typed'];
  5. export var createAsinh = /* #__PURE__ */factory(name, dependencies, _ref => {
  6. var {
  7. typed
  8. } = _ref;
  9. /**
  10. * Calculate the hyperbolic arcsine of a value,
  11. * defined as `asinh(x) = ln(x + sqrt(x^2 + 1))`.
  12. *
  13. * To avoid confusion with the matrix hyperbolic arcsine, this function
  14. * does not apply to matrices.
  15. *
  16. * Syntax:
  17. *
  18. * math.asinh(x)
  19. *
  20. * Examples:
  21. *
  22. * math.asinh(0.5) // returns 0.48121182505960347
  23. *
  24. * See also:
  25. *
  26. * acosh, atanh
  27. *
  28. * @param {number | BigNumber | Complex} x Function input
  29. * @return {number | BigNumber | Complex} Hyperbolic arcsine of x
  30. */
  31. return typed('asinh', {
  32. number: asinhNumber,
  33. Complex: function Complex(x) {
  34. return x.asinh();
  35. },
  36. BigNumber: function BigNumber(x) {
  37. return x.asinh();
  38. }
  39. });
  40. });