*/
public DerivativeStructure value(final DerivativeStructure t)
throws NumberIsTooLargeException {
switch (t.getOrder()) {
case 0 :
return new DerivativeStructure(t.getFreeParameters(), 0, f.value(t.getValue()));
case 1 : {
final int parameters = t.getFreeParameters();
final double[] derivatives = new double[parameters + 1];
derivatives[0] = f.value(t.getValue());
final double fPrime = f.derivative().value(t.getValue());
int[] orders = new int[parameters];
for (int i = 0; i < parameters; ++i) {
orders[i] = 1;
derivatives[i + 1] = fPrime * t.getPartialDerivative(orders);
orders[i] = 0;
}
return new DerivativeStructure(parameters, 1, derivatives);
}
default :
throw new NumberIsTooLargeException(t.getOrder(), 1, true);
}
}