# Argument recycling and parallel integration of two intervals
integrate_gk(sin, 0, c(pi, 2 * pi))
dist <- dist_exponential()
integrate_gk(
function(x, p) dist$density(x, with_params = p),
lower = 0, upper = 1:10,
params = list(rate = 1 / 1:10)
)
dist$probability(1:10, with_params = list(rate = 1 / 1:10))
Run the code above in your browser using DataLab