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"



On 03/19/2012 04:02 AM, John Pryce wrote:
Michel

On 18 Mar 2012, at 23:01, Michel Hack wrote:

John Pryce wrote, replying to Vladik's efficiency concerns:
Earlier discussion suggested a good method to find a split point in [a,b]
would behave like the arithmetic mean for smallish numbers, and like
geometric mean for larger numbers of the same sign.  asinh is the only
elementary function that gives a mapping which implements that, being like
log(x) for x>>  1, like x for |x| small, like -log(-x) for x<<  -1.  That's
why I chose it.  But a function with similar behaviour would do, if it and
its inverse are cheap to evaluate and guaranteed monotone.

If you want a Level 1 definition, this seems best indeed.  But if we loosen
the Level 2 requirement to provide a function with the same overall behaviour,
but otherwise unspecified, the most efficient one at Level 2 works directly
on the binary representation, by flipping some bits and taking the integer
arithmetic mean.  Formally it means converting to sortable, averaging, then
converting back to FP.  This would work for DFP as well as for BFP (the DFP
sortable format is a bit more complicated, but still implementable with good
performance -- certainly better than a hyperbolic function).

(You still need the cutoff -- probably L=1 is just fine -- near zero.)

I like this idea. I've previously written some code using convert-to-sortable, but wonder how the cutoff is to be done. Is the idea that you scale down so that L becomes the subnormal threshold? I.e. multiply [xlo,xhi] by C = REALMIN/L, do the convert and average, then divide by C?

Before deciding what to propose, you also need to look at how to do unbounded intervals, to see what happens to simplicity. I'd like to see what happens when [0,Inf] is taken as the initial interval. This is frequent in B&b.

Look at my sample output. I think they show having a variable length-scale L can be quite useful.

What is the use? You only apply it with various fixed L. Variable L is needed only if it is useful to change L during a computation - which doesn't make sense, I think.

Scaling a problem is most sensibly done before starting the B&B algorithm, not in each iteration. Thus taking L=1 is no harm.