-
Notifications
You must be signed in to change notification settings - Fork 57
Description
I've given a go to building ocean v5.0.x tests with ldmd2 instead of dmd (v5.0.x because it includes the getIeeeFlags fix that was a blocker to using compilers other than DMD). The command used was:
DC=ldmd2 make V=1 test ALLOW_DEPRECATIONS=1
... with LDC 1.16.0 being used to test (matching DMD 2.086.1).
My suspicion (not yet confirmed) is that all of these reflect LDC using different core math routines to DMD (e.g. implementation of cos, sin, sqrt, etc.). I suspect that similar results might be obtained for GDC, for similar reasons.
No worries if this is a WONTFIX (or at least very low priority) from the maintainers' side, but since I went through this all systematically today I thought I'd share the results.
The following unittests all fail when LDC is used:
ocean.math.Elliptic:
ocean/src/ocean/math/Elliptic.d
Line 349 in 63ef0e8
| test(ellipticEComplete(1-x) == ellipticE(PI_2, x) ); |
ocean.math.Probability:
ocean/src/ocean/math/Probability.d
Lines 261 to 271 in 63ef0e8
| test(isfeqabs(studentsTDistributionInv(10, 0.995), 3.169_272_67L, 0.000_000_005L)); | |
| test(isfeqabs(studentsTDistributionInv(8, 0.6), 0.261_921_096_769_043L,0.000_000_000_05L)); | |
| // -TINV(2*0.4, 18) == -0.257123042655869 | |
| test(isfeqabs(studentsTDistributionInv(18, 0.4), -0.257_123_042_655_869L, 0.000_000_000_05L)); | |
| test( feqrel(studentsTDistribution(18, studentsTDistributionInv(18, 0.4L)),0.4L) | |
| > real.mant_dig-5 ); | |
| test( feqrel(studentsTDistribution(11, studentsTDistributionInv(11, 0.9L)),0.9L) | |
| > real.mant_dig-2); |
ocean/src/ocean/math/Probability.d
Line 368 in 63ef0e8
| test(fabs((1-fDistribution(12, 23, 0.1)) - 0.99990562845505L)< 0.0000000000005L); |
ocean.math.Math:
Line 422 in 63ef0e8
| if (!isIdentical(r, t)) test(fabs(r-t) <= .0000001); |
Lines 428 to 429 in 63ef0e8
| if (!isIdentical(r, t) && !(isNaN(r) && isNaN(t))) | |
| test(fabs(r-t) <= .0000001); |
Line 435 in 63ef0e8
| test(isIdentical( tan(NaN(0x0123L)), NaN(0x0123L) )); |
Line 490 in 63ef0e8
| test(sin(2.0+0.0i) == sin(2.0L) ); |
Lines 513 to 514 in 63ef0e8
| test(cos(1.3L+0.0i)==cos(1.3L)); | |
| test(cos(5.2Li)== cosh(5.2L)); |
Line 632 in 63ef0e8
| test(asin(sin(0+0i)) == 0 + 0i); |
Line 740 in 63ef0e8
| test(sinh(4.2L + 0i)==sinh(4.2L)); |
Line 762 in 63ef0e8
| test(cosh(8.3L + 0i)==cosh(8.3L)); |
Line 976 in 63ef0e8
| test(cfeqrel(sqrt(4+16i)*sqrt(4+16i), 4+16i)>=real.mant_dig-2); |
Line 1504 in 63ef0e8
| test(exp(1.3e5Li)==cos(1.3e5L)+sin(1.3e5L)*1i); |
Line 1506 in 63ef0e8
| test(exp(7.2 + 0.0i) == exp(7.2L)); |