@sverek (Sverek) posted a new topic, subject "Choosing order in QuadGK". It read:

   Anybody has a rough idea how I should set the order of QuadGK for a standard mass matrix element calculation (Lagrange element) with order `p^2` and `BigFloat` precision `N`
    
    i read this in documentation:
    
    `It is advisable to increase the integration order in rough proportion to the precision, for smooth integrands.`
    
    and it is not very clear so me. Say I want `p=20` and `N=1000`, then what order for the quadrature should I set?

@sverek (Sverek) replied

    And yes, I need these kinds of matrices. It is not for FEM calculations. Doing it symbolically would be ok too if somebody has some hints.

@antoine-levitt (Antoine Levitt) replied

    Is your question for a given N, how to choose p? Otherwise I don't understand the question. For a smooth integrand (technically, it depends on the region of analyticity), you can expect that the error of a Lagrange interpolation with p points behaves as exp(-c p) where c is a constant. Therefore, if you find out that a given p gives you N digits, you should use 2p to give you 2N digits.

Then @sverek (Sverek) said

    Bad choice of notation from my part `N` here is the precision of BigFloat in bits, I need to do many different runs with varying number of bits, some over 3000 bits. I need to do for varying order of the Lagrange polynomials (up to maybe p=50, doing up to 20 now). Code works fine but already at p=7 it is very slow. We are talking about 12 hours for a tiny matrix (mixing up questions now, ignore the size of the matrix, here I am talking about the specific elements for assembly, in other parts of the code I am computing the eigenvalues which is of course not related) maybe 256 bit precision and p=10. In documentation of QuadGK Home · QuadGK.jl  
    It states that one should increase the integration order of QuadGK with precision. I am not setting it to anything at the moment and letting it choose by itself.
    
    So my question is: For a given `p` and `N`, what would be an appropriate argument `order=x` to the function `quadgk` to make it faster, I assume it is slow because it is adaptively increasing this order. I could always try but since one run is about 12h it is a bit awkward


{'source': 'discourse', 'url': 'https://discourse.julialang.org/t/choosing-order-in-quadgk/13534', 'title': 'Choosing order in QuadGK', 'views': 533, 'has_accepted_answer': False, 'word_count': 391, 'like_count': 0, 'reply_count': 1, 'participant_count': 2, 'posts': 4, 'tags': '', 'author': '@sverek (Sverek)', 'participants': '@sverek (Sverek), @antoine-levitt (Antoine Levitt)', 'image_url': [None], 'created_at': '2018-08-15T23:31:56.152Z', 'last_posted_at': '2018-08-16T10:10:01.635Z'}