File tree 7 files changed +17
-18
lines changed 7 files changed +17
-18
lines changed Original file line number Diff line number Diff line change @@ -120,19 +120,19 @@ func tanSeries(z complex128) float64 {
120
120
rn := 0.0
121
121
d := 0.0
122
122
for {
123
- rn += 1
123
+ rn ++
124
124
f *= rn
125
- rn += 1
125
+ rn ++
126
126
f *= rn
127
127
x2 *= x
128
128
y2 *= y
129
129
t := y2 + x2
130
130
t /= f
131
131
d += t
132
132
133
- rn += 1
133
+ rn ++
134
134
f *= rn
135
- rn += 1
135
+ rn ++
136
136
f *= rn
137
137
x2 *= x
138
138
y2 *= y
Original file line number Diff line number Diff line change @@ -229,7 +229,7 @@ func expm1(x float64) float64 {
229
229
}
230
230
t := Float64frombits (uint64 (0x3ff - k ) << 52 ) // 2**-k
231
231
y := x - (e + t )
232
- y += 1
232
+ y ++
233
233
y = Float64frombits (Float64bits (y ) + uint64 (k )<< 52 ) // add k to y's exponent
234
234
return y
235
235
}
Original file line number Diff line number Diff line change @@ -174,7 +174,7 @@ func Jn(n int, x float64) float64 {
174
174
q1 := w * z - 1
175
175
k := 1
176
176
for q1 < 1e9 {
177
- k += 1
177
+ k ++
178
178
z += h
179
179
q0 , q1 = q1 , z * q1 - q0
180
180
}
Original file line number Diff line number Diff line change @@ -167,7 +167,7 @@ func log1p(x float64) float64 {
167
167
if iu < 0x0006a09e667f3bcd { // mantissa of Sqrt(2)
168
168
u = Float64frombits (iu | 0x3ff0000000000000 ) // normalize u
169
169
} else {
170
- k += 1
170
+ k ++
171
171
u = Float64frombits (iu | 0x3fe0000000000000 ) // normalize u/2
172
172
iu = (0x0010000000000000 - iu ) >> 2
173
173
}
@@ -179,10 +179,9 @@ func log1p(x float64) float64 {
179
179
if f == 0 {
180
180
if k == 0 {
181
181
return 0
182
- } else {
183
- c += float64 (k ) * Ln2Lo
184
- return float64 (k )* Ln2Hi + c
185
182
}
183
+ c += float64 (k ) * Ln2Lo
184
+ return float64 (k )* Ln2Hi + c
186
185
}
187
186
R = hfsq * (1.0 - 0.66666666666666666 * f ) // avoid division
188
187
if k == 0 {
Original file line number Diff line number Diff line change @@ -140,8 +140,8 @@ func cos(x float64) float64 {
140
140
141
141
// map zeros to origin
142
142
if j & 1 == 1 {
143
- j += 1
144
- y += 1
143
+ j ++
144
+ y ++
145
145
}
146
146
j &= 7 // octant modulo 2Pi radians (360 degrees)
147
147
if j > 3 {
@@ -200,8 +200,8 @@ func sin(x float64) float64 {
200
200
201
201
// map zeros to origin
202
202
if j & 1 == 1 {
203
- j += 1
204
- y += 1
203
+ j ++
204
+ y ++
205
205
}
206
206
j &= 7 // octant modulo 2Pi radians (360 degrees)
207
207
// reflect in x axis
Original file line number Diff line number Diff line change @@ -40,8 +40,8 @@ func sincos(x float64) (sin, cos float64) {
40
40
y := float64 (j ) // integer part of x/(Pi/4), as float
41
41
42
42
if j & 1 == 1 { // map zeros to origin
43
- j += 1
44
- y += 1
43
+ j ++
44
+ y ++
45
45
}
46
46
j &= 7 // octant modulo 2Pi radians (360 degrees)
47
47
if j > 3 { // reflect in x axis
Original file line number Diff line number Diff line change @@ -108,8 +108,8 @@ func tan(x float64) float64 {
108
108
109
109
/* map zeros and singularities to origin */
110
110
if j & 1 == 1 {
111
- j += 1
112
- y += 1
111
+ j ++
112
+ y ++
113
113
}
114
114
115
115
z := ((x - y * PI4A ) - y * PI4B ) - y * PI4C
You can’t perform that action at this time.
0 commit comments