/usr/lib/ats-anairiats-0.2.11/libc/SATS/complex.sats is in ats-lang-anairiats 0.2.11-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
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 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 | (***********************************************************************)
(* *)
(* Applied Type System *)
(* *)
(* Hongwei Xi *)
(* *)
(***********************************************************************)
(*
** ATS - Unleashing the Potential of Types!
** Copyright (C) 2002-2008 Hongwei Xi, Boston University
** All rights reserved
**
** ATS is free software; you can redistribute it and/or modify it under
** the terms of the GNU General Public License as published by the Free
** Software Foundation; either version 2.1, or (at your option) any later
** version.
**
** ATS is distributed in the hope that it will be useful, but WITHOUT ANY
** WARRANTY; without even the implied warranty of MERCHANTABILITY or
** FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
** for more details.
**
** You should have received a copy of the GNU General Public License
** along with ATS; see the file COPYING. If not, please write to the
** Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
** 02110-1301, USA.
*)
(* ****** ****** *)
(* author: Hongwei Xi (hwxi AT cs DOT bu DOT edu) *)
(* ****** ****** *)
%{#
#include "libc/CATS/complex.cats"
%} // end of [%{#}
(* ****** ****** *)
#define ATS_STALOADFLAG 0 // no static loading at run-time
(* ****** ****** *)
(*
** complex numbers of single precision
*)
abst@ype ccmplx_t0ype = $extype"ats_fcomplex_type"
typedef ccmplx = ccmplx_t0ype
symintr ccmplx_of
(* ****** ****** *)
fun fprint_ccmplx {m:file_mode}
(pf: file_mode_lte (m, w) | out: &FILE m, x: ccmplx):<!exnref> void
= "atslib_fprint_ccmplx"
overload fprint with fprint_ccmplx
fun print_ccmplx (c: ccmplx):<!exnref> void
and prerr_ccmplx (c: ccmplx):<!exnref> void
overload print with print_ccmplx
overload prerr with prerr_ccmplx
(* ****** ****** *)
val ccmplx_imag_unit : ccmplx
= "atslib_ccmplx_imag_unit" // imaginary unit
// end of [val]
(* ****** ****** *)
fun ccmplx_of_int (i: int):<> ccmplx
= "atslib_ccmplx_of_int"
overload ccmplx_of with ccmplx_of_int
fun ccmplx_of_float (f: float):<> ccmplx
= "atslib_ccmplx_of_float"
overload ccmplx_of with ccmplx_of_float
fun ccmplx_make_cart (f1: float, f2: float):<> ccmplx
= "atslib_ccmplx_make_cart"
fun ccmplx_make_polar (f1: float, f2: float):<> ccmplx
= "atslib_ccmplx_make_polar"
(* ****** ****** *)
fun crealf (c: ccmplx):<> float = "atslib_crealf"
fun ccmplx_real (c: ccmplx):<> float = "atslib_crealf"
fun cimagf (c: ccmplx):<> float = "atslib_cimagf"
fun ccmplx_imag (c: ccmplx):<> float = "atslib_cimagf"
(* ****** ****** *)
fun neg_ccmplx
(c: ccmplx):<> ccmplx = "atslib_neg_ccmplx"
overload ~ with neg_ccmplx
fun add_ccmplx_ccmplx (c1: ccmplx, c2: ccmplx):<> ccmplx
= "atslib_add_ccmplx_ccmplx"
overload + with add_ccmplx_ccmplx
fun sub_ccmplx_ccmplx (c1: ccmplx, c2: ccmplx):<> ccmplx
= "atslib_sub_ccmplx_ccmplx"
overload - with sub_ccmplx_ccmplx
fun mul_ccmplx_ccmplx (c1: ccmplx, c2: ccmplx):<> ccmplx
= "atslib_mul_ccmplx_ccmplx"
overload * with mul_ccmplx_ccmplx
fun div_ccmplx_ccmplx (c1: ccmplx, c2: ccmplx):<> ccmplx
= "atslib_div_ccmplx_ccmplx"
overload / with div_ccmplx_ccmplx
(* ****** ****** *)
fun eq_ccmplx_ccmplx (c1: ccmplx, c2: ccmplx):<> bool
= "atslib_eq_ccmplx_ccmplx"
overload = with eq_ccmplx_ccmplx
fun neq_ccmplx_ccmplx (c1: ccmplx, c2: ccmplx):<> bool
= "atslib_neq_ccmplx_ccmplx"
overload <> with neq_ccmplx_ccmplx
(* ****** ****** *)
fun cabsf (c: ccmplx):<> float = "atslib_cabsf"
fun abs_ccmplx (c: ccmplx):<> float = "atslib_cabsf"
overload abs with abs_ccmplx
fun csqrtf (c: ccmplx):<> ccmplx = "atslib_csqrtf"
fun sqrt_ccmplx (c: ccmplx):<> ccmplx = "atslib_csqrtf"
overload sqrt with sqrt_ccmplx
(* ****** ****** *)
fun cargf (c: ccmplx):<> float = "atslib_cargf"
fun arg_ccmplx (c: ccmplx):<> float = "atslib_cargf"
fun conjf (c: ccmplx):<> ccmplx = "atslib_conjf"
fun conj_ccmplx (c: ccmplx):<> ccmplx = "atslib_conjf"
(* ****** ****** *)
fun csinf (c: ccmplx):<> ccmplx = "atslib_csinf"
fun sin_ccmplx (c: ccmplx):<> ccmplx = "atslib_csinf"
fun ccosf (c: ccmplx):<> ccmplx = "atslib_ccosf"
fun cos_ccmplx (c: ccmplx):<> ccmplx = "atslib_ccosf"
fun ctanf (c: ccmplx):<> ccmplx = "atslib_ctanf"
fun tan_ccmplx (c: ccmplx):<> ccmplx = "atslib_ctanf"
(* ****** ****** *)
fun casinf (c: ccmplx):<> ccmplx = "atslib_casinf"
fun asin_ccmplx (c: ccmplx):<> ccmplx = "atslib_casinf"
fun cacosf (c: ccmplx):<> ccmplx = "atslib_cacosf"
fun acos_ccmplx (c: ccmplx):<> ccmplx = "atslib_cacosf"
fun catanf (c: ccmplx):<> ccmplx = "atslib_catanf"
fun atan_ccmplx (c: ccmplx):<> ccmplx = "atslib_catanf"
(* ****** ****** *)
fun csinhf (c: ccmplx):<> ccmplx = "atslib_csinhf"
fun sinh_ccmplx (c: ccmplx):<> ccmplx = "atslib_csinhf"
fun ccoshf (c: ccmplx):<> ccmplx = "atslib_ccoshf"
fun cosh_ccmplx (c: ccmplx):<> ccmplx = "atslib_ccoshf"
fun ctanhf (c: ccmplx):<> ccmplx = "atslib_ctanhf"
fun tanh_ccmplx (c: ccmplx):<> ccmplx = "atslib_ctanhf"
(* ****** ****** *)
fun casinhf (c: ccmplx):<> ccmplx = "atslib_casinhf"
fun asinh_ccmplx (c: ccmplx):<> ccmplx = "atslib_casinhf"
fun cacoshf (c: ccmplx):<> ccmplx = "atslib_cacoshf"
fun acosh_ccmplx (c: ccmplx):<> ccmplx = "atslib_cacoshf"
fun catanhf (c: ccmplx):<> ccmplx = "atslib_catanhf"
fun atanh_ccmplx (c: ccmplx):<> ccmplx = "atslib_catanhf"
(* ****** ****** *)
fun cexpf (c: ccmplx):<> ccmplx = "atslib_cexpf"
fun exp_ccmplx (c: ccmplx):<> ccmplx = "atslib_cexpf"
fun clogf (c: ccmplx):<> ccmplx = "atslib_clogf"
fun log_ccmplx (c: ccmplx):<> ccmplx = "atslib_clogf"
fun cpowf (c1: ccmplx, c2: ccmplx):<> ccmplx
= "atslib_cpowf"
fun pow_ccmplx_ccmplx (c1: ccmplx, c2: ccmplx):<> ccmplx
= "atslib_cpowf"
overload pow with pow_ccmplx_ccmplx
fun pow_ccmplx_float (c1: ccmplx, c2: float):<> ccmplx
= "mac#atslib_pow_ccmplx_float" // macro!
overload pow with pow_ccmplx_float
(* ****** ****** *)
fun cprojf (c: ccmplx):<> float = "atslib_cprojf"
(* ****** ****** *)
(*
** complex numbers of double precision
*)
(* ****** ****** *)
abst@ype zcmplx_t0ype = $extype"ats_dcomplex_type"
typedef zcmplx = zcmplx_t0ype
symintr zcmplx_of
(* ****** ****** *)
fun fprint_zcmplx {m:file_mode}
(pf: file_mode_lte (m, w) | out: &FILE m, x: zcmplx):<!exnref> void
= "atslib_fprint_zcmplx"
overload fprint with fprint_zcmplx
fun print_zcmplx (z: zcmplx):<!exnref> void
and prerr_zcmplx (z: zcmplx):<!exnref> void
overload print with print_zcmplx
overload prerr with prerr_zcmplx
(* ****** ****** *)
val zcmplx_imag_unit : zcmplx
= "atslib_zcmplx_imag_unit" // imaginary unit
// end of [val]
(* ****** ****** *)
fun zcmplx_of_int (i: int):<> zcmplx
= "atslib_zcmplx_of_int"
overload zcmplx_of with zcmplx_of_int
fun zcmplx_of_double (d: double):<> zcmplx
= "atslib_zcmplx_of_double"
overload zcmplx_of with zcmplx_of_double
fun zcmplx_make_cart (d1: double, d2: double):<> zcmplx
= "atslib_zcmplx_make_cart"
fun zcmplx_make_polar (d1: double, d2: double):<> zcmplx
= "atslib_zcmplx_make_polar"
(* ****** ****** *)
fun creal (z: zcmplx):<> double = "atslib_creal"
fun zcmplx_real (z: zcmplx):<> double = "atslib_creal"
fun cimag (z: zcmplx):<> double = "atslib_cimag"
fun zcmplx_imag (z: zcmplx):<> double = "atslib_cimag"
(* ****** ****** *)
fun neg_zcmplx
(z: zcmplx):<> zcmplx = "atslib_neg_zcmplx"
overload ~ with neg_zcmplx
fun add_zcmplx_zcmplx (z1: zcmplx, z2: zcmplx):<> zcmplx
= "atslib_add_zcmplx_zcmplx"
overload + with add_zcmplx_zcmplx
fun sub_zcmplx_zcmplx (z1: zcmplx, z2: zcmplx):<> zcmplx
= "atslib_sub_zcmplx_zcmplx"
overload - with sub_zcmplx_zcmplx
fun mul_zcmplx_zcmplx (z1: zcmplx, z2: zcmplx):<> zcmplx
= "atslib_mul_zcmplx_zcmplx"
overload * with mul_zcmplx_zcmplx
fun div_zcmplx_zcmplx (z1: zcmplx, z2: zcmplx):<> zcmplx
= "atslib_div_zcmplx_zcmplx"
overload / with div_zcmplx_zcmplx
(* ****** ****** *)
fun eq_zcmplx_zcmplx (c1: zcmplx, c2: zcmplx):<> bool
= "atslib_eq_zcmplx_zcmplx"
overload = with eq_zcmplx_zcmplx
fun neq_zcmplx_zcmplx (c1: zcmplx, c2: zcmplx):<> bool
= "atslib_neq_zcmplx_zcmplx"
overload <> with neq_zcmplx_zcmplx
(* ****** ****** *)
fun cabs (z: zcmplx):<> double = "atslib_cabs"
fun abs_zcmplx (z: zcmplx):<> double = "atslib_cabs"
overload abs with abs_zcmplx
fun csqrt (z: zcmplx):<> zcmplx = "atslib_csqrt"
fun sqrt_zcmplx (z: zcmplx):<> zcmplx = "atslib_csqrt"
overload sqrt with sqrt_zcmplx
(* ****** ****** *)
fun carg (z: zcmplx):<> double = "atslib_carg"
fun arg_zcmplx (z: zcmplx):<> double = "atslib_carg"
fun conj (z: zcmplx):<> zcmplx = "atslib_conj"
fun conj_zcmplx (z: zcmplx):<> zcmplx = "atslib_conj"
(* ****** ****** *)
fun csin (z: zcmplx):<> zcmplx = "atslib_csin"
fun sin_zcmplx (z: zcmplx):<> zcmplx = "atslib_csin"
fun ccos (z: zcmplx):<> zcmplx = "atslib_ccos"
fun cos_zcmplx (z: zcmplx):<> zcmplx = "atslib_ccos"
fun ctan (z: zcmplx):<> zcmplx = "atslib_ctan"
fun tan_zcmplx (z: zcmplx):<> zcmplx = "atslib_ctan"
(* ****** ****** *)
fun casin (z: zcmplx):<> zcmplx = "atslib_casin"
fun asin_zcmplx (z: zcmplx):<> zcmplx = "atslib_casin"
fun cacos (z: zcmplx):<> zcmplx = "atslib_cacos"
fun acos_zcmplx (z: zcmplx):<> zcmplx = "atslib_cacos"
fun catan (z: zcmplx):<> zcmplx = "atslib_catan"
fun atan_zcmplx (z: zcmplx):<> zcmplx = "atslib_catan"
(* ****** ****** *)
fun csinh (z: zcmplx):<> zcmplx = "atslib_csinh"
fun sinh_zcmplx (z: zcmplx):<> zcmplx = "atslib_csinh"
fun ccosh (z: zcmplx):<> zcmplx = "atslib_ccosh"
fun cosh_zcmplx (z: zcmplx):<> zcmplx = "atslib_ccosh"
fun ctanh (z: zcmplx):<> zcmplx = "atslib_ctanh"
fun tanh_zcmplx (z: zcmplx):<> zcmplx = "atslib_ctanh"
(* ****** ****** *)
fun casinh (z: zcmplx):<> zcmplx = "atslib_casinh"
fun asinh_zcmplx (z: zcmplx):<> zcmplx = "atslib_casinh"
fun cacosh (z: zcmplx):<> zcmplx = "atslib_cacosh"
fun acosh_zcmplx (z: zcmplx):<> zcmplx = "atslib_cacosh"
fun catanh (z: zcmplx):<> zcmplx = "atslib_catanh"
fun atanh_zcmplx (z: zcmplx):<> zcmplx = "atslib_catanh"
(* ****** ****** *)
fun cexp (z: zcmplx):<> zcmplx = "atslib_cexp"
fun exp_zcmplx (z: zcmplx):<> zcmplx = "atslib_cexp"
fun clog (z: zcmplx):<> zcmplx = "atslib_clog"
fun log_zcmplx (z: zcmplx):<> zcmplx = "atslib_clog"
fun cpow (z1: zcmplx, z2: zcmplx):<> zcmplx
= "atslib_cpow"
fun pow_zcmplx_zcmplx (z1: zcmplx, z2: zcmplx):<> zcmplx
= "atslib_cpow"
overload pow with pow_zcmplx_zcmplx
fun pow_zcmplx_double (z1: zcmplx, z2: double):<> zcmplx
= "mac#atslib_pow_zcmplx_double" // macro!
overload pow with pow_zcmplx_double
(* ****** ****** *)
fun cproj (z: zcmplx):<> double = "atslib_cproj"
(* ****** ****** *)
(* end of [complex.sats] *)
|