\frac{x}{x + 1} - \frac{x + 1}{x - 1}\begin{array}{l}
\mathbf{if}\;x \le -14927.87841463981749257072806358337402344:\\
\;\;\;\;-\left(\left(\frac{3}{\left(x \cdot x\right) \cdot x} + \frac{1}{x \cdot x}\right) + \frac{3}{x}\right)\\
\mathbf{elif}\;x \le 9776.984335638540869695134460926055908203:\\
\;\;\;\;\log \left(e^{\frac{x}{x + 1}}\right) - \frac{1}{x - 1} \cdot \left(x + 1\right)\\
\mathbf{else}:\\
\;\;\;\;-\left(\left(\frac{3}{\left(x \cdot x\right) \cdot x} + \frac{1}{x \cdot x}\right) + \frac{3}{x}\right)\\
\end{array}double f(double x) {
double r8093931 = x;
double r8093932 = 1.0;
double r8093933 = r8093931 + r8093932;
double r8093934 = r8093931 / r8093933;
double r8093935 = r8093931 - r8093932;
double r8093936 = r8093933 / r8093935;
double r8093937 = r8093934 - r8093936;
return r8093937;
}
double f(double x) {
double r8093938 = x;
double r8093939 = -14927.878414639817;
bool r8093940 = r8093938 <= r8093939;
double r8093941 = 3.0;
double r8093942 = r8093938 * r8093938;
double r8093943 = r8093942 * r8093938;
double r8093944 = r8093941 / r8093943;
double r8093945 = 1.0;
double r8093946 = r8093945 / r8093942;
double r8093947 = r8093944 + r8093946;
double r8093948 = r8093941 / r8093938;
double r8093949 = r8093947 + r8093948;
double r8093950 = -r8093949;
double r8093951 = 9776.98433563854;
bool r8093952 = r8093938 <= r8093951;
double r8093953 = r8093938 + r8093945;
double r8093954 = r8093938 / r8093953;
double r8093955 = exp(r8093954);
double r8093956 = log(r8093955);
double r8093957 = 1.0;
double r8093958 = r8093938 - r8093945;
double r8093959 = r8093957 / r8093958;
double r8093960 = r8093959 * r8093953;
double r8093961 = r8093956 - r8093960;
double r8093962 = r8093952 ? r8093961 : r8093950;
double r8093963 = r8093940 ? r8093950 : r8093962;
return r8093963;
}



Bits error versus x
Results
if x < -14927.878414639817 or 9776.98433563854 < x Initial program 59.3
rmApplied add-log-exp59.3
Applied add-log-exp59.3
Applied diff-log59.3
Simplified59.3
rmApplied flip--60.4
Applied associate-/r/60.4
Simplified59.4
Taylor expanded around inf 0.3
Simplified0.0
if -14927.878414639817 < x < 9776.98433563854Initial program 0.1
rmApplied add-log-exp0.1
Applied add-log-exp0.1
Applied diff-log0.1
Simplified0.1
rmApplied flip--0.1
Applied associate-/r/0.1
Simplified0.1
rmApplied rem-log-exp0.1
rmApplied add-log-exp0.1
Final simplification0.1
herbie shell --seed 2019174
(FPCore (x)
:name "Asymptote C"
(- (/ x (+ x 1.0)) (/ (+ x 1.0) (- x 1.0))))