(FPCore (x) :precision binary64 (- (/ x (+ x 1.0)) (/ (+ x 1.0) (- x 1.0))))
(FPCore (x)
:precision binary64
(let* ((t_0 (fma -1.0 (pow x -2.0) (fma -3.0 (pow x -3.0) (/ -3.0 x)))))
(if (<= x -6176794.5564302765)
t_0
(if (<= x 209.85361716255164)
(fma x (/ 1.0 (+ x 1.0)) (/ (fma -1.0 x -1.0) (+ x -1.0)))
t_0))))double code(double x) {
return (x / (x + 1.0)) - ((x + 1.0) / (x - 1.0));
}
double code(double x) {
double t_0 = fma(-1.0, pow(x, -2.0), fma(-3.0, pow(x, -3.0), (-3.0 / x)));
double tmp;
if (x <= -6176794.5564302765) {
tmp = t_0;
} else if (x <= 209.85361716255164) {
tmp = fma(x, (1.0 / (x + 1.0)), (fma(-1.0, x, -1.0) / (x + -1.0)));
} else {
tmp = t_0;
}
return tmp;
}
function code(x) return Float64(Float64(x / Float64(x + 1.0)) - Float64(Float64(x + 1.0) / Float64(x - 1.0))) end
function code(x) t_0 = fma(-1.0, (x ^ -2.0), fma(-3.0, (x ^ -3.0), Float64(-3.0 / x))) tmp = 0.0 if (x <= -6176794.5564302765) tmp = t_0; elseif (x <= 209.85361716255164) tmp = fma(x, Float64(1.0 / Float64(x + 1.0)), Float64(fma(-1.0, x, -1.0) / Float64(x + -1.0))); else tmp = t_0; end return tmp end
code[x_] := N[(N[(x / N[(x + 1.0), $MachinePrecision]), $MachinePrecision] - N[(N[(x + 1.0), $MachinePrecision] / N[(x - 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
code[x_] := Block[{t$95$0 = N[(-1.0 * N[Power[x, -2.0], $MachinePrecision] + N[(-3.0 * N[Power[x, -3.0], $MachinePrecision] + N[(-3.0 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -6176794.5564302765], t$95$0, If[LessEqual[x, 209.85361716255164], N[(x * N[(1.0 / N[(x + 1.0), $MachinePrecision]), $MachinePrecision] + N[(N[(-1.0 * x + -1.0), $MachinePrecision] / N[(x + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\frac{x}{x + 1} - \frac{x + 1}{x - 1}
\begin{array}{l}
t_0 := \mathsf{fma}\left(-1, {x}^{-2}, \mathsf{fma}\left(-3, {x}^{-3}, \frac{-3}{x}\right)\right)\\
\mathbf{if}\;x \leq -6176794.5564302765:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x \leq 209.85361716255164:\\
\;\;\;\;\mathsf{fma}\left(x, \frac{1}{x + 1}, \frac{\mathsf{fma}\left(-1, x, -1\right)}{x + -1}\right)\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
if x < -6176794.5564302765 or 209.85361716255164 < x Initial program 59.5
Taylor expanded in x around inf 0.4
Simplified0.1
Applied egg-rr0.1
if -6176794.5564302765 < x < 209.85361716255164Initial program 0.1
Applied egg-rr0.1
Final simplification0.1
herbie shell --seed 2022192
(FPCore (x)
:name "Asymptote C"
:precision binary64
(- (/ x (+ x 1.0)) (/ (+ x 1.0) (- x 1.0))))