RandomGenerator random = new Well1024a(0x49914cdd9f0b8db5l);
final UnivariateDifferentiableFunction id = FunctionUtils.compose((UnivariateDifferentiableFunction) g,
(UnivariateDifferentiableFunction) f);
for (int i = 0; i < 10; i++) {
final double x = lo + random.nextDouble() * (hi - lo);
Assert.assertEquals(x, id.value(new DerivativeStructure(1, 1, 0, x)).getValue(), EPS);
}
Assert.assertEquals(lo, id.value(new DerivativeStructure(1, 1, 0, lo)).getValue(), EPS);
Assert.assertEquals(hi, id.value(new DerivativeStructure(1, 1, 0, hi)).getValue(), EPS);