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
|
;; -*-theme-d-*-
;; Copyright (C) 2018, 2021 Tommi Höynälänmaa
;; Distributed under GNU Lesser General Public License version 3,
;; see file doc/LGPL-3.
(define-interface (standard-library extra-math)
(import (standard-library core)
(standard-library math))
(declare-simple-method fmod (<real> <real>) <real> pure)
(declare-simple-method r-remainder (<real> <real>) <real> pure)
(declare-simple-method fma (<real> <real> <real>) <real> pure)
(declare-simple-method fast-fma? () <boolean> pure)
(declare-simple-method fmin (<real> <real>) <real> pure)
(declare-simple-method fmax (<real> <real>) <real> pure)
(declare-simple-method fdim (<real> <real>) <real> pure)
(declare-simple-method r-exp2 (<real>) <real> pure)
(declare-simple-method r-expm1 (<real>) <real> pure)
(declare-simple-method r-log2 (<real>) <real> pure)
(declare-simple-method r-log1p (<real>) <real> pure)
(declare-simple-method logb (<real>) <real> pure)
(declare-simple-method ilogb (<real>) <integer> pure)
(declare-simple-method ilogb0 () <integer> pure)
(declare-simple-method ilogbnan () <integer> pure)
(declare-simple-method r-cbrt (<real>) <real> pure)
(declare-simple-method r-hypot (<real> <real>) <real> pure)
(declare-simple-method r-erf (<real>) <real> pure)
(declare-simple-method r-erfc (<real>) <real> pure)
(declare-simple-method r-lgamma (<real>) <real> pure)
(declare-simple-method r-tgamma (<real>) <real> pure)
(declare-simple-method r-nearbyint (<real>) <real> pure)
(declare-simple-method rint (<real>) <real> pure)
(declare-simple-method frexp (<real>) (:pair <real> <integer>) pure)
(declare-simple-method ldexp (<real> <integer>) <real> pure)
(declare-simple-method modf (<real>) (:pair <real> <real>) pure)
(declare-simple-method r-nextafter (<real> <real>) <real> pure)
(declare-simple-method r-copysign (<real> <real>) <real> pure)
(declare-simple-method fpclassify (<real>) <integer> pure)
(declare-simple-method fpclassify-nan () <integer> pure)
(declare-simple-method fpclassify-infinite () <integer> pure)
(declare-simple-method fpclassify-zero () <integer> pure)
(declare-simple-method fpclassify-subnormal () <integer> pure)
(declare-simple-method fpclassify-normal () <integer> pure)
(declare-simple-method r-isnormal? (<real>) <boolean> pure)
(declare-simple-method r-signbit (<real>) <integer> pure)
(declare-simple-method r-log2-neg (<real>) <complex> pure)
(declare-simple-method i-cbrt (<integer>) (:union <real> <integer>) pure)
(declare-simple-method rat-cbrt (<rational>)
(:union <real> <rational> <integer>) pure)
(declare-simple-virtual-method exp2 (<number>) <number> pure)
(declare-simple-virtual-method exp2 (<real-number>) <real-number> pure)
(declare-simple-virtual-method exp2 (<complex>) <complex> pure)
(declare-simple-virtual-method exp2 (<real>) <real> pure)
(declare-simple-virtual-method exp2 (<rational>) <real-number> pure)
(declare-simple-virtual-method exp2 (<integer>) <rational-number> pure)
(declare-simple-virtual-method expm1 (<number>) <number> pure)
(declare-simple-virtual-method expm1 (<real-number>) <real-number> pure)
(declare-simple-virtual-method expm1 (<complex>) <complex> pure)
(declare-simple-virtual-method expm1 (<real>) <real> pure)
(declare-simple-virtual-method expm1 (<rational>) (:union <real> <integer>)
pure)
(declare-simple-virtual-method expm1 (<integer>) (:union <real> <integer>)
pure)
(declare-simple-virtual-method log2 (<number>) <number> pure)
(declare-simple-virtual-method log2 (<complex>) <complex> pure)
(declare-simple-virtual-method log2 (<real>) (:union <real> <complex>) pure)
(declare-simple-virtual-method log2 (<rational>)
(:union <integer> <real> <complex>) pure)
(declare-simple-virtual-method log2 (<integer>)
(:union <integer> <real> <complex>)
pure)
(declare-simple-virtual-method log1p (<number>) <number> pure)
(declare-simple-virtual-method log1p (<complex>) <complex> pure)
(declare-simple-virtual-method log1p (<real>) (:union <complex> <real>)
pure)
(declare-simple-virtual-method log1p (<rational>)
(:union <complex> <real> <integer>)
pure)
(declare-simple-virtual-method log1p (<integer>)
(:union <complex> <real> <integer>)
pure)
(declare-simple-virtual-method cbrt (<number>) <number> pure)
(declare-simple-virtual-method cbrt (<real-number>) <real-number> pure)
(declare-simple-virtual-method cbrt (<complex>) <complex> pure)
(declare-simple-virtual-method cbrt (<real>) <real> pure)
(declare-simple-virtual-method cbrt (<integer>) (:union <real> <integer>)
pure)
(declare-simple-virtual-method cbrt (<rational>)
(:union <real> <rational> <integer>)
pure)
(declare-simple-virtual-method hypot (<real-number> <real-number>)
<real-number> pure)
(declare-simple-virtual-method hypot (<real> <real>) <real> pure)
(declare-simple-virtual-method hypot (<real> <rational>) <real> pure)
(declare-simple-virtual-method hypot (<real> <integer>) <real> pure)
(declare-simple-virtual-method hypot (<rational> <real>) <real> pure)
(declare-simple-virtual-method hypot (<rational> <rational>) <real-number>
pure)
(declare-simple-virtual-method hypot (<rational> <integer>) <real-number>
pure)
(declare-simple-virtual-method hypot (<integer> <real>) <real> pure)
(declare-simple-virtual-method hypot (<integer> <rational>) <real-number>
pure)
(declare-simple-virtual-method hypot (<integer> <integer>)
(:union <real> <integer>) pure)
(declare-simple-virtual-method erf (<real-number>) (:union <real> <integer>)
pure)
(declare-simple-virtual-method erf (<real>) <real> pure)
(declare-simple-virtual-method erf (<rational>) (:union <real> <integer>)
pure)
(declare-simple-virtual-method erf (<integer>) (:union <real> <integer>)
pure)
(declare-simple-virtual-method erfc (<real-number>) (:union <real> <integer>)
pure)
(declare-simple-virtual-method erfc (<real>) <real> pure)
(declare-simple-virtual-method erfc (<rational>) (:union <real> <integer>)
pure)
(declare-simple-virtual-method erfc (<integer>) (:union <real> <integer>)
pure)
;; We may later change the gamma function result types if we
;; implement computation of exact values for them.
(declare-simple-virtual-method lgamma (<real-number>)
(:union <real> <integer>) pure)
(declare-simple-virtual-method lgamma (<real>) <real> pure)
(declare-simple-virtual-method lgamma (<rational>) (:union <real> <integer>)
pure)
(declare-simple-virtual-method lgamma (<integer>) (:union <real> <integer>)
pure)
(declare-simple-virtual-method tgamma (<real-number>)
(:union <real> <integer>) pure)
(declare-simple-virtual-method tgamma (<real>) <real> pure)
(declare-simple-virtual-method tgamma (<rational>) (:union <real> <integer>)
pure)
(declare-simple-virtual-method tgamma (<integer>) (:union <real> <integer>)
pure))
|