Approximate the Score of a 2048 Game A game of 2048 goes like this:


Every move you get another piece - either 2 90% of the time, or 4 10% of the time
for each 2 equal pieces combined you get a piece of the sum of the two and the sum gets added to your score


Your task

given a board of a 4x4 game, give the average score of what A game like that would result in.

To calculate it, go the other way around of the game. For example, if there's an 8 piece, it's made from 4s. The average score of a 4 piece is 4*90% (90% of the time it's made from combining two 2 pieces together and it the other 10% a 4 isn't made, but ) = 3.6. As to make an 8 you need two 4s, and then you need to combine them to an 8, the result is 3.6*2 + 8 = 15.2.

In pseudocode a calculation for one number could be this:

function value (x) {
  if (x &gt; 4) return value(x / 2) * 2 + x
  else if (x == 4) return 4*90%
  else return 0
}


but you're free to choose any approach as long as it works the same.

Clarifications


The input board will always be from a 4x4 board.
You can take in the board as an array of the 16 values, as 16 different inputs or even a 2D array if that somehow helps you.
The input numbers will always be zero or 2 to the power of a positive integer.
You can discard any errors due to floating point operations (but theoretically the program must implement a correct algorithm).
This is code-golf, the shortest code wins!


Test-cases

[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0] -&gt; 0
[2,4,2,4,4,2,4,2,2,4,2,4,4,2,4,2] -&gt; 28.8
[4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4] -&gt; 57.6
[0,0,0,4,0,0,0,8,0,0,0,16,2,2,0,2048] -&gt; 20340.4
[2,16,2048,4096,4,32,1024,8192,8,64,512,16384,16,128,256,32768] -&gt; 845465.2
[8,8,4,4,0,0,0,0,0,0,2,2,2048,65536] -&gt; 996799.2
Python 3, 51 48 bytes

 -3 bytes thanks to Mr. Xcoder!



lambda b:sum(n*max(0,len(bin(n))-4.1)for n in b)


Try it online!