(FPCore (x) :precision binary64 (- (/ x (+ x 1.0)) (/ (+ x 1.0) (- x 1.0))))
(FPCore (x)
:precision binary64
(let* ((t_0 (/ x (+ x 1.0)))
(t_1 (pow (+ x 1.0) 3.0))
(t_2 (pow (+ x -1.0) 3.0))
(t_3 (+ (/ -3.0 x) (* (/ (/ -1.0 x) x) (+ (/ 3.0 x) 1.0))))
(t_4 (/ (fma -1.0 x -1.0) (+ x -1.0))))
(if (<= x -2181902.375756449)
t_3
(if (<= x 547.9582968275782)
(/
(/
(fma (pow (fma x -1.0 -1.0) 3.0) t_1 (* t_2 (pow x 3.0)))
(* t_1 t_2))
(+ (pow t_0 2.0) (- (pow t_4 2.0) (* t_0 t_4))))
t_3))))double code(double x) {
return (x / (x + 1.0)) - ((x + 1.0) / (x - 1.0));
}
double code(double x) {
double t_0 = x / (x + 1.0);
double t_1 = pow((x + 1.0), 3.0);
double t_2 = pow((x + -1.0), 3.0);
double t_3 = (-3.0 / x) + (((-1.0 / x) / x) * ((3.0 / x) + 1.0));
double t_4 = fma(-1.0, x, -1.0) / (x + -1.0);
double tmp;
if (x <= -2181902.375756449) {
tmp = t_3;
} else if (x <= 547.9582968275782) {
tmp = (fma(pow(fma(x, -1.0, -1.0), 3.0), t_1, (t_2 * pow(x, 3.0))) / (t_1 * t_2)) / (pow(t_0, 2.0) + (pow(t_4, 2.0) - (t_0 * t_4)));
} else {
tmp = t_3;
}
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 = Float64(x / Float64(x + 1.0)) t_1 = Float64(x + 1.0) ^ 3.0 t_2 = Float64(x + -1.0) ^ 3.0 t_3 = Float64(Float64(-3.0 / x) + Float64(Float64(Float64(-1.0 / x) / x) * Float64(Float64(3.0 / x) + 1.0))) t_4 = Float64(fma(-1.0, x, -1.0) / Float64(x + -1.0)) tmp = 0.0 if (x <= -2181902.375756449) tmp = t_3; elseif (x <= 547.9582968275782) tmp = Float64(Float64(fma((fma(x, -1.0, -1.0) ^ 3.0), t_1, Float64(t_2 * (x ^ 3.0))) / Float64(t_1 * t_2)) / Float64((t_0 ^ 2.0) + Float64((t_4 ^ 2.0) - Float64(t_0 * t_4)))); else tmp = t_3; 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[(x / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Power[N[(x + 1.0), $MachinePrecision], 3.0], $MachinePrecision]}, Block[{t$95$2 = N[Power[N[(x + -1.0), $MachinePrecision], 3.0], $MachinePrecision]}, Block[{t$95$3 = N[(N[(-3.0 / x), $MachinePrecision] + N[(N[(N[(-1.0 / x), $MachinePrecision] / x), $MachinePrecision] * N[(N[(3.0 / x), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(N[(-1.0 * x + -1.0), $MachinePrecision] / N[(x + -1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -2181902.375756449], t$95$3, If[LessEqual[x, 547.9582968275782], N[(N[(N[(N[Power[N[(x * -1.0 + -1.0), $MachinePrecision], 3.0], $MachinePrecision] * t$95$1 + N[(t$95$2 * N[Power[x, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(t$95$1 * t$95$2), $MachinePrecision]), $MachinePrecision] / N[(N[Power[t$95$0, 2.0], $MachinePrecision] + N[(N[Power[t$95$4, 2.0], $MachinePrecision] - N[(t$95$0 * t$95$4), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$3]]]]]]]
\frac{x}{x + 1} - \frac{x + 1}{x - 1}
\begin{array}{l}
t_0 := \frac{x}{x + 1}\\
t_1 := {\left(x + 1\right)}^{3}\\
t_2 := {\left(x + -1\right)}^{3}\\
t_3 := \frac{-3}{x} + \frac{\frac{-1}{x}}{x} \cdot \left(\frac{3}{x} + 1\right)\\
t_4 := \frac{\mathsf{fma}\left(-1, x, -1\right)}{x + -1}\\
\mathbf{if}\;x \leq -2181902.375756449:\\
\;\;\;\;t_3\\
\mathbf{elif}\;x \leq 547.9582968275782:\\
\;\;\;\;\frac{\frac{\mathsf{fma}\left({\left(\mathsf{fma}\left(x, -1, -1\right)\right)}^{3}, t_1, t_2 \cdot {x}^{3}\right)}{t_1 \cdot t_2}}{{t_0}^{2} + \left({t_4}^{2} - t_0 \cdot t_4\right)}\\
\mathbf{else}:\\
\;\;\;\;t_3\\
\end{array}
if x < -2181902.3757564491 or 547.958296827578238 < x Initial program 59.3
Taylor expanded in x around inf 0.4
Simplified0.1
if -2181902.3757564491 < x < 547.958296827578238Initial program 0.1
Applied egg-rr0.1
Applied egg-rr0.1
Final simplification0.1
herbie shell --seed 2022210
(FPCore (x)
:name "Asymptote C"
:precision binary64
(- (/ x (+ x 1.0)) (/ (+ x 1.0) (- x 1.0))))