Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 9cd0b02

Browse files
petermcneeleychromiumPeter McNeeleymehmetoguzderin
authored
Widen tanh acceptable range (output values) (gpuweb#5199)
After a bit of investigation it has been determined that tanh has a max Absolute error of 1e-5 for some devices (nvidia) We discussed polyfilling this function (sinh/cosh) but this inaccuracy is likely intentional as tanh is commonly used in sigmoid functions for ML. crbug.com/390221422 Co-authored-by: Peter McNeeley <[email protected]> Co-authored-by: Mehmet Oguz Derin <[email protected]>
1 parent 4ee7acf commit 9cd0b02

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

wgsl/index.bs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12938,7 +12938,10 @@ the rules in [[#floating-point-rounding-and-overflow]] apply.
1293812938
<tr><td>`sqrt(x)`<td colspan=2 style="text-align:left;">Inherited from `1.0 / inverseSqrt(x)`
1293912939
<tr><td>`step(edge, x)`<td colspan=2 style="text-align:left;">Correctly rounded
1294012940
<tr><td>`tan(x)`<td colspan=2 style="text-align:left;">Inherited from `sin(x) / cos(x)`
12941-
<tr><td>`tanh(x)`<td colspan=2 style="text-align:left;">Inherited from `sinh(x) / cosh(x)`
12941+
<tr><td>`tanh(x)`<td colspan=2 style="text-align:left;">
12942+
The worse of:
12943+
* Absolute error 1.0&times;10<sup>-5</sup>
12944+
* Inherited from `sinh(x) / cosh(x)`
1294212945
<tr><td>`transpose(x)`<td colspan=2 style="text-align:left;">Correctly rounded
1294312946
<tr><td>`trunc(x)`<td colspan=2 style="text-align:left;">Correctly rounded
1294412947

0 commit comments

Comments
 (0)