acsch.js 1.1 KB

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