## 從三角函數 cosine 的實做問題學一些週邊知識...

cosine 是很基本的函數，所以可以使用的地方很多。另外一方面，也因為他不是那麼直覺就可以實做出來，在現代的實做裡面其實藏了超多細節...

A common software technique to implement nearly quadruple precision using pairs of double-precision values is sometimes called double-double arithmetic.

Using pairs of IEEE double-precision values with 53-bit significands, double-double arithmetic provides operations on numbers with significands of at least[4] 2 × 53 = 106 bits (...), only slightly less precise than the 113-bit significand of IEEE binary128 quadruple precision.

## Python 裡使用超過 Double Precision 的運算

There is no error with the program; this discrepancy is caused by a loss of numerical accuracy in the eigenvalue calculation due to the limitation of hardware double precision (16-digit).

Note that this library is incredibly slow for large matrices, so is best avoided for most applications.

## 測試 TPUv2 的 C/P 值

It turns out that the TPU is even faster on the LSTM model (21402 examples/s): ~12.9 times faster than a P100 (1658 examples/s) and ~7.7 times faster than a V100 (2778 examples/s)!