Help me find the function definition if: $$ f(a, b)\ =\ ? $$ $$ f(a, b) = \frac{a}{b}, a > b $$ $$ f(a, b) = -\frac{b}{a}, a < b $$ $$ f(a, b) = 0, a = b $$ $$ a > 0; b > 0; $$
Asked
Active
Viewed 66 times
2 Answers
1
$$ f(a,b) = \left [ \frac{a+b+|a-b|}{2} \right ]\left ( \frac{1}{b} - \frac{1}{a} \right ) + \text{sgn}(a-b) $$
Jay Jay
- 121
0
I have non-numerical solution (?):
$$ f(a, b) = \frac{max(a, b)}{min(a, b)}$$
OlegSerov
- 21
-
How do you get the negative sign in the $a<b$ case? – max_zorn Feb 15 '18 at 23:29
-
Indeed, I've made a mistake here. However, because I use $$f(a, b)^2$$, so I really did not care about it. – OlegSerov Feb 16 '18 at 02:59