I am trying to find sine from a cosine relation using the following commands:
CosEta[x_,y_]: := 1/2 Cosh[Log[3]/2] (-Sqrt[y^2 + (x - Sech[Log[3]/2])^2] + Sqrt[y^2 + (x + Sech[Log[3]/2])^2]);
sinsquare[x_,y_]: := 1 - (CosEta[x,y])^2;
SinEta[x_,y_]: := Sqrt[sinsquare[x,y]];
At some point, i.e. x-> 1.1, y-> -0.000000001 x-> 1.1, y-> -0.000000001
,
CosEta[x,y]CosEta[x,y]
becomes -4.44089 * 10^-16 -4.44089 * 10^-16
, and as a consequence, SinEta SinEta
returns complex number as 0. + 2.10734 * 10^-8 I 0. + 2.10734 * 10^-8 I
. What can be done to get rid of this complex number return?
I have to implement this commands in my full code which includes multiple 1st and 2nd derivatives of SinEtaSinEta
and CosEtaCosEta
for which I can not use Re[]Re[]
in defining the SinEtaSinEta
since Re'Re'
and Re''Re''
shows up in the final outcome.