mathnet-symbolics icon indicating copy to clipboard operation
mathnet-symbolics copied to clipboard

Missing pattern matching for ComplexInf operations in Evaluate.fs

Open diluculo opened this issue 6 months ago • 0 comments

I found missing matching patterns in several arithmetic functions in Evaluate.fs where operations with complex infinity aren't handled correctly, resulting in "not supported" errors instead of returning mathematically correct results.

The issue occurs when adding finite values to complex infinity (-1 + ComplexInf) or multiplying non-zero values with complex infinity. These operations should generally return ComplexInf but currently fail with errors.

I think the following may fix the missing patterns:


// in fadd function:
| ComplexInf, _ | _, ComplexInf -> ComplexInf 

// In fmultiply function:
| ComplexInf, Real 0.0 | Real 0.0, ComplexInf -> Undef  // 0 × ⧝ = undefined
| ComplexInf, _ | _, ComplexInf -> ComplexInf

diluculo avatar May 03 '25 03:05 diluculo