x86: intervals lose containment when linking with -ffast-math

Open
#74 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
48/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
cpp
Domain
performance

Research direction

Start with the Godbolt example linked in the issue and compare the intervals with and without linking using -ffast-math. The issue shows that the upper bounds become 0 and 1, below the true values, so the fix is complete when those intervals contain the true values under that link setting. The payload does not name repository files or tests.

Written by the indexing model from the issue text.

Description

godbolt

DBL_MIN/4   in [0x0.4p-1022, 0x0.4p-1022]
1+DBL_MIN/4 in [0x1p+0, 0x1.0000000000001p+0]

with -ffast-math on
DBL_MIN/4   in [0x0p+0, 0x0p+0]
1+DBL_MIN/4 in [0x1p+0, 0x1p+0]

The true values are 2^-1024 (0x0.4p-1022, about 5.6e-309) and 1 + 2^-1024. With the fast-math link, the upper bounds 0 and 1 are below them, so neither interval contains the true value.

Dominant language
C++
Stars
30
Forks
49
Avg merge
2d 15h
Merged PRs (30d)
7

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from boostorg/interval

All issues in boostorg/interval

Similar issues

More C++ issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.