Fix fast_trigonometry.inl #1365
                
     Open
            
            
          
  Add this suggestion to a batch that can be applied as a single commit.
  This suggestion is invalid because no changes were made to the code.
  Suggestions cannot be applied while the pull request is closed.
  Suggestions cannot be applied while viewing a subset of changes.
  Only one suggestion per line can be applied in a batch.
  Add this suggestion to a batch that can be applied as a single commit.
  Applying suggestions on deleted lines is not supported.
  You must change the existing code in this line in order to create a valid suggestion.
  Outdated suggestions cannot be applied.
  This suggestion has been applied or marked resolved.
  Suggestions cannot be applied from pending reviews.
  Suggestions cannot be applied on multi-line comments.
  Suggestions cannot be applied while the pull request is queued to merge.
  Suggestion cannot be applied right now. Please check back later.
  
    
  
    
fix
glm::fastTan,glm::fastAsin,glm::fastAcos,glm::fastAtan, They should work much better now across their domains.Other changes
glm::wrapAngle, sincefmodis slow so changed it intoangle - trunc(angle / two_pi) * two_piglm::fastSin,glm::fastCosimprove accuracyImplementation
it uses different approximated polynomials to minimize the error
sin_poly(x) ~ (sin(sqrt(x))-sqrt(x)) / (x * sqrt(x))sin(x) ~ x * x3 * sin_poly(x2)cos_poly(x) ~ cos(sqrt(x))cos(x) ~ cos_poly(x2)asin_poly(x) ~ (asin(sqrt(x))-sqrt(x)) / (x * sqrt(x))asin(x) ~ x * x3 * asin_poly(x2)atan_poly(x) ~ (atan(sqrt(x))-sqrt(x)) / (x * sqrt(x))atan(x) ~ x * x3 * atan_poly(x2)Identity
Polynomial approximation is only accurate within its interval, so trig identity solves that
asin_poly(x)interval [0, 0.5]for x values [0.5, 1.0]
asin(x) ~ pi/2 - 2 * asin_poly(sqrt((1 - x) / 2))for -x values
asin(x) ~ -asin(abs(x))tan(x)for +-x -> inf x values
tan(x) ~ sin(x)/cos(x)atan_poly(x)interval [0, 0.5]for x values [0.5, 1.0]
atan(x) ~ atan_poly((x - 1) / (1 + x)) + pi/4for x values [1.0, inf]
atan(x) ~ asin(x / sqrt(1 + x * x))alternative :
atan(x) ~ pi/2 - atan(1 / x)for -x values
atan(x) ~ -atan(abs(x))