voidtype: As before the subprogram has no explicit return type.
doubleto receive the output from the subprogram. But there are no ampersands in the calling statement. Instead we see ampersands in the argument list of the function
double &dfdxr. This is how we declare that
dfdxrare ``references to a double''. A reference can be thought of as an alias, i.e. another name for the same thing. In this sense the arguments supplied in the calling statement still match the declared arguments in the subprogram definition, as required. No "pointer dereferencing" is required, because
dfdxrare just aliases for
dfdxin the main program. So the computed values of the function and derivative are assigned directly to
dfdxin the main program, where they are subsequently used to update
f_and_f(x,2*f,dfdx + 1.);. This is not permitted for nonconstant reference arguments and certainly doesn't make sense if the second and third arguments are ``output'' values.