- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The compiler documentation says /Qprec-div improves precision of floating-point divides.
Does that mean that if /Qprec-div is not used that the floating-point divides are not as precise as they can be?
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Did you read the full text of the documentation? It says:
Description
This option improves precision of floating-point divides. It has a slight impact on speed.
With some optimizations, such as -xN and -xB (Linux) or /QxN and /QxB (Windows), the compiler may change floating-point division computations into multiplication by the reciprocal of the denominator. For example, A/B is computed as A * (1/B) to improve the speed of the computation.
However, sometimes the value produced by this transformation is not as accurate as full IEEE division. When it is important to have fully precise IEEE division, use this option to disable the floating-point division-to-multiplication optimization. The result is more accurate, with some loss of performance.
If you specify -no-prec-div (Linux and Mac OS) or /Qprec-div- (Windows), it enables optimizations that give slightly less precise results than full IEEE division.
The default is that /Qprec-div is "on", so that the optimization is not done. You can get better performance by specifying /Qprec-div- to allow the additional optimization which may change low-order results. Most applications would not notice.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
/Qno-prec-div permits the compiler to perform optimizations such as replacing division by reciprocal multiplication, when there is an invariant divisor. Single precision vectorizable division might be performed bya Newton approximation scheme. The results will not be identical to IEEE standard, and extreme cases run into problems with overflow. Where sqrt is involved, there are similar tricks controlled by /Qprec-sqrt.
-fp-model: precise (also strict and the like) incorporate prec-div and prec-sqrt.

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page