--Copyright The Numerical Algorithms Group Limited 1994.
--
)clear all
EFI:=Expression Integer

ber:=operator 'ber
s:=operator 's
--s:OP EFI:=operator 's

br:LIST EFI->EFI
-- br(x|(x.1)~=0)==(x.1)/(exp((x.1))-1)
-- br has a removable singularity at the origin
-- br(x|(x.1)=0)== limit(br([y]),y=0)
br(x) == 
 (x.1) = 0 => limit(br([y]),y=0) 
 (x.1)/(exp((x.1))-1) 

br([1])
br([0])

fJ:List FRAC INT -> EFI
J(i:PI,j:PI):EFI==ber(s(i)-s(j))

function(J(1,2),'fJ,['s])
evaluate(ber,br)$BOP1(EFI);

ss:=[1,2]
fJ(ss)

ss:=[1,1]
-- fJ doesn't know about the special definition at the origin
fJ(ss)

