@@ -38,9 +38,9 @@ julia> gen( x, y, \"data.json\" );
3838```
3939"""
4040function gen ( x, y, name )
41- z = Array {Float32 } ( undef, length (x) );
41+ z = Array {Float64 } ( undef, length (x) );
4242 for i in eachindex (x)
43- z[ i ] = x[i]^ y[i];
43+ z[ i ] = Float32 ( x[i]^ y[i] ) ;
4444 end
4545
4646 # Store data to be written to file as a collection:
@@ -73,7 +73,7 @@ y[:] .= 2.0;
7373gen ( x, y, " squared_small.json" );
7474
7575# Squares (x large):
76- x = range ( 3.14e100 , stop = 3.14e110 , length = 2001 );
76+ x = range ( 3.14e10 , stop = 3.14e11 , length = 2001 );
7777y = zeros ( 2001 );
7878y[:] .= 2.0 ;
7979gen ( x, y, " squared_large.json" );
@@ -85,7 +85,7 @@ y[:] .= 3.0;
8585gen ( x, y, " cubed_small.json" );
8686
8787# Cubes (x large):
88- x = range ( - 9.99e99 , stop = - 4.641588833612779e102 , length = 2001 );
88+ x = range ( - 9.99e29 , stop = - 4.64e32 , length = 2001 );
8989y = zeros ( 2001 );
9090y[:] .= 3.0 ;
9191gen ( x, y, " cubed_large.json" );
@@ -97,29 +97,29 @@ y[:] .= 4.0;
9797gen ( x, y, " to_the_fourth_small.json" );
9898
9999# 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 );
101101y = zeros ( 2001 );
102102y[:] .= 4.0 ;
103103gen ( x, y, " to_the_fourth_large.json" );
104104
105105# 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 );
107107y = range ( - 10 , stop = 10 , length = 500 );
108108gen ( x, y, " base_near_unity_small.json" );
109109
110110# 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 );
113113gen ( x, y, " base_near_unity_large.json" );
114114
115115# 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 );
118118gen ( x, y, " base_near_unity_huge.json" );
119119
120120# 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 );
123123y = log .(z) ./ log .(x);
124124gen ( x, y, " subnormal_results.json" );
125125
@@ -135,12 +135,12 @@ gen( x, y, "negative_exp_large_small.json" );
135135
136136# Negative exponents (x small, y large):
137137x = range ( 0 , stop = 10 , length = 5001 );
138- y = rand ( 5001 ) .* - (2.0 ^ 31 );
138+ y = rand ( 5001 ) .* - (2.0 ^ 27 );
139139gen ( x, y, " negative_exp_small_large.json" );
140140
141141# Negative exponents (x large, y large):
142142x = range ( 3.14e20 , stop = 1e22 , length = 5001 );
143- y = rand ( 5001 ) .* - (2.0 ^ 31 );
143+ y = rand ( 5001 ) .* - (2.0 ^ 27 );
144144gen ( x, y, " negative_exp_large_large.json" );
145145
146146# x small, y small:
@@ -149,12 +149,12 @@ y = rand( 5001 ) .* 100;
149149gen ( x, y, " small_small.json" );
150150
151151# 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 ;
154154gen ( x, y, " small_large.json" );
155155
156156# x large, y small:
157- x = rand ( 5001 ) .* 5e20 ;
157+ x = rand ( 5001 ) .* 1e30 ;
158158y = rand ( 5001 ) .* 10 ;
159159gen ( x, y, " large_small.json" );
160160
0 commit comments