test_intrinsic.py 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655
  1. import unittest
  2. import numpy as np
  3. from typing import Callable
  4. from swiftt.taylor import taylor_map, factory_taylor
  5. from swiftt.math_algebra import tan, cos, sin, tanh, cosh, sinh, asin, asinh, acos, acosh, atan, atanh, exp, log,\
  6. erf, sqrt, cbrt, arctan, arctanh, arccos, arcsin, arcsinh, scalar_inversion
  7. tol_coeff = 1.e-12
  8. null_expansion_2var_order2 = factory_taylor.zero_expansion(2, 2)
  9. null_expansion_2var_order3 = factory_taylor.zero_expansion(2, 3)
  10. null_expansion_3var_order2 = factory_taylor.zero_expansion(3, 2)
  11. null_expansion_4var_order5 = factory_taylor.zero_expansion(4, 5)
  12. def test_func_inverse(func: Callable, inv_func: Callable, const: float, order: int = 10):
  13. expansion = factory_taylor.zero_expansion(n_var=1, order=order)
  14. coeff = np.zeros(order + 1)
  15. coeff[1] = 1.
  16. expansion.coeff = coeff
  17. v1 = inv_func(func(const) + expansion)
  18. v2 = scalar_inversion(func, const + expansion)
  19. return np.allclose(v1.coeff, v2.coeff)
  20. def test_inverse_pow(power: float):
  21. return test_func_inverse(lambda x: x**power, lambda y: y**(1. / power), 2.)
  22. def test_map_intrinsic(func) -> bool:
  23. expansion1 = null_expansion_2var_order2.copy()
  24. coeff1 = [0.5, -1., 4., 2., 5., 1.]
  25. expansion1.coeff = coeff1
  26. expansion2 = null_expansion_2var_order2.copy()
  27. coeff2 = [0.1, 6., 3., -2., 1., -1.]
  28. expansion2.coeff = coeff2
  29. map1 = taylor_map.RealTaylorMap([expansion1, expansion2])
  30. on_map = func(map1)
  31. for el1, el2 in zip(map1, on_map):
  32. if el2 != func(el1):
  33. return False
  34. return True
  35. class TestIntrinsic(unittest.TestCase):
  36. def test_cos0(self):
  37. expansion1 = factory_taylor.zero_expansion(1, 5)
  38. coeff1 = [0., 1., 0., 0., 0., 0.]
  39. expansion1.coeff = coeff1
  40. cosinus = cos(expansion1)
  41. coeff = cosinus.coeff
  42. if not np.array_equal(coeff, [1., 0., -0.5, 0., 1. / 24., 0.]):
  43. self.fail()
  44. def test_cosh0(self):
  45. expansion1 = factory_taylor.zero_expansion(1, 5)
  46. coeff1 = [0., 1., 0., 0., 0., 0.]
  47. expansion1.coeff = coeff1
  48. cosinush = cosh(expansion1)
  49. coeff = cosinush.coeff
  50. if not np.array_equal(coeff, [1., 0., 0.5, 0., 1. / 24., 0.]):
  51. self.fail()
  52. def test_sin0(self):
  53. expansion1 = factory_taylor.zero_expansion(1, 6)
  54. coeff1 = [0., 1., 0., 0., 0., 0., 0.]
  55. expansion1.coeff = coeff1
  56. sinus = sin(expansion1)
  57. coeff = sinus.coeff
  58. if not np.array_equal(coeff, [0., 1., 0., -1. / 6., 0., 1. / 120., 0.]):
  59. self.fail()
  60. def test_sinh0(self):
  61. expansion1 = factory_taylor.zero_expansion(1, 6)
  62. coeff1 = [0., 1., 0., 0., 0., 0., 0.]
  63. expansion1.coeff = coeff1
  64. sinush = sinh(expansion1)
  65. coeff = sinush.coeff
  66. if not np.array_equal(coeff, [0., 1., 0., 1. / 6., 0., 1. / 120., 0.]):
  67. self.fail()
  68. def test_cos_sin(self):
  69. expansion1 = null_expansion_2var_order2.copy()
  70. coeff1 = [2., 3., 4., -5., -1., -3.]
  71. expansion1.coeff = coeff1
  72. expansion2 = cos(expansion1)**2 + sin(expansion1)**2
  73. coeff2 = expansion2.coeff
  74. if np.fabs(1. - coeff2[0]) > tol_coeff:
  75. self.fail()
  76. if not np.allclose(coeff2[1:], np.zeros(len(coeff2) - 1)):
  77. self.fail()
  78. def test_asin0(self):
  79. expansion1 = factory_taylor.zero_expansion(1, 6)
  80. coeff1 = [0., 1., 0., 0., 0., 0., 0.]
  81. expansion1.coeff = coeff1
  82. arcsin = asin(expansion1)
  83. coeff = arcsin.coeff
  84. if not np.array_equal(coeff, [0., 1., 0., 1. / 6., 0., 3. / 40., 0.]):
  85. self.fail()
  86. def test_atan0(self):
  87. expansion1 = factory_taylor.zero_expansion(1, 6)
  88. coeff1 = [0., 1., 0., 0., 0., 0., 0.]
  89. expansion1.coeff = coeff1
  90. arctan = atan(expansion1)
  91. coeff = arctan.coeff
  92. if not np.array_equal(coeff, [0., 1., 0., -1. / 3., 0., 0.2, 0.]):
  93. self.fail()
  94. def test_sin_asin(self):
  95. expansion = null_expansion_2var_order2.copy()
  96. coeff = [0.5, 3., 4., -5., -1., -3.]
  97. expansion.coeff = coeff
  98. expansion1 = asin(sin(expansion))
  99. coeff1 = expansion1.coeff
  100. expansion2 = sin(asin(expansion))
  101. coeff2 = expansion2.coeff
  102. if np.fabs(coeff1[0] - coeff2[0]) > tol_coeff:
  103. self.fail()
  104. if not np.allclose(coeff1[1:], coeff2[1:]):
  105. self.fail()
  106. if not np.allclose(coeff[1:], coeff2[1:]):
  107. self.fail()
  108. def test_cos_acos(self):
  109. expansion = null_expansion_2var_order2.copy()
  110. coeff = [0.5, 3., 4., -5., -1., -3.]
  111. expansion.coeff = coeff
  112. expansion1 = acos(cos(expansion))
  113. coeff1 = expansion1.coeff
  114. expansion2 = cos(acos(expansion))
  115. coeff2 = expansion2.coeff
  116. if np.fabs(coeff1[0] - coeff2[0]) > tol_coeff:
  117. self.fail()
  118. if not np.allclose(coeff1[1:], coeff2[1:]):
  119. self.fail()
  120. if not np.allclose(coeff[1:], coeff2[1:]):
  121. self.fail()
  122. def test_sinh_asinh(self):
  123. expansion = null_expansion_2var_order2.copy()
  124. coeff = [2., 3., 4., -5., -1., -3.]
  125. expansion.coeff = coeff
  126. expansion1 = asinh(sinh(expansion))
  127. coeff1 = expansion1.coeff
  128. expansion2 = sinh(asinh(expansion))
  129. coeff2 = expansion2.coeff
  130. if np.fabs(coeff1[0] - coeff2[0]) > tol_coeff:
  131. self.fail()
  132. if not np.allclose(coeff1[1:], coeff2[1:]):
  133. self.fail()
  134. if not np.allclose(coeff[1:], coeff2[1:]):
  135. self.fail()
  136. def test_cosh_acosh(self):
  137. expansion = null_expansion_2var_order2.copy()
  138. coeff = [2., 3., 4., -5., -1., -3.]
  139. expansion.coeff = coeff
  140. expansion1 = acosh(cosh(expansion))
  141. coeff1 = expansion1.coeff
  142. expansion2 = cosh(acosh(expansion))
  143. coeff2 = expansion2.coeff
  144. if np.fabs(coeff1[0] - coeff2[0]) > tol_coeff:
  145. self.fail()
  146. if not np.allclose(coeff1[1:], coeff2[1:]):
  147. self.fail()
  148. if not np.allclose(coeff[1:], coeff2[1:]):
  149. self.fail()
  150. def test_tan_atan(self):
  151. expansion = null_expansion_2var_order2.copy()
  152. coeff = [0.5, 3., 4., -5., -1., -3.]
  153. expansion.coeff = coeff
  154. expansion1 = atan(tan(expansion))
  155. coeff1 = expansion1.coeff
  156. expansion2 = tan(atan(expansion))
  157. coeff2 = expansion2.coeff
  158. if np.fabs(coeff1[0] - coeff2[0]) > tol_coeff:
  159. self.fail()
  160. if not np.allclose(coeff1[1:], coeff2[1:]):
  161. self.fail()
  162. if not np.allclose(coeff[1:], coeff2[1:]):
  163. self.fail()
  164. def test_cosh_sinh(self):
  165. expansion1 = null_expansion_2var_order2.copy()
  166. coeff1 = [0.5, 3., 4., -5., -1., -3.]
  167. expansion1.coeff = coeff1
  168. expansion2 = cosh(expansion1)**2 - sinh(expansion1)**2
  169. coeff2 = expansion2.coeff
  170. if np.fabs(1. - coeff2[0]) > tol_coeff:
  171. self.fail()
  172. if not np.allclose(np.zeros(len(coeff2) - 1), coeff2[1:]):
  173. self.fail()
  174. def test_cosh(self):
  175. expansion = factory_taylor.zero_expansion(1, 5)
  176. coeff = [3., 1.5, -4., 2., -1., 7.]
  177. expansion.coeff = coeff
  178. cosinush = cosh(expansion)
  179. coeff1 = cosinush.coeff
  180. cosinush2 = (exp(expansion) + exp(-expansion)) / 2.
  181. coeff2 = cosinush2.coeff
  182. if not np.allclose(coeff1, coeff2):
  183. self.fail()
  184. def test_sinh(self):
  185. expansion = factory_taylor.zero_expansion(1, 5)
  186. coeff = [3., 1.5, -4., 2., -1., 7.]
  187. expansion.coeff = coeff
  188. sinush = sinh(expansion)
  189. coeff1 = sinush.coeff
  190. sinush2 = (exp(expansion) - exp(-expansion)) / 2.
  191. coeff2 = sinush2.coeff
  192. if not np.allclose(coeff1, coeff2):
  193. self.fail()
  194. def test_tanh_atanh(self):
  195. expansion = null_expansion_2var_order2.copy()
  196. coeff = [0.5, 3., 4., -5., -1., -3.]
  197. expansion.coeff = coeff
  198. expansion1 = atanh(tanh(expansion))
  199. coeff1 = expansion1.coeff
  200. expansion2 = tanh(atanh(expansion))
  201. coeff2 = expansion2.coeff
  202. if np.fabs(coeff1[0] - coeff2[0]) > tol_coeff:
  203. self.fail()
  204. if not np.allclose(coeff1[1:], coeff2[1:]):
  205. self.fail()
  206. if not np.allclose(coeff[1:], coeff2[1:]):
  207. self.fail()
  208. def test_exp0(self):
  209. expansion1 = factory_taylor.zero_expansion(1, 10)
  210. coeff1 = [0., 1., 0., 0., 0., 0., 0., 0., 0., 0., 0.]
  211. expansion1.coeff = coeff1
  212. expon = exp(expansion1)
  213. coeff = expon.coeff
  214. if not np.allclose(coeff, np.append([1.], 1. / np.cumprod(np.arange(1., len(coeff))))):
  215. self.fail()
  216. def test_exp_div(self):
  217. expansion1 = factory_taylor.zero_expansion(1, 5)
  218. coeff1 = [3., 1.5, -4., 2., -1., 7.]
  219. expansion1.coeff = coeff1
  220. expon_inv = exp(-expansion1)
  221. one_over_expon = 1. / exp(expansion1)
  222. coeff = expon_inv.coeff
  223. coeff1 = one_over_expon.coeff
  224. if not np.allclose(coeff, coeff1):
  225. self.fail()
  226. def test_tan(self):
  227. expansion = factory_taylor.zero_expansion(1, 5)
  228. coeff = [3., 1.5, -4., 2., -1., 7.]
  229. expansion.coeff = coeff
  230. tan1 = tan(expansion)
  231. tan2 = sin(expansion) / cos(expansion)
  232. coeff1 = tan1.coeff
  233. coeff2 = tan2.coeff
  234. if not np.allclose(coeff1, coeff2):
  235. self.fail()
  236. def test_tanh(self):
  237. expansion = factory_taylor.zero_expansion(1, 5)
  238. coeff = [3., 1.5, -4., 2., -1., 7.]
  239. expansion.coeff = coeff
  240. tan1 = tanh(expansion)
  241. tan2 = sinh(expansion) / cosh(expansion)
  242. coeff1 = tan1.coeff
  243. coeff2 = tan2.coeff
  244. if not np.allclose(coeff1, coeff2):
  245. self.fail()
  246. def test_sqrt0(self):
  247. expansion1 = factory_taylor.zero_expansion(n_var=1, order=3)
  248. coeff1 = [1., 1., 0., 0.]
  249. expansion1.coeff = coeff1
  250. sqroot = sqrt(expansion1)
  251. coeff = sqroot.coeff
  252. if not np.array_equal(coeff, [1., 0.5, -0.125, 0.0625]):
  253. self.fail()
  254. def test_sqrt_sq(self):
  255. expansion = factory_taylor.zero_expansion(1, 5)
  256. coeff = [0.5, 1.5, -4., 2., -1., 7.]
  257. expansion.coeff = coeff
  258. expansion1 = sqrt(expansion**2)
  259. coeff1 = expansion1.coeff
  260. expansion2 = sqrt(expansion)**2
  261. coeff2 = expansion2.coeff
  262. expansion = abs(expansion)
  263. coeff = expansion.coeff
  264. if np.fabs(coeff1[0] - coeff2[0]) > tol_coeff:
  265. self.fail()
  266. if not np.allclose(coeff[1:], coeff1[1:]):
  267. self.fail()
  268. if not np.allclose(coeff[1:], coeff2[1:]):
  269. self.fail()
  270. def test_sqrt_exp_log_float(self):
  271. expansion = factory_taylor.zero_expansion(1, 5)
  272. coeff = [0.5, 1.5, -4., 2., -1., 7.]
  273. expansion.coeff = coeff
  274. expansion1 = sqrt(expansion)
  275. coeff1 = expansion1.coeff
  276. expansion2 = exp(0.5 * log(expansion))
  277. coeff2 = expansion2.coeff
  278. if not np.allclose(coeff1, coeff2):
  279. self.fail()
  280. def test_sqrt_exp_log_complex(self):
  281. expansion = factory_taylor.zero_expansion(1, 5, dtype=np.complex128)
  282. coeff = [complex(0.5, 1.), complex(1.5, -1.), complex(-4., 0.), complex(0., 2.), complex(-1., 3.), complex(7., 0.)]
  283. expansion.coeff = coeff
  284. expansion1 = sqrt(expansion)
  285. coeff1 = expansion1.coeff
  286. expansion2 = exp(0.5 * log(expansion))
  287. coeff2 = expansion2.coeff
  288. if not np.allclose(coeff1, coeff2):
  289. self.fail()
  290. def test_sqrt_pow(self):
  291. expansion = factory_taylor.zero_expansion(1, 5)
  292. coeff = [0.5, 1.5, -4., 2., -1., 7.]
  293. expansion.coeff = coeff
  294. expansion1 = sqrt(expansion)
  295. coeff1 = expansion1.coeff
  296. expansion2 = expansion**0.5
  297. coeff2 = expansion2.coeff
  298. if not np.allclose(coeff1, coeff2):
  299. self.fail()
  300. def test_sqrt_iter(self):
  301. expansion = factory_taylor.zero_expansion(1, 5)
  302. coeff = [0.5, 1.5, -4., 2., -1., 7.]
  303. expansion.coeff = coeff
  304. expansion1 = sqrt(expansion)
  305. coeff1 = expansion1.coeff
  306. sqrt_const = np.sqrt(expansion.const)
  307. factor = 0.5 / sqrt_const
  308. nilpo = expansion.get_nilpo_part()
  309. expansion2 = nilpo * factor
  310. if expansion2.total_depth != 1:
  311. self.fail()
  312. for i in range(2, expansion.order + 1):
  313. save = expansion2.copy()
  314. expansion2 = (nilpo - expansion2**2) * factor
  315. if (expansion2 - save).total_depth != i:
  316. self.fail()
  317. expansion2 += sqrt_const
  318. coeff2 = expansion2.coeff
  319. if not np.allclose(coeff1, coeff2):
  320. self.fail()
  321. def test_cbrt_pow(self):
  322. expansion = factory_taylor.zero_expansion(1, 5)
  323. coeff = [0.5, 1.5, -4., 2., -1., 7.]
  324. expansion.coeff = coeff
  325. expansion1 = cbrt(expansion)
  326. coeff1 = expansion1.coeff
  327. expansion2 = expansion**(1. / 3.)
  328. coeff2 = expansion2.coeff
  329. if not np.allclose(coeff1, coeff2):
  330. self.fail()
  331. def test_log(self):
  332. expansion1 = factory_taylor.zero_expansion(1, 10)
  333. coeff1 = [1., 1., 0., 0., 0., 0., 0., 0., 0., 0., 0.]
  334. expansion1.coeff = coeff1
  335. logar = log(expansion1)
  336. coeff = logar.coeff
  337. if coeff[0] != 0.:
  338. self.fail()
  339. if not np.array_equal(coeff[1:], [(-1.)**(i - 1) / float(i) for i in range(1, len(coeff))]):
  340. self.fail()
  341. def test_log_exp(self):
  342. expansion1 = factory_taylor.zero_expansion(1, 5)
  343. coeff1 = [3., 1.5, -4., 2, -1., 7.]
  344. expansion1.coeff = coeff1
  345. expansion2 = log(exp(expansion1))
  346. coeff = expansion2.coeff
  347. if not np.allclose(coeff1, coeff):
  348. self.fail()
  349. def test_asinh(self):
  350. expansion1 = factory_taylor.zero_expansion(1, 5)
  351. coeff1 = [0.5, 1.5, -4., 2., -1., 7.]
  352. expansion1.coeff = coeff1
  353. asinh1 = asinh(expansion1)
  354. asinh2 = log(expansion1 + sqrt(expansion1**2 + 1.))
  355. coeff = asinh1.coeff
  356. coeff1 = asinh2.coeff
  357. if not np.allclose(coeff1, coeff):
  358. self.fail()
  359. def test_acosh(self):
  360. expansion1 = factory_taylor.zero_expansion(1, 5)
  361. coeff1 = [3., 1.5, -4., 2., -1., 7.]
  362. expansion1.coeff = coeff1
  363. acosh1 = acosh(expansion1)
  364. acosh2 = log(expansion1 + sqrt(expansion1**2 - 1.))
  365. coeff = acosh1.coeff
  366. coeff1 = acosh2.coeff
  367. if not np.allclose(coeff1, coeff):
  368. self.fail()
  369. def test_atanh(self):
  370. expansion = factory_taylor.zero_expansion(1, 5)
  371. coeff = [0.5, 1.5, -4., 2., -1., 7.]
  372. expansion.coeff = coeff
  373. atanh1 = atanh(expansion)
  374. atanh2 = 0.5 * log((expansion + 1.) / (1. - expansion))
  375. coeff1 = atanh1.coeff
  376. coeff2 = atanh2.coeff
  377. if not np.allclose(coeff1, coeff2):
  378. self.fail()
  379. def test_erf0(self):
  380. expansion = factory_taylor.zero_expansion(1, 9)
  381. coeff = [0., 1., 0., 0., 0., 0., 0., 0., 0., 0.]
  382. expansion.coeff = coeff
  383. error_fun = erf(expansion)
  384. expansion1 = error_fun.deriv_once_wrt_var(0)
  385. expansion2 = 2. * exp(-expansion**2) / np.sqrt(np.pi)
  386. coeff1 = expansion1.coeff
  387. coeff2 = expansion2.coeff
  388. if not np.allclose(coeff1, coeff2):
  389. self.fail()
  390. def test_inverse_exp(self):
  391. if not test_func_inverse(exp, log, 2.):
  392. return self.fail()
  393. def test_inverse_log(self):
  394. if not test_func_inverse(log, exp, 3.):
  395. return self.fail()
  396. def test_inverse_cos(self):
  397. if not test_func_inverse(cos, acos, 1.):
  398. return self.fail()
  399. def test_inverse_acos(self):
  400. if not test_func_inverse(acos, cos, -0.5):
  401. return self.fail()
  402. def test_inverse_sin(self):
  403. if not test_func_inverse(sin, asin, 1.):
  404. return self.fail()
  405. def test_inverse_asin(self):
  406. if not test_func_inverse(asin, sin, -0.5):
  407. return self.fail()
  408. def test_inverse_tan(self):
  409. if not test_func_inverse(tan, atan, 1.):
  410. return self.fail()
  411. def test_inverse_atan(self):
  412. if not test_func_inverse(atan, tan, -0.5):
  413. return self.fail()
  414. def test_inverse_cosh(self):
  415. if not test_func_inverse(cosh, acosh, 1.):
  416. return self.fail()
  417. def test_inverse_acosh(self):
  418. if not test_func_inverse(acosh, cosh, 2.):
  419. return self.fail()
  420. def test_inverse_sinh(self):
  421. if not test_func_inverse(sinh, asinh, 1.):
  422. return self.fail()
  423. def test_inverse_asinh(self):
  424. if not test_func_inverse(asinh, sinh, -0.5):
  425. return self.fail()
  426. def test_inverse_tanh(self):
  427. if not test_func_inverse(tanh, atanh, 1.):
  428. return self.fail()
  429. def test_inverse_atanh(self):
  430. if not test_func_inverse(atanh, tanh, -0.5):
  431. return self.fail()
  432. def test_inverse_pow2(self):
  433. if not test_inverse_pow(2.):
  434. return self.fail()
  435. def test_inverse_pow3(self):
  436. if not test_inverse_pow(3.):
  437. return self.fail()
  438. def test_modulo(self):
  439. expansion1 = null_expansion_3var_order2.copy()
  440. coeff1 = [8., 3., 4., -5., -1., -3., -2., 1., 6., -7.]
  441. expansion1.coeff = coeff1
  442. arg_mod = 3.
  443. if expansion1 % arg_mod != expansion1 - 6.:
  444. self.fail()
  445. def test_map_sqrt(self):
  446. if not test_map_intrinsic(sqrt):
  447. self.fail()
  448. def test_map_exp(self):
  449. if not test_map_intrinsic(exp):
  450. self.fail()
  451. def test_map_log(self):
  452. if not test_map_intrinsic(log):
  453. self.fail()
  454. def test_map_cos(self):
  455. if not test_map_intrinsic(cos):
  456. self.fail()
  457. def test_map_sin(self):
  458. if not test_map_intrinsic(sin):
  459. self.fail()
  460. def test_map_cosh(self):
  461. if not test_map_intrinsic(cosh):
  462. self.fail()
  463. def test_map_sinh(self):
  464. if not test_map_intrinsic(sinh):
  465. self.fail()
  466. def test_map_tan(self):
  467. if not test_map_intrinsic(tan):
  468. self.fail()
  469. def test_map_tanh(self):
  470. if not test_map_intrinsic(tanh):
  471. self.fail()
  472. def test_map_arctan(self):
  473. if not test_map_intrinsic(arctan):
  474. self.fail()
  475. def test_map_arctanh(self):
  476. if not test_map_intrinsic(arctanh):
  477. self.fail()
  478. def test_map_arcsin(self):
  479. if not test_map_intrinsic(arcsin):
  480. self.fail()
  481. def test_map_arccos(self):
  482. if not test_map_intrinsic(arccos):
  483. self.fail()
  484. def test_map_arcsinh(self):
  485. if not test_map_intrinsic(arcsinh):
  486. self.fail()
  487. if __name__ == '__main__':
  488. unittest.main()