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
4 answers

Why is 1+machine epsilon + machine epsilon/2 not equal to 1+machine epsilon/2+machine epsilon?

Python: machine_epsilon = np.finfo(float).eps first_variant = 1 + machine_epsilon + machine_epsilon/2 second_variant = 1 + machine_epsilon/2 + machine_epsilon print ('%.20f' % first_variant) print ('%.20f' % second_variant) C: double eps2 =…
1
vote
1 answer

PPC64 long double's machine epsilon calculation

I'm playing around with a PPC64 virtual machine emulated in qemu, trying to mimic a POWER8 CPU. Here, the long double type is different from the 80-bit float used in x86 for long doubles, and from what I see it does not conform to IEEE754's float128…
1
vote
1 answer

How is machine epsilon related to floating point rounding error?

I have read that floating points may encounter rounding due to finite number of bits in mantissa. Also, I have read that machine epsilon represents a floating point such that 1 + epsilon is equal to next minimum representable number. a) However I am…
Test
  • 564
  • 3
  • 12
1
vote
2 answers

arccos((sin(x)^2)+cos(x)^2) is not 0 for certain angles

I am struggling with a simple calculation problem. By theory for an arbitrary angle: If is If I implement this in python or Matlab: import numpy as np alpha = -89.999961 alpha_rad = np.deg2rad(alpha) result = np.arccos(np.sin(alpha_rad)**2 +…
No Body
  • 154
  • 1
  • 1
  • 6
1
vote
1 answer

Floating-point arithmetic - bits of the exponent

I have a general question about floating-point arithmetic. Recently, I got quite interested in understanding of the computing in programmes, thus I started to solve exercises. I would like you to explain the one which especially confuses…
fgh
  • 169
  • 1
  • 3
  • 15
1
vote
1 answer

Is multiarm bandit a choice when there is very low reward

Is any version of multiarm bandit (EpsilonGreedy, Thompson Sampling, UCB) any good when there is very low reward/click rate for the high pull rate. I have 600 piece of content with approximately 3000 clicks (total across all content) per day for a…
1
vote
1 answer

Floating point resolution at a given number

I would like to know the epsilon of a floating point number around a given value. std::numeric_limits::epsilon() provides that only for the number 1.0, while I would like a function to work on any number. Is there any standard…
Tim Kuipers
  • 1,705
  • 2
  • 16
  • 26
1
vote
1 answer

The Hilbert epsilon operator

Why you can use the Hilbert epsilon operator in a method and in a function, but not in a "function method"? method choose(s:set) returns (x:T) requires s != {} { var z :| z in s; return z; } function choose'(s:set):T //…
jiplucap
  • 155
  • 7
1
vote
2 answers

Are floating-point numbers used without an epsilon always a code-smell?

This question is very simple. It is related to but definitely not a dupe of: Most unpatched Tomcat webservers are vulnerable, who's at fault? Seen the amazing amount of things that can go wrong with floating-point numbers (including, but not…
SyntaxT3rr0r
  • 27,745
  • 21
  • 87
  • 120
1
vote
1 answer

Float type variable uncertainty

I developed an image processing software and I need to do a numerical analysis of it, considering the error propagation associated to its operations and the uncertainty of float type variables caused by the inherent rounding up that happens with…
Pedro Pereira
  • 312
  • 5
  • 21
1
vote
3 answers

Float data type uncertainty

I am doing a numerical analysis of a math software I developed. I want to identify what is the uncertainty of my result. Being f() my method and x an input value, I want to identify y of my result as f(x) +/- y. My f() method has multiple operations…
Pedro Pereira
  • 312
  • 5
  • 21
1
vote
2 answers

How would you high precision compare floats & doubles sent into QML functions from Cpp side?

How would you compare floats & doubles sent into QML functions from Cpp side ? If I want to do a high precision comparasion like below as mentioned here bool AreSame(double a, double b) { return fabs(a - b) < EPSILON; } How should I do this in Qt…
TheWaterProgrammer
  • 7,055
  • 12
  • 70
  • 159
1
vote
3 answers

How to compare multiple lists for numerical closeness two at a time?

Say I have 4 lists: A = [1.1, 1.4, 2.1, 2.4] B = [1.3, 6.5, -1.0, 2.3] C = [0.5, -1.0, -1.1, 2.0] D = [1.5, 6.3, 2.2, 3.0] How do I 1)compare the lists eg A,B B,C C,D A,C so on and 2)return true if the elements are +/-0.2 ? Example output: (Or…
1
vote
2 answers

OCL-based model transformation languages

Which of the model transformation languages are ocl-based? Is Epsilon Transformation Language (ETL) ocl-based?
any
  • 325
  • 5
  • 17
1
vote
1 answer

ELKI DBSCAN LngLatDistanceFunction producing one cluster

I'm using Elki LngLatDistanceFunction to cluster Lon/lat points but it's only returning one cluster (was returning more clusters when I used Euclid distance). I tried multiple Epsilon values but I'm still getting one cluster. int minPts=20; …
MTA
  • 739
  • 2
  • 9
  • 29