Naive sign function for real numbers - challenge

Click For Summary

Discussion Overview

The discussion revolves around finding a naive sign function for real numbers without using decisional blocks, piecewise functions, or certain mathematical functions like floor or ceil. Participants explore various approaches and challenges related to this problem, including the implications of restrictions on function definitions and implementations.

Discussion Character

  • Debate/contested
  • Mathematical reasoning
  • Technical explanation

Main Points Raised

  • Some participants propose using the function \operatorname{sgn} x = x/|x| as a potential solution.
  • Others suggest approximating the sign function with smooth functions that yield results within machine precision, considering round-off errors.
  • A participant argues that algorithms like |x| = x if x positive; else -x are fundamentally similar to ordinary functions and do not differ qualitatively.
  • Another participant presents the limit-based function f(x) = lim_{n \to \infty} \frac{2}{\pi} \arctan(xn) as a possible solution.
  • Some participants discuss the implications of using truncation and the Heaviside step function, debating their simplicity and elegance compared to other methods.
  • Concerns are raised about dividing by zero and suggestions are made to add machine epsilon to avoid this issue.
  • Several participants express differing views on the efficiency and appropriateness of various proposed methods, including the use of regularized absolute values.
  • One participant shares a specific truncation-based method for deriving the sign function, while others critique its efficiency.

Areas of Agreement / Disagreement

Participants do not reach a consensus on the best approach to define a sign function without decisional blocks. Multiple competing views and methods are presented, with ongoing debate about their validity and efficiency.

Contextual Notes

Participants express varying interpretations of what constitutes a "decision block" and the implications of using certain mathematical functions. The discussion includes considerations of efficiency in computer implementations and the nature of function definitions.

  • #31
I will use the Lemmings suicide function. Then maybe this thread will truncate.
 
Physics news on Phys.org
  • #32
Given any number x you could guess the sign. You'd be right half the time.
 

Similar threads

  • · Replies 7 ·
Replies
7
Views
3K
  • · Replies 24 ·
Replies
24
Views
6K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 5 ·
Replies
5
Views
3K
  • · Replies 9 ·
Replies
9
Views
3K
  • · Replies 15 ·
Replies
15
Views
2K
  • · Replies 36 ·
2
Replies
36
Views
6K
  • · Replies 8 ·
Replies
8
Views
3K
  • · Replies 9 ·
Replies
9
Views
2K
  • · Replies 1 ·
Replies
1
Views
3K