@@ -77,11 +77,13 @@ public func exp(_ value: Complex<Double>) -> Complex<Double> {
77
77
return Complex < Double > ( real: exp * cos( value. imaginary) , imaginary: exp * sin( value. imaginary) )
78
78
}
79
79
80
+ #if !(os(Windows) || os(Android)) && (arch(i386) || arch(x86_64))
80
81
@_transparent
81
82
public func exp( _ value: Complex < Float80 > ) -> Complex < Float80 > {
82
83
let exp = Darwin . exp ( value. real)
83
84
return Complex < Float80 > ( real: exp * cos( value. imaginary) , imaginary: exp * sin( value. imaginary) )
84
85
}
86
+ #endif
85
87
86
88
//
87
89
// log(a + bi) = log(sqrt(a^2 + b^2)) + i * atan(b / a)
@@ -96,10 +98,12 @@ public func log(_ value: Complex<Double>) -> Complex<Double> {
96
98
return Complex < Double > ( real: log ( value. modulus) , imaginary: value. angle)
97
99
}
98
100
101
+ #if !(os(Windows) || os(Android)) && (arch(i386) || arch(x86_64))
99
102
@_transparent
100
103
public func log( _ value: Complex < Float80 > ) -> Complex < Float80 > {
101
104
return Complex < Float80 > ( real: log ( value. modulus) , imaginary: value. angle)
102
105
}
106
+ #endif
103
107
104
108
//
105
109
@@ -113,10 +117,12 @@ public func log10(_ value: Complex<Double>) -> Complex<Double> {
113
117
return log ( value) / log( 10.0 )
114
118
}
115
119
120
+ #if !(os(Windows) || os(Android)) && (arch(i386) || arch(x86_64))
116
121
@_transparent
117
122
public func log10( _ value: Complex < Float80 > ) -> Complex < Float80 > {
118
123
return log ( value) / log( 10.0 )
119
124
}
125
+ #endif
120
126
121
127
//
122
128
@@ -130,10 +136,12 @@ public func log2(_ value: Complex<Double>) -> Complex<Double> {
130
136
return log ( value) / log( 2.0 )
131
137
}
132
138
139
+ #if !(os(Windows) || os(Android)) && (arch(i386) || arch(x86_64))
133
140
@_transparent
134
141
public func log2( _ value: Complex < Float80 > ) -> Complex < Float80 > {
135
142
return log ( value) / log( 2.0 )
136
143
}
144
+ #endif
137
145
138
146
//
139
147
// sin(a + bi) = sin(a) * cosh(b) + i * cos(a) * sinh(b)
@@ -148,10 +156,12 @@ public func sin(_ value: Complex<Double>) -> Complex<Double> {
148
156
return Complex < Double > ( real: sin ( value. real) * cosh( value. imaginary) , imaginary: cos ( value. real) * sinh( value. imaginary) )
149
157
}
150
158
159
+ #if !(os(Windows) || os(Android)) && (arch(i386) || arch(x86_64))
151
160
@_transparent
152
161
public func sin( _ value: Complex < Float80 > ) -> Complex < Float80 > {
153
162
return Complex < Float80 > ( real: sin ( value. real) * cosh( value. imaginary) , imaginary: cos ( value. real) * sinh( value. imaginary) )
154
163
}
164
+ #endif
155
165
156
166
//
157
167
// asin(z) = -i * ln(iz + sqrt(1 - z^2))
@@ -176,6 +186,7 @@ public func asin(_ value: Complex<Double>) -> Complex<Double> {
176
186
//swiftlint:enable identifier_name
177
187
}
178
188
189
+ #if !(os(Windows) || os(Android)) && (arch(i386) || arch(x86_64))
179
190
@_transparent
180
191
public func asin( _ value: Complex < Float80 > ) -> Complex < Float80 > {
181
192
//swiftlint:disable identifier_name
@@ -185,6 +196,7 @@ public func asin(_ value: Complex<Float80>) -> Complex<Float80> {
185
196
return - . i * log( iz + root)
186
197
//swiftlint:enable identifier_name
187
198
}
199
+ #endif
188
200
189
201
//
190
202
// sinh(z) = -i * sin(iz)
@@ -199,10 +211,12 @@ public func sinh(_ value: Complex<Double>) -> Complex<Double> {
199
211
return - . i * sin( . i * value)
200
212
}
201
213
214
+ #if !(os(Windows) || os(Android)) && (arch(i386) || arch(x86_64))
202
215
@_transparent
203
216
public func sinh( _ value: Complex < Float80 > ) -> Complex < Float80 > {
204
217
return - . i * sin( . i * value)
205
218
}
219
+ #endif
206
220
207
221
//
208
222
// cos(a + bi) = cos(a) * cosh(b) - i * sin(a) * sinh(b)
@@ -217,10 +231,12 @@ public func cos(_ value: Complex<Double>) -> Complex<Double> {
217
231
return Complex < Double > ( real: cos ( value. real) * cosh( value. imaginary) , imaginary: - sin( value. real) * sinh( value. imaginary) )
218
232
}
219
233
234
+ #if !(os(Windows) || os(Android)) && (arch(i386) || arch(x86_64))
220
235
@_transparent
221
236
public func cos( _ value: Complex < Float80 > ) -> Complex < Float80 > {
222
237
return Complex < Float80 > ( real: cos ( value. real) * cosh( value. imaginary) , imaginary: - sin( value. real) * sinh( value. imaginary) )
223
238
}
239
+ #endif
224
240
225
241
//
226
242
// acos(z) = -i * ln(z + sqrt(z^2 - 1))
@@ -237,11 +253,13 @@ public func acos(_ value: Complex<Double>) -> Complex<Double> {
237
253
return - . i * log( value + root)
238
254
}
239
255
256
+ #if !(os(Windows) || os(Android)) && (arch(i386) || arch(x86_64))
240
257
@_transparent
241
258
public func acos( _ value: Complex < Float80 > ) -> Complex < Float80 > {
242
259
let root = sqrt ( ( value * value) - 1.0 )
243
260
return - . i * log( value + root)
244
261
}
262
+ #endif
245
263
246
264
//
247
265
// cosh(z) = cos(iz)
@@ -256,10 +274,12 @@ public func cosh(_ value: Complex<Double>) -> Complex<Double> {
256
274
return cos ( . i * value)
257
275
}
258
276
277
+ #if !(os(Windows) || os(Android)) && (arch(i386) || arch(x86_64))
259
278
@_transparent
260
279
public func cosh( _ value: Complex < Float80 > ) -> Complex < Float80 > {
261
280
return cos ( . i * value)
262
281
}
282
+ #endif
263
283
264
284
//
265
285
@@ -273,10 +293,12 @@ public func tan(_ value: Complex<Double>) -> Complex<Double> {
273
293
return sin ( value) / cos( value)
274
294
}
275
295
296
+ #if !(os(Windows) || os(Android)) && (arch(i386) || arch(x86_64))
276
297
@_transparent
277
298
public func tan( _ value: Complex < Float80 > ) -> Complex < Float80 > {
278
299
return sin ( value) / cos( value)
279
300
}
301
+ #endif
280
302
281
303
//
282
304
// atan(z) = (i / 2) * ln((i + z) / (i - z))
@@ -293,11 +315,13 @@ public func atan(_ value: Complex<Double>) -> Complex<Double> {
293
315
return . i * 0.5 * log( quotient)
294
316
}
295
317
318
+ #if !(os(Windows) || os(Android)) && (arch(i386) || arch(x86_64))
296
319
@_transparent
297
320
public func atan( _ value: Complex < Float80 > ) -> Complex < Float80 > {
298
321
let quotient = ( . i + value) / ( . i - value)
299
322
return . i * 0.5 * log( quotient)
300
323
}
324
+ #endif
301
325
302
326
//
303
327
// tanh(z) = -i * tan(iz)
@@ -312,9 +336,11 @@ public func tanh(_ value: Complex<Double>) -> Complex<Double> {
312
336
return - . i * tan( . i * value)
313
337
}
314
338
339
+ #if !(os(Windows) || os(Android)) && (arch(i386) || arch(x86_64))
315
340
@_transparent
316
341
public func tanh( _ value: Complex < Float80 > ) -> Complex < Float80 > {
317
342
return - . i * tan( . i * value)
318
343
}
344
+ #endif
319
345
320
346
//
0 commit comments