phobos icon indicating copy to clipboard operation
phobos copied to clipboard

remove use of INLINE_YL2X from std.math

Open thewilsonator opened this issue 3 years ago • 10 comments

rebases #3310

thewilsonator avatar Oct 19 '20 05:10 thewilsonator

std/internal/math/gammafunction.d(569): [unittest] unittest failure assert(logGamma(-50.2L) == log(fabs(gamma(-50.2L)))); e: relaxed to assert(feqrel(logGamma(-50.2L),log(fabs(gamma(-50.2L)))) > real.mant_dig-2);

thewilsonator avatar Oct 19 '20 05:10 thewilsonator

Thanks for your pull request and interest in making D better, @thewilsonator! We are looking forward to reviewing it, and you should be hearing from a maintainer soon. Please verify that your PR follows this checklist:

  • My PR is fully covered with tests (you can see the coverage diff by visiting the details link of the codecov check)
  • My PR is as minimal as possible (smaller, focused PRs are easier to review than big ones)
  • I have provided a detailed rationale explaining my changes
  • New or modified functions have Ddoc comments (with Params: and Returns:)

Please see CONTRIBUTING.md for more information.


If you have addressed all reviews or aren't sure how to proceed, don't hesitate to ping us with a simple comment.

Bugzilla references

Your PR doesn't reference any Bugzilla issue.

If your PR contains non-trivial changes, please reference a Bugzilla issue or create a manual changelog.

Testing this PR locally

If you don't have a local development environment setup, you can use Digger to test this PR:

dub run digger -- build "master + phobos#7668"

dlang-bot avatar Oct 19 '20 06:10 dlang-bot

std\internal\math\gammafunction.d(1045): [unittest] unittest failure
assert(feqrel(betaIncompleteInv(5, 10, 0.2000002972865658842L), 0.229121208190918L) >= real.mant_dig - 3);

thewilsonator avatar Oct 19 '20 07:10 thewilsonator

std/internal/math/gammafunction.d(569): [unittest] unittest failure assert(logGamma(-50.2L) == log(fabs(gamma(-50.2L)))); e: relaxed to assert(feqrel(logGamma(-50.2L),log(fabs(gamma(-50.2L)))) > real.mant_dig-2);

I'll have to check, but I think that similar relaxations also exist in gdc's fork as well.

ibuclaw avatar Oct 19 '20 16:10 ibuclaw

actually could you do me a favour and upstream the relaxations

thewilsonator avatar Oct 21 '20 04:10 thewilsonator

actually could you do me a favour and upstream the relaxations

I'm looking at the first failure in dmd

assert(logGamma(-50.2L) == log(fabs(gamma(-50.2L))));

I don't see any deviation with the unittest in gdc, and yet there is no failure. On inspection, it looks like most if not all of logGamma and gamma is inlined and constfolded at compile-time in gdc. So the call to log() for gdc and dmd are receiving two different numbers (same up until the 17th decimal place). I'll have a try on aarch64, as there's sure to be failures there that don't exist on i386/x86_64.

ibuclaw avatar Oct 21 '20 14:10 ibuclaw

I'll have a try on aarch64, as there's sure to be failures there that don't exist on i386/x86_64.

gammafunction hasn't been ported to 128-bit, so that's a dead end. :-)

ibuclaw avatar Oct 21 '20 15:10 ibuclaw

@thewilsonator can you rebase this?

RazvanN7 avatar Apr 15 '21 09:04 RazvanN7

@thewilsonator can you rebase this?

Tests will fail if you remove INLINE_Y2LX, so rebasing would be a futile effort.

https://github.com/dlang/phobos/pull/7942#issuecomment-817138577

ibuclaw avatar Apr 15 '21 10:04 ibuclaw

@ibuclaw Any pointers on how we can fix this?

RazvanN7 avatar Sep 13 '21 10:09 RazvanN7