function T_s = region4_Tcalc(p)
% Description:      Calculates the saturation temperature at a given
%                   pressure based upon the IAPWS IF-97 Release for 
%                   Region 4                
% -------------------------------------------------------------------------
% Syntax:           T_s = region4_Tcalc(p)
%                   p           Pressure [MPa]
% -------------------------------------------------------------------------
% Output:           T_s         Saturation temperature at p [K] 

n = region4_sat;

beta = p^(1/4);

E = beta^2 + n(3) * beta + n(6);
F = n(1) * beta^2 + n(4) * beta + n(7);
G = n(2) * beta^2 + n(5) * beta + n(8);
D = 2 * G / (-F - (F^2 - 4 * E *G)^(1/2));

T_s = (n(10) + D-((n(10) + D)^2 - 4*(n(9) + n(10) * D))^(1/2)) / 2;