Le 27/01/2012 20:44, Sébastien Brisard a écrit : > Hi Luc, > thanks for this answer. >>> >>> My problem is that I do not know what getSolverAbsoluteAccuracy() >>> should return. I see three options >>> 1. Have getSolverAbsoluteAccuracy() throw an >>> UnsupportedOperationException, as the solver is *never* invoked. >>> 2. Return a default value, and specify in the Javadoc that it is >>> meaningless or not really meaningful ;). >>> 3. Return an estimate of the absolute accuracy of the explicit above >>> expressions, namely a + FastMath.sqrt(p * (b - a) * (c - a)) and b - >>> FastMath.sqrt((1 - p) * (b - a) * (b - c)). >>> >>> My preferred option is 1. I dislike option 2, because users might >>> actually be using the returned value, believing it to somehow reflect >>> the accuracy of the value returned by >>> inverseCumulativeProbability(double). Option 3 would be a good >>> compromise, but I certainly do not have the level of expertise to come >>> up with this estimate... Any help would be most welcome! >> >> I don't like UnsupportedOperationException. >> > Fine. >> In this case, I would say >> the explicit formula is some kind of "perfect" solver > I agree >> >> which has a >> theoretical accuracy of zero (or 1 ulp). So I would return this value. >> > Yes, but one ulp of which number? What I have implemented so far is > return Math.ulp(c) (the intermediate value). I sould probably return > Math.max(Math.ulp(a), Math.ulp(b)), what do you think?
Both are fine. Luc > Sébastien > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org > For additional commands, e-mail: dev-h...@commons.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org For additional commands, e-mail: dev-h...@commons.apache.org