Calculate welfare loss

I designed an m-file to calculate the welfare loss. It can run normally, but I don’t know if this file is correct? vol means volatility, and wel means loss of welfare.run.m (1.7 KB)

Without specifying the loss-function, it is impossible to tell. Also, why the rounding?