clear clc

y=1
i=0
sum=1

while y>10e-8
    i=i+1 
    y=y*(1/2)^(2)/((2*i-1)*(2*i)); 
    sum=sum+ y
end

% matlab built-in function for cosh
ym=cosh(1/2)

% comparison between our calculation and Matlab function

error=sum-ym

