Average Error: 26.0 → 0.8
Time: 18.3s
Precision: 64
$\sin \left(x + 1\right) + \tanh \left(x - 1\right)$
$\frac{\left(\left(\sin x \cdot \cos 1\right) \cdot \left(\sin x \cdot \cos 1\right) - \left(\cos x \cdot \sin 1\right) \cdot \left(\cos x \cdot \sin 1\right)\right) \cdot \left(1 + \tanh x \cdot \tanh \left(-1\right)\right) + \left(\sin x \cdot \cos 1 - \cos x \cdot \sin 1\right) \cdot \left(\tanh x + \tanh \left(-1\right)\right)}{\left(\sin x \cdot \cos 1 - \cos x \cdot \sin 1\right) \cdot \left(1 + \tanh x \cdot \tanh \left(-1\right)\right)}$
\sin \left(x + 1\right) + \tanh \left(x - 1\right)
\frac{\left(\left(\sin x \cdot \cos 1\right) \cdot \left(\sin x \cdot \cos 1\right) - \left(\cos x \cdot \sin 1\right) \cdot \left(\cos x \cdot \sin 1\right)\right) \cdot \left(1 + \tanh x \cdot \tanh \left(-1\right)\right) + \left(\sin x \cdot \cos 1 - \cos x \cdot \sin 1\right) \cdot \left(\tanh x + \tanh \left(-1\right)\right)}{\left(\sin x \cdot \cos 1 - \cos x \cdot \sin 1\right) \cdot \left(1 + \tanh x \cdot \tanh \left(-1\right)\right)}
double f(double x) {
double r149565 = x;
double r149566 = 1.0;
double r149567 = r149565 + r149566;
double r149568 = sin(r149567);
double r149569 = r149565 - r149566;
double r149570 = tanh(r149569);
double r149571 = r149568 + r149570;
return r149571;
}


double f(double x) {
double r149572 = x;
double r149573 = sin(r149572);
double r149574 = 1.0;
double r149575 = cos(r149574);
double r149576 = r149573 * r149575;
double r149577 = r149576 * r149576;
double r149578 = cos(r149572);
double r149579 = sin(r149574);
double r149580 = r149578 * r149579;
double r149581 = r149580 * r149580;
double r149582 = r149577 - r149581;
double r149583 = 1.0;
double r149584 = tanh(r149572);
double r149585 = -r149574;
double r149586 = tanh(r149585);
double r149587 = r149584 * r149586;
double r149588 = r149583 + r149587;
double r149589 = r149582 * r149588;
double r149590 = r149576 - r149580;
double r149591 = r149584 + r149586;
double r149592 = r149590 * r149591;
double r149593 = r149589 + r149592;
double r149594 = r149590 * r149588;
double r149595 = r149593 / r149594;
return r149595;
}



# Try it out

Results

 In Out
Enter valid numbers for all inputs

# Derivation

1. Initial program 26.0

$\sin \left(x + 1\right) + \tanh \left(x - 1\right)$
2. Using strategy rm
3. Applied sin-sum1.5

$\leadsto \color{blue}{\left(\sin x \cdot \cos 1 + \cos x \cdot \sin 1\right)} + \tanh \left(x - 1\right)$
4. Using strategy rm
5. Applied sub-neg1.5

$\leadsto \left(\sin x \cdot \cos 1 + \cos x \cdot \sin 1\right) + \tanh \color{blue}{\left(x + \left(-1\right)\right)}$
6. Applied tanh-sum1.5

$\leadsto \left(\sin x \cdot \cos 1 + \cos x \cdot \sin 1\right) + \color{blue}{\frac{\tanh x + \tanh \left(-1\right)}{1 + \tanh x \cdot \tanh \left(-1\right)}}$
7. Applied flip-+1.6

$\leadsto \color{blue}{\frac{\left(\sin x \cdot \cos 1\right) \cdot \left(\sin x \cdot \cos 1\right) - \left(\cos x \cdot \sin 1\right) \cdot \left(\cos x \cdot \sin 1\right)}{\sin x \cdot \cos 1 - \cos x \cdot \sin 1}} + \frac{\tanh x + \tanh \left(-1\right)}{1 + \tanh x \cdot \tanh \left(-1\right)}$

$\leadsto \color{blue}{\frac{\left(\left(\sin x \cdot \cos 1\right) \cdot \left(\sin x \cdot \cos 1\right) - \left(\cos x \cdot \sin 1\right) \cdot \left(\cos x \cdot \sin 1\right)\right) \cdot \left(1 + \tanh x \cdot \tanh \left(-1\right)\right) + \left(\sin x \cdot \cos 1 - \cos x \cdot \sin 1\right) \cdot \left(\tanh x + \tanh \left(-1\right)\right)}{\left(\sin x \cdot \cos 1 - \cos x \cdot \sin 1\right) \cdot \left(1 + \tanh x \cdot \tanh \left(-1\right)\right)}}$
9. Final simplification0.8

$\leadsto \frac{\left(\left(\sin x \cdot \cos 1\right) \cdot \left(\sin x \cdot \cos 1\right) - \left(\cos x \cdot \sin 1\right) \cdot \left(\cos x \cdot \sin 1\right)\right) \cdot \left(1 + \tanh x \cdot \tanh \left(-1\right)\right) + \left(\sin x \cdot \cos 1 - \cos x \cdot \sin 1\right) \cdot \left(\tanh x + \tanh \left(-1\right)\right)}{\left(\sin x \cdot \cos 1 - \cos x \cdot \sin 1\right) \cdot \left(1 + \tanh x \cdot \tanh \left(-1\right)\right)}$

# Reproduce

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