LM317 with potentiometer
The equation is correct &mdash; the output voltage is indeed independent of the input voltage &mdash; but the equation only applies when the rest of the operating requirements of the device are met, specified elsewhere in the datasheet. Among these are the requirement that V_in > V_out + V_dropout. If this requirement is not met, then the first equation no longer applies.