# Generated by using Rcpp::compileAttributes() -> do not edit by hand
# Generator token: 10BE3573-1514-4C36-9D1C-5A225CD40393

#' @title Trapezoid Rule Numeric Integration
#'
#' @description Compute the integral of y with respect to x via trapezoid rule.
#'
#' @param x,y numeric vectors of equal length
#'
#' @return a numeric value, the estimated integral
#'
#' @examples
#' xvec <- seq(-2 * pi, 3 * pi, length = 560)
#' foo  <- function(x) { sin(x) + x * cos(x) + 12 }
#' yvec <- foo(xvec)
#' plot(xvec, yvec, type = "l")
#'
#' integrate(f = foo, lower = -2 * pi, upper = 3 * pi)
#' traprule(xvec, yvec)
#'
#' @export
traprule <- function(x, y) {
    .Call('_qwraps2_traprule', PACKAGE = 'qwraps2', x, y)
}

