-
-
Notifications
You must be signed in to change notification settings - Fork 9
Open
Labels
Description
print(np.sin(1e100))
print(np.sin(npq.QuadPrecision("1e100")))
print(np.sin(npq.QuadPrecision("1e100", backend="longdouble")))
# output
-0.3806377310050287
0.679816461925869553732614638474571
-0.380637731005028678854529289310449
This is kind of expected, since using taylor expansion for large arguments can cause higher ULP.
A possible workaround in numpy_quaddtype is we can patch the trignometric functions to use any argument reduction strategies like Payne Hanek
@ngoldbaum what is your opinion here? We can also go in the current trivial way and mention in documentation about the working ranges but this won't be similar to NumPy's default behaviour as it seems to apply the reductions before trig functions.