Average Error: 29.6 → 0.3
Time: 24.3s
Precision: 64
$\tan \left(x + 1\right) - \tan x$
$\frac{\tan x + \tan 1}{1 - \sqrt{\tan 1} \cdot \left(\tan x \cdot \sqrt{\tan 1}\right)} - \tan x$
\tan \left(x + 1\right) - \tan x
\frac{\tan x + \tan 1}{1 - \sqrt{\tan 1} \cdot \left(\tan x \cdot \sqrt{\tan 1}\right)} - \tan x
double f(double x) {
double r57162762 = x;
double r57162763 = 1.0;
double r57162764 = r57162762 + r57162763;
double r57162765 = tan(r57162764);
double r57162766 = tan(r57162762);
double r57162767 = r57162765 - r57162766;
return r57162767;
}


double f(double x) {
double r57162768 = x;
double r57162769 = tan(r57162768);
double r57162770 = 1.0;
double r57162771 = tan(r57162770);
double r57162772 = r57162769 + r57162771;
double r57162773 = sqrt(r57162771);
double r57162774 = r57162769 * r57162773;
double r57162775 = r57162773 * r57162774;
double r57162776 = r57162770 - r57162775;
double r57162777 = r57162772 / r57162776;
double r57162778 = r57162777 - r57162769;
return r57162778;
}



# Try it out

Results

 In Out
Enter valid numbers for all inputs

# Derivation

1. Initial program 29.6

$\tan \left(x + 1\right) - \tan x$
2. Using strategy rm
3. Applied tan-sum0.3

$\leadsto \color{blue}{\frac{\tan x + \tan 1}{1 - \tan x \cdot \tan 1}} - \tan x$
4. Using strategy rm

$\leadsto \frac{\tan x + \tan 1}{1 - \tan x \cdot \color{blue}{\left(\sqrt{\tan 1} \cdot \sqrt{\tan 1}\right)}} - \tan x$
6. Applied associate-*r*0.3

$\leadsto \frac{\tan x + \tan 1}{1 - \color{blue}{\left(\tan x \cdot \sqrt{\tan 1}\right) \cdot \sqrt{\tan 1}}} - \tan x$
7. Final simplification0.3

$\leadsto \frac{\tan x + \tan 1}{1 - \sqrt{\tan 1} \cdot \left(\tan x \cdot \sqrt{\tan 1}\right)} - \tan x$

# Reproduce

herbie shell --seed 1
(FPCore (x)
:name "tan(x+1)-tan(x)"
(- (tan (+ x 1)) (tan x)))