Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Generally, using suitable epsilon values is the way to go if you need to use floating point numbers. Here are a few things which may help:</p> <ul> <li>If your values are in a known range you and you don't need divisions you may be able to scale the problem and use exact operations on integers. In general, the conditions don't apply.</li> <li>A variation is to use rational numbers to do exact computations. This still has restrictions on the operations available and it typically has severe performance implications: you trade performance for accuracy.</li> <li>The rounding mode can be changed. This can be use to compute an interval rather than an individual value (possibly with 3 values resulting from round up, round down, and round closest). Again, it won't work for everything but you may get an error estimate out of this.</li> <li>Keeping track of the value and a number of operations (possible multiple counters) may also be used to estimate the current size of the error.</li> <li>To possibly experiment with different numeric representations (<code>float</code>, <code>double</code>, interval, etc.) you might want to implement your simulation as templates parameterized for the numeric type.</li> <li>There are many books written on estimating and minimizing errors when using floating point arithmetic. This is the topic of numerical mathematics.</li> </ul> <p>Most cases I'm aware of experiment briefly with some of the methods mentioned above and conclude that the model is imprecise anyway and don't bother with the effort. Also, doing something else than using <code>float</code> may yield better result but is just too slow, even using <code>double</code> due to the doubled memory footprint and the smaller opportunity of using SIMD operations.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload