Merge remote-tracking branch 'origin/main'

# Conflicts:
#	src/main.rs
This commit is contained in:
2024-06-03 09:55:48 +02:00
2 changed files with 9 additions and 7 deletions

View File

@@ -14,17 +14,17 @@ mod bounds;
mod function;
mod plot;
const THREAD_CNT: usize = 8;
const THREAD_CNT: usize = 20;
const SAMPLE_LIMIT: usize = 100_000_000;
const SUB_SAMPLES: [usize; 3] = [1, 2, 5];
const SAMPLES_PER_ITERATION: usize = 250;
fn f(x: &f64) -> f64 {
E.powf(*x) * (1.0 / (*x).sin()).cos() + (*x).powf(2.0)
fn f(x: f64) -> f64 {
E.powf(x) * (1.0 / x.sin()).cos() + x.powf(2.0)
}
fn main() {
let bounds: Bounds = Bounds::new(LinearBounds::new(3.1_f64, 3.2_f64), LinearBounds::new(-15_f64, 35_f64));
let bounds: Bounds = Bounds::new(LinearBounds::new(3.1_f64, 3.2_f64), LinearBounds::new(-10_f64, 35_f64));
let func: Function = Function::new(f);
//let start: Instant = Instant::now();
@@ -48,6 +48,8 @@ fn simulate(bounds: &Bounds, func: &Function) {
println!();
}
sample_cnt *= 10;
}
result.print();
let file: io::Result<File> = File::create(format!("output{}.json", sample_cnt.ilog10()));
if file.is_err() {