On Hilbert's 17th problem and Pfister's multiplicative formulae for the ring of real analytic functions