Scan multi-output function with state variable a subset of outputs

It depends on the nature of the variables d,e. If they are static parameters that remain the same at every iteration, you can use non_sequences. If they are vectors of pre-computed parameters, you should use sequences.