1 | 'use strict';
|
2 |
|
3 | var deepMap = require('../../utils/collection/deepMap');
|
4 |
|
5 | function factory(type, config, load, typed) {
|
6 | |
7 |
|
8 |
|
9 |
|
10 |
|
11 |
|
12 |
|
13 |
|
14 |
|
15 |
|
16 |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 |
|
22 |
|
23 |
|
24 |
|
25 |
|
26 |
|
27 | var acoth = typed('acoth', {
|
28 | 'number': function number(x) {
|
29 | if (x >= 1 || x <= -1 || config.predictable) {
|
30 | return isFinite(x) ? (Math.log((x + 1) / x) + Math.log(x / (x - 1))) / 2 : 0;
|
31 | }
|
32 | return new type.Complex(x, 0).acoth();
|
33 | },
|
34 |
|
35 | 'Complex': function Complex(x) {
|
36 | return x.acoth();
|
37 | },
|
38 |
|
39 | 'BigNumber': function BigNumber(x) {
|
40 | return new type.BigNumber(1).div(x).atanh();
|
41 | },
|
42 |
|
43 | 'Array | Matrix': function ArrayMatrix(x) {
|
44 | return deepMap(x, acoth);
|
45 | }
|
46 | });
|
47 |
|
48 | acoth.toTex = { 1: '\\coth^{-1}\\left(${args[0]}\\right)' };
|
49 |
|
50 | return acoth;
|
51 | }
|
52 |
|
53 | exports.name = 'acoth';
|
54 | exports.factory = factory; |
\ | No newline at end of file |