From 3993dbc80a98be230ff797b9e966b636e9e80640 Mon Sep 17 00:00:00 2001 From: d_m Date: Sun, 5 Nov 2023 21:03:21 -0500 Subject: [PATCH] fix trig bug --- fix16.tal | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/fix16.tal b/fix16.tal index e8bf879..64ad2d2 100644 --- a/fix16.tal +++ b/fix16.tal @@ -343,12 +343,9 @@ POP2r POP2r NIP2 JMP2r ( s1* ) @x16-cos ( x* -> cos[x]* ) - x16-pi/2 ,&x16-sin-cos-helper/offset STR2 !sin-cos-helper + x16-pi/2 ADD2 @x16-sin ( x* -> sin[x]* ) - #0000 ,&x16-sin-cos-helper/offset STR2 ( fall-through ) - -@x16-sin-cos-helper DUP2 #8000 LTH2 ?&non-negative x16-negate x16-sin/non-negative !x16-negate &non-negative @@ -356,7 +353,6 @@ DUP2 STH2kr x16-quotient ( x x/2pi [2pi] ) DUP2 #1400 DIV2 STH2 SWP2r ( x x/2pi [adj* 2pi*] ) STH2r x16-mul STH2r ADD2 SUB2 ( x' ; 0 <= x' < 2pi ) - LIT2 [ &offset $2 ] ADD2 DUP2 x16-3pi/2 LTH2 ?&c1 ( -sin(2pi - x) ) x16-pi*2 SWP2 SUB2 x16-sin-q !x16-negate &c1 DUP2 x16-pi LTH2 ?&c2