Skip to content

erfInv is very inneficient #7568

@JeWaVe

Description

@JeWaVe

System Information (please complete the following information):

  • OS & Version: Any
  • ML.NET Version: latest
  • .NET Version: [e.g. .NET 5.0]any

Describe the bug
In ProbabilityFunctions.cs, there are these lines :

// This is very inefficient... fortunately we only need to compute it very infrequently.
double[] c = new double[1000];
c[0] = 1;
for (int k = 1; k < c.Length; ++k)
{
for (int m = 0; m < k; ++m)
c[k] += c[m] * c[k - 1 - m] / (m + 1) / (m + m + 1);
}

even if the class is internal, this is very inefficient (as written in the code), and could be called somewhere else

To Reproduce

  1. Open ProbabilityFunctions.cs
  2. go to line 74

Expected behavior
A precomputed table, or a once-and-for-all computed table

Metadata

Metadata

Assignees

No one assigned

    Labels

    untriagedNew issue has not been triaged

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions