Water density in the calculation of the ionic product of water

In 2019 the International Association for the Properties of Water and Steam released this document for the semi-empirical calculation of the ionization constant of water: <http://www.iapws.org/relguide/Ionization.pdf>


My idea was to insert this formula in my spreadsheet for calculating the pH of an acid base mixture, where until now $K\_w$ I entered it manually.


On the other hand, this formula, in addition to requiring the inlet temperature (between $\pu{0°C}$ and $\pu{800°C}$), also requires the density of the water (between $0$ and $\pu{1.25 g/cm3}$).


Since the density of water in turn depends on temperature and pressure, I wondered if in the literature a sufficiently compact formulation could be found that would give me the density of the water at the input temperature and pressure.




---


Before asking here of course I searched far and wide:


* in *MapleSoft* [here](https://www.maplesoft.com/applications/view.aspx?SID=154073&view=html) they show their procedure, which in turn refers to [this](http://www.wsp.ru/en/test/wspDPT.asp) other routine which is apparently secret;
* in *WolfraAlpha* I found [this](https://www.wolframalpha.com/widgets/view.jsp?id=1de7d2b90d554be9f0db1c338e80197d) widget which in turn refers to a long line of books in which I have not found anything that can do for me;
* [this](https://www.translatorscafe.com/unit-converter/en-US/calculator/salt-water-density/) is the only page where without many turns of words they show a simple algorithm, too bad it is only valid for temperatures between 0°C and 40°C, if it had been valid at least up to 100°C it would have been enough.


This is why I was wondering if anyone was aware of some more general formulation of the latter.


