Internal Rate of Return Javascript
The IRR can be calculated using the Yield Library
let yd = await import('/lib/finance/yield/v1.0.0/yield.mjs');
let cashFlows = [{ time:0,value:100 }, { time:0.1,value:10 },{ time:0.5,value:5 },{ time:0.9,value:10 },{ time:1,value: -120 },];
let rate = yd.irr(cashFlows);