User fredrik johansson - MathOverflow most recent 30 from http://mathoverflow.net 2013-05-21T23:43:08Z http://mathoverflow.net/feeds/user/4854 http://www.creativecommons.org/licenses/by-nc/2.5/rdf http://mathoverflow.net/questions/123999/efficient-way-for-computation-of-derivatives-of-fx-zeta1-x-1-x-at-int/124002#124002 Answer by Fredrik Johansson for Efficient way for computation of derivatives of $f(x) = \zeta(1-x) + 1/x $ at integer x? Fredrik Johansson 2013-03-08T17:38:42Z 2013-03-08T17:38:42Z <p>The Euler-Maclaurin formula works quite well.</p> <p>I have implemented simultaneous computation of $(\zeta(s,a), \zeta'(s,a) \ldots, \zeta^{(n)}(s,a))$ for arbitrary $s, a \in \mathbb{C}$, with the option to subtract $1/(s-1)$ to remove the singularity at $s = 1$, in my library for ball arithmetic <a href="http://fredrikj.net/arb/" rel="nofollow">Arb</a>. All the derivatives are computed with rigorous error bounds (as currently described on <a href="http://fredrikj.net/arb/fmpcb.html" rel="nofollow">this page</a>).</p> <p>As a benchmark, computing the first 1000 Stieltjes constants to 1000 accurate digits (using 1500 digits of precision to give $\gamma_0$ accurate to 1500 digits and $\gamma_{1000}$ accurate to 1000 digits) takes 14 seconds, and computing the first 5000 Stieltjes constants to 5000 digits takes 40 minutes.</p> http://mathoverflow.net/questions/105535/how-to-check-numerical-precision-of-my-computation-of-stieltjes-constants/105545#105545 Answer by Fredrik Johansson for How to check numerical precision of my computation of Stieltjes-constants? Fredrik Johansson 2012-08-26T15:46:08Z 2012-08-26T15:46:08Z <p>You could compare with the output from mpmath:</p> <pre><code>sage: import mpmath sage: mpmath.mp.dps = 1000 sage: %time mpmath.stieltjes(511) CPU times: user 123.17 s, sys: 0.02 s, total: 123.19 s Wall time: 123.40 s mpf('673581492593841075447052270498937988033439947306384442967711559788996269245614412865378751092398327114199475672304543519558074203937367354475627304841991475249868411079091195038704370379319922304314968920977080.4218186954910530966341150821211999689800345913062006500416130863993252444286525401536530609127800808358611180051913954061786113778487954768827917318185861285728540852470806490244553130800206629709991267757983837666355484638397085316115099902138453930569718675294835237821298508690226519561229169443578986238598614523990440226172962706436119188515904391443174279895106345752233034115379099381680958168062786627389335290431416199037643058641914376639305675292168558263653044141610653456719446309980037732502545489019580865593535176949757824659484296855986638635532332512794555243036229273521585906314889067495562018805980518215400448131311489588531760771126389926309367463577942595344292677230759234541824332220012416082001221662802813469321335808232095303910714771240349667445255785796410716571') </code></pre> <p>This only seems to agree with your result up to about 715 digits. Mathematica 8 agrees with mpmath, so presumably you will need to increase the precision in your algorithm.</p> http://mathoverflow.net/questions/88612/about-one-series-are-there-some-related-special-functions/88616#88616 Answer by Fredrik Johansson for About one series. Are there some related special functions? Fredrik Johansson 2012-02-16T09:27:08Z 2012-02-16T09:27:08Z <p>It's a special case of the <a href="http://en.wikipedia.org/wiki/Mittag-Leffler_function" rel="nofollow">Mittag-Leffler function</a>.</p> http://mathoverflow.net/questions/34151/simple-efficient-representation-of-stirling-numbers-of-the-first-kind Simple/efficient representation of Stirling numbers of the first kind Fredrik Johansson 2010-08-01T20:36:55Z 2010-10-02T02:11:27Z <p>Stirling numbers of the second kind can be expressed by means of a simple hypergeometric (considering $n$ fixed) sum</p> <p>$$S_2(n,k) = \frac{1}{k!}\sum_{j=0}^{k}(-1)^{k-j}{k \choose j} j^n. \qquad (1)$$</p> <p>This can be used for direct calculation of $S_2(n,k)$, without the need to compute any preceding values. But for Stirling numbers of the first kind, one seems to need a nested sum or a recurrence over preceding values, the most direct known representation perhaps being</p> <p>$$S_1(n,k) = \sum_{j=0}^{n-k} (-1)^j {n+j-1\choose n-k+j} {2n-k \choose n-k-j} S_2(n-k+j,j). \qquad (2)$$</p> <p>Is there a reason to believe that no formula similar to (1) exists for Stirling numbers of the first kind? Does a formula better than (2)+(1) for calculations exist (assume that I have no interest in generating a table of all preceding values)?</p> http://mathoverflow.net/questions/39986/modified-and-unmodified-bessel-functions-of-the-second-kind/39988#39988 Answer by Fredrik Johansson for Modified and unmodified Bessel functions of the second kind Fredrik Johansson 2010-09-26T01:36:56Z 2010-09-26T01:36:56Z <p>There is, but I think you need to include an extra $J_\nu$ or $I_\nu$. See the formulas here: <a href="http://functions.wolfram.com/Bessel-TypeFunctions/BesselK/27/01/" rel="nofollow">http://functions.wolfram.com/Bessel-TypeFunctions/BesselK/27/01/</a> (in particular #3 and #4 from the top).</p> http://mathoverflow.net/questions/33588/complexity-of-high-order-differentiation Complexity of high-order differentiation Fredrik Johansson 2010-07-27T23:56:56Z 2010-09-08T12:10:44Z <p>Let $g(x) = \exp(f(x))$. Assuming numerical (or symbolic) values of $f(x), f'(x), f''(x), \ldots, f^{(n)}(x)$ are known, is there a way to compute $g'(x), g''(x), \ldots g^{(n)}(x)$ (or even the single value $g^{(n)}(x)$) for large $n$ that is faster than explicitly generating and evaluating the expanded symbolic derivative, a polynomial which has $p(n)$ (partition function) terms?</p> http://mathoverflow.net/questions/28261/uniform-variant-of-stirlings-approximation/28321#28321 Answer by Fredrik Johansson for Uniform variant of Stirling's approximation Fredrik Johansson 2010-06-15T22:54:37Z 2010-06-15T22:54:37Z <p>Would the approximations of <a href="http://en.wikipedia.org/wiki/Lanczos_approximation" rel="nofollow">Lanczos</a> and <a href="http://en.wikipedia.org/wiki/Spouge%27s_approximation" rel="nofollow">Spouge</a> work? Spouge's approximation, in particular, has a rather nice form and an explicit error bound valid in the entire right half plane. Note that both approximations are for the gamma function, not the log gamma function, so getting the right branch might require additional work.</p> http://mathoverflow.net/questions/23946/elementary-functions-with-zeros-only-at-the-positive-integers Elementary functions with zeros only at the positive integers Fredrik Johansson 2010-05-08T18:42:08Z 2010-05-08T21:36:48Z <p>Does there exist a (meromorphic) elementary function $f(z)$ that is zero at all the positive integers $z = 1, 2, 3, \ldots$ and only at those points?</p> <p>Edit: an <a href="http://en.wikipedia.org/wiki/Elementary_function" rel="nofollow">elementary function</a> can be written as a finite composition of constants, rational functions, exponentials and logarithms.</p> <p>Obviously a function with those zeros can be constructed using the gamma function or a Weierstrass product, but the question is whether there is an elementary function.</p> http://mathoverflow.net/questions/3204/does-any-method-of-summing-divergent-series-work-on-the-harmonic-series/19287#19287 Answer by Fredrik Johansson for Does any method of summing divergent series work on the harmonic series? Fredrik Johansson 2010-03-25T07:39:29Z 2010-03-25T07:39:29Z <p>I'm not allowed to post a comment, but in reply to Michael Lugo's post and as a followup to Scott Carnahan, the prime harmonic series can be regularized in analogy with $1 + 1/2 + 1/3 + 1/4 + \ldots$ "$=$" $\gamma$, giving the <a href="http://mathworld.wolfram.com/MertensConstant.html" rel="nofollow">Mertens constant</a>. See the <a href="http://mathworld.wolfram.com/PrimeZetaFunction.html" rel="nofollow">prime zeta function</a> for more information.</p> <p>In this case it's not "meromorphic continuation" as the singularity is logarithmic. This leads to the followup question: is there a practical difference, and is there a general theory for the logarithmic (or even more general, e.g. multiply nested logarithmic) case? The prime zeta function has some interesting properties, such as having a natural boundary of analyticity at $\Re(s) = 0$.</p> http://mathoverflow.net/questions/127968/efficient-divergent-summation-for-sum-of-zetas-at-negative-arguments Comment by Fredrik Johansson Fredrik Johansson 2013-04-19T11:00:33Z 2013-04-19T11:00:33Z joro: mpmath.nsum does not work well if some terms are zero. Excluding those gives 0.081061466795328 (it does not appear possible to get much more accuracy). http://mathoverflow.net/questions/111400/good-computer-package-for-calculating-inverse-of-a-formal-power-series Comment by Fredrik Johansson Fredrik Johansson 2013-04-03T22:57:45Z 2013-04-03T22:57:45Z Assuming you mean the compositional inverse, fmpz_poly_revert_series. flint is a good choice if you want say 10000 terms. http://mathoverflow.net/questions/125629/machin-like-formulas-for-logarithms/125687#125687 Comment by Fredrik Johansson Fredrik Johansson 2013-03-28T18:13:18Z 2013-03-28T18:13:18Z These findings are very interesting (author of the blog here). The 4-term formula is some 10% faster than the 3-term formula in practice, which is not really that much but still quite nice. Getting a longer list of primes is very useful though. I can't believe I missed the section in Joerg's (great) book! http://mathoverflow.net/questions/123999/efficient-way-for-computation-of-derivatives-of-fx-zeta1-x-1-x-at-int/124002#124002 Comment by Fredrik Johansson Fredrik Johansson 2013-03-08T20:59:14Z 2013-03-08T20:59:14Z Yes (if I understand your question directly), the Euler-Maclaurin formula works directly for zeta at any integer, and gives you the Stieltjes constants at $s = 1$ after just removing the singular $1/(s-1)$ term. http://mathoverflow.net/questions/116275/simple-lower-bounds-for-bell-numbers-number-of-set-partitions Comment by Fredrik Johansson Fredrik Johansson 2012-12-14T22:19:29Z 2012-12-14T22:19:29Z B_n &gt;= (n/log_2(n))^n is false already for n = 47... http://mathoverflow.net/questions/115509/when-we-use-bernstein-polynomials-in-application/115510#115510 Comment by Fredrik Johansson Fredrik Johansson 2012-12-06T01:39:17Z 2012-12-06T01:39:17Z I see. Still, any polynomial can be written in the Bernstein basis, so if you are working with the Bernstein basis for computational purposes, you always have the option to choose an exact interpolant instead of &quot;the&quot; Bernstein polynomial $B_n(f)$. http://mathoverflow.net/questions/115509/when-we-use-bernstein-polynomials-in-application/115510#115510 Comment by Fredrik Johansson Fredrik Johansson 2012-12-05T23:56:45Z 2012-12-05T23:56:45Z I must be missing something. Surely the approximation error is $o(1/n)$ (in particular, identically zero for all but a finite number of $n$) if $f$ is any polynomial? http://mathoverflow.net/questions/42393/has-stirlings-formula-ever-been-applied-with-interesting-consequence-to-wilson/42398#42398 Comment by Fredrik Johansson Fredrik Johansson 2012-10-04T15:39:19Z 2012-10-04T15:39:19Z The convergent version converges incredibly slowly. We are now swatting flies with glaciers. http://mathoverflow.net/questions/105535/how-to-check-numerical-precision-of-my-computation-of-stieltjes-constants/105545#105545 Comment by Fredrik Johansson Fredrik Johansson 2012-08-26T17:39:08Z 2012-08-26T17:39:08Z The algorithm is described here: <a href="http://mpmath.googlecode.com/svn/trunk/doc/build/functions/zeta.html#stieltjes" rel="nofollow">mpmath.googlecode.com/svn/trunk/doc/build/&hellip;</a> Specifically, it does numerical integration. http://mathoverflow.net/questions/33588/complexity-of-high-order-differentiation/38050#38050 Comment by Fredrik Johansson Fredrik Johansson 2010-09-09T11:48:34Z 2010-09-09T11:48:34Z Excellent! This doesn't really solve the problem for arbitrary n, though. http://mathoverflow.net/questions/34151/simple-efficient-representation-of-stirling-numbers-of-the-first-kind Comment by Fredrik Johansson Fredrik Johansson 2010-08-02T17:08:32Z 2010-08-02T17:08:32Z Wadim: I'm asking whether there is a formula that does not involve nested Stirling numbers. http://mathoverflow.net/questions/34151/simple-efficient-representation-of-stirling-numbers-of-the-first-kind Comment by Fredrik Johansson Fredrik Johansson 2010-08-02T01:23:12Z 2010-08-02T01:23:12Z Mariano: yes, for large $n$. Qiaochu: this is a good method, but even expanding the polynomial using a balanced product (I tried it using Sage) is considerably slower for large n than evaluating (1), and of course requires much more memory. I'm interested in whether there exists a formula that does not amount to computing all $k$ numbers. http://mathoverflow.net/questions/33588/complexity-of-high-order-differentiation Comment by Fredrik Johansson Fredrik Johansson 2010-07-28T01:18:32Z 2010-07-28T01:18:32Z Thanks, this is the terminology I'm looking for. So I guess the question is: is there a better way than the naive one to evaluate this polynomial (the naive method being to generate the expanded polynomial and evaluate it term by term)? http://mathoverflow.net/questions/33588/complexity-of-high-order-differentiation/33596#33596 Comment by Fredrik Johansson Fredrik Johansson 2010-07-28T01:09:26Z 2010-07-28T01:09:26Z I don't see how AD helps here. Rather, AD of nth order requires that the symbolic nth derivatives of atomic functions are already known. http://mathoverflow.net/questions/28669/numerical-integration-over-2d-disk Comment by Fredrik Johansson Fredrik Johansson 2010-06-18T22:10:01Z 2010-06-18T22:10:01Z Am I missing something or why not just change variables from the disk to the unit square and use nested Gaussian quadrature?