/// <summary>
/// Returns the arccos of of the specified number, calculated using Atan and Sqrt
/// This function has at least 7 decimals of accuracy.
/// </summary>
public static FP Acos(FP x)
{
if (x < -One || x > One)
{
throw new ArgumentOutOfRangeException("Must between -FP.One and FP.One", "x");
}
if (x.RawValue == 0) return PiOver2;
var result = Atan(Sqrt(One - x * x) / x);
return x.RawValue < 0 ? result + Pi : result;
}
It throw out exception "Must between -FP.One and FP.One"
The demo is as follow:
The code of Fix64: