There's no accurate algorithm possible, it's impossible because there's too many variables to ever be able to calculate it.
You can measure some variables (e.g. distance to goal, angle) but how can you accurately measure (e.g. defenders positions blocking a percentage of the goal, the speed angle and spin on a cross or pass to the striker, a defender pulling your shirt to unbalance you, you falling over like Sterling with the header off the floor, how quickly you have to shoot before a defender closes you down)?
You simply can't put an algorithm on that stuff, it's impossible, so xG is bollocks. To try and use it to justify our strikers being shit and not clinical enough is comical. It's like trying to measure someone's cock by where they buy their weekly shopping.