Skip to content

std.internal.math.gammafunction: loosen some tests for 64-bit reals.#3283

Merged
WalterBright merged 1 commit intodlang:masterfrom
kinke:gammafunction
May 22, 2015
Merged

std.internal.math.gammafunction: loosen some tests for 64-bit reals.#3283
WalterBright merged 1 commit intodlang:masterfrom
kinke:gammafunction

Conversation

@kinke
Copy link
Contributor

@kinke kinke commented May 14, 2015

As supplement for JohanEngelen@2ac2581 (1st commit of #3045; that commit alone doesn't depend on the other PR).

@WalterBright
Copy link
Member

Why? I like to have them tight, because they let me know when the algorithm changes in a way that makes the result less accurate.

@kinke
Copy link
Contributor Author

kinke commented May 17, 2015

Simple - these tests assume 80-bit reals, and it's time to support other targets too, don't you think? We're talking about 3 relaxed assertions and 9 coverage tests now only enabled for x87 reals...

@WalterBright
Copy link
Member

Use version blocks for tests for targets that have reduced precision. The tests for all platforms should not be the worst precision on any platform. Using max precision for each target is necessary so we know when that precision decays.

@kinke
Copy link
Contributor Author

kinke commented May 17, 2015

Summary:

  • line 526: previous input results in overflow for 64-bit real => extended by a dedicated assert for 64-bit real
  • line 902: allow 14 instead of only 13 least-significant mantissa bits to diverge so that no additional modification is required for 64-bit reals
  • disable existing extended coverage tests for non-80-bit reals as, iirc, most of those yield NaN with 64-bit reals and the coverage has most likely been measured for the x87 inline asm code only
  • line 1421: relax the upper limit for the absolute difference; the new limit is used in all other asserts of that test

Using version blocks results in way clumsier code, we have enough of those PPC, PPC64, ARM, ARM64, MIPS, MIPS64 etc. stuff already in there (in LDC), so I'll stick with the static if to check the precision of the real type.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Again, please do not reduce the precision of 80 bit tests. Add a separate test for 64 bit reals.

@kinke
Copy link
Contributor Author

kinke commented May 21, 2015

Done.

@WalterBright
Copy link
Member

thanks!

@WalterBright
Copy link
Member

Auto-merge toggled on

WalterBright added a commit that referenced this pull request May 22, 2015
std.internal.math.gammafunction: loosen some tests for 64-bit reals.
@WalterBright WalterBright merged commit ae9706a into dlang:master May 22, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants