shithub: aacenc

Download patch

ref: b6ed5e8c175d4872b3ba6bb39dc30133e9b9b9f7
parent: fd44160c16dcca17af57a0a69eb20d27f4c98e04
author: oxygene2000 <oxygene2000>
date: Mon Feb 7 12:44:47 EST 2000

Another speedup by solving calculations into something more simple but equivalent

--- a/psych.c
+++ b/psych.c
@@ -52,9 +52,9 @@
 
 Source file:
 
-$Id: psych.c,v 1.37 2000/02/07 16:43:48 oxygene2000 Exp $
-$Id: psych.c,v 1.37 2000/02/07 16:43:48 oxygene2000 Exp $
-$Id: psych.c,v 1.37 2000/02/07 16:43:48 oxygene2000 Exp $
+$Id: psych.c,v 1.38 2000/02/07 17:44:47 oxygene2000 Exp $
+$Id: psych.c,v 1.38 2000/02/07 17:44:47 oxygene2000 Exp $
+$Id: psych.c,v 1.38 2000/02/07 17:44:47 oxygene2000 Exp $
 
 **********************************************************************/
 
@@ -739,8 +739,12 @@
 		fp = psy_var_long->f_pred[w];
 
 		if( fabs(r) + fabs(rp) != 0.0 )
+/* Replacing with something faster
 			psy_var_long->c[w] = sqrt( psy_sqr(r*cos(f) - rp*cos(fp))
 				+psy_sqr(r*sin(f) - rp*sin(fp)) )/ ( r + fabs(rp) );
+*/
+			psy_var_long->c[w] = sqrt( r*r+rp*rp-2*r*rp*cos(f+fp) )/ ( r + fabs(rp) );
+
 		else
 			psy_var_long->c[w] = 0.0; /* tmp */
     }