This article talks about using “mini max regret” in climate planning. Basically this sounds like a form of cost-benefit analysis incorporating uncertainty of key inputs including the discount rate. They conclude that 2% is a reasonable intergenerational discount rate.
Note that discounting is one way of handling that issue of the needs of the present population vs. all the teeming trillions who might exist in the future. It doesn’t quite work for existential risks though, because if no humans are around there are by definition no costs or benefits until the cockroaches develop economics.