This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <functional> | |
#include <iostream> | |
#include <vector> | |
using namespace std; | |
const size_t NNODE = 3; | |
void print_x(size_t num_triangle, function<vector<double> const *(size_t, size_t)> get_x) { | |
for (size_t t = 0; t < num_triangle; t++) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Evil Floating-Point Computations (using Mathematica 13.1) | |
Analytical | |
In[1]:= a={32 10^7,1,-1,8 10^7} | |
Out[1]= {320000000,1,-1,80000000} | |
In[2]:= b={4 10^7,1,-1,-16 10^7} | |
Out[2]= {40000000,1,-1,-160000000} | |
In[3]:= a b | |
Out[3]= {12800000000000000,1,1,-12800000000000000} | |
In[4]:= Total[a b] |