Hello Alex.

Thanks a lot for your always-detailed investigations... :-)

Le lun. 6 avr. 2020 à 13:09, Alex Herbert <[email protected]> a écrit :
>
> The ContinuedFraction class required that an implementation provide a
> and b coefficients of the form:
>
>   *              b1
>   * a0 + ------------------
>   *      a1 +      b2
>   *           -------------
>   *           a2 +    b3
>   *                --------
>   *                a3 + ...
>
> I added this form to the class javadoc to clarify usage. This form is
> the opposite of the form used by the linked resource on Wolfram [1] and
> the original paper that is the source of the method.
>
> It is the same order as defined for the formula on Wikipedia [2].
>
> The choice of a and b is point of contention described on wolfram [3]
> when discussing a simple continued fraction where all a are 1:
>
> "In contexts where only simple continued fractions are considered, the
> partial denominators are often denoted [a0, a1, a2, ...] instead of [b0;
> b1, b2, ...] (e.g., Rockett and Szüsz 1992, p. 3), a practice which
> unfortunately conflicts with the common notation for generalized
> continued fractions in which a_n denotes a partial numerator."
>
> This file has been ported from Commons Math where the implementation is
> the same. If we re-arrange the definition of a and b to match the link
> from wolfram, the original paper and wolfram's stated common notation
> for a continued fraction then a user upgrading from Commons Math will
> have to transpose all their function logic.
>
> The simpler action is to drop the link to Wolfram and use the Wikipedia
> link, or be very specific in the javadoc about the form expected. A note
> can be added to the code to indicate that the definition of a and b have
> been reversed from the original paper.
>
> 1. Maintain functional compatibility with Commons Math
> 2. Change for notation compatibility with the original paper
>
> Opinions on which action?

I'm torn, since a lot of the Javadoc points to Wikipedia.
However, if some sources explicitly discuss the drawback of our
current convention, I'd be much tempted to fix it (the more so if
the primary reference also uses the other one).
I wouldn't worry about previous CM usage.  [Numbers] is another
library and there isn't any promise whatsoever about compatibility.
Users who adapt their codes would certainly do so with minimal
care.  IIRC, similar fixes were done for the name and/or order of
the arguments for some of the distribution classes in [Statistics].

Gilles

>
> Alex
>
> [1] https://mathworld.wolfram.com/ContinuedFraction.html
>
> [2] https://en.wikipedia.org/wiki/Continued_fraction#Basic_formula
>
> [3] https://mathworld.wolfram.com/SimpleContinuedFraction.html

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to