(FPCore (x) :precision binary64 (- (/ 1.0 (+ x 1.0)) (/ 1.0 (- x 1.0))))
(FPCore (x) :precision binary64 (if (<= (+ (/ 1.0 (+ 1.0 x)) (/ -1.0 (+ x -1.0))) 0.0) (fma -2.0 (pow x -2.0) (* -2.0 (pow x -4.0))) (* 2.0 (+ (pow x 4.0) (fma x x 1.0)))))
double code(double x) {
return (1.0 / (x + 1.0)) - (1.0 / (x - 1.0));
}
double code(double x) {
double tmp;
if (((1.0 / (1.0 + x)) + (-1.0 / (x + -1.0))) <= 0.0) {
tmp = fma(-2.0, pow(x, -2.0), (-2.0 * pow(x, -4.0)));
} else {
tmp = 2.0 * (pow(x, 4.0) + fma(x, x, 1.0));
}
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) tmp = 0.0 if (Float64(Float64(1.0 / Float64(1.0 + x)) + Float64(-1.0 / Float64(x + -1.0))) <= 0.0) tmp = fma(-2.0, (x ^ -2.0), Float64(-2.0 * (x ^ -4.0))); else tmp = Float64(2.0 * Float64((x ^ 4.0) + fma(x, x, 1.0))); 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_] := If[LessEqual[N[(N[(1.0 / N[(1.0 + x), $MachinePrecision]), $MachinePrecision] + N[(-1.0 / N[(x + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 0.0], N[(-2.0 * N[Power[x, -2.0], $MachinePrecision] + N[(-2.0 * N[Power[x, -4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[Power[x, 4.0], $MachinePrecision] + N[(x * x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\frac{1}{x + 1} - \frac{1}{x - 1}
\begin{array}{l}
\mathbf{if}\;\frac{1}{1 + x} + \frac{-1}{x + -1} \leq 0:\\
\;\;\;\;\mathsf{fma}\left(-2, {x}^{-2}, -2 \cdot {x}^{-4}\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left({x}^{4} + \mathsf{fma}\left(x, x, 1\right)\right)\\
\end{array}
if (-.f64 (/.f64 1 (+.f64 x 1)) (/.f64 1 (-.f64 x 1))) < 0.0Initial program 29.0
Taylor expanded in x around inf 1.1
Simplified1.1
Applied egg-rr0.5
Applied egg-rr0.3
if 0.0 < (-.f64 (/.f64 1 (+.f64 x 1)) (/.f64 1 (-.f64 x 1))) Initial program 0.0
Taylor expanded in x around 0 0.3
Simplified0.3
Final simplification0.3
herbie shell --seed 2022190
(FPCore (x)
:name "Asymptote A"
:precision binary64
(- (/ 1.0 (+ x 1.0)) (/ 1.0 (- x 1.0))))