Skip to content

Instantly share code, notes, and snippets.

#include <cmath>
#include <functional>
#include <iomanip>
#include <iostream>
#include <random>
using namespace std;
int main() {
double pi_ref=3.14159265359, r_max=1000000000.0, n_max=10000000.0;
auto axis = bind(uniform_real_distribution<double>(0.0, 2*r_max), mt19937(random_device()()));
auto estimate_pi = [&](double r, double n) -> double {