# Hcubature\_count?

**URL:** <https://discourse.julialang.org/t/hcubature-count/115878>\
**Category:** Numerics\
**Tags:** quadrature, hcubature\
**Created:** [June 19, 2024, 5:55pm UTC](https://discourse.julialang.org/t/hcubature-count/115878 "2024-06-19T17:55:09Z")\
**Posts on this page:** 1\
**Showing post:** 6

<div class="post-metadata">

**Author:** ![stevengj](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stevengj/32/71_2.png) [@stevengj](https://discourse.julialang.org/u/stevengj)\
**Post date:** [June 20, 2024, 1:01am UTC](https://discourse.julialang.org/t/hcubature-count/115878/6 "2024-06-20T01:01:54Z")

</div>

> [@Domenico\_Lahaye](#):
>
> What do you consider to be a good measure of the degree of singularity of the integrand? Does information from truncated Taylor series map on-to-one to number of function evaluations?

If it’s singular, you don’t even have a Taylor series.

If the function is analytic (has a convergent Taylor series in a neighborhood of the integration domain), then convergence is determined by things like the closest singularity/pole in the complex plane and/or how oscillatory the function is.

If it’s not analytic, then convergence is usually determined by the biggest “non-smoothness”. For example, the lowest derivative that is discontinuous. Or, if it has an integrable singularity (a point where the integrand blows up in the domain, but slowly enough that the integral is still finite), then by the fastest rate of blowing up.

> [@Domenico\_Lahaye](#):
>
> I would expect 1/norm(x)^3 to be more singular than x[1]/norm(x)^3, but hcubature shows a lower function evaluation count.

That’s because for `1/norm(x)^3` it simply gives up without giving a finite answer: this is _not_ an integrable singularity in 3d (the integral is \infty).

```julia
julia> hcubature_count(x -> 1/norm(x)^3, (0,0,0), (1,1,1)) # non-integrable singularity
(Inf, NaN, 67287)

julia> hcubature_count(x -> x[1]/norm(x)^3, (0,0,0), (1,1,1)) # integrable singularity
(0.9693880526621552, 1.4444861385160079e-8, 1098471)

```

---

_[View the full topic](https://discourse.julialang.org/t/hcubature-count/115878)._
