(FPCore (x) :precision binary64 (- (/ 1.0 (+ x 1.0)) (/ 1.0 (- x 1.0))))
(FPCore (x)
:precision binary64
(let* ((t_0 (/ 1.0 (+ x -1.0)))
(t_1 (- (/ (+ (/ 2.0 x) (/ 2.0 (pow x 3.0))) x))))
(if (<= x -41108431.41060643)
t_1
(if (<= x 1.6458904718769783e-11)
(fma t_0 -2.0 (+ t_0 (/ 1.0 (+ 1.0 x))))
t_1))))double code(double x) {
return (1.0 / (x + 1.0)) - (1.0 / (x - 1.0));
}
double code(double x) {
double t_0 = 1.0 / (x + -1.0);
double t_1 = -(((2.0 / x) + (2.0 / pow(x, 3.0))) / x);
double tmp;
if (x <= -41108431.41060643) {
tmp = t_1;
} else if (x <= 1.6458904718769783e-11) {
tmp = fma(t_0, -2.0, (t_0 + (1.0 / (1.0 + x))));
} else {
tmp = t_1;
}
return tmp;
}
function code(x) return Float64(Float64(1.0 / Float64(x + 1.0)) - Float64(1.0 / Float64(x - 1.0))) end
function code(x) t_0 = Float64(1.0 / Float64(x + -1.0)) t_1 = Float64(-Float64(Float64(Float64(2.0 / x) + Float64(2.0 / (x ^ 3.0))) / x)) tmp = 0.0 if (x <= -41108431.41060643) tmp = t_1; elseif (x <= 1.6458904718769783e-11) tmp = fma(t_0, -2.0, Float64(t_0 + Float64(1.0 / Float64(1.0 + x)))); else tmp = t_1; end return tmp end
code[x_] := N[(N[(1.0 / N[(x + 1.0), $MachinePrecision]), $MachinePrecision] - N[(1.0 / N[(x - 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
code[x_] := Block[{t$95$0 = N[(1.0 / N[(x + -1.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = (-N[(N[(N[(2.0 / x), $MachinePrecision] + N[(2.0 / N[Power[x, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision])}, If[LessEqual[x, -41108431.41060643], t$95$1, If[LessEqual[x, 1.6458904718769783e-11], N[(t$95$0 * -2.0 + N[(t$95$0 + N[(1.0 / N[(1.0 + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\frac{1}{x + 1} - \frac{1}{x - 1}
\begin{array}{l}
t_0 := \frac{1}{x + -1}\\
t_1 := -\frac{\frac{2}{x} + \frac{2}{{x}^{3}}}{x}\\
\mathbf{if}\;x \leq -41108431.41060643:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 1.6458904718769783 \cdot 10^{-11}:\\
\;\;\;\;\mathsf{fma}\left(t_0, -2, t_0 + \frac{1}{1 + x}\right)\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
if x < -41108431.410606429 or 1.6458904718769783e-11 < x Initial program 28.7
Taylor expanded in x around inf 2.1
Simplified2.1
Applied egg-rr1.6
Applied egg-rr1.5
if -41108431.410606429 < x < 1.6458904718769783e-11Initial program 0.1
Applied egg-rr0.1
Applied egg-rr0.1
Final simplification0.8
herbie shell --seed 2022203
(FPCore (x)
:name "Asymptote A"
:precision binary64
(- (/ 1.0 (+ x 1.0)) (/ 1.0 (- x 1.0))))