Metal Shading Language Specification



Yüklə 4,82 Kb.
Pdf görüntüsü
səhifə50/51
tarix25.05.2018
ölçüsü4,82 Kb.
#45967
1   ...   43   44   45   46   47   48   49   50   51

x / y
Correctly rounded
acos
<= 4 ulp
acosh
<= 4 ulp
asin
<= 4 ulp
asinh
<= 4 ulp
atan
<= 5 ulp
atan2
<= 6 ulp
atanh
<= 5 ulp
ceil
Correctly rounded
copysign
0 ulp
cos
<= 4 ulp
cosh
<= 4 ulp
cospi
<= 4 ulp
exp
<= 4 ulp
exp2
<= 4 ulp
exp10
<= 4 ulp
fabs
0 ulp
fdim
Correctly rounded
floor
Correctly rounded
fma
Correctly rounded
fmax
0 ulp
fmin
0 ulp
fmod
0 ulp
fract
Correctly rounded
frexp
0 ulp
ilogb
0 ulp
ldexp
Correctly rounded
log
<= 4 ulp
Math Function
Min Accuracy - ULP values 
 
2017-9-12   |  Copyright © 2017 Apple Inc. All Rights Reserved.  
Page  
 of  
161
174


Table 37 describes the minimum accuracy of single-precision floating-point arithmetic 
operations given as ULP values with fast math enabled (which is the default unless 
-ffast-
math-disable
 is specified as a compiler option). 
Table 37 Minimum Accuracy of Single-Precision Operations and Functions with 
Fast Math Enabled 
log2
<= 4 ulp
log10
<= 4 ulp
modf
0 ulp
pow
<= 16 ulp
powr
<= 16 ulp
rint
Correctly rounded
round
Correctly rounded
rsqrt
Correctly rounded
sin
<= 4 ulp
sincos
<= 4 ulp
sinh
<= 4 ulp
sinpi
<= 4 ulp
sqrt
Correctly rounded
tan
<= 6 ulp
tanpi
<= 6 ulp
tanh
<= 5 ulp
trunc
Correctly rounded
Math Function
Min Accuracy - ULP values 
Math Function
Min Accuracy - ULP values 
x + y
Correctly rounded
x - y
Correctly rounded
x * y
Correctly rounded
1.0 / x
<= 1 ulp for x in the domain of 2
-126
 to 2
126
 
2017-9-12   |  Copyright © 2017 Apple Inc. All Rights Reserved.  
Page  
 of  
162
174


x / y
<= 2.5 ulp for y in the domain of 2
-126
 to 2
126
acos(x)
<= 5 ulp for x in the domain [-1, 1]
acosh(x)
Implemented as log(x + sqrt(x * x – 1.0))
asin(x)
<= 5 ulp for for x in the domain [-1, 1] and |x| >= 2
-125
asinh(x)
Implemented as log(x + sqrt(x * x + 1.0))
atan(x)
<= 5 ulp 
atanh(x)
Implemented as 0.5 * (log(1.0 + x) / log(1.0 – x))
atan2(y, x)
Implemented as atan(y / x) for x > 0, atan(y / x) + M_PI_F for x < 0 and y 
> 0, atan(y / x) – M_PI_F for x < 0 and y < 0 and is undefined if y = 0 
and x = 0.
cos(x)
For x in the domain [-pi, pi], the maximum absolute error is <= 2
-13
 and 
larger otherwise.
cosh(x)
Implemented as 0.5 * (exp(x) + exp(-x))
cospi(x)
The maximum relative error is <= 2
-17
.
exp(x)
<= 3 + floor(fabs(2 * x)) ulp
exp2(x)
<= 3 + floor(fabs(2 * x)) ulp
exp10(x)
Implemented as exp2(x * log2(10))
fabs
0 ulp
fdim
Correctly rounded
floor
Correctly rounded
fma
Correctly rounded
fmax
0 ulp
fmin
0 ulp
fmod
0 ulp
fract
Correctly rounded
frexp
0 ulp
ilogb
0 ulp
ldexp
Correctly rounded
log(x)
For x in the domain [0.5, 2], the maximum absolute error is <= 2
-21

otherwise the maximum error is <= 3 ulp if x > 0; otherwise the results 
are undefined.
 
2017-9-12   |  Copyright © 2017 Apple Inc. All Rights Reserved.  
Page  
 of  
163
174


Table 38 describes the minimum accuracy of half-precision floating-point basic arithmetic 
operations and math functions given as ULP values. Table 38 only applies to iOS with A11 
hardware. 
Table 38 Minimum Accuracy of Half Precision Floating-Point Operations and 
Functions 
log2(x)
For x in the domain [0.5, 2], the maximum absolute error is <= 2
-22

otherwise the maximum error is <= 2 ulp if x > 0; otherwise the results 
are undefined.
log10(x)
Implemented as log2(x) * log10(2)
modf
0 ulp
pow(x, y)
Implemented as exp2(y * log2(x)). Undefined for x = 0 and y = 0.
powr(x, y)
Implemented as exp2(y * log2(x)). Undefined for x = 0 and y = 0.
rint
Correctly rounded
round(x)
Correctly rounded
rsqrt
<= 2 ulp
sin(x)
For x in the domain [-pi, pi], the maximum absolute error is <= 2
-13
 and 
larger otherwise.
sinh(x)
Implemented as 0.5 * (exp(x) – exp(-x))
sincos(x)
ULP values as defined for sin(x) and cos(x)
sinpi(x)
The maximum relative error is <= 2
-17
.
sqrt(x)
Implemented as x * rsqrt(x) with special cases handled correctly.
tan(x)
Implemented as sin(x) * (1.0 / cos(x))
tanh(x)
Implemented as (t – 1.0)/(t + 1.0) where t = exp(2.0 * x)
tanpi(x)
The maximum relative error is <= 2
-17
.
trunc
Correctly rounded
Math Function
Min Accuracy - ULP values 
x + y
Correctly rounded
x - y
Correctly rounded
x * y
Correctly rounded
 
2017-9-12   |  Copyright © 2017 Apple Inc. All Rights Reserved.  
Page  
 of  
164
174


Yüklə 4,82 Kb.

Dostları ilə paylaş:
1   ...   43   44   45   46   47   48   49   50   51




Verilənlər bazası müəlliflik hüququ ilə müdafiə olunur ©www.genderi.org 2024
rəhbərliyinə müraciət

    Ana səhifə