Average Error: 0.6 → 0.6
Time: 12.9s
Precision: 64
$\frac{\sin x + \tanh x}{\sin x - \cos x}$
$\frac{\frac{\sin x + \tanh x}{\sin x - \cos x}}{1}$
\frac{\sin x + \tanh x}{\sin x - \cos x}
\frac{\frac{\sin x + \tanh x}{\sin x - \cos x}}{1}
double f(double x) {
double r160765 = x;
double r160766 = sin(r160765);
double r160767 = tanh(r160765);
double r160768 = r160766 + r160767;
double r160769 = cos(r160765);
double r160770 = r160766 - r160769;
double r160771 = r160768 / r160770;
return r160771;
}

double f(double x) {
double r160772 = x;
double r160773 = sin(r160772);
double r160774 = tanh(r160772);
double r160775 = r160773 + r160774;
double r160776 = cos(r160772);
double r160777 = r160773 - r160776;
double r160778 = r160775 / r160777;
double r160779 = 1.0;
double r160780 = r160778 / r160779;
return r160780;
}

# Try it out

Your Program's Arguments

Results

 In Out
Enter valid numbers for all inputs

# Derivation

1. Initial program 0.6

$\frac{\sin x + \tanh x}{\sin x - \cos x}$
2. Using strategy rm
3. Applied add-log-exp0.6

$\leadsto \frac{\sin x + \tanh x}{\sin x - \color{blue}{\log \left(e^{\cos x}\right)}}$
4. Applied add-log-exp0.7

$\leadsto \frac{\sin x + \tanh x}{\color{blue}{\log \left(e^{\sin x}\right)} - \log \left(e^{\cos x}\right)}$
5. Applied diff-log0.7

$\leadsto \frac{\sin x + \tanh x}{\color{blue}{\log \left(\frac{e^{\sin x}}{e^{\cos x}}\right)}}$
6. Simplified0.6

$\leadsto \frac{\sin x + \tanh x}{\log \color{blue}{\left(e^{\sin x - \cos x}\right)}}$
7. Using strategy rm
8. Applied *-un-lft-identity0.6

$\leadsto \frac{\sin x + \tanh x}{\log \left(e^{\color{blue}{1 \cdot \left(\sin x - \cos x\right)}}\right)}$
9. Applied exp-prod0.6

$\leadsto \frac{\sin x + \tanh x}{\log \color{blue}{\left({\left(e^{1}\right)}^{\left(\sin x - \cos x\right)}\right)}}$
10. Applied log-pow0.6

$\leadsto \frac{\sin x + \tanh x}{\color{blue}{\left(\sin x - \cos x\right) \cdot \log \left(e^{1}\right)}}$
11. Applied associate-/r*0.6

$\leadsto \color{blue}{\frac{\frac{\sin x + \tanh x}{\sin x - \cos x}}{\log \left(e^{1}\right)}}$
12. Final simplification0.6

$\leadsto \frac{\frac{\sin x + \tanh x}{\sin x - \cos x}}{1}$

# Reproduce

herbie shell --seed 1
(FPCore (x)
:name "(sin(x) + tanh(x))/(sin(x) - cos(x))"
:precision binary64
(/ (+ (sin x) (tanh x)) (- (sin x) (cos x))))