I'm trying to construct a function that contains two parts: one, $g(a,b)$, coming into effect when $a\lt b$, and the other, $h(a,b)$, when $b \lt a$.
The problem is that $a=b$ is a valid possibility which I do not know how to handle, even though
if $a=b$, then $g(a,b)=h(a,b)$ and $g'(a,b)=h'(a,b)$.
So there is a real result at $a=b$, but I don't know how to get it out of the equation. there must be a mathematical way to properly express this.
currently I have
f(a,b) = $$\frac{(a-b)-\sqrt{(a-b)^2}}{2(a-b)}g(a,b) + \frac{\sqrt{(a-b)^2}+(a-b)}{2(a-b)}h(a,b).$$ which clearly doesn't cut it, because at $a=b$ the result is some weird specie of infinity.
And I am still working on figuring out $g(a,b)$ and $h(a,b)$, so I can't provide you with an example at this point.
So to recap: How do you join parts of functions into one continuous arithmetic function? (without input logic)
"you can'd do that" is a valid answer, but I'd like to know why.
and I mean I can use conditional statements, but i would 'like' a form that is universally portable, something you 'could' punch into a calculator, something that you could just copy from c++ and paste into haskell or calc.exe. I know plenty of ways to do it, but I'm asking the crowd for a universal solution, should one exist. If anyone (heh), you would know.
– guest Jul 24 '12 at 04:37