[java] Rapid trigonometric calculations

I was fairly bored earlier and decided to try to write a fast algorithm to calculate all the basic trig functions with optimizations made to their calculations due to similarities with their Taylor series.
Compared to functions such as the built in sin and cos it generally takes longer than each individual function but is faster that sin and cos performed at the same time and much faster than sin cos and tan calculated , I haven’t compared it to more assembly based ones such as fsincos so I’m not really sure about that.


public double[] sincostan(double theta){
		int accuracy = 10;
		double sin = theta;
		double cos = 1;
		double exponential = theta;
		double factorial = 1;
		double even = -1;
		double increment = 2;
		for(int i = 1; i < accuracy; i++){
			exponential *=theta;
			factorial *= (increment);
			cos += (even/factorial) * exponential;
			increment ++;
			exponential *=theta;
			factorial *= (increment);
			sin += (even/factorial) * exponential;
			increment ++;
			even*=-1;
		}
		double tan = sin/cos;
		return new double[]{sin,cos,tan};
	}

It’s simple enough to use , give a number of iterations as the accuracy variable (10 tends to give you the maximum accuracy when using doubles) and input theta as the angle in radians. If there are any improvements or comparisons please let me know!