Daily update on 20231211 by nitload youmu

This commit is contained in:
Nitload
2023-12-12 03:17:16 +08:00
parent ab85c1a9fe
commit f97fb137ba
100 changed files with 2699 additions and 3191 deletions
+41 -37
View File
@@ -1,52 +1,55 @@
using System;
using System.Runtime.CompilerServices;
namespace StgSharp.Math
{
public static unsafe partial class Calc
public static unsafe partial class Scaler
{
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static unsafe float ACos(float x)
{
return MathF.Acos(x);
int sign = 1;
float y;
/*
int sign = 1;
float y;
if (x < 0)
{
sign = -1;
y = -x;
}
else
{
y = x;
}
if (x < 0)
{
sign = -1;
y = -x;
}
else
{
y = x;
}
if (x > 1)
{
throw new ArgumentException();
}
if (x > 1)
{
throw new ArgumentException();
}
float r, s, u, v = 0.0f;
bool transform = (y >= 0.5f);
float r, s, u, v = 0.0f;
bool transform = (y >= 0.5f);
if (transform)
{
r = 0.5f * (1.0f - y);
s = Calc.Sqrt(r);
y = s;
}
else
{
r = y * y;
}
u = r * (0.184161606965100694821398249421F +
(-0.0565298683201845211985026327361F +
(-0.0133819288943925804214011424456F -
0.00396137437848476485201154797087F * r) * r) * r) /
(1.10496961524520294485512696706F -
0.836411276854206731913362287293F * r);
/**/
if (transform)
{
r = 0.5f * (1.0f - y);
s = Scaler.Sqrt(r);
y = s;
}
else
{
r = y * y;
}
u = r * (0.184161606965100694821398249421F +
(-0.0565298683201845211985026327361F +
(-0.0133819288943925804214011424456F -
0.00396137437848476485201154797087F * r) * r) * r) /
(1.10496961524520294485512696706F -
0.836411276854206731913362287293F * r);
/*
if (transform)
{
@@ -65,11 +68,12 @@ namespace StgSharp.Math
else
{
v = y + y * u;
}/**/
}
v = sign * v;
return piby2 - v;
*/
}
}
}