0

I have a bounded function.

When x > 1, y = 1;

when 0 <= x <= 1, y = x;

when x < 0, y = 0.

Does anyone know any simple math function to represent y (Do not use piece-wise function).

For example, Heaviside function is a similar approach.

Thanks

HeyMan
  • 163
  • 2
  • 11
  • 2
    This seems to be off-topic, as it is about mathematics rather than programming. math.stackexchange.com would be more appropriate for this question. –  Jan 18 '14 at 21:24
  • That said, if you want to know how to accomplish this in any programming language, we can easily demonstrate that. ;) – Josiah Jan 18 '14 at 21:29
  • 3
    Is a two-argument `min()` and `max()` function acceptable? `y = max(0, min(x, 1))`... –  Jan 18 '14 at 21:31

1 Answers1

1

Just for fun - pure math function:

formula

Egor Skriptunoff
  • 23,359
  • 2
  • 34
  • 64