class AdaptiveCompositeIntegrator1D extends Integrator1D<Double, Double> {

  @Override
  public Double integrate(final Function1D<Double, Double> f, final Double lower, final Double upper) {
    Validate.notNull(f, "f");
    Validate.notNull(lower, "lower bound");
    Validate.notNull(upper, "upper bound");
    try {
      if (lower < upper) {
        return integration(f, lower, upper);
      }
      s_logger.info("Upper bound was less than lower bound; swapping bounds and negating result");
      return -integration(f, upper, lower);
    } catch (final Exception e) {
      throw new OpenGammaRuntimeException("function evaluation returned NaN or Inf");
    }
  }

  public  AdaptiveCompositeIntegrator1D(final Integrator1D<Double, Double> integrator);
  public  AdaptiveCompositeIntegrator1D(final Integrator1D<Double, Double> integrator, final double gain, final double tol);

}