4 ms·
Isn't it just a small number to prevent divide by zero errors?
by jacob019 3y ago
Isn't it just a small number to prevent divide by zero errors?
- danbruc 3y agoIf you want to not divide by zero, you can just check for zero. You want to use some epsilon if you want to compare floating point numbers, 0.1 + 0.2 == 0.3 for example is false and not what you wanted most of the time. To do this properly you calculate the difference (0.1 + 0.2) - 0.3 and check if the absolute value of the difference is smaller than some tolerance, your epsilon.
- lmkg 3y agoNot exactly. In math, epsilon is basically "it's not zero, except when it is." When you're dividing, then it's close to zero, but still qualitatively not zero. But when you're multiplying or adding, then we say it's close enough that we'll treat it as exactly zero. So it's not a specific number, it's something where we can handwave its qualitative size depending on what's convenient. Limits are a formalization of this concept. It's not a specific value, it's very much a variable that "approaches" zero. This establishes rules about how much bullshit you can actually do it. It's not zero, you do some arithmetic, then it becomes zero and you do the rest of the arithmetic. But when you're writing a program, epsilon is indeed often just a small number. The trick is choosing the right "small."
- Someone 3y ago> In math, epsilon is basically "it's not zero, except when it is." In the math I know, it’s not necessarily small, but it is larger than zero. https://mathworld.wolfram.com/Epsilon-DeltaDefinition.html https://mathworld.wolfram.com/Epsilon-DeltaDefinition.html: “An epsilon-delta definition is a mathematical definition in which a statement on a real function of one variable f having, for example, the form "for all neighborhoods U of y₀ there is a neighborhood V of x₀ such that, whenever x in V, then f(x) in U" is rephrased as "for all ε > 0 there is δ > 0 such that, whenever 0 < |x - x₀| < δ, then |f(x) - y₀| < ε.” (Also used in proofs. https://mathworld.wolfram.com/Epsilon-DeltaProof.html https://mathworld.wolfram.com/Epsilon-DeltaProof.html) https://en.m.wikipedia.org/wiki/Limit_of_a_function#%7F'%22%60UNIQ--postMath-00000007-QINU%60%22'%7F-definition_of_limit https://en.m.wikipedia.org/wiki/Limit_of_a_function#%7F'%22%...: “For every real ε > 0, there exists a real δ > 0 such that for all real x, 0 < |x − p| < δ implies |f(x) − L| < ε.” > it's something where we can handwave its qualitative size depending on what's convenient. Aha! You’re doing physics, not math. Mathematicians only handwave when they can prove it doesn’t affect results ;-)
- iamevn 3y agoThe paper, on the epsilon-delta: > This has nothing to do with the subject of the paper
- deleted 3y ago[deleted]
- jerf 3y agoThere is subtlety in selecting that "small number". 0.000000001 may look like a "small number", but if you're doing calculations in the 1e-20 range, suddenly it isn't small anymore. Small is relative to the task at hand. Simple uses of floats in known situations can get away with a hard-coded epsilon constant, and it may not even much matter what the number is, but as your usage becomes more sophisticated and more important, proper selection of epsilon values becomes non-trivial.
- tempodox 3y agoTo oversimplify, epsilon is “the smallest number that still makes a difference in the given context”.
- amelius 3y agoIn actual code, you will see it used with wide safety margins, though.