Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6571631
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T14:54:26+00:00 2026-05-25T14:54:26+00:00

The Intel C++ compiler provides two options for controlling floating point: -fp-speculation (fast/safe/strict/off) -fp-model

  • 0

The Intel C++ compiler provides two options for controlling floating point:

-fp-speculation (fast/safe/strict/off)
-fp-model (precise/fast/strict and source/double/extended)

I think I understand what fp-model does. But what is fp-speculation and how does it relate to fp-model? I have yet to find any intel doc which explains this!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T14:54:27+00:00Added an answer on May 25, 2026 at 2:54 pm

    -fp-model influences how floating-point computations are carried out, and can change the numeric result (by licensing unsafe optimizations or by changing the precision at which intermediate results are evaluated).

    -fp-speculation does not change the numerical results, but can effect what floating-point flags are raised by an operation (or what traps are taken if floating-point traps are enabled). 99.99% of programmers don’t need care about these things, so you can probably run with the default and not worry about it.

    Here’s a concrete example; suppose you have the following function:

    double foo(double x) {
        // lots of computation
        if (x >= 0) return sqrt(x);
        else return x;
    }
    

    sqrt is, relatively speaking, slow. It would be nice to hoist the computation of sqrt(x) like this:

    double foo(double x) {
        const double sqrtx = sqrt(x);
        // lots of computation
        if (x >= 0) return sqrtx;
        else return x;
    }
    

    By doing this, we allow the computation of sqrt to proceed simultaneously with other computations, reducing the latency of our function. However, there’s a problem; if x is negative, then sqrt(x) raises the invalid flag. In the original program, this could never happen, because sqrt(x) was only computed if x was non-negative. In the modified program, sqrt(x) is computed unconditionally. Thus, if x is negative, the modified program raises the invalid flag, whereas the original program did not.

    The -fp-speculation flag gives you a way to tell the compiler whether or not you care about these cases, so it knows whether or not it is licensed to make such transformations.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Does gcc have memory alignment pragma, akin #pragma vector aligned in Intel compiler? I
I need to profile an application compiled with intel's compiler via VC++. I'm using
I'm using MS VC 2008 and for some projects Intel C++ compiler 11.0. Is
I was checking out Intel's whatif site and their Transactional Memory compiler (each thread
I am using Intel's FORTRAN compiler to compile a numerical library. The test case
I'm building the boost libraries with bjam for both the intel compiler and vs2008,
I want to disable remark LOOP WAS VECTORIZED written by Intel compiler. But I
I am using a development environment with VS 2003 as IDE and Intel compiler
Is anyone here using the Intel C++ compiler instead of Microsoft's Visual c++ compiler?
Actually I've a problem with compiling some library with intel compiler. This same library

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.