#include <iostream>
#include <fstream>
#include <cmath>
#include <iomanip>

using namespace std;

int main(){
    const double dx = 1.0/1000000;
    const double xmin = 0;
    const double xmax = 1;
    const int decimals = 14;

    string output_file = "poisson_solution.csv";
    ofstream ofs(output_file);
    ofs << "x,u(x)\n";

    for(double x = xmin; x <= xmax; x += dx){
        double u = 1 - (1 - exp(-10))*x - exp(-10*x);
        ofs << fixed << setprecision(decimals) << x << "," << u << "\n";
    }
    ofs.close();
    return 0;
}