Closed
Description
The logarithmic mean of two +ve numbers (not same as log-mean), is defined as:
Where x = y:
Mlm(x, y) = x
Where x ≠ y:
Mlm(x, y) = (y - x) / (ln(y) - ln(x))
So:
function LogarithmicMean(const X, Y: Double): Double;
begin
Assert((X > 0) and (Y > 0));
if SameValue(X, Y) then
Result := X
else
Result := (Y - X) / (Ln(Y) - Ln(X));
end;
This issue was extracted from issue #16
Metadata
Metadata
Assignees
Projects
Status
Completed