Sadness along every other feeling is indeed a computation, its just that people don't like to face such bleak reality, same way we can easily understand why a machine can be turned off and never to be turned on again and yet most of us have issues understanding when the same thing happen to our brains, so we rather invent a lot of mythology around such event (death). Simplified example: If I perceive my father died (input) I get sad (output). Is a system of stimulus/rewards/pushinement that has worked pretty well for the evolution of our species, is extremely complex but that doesn't make it not one.
And we know that the animals behave "sad" when somebody close to them dies or just goes away.
Emotions aren't anything special to humans. Other behaviors too. The "being special" is what humans just want to believe. Most of those promoting "consciousness" as "something special, that can't be explained by physical interactions of electrons, atoms and molecules or above that by biological interactions of cells etc, are simply in some way still hanging on their religious beliefs and projecting them there. The rest just have a new book or whatever else to sell.