\frac{1 - \tan x \cdot \tan x}{1 + \tan x \cdot \tan x}\mathsf{log1p}\left(\mathsf{expm1}\left(\frac{1}{\mathsf{fma}\left(\tan x, \tan x, 1\right)}\right)\right) - \frac{\tan x}{\frac{\mathsf{fma}\left(\tan x, \tan x, 1\right)}{\tan x}}double f(double x) {
double r21458 = 1.0;
double r21459 = x;
double r21460 = tan(r21459);
double r21461 = r21460 * r21460;
double r21462 = r21458 - r21461;
double r21463 = r21458 + r21461;
double r21464 = r21462 / r21463;
return r21464;
}
double f(double x) {
double r21465 = 1.0;
double r21466 = x;
double r21467 = tan(r21466);
double r21468 = fma(r21467, r21467, r21465);
double r21469 = r21465 / r21468;
double r21470 = expm1(r21469);
double r21471 = log1p(r21470);
double r21472 = r21468 / r21467;
double r21473 = r21467 / r21472;
double r21474 = r21471 - r21473;
return r21474;
}



Bits error versus x
Initial program 0.3
rmApplied div-sub0.4
Simplified0.4
Simplified0.4
rmApplied log1p-expm1-u0.4
Final simplification0.4
herbie shell --seed 2020062 +o rules:numerics
(FPCore (x)
:name "Trigonometry B"
:precision binary64
(/ (- 1 (* (tan x) (tan x))) (+ 1 (* (tan x) (tan x)))))