% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/helper_functions.R
\name{minmax}
\alias{minmax}
\alias{min2}
\alias{max2}
\title{AD-compatible minimum and maximum functions}
\usage{
min2(x, y)

max2(x, y)
}
\arguments{
\item{x}{first vector}

\item{y}{second vector}
}
\value{
\code{min2} returns the parallel minimum and \code{max2} the parallel maximum of \code{x} and \code{y}
}
\description{
These functions compute the parallel minimum/ maximum of two vector-valued inputs and are compatible with automatic differentiation using \code{RTMB}.
}
\examples{
x <- c(1, 4, 8, 2)
y <- c(2, 5, 3, 7)
min2(x, y)
max2(x, y)
}
