You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
| O.f_I_ceil(x) |`=`|`min { y \| y ∈ O, F(x) <= y }`|
134
-
| O.f_I_floor(x) |`=`|`max { y \| y ∈ O, y <= F(x) }`|
135
-
| O.f_I_trunc(x) |`=`|`if 0 < F(x) then O.f_I_floor(x) else O.f_I_ceil(x)`|
133
+
|`O.f_I_ceil(x)`|`=`|`min { y \| y ∈ O, F(x) <= y }`|
134
+
|`O.f_I_floor(x)`|`=`|`max { y \| y ∈ O, y <= F(x) }`|
135
+
|`O.f_I_trunc(x)`|`=`|`if 0 < F(x) then O.f_I_floor(x) else O.f_I_ceil(x)`|
136
136
137
-
This definition is not complete as the result might be zero and in that case the sign has to be determined. In that case IEEE defines the result as `+0.0` with following exception: Should `f` be `+` or `-` and the result be zero then the sign is `-`. In Formal notation this gives us: (higher listed rules have precedence)
137
+
This definition is not complete as the result might be zero and in that case the sign has to be determined. In that case IEEE defines the result as the usual sign rules (`+0.0`for `±`, `copysign(1,a*b) = copysign(1,a)*copysign(1,b)`) with following exception: Should `f` be `+` or `-` and the result be zero then the sign is `-`. In formal notation this gives us: (higher listed rules have precedence)
Here means `minimal` a functions that gives the set of minimal elements of the input set. So the result set is either a non zero number singleton or the set `{-0.0, 0.0}`. Here `max` and `min` are parameterized on the relation `<` with the additional having `-0.0 < 0.0` to make the relation total.
148
151
149
-
## redundants
152
+
Here `maximal` means a function that gives the set of maximal elements of the input set. So the result set is either a non zero number singleton or the set `{-0.0, 0.0}`. Here `max` and `min` are parameterized on the relation `<` with the additional having `-0.0 < 0.0` to make the relation total.
150
153
151
-
The following functions are redundant and simple to implement:
154
+
## Redundants
155
+
156
+
The following functions are redundant and simple to implement. For instance:
152
157
```
153
158
f32.convert_i32_s_ceil
154
159
f32.convert_i32_s_floor
@@ -181,7 +186,7 @@ f64.convert_i32_u_ceil
181
186
f64.convert_i32_u_floor
182
187
f64.convert_i32_u_trunc
183
188
```
184
-
It turns out that the functions above are respectively equivalent to `f64.convert_i32_s` and `f64.convert_i32_u`. The reason is that an `f64` float contains a 53-bit mantissa, which is sufficient to accommodate an entire 'i32'.
189
+
It turns out that the functions above are respectively equivalent to `f64.convert_i32_s` and `f64.convert_i32_u`. The reason is that an `f64` float contains a 53-bit mantissa, which is sufficient to accommodate an entire `i32`.
185
190
186
191
187
192
@@ -199,7 +204,7 @@ Technically the redundant functions do not add much normative value. But they ar
199
204
200
205
The operation and conversion tensor does not get arbitrary holes. This makes it easier to reason about the operations. The mathematical defenition of the semantic of `f64.promote_f32_ceil` is still different from `f64.promote_f32`. It is easier to express intend that way.
201
206
202
-
Having the full conversion tensor may improve portability of WebAssembly: With rounded instructions it is possible to write algorithms that are independent of and equivalent over different number formats. For example a user of the `wasm2c` tool could purposefully relax the requirement of `f32` to be IEEE floating point. The `c` standard does not require `flaot` to be IEEE. Lets say `f32` gets implemented by the plattform as `posit32`. `posit32` is a number format with more precicion around `1.0` than IEEE. That way there might be numbers in `float` that are not representable in `double`. Now you need `promot` with a rounding variation so that your iterating enclosing loop is still converging.
207
+
Having the full conversion tensor may improve portability of WebAssembly: With rounded instructions it is possible to write algorithms that are independent of and equivalent over different number formats. For example a user of the `wasm2c` tool could purposefully relax the requirement of `f32` to be IEEE floating point. The `c` standard does not require `flaot` to be IEEE. Lets say `f32` gets implemented by the plattform as `posit32`. `posit32` is a number format with more precicion around `1.0` than IEEE. That way there might be numbers in `float` that are not representable in `double`. Now you need a rounding variant of `promot` so that your iterating enclosing loop is still converging.
0 commit comments