The return type is not part of a function's signature. It doesn't really make much sense. How do you expect type deduction to work when only the return type changes? i.e.:
auto func = ambiguous(0.0, 0.0, 0.0); // Which one to use?
You can specify an out parameter. This is a common idiom in Microsoft:
quadraticFormula(long double, long double, long double, TypeOne& out);
Although this will require your users to rely on Intellisense or documentation. The other option is to rename your functions.
quadraticFormulaOne(...);
quadraticFormulaTwo(...);
But this can be annoying if there's a lot of them.
C++ (subsection 7.4.1 of Bjarne Stroustrup's "The C++ Programming
Language"): "Return types are not considered in overload resolution.
The reason is to keep resolution for an individual operator or
function call context-independent. Consider:
float sqrt(float);
double sqrt(double);
void f(double da, float fla)
{
float fl = sqrt(da); // call sqrt(double)
double d = sqrt(da); // call sqrt(double)
fl = sqrt(fla); // call sqrt(float)
d = sqrt(fla); // call sqrt(float)
}
If the return type were taken into account, it would no longer be
possible to look at a call of sqrt() in isolation and determine which
function was called."
See Function overloading by return type? for an extensive discussion.