OXIESEC PANEL
- Current Dir:
/
/
opt
/
golang
/
1.22.0
/
src
/
math
Server IP: 191.96.63.230
Upload:
Create Dir:
Name
Size
Modified
Perms
📁
..
-
02/02/2024 06:09:55 PM
rwxr-xr-x
📄
abs.go
366 bytes
02/02/2024 06:09:55 PM
rw-r--r--
📄
acos_s390x.s
3.73 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
acosh.go
1.71 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
acosh_s390x.s
4.32 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
all_test.go
86.77 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
arith_s390x.go
3.73 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
arith_s390x_test.go
10.78 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
asin.go
1.09 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
asin_s390x.s
4.16 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
asinh.go
1.92 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
asinh_s390x.s
5.74 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
atan.go
3.03 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
atan2.go
1.52 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
atan2_s390x.s
6.93 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
atan_s390x.s
3.69 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
atanh.go
1.99 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
atanh_s390x.s
5.06 KB
02/02/2024 06:09:55 PM
rw-r--r--
📁
big
-
02/02/2024 06:09:55 PM
rwxr-xr-x
📁
bits
-
02/02/2024 06:09:55 PM
rwxr-xr-x
📄
bits.go
1.87 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
cbrt.go
2.31 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
cbrt_s390x.s
4.89 KB
02/02/2024 06:09:55 PM
rw-r--r--
📁
cmplx
-
02/02/2024 06:09:55 PM
rwxr-xr-x
📄
const.go
2.76 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
const_test.go
1.29 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
copysign.go
396 bytes
02/02/2024 06:09:55 PM
rw-r--r--
📄
cosh_s390x.s
5.59 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
dim.go
1.87 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
dim_amd64.s
1.92 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
dim_arm64.s
963 bytes
02/02/2024 06:09:55 PM
rw-r--r--
📄
dim_asm.go
344 bytes
02/02/2024 06:09:55 PM
rw-r--r--
📄
dim_noasm.go
410 bytes
02/02/2024 06:09:55 PM
rw-r--r--
📄
dim_riscv64.s
1.16 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
dim_s390x.s
1.97 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
erf.go
11.51 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
erf_s390x.s
8.5 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
erfc_s390x.s
14.4 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
erfinv.go
3.37 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
example_test.go
3.75 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
exp.go
5.38 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
exp2_asm.go
252 bytes
02/02/2024 06:09:55 PM
rw-r--r--
📄
exp2_noasm.go
284 bytes
02/02/2024 06:09:55 PM
rw-r--r--
📄
exp_amd64.go
261 bytes
02/02/2024 06:09:55 PM
rw-r--r--
📄
exp_amd64.s
4.24 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
exp_arm64.s
5.36 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
exp_asm.go
268 bytes
02/02/2024 06:09:55 PM
rw-r--r--
📄
exp_noasm.go
302 bytes
02/02/2024 06:09:55 PM
rw-r--r--
📄
exp_s390x.s
4.65 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
expm1.go
7.91 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
expm1_s390x.s
5.29 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
export_s390x_test.go
732 bytes
02/02/2024 06:09:55 PM
rw-r--r--
📄
export_test.go
357 bytes
02/02/2024 06:09:55 PM
rw-r--r--
📄
floor.go
3.29 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
floor_386.s
1.47 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
floor_amd64.s
2 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
floor_arm64.s
573 bytes
02/02/2024 06:09:55 PM
rw-r--r--
📄
floor_asm.go
431 bytes
02/02/2024 06:09:55 PM
rw-r--r--
📄
floor_noasm.go
531 bytes
02/02/2024 06:09:55 PM
rw-r--r--
📄
floor_ppc64x.s
499 bytes
02/02/2024 06:09:55 PM
rw-r--r--
📄
floor_s390x.s
579 bytes
02/02/2024 06:09:55 PM
rw-r--r--
📄
floor_wasm.s
459 bytes
02/02/2024 06:09:55 PM
rw-r--r--
📄
fma.go
4.61 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
frexp.go
929 bytes
02/02/2024 06:09:55 PM
rw-r--r--
📄
gamma.go
5.53 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
huge_test.go
2.91 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
hypot.go
850 bytes
02/02/2024 06:09:55 PM
rw-r--r--
📄
hypot_386.s
1.81 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
hypot_amd64.s
1.05 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
hypot_asm.go
264 bytes
02/02/2024 06:09:55 PM
rw-r--r--
📄
hypot_noasm.go
297 bytes
02/02/2024 06:09:55 PM
rw-r--r--
📄
j0.go
13.6 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
j1.go
13.3 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
jn.go
7.18 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
ldexp.go
1.05 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
lgamma.go
11.03 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
log.go
3.86 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
log10.go
873 bytes
02/02/2024 06:09:55 PM
rw-r--r--
📄
log10_s390x.s
4.73 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
log1p.go
6.34 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
log1p_s390x.s
5.15 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
log_amd64.s
3.66 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
log_asm.go
259 bytes
02/02/2024 06:09:55 PM
rw-r--r--
📄
log_s390x.s
4.31 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
log_stub.go
292 bytes
02/02/2024 06:09:55 PM
rw-r--r--
📄
logb.go
1021 bytes
02/02/2024 06:09:55 PM
rw-r--r--
📄
mod.go
903 bytes
02/02/2024 06:09:55 PM
rw-r--r--
📄
modf.go
913 bytes
02/02/2024 06:09:55 PM
rw-r--r--
📄
modf_arm64.s
447 bytes
02/02/2024 06:09:55 PM
rw-r--r--
📄
modf_asm.go
292 bytes
02/02/2024 06:09:55 PM
rw-r--r--
📄
modf_noasm.go
326 bytes
02/02/2024 06:09:55 PM
rw-r--r--
📄
modf_ppc64x.s
416 bytes
02/02/2024 06:09:55 PM
rw-r--r--
📄
nextafter.go
1.21 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
pow.go
3.65 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
pow10.go
1.24 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
pow_s390x.s
16.27 KB
02/02/2024 06:09:55 PM
rw-r--r--
📁
rand
-
02/02/2024 06:09:55 PM
rwxr-xr-x
📄
remainder.go
2.04 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
signbit.go
302 bytes
02/02/2024 06:09:55 PM
rw-r--r--
📄
sin.go
6.35 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
sin_s390x.s
8.57 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
sincos.go
1.76 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
sinh.go
1.69 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
sinh_s390x.s
5.98 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
sqrt.go
4.75 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
stubs.go
2.57 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
stubs_s390x.s
12.38 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
tan.go
3.68 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
tan_s390x.s
2.72 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
tanh.go
2.66 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
tanh_s390x.s
4.57 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
trig_reduce.go
3.34 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
unsafe.go
1.27 KB
02/02/2024 06:09:55 PM
rw-r--r--
Editing: trig_reduce.go
Close
// Copyright 2018 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package math import ( "math/bits" ) // reduceThreshold is the maximum value of x where the reduction using Pi/4 // in 3 float64 parts still gives accurate results. This threshold // is set by y*C being representable as a float64 without error // where y is given by y = floor(x * (4 / Pi)) and C is the leading partial // terms of 4/Pi. Since the leading terms (PI4A and PI4B in sin.go) have 30 // and 32 trailing zero bits, y should have less than 30 significant bits. // // y < 1<<30 -> floor(x*4/Pi) < 1<<30 -> x < (1<<30 - 1) * Pi/4 // // So, conservatively we can take x < 1<<29. // Above this threshold Payne-Hanek range reduction must be used. const reduceThreshold = 1 << 29 // trigReduce implements Payne-Hanek range reduction by Pi/4 // for x > 0. It returns the integer part mod 8 (j) and // the fractional part (z) of x / (Pi/4). // The implementation is based on: // "ARGUMENT REDUCTION FOR HUGE ARGUMENTS: Good to the Last Bit" // K. C. Ng et al, March 24, 1992 // The simulated multi-precision calculation of x*B uses 64-bit integer arithmetic. func trigReduce(x float64) (j uint64, z float64) { const PI4 = Pi / 4 if x < PI4 { return 0, x } // Extract out the integer and exponent such that, // x = ix * 2 ** exp. ix := Float64bits(x) exp := int(ix>>shift&mask) - bias - shift ix &^= mask << shift ix |= 1 << shift // Use the exponent to extract the 3 appropriate uint64 digits from mPi4, // B ~ (z0, z1, z2), such that the product leading digit has the exponent -61. // Note, exp >= -53 since x >= PI4 and exp < 971 for maximum float64. digit, bitshift := uint(exp+61)/64, uint(exp+61)%64 z0 := (mPi4[digit] << bitshift) | (mPi4[digit+1] >> (64 - bitshift)) z1 := (mPi4[digit+1] << bitshift) | (mPi4[digit+2] >> (64 - bitshift)) z2 := (mPi4[digit+2] << bitshift) | (mPi4[digit+3] >> (64 - bitshift)) // Multiply mantissa by the digits and extract the upper two digits (hi, lo). z2hi, _ := bits.Mul64(z2, ix) z1hi, z1lo := bits.Mul64(z1, ix) z0lo := z0 * ix lo, c := bits.Add64(z1lo, z2hi, 0) hi, _ := bits.Add64(z0lo, z1hi, c) // The top 3 bits are j. j = hi >> 61 // Extract the fraction and find its magnitude. hi = hi<<3 | lo>>61 lz := uint(bits.LeadingZeros64(hi)) e := uint64(bias - (lz + 1)) // Clear implicit mantissa bit and shift into place. hi = (hi << (lz + 1)) | (lo >> (64 - (lz + 1))) hi >>= 64 - shift // Include the exponent and convert to a float. hi |= e << shift z = Float64frombits(hi) // Map zeros to origin. if j&1 == 1 { j++ j &= 7 z-- } // Multiply the fractional part by pi/4. return j, z * PI4 } // mPi4 is the binary digits of 4/pi as a uint64 array, // that is, 4/pi = Sum mPi4[i]*2^(-64*i) // 19 64-bit digits and the leading one bit give 1217 bits // of precision to handle the largest possible float64 exponent. var mPi4 = [...]uint64{ 0x0000000000000001, 0x45f306dc9c882a53, 0xf84eafa3ea69bb81, 0xb6c52b3278872083, 0xfca2c757bd778ac3, 0x6e48dc74849ba5c0, 0x0c925dd413a32439, 0xfc3bd63962534e7d, 0xd1046bea5d768909, 0xd338e04d68befc82, 0x7323ac7306a673e9, 0x3908bf177bf25076, 0x3ff12fffbc0b301f, 0xde5e2316b414da3e, 0xda6cfd9e4f96136e, 0x9e8c7ecd3cbfd45a, 0xea4f758fd7cbe2f6, 0x7a0e73ef14a525d4, 0xd7f6bf623f1aba10, 0xac06608df8f6d757, }