Code-Eli  0.3.6
dual_math.hpp
Go to the documentation of this file.
1 /*********************************************************************************
2 * Copyright (c) 2013 David D. Marshall <ddmarsha@calpoly.edu>
3 *
4 * All rights reserved. This program and the accompanying materials
5 * are made available under the terms of the Eclipse Public License v1.0
6 * which accompanies this distribution, and is available at
7 * http://www.eclipse.org/legal/epl-v10.html
8 *
9 * Contributors:
10 * David D. Marshall - initial code and implementation
11 ********************************************************************************/
12 
13 #ifndef eli_mutil_ad_dual_math_hpp
14 #define eli_mutil_ad_dual_math_hpp
15 
16 #include "eli/code_eli.hpp"
17 
18 #include "eli/constants/math.hpp"
20 
21 #include <cmath>
22 
23 // sin and std::sin
24 namespace eli
25 {
26  namespace mutil
27  {
28  namespace ad
29  {
30  template <typename T__>
31  struct sin_fun
32  {
33  static T__ f(const T__ &t) {return std::sin(t);}
34  static T__ fp(const T__ &t) {return std::cos(t);}
35  static T__ fp(const T__ &t, const size_t &n)
36  {
37  switch(n%4)
38  {
39  case(0):
40  {
41  return f(t);
42  break;
43  }
44  case(1):
45  {
46  return fp(t);
47  break;
48  }
49  case(2):
50  {
51  return -std::sin(t);
52  break;
53  }
54  default:
55  case(3):
56  {
57  return -std::cos(t);
58  break;
59  }
60  }
61  }
62  };
63  }
64  }
65 }
66 namespace std { ELI_AD_DUAL_UNARY_OP_HELPER(sin) }
67 using std::sin;
68 
69 // cos and std::cos
70 namespace eli
71 {
72  namespace mutil
73  {
74  namespace ad
75  {
76  template <typename T__>
77  struct cos_fun
78  {
79  static T__ f(const T__ &t) {return std::cos(t);}
80  static T__ fp(const T__ &t) {return -std::sin(t);}
81  static T__ fp(const T__ &t, const size_t &n)
82  {
83  switch(n%4)
84  {
85  case(0):
86  {
87  return f(t);
88  break;
89  }
90  case(1):
91  {
92  return fp(t);
93  break;
94  }
95  case(2):
96  {
97  return -std::cos(t);
98  break;
99  }
100  default:
101  case(3):
102  {
103  return std::sin(t);
104  break;
105  }
106  }
107  }
108  };
109  }
110  }
111 }
112 namespace std { ELI_AD_DUAL_UNARY_OP_HELPER(cos) }
113 using std::cos;
114 
115 // tan and std::tan
116 namespace eli
117 {
118  namespace mutil
119  {
120  namespace ad
121  {
122  template <typename T__>
123  struct tan_fun
124  {
125  static T__ f(const T__ &t) {return std::tan(t);}
126  static T__ fp(const T__ &t) {T__ v(std::cos(t)); return 1/v/v;}
127  static T__ fp(const T__ &t, const size_t &n)
128  {
129  switch(n)
130  {
131  case(0):
132  {
133  return f(t);
134  break;
135  }
136  case(1):
137  {
138  return fp(t);
139  break;
140  }
141  default:
142  {
143  // TODO: IMPLEMENT THIS ALGORITHM
144  // d(tan)=1+tan^2
145  // d^n(tan)=n*tan^(n-1)+n*tan^(n+1)
146  assert(false);
147  return 0;
148  break;
149  }
150  }
151  }
152  };
153  }
154  }
155 }
156 namespace std { ELI_AD_DUAL_UNARY_OP_HELPER(tan) }
157 using std::tan;
158 
159 // asin and std::asin
160 namespace eli
161 {
162  namespace mutil
163  {
164  namespace ad
165  {
166  template <typename T__>
167  struct asin_fun
168  {
169  static T__ f(const T__ &t) {return std::asin(t);}
170  static T__ fp(const T__ &t) {return 1/std::sqrt(1-t*t);}
171  static T__ fp(const T__ &t, const size_t &n)
172  {
173  switch(n)
174  {
175  case(0):
176  {
177  return f(t);
178  break;
179  }
180  case(1):
181  {
182  return fp(t);
183  break;
184  }
185  default:
186  case(2):
187  {
188  // TODO: IMPLEMENT THIS
189  assert(false);
190  return 0;
191  break;
192  }
193  }
194  }
195  };
196  }
197  }
198 }
199 namespace std { ELI_AD_DUAL_UNARY_OP_HELPER(asin) }
200 using std::asin;
201 
202 // acos and std::acos
203 namespace eli
204 {
205  namespace mutil
206  {
207  namespace ad
208  {
209  template <typename T__>
210  struct acos_fun
211  {
212  static T__ f(const T__ &t) {return std::acos(t);}
213  static T__ fp(const T__ &t) {return -1/std::sqrt(1-t*t);}
214  static T__ fp(const T__ &t, const size_t &n)
215  {
216  switch(n)
217  {
218  case(0):
219  {
220  return f(t);
221  break;
222  }
223  case(1):
224  {
225  return fp(t);
226  break;
227  }
228  default:
229  case(2):
230  {
231  // TODO: IMPLEMENT THIS
232  assert(false);
233  return 0;
234  break;
235  }
236  }
237  }
238  };
239  }
240  }
241 }
242 namespace std { ELI_AD_DUAL_UNARY_OP_HELPER(acos) }
243 using std::acos;
244 
245 // atan and std::atan
246 namespace eli
247 {
248  namespace mutil
249  {
250  namespace ad
251  {
252  template <typename T__>
253  struct atan_fun
254  {
255  static T__ f(const T__ &t) {return std::atan(t);}
256  static T__ fp(const T__ &t) {return 1/(1+t*t);}
257  static T__ fp(const T__ &t, const size_t &n)
258  {
259  switch(n)
260  {
261  case(0):
262  {
263  return f(t);
264  break;
265  }
266  case(1):
267  {
268  return fp(t);
269  break;
270  }
271  default:
272  case(2):
273  {
274  // TODO: IMPLEMENT THIS
275  assert(false);
276  return 0;
277  break;
278  }
279  }
280  }
281  };
282  }
283  }
284 }
285 namespace std { ELI_AD_DUAL_UNARY_OP_HELPER(atan) }
286 using std::atan;
287 
288 // atan2 and std::atan2
289 namespace eli
290 {
291  namespace mutil
292  {
293  namespace ad
294  {
295  template <typename T__>
296  struct atan2_fun
297  {
298  static T__ f(const T__ &y, const T__ &x) {return std::atan2(y, x);}
299  static T__ fx(const T__ &y, const T__ &x) {return -y/(x*x+y*y);}
300  static T__ fy(const T__ &y, const T__ &x) {return x/(x*x+y*y);}
301  static T__ fxy(const T__ &y, const T__ &x, const size_t &nx, const size_t &ny)
302  {
303  switch(nx)
304  {
305  case(0):
306  {
307  switch(ny)
308  {
309  case(0):
310  {
311  return f(y,x);
312  break;
313  }
314  case(1):
315  {
316  return fy(y,x);
317  break;
318  }
319  default:
320  {
321  // TODO: NEED TO IMPLEMENT THIS
322  assert(false);
323  return 0;
324  break;
325  }
326  }
327  }
328  case(1):
329  {
330  switch(ny)
331  {
332  case(0):
333  {
334  return fx(y,x);
335  break;
336  }
337  default:
338  {
339  // TODO: NEED TO IMPLEMENT THIS
340  assert(false);
341  return 0;
342  break;
343  }
344  }
345  }
346  default:
347  case(2):
348  {
349  // TODO: IMPLEMENT THIS
350  assert(false);
351  return 0;
352  break;
353  }
354  }
355  }
356  };
357  }
358  }
359 }
360 namespace std { ELI_AD_DUAL_UNARY_OP_HELPER(atan2) }
361 using std::atan2;
362 
363 
364 // sinh and std::sinh
365 namespace eli
366 {
367  namespace mutil
368  {
369  namespace ad
370  {
371  template <typename T__>
372  struct sinh_fun
373  {
374  static T__ f(const T__ &t) {return std::sinh(t);}
375  static T__ fp(const T__ &t) {return std::cosh(t);}
376  static T__ fp(const T__ &t, const size_t &n)
377  {
378  if ((n%2)==0)
379  return f(t);
380  else
381  return fp(t);
382  }
383  };
384  }
385  }
386 }
387 namespace std { ELI_AD_DUAL_UNARY_OP_HELPER(sinh) }
388 using std::sinh;
389 
390 // cosh and std::cosh
391 namespace eli
392 {
393  namespace mutil
394  {
395  namespace ad
396  {
397  template <typename T__>
398  struct cosh_fun
399  {
400  static T__ f(const T__ &t) {return std::cosh(t);}
401  static T__ fp(const T__ &t) {return std::sinh(t);}
402  static T__ fp(const T__ &t, const size_t &n)
403  {
404  if ((n%2)==0)
405  return f(t);
406  else
407  return fp(t);
408  }
409  };
410  }
411  }
412 }
413 namespace std { ELI_AD_DUAL_UNARY_OP_HELPER(cosh) }
414 using std::cosh;
415 
416 // tanh and std::tanh
417 namespace eli
418 {
419  namespace mutil
420  {
421  namespace ad
422  {
423  template <typename T__>
424  struct tanh_fun
425  {
426  static T__ f(const T__ &t) {return std::tanh(t);}
427  static T__ fp(const T__ &t) {T__ v(std::cosh(t)); return 1/v/v;}
428  static T__ fp(const T__ &t, const size_t &n)
429  {
430  switch(n)
431  {
432  case(0):
433  {
434  return f(t);
435  break;
436  }
437  case(1):
438  {
439  return fp(t);
440  break;
441  }
442  default:
443  {
444  // TODO: IMPLEMENT THIS ALGORITHM
445  // d(tanh)=1-tanh^2
446  // d(tanh^n)=n*tanh^(n-1)-n*tanh^(n+1)
447  assert(false);
448  return 0;
449  break;
450  }
451  }
452  }
453  };
454  }
455  }
456 }
457 namespace std { ELI_AD_DUAL_UNARY_OP_HELPER(tanh) }
458 using std::tanh;
459 
460 // asinh and std::asinh
461 namespace eli
462 {
463  namespace mutil
464  {
465  namespace ad
466  {
467  template <typename T__>
468  struct asinh_fun
469  {
470  static T__ f(const T__ &t) {return std::asinh(t);}
471  static T__ fp(const T__ &t) {return 1/std::sqrt(1+t*t);}
472  static T__ fp(const T__ &t, const size_t &n)
473  {
474  switch(n)
475  {
476  case(0):
477  {
478  return f(t);
479  break;
480  }
481  case(1):
482  {
483  return fp(t);
484  break;
485  }
486  default:
487  case(2):
488  {
489  // TODO: IMPLEMENT THIS
490  assert(false);
491  return 0;
492  break;
493  }
494  }
495  }
496  };
497  }
498  }
499 }
500 namespace std { ELI_AD_DUAL_UNARY_OP_HELPER(asinh) }
501 using std::asinh;
502 
503 // acos and std::acosh
504 namespace eli
505 {
506  namespace mutil
507  {
508  namespace ad
509  {
510  template <typename T__>
511  struct acosh_fun
512  {
513  static T__ f(const T__ &t) {return std::acosh(t);}
514  static T__ fp(const T__ &t) {return 1/std::sqrt(t*t-1);}
515  static T__ fp(const T__ &t, const size_t &n)
516  {
517  switch(n)
518  {
519  case(0):
520  {
521  return f(t);
522  break;
523  }
524  case(1):
525  {
526  return fp(t);
527  break;
528  }
529  default:
530  case(2):
531  {
532  // TODO: IMPLEMENT THIS
533  assert(false);
534  return 0;
535  break;
536  }
537  }
538  }
539  };
540  }
541  }
542 }
543 namespace std { ELI_AD_DUAL_UNARY_OP_HELPER(acosh) }
544 using std::acosh;
545 
546 // atanh and std::atanh
547 namespace eli
548 {
549  namespace mutil
550  {
551  namespace ad
552  {
553  template <typename T__>
554  struct atanh_fun
555  {
556  static T__ f(const T__ &t) {return std::atanh(t);}
557  static T__ fp(const T__ &t) {return 1/(1-t*t);}
558  static T__ fp(const T__ &t, const size_t &n)
559  {
560  switch(n)
561  {
562  case(0):
563  {
564  return f(t);
565  break;
566  }
567  case(1):
568  {
569  return fp(t);
570  break;
571  }
572  default:
573  case(2):
574  {
575  // TODO: IMPLEMENT THIS
576  assert(false);
577  return 0;
578  break;
579  }
580  }
581  }
582  };
583  }
584  }
585 }
586 namespace std { ELI_AD_DUAL_UNARY_OP_HELPER(atanh) }
587 using std::atanh;
588 
589 // exp and std::exp
590 namespace eli
591 {
592  namespace mutil
593  {
594  namespace ad
595  {
596  template <typename T__>
597  struct exp_fun
598  {
599  static T__ f(const T__ &t) {return std::exp(t);}
600  static T__ fp(const T__ &t) {return std::exp(t);}
601  static T__ fp(const T__ &t, const size_t &/*n*/) {return std::exp(t);}
602  };
603  }
604  }
605 }
606 namespace std { ELI_AD_DUAL_UNARY_OP_HELPER(exp) }
607 using std::exp;
608 
609 // expm1 and std::expm1
610 namespace eli
611 {
612  namespace mutil
613  {
614  namespace ad
615  {
616  template <typename T__>
617  struct expm1_fun
618  {
619  static T__ f(const T__ &t) {return std::expm1(t);}
620  static T__ fp(const T__ &t) {return std::exp(t);}
621  static T__ fp(const T__ &t, const size_t &/*n*/) {return std::exp(t);}
622  };
623  }
624  }
625 }
626 namespace std { ELI_AD_DUAL_UNARY_OP_HELPER(expm1) }
627 using std::expm1;
628 
629 // exp2 and std::exp2
630 namespace eli
631 {
632  namespace mutil
633  {
634  namespace ad
635  {
636  template <typename T__>
637  struct exp2_fun
638  {
639  static T__ f(const T__ &t) {return std::exp2(t);}
640  static T__ fp(const T__ &t) {return std::log(static_cast<T__>(2))*std::exp2(t);}
641  static T__ fp(const T__ &t, const size_t &n)
642  {
643  switch (n)
644  {
645  case(0):
646  {
647  return f(t);
648  break;
649  }
650  case(1):
651  {
652  return fp(t);
653  break;
654  }
655  default:
656  {
657  return std::pow(std::log(static_cast<T__>(2)),n-1)*std::exp2(t);
658  }
659  }
660  }
661  };
662  }
663  }
664 }
665 namespace std { ELI_AD_DUAL_UNARY_OP_HELPER(exp2) }
666 using std::exp2;
667 
668 // log and std::log
669 namespace eli
670 {
671  namespace mutil
672  {
673  namespace ad
674  {
675  template <typename T__>
676  struct log_fun
677  {
678  static T__ f(const T__ &t) {return std::log(t);}
679  static T__ fp(const T__ &t) {return 1/t;}
680  static T__ fp(const T__ &t, const size_t &n)
681  {
682  switch(n)
683  {
684  case(0):
685  {
686  return f(t);
687  break;
688  }
689  case(1):
690  {
691  return fp(t);
692  break;
693  }
694  default:
695  {
696  T__ val(fp(t));
697  for (size_t i=2; i<=n; ++i)
698  val/=-t/i;
699  return val;
700  }
701  }
702  }
703  };
704  }
705  }
706 }
707 namespace std { ELI_AD_DUAL_UNARY_OP_HELPER(log) }
708 using std::log;
709 
710 // log10 and std::log10
711 namespace eli
712 {
713  namespace mutil
714  {
715  namespace ad
716  {
717  template <typename T__>
718  struct log10_fun
719  {
720  static T__ f(const T__ &t) {return std::log10(t);}
721  static T__ fp(const T__ &t) {return 1/t/std::log(static_cast<T__>(10));}
722  static T__ fp(const T__ &t, const size_t &n)
723  {
724  switch(n)
725  {
726  case(0):
727  {
728  return f(t);
729  break;
730  }
731  case(1):
732  {
733  return fp(t);
734  break;
735  }
736  default:
737  {
738  T__ val(fp(t)/std::log(static_cast<T__>(10)));
739  for (size_t i=2; i<=n; ++i)
740  val/=-t/i;
741  return val;
742  }
743  }
744  }
745  };
746  }
747  }
748 }
749 namespace std { ELI_AD_DUAL_UNARY_OP_HELPER(log10) }
750 using std::log10;
751 
752 // log2 and std::log2
753 namespace eli
754 {
755  namespace mutil
756  {
757  namespace ad
758  {
759  template <typename T__>
760  struct log2_fun
761  {
762  static T__ f(const T__ &t) {return std::log2(t);}
763  static T__ fp(const T__ &t) {return 1/t/std::log(static_cast<T__>(2));}
764  static T__ fp(const T__ &t, const size_t &n)
765  {
766  switch(n)
767  {
768  case(0):
769  {
770  return f(t);
771  break;
772  }
773  case(1):
774  {
775  return fp(t);
776  break;
777  }
778  default:
779  {
780  T__ val(fp(t)/std::log(static_cast<T__>(2)));
781  for (size_t i=2; i<=n; ++i)
782  val/=-t/i;
783  return val;
784  }
785  }
786  }
787  };
788  }
789  }
790 }
791 namespace std { ELI_AD_DUAL_UNARY_OP_HELPER(log2) }
792 using std::log2;
793 
794 // log1p and std::log1p
795 namespace eli
796 {
797  namespace mutil
798  {
799  namespace ad
800  {
801  template <typename T__>
802  struct log1p_fun
803  {
804  static T__ f(const T__ &t) {return std::log1p(t);}
805  static T__ fp(const T__ &t) {return 1/(1+t);}
806  static T__ fp(const T__ &t, const size_t &n)
807  {
808  switch(n)
809  {
810  case(0):
811  {
812  return f(t);
813  break;
814  }
815  case(1):
816  {
817  return fp(t);
818  break;
819  }
820  default:
821  {
822  T__ val(fp(t));
823  for (size_t i=2; i<=n; ++i)
824  val/=-(1+t)/i;
825  return val;
826  }
827  }
828  }
829  };
830  }
831  }
832 }
833 namespace std { ELI_AD_DUAL_UNARY_OP_HELPER(log1p) }
834 using std::log1p;
835 
836 // sqrt and std::sqrt
837 namespace eli
838 {
839  namespace mutil
840  {
841  namespace ad
842  {
843  template <typename T__>
844  struct sqrt_fun
845  {
846  static T__ f(const T__ &t) {return std::sqrt(t);}
847  static T__ fp(const T__ &t) {return static_cast<T__>(0.5)/std::sqrt(t);}
848  static T__ fp(const T__ &t, const size_t &n)
849  {
850  switch(n)
851  {
852  case(0):
853  {
854  return f(t);
855  break;
856  }
857  case(1):
858  {
859  return fp(t);
860  break;
861  }
862  default:
863  {
864  T__ val(fp(t));
865  for (size_t i=1; i<n; ++i)
866  val*=0.5*(1-2*i)/t;
867 
868  return val;
869  }
870  }
871  }
872  };
873  }
874  }
875 }
876 namespace std { ELI_AD_DUAL_UNARY_OP_HELPER(sqrt) }
877 using std::sqrt;
878 
879 // cbrt and std::cbrt
880 namespace eli
881 {
882  namespace mutil
883  {
884  namespace ad
885  {
886  template <typename T__>
887  struct cbrt_fun
888  {
889  static T__ f(const T__ &t) {return std::cbrt(t);}
890  static T__ fp(const T__ &t) {return (static_cast<T__>(1)/static_cast<T__>(3))/std::cbrt(t*t);}
891  static T__ fp(const T__ &t, const size_t &n)
892  {
893  switch(n)
894  {
895  case(0):
896  {
897  return f(t);
898  break;
899  }
900  case(1):
901  {
902  return fp(t);
903  break;
904  }
905  default:
906  {
907  T__ val(fp(t));
908  for (size_t i=1; i<n; ++i)
909  val*=(1-3*i)/t/3;
910 
911  return val;
912  }
913  }
914  }
915  };
916  }
917  }
918 }
919 namespace std { ELI_AD_DUAL_UNARY_OP_HELPER(cbrt) }
920 using std::cbrt;
921 
922 // abs and std::abs
923 namespace eli
924 {
925  namespace mutil
926  {
927  namespace ad
928  {
929  template <typename T__>
930  struct abs_fun
931  {
932  static T__ f(const T__ &t) {return std::abs(t);}
933  static T__ fp(const T__ &t) {return (t<0)?(static_cast<T__>(-1)):(static_cast<T__>(1));}
934  static T__ fp(const T__ &t, const size_t &n)
935  {
936  switch(n)
937  {
938  case(0):
939  {
940  return f(t);
941  break;
942  }
943  case(1):
944  {
945  return fp(t);
946  break;
947  }
948  default:
949  {
950  return 0;
951  }
952  }
953  }
954  };
955  }
956  }
957 }
958 namespace std { ELI_AD_DUAL_UNARY_OP_HELPER(abs) }
959 using std::abs;
960 
961 // ceil and std::ceil
962 namespace eli
963 {
964  namespace mutil
965  {
966  namespace ad
967  {
968  template <typename T__>
969  struct ceil_fun
970  {
971  static T__ f(const T__ &t) {return std::ceil(t);}
972  static T__ fp(const T__ &/*t*/) {return 0;}
973  static T__ fp(const T__ &t, const size_t &n)
974  {
975  if (n==0)
976  return f(t);
977  else
978  return 0;
979  }
980  };
981  }
982  }
983 }
984 namespace std { ELI_AD_DUAL_UNARY_OP_HELPER(ceil) }
985 using std::ceil;
986 
987 // floor and std::floor
988 namespace eli
989 {
990  namespace mutil
991  {
992  namespace ad
993  {
994  template <typename T__>
995  struct floor_fun
996  {
997  static T__ f(const T__ &t) {return std::floor(t);}
998  static T__ fp(const T__ &/*t*/) {return 0;}
999  static T__ fp(const T__ &t, const size_t &n)
1000  {
1001  if (n==0)
1002  return f(t);
1003  else
1004  return 0;
1005  }
1006  };
1007  }
1008  }
1009 }
1010 namespace std { ELI_AD_DUAL_UNARY_OP_HELPER(floor) }
1011 using std::floor;
1012 
1013 // erf and std::erf
1014 namespace eli
1015 {
1016  namespace mutil
1017  {
1018  namespace ad
1019  {
1020  template <typename T__>
1021  struct erf_fun
1022  {
1023  static T__ f(const T__ &t) {return std::erf(t);}
1024  static T__ fp(const T__ &t)
1025  {
1026  return static_cast<T__>(2)*std::exp(-t*t)/eli::constants::math<T__>::sqrt_pi();
1027  }
1028  static T__ fp(const T__ &t, const size_t &n)
1029  {
1030  switch(n)
1031  {
1032  case(0):
1033  {
1034  return f(t);
1035  break;
1036  }
1037  case(1):
1038  {
1039  return fp(t);
1040  break;
1041  }
1042  default:
1043  {
1044  // TODO: IMPLEMENT THIS
1045  assert(false);
1046  return 0;
1047  }
1048  }
1049  }
1050  };
1051  }
1052  }
1053 }
1054 namespace std { ELI_AD_DUAL_UNARY_OP_HELPER(erf) }
1055 using std::erf;
1056 
1057 // erfc and std::erfc
1058 namespace eli
1059 {
1060  namespace mutil
1061  {
1062  namespace ad
1063  {
1064  template <typename T__>
1065  struct erfc_fun
1066  {
1067  static T__ f(const T__ &t) {return std::erfc(t);}
1068  static T__ fp(const T__ &t)
1069  {
1070  return -2*std::exp(-t*t)/eli::constants::math<T__>::sqrt_pi();
1071  }
1072  static T__ fp(const T__ &t, const size_t &n)
1073  {
1074  switch(n)
1075  {
1076  case(0):
1077  {
1078  return f(t);
1079  break;
1080  }
1081  case(1):
1082  {
1083  return fp(t);
1084  break;
1085  }
1086  default:
1087  {
1088  // TODO: IMPLEMENT THIS
1089  assert(false);
1090  return 0;
1091  }
1092  }
1093  }
1094  };
1095  }
1096  }
1097 }
1098 namespace std { ELI_AD_DUAL_UNARY_OP_HELPER(erfc) }
1099 using std::erfc;
1100 
1101 #endif
Definition: dual_math.hpp:31
static T__ f(const T__ &t)
Definition: dual_math.hpp:125
static T__ fp(const T__ &t, const size_t &n)
Definition: dual_math.hpp:806
Definition: math.hpp:20
static T__ fp(const T__ &t, const size_t &n)
Definition: dual_math.hpp:973
Definition: dual_math.hpp:253
static T__ fp(const T__ &t)
Definition: dual_math.hpp:514
Definition: dual_math.hpp:844
Definition: dual_math.hpp:77
Definition: dual_math.hpp:597
static T__ f(const T__ &t)
Definition: dual_math.hpp:846
static T__ fp(const T__ &t)
Definition: dual_math.hpp:1024
static T__ fp(const T__ &t)
Definition: dual_math.hpp:620
static T__ fp(const T__ &t)
Definition: dual_math.hpp:256
static T__ fp(const T__ &t)
Definition: dual_math.hpp:80
Definition: dual_math.hpp:676
static T__ f(const T__ &t)
Definition: dual_math.hpp:762
static T__ fp(const T__ &t)
Definition: dual_math.hpp:640
Definition: dual_math.hpp:637
Definition: dual_math.hpp:372
Definition: dual_math.hpp:123
static T__ f(const T__ &t)
Definition: dual_math.hpp:720
static T__ fp(const T__ &t)
Definition: dual_math.hpp:679
Definition: dual_math.hpp:1065
static T__ fp(const T__ &t, const size_t &n)
Definition: dual_math.hpp:848
static T__ fp(const T__ &t)
Definition: dual_math.hpp:401
static T__ fy(const T__ &y, const T__ &x)
Definition: dual_math.hpp:300
static T__ fp(const T__ &t, const size_t &)
Definition: dual_math.hpp:601
STL namespace.
static T__ fp(const T__ &t)
Definition: dual_math.hpp:34
static T__ fx(const T__ &y, const T__ &x)
Definition: dual_math.hpp:299
static T__ fp(const T__ &t)
Definition: dual_math.hpp:721
static T__ f(const T__ &t)
Definition: dual_math.hpp:619
static T__ f(const T__ &t)
Definition: dual_math.hpp:212
Definition: dual_math.hpp:930
Definition: dual_math.hpp:1021
Definition: math.hpp:25
Definition: dual_math.hpp:995
static T__ fp(const T__ &t, const size_t &n)
Definition: dual_math.hpp:1028
Definition: dual_math.hpp:398
static T__ fp(const T__ &t, const size_t &n)
Definition: dual_math.hpp:722
Definition: dual_math.hpp:718
static T__ fp(const T__ &)
Definition: dual_math.hpp:998
static T__ fp(const T__ &t, const size_t &n)
Definition: dual_math.hpp:402
static T__ fp(const T__ &t, const size_t &n)
Definition: dual_math.hpp:934
static T__ f(const T__ &t)
Definition: dual_math.hpp:971
static T__ fp(const T__ &t)
Definition: dual_math.hpp:427
static T__ f(const T__ &t)
Definition: dual_math.hpp:169
Definition: dual_math.hpp:617
static T__ f(const T__ &t)
Definition: dual_math.hpp:997
static T__ fp(const T__ &t)
Definition: dual_math.hpp:1068
static T__ fp(const T__ &t, const size_t &n)
Definition: dual_math.hpp:515
Definition: dual_math.hpp:760
static T__ fp(const T__ &t, const size_t &n)
Definition: dual_math.hpp:472
static T__ fp(const T__ &t, const size_t &n)
Definition: dual_math.hpp:680
static T__ f(const T__ &t)
Definition: dual_math.hpp:804
Definition: dual_math.hpp:468
static T__ f(const T__ &t)
Definition: dual_math.hpp:400
static T__ f(const T__ &t)
Definition: dual_math.hpp:255
Definition: dual_math.hpp:210
static T__ f(const T__ &t)
Definition: dual_math.hpp:932
Definition: dual_math.hpp:424
Definition: dual_math.hpp:511
static T__ f(const T__ &t)
Definition: dual_math.hpp:678
static T__ f(const T__ &t)
Definition: dual_math.hpp:374
static T__ fp(const T__ &t, const size_t &n)
Definition: dual_math.hpp:641
static T__ fp(const T__ &t)
Definition: dual_math.hpp:375
static T__ f(const T__ &y, const T__ &x)
Definition: dual_math.hpp:298
static T__ fp(const T__ &t)
Definition: dual_math.hpp:763
static T__ f(const T__ &t)
Definition: dual_math.hpp:513
static T__ fp(const T__ &t)
Definition: dual_math.hpp:170
static T__ fp(const T__ &t, const size_t &n)
Definition: dual_math.hpp:558
static T__ f(const T__ &t)
Definition: dual_math.hpp:33
static T__ fp(const T__ &t)
Definition: dual_math.hpp:933
static T__ f(const T__ &t)
Definition: dual_math.hpp:639
static T__ fp(const T__ &t)
Definition: dual_math.hpp:213
static T__ fp(const T__ &t, const size_t &n)
Definition: dual_math.hpp:891
static T__ fp(const T__ &t, const size_t &n)
Definition: dual_math.hpp:428
static T__ fp(const T__ &t, const size_t &)
Definition: dual_math.hpp:621
static T__ f(const T__ &t)
Definition: dual_math.hpp:599
static T__ fp(const T__ &t)
Definition: dual_math.hpp:890
static T__ fxy(const T__ &y, const T__ &x, const size_t &nx, const size_t &ny)
Definition: dual_math.hpp:301
static T__ fp(const T__ &t, const size_t &n)
Definition: dual_math.hpp:171
static T__ f(const T__ &t)
Definition: dual_math.hpp:1023
static T__ fp(const T__ &t)
Definition: dual_math.hpp:126
Definition: dual_math.hpp:167
static T__ f(const T__ &t)
Definition: dual_math.hpp:426
static T__ fp(const T__ &t, const size_t &n)
Definition: dual_math.hpp:764
static T__ fp(const T__ &t, const size_t &n)
Definition: dual_math.hpp:35
static T__ f(const T__ &t)
Definition: dual_math.hpp:889
static T__ fp(const T__ &t)
Definition: dual_math.hpp:471
static T__ fp(const T__ &t, const size_t &n)
Definition: dual_math.hpp:127
static T__ f(const T__ &t)
Definition: dual_math.hpp:1067
static T__ f(const T__ &t)
Definition: dual_math.hpp:556
Definition: dual_math.hpp:296
Definition: dual_math.hpp:887
static T__ f(const T__ &t)
Definition: dual_math.hpp:470
static T__ fp(const T__ &t)
Definition: dual_math.hpp:600
Definition: dual_math.hpp:554
static T__ fp(const T__ &t, const size_t &n)
Definition: dual_math.hpp:81
static T__ fp(const T__ &t, const size_t &n)
Definition: dual_math.hpp:999
static T__ fp(const T__ &t, const size_t &n)
Definition: dual_math.hpp:214
static T__ fp(const T__ &t, const size_t &n)
Definition: dual_math.hpp:257
static T__ fp(const T__ &)
Definition: dual_math.hpp:972
static T__ f(const T__ &t)
Definition: dual_math.hpp:79
static T__ fp(const T__ &t)
Definition: dual_math.hpp:805
static T__ fp(const T__ &t)
Definition: dual_math.hpp:847
static T__ fp(const T__ &t, const size_t &n)
Definition: dual_math.hpp:1072
static T__ fp(const T__ &t)
Definition: dual_math.hpp:557
static T__ fp(const T__ &t, const size_t &n)
Definition: dual_math.hpp:376
Definition: dual_math.hpp:969
Definition: dual_math.hpp:802
#define ELI_AD_DUAL_UNARY_OP_HELPER(x)
Definition: dual_functions.hpp:58