double[] epsilon = new double[] { 1.0e-20, 4.0e-16, 3.0e-15, 2.0e-11, 3.0e-9, 1.0e-6 };
final double lo = 2;
final double hi = 3;
final Logit f = new Logit(lo, hi);
final Sigmoid g = new Sigmoid(lo, hi);
RandomGenerator random = new Well1024a(0x96885e9c1f81cea5l);
final UnivariateDifferentiableFunction id =
FunctionUtils.compose((UnivariateDifferentiableFunction) g, (UnivariateDifferentiableFunction) f);
for (int maxOrder = 0; maxOrder < 6; ++maxOrder) {
double max = 0;
for (int i = 0; i < 10; i++) {
final double x = lo + random.nextDouble() * (hi - lo);
final DerivativeStructure dsX = new DerivativeStructure(1, maxOrder, 0, x);
max = FastMath.max(max, FastMath.abs(dsX.getPartialDerivative(maxOrder) -
id.value(dsX).getPartialDerivative(maxOrder)));
Assert.assertEquals(dsX.getPartialDerivative(maxOrder),
id.value(dsX).getPartialDerivative(maxOrder),