\frac{1 - \tan x \cdot \tan x}{1 + \tan x \cdot \tan x}\frac{\log \left(e^{\sqrt{1} + \tan x}\right) \cdot \left(\sqrt{1} - \tan x\right)}{1 + \tan x \cdot \tan x}double f(double x) {
double r11987 = 1.0;
double r11988 = x;
double r11989 = tan(r11988);
double r11990 = r11989 * r11989;
double r11991 = r11987 - r11990;
double r11992 = r11987 + r11990;
double r11993 = r11991 / r11992;
return r11993;
}
double f(double x) {
double r11994 = 1.0;
double r11995 = sqrt(r11994);
double r11996 = x;
double r11997 = tan(r11996);
double r11998 = r11995 + r11997;
double r11999 = exp(r11998);
double r12000 = log(r11999);
double r12001 = r11995 - r11997;
double r12002 = r12000 * r12001;
double r12003 = r11997 * r11997;
double r12004 = r11994 + r12003;
double r12005 = r12002 / r12004;
return r12005;
}



Bits error versus x
Results
Initial program 0.3
rmApplied add-sqr-sqrt0.3
Applied difference-of-squares0.4
rmApplied add-log-exp0.4
Applied add-log-exp0.4
Applied sum-log0.4
Simplified0.4
Final simplification0.4
herbie shell --seed 2020024 +o rules:numerics
(FPCore (x)
:name "Trigonometry B"
:precision binary64
(/ (- 1 (* (tan x) (tan x))) (+ 1 (* (tan x) (tan x)))))