q = r4_Cos(a,b); if ((! (-1.0 <= q) && (q <= 1.0))) { q = FLOAT(TRUNC(q), double); }; z = Math.acos(q); /* Aproximation */