3

$\mathrm{Abs}(a - b)$ is $b - a$ if $a - b < 0$ else $a -b$.

If so, is there anything equivalent for division? That is, something like:

$\mathrm{Xxx}(a/b)$ is $b/a$ if $a/b < 1$ else $a/b$.

Thanks.

akai
  • 203
  • For which $a,b$? Integers? Real numbers? $0<1$ for instance, how do you plan on dividing by it? – AlvinL Jul 12 '21 at 08:36
  • $a$ and $b$ are real, and $b ≠ 0$ in the division case. Actually, I think setting $a > 0$ and $b > 0$ in the division case makes the discussion easy, but not sure very much. – akai Jul 12 '21 at 08:51
  • 3
    Here's a function that does that operation $f(x)=x^\frac{x-1}{|x-1|}$ – Asher2211 Jul 12 '21 at 08:54
  • multiplicative inverse is there –  Jul 12 '21 at 09:46
  • For positive real numbers $a$ and $b,$ one sometimes wishes to consider $L=\max{\frac{a}{b},\frac{b}{a}}.$ For example, if you're dealing with a situation in which it is important to know that a certain variable quantity is bounded above zero and below infinity (e.g. the notion of Lipschitz equivalence and describing equivalent order of growth for functions), then we can describe this by the use of a single parameter by saying it's between $L^{-1}$ and $L$ for some positive number $L.$ – Dave L. Renfro Jul 12 '21 at 13:40

1 Answers1

4

One obvious formula for positive real $x$, equivalent to Asher2211's comment, is $$ f(x) = e^{|\log x|} = \begin{cases} \frac{1}{x} & 0 < x < 1, \\ x & 1 \leq x. \end{cases} $$ Conceptually, the natural logarithm $\log$ maps the positive reals to the reals (converting multiplication/division to addition/subtraction), the absolute value does its thing, and $\exp$ sends the value back to the positive reals (converting addition/subtraction back to multiplication/division).

This illustrates a useful general mathematical idiom, "transfer of structure".

This function can be extended to $f(x) = e^{|\log|x||}$, for non-zero real $x$, and $f(0) = 0$, i.e., $f(x) = 1/|x|$ if $0 < |x| < 1$ and $f(x) = |x|$ otherwise.

A function analogous to absolute value for multiplication