\frac{1 - \tan x \cdot \tan x}{1 + \tan x \cdot \tan x}\frac{1 - \frac{{\left(\sin x\right)}^{2}}{{\left(\cos x\right)}^{2}}}{\frac{{\left(\sin x\right)}^{2}}{\mathsf{log1p}\left(\mathsf{expm1}\left({\left(\cos x\right)}^{2}\right)\right)} + 1}double f(double x) {
double r9929 = 1.0;
double r9930 = x;
double r9931 = tan(r9930);
double r9932 = r9931 * r9931;
double r9933 = r9929 - r9932;
double r9934 = r9929 + r9932;
double r9935 = r9933 / r9934;
return r9935;
}
double f(double x) {
double r9936 = 1.0;
double r9937 = x;
double r9938 = sin(r9937);
double r9939 = 2.0;
double r9940 = pow(r9938, r9939);
double r9941 = cos(r9937);
double r9942 = pow(r9941, r9939);
double r9943 = r9940 / r9942;
double r9944 = r9936 - r9943;
double r9945 = expm1(r9942);
double r9946 = log1p(r9945);
double r9947 = r9940 / r9946;
double r9948 = r9947 + r9936;
double r9949 = r9944 / r9948;
return r9949;
}



Bits error versus x
Results
Initial program 0.3
rmApplied tan-quot0.4
Applied associate-*r/0.4
Taylor expanded around inf 0.4
rmApplied log1p-expm1-u0.4
Final simplification0.4
herbie shell --seed 2019352 +o rules:numerics
(FPCore (x)
:name "Trigonometry B"
:precision binary64
(/ (- 1 (* (tan x) (tan x))) (+ 1 (* (tan x) (tan x)))))