Could not calculate negative Xirr, as below values
new Xirr(new Transaction(-10000d, "2022-01-24"), new Transaction(9800d, "2022-01-28")).xirr();
gives below error
Exception in thread "main" org.decampo.xirr.OverflowException: Candidate overflow: {guess=-1.825, iteration=159, candidate=-Infinity, value=-2.3355275185815405E7, derivative=-1.0631116397667295E-302}
at org.decampo.xirr.NewtonRaphson$Calculation.setCandidate(NewtonRaphson.java:166)
at org.decampo.xirr.NewtonRaphson$Calculation.solve(NewtonRaphson.java:213)
at org.decampo.xirr.NewtonRaphson.inverse(NewtonRaphson.java:89)
at org.decampo.xirr.NewtonRaphson.findRoot(NewtonRaphson.java:70)
at org.decampo.xirr.NewtonRaphson$Builder.findRoot(NewtonRaphson.java:136)
at org.decampo.xirr.Xirr.xirr(Xirr.java:155)
Could not calculate negative Xirr, as below values
new Xirr(new Transaction(-10000d, "2022-01-24"), new Transaction(9800d, "2022-01-28")).xirr();
gives below error