\frac{1 - \tan x \cdot \tan x}{1 + \tan x \cdot \tan x}\mathsf{expm1}\left(\log \left(e^{\mathsf{log1p}\left(\frac{1 - \tan x \cdot \tan x}{\tan x \cdot \tan x + 1}\right)}\right)\right)double f(double x) {
double r702695 = 1.0;
double r702696 = x;
double r702697 = tan(r702696);
double r702698 = r702697 * r702697;
double r702699 = r702695 - r702698;
double r702700 = r702695 + r702698;
double r702701 = r702699 / r702700;
return r702701;
}
double f(double x) {
double r702702 = 1.0;
double r702703 = x;
double r702704 = tan(r702703);
double r702705 = r702704 * r702704;
double r702706 = r702702 - r702705;
double r702707 = r702705 + r702702;
double r702708 = r702706 / r702707;
double r702709 = log1p(r702708);
double r702710 = exp(r702709);
double r702711 = log(r702710);
double r702712 = expm1(r702711);
return r702712;
}



Bits error versus x
Results
Initial program 0.3
rmApplied expm1-log1p-u0.4
rmApplied add-log-exp0.4
Final simplification0.4
herbie shell --seed 2019158 +o rules:numerics
(FPCore (x)
:name "Trigonometry B"
(/ (- 1 (* (tan x) (tan x))) (+ 1 (* (tan x) (tan x)))))