aboutsummaryrefslogtreecommitdiff
path: root/ic-reals-6.3/math-lib/acos_R.c~
diff options
context:
space:
mode:
Diffstat (limited to 'ic-reals-6.3/math-lib/acos_R.c~')
-rw-r--r--ic-reals-6.3/math-lib/acos_R.c~26
1 files changed, 26 insertions, 0 deletions
diff --git a/ic-reals-6.3/math-lib/acos_R.c~ b/ic-reals-6.3/math-lib/acos_R.c~
new file mode 100644
index 0000000..4de1e7a
--- /dev/null
+++ b/ic-reals-6.3/math-lib/acos_R.c~
@@ -0,0 +1,26 @@
+/*
+ * Copyright (C) 2000, Imperial College
+ *
+ * This file is part of the Imperial College Exact Real Arithmetic Library.
+ * See the copyright notice included in the distribution for conditions
+ * of use.
+ */
+
+#include <stdio.h>
+#include "real.h"
+
+/*
+ * acos(x) = atan((sqrt(1-x^2))/x)
+ */
+Real
+acos_R(Real x)
+{
+ Real r, s;
+
+ r = mul_R_R(x, x);
+ r = sub_Int_R(1, r);
+ r = sqrt_R(r);
+ r = div_R_R(r, x);
+ r = atan_R(r);
+ return r;
+}