Have error code P1584. What is repair and what is the est. cost? on 2002 Jaguar S-Type

engine light on all the time.
Goes in and out of "safe mode", unpredictable as to when, hot or cold. Does not stay in this mode for long.

Asked by for the 2002 Jaguar S-Type