-
Notifications
You must be signed in to change notification settings - Fork 128
Expand file tree
/
Copy pathmath.pxi
More file actions
101 lines (81 loc) · 1.68 KB
/
math.pxi
File metadata and controls
101 lines (81 loc) · 1.68 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
(ns pixie.math
(:require [pixie.ffi-infer :as i]
[pixie.string :as s]))
(i/with-config {:library "m"
:cxx-flags ["-lm"]
:includes ["math.h"]}
(i/defconst M_E)
(i/defconst M_LOG2E)
(i/defconst M_LOG10E)
(i/defconst M_LN2)
(i/defconst M_LN10)
(i/defconst M_PI)
(i/defconst M_PI_2)
(i/defconst M_PI_4)
(i/defconst M_1_PI)
(i/defconst M_2_PI)
(i/defconst M_2_SQRTPI)
(i/defconst M_SQRT2)
(i/defconst M_SQRT1_2)
(i/defcfn nan)
(i/defcfn ceil)
(i/defcfn floor)
(i/defcfn nearbyint)
(i/defcfn rint)
(i/defcfn lround)
(i/defcfn llrint)
(i/defcfn llround)
(i/defcfn trunc)
(i/defcfn fmod)
(i/defcfn remainder)
(i/defcfn remquo)
(i/defcfn fdim)
(i/defcfn fmax)
(i/defcfn fmin)
(i/defcfn fma)
(i/defcfn fabs)
(i/defcfn sqrt)
(i/defcfn cbrt)
(i/defcfn hypot)
(i/defcfn exp)
(i/defcfn exp2)
(if-not (s/starts-with? pixie.platform/name "darwin")
(i/defcfn exp10))
(i/defcfn expm1)
(i/defcfn log)
(i/defcfn log2)
(i/defcfn log10)
(i/defcfn log1p)
(i/defcfn logb)
(i/defcfn ilogb)
(i/defcfn modf)
(i/defcfn frexp)
(i/defcfn ldexp)
(i/defcfn scalbn)
(i/defcfn scalbln)
(i/defcfn pow)
(i/defcfn cos)
(i/defcfn sin)
(i/defcfn tan)
(i/defcfn cosh)
(i/defcfn sinh)
(i/defcfn tanh)
(i/defcfn acos)
(i/defcfn asin)
(i/defcfn atan)
(i/defcfn atan2)
(i/defcfn acosh)
(i/defcfn asinh)
(i/defcfn atanh)
(i/defcfn tgamma)
(i/defcfn lgamma)
(i/defcfn j0)
(i/defcfn j1)
(i/defcfn jn)
(i/defcfn y0)
(i/defcfn y1)
(i/defcfn yn)
(i/defcfn erf)
(i/defcfn erfc))
(if (s/starts-with? pixie.platform/name "darwin")
(defn exp10 [x] (pow 10.0 x)))