Skip to content

[BUG] wrong output from incomplete upper gamma function #195

@soerenhm

Description

@soerenhm

Describe the bug
The (regularized) incomplete upper gamma function 'Gamma(x, a)' gives wrong values for x > 100 and for certain other special cases.

To Reproduce
Here are some examples of wrong behavior:

open FSharp.Stats.SpecialFunctions
Gamma.upperIncomplete 1 infinity = 1. // Correct value: 0
Gamma.upperIncomplete 100 0 = 0.  // Correct value: 1.0
Gamma.upperIncomplete 100 200 = 1. // Correct value: ~0

OS and framework information (please complete the following information):

  • OS: Windows 11
  • OS Version [22000]
  • .Net core SDK version 6.0.100

Additional context
When Gamma.upperIncomplete fails to give the correct answer (e.g. when x > 100), the output, call it y, is identical to that produced by Gamma.lowerIncomplete; the correct should've been is 1 - y.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions