### 9.2 Algorithms to recover primitive quantities

The expressions relating the primitive variables to the conserved quantities
depend explicitly on the equation of state , and simple expressions are only obtained for simple
equations of state (i.e., ideal gas).
A function of pressure, whose zero represents the pressure in the physical state, can easily be obtained
from Equations (8, 9, 10, 12, 13):

with and given by
and
where
and
The root of Equation (73) can be obtained by means of a nonlinear root-finder (e.g., a one-dimensional
Newton–Raphson iteration). For an ideal gas with a constant adiabatic exponent such a procedure has
proven to be very successful in a large number of tests and applications [179, 181, 183]. The derivative of
with respect to , , can be approximated by [6]
where is the sound speed which can efficiently be computed for any EOS. Moreover, approximation (78)
tends to the exact derivative as the solution is approached.
Eulderink [83, 84] has also developed several procedures to calculate the primitive variables for an ideal
EOS with a constant adiabatic index. One procedure is based on finding the physically admissible root of a
fourth-order polynomial of a function of the specific enthalpy. This quartic equation can be solved
analytically by the exact algebraic quartic root formula, although this computation is rather expensive. The
root of the quartic can be found much more efficiently using a one-dimensional Newton–Raphson iteration.
Another procedure is based on the use of a six-dimensional Newton–Kantorovich method to solve the entire
nonlinear set of equations.

Also for ideal gases with constant , Schneider et al. [257] transform system (8, 9, 10, 12, 13)
algebraically into a fourth-order polynomial in the modulus of the flow speed, which can be solved
analytically or by means of iterative procedures.

For a general EOS, Dean et al. [70] and Dolezal and Wong [74] proposed the use of iterative algorithms
for and , respectively.

In the covariant formulation of the GRHD equations presented by Papadopoulos and Font [221], which
also holds in the Minkowski limit, there exists a closed form relationship between conserved and primitive
variables in the particular case of a null foliation and an ideal EOS. However, in the spacelike case their
formulation also requires some type of root-finding procedure.