Questions tagged [epsilon]

The machine epsilon gives an upper bound on the relative error due to rounding in floating point arithmetic. The quantity is also called "macheps" or "unit roundoff".

The IEEE standard does not define the terms machine epsilon and unit roundoff, so differing definitions of these terms are in use, which can cause some confusion.

The following different definition is much more widespread outside academia: Machine epsilon is defined as the smallest number that, when added to one, yields a result different from one.

158 questions
1
vote
1 answer

precision of comparing double values with EPSILON in C

Doing function that takes 2 arrays (column1 and column2) from struct CSV D and plots the graph from it. Idea is to find max, min values of each array, then break range between min−EPSILON and max+EPSILON in to 600 equal regions, where EPSILON =…
2Napasa
  • 378
  • 1
  • 5
  • 17
1
vote
1 answer

difference in printing zero in cout and printf

with printf("%lf\n",-1.0+0.9+0.1); result is 0.000000 while with cout<<-1.0+0.9+0.1; result is 2.77556e-17 again, if i change cout<<0.9+0.1+-1.0; result is 0 why this different behavior simply inverting the sum?and why 2.77556e-17?is it…
volperossa
  • 1,339
  • 20
  • 33
1
vote
2 answers

Scala Double epsilon calculation in a functional style

A suggested approach to calculate machine epsilon using Java is as follows, private static float calculateMachineEpsilonFloat() { float machEps = 1.0f; do machEps /= 2.0f; while ((float) (1.0 + (machEps / 2.0)) != 1.0); …
elm
  • 20,117
  • 14
  • 67
  • 113
1
vote
2 answers

Java: Adding Double.MIN_NORMAL to a double doesn't change the number

I thought that MIN_NORMAL was a value that you could add to a "normal" double and the number will change. E.g. add Double.MIN_NORMAL to 0.1d and you get a value different from 0.1d, however my understanding is wrong: public static void test(double…
Dmitry Avtonomov
  • 8,747
  • 4
  • 32
  • 45
1
vote
0 answers

Removing nullable productions

I am working through creating a lexical analyzer for a subset of pascal, which is a programming project recommended in the back of the compiler red dragon textbook. I am working through changing the grammar into LL so that I can create the parse…
user1814946
  • 181
  • 2
  • 11
1
vote
3 answers

Machine epsilon estimation in C

I'm new to C and I'm trying to find machine epsilon (1.0 + macheps > 1.0), eta (eta > 0.0) and MAX (MAX < infinity), but my code doesn't work as intended. First of all, macheps is calculated using 80-bit precision. How do I force it to single,…
1
vote
1 answer

Boundary value analysis in C++ with CppUnit

I'm trying to implement boundary tests in CppUnit. I want to check the limit value itself as well as the boundaries around this limit. For the upper boundary I wanted to add the smallest inkrement possible. For double this increment can be accessed…
tobiger
  • 103
  • 1
  • 12
1
vote
4 answers

How to determine one variable by the relative values of another?

I'm implementing a PID-control algorithm to a robot I'm currently building using Arduino. My question is more related to the logics of programming. I have to calculate a variable, an error, int eps. This eps will be between -7 and +7. From the robot…
Eugen
  • 1,537
  • 7
  • 29
  • 57
0
votes
2 answers

Java Test Number for its precision

I have to write a method, that calculates the ArcTan without using Math.atan() My algorythm is working, but it isn't stoping. public final static double EPSILON = 1E-16; // Given Value 0,00000000000000010000 public static void main(String[] args) {…
Reini
  • 1,233
  • 3
  • 19
  • 34
0
votes
1 answer

Merge Project models through EML using complex comparison rules

Problem: I'm using EML and Epsilon Language Workbench to merge two project models, represented by two metamodels (MM1 and MM2), into a third metamodel (target). While I can achieve a simple merge based on element names, I need a more complex rule to…
James
  • 1,653
  • 2
  • 31
  • 60
0
votes
0 answers

Is there an in-built support to add epsilon as an input parameter for double comparsions with mvel dialect?

I am using mvel dialect for defining rules for drools rule engine. It may comprise of arithmetic expressions like in the when part as shown below rule "Test rule" dialect "mvel" when context : ActionContext( context.get("test") == 0.8…
0
votes
2 answers

Are there any best practices or considerations for setting "epsilon" values ​to avoid zero-division errors?

I'm thinking to add a value close to 0, the so-called "epsilon", to the denominator to prevent zero division error, such as: double EPS = DBL_MIN; double no_zerodivision_error = 0.0 / (0.0 + EPS); When setting this epsilon value, are there any…
starriet
  • 2,565
  • 22
  • 23
0
votes
0 answers

AMPL epsilon constraint programming

I cannot figure out why this problem is unbounded? Do I Need to add another constraint for one of the decision variables? I don't know which one isn't constrained right. Is it the bank variable being unbounded? That is my most likely guess. Any…
D. React
  • 21
  • 3
0
votes
0 answers

how to code epsilon constraint model in Xpress

I want to used the ε-constrained method to solve a problem a posteriori and plot the set of Pareto optimal solutions and the Pareto front. I think I've managed to do this as my results look similar to what I achieved with the weighted sum method,…
marsh
  • 1
0
votes
0 answers

Error for my DBscan clustering, seek for a resolution

So I have been trying to apply the DBSCAN method to cluster my dataset, I want to get the silhouette_Score to compare with my other model, however, after I do the DBSCAN, it return the error: ValueError: Number of labels is 1. Valid values are 2 to…