@@ -38,9 +38,9 @@ julia> gen( x, y, \"data.json\" );
38
38
```
39
39
"""
40
40
function gen ( x, y, name )
41
- z = Array {Float32 } ( undef, length (x) );
41
+ z = Array {Float64 } ( undef, length (x) );
42
42
for i in eachindex (x)
43
- z[ i ] = x[i]^ y[i];
43
+ z[ i ] = Float32 ( x[i]^ y[i] ) ;
44
44
end
45
45
46
46
# Store data to be written to file as a collection:
@@ -73,7 +73,7 @@ y[:] .= 2.0;
73
73
gen ( x, y, " squared_small.json" );
74
74
75
75
# Squares (x large):
76
- x = range ( 3.14e100 , stop = 3.14e110 , length = 2001 );
76
+ x = range ( 3.14e10 , stop = 3.14e11 , length = 2001 );
77
77
y = zeros ( 2001 );
78
78
y[:] .= 2.0 ;
79
79
gen ( x, y, " squared_large.json" );
@@ -85,7 +85,7 @@ y[:] .= 3.0;
85
85
gen ( x, y, " cubed_small.json" );
86
86
87
87
# Cubes (x large):
88
- x = range ( - 9.99e99 , stop = - 4.641588833612779e102 , length = 2001 );
88
+ x = range ( - 9.99e29 , stop = - 4.64e32 , length = 2001 );
89
89
y = zeros ( 2001 );
90
90
y[:] .= 3.0 ;
91
91
gen ( x, y, " cubed_large.json" );
@@ -97,29 +97,29 @@ y[:] .= 4.0;
97
97
gen ( x, y, " to_the_fourth_small.json" );
98
98
99
99
# To the 4th power (x large):
100
- x = range ( 1.234e61 , stop = 3.14e69 , length = 2001 );
100
+ x = range ( 1.234e30 , stop = 3.14e35 , length = 2001 );
101
101
y = zeros ( 2001 );
102
102
y[:] .= 4.0 ;
103
103
gen ( x, y, " to_the_fourth_large.json" );
104
104
105
105
# Base near unity (y small):
106
- x = range ( 0.9999990463256836 , stop = 1.0000009536743164 , length = 500 );
106
+ x = range ( 0.999999 , stop = 1.000001 , length = 500 );
107
107
y = range ( - 10 , stop = 10 , length = 500 );
108
108
gen ( x, y, " base_near_unity_small.json" );
109
109
110
110
# Base near unity (y large):
111
- x = range ( 0.9999990463256836 , stop = 1.0000009536743164 , length = 500 );
112
- y = range ( 100 , stop = 709 , length = 500 );
111
+ x = range ( 0.999999 , stop = 1.000001 , length = 500 );
112
+ y = range ( 100 , stop = 79 , length = 500 );
113
113
gen ( x, y, " base_near_unity_large.json" );
114
114
115
115
# Base near unity (y huge):
116
- x = range ( 0.9999999999990463256836 , stop = 1.0000000000009536743164 , length = 500 );
117
- y = range ( 1.8446744073709552e13 , stop = 4.294967296e14 , length = 500 );
116
+ x = range ( 0.999999 , stop = 1.000001 , length = 500 );
117
+ y = range ( 1.0e6 , stop = 1.0e8 , length = 500 );
118
118
gen ( x, y, " base_near_unity_huge.json" );
119
119
120
120
# Subnormal results:
121
- z = range ( 3.14e-309 , stop = 3.14e-312 , length = 2001 );
122
- x = range ( 3.14e-52 , stop = 3.14e-54 , length = 2001 );
121
+ z = range ( 3.14e-39 , stop = 1.40129846e-45 , length = 2001 );
122
+ x = range ( 3.14e-26 , stop = 3.14e-27 , length = 2001 );
123
123
y = log .(z) ./ log .(x);
124
124
gen ( x, y, " subnormal_results.json" );
125
125
@@ -135,12 +135,12 @@ gen( x, y, "negative_exp_large_small.json" );
135
135
136
136
# Negative exponents (x small, y large):
137
137
x = range ( 0 , stop = 10 , length = 5001 );
138
- y = rand ( 5001 ) .* - (2.0 ^ 31 );
138
+ y = rand ( 5001 ) .* - (2.0 ^ 27 );
139
139
gen ( x, y, " negative_exp_small_large.json" );
140
140
141
141
# Negative exponents (x large, y large):
142
142
x = range ( 3.14e20 , stop = 1e22 , length = 5001 );
143
- y = rand ( 5001 ) .* - (2.0 ^ 31 );
143
+ y = rand ( 5001 ) .* - (2.0 ^ 27 );
144
144
gen ( x, y, " negative_exp_large_large.json" );
145
145
146
146
# x small, y small:
@@ -149,12 +149,12 @@ y = rand( 5001 ) .* 100;
149
149
gen ( x, y, " small_small.json" );
150
150
151
151
# x small, y large:
152
- x = rand ( 5001 ) .* 1.9988548118735103 ;
153
- y = rand ( 5001 ) .* 2.0 ^ 10 ;
152
+ x = rand ( 5001 ) .* 1.9988548 ;
153
+ y = rand ( 5001 ) .* 1024 ;
154
154
gen ( x, y, " small_large.json" );
155
155
156
156
# x large, y small:
157
- x = rand ( 5001 ) .* 5e20 ;
157
+ x = rand ( 5001 ) .* 1e30 ;
158
158
y = rand ( 5001 ) .* 10 ;
159
159
gen ( x, y, " large_small.json" );
160
160
0 commit comments