From 1f960e3726a4cc55718c5d75a7a2b8082c6d24db Mon Sep 17 00:00:00 2001 From: numzero Date: Sun, 9 Jun 2024 22:05:51 +0300 Subject: [PATCH] Improve precision That thing is divided by, so better make it a power of two to make the division exact. --- src/bin/flat.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bin/flat.rs b/src/bin/flat.rs index 6f7a7ae..692e708 100644 --- a/src/bin/flat.rs +++ b/src/bin/flat.rs @@ -637,7 +637,7 @@ mod riemann { } fn part_derivs_at(&self, pos: Vec2) -> Tens2 { - part_deriv(|p| self.at(p), pos, 1.0e-3) + part_deriv(|p| self.at(p), pos, 1.0 / 1024.0) // division by such eps is exact which is good for overall precision } fn vec_length_at(&self, at: Vec2, v: Vec2) -> f32 {