How to emulate MixRGB (Mix) with math node for Grayscale?
This 'Mix Value' node group will emulate the simple Mix of two values:


The inputs are all clamped 0-1
The result is [(1-Fac) * Value 1] + [Fac * Value 2]

You can use this framework to test it:

The outputs of the Mix RGB node and of the combined lower branches, mixing the channels independently, are indistinguishable.
If you want to test the other mix modes, this reference could be handy.You would replace the 'Add' in the node group with the functions described. here's a link to the Blender code, thanks to this answer by @Meng Hui Tan.
Have fun!