Skip to content
This repository has been archived by the owner on May 18, 2024. It is now read-only.

Commit

Permalink
support ./src/math/*.c
Browse files Browse the repository at this point in the history
  • Loading branch information
xushiwei committed Jul 23, 2022
1 parent 8bcf009 commit 202df94
Show file tree
Hide file tree
Showing 109 changed files with 3,914 additions and 2,270 deletions.
56 changes: 28 additions & 28 deletions acos.c.i.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,24 @@ package libc

import unsafe "unsafe"

var pio2_hi_cgo18_acos float64 = 1.5707963267948966
var pio2_lo_cgo19_acos float64 = 6.123233995736766e-17
var pS0_cgo20_acos float64 = 0.16666666666666666
var pS1_cgo21_acos float64 = -0.32556581862240092
var pS2_cgo22_acos float64 = 0.20121253213486293
var pS3_cgo23_acos float64 = -0.040055534500679411
var pS4_cgo24_acos float64 = 7.9153499428981453e-4
var pS5_cgo25_acos float64 = 3.4793310759602117e-5
var qS1_cgo26_acos float64 = -2.4033949117344142
var qS2_cgo27_acos float64 = 2.0209457602335057
var qS3_cgo28_acos float64 = -0.68828397160545329
var qS4_cgo29_acos float64 = 0.077038150555901935
var pio2_hi_cgos__acos float64 = 1.5707963267948966
var pio2_lo_cgos__acos float64 = 6.123233995736766e-17
var pS0_cgos__acos float64 = 0.16666666666666666
var pS1_cgos__acos float64 = -0.32556581862240092
var pS2_cgos__acos float64 = 0.20121253213486293
var pS3_cgos__acos float64 = -0.040055534500679411
var pS4_cgos__acos float64 = 7.9153499428981453e-4
var pS5_cgos__acos float64 = 3.4793310759602117e-5
var qS1_cgos__acos float64 = -2.4033949117344142
var qS2_cgos__acos float64 = 2.0209457602335057
var qS3_cgos__acos float64 = -0.68828397160545329
var qS4_cgos__acos float64 = 0.077038150555901935

func R_cgo30_acos(z float64) float64 {
func R_cgos__acos(z float64) float64 {
var p float64
var q float64
p = z * (pS0_cgo20_acos + z*(pS1_cgo21_acos+z*(pS2_cgo22_acos+z*(pS3_cgo23_acos+z*(pS4_cgo24_acos+z*pS5_cgo25_acos)))))
q = 1 + z*(qS1_cgo26_acos+z*(qS2_cgo27_acos+z*(qS3_cgo28_acos+z*qS4_cgo29_acos)))
p = z * (pS0_cgos__acos + z*(pS1_cgos__acos+z*(pS2_cgos__acos+z*(pS3_cgos__acos+z*(pS4_cgos__acos+z*pS5_cgos__acos)))))
q = 1 + z*(qS1_cgos__acos+z*(qS2_cgos__acos+z*(qS3_cgos__acos+z*qS4_cgos__acos)))
return p / q
}
func Acos(x float64) float64 {
Expand All @@ -31,7 +31,7 @@ func Acos(x float64) float64 {
var hx uint32
var ix uint32
for {
hx = uint32(*(*uint64)(unsafe.Pointer(&_cgoz_31_acos{x})) >> int32(32))
hx = uint32(*(*uint64)(unsafe.Pointer(&_cgoz_18_acos{x})) >> int32(32))
if true {
break
}
Expand All @@ -40,54 +40,54 @@ func Acos(x float64) float64 {
if ix >= uint32(1072693248) {
var lx uint32
for {
lx = uint32(*(*uint64)(unsafe.Pointer(&_cgoz_32_acos{x})))
lx = uint32(*(*uint64)(unsafe.Pointer(&_cgoz_19_acos{x})))
if true {
break
}
}
if ix-uint32(1072693248)|lx == uint32(0) {
if hx>>int32(31) != 0 {
return float64(int32(2))*pio2_hi_cgo18_acos + float64(7.52316385e-37)
return float64(int32(2))*pio2_hi_cgos__acos + float64(7.52316385e-37)
}
return float64(int32(0))
}
return float64(int32(0)) / (x - x)
}
if ix < uint32(1071644672) {
if ix <= uint32(1012924416) {
return pio2_hi_cgo18_acos + float64(7.52316385e-37)
return pio2_hi_cgos__acos + float64(7.52316385e-37)
}
return pio2_hi_cgo18_acos - (x - (pio2_lo_cgo19_acos - x*R_cgo30_acos(x*x)))
return pio2_hi_cgos__acos - (x - (pio2_lo_cgos__acos - x*R_cgos__acos(x*x)))
}
if hx>>int32(31) != 0 {
z = (1 + x) * 0.5
s = Sqrt(z)
w = R_cgo30_acos(z)*s - pio2_lo_cgo19_acos
return float64(int32(2)) * (pio2_hi_cgo18_acos - (s + w))
w = R_cgos__acos(z)*s - pio2_lo_cgos__acos
return float64(int32(2)) * (pio2_hi_cgos__acos - (s + w))
}
z = (1 - x) * 0.5
s = Sqrt(z)
df = s
for {
df = *(*float64)(unsafe.Pointer(&_cgoz_33_acos{uint64(*(*uint64)(unsafe.Pointer(&_cgoz_34_acos{df}))>>int32(32))<<int32(32) | uint64(0)}))
df = *(*float64)(unsafe.Pointer(&_cgoz_20_acos{uint64(*(*uint64)(unsafe.Pointer(&_cgoz_21_acos{df}))>>int32(32))<<int32(32) | uint64(0)}))
if true {
break
}
}
c = (z - df*df) / (s + df)
w = R_cgo30_acos(z)*s + c
w = R_cgos__acos(z)*s + c
return float64(int32(2)) * (df + w)
}

type _cgoz_31_acos struct {
type _cgoz_18_acos struct {
_f float64
}
type _cgoz_32_acos struct {
type _cgoz_19_acos struct {
_f float64
}
type _cgoz_33_acos struct {
type _cgoz_20_acos struct {
_i uint64
}
type _cgoz_34_acos struct {
type _cgoz_21_acos struct {
_f float64
}
42 changes: 21 additions & 21 deletions acosf.c.i.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,18 @@ package libc

import unsafe "unsafe"

var pio2_hi_cgo18_acosf float32 = float32(1.5707962513)
var pio2_lo_cgo19_acosf float32 = float32(7.5497894159e-8)
var pS0_cgo20_acosf float32 = float32(0.16666586696999999)
var pS1_cgo21_acosf float32 = float32(-0.042743422091000002)
var pS2_cgo22_acosf float32 = float32(-0.0086563630029999998)
var qS1_cgo23_acosf float32 = float32(-0.7066296339)
var pio2_hi_cgos__acosf float32 = float32(1.5707962513)
var pio2_lo_cgos__acosf float32 = float32(7.5497894159e-8)
var pS0_cgos__acosf float32 = float32(0.16666586696999999)
var pS1_cgos__acosf float32 = float32(-0.042743422091000002)
var pS2_cgos__acosf float32 = float32(-0.0086563630029999998)
var qS1_cgos__acosf float32 = float32(-0.7066296339)

func R_cgo24_acosf(z float32) float32 {
func R_cgos__acosf(z float32) float32 {
var p float32
var q float32
p = z * (pS0_cgo20_acosf + z*(pS1_cgo21_acosf+z*pS2_cgo22_acosf))
q = 1 + z*qS1_cgo23_acosf
p = z * (pS0_cgos__acosf + z*(pS1_cgos__acosf+z*pS2_cgos__acosf))
q = 1 + z*qS1_cgos__acosf
return p / q
}
func Acosf(x float32) float32 {
Expand All @@ -25,7 +25,7 @@ func Acosf(x float32) float32 {
var hx uint32
var ix uint32
for {
hx = *(*uint32)(unsafe.Pointer(&_cgoz_25_acosf{x}))
hx = *(*uint32)(unsafe.Pointer(&_cgoz_18_acosf{x}))
if true {
break
}
Expand All @@ -34,49 +34,49 @@ func Acosf(x float32) float32 {
if ix >= uint32(1065353216) {
if ix == uint32(1065353216) {
if hx>>int32(31) != 0 {
return float32(int32(2))*pio2_hi_cgo18_acosf + 7.52316385e-37
return float32(int32(2))*pio2_hi_cgos__acosf + 7.52316385e-37
}
return float32(int32(0))
}
return float32(int32(0)) / (x - x)
}
if ix < uint32(1056964608) {
if ix <= uint32(847249408) {
return pio2_hi_cgo18_acosf + 7.52316385e-37
return pio2_hi_cgos__acosf + 7.52316385e-37
}
return pio2_hi_cgo18_acosf - (x - (pio2_lo_cgo19_acosf - x*R_cgo24_acosf(x*x)))
return pio2_hi_cgos__acosf - (x - (pio2_lo_cgos__acosf - x*R_cgos__acosf(x*x)))
}
if hx>>int32(31) != 0 {
z = (float32(int32(1)) + x) * 0.5
s = Sqrtf(z)
w = R_cgo24_acosf(z)*s - pio2_lo_cgo19_acosf
return float32(int32(2)) * (pio2_hi_cgo18_acosf - (s + w))
w = R_cgos__acosf(z)*s - pio2_lo_cgos__acosf
return float32(int32(2)) * (pio2_hi_cgos__acosf - (s + w))
}
z = (float32(int32(1)) - x) * 0.5
s = Sqrtf(z)
for {
hx = *(*uint32)(unsafe.Pointer(&_cgoz_26_acosf{s}))
hx = *(*uint32)(unsafe.Pointer(&_cgoz_19_acosf{s}))
if true {
break
}
}
for {
df = *(*float32)(unsafe.Pointer(&_cgoz_27_acosf{hx & uint32(4294963200)}))
df = *(*float32)(unsafe.Pointer(&_cgoz_20_acosf{hx & uint32(4294963200)}))
if true {
break
}
}
c = (z - df*df) / (s + df)
w = R_cgo24_acosf(z)*s + c
w = R_cgos__acosf(z)*s + c
return float32(int32(2)) * (df + w)
}

type _cgoz_25_acosf struct {
type _cgoz_18_acosf struct {
_f float32
}
type _cgoz_26_acosf struct {
type _cgoz_19_acosf struct {
_f float32
}
type _cgoz_27_acosf struct {
type _cgoz_20_acosf struct {
_i uint32
}
54 changes: 27 additions & 27 deletions asin.c.i.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,24 @@ package libc

import unsafe "unsafe"

var pio2_hi_cgo18_asin float64 = 1.5707963267948966
var pio2_lo_cgo19_asin float64 = 6.123233995736766e-17
var pS0_cgo20_asin float64 = 0.16666666666666666
var pS1_cgo21_asin float64 = -0.32556581862240092
var pS2_cgo22_asin float64 = 0.20121253213486293
var pS3_cgo23_asin float64 = -0.040055534500679411
var pS4_cgo24_asin float64 = 7.9153499428981453e-4
var pS5_cgo25_asin float64 = 3.4793310759602117e-5
var qS1_cgo26_asin float64 = -2.4033949117344142
var qS2_cgo27_asin float64 = 2.0209457602335057
var qS3_cgo28_asin float64 = -0.68828397160545329
var qS4_cgo29_asin float64 = 0.077038150555901935
var pio2_hi_cgos__asin float64 = 1.5707963267948966
var pio2_lo_cgos__asin float64 = 6.123233995736766e-17
var pS0_cgos__asin float64 = 0.16666666666666666
var pS1_cgos__asin float64 = -0.32556581862240092
var pS2_cgos__asin float64 = 0.20121253213486293
var pS3_cgos__asin float64 = -0.040055534500679411
var pS4_cgos__asin float64 = 7.9153499428981453e-4
var pS5_cgos__asin float64 = 3.4793310759602117e-5
var qS1_cgos__asin float64 = -2.4033949117344142
var qS2_cgos__asin float64 = 2.0209457602335057
var qS3_cgos__asin float64 = -0.68828397160545329
var qS4_cgos__asin float64 = 0.077038150555901935

func R_cgo30_asin(z float64) float64 {
func R_cgos__asin(z float64) float64 {
var p float64
var q float64
p = z * (pS0_cgo20_asin + z*(pS1_cgo21_asin+z*(pS2_cgo22_asin+z*(pS3_cgo23_asin+z*(pS4_cgo24_asin+z*pS5_cgo25_asin)))))
q = 1 + z*(qS1_cgo26_asin+z*(qS2_cgo27_asin+z*(qS3_cgo28_asin+z*qS4_cgo29_asin)))
p = z * (pS0_cgos__asin + z*(pS1_cgos__asin+z*(pS2_cgos__asin+z*(pS3_cgos__asin+z*(pS4_cgos__asin+z*pS5_cgos__asin)))))
q = 1 + z*(qS1_cgos__asin+z*(qS2_cgos__asin+z*(qS3_cgos__asin+z*qS4_cgos__asin)))
return p / q
}
func Asin(x float64) float64 {
Expand All @@ -29,7 +29,7 @@ func Asin(x float64) float64 {
var hx uint32
var ix uint32
for {
hx = uint32(*(*uint64)(unsafe.Pointer(&_cgoz_31_asin{x})) >> int32(32))
hx = uint32(*(*uint64)(unsafe.Pointer(&_cgoz_18_asin{x})) >> int32(32))
if true {
break
}
Expand All @@ -38,55 +38,55 @@ func Asin(x float64) float64 {
if ix >= uint32(1072693248) {
var lx uint32
for {
lx = uint32(*(*uint64)(unsafe.Pointer(&_cgoz_32_asin{x})))
lx = uint32(*(*uint64)(unsafe.Pointer(&_cgoz_19_asin{x})))
if true {
break
}
}
if ix-uint32(1072693248)|lx == uint32(0) {
return x*pio2_hi_cgo18_asin + float64(7.52316385e-37)
return x*pio2_hi_cgos__asin + float64(7.52316385e-37)
}
return float64(int32(0)) / (x - x)
}
if ix < uint32(1071644672) {
if ix < uint32(1045430272) && ix >= uint32(1048576) {
return x
}
return x + x*R_cgo30_asin(x*x)
return x + x*R_cgos__asin(x*x)
}
z = (float64(int32(1)) - Fabs(x)) * 0.5
s = Sqrt(z)
r = R_cgo30_asin(z)
r = R_cgos__asin(z)
if ix >= uint32(1072640819) {
x = pio2_hi_cgo18_asin - (float64(int32(2))*(s+s*r) - pio2_lo_cgo19_asin)
x = pio2_hi_cgos__asin - (float64(int32(2))*(s+s*r) - pio2_lo_cgos__asin)
} else {
var f float64
var c float64
f = s
for {
f = *(*float64)(unsafe.Pointer(&_cgoz_33_asin{uint64(*(*uint64)(unsafe.Pointer(&_cgoz_34_asin{f}))>>int32(32))<<int32(32) | uint64(0)}))
f = *(*float64)(unsafe.Pointer(&_cgoz_20_asin{uint64(*(*uint64)(unsafe.Pointer(&_cgoz_21_asin{f}))>>int32(32))<<int32(32) | uint64(0)}))
if true {
break
}
}
c = (z - f*f) / (s + f)
x = 0.5*pio2_hi_cgo18_asin - (float64(int32(2))*s*r - (pio2_lo_cgo19_asin - float64(int32(2))*c) - (0.5*pio2_hi_cgo18_asin - float64(int32(2))*f))
x = 0.5*pio2_hi_cgos__asin - (float64(int32(2))*s*r - (pio2_lo_cgos__asin - float64(int32(2))*c) - (0.5*pio2_hi_cgos__asin - float64(int32(2))*f))
}
if hx>>int32(31) != 0 {
return -x
}
return x
}

type _cgoz_31_asin struct {
type _cgoz_18_asin struct {
_f float64
}
type _cgoz_32_asin struct {
type _cgoz_19_asin struct {
_f float64
}
type _cgoz_33_asin struct {
type _cgoz_20_asin struct {
_i uint64
}
type _cgoz_34_asin struct {
type _cgoz_21_asin struct {
_f float64
}
26 changes: 13 additions & 13 deletions asinf.c.i.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@ package libc

import unsafe "unsafe"

var pio2_cgo18_asinf float64 = 1.5707963267948966
var pS0_cgo19_asinf float32 = float32(0.16666586696999999)
var pS1_cgo20_asinf float32 = float32(-0.042743422091000002)
var pS2_cgo21_asinf float32 = float32(-0.0086563630029999998)
var qS1_cgo22_asinf float32 = float32(-0.7066296339)
var pio2_cgos__asinf float64 = 1.5707963267948966
var pS0_cgos__asinf float32 = float32(0.16666586696999999)
var pS1_cgos__asinf float32 = float32(-0.042743422091000002)
var pS2_cgos__asinf float32 = float32(-0.0086563630029999998)
var qS1_cgos__asinf float32 = float32(-0.7066296339)

func R_cgo23_asinf(z float32) float32 {
func R_cgos__asinf(z float32) float32 {
var p float32
var q float32
p = z * (pS0_cgo19_asinf + z*(pS1_cgo20_asinf+z*pS2_cgo21_asinf))
q = 1 + z*qS1_cgo22_asinf
p = z * (pS0_cgos__asinf + z*(pS1_cgos__asinf+z*pS2_cgos__asinf))
q = 1 + z*qS1_cgos__asinf
return p / q
}
func Asinf(x float32) float32 {
Expand All @@ -21,33 +21,33 @@ func Asinf(x float32) float32 {
var hx uint32
var ix uint32
for {
hx = *(*uint32)(unsafe.Pointer(&_cgoz_24_asinf{x}))
hx = *(*uint32)(unsafe.Pointer(&_cgoz_18_asinf{x}))
if true {
break
}
}
ix = hx & uint32(2147483647)
if ix >= uint32(1065353216) {
if ix == uint32(1065353216) {
return float32(float64(x)*pio2_cgo18_asinf + float64(7.52316385e-37))
return float32(float64(x)*pio2_cgos__asinf + float64(7.52316385e-37))
}
return float32(int32(0)) / (x - x)
}
if ix < uint32(1056964608) {
if ix < uint32(964689920) && ix >= uint32(8388608) {
return x
}
return x + x*R_cgo23_asinf(x*x)
return x + x*R_cgos__asinf(x*x)
}
z = (float32(int32(1)) - Fabsf(x)) * 0.5
s = Sqrt(float64(z))
x = float32(pio2_cgo18_asinf - float64(int32(2))*(s+s*float64(R_cgo23_asinf(z))))
x = float32(pio2_cgos__asinf - float64(int32(2))*(s+s*float64(R_cgos__asinf(z))))
if hx>>int32(31) != 0 {
return -x
}
return x
}

type _cgoz_24_asinf struct {
type _cgoz_18_asinf struct {
_f float32
}
Loading

0 comments on commit 202df94

Please sign in to comment.