SayoriOS  0.3.3
asin.c
1 #include "lib/math.h"
2 
3 double asin_ipart(double t) {
4  return pow(1.0 - pow(t, 2.0), -0.5);
5 }
6 
7 double asin(double x) {
8  if(x < -1.0 || x > 1.0) {
9  return NAN;
10  }
11 
12  if(x == 1.0) {
13  return PI / 2;
14  }
15 
16  return trapezoidal_rule(
17  asin_ipart,
18  0,
19  x,
20  ASIN_STEPS
21  );
22 }