If an RHS calls a function f that has no nondifferentiabilities, then f does not need to be preprocessed.
However, if f in turn calls a function g that does contain nondifferentiabilities, then f will need (some, minor) preprocessing: The preprocessed g has a new name, so the calls to g inside f need to be updated and equipped with an updateFunctionIndex call.
This mechanism already works (see preprocess_fcnInRhs.m) - but only for one level of function chaining.
Meaning if, instead of f calling g, f calls another function h which calls g and which contains no nondifferentiabilities, then IFDIFF will fail to recognize that f should be included in the preprocessing, and calls to f in the RHS will be left unchanged, leading to disastrous results.
To do: Change the mechanism for handling these transitively-called nondifferentiabilities so that it can handle arbitrarily long chains of function calls.
If an RHS calls a function
fthat has no nondifferentiabilities, thenfdoes not need to be preprocessed.However, if
fin turn calls a functiongthat does contain nondifferentiabilities, thenfwill need (some, minor) preprocessing: The preprocessedghas a new name, so the calls toginsidefneed to be updated and equipped with anupdateFunctionIndexcall.This mechanism already works (see
preprocess_fcnInRhs.m) - but only for one level of function chaining.Meaning if, instead of
fcallingg,fcalls another functionhwhich callsgand which contains no nondifferentiabilities, then IFDIFF will fail to recognize thatfshould be included in the preprocessing, and calls tofin the RHS will be left unchanged, leading to disastrous results.To do: Change the mechanism for handling these transitively-called nondifferentiabilities so that it can handle arbitrarily long chains of function calls.