Alpha on alpha calculation

BlitzMax Forums/BlitzMax Programming/Alpha on alpha calculation

I THINK I GOT IT! (I'm sure by now nobody cares anymore...?!)
And it's in one formula that may still be optimized:

S = source
Sa = source alpha
D = destination
Da = destination alpha

((D+(S-D)*Sa)*Da+S*(Sa*(1.0-Da))/(Da+Sa*(1.0-Da))

There you go... just in case you've been through the same pains...

Let me know if you find this to be wrong