Thread Links Date Links
Thread Prev Thread Next Thread Index Date Prev Date Next Date Index

Re: Another proposal for a "split" function to complement "mid"



Joel, P1788

On 20 Mar 2012, at 13:39, Joel C. Salomon wrote:
> (Also, the question of how to most usefully define split() is open for discussion; I'm just trying to cheat at Level 1, not defining anything in terms of HUGH_VAL.)
> 
> Does that sound workable?

So the idea is that a function is "mentioned" at Level 1 with minimal properties specified, and fully defined at Level 2? Seems a reasonable idea. Since I agree with Arnold that we should have a function that returns a single number, not two intervals, I'll call it median().

This would give the following.

Level 1 specification:
    A function m = median(xx) shall exist, where xx is an interval
    and m a real number.
Level 1 Properties:
    Don't demand much, maybe only that m is a member of xx, if xx
    is nonempty. Undefined if xx empty.

Level 2 specification:
    Define one specific median() function. 
Level 2 Properties:
    All Level 1 properties shall hold also at Level 2, with the
    usual proviso that "undefined number" becomes NaN at Level 2.

For reasons given by Arnold and others, I lean towards Arnold & Michel's "convert-to-sortable" method, once someone solves the "bunching at zero" problem. (I think I know how.)
This would be short and fast if done in low-level code. I guess 10 to 100 times faster than my asinh idea, even when this is given improvements Dan Zuras is working on.

Would the group go with that?

John