The impedance is 50 ohms for all four channels (connected to an opamp output through resistor).
You sure of that it sounds very low for something coming out of an op amp.
With regard to defining the variable based on a function... forgive me, but I don't understand why that would be an issue. Doesn't the compiler take care of that?
It is not your issue but I thought as you were worried about timing it might be relevant. A compiler can only do so much optimization and there is way too much there for the compiler to make any sensible guess as to how to cut the processing down.
I would initially suspect some sort of latch up in the internal multiplexers, have you checked your grounds and have you made sure that the voltage your op amps deliver are not greater than the 3V3 supply voltage of the chip or less than zero volts.