Hi,

I think this could be achieved with a bidimendional array for example or with two arrays.

The first array keeps the values that you already have in the array for 'cos' problem. Let's name it A.

The second ones keeps the values from 0 to 90. Let's name it B.

The mapping between the two arrays is done by the index. Thus the acos of A[X] will be the value in B[X].

And if you want to find tha value of acos(Y) you just do a binary search in the array A (since it is a sorted array). This way you find the closest value for Y in A. This value has an index of X. So the wanted acos will be B[X].

This will be a little slower than the solution for cos but has to be quite faster than the standard way.

I have not described it very detailed but I see you have a lot of expert points so I think you'll get it. :)

I think this could be achieved with a bidimendional array for example or with two arrays.

The first array keeps the values that you already have in the array for 'cos' problem. Let's name it A.

The second ones keeps the values from 0 to 90. Let's name it B.

The mapping between the two arrays is done by the index. Thus the acos of A[X] will be the value in B[X].

And if you want to find tha value of acos(Y) you just do a binary search in the array A (since it is a sorted array). This way you find the closest value for Y in A. This value has an index of X. So the wanted acos will be B[X].

This will be a little slower than the solution for cos but has to be quite faster than the standard way.

I have not described it very detailed but I see you have a lot of expert points so I think you'll get it. :)