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 atanh = typed('atanh', {
|
28 | 'number': function number(x) {
|
29 | if (x <= 1 && x >= -1 || config.predictable) {
|
30 | return _atanh(x);
|
31 | }
|
32 | return new type.Complex(x, 0).atanh();
|
33 | },
|
34 |
|
35 | 'Complex': function Complex(x) {
|
36 | return x.atanh();
|
37 | },
|
38 |
|
39 | 'BigNumber': function BigNumber(x) {
|
40 | return x.atanh();
|
41 | },
|
42 |
|
43 | 'Array | Matrix': function ArrayMatrix(x) {
|
44 |
|
45 | return deepMap(x, atanh, true);
|
46 | }
|
47 | });
|
48 |
|
49 | atanh.toTex = { 1: '\\tanh^{-1}\\left(${args[0]}\\right)' };
|
50 |
|
51 | return atanh;
|
52 | }
|
53 |
|
54 |
|
55 |
|
56 |
|
57 |
|
58 |
|
59 |
|
60 | var _atanh = Math.atanh || function (x) {
|
61 | return Math.log((1 + x) / (1 - x)) / 2;
|
62 | };
|
63 |
|
64 | exports.name = 'atanh';
|
65 | exports.factory = factory; |
\ | No newline at end of file |