(j3.2006) Liaison to IFIP WG 2.5

Bill Long longb
Wed Aug 22 16:51:38 EDT 2007



Van Snyder wrote:
> On Wed, 2007-08-22 at 12:37 -0500, Bill Long wrote:
>   
>> Van Snyder wrote: 
>>     
>>> On Tue, 2007-08-21 at 17:32 -0600, keith bierman wrote:
>>>   
>>>       
>>>> That's doing things naively. If you are clever you can do rafts of  
>>>> computation with one rounding mode, and then change the mode and do  
>>>> the next set. All the moreso with enough cores to be working in  
>>>> parallel. Of course, then it is intractable if it's just modules,  
>>>> hand code, and an optimizer stuck trying to paste it all back
>>>> together.
>>>>     
>>>>         
>>> This is pretty simple for add and subtract, but for multiply there are
>>> nine cases, and for divide when the divisor doesn't include zero there
>>> are six.  When the divisor includes zero you just produce NaN (or should
>>> it be [-Inf,+Inf]?).  So for multiply you'd set the rounding mode down
>>> and then execute a 9-way where/elsewhere block, then set it up and
>>> execute another where/elsewhere block. 
>>>       
>> What algorithm are you using?  From Wikipedia, I see this for interval
>> multiplies:
>>
>> [a,b] ? [c,d] = [min (ac, ad, bc, bd), max (ac, ad, bc, bd)]
>>
>>
>> This looks like 4 multiplies rounded up, another 4 multiplies (same
>> operands) rounded down, and 6 conditional merges.  No reasonable use
>> of where/elsewhere blocks in sight. 
>>     
>
> That's fine if you want to do four multiplies instead of two in all but
> one case.
>   

Well, if the trade-off between a couple of multiplies and a 9-way branch 
nest is not obvious to Kulisch, it is no wonder that computer people 
don't taking him seriously.

Cheers,
Bill

> Table 1 from Kulisch's book:
>
> ----------------------------------------------------------------------
>     A = [a1,a2],   B = [b1,b2]    A*B
> ----------------------------------------------------------------------
> 1   a1 >= 0        b1 >= 0        [a1b1,a2b2]
> 2   a1 >= 0        b2 <= 0        [a2b1,a1b2]
> 3   a1 >= 0        b1 < 0 < b2    [a2b1,a2b2]
> 4   a2 <= 0        b1 >= 0        [a1b2,a2b1]
> 5   a2 <= 0        b2 <= 0        [a2b2,a1b1]
> 6   a2 <= 0        b1 < 0 < b2    [a1b2,a1b1]
> 7   a1 < 0 < a2    b1 >= 0        [a1b2,a2b2]
> 8   a1 < 0 < a2    b2 <= 0        [a2b1,a1b1]
> 9   a1 < 0 < a2    b1 < 0 < b2    [min(a1b2,a2b1),max(a1b1,a2b2)]
> ---------------------------------------------------------------------
>
>   

-- 
Bill Long                                   longb at cray.com
Fortran Technical Support    &              voice: 651-605-9024
Bioinformatics Software Development         fax:   651-605-9142
Cray Inc., 1340 Mendota Heights Rd., Mendota Heights, MN, 55120

            

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://j3-fortran.org/pipermail/j3/attachments/20070822/31a10fdf/attachment-0001.html 



More information about the J3 mailing list