From 70eabb12bd5e9327ccd01b1f9367fca109d4fbfa Mon Sep 17 00:00:00 2001 From: TakaRikka <38417346+TakaRikka@users.noreply.github.com> Date: Wed, 10 Nov 2021 23:54:31 -0800 Subject: wip --- include/JSystem/JMath/JMath.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'include/JSystem/JMath') diff --git a/include/JSystem/JMath/JMath.h b/include/JSystem/JMath/JMath.h index d71f5de5e7..cb252d9aea 100644 --- a/include/JSystem/JMath/JMath.h +++ b/include/JSystem/JMath/JMath.h @@ -10,6 +10,14 @@ inline f32 JMAFastReciprocal(f32 value) { return __fres(value); } +inline f32 JMAFastSqrt(f32 input) { + if (input > 0.0f) { + f64 tmp = __frsqrte(input); + return tmp * input; + } + return input; +} + namespace JMath { inline f32 fastReciprocal(f32 value) { -- cgit v1.2.3