Skip to content

Arithogeometric mean of infinity inconsistencies #4416

Description

@d-torrance

We currently compute the agm of two numbers in three distinct ways:

This results in inconsistent output when one of the arguments is infinite:

i1 : agmTests = f -> {
    agm(f numeric infinity, f 0),
    agm(f numeric infinity, f 2),
    agm(f 0, f numeric infinity),
    agm(f 2, f numeric infinity)}

                    
o1 = agmTests

o1 : FunctionClosure

i2 : agmTests toRR

o2 = {NotANumber, infinity, NotANumber, infinity}

o2 : List

i3 : agmTests toCC

o3 = {infinity, infinity, infinity, infinity}

o3 : List

i4 : agmTests toRRi

o4 = {[NotANumber,NotANumber] (an empty interval), [NotANumber,NotANumber] (an empty interval), [NotANumber,NotANumber] (an empty interval), [NotANumber,NotANumber] (an empty interval)}

o4 : List

i5 : agmTests toCCi

o5 = {[NotANumber,NotANumber]+[NotANumber,NotANumber]*ii (an empty interval), [NotANumber,NotANumber]+[NotANumber,NotANumber]*ii (an empty interval), [NotANumber,NotANumber]+[NotANumber,NotANumber]*ii (an empty interval),
     -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
     [NotANumber,NotANumber]+[NotANumber,NotANumber]*ii (an empty interval)}

o5 : List

Maybe it makes sense for different behavior between the real and complex cases, but certainly it seems like we'd want RR and RRi to agree and to CC and CCi to agree.

I asked Claude to classify what it thinks the output should be:

Case agm(∞, 2) agm(∞, 0)
Real +∞ NaN
Complex NaN NaN

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions