1+ (FPCore (phi lam es k0 esp)
2+ :name "approx-x-forward-full-series"
3+ (let* ((cp (cos phi))
4+ (sp (sin phi))
5+ (t (if (> (fabs cp) 1e-10) (/ sp cp) 0.0))
6+ (t2 (* t t))
7+ (al (/ (* cp lam) (sqrt (- 1.0 (* es (* sp sp))))))
8+ (als (* al al))
9+ (n (* esp (* cp cp))))
10+ (* k0 al
11+ (+ 1.0
12+ (* (/ 1.0 6.0) als
13+ (+ (- 1.0 t2) n
14+ (* (/ 1.0 120.0) als
15+ (+ 5.0
16+ (+ (* t2 (- t2 18.0))
17+ (* n (- 14.0 (* 58.0 t2))))
18+ (* (/ 1.0 5040.0) als
19+ (+ 61.0 (* t2 (+ (* t2 (- 179.0)) -479.0))))))))))))
20+
21+ (FPCore (phi lam es k0 esp ml0 en_mlfn)
22+ :name "approx-y-forward-full-series"
23+ :pre (and (>= es 0.0) (<= es 1.0))
24+ (let* ((cp (cos phi))
25+ (sp (sin phi))
26+ (t (if (> (fabs cp) 1e-10) (/ sp cp) 0.0))
27+ (t2 (* t t))
28+ (al (/ (* cp lam) (sqrt (- 1.0 (* es (* sp sp))))))
29+ (als (* al al))
30+ (n (* esp (* cp cp)))
31+ ;; Treat m(phi) = pj_mlfn(phi, sp, cp, en) as input en_mlfn
32+ (mphi en_mlfn))
33+ (* k0
34+ (+ (- mphi ml0)
35+ (* sp al lam 0.5
36+ (+ 1.0
37+ (* 0.25 als
38+ (+ 5.0
39+ (+ (- t2) (* n (+ 9.0 (* 4.0 n))))
40+ (* (/ 1.0 720.0) als
41+ (+ 61.0
42+ (+ (* t2 (- 58.0))
43+ (* n (+ 270.0 (* -330.0 t2)))
44+ (* (/ 1.0 80640.0) als
45+ (+ 1385.0
46+ (+ (* t2 (+ (* t2 (- 543.0)) -3111.0))))))))))))))))
47+
48+ (FPCore (x y)
49+ :name "auto-inv-frontier-test"
50+ (- 0.053 (* 0.022 (* y y))))
51+
52+ (FPCore (phi lam)
53+ :name "spherical-b"
54+ (* (cos phi) (sin lam)))
55+
56+ (FPCore (phi lam ml0)
57+ :name "spherical-x-log1p-like"
58+ :pre (< (fabs (* (cos phi) (sin lam))) 1.0)
59+ (let* ((b (* (cos phi) (sin lam))))
60+ (* ml0 (log (/ (+ 1.0 b) (- 1.0 b))))))
61+
62+ (FPCore (phi lam)
63+ :name "spherical-y-cos-over-sqrt"
64+ :pre (< (fabs (* (cos phi) (sin lam))) 1.0)
65+ (let* ((b (* (cos phi) (sin lam))))
66+ (/ (* (cos phi) (cos lam))
67+ (sqrt (- 1.0 (* b b))))))
68+
69+ (FPCore (phi x es k0 esp)
70+ :name "approx-inv-delta-phi"
71+ :pre (and (>= es 0.0) (<= es 1.0))
72+ (let* ((cp (cos phi))
73+ (sp (sin phi))
74+ (t (if (> (fabs cp) 1e-10) (/ sp cp) 0.0))
75+ (t2 (* t t))
76+ (n (* esp (* cp cp)))
77+ (con (- 1.0 (* es (* sp sp))))
78+ (d (/ (* x (sqrt con)) k0))
79+ (ds (* d d)))
80+ (* (/ (* con ds) (- 1.0 es)) 0.5
81+ (+ 1.0
82+ (* (- (/ 1.0 12.0)) ds
83+ (+ 5.0
84+ (+ (* t2 (+ 3.0 (* -9.0 n)))
85+ (* n (+ 1.0 (* -4.0 n))))
86+ (* (- (/ 1.0 360.0)) ds
87+ (+ 61.0
88+ (+ (* t2 (+ 90.0 (* -252.0 n) (* 45.0 t2)))
89+ (* 46.0 n)
90+ (* (- (/ 1.0 560.0)) ds
91+ (+ 1385.0
92+ (+ (* t2 (+ 3633.0
93+ (+ (* t2 (+ 4095.0
94+ (* 1575.0 t2))))))))))))))))))
95+
96+ (FPCore (phi x es k0 esp)
97+ :name "approx-inv-delta-lambda"
98+ :pre (and (>= es 0.0) (<= es 1.0))
99+ (let* ((cp (cos phi))
100+ (sp (sin phi))
101+ (t (if (> (fabs cp) 1e-10) (/ sp cp) 0.0))
102+ (t2 (* t t))
103+ (n (* esp (* cp cp)))
104+ (con (- 1.0 (* es (* sp sp))))
105+ (d (/ (* x (sqrt con)) k0))
106+ (ds (* d d)))
107+ (/ (* d
108+ (+ 1.0
109+ (* (- (/ 1.0 6.0)) ds
110+ (+ 1.0 (* 2.0 t2) n
111+ (* (- (/ 1.0 120.0)) ds
112+ (+ 5.0
113+ (+ (* t2 (+ 28.0 (* 24.0 t2) (* 8.0 n)))
114+ (* 6.0 n)
115+ (* (- (/ 1.0 5040.0)) ds
116+ (+ 61.0
117+ (+ (* t2 (+ 662.0
118+ (+ (* t2 (+ 1320.0
119+ (* 720.0 t2))))))))))))))))
120+ (cos phi))))
121+
122+ (FPCore (Cn Ce)
123+ :name "clenshaw-arg-RI-direct"
124+ (let* ((sin_arg_r (sin (* 2.0 Cn)))
125+ (cos_arg_r (cos (* 2.0 Cn)))
126+ (sinh_arg_i (sinh (* 2.0 Ce)))
127+ (cosh_arg_i (cosh (* 2.0 Ce))))
128+ ;; Returns a tuple in code; here we just form a hard sub-expression
129+ (+ (* sin_arg_r cosh_arg_i) (* cos_arg_r sinh_arg_i))))
130+
131+ (FPCore (Cn lam)
132+ :name "inv-denom-tanCe-optimized"
133+ (let* ((sC (sin Cn))
134+ (cC (cos Cn))
135+ (cE (cos lam)))
136+ (/ 1.0 (sqrt (+ (* sC sC) (* cC cC (* cE cE)))))))
137+
138+ (FPCore (Cn lam)
139+ :name "two-inv-denom-square"
140+ (let* ((sC (sin Cn))
141+ (cC (cos Cn))
142+ (cE (cos lam))
143+ (inv (/ 1.0 (sqrt (+ (* sC sC) (* cC cC (* cE cE)))))))
144+ (* 2.0 (* inv inv))))
145+
146+ (FPCore (Cn lam)
147+ :name "sin-arg-r-optimized"
148+ (let* ((sC (sin Cn))
149+ (cC (cos Cn))
150+ (cE (cos lam))
151+ (twoinv2 (* 2.0
152+ (/ 1.0 (+ (* sC sC) (* cC cC (* cE cE)))))))
153+ ;; twoinv2 == 2 * inv^2
154+ (* sC cC cE twoinv2)))
155+
156+ (FPCore (Cn lam)
157+ :name "cos-arg-r-optimized"
158+ (let* ((sC (sin Cn))
159+ (cC (cos Cn))
160+ (cE (cos lam))
161+ (twoinv2 (* 2.0
162+ (/ 1.0 (+ (* sC sC) (* cC cC (* cE cE)))))))
163+ (+ (* cC cE twoinv2) -1.0)))
164+
165+ (FPCore (Cn lam)
166+ :name "tanCe-and-asinh"
167+ (let* ((sC (sin Cn))
168+ (cC (cos Cn))
169+ (sE (sin lam))
170+ (cE (cos lam))
171+ (inv (/ 1.0 (sqrt (+ (* sC sC) (* cC cC (* cE cE))))))
172+ (tanCe (* sE cC inv)))
173+ (asinh tanCe)))
174+
175+ (FPCore (Cn lam)
176+ :name "sinh-arg-i-optimized"
177+ (let* ((sC (sin Cn))
178+ (cC (cos Cn))
179+ (sE (sin lam))
180+ (cE (cos lam))
181+ (inv (/ 1.0 (sqrt (+ (* sC sC) (* cC cC (* cE cE))))))
182+ (tanCe (* sE cC inv)))
183+ (* tanCe (* 2.0 inv))))
184+
185+ (FPCore (Cn lam)
186+ :name "cosh-arg-i-optimized"
187+ (let* ((sC (sin Cn))
188+ (cC (cos Cn))
189+ (cE (cos lam))
190+ (inv (/ 1.0 (sqrt (+ (* sC sC) (* cC cC (* cE cE))))))
191+ (twoinv2 (* 2.0 (* inv inv))))
192+ (+ twoinv2 -1.0)))
193+
194+ (FPCore (Ce)
195+ :name "sinh2C-and-cosh2C-from-exp"
196+ (let* ((e (exp (* 2.0 Ce))))
197+ ;; sinh(2Ce) = 0.5e - 0.5/e ; cosh(2Ce) = 0.5e + 0.5/e
198+ (- (* 0.5 e) (/ 0.5 e))))
199+
200+ (FPCore (Ce Cn)
201+ :name "Ce-prime-atan2-sinhCe-cosCn"
202+ (let* ((sinhCe (sinh Ce))
203+ (cC (cos Cn)))
204+ (atan2 sinhCe cC)))
205+
206+ (FPCore (Ce Cn)
207+ :name "Cn-prime-atan2-sinCn-hypot"
208+ (let* ((sinhCe (sinh Ce))
209+ (cC (cos Cn))
210+ (sC (sin Cn))
211+ (modC (sqrt (+ (* sinhCe sinhCe) (* cC cC)))))
212+ (atan2 sC modC)))
213+
214+ (FPCore (lam0)
215+ :name "utm-zone-from-lon0-core"
216+ ;; This mirrors the floating arithmetic inside the zone choice,
217+ ;; minus adjlon/floor/lround; keep the hairy scale/shift.
218+ (+ (* (/ 1.0 30.0) (+ lam0 (* (/ 1.0 30.0) 0.0))) 0.0))
0 commit comments