MCPcopy Create free account
hub / github.com/arguiot/TheoremJS / ln

Method ln

__test__/theorem.js:60–76  ·  view source on GitHub ↗
(x, n = 15)

Source from the content-addressed store, hash-verified

58 }
59 }
60 ln(x, n = 15) {
61 if (x.isComplex) {
62 return x.ln()
63 }
64 let buffer = new BigNumber(0);
65 for (let i = 0; i < Math.ceil(n + (3 / 2 * x)); i++) {
66 const n = new BigNumber(1)
67 .div(new BigNumber(i).times(2).plus(1))
68 .times(
69 new BigNumber(x).minus(1)
70 .div(new BigNumber(x).plus(1))
71 .pow(new BigNumber(i).times(2).plus(1))
72 )
73 buffer = buffer.plus(n)
74 }
75 return new BigNumber(buffer.times(2).toFixed(n - 1))
76 }
77 lngamma(z) {
78 const g_ln = 607/128;
79 const p_ln = [

Callers 8

logMethod · 0.95
log.jsFile · 0.45
ln.jsFile · 0.45
log.jsFile · 0.45
ln.jsFile · 0.45
lnMethod · 0.45
logMethod · 0.45
test.jsFile · 0.45

Calls 6

ceilMethod · 0.80
timesMethod · 0.80
divMethod · 0.80
plusMethod · 0.80
minusMethod · 0.80
powMethod · 0.45

Tested by

no test coverage detected