mathnet / mathnet-numerics

Math.NET Numerics
http://numerics.mathdotnet.com
MIT License
3.47k stars 893 forks source link

Airy Function Unit tests are failing #617

Open jbcoe opened 5 years ago

jbcoe commented 5 years ago

Running build.sh gives me:

1) Failed : MathNet.Numerics.UnitTests.SpecialFunctionsTests.AiryTests.AiryAiPrimeApprox(-1.0d,-1.0d,-0.379060479226834d,0.604500130862246d,14)
Real components are not equal within 14 places. Expected:-0.379060479226834; Actual:-0.379060479226834
   at MathNet.Numerics.UnitTests.AssertHelpers.AlmostEqualRelative(Complex expected, Complex actual, Int32 decimalPlaces) in /Users/jon/DEV/mathnet-numerics/src/Numerics.Tests/AssertHelpers.cs:line 161
   at MathNet.Numerics.UnitTests.SpecialFunctionsTests.AiryTests.AiryAiPrimeApprox(Double zr, Double zi, Double cyr, Double cyi, Int32 decimalPlaces) in /Users/jon/DEV/mathnet-numerics/src/Numerics.Tests/SpecialFunctionsTests/AiryTests.cs:line 50

2) Failed : MathNet.Numerics.UnitTests.SpecialFunctionsTests.AiryTests.AiryBiPrimeApprox(-1.0d,-1.0d,0.834473488522783d,0.346526063266829d,14)
Imaginary components are not equal within 14 places. Expected:0.346526063266829; Actual:0.346526063266828
   at MathNet.Numerics.UnitTests.AssertHelpers.AlmostEqualRelative(Complex expected, Complex actual, Int32 decimalPlaces) in /Users/jon/DEV/mathnet-numerics/src/Numerics.Tests/AssertHelpers.cs:line 168
   at MathNet.Numerics.UnitTests.SpecialFunctionsTests.AiryTests.AiryBiPrimeApprox(Double zr, Double zi, Double cyr, Double cyi, Int32 decimalPlaces) in /Users/jon/DEV/mathnet-numerics/src/Numerics.Tests/SpecialFunctionsTests/AiryTests.cs:line 90

I can reduce the numerical accuracy of the tests from 14 to 13 dp to fix the test failures but would like to understand why this is needed.

I am running tests with dotnet core

dotnet --info:

.NET Core SDK (reflecting any global.json):
 Version:   2.2.100
 Commit:    51868761f2

Runtime Environment:
 OS Name:     Mac OS X
 OS Version:  10.14
 OS Platform: Darwin
 RID:         osx.10.14-x64
 Base Path:   /usr/local/share/dotnet/sdk/2.2.100/

Host (useful for support):
  Version: 2.2.0
  Commit:  1249f08fed

.NET Core SDKs installed:
  2.1.4 [/usr/local/share/dotnet/sdk]
  2.1.105 [/usr/local/share/dotnet/sdk]
  2.1.302 [/usr/local/share/dotnet/sdk]
  2.2.100 [/usr/local/share/dotnet/sdk]

.NET Core runtimes installed:
  Microsoft.AspNetCore.All 2.1.2 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.All]
  Microsoft.AspNetCore.All 2.2.0 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.All]
  Microsoft.AspNetCore.App 2.1.2 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 2.2.0 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 2.0.5 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 2.0.7 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 2.1.2 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 2.2.0 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
bobbyingram commented 3 years ago

I am also seeing the same test failures:

dotnet --info:

.NET Core SDK (reflecting any global.json):
 Version:   3.1.404
 Commit:    470f6754b3

Runtime Environment:
 OS Name:     Mac OS X
 OS Version:  10.16
 OS Platform: Darwin
 RID:         osx.10.16-x64
 Base Path:   /usr/local/share/dotnet/sdk/3.1.404/

Host (useful for support):
  Version: 5.0.1
  Commit:  b02e13abab

.NET SDKs installed:
  3.1.404 [/usr/local/share/dotnet/sdk]
  5.0.101 [/usr/local/share/dotnet/sdk]

.NET runtimes installed:
  Microsoft.AspNetCore.App 3.1.10 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 5.0.0 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 5.0.1 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 3.1.10 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 5.0.0 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 5.0.1 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]