
(FPCore (x) :precision binary64 (+ (- (/ 1.0 (+ x 1.0)) (/ 2.0 x)) (/ 1.0 (- x 1.0))))
double code(double x) {
return ((1.0 / (x + 1.0)) - (2.0 / x)) + (1.0 / (x - 1.0));
}
real(8) function code(x)
real(8), intent (in) :: x
code = ((1.0d0 / (x + 1.0d0)) - (2.0d0 / x)) + (1.0d0 / (x - 1.0d0))
end function
public static double code(double x) {
return ((1.0 / (x + 1.0)) - (2.0 / x)) + (1.0 / (x - 1.0));
}
def code(x): return ((1.0 / (x + 1.0)) - (2.0 / x)) + (1.0 / (x - 1.0))
function code(x) return Float64(Float64(Float64(1.0 / Float64(x + 1.0)) - Float64(2.0 / x)) + Float64(1.0 / Float64(x - 1.0))) end
function tmp = code(x) tmp = ((1.0 / (x + 1.0)) - (2.0 / x)) + (1.0 / (x - 1.0)); end
code[x_] := N[(N[(N[(1.0 / N[(x + 1.0), $MachinePrecision]), $MachinePrecision] - N[(2.0 / x), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(x - 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\frac{1}{x + 1} - \frac{2}{x}\right) + \frac{1}{x - 1}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 8 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x) :precision binary64 (+ (- (/ 1.0 (+ x 1.0)) (/ 2.0 x)) (/ 1.0 (- x 1.0))))
double code(double x) {
return ((1.0 / (x + 1.0)) - (2.0 / x)) + (1.0 / (x - 1.0));
}
real(8) function code(x)
real(8), intent (in) :: x
code = ((1.0d0 / (x + 1.0d0)) - (2.0d0 / x)) + (1.0d0 / (x - 1.0d0))
end function
public static double code(double x) {
return ((1.0 / (x + 1.0)) - (2.0 / x)) + (1.0 / (x - 1.0));
}
def code(x): return ((1.0 / (x + 1.0)) - (2.0 / x)) + (1.0 / (x - 1.0))
function code(x) return Float64(Float64(Float64(1.0 / Float64(x + 1.0)) - Float64(2.0 / x)) + Float64(1.0 / Float64(x - 1.0))) end
function tmp = code(x) tmp = ((1.0 / (x + 1.0)) - (2.0 / x)) + (1.0 / (x - 1.0)); end
code[x_] := N[(N[(N[(1.0 / N[(x + 1.0), $MachinePrecision]), $MachinePrecision] - N[(2.0 / x), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(x - 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\frac{1}{x + 1} - \frac{2}{x}\right) + \frac{1}{x - 1}
\end{array}
(FPCore (x)
:precision binary64
(if (<= x -560.0)
(+ (/ 2.0 (pow x 3.0)) (/ 2.0 (pow x 5.0)))
(if (<= x 12000.0)
(+ (/ -2.0 x) (+ (/ 1.0 (+ x -1.0)) (/ -1.0 (- -1.0 x))))
(* 2.0 (pow x -3.0)))))
double code(double x) {
double tmp;
if (x <= -560.0) {
tmp = (2.0 / pow(x, 3.0)) + (2.0 / pow(x, 5.0));
} else if (x <= 12000.0) {
tmp = (-2.0 / x) + ((1.0 / (x + -1.0)) + (-1.0 / (-1.0 - x)));
} else {
tmp = 2.0 * pow(x, -3.0);
}
return tmp;
}
real(8) function code(x)
real(8), intent (in) :: x
real(8) :: tmp
if (x <= (-560.0d0)) then
tmp = (2.0d0 / (x ** 3.0d0)) + (2.0d0 / (x ** 5.0d0))
else if (x <= 12000.0d0) then
tmp = ((-2.0d0) / x) + ((1.0d0 / (x + (-1.0d0))) + ((-1.0d0) / ((-1.0d0) - x)))
else
tmp = 2.0d0 * (x ** (-3.0d0))
end if
code = tmp
end function
public static double code(double x) {
double tmp;
if (x <= -560.0) {
tmp = (2.0 / Math.pow(x, 3.0)) + (2.0 / Math.pow(x, 5.0));
} else if (x <= 12000.0) {
tmp = (-2.0 / x) + ((1.0 / (x + -1.0)) + (-1.0 / (-1.0 - x)));
} else {
tmp = 2.0 * Math.pow(x, -3.0);
}
return tmp;
}
def code(x): tmp = 0 if x <= -560.0: tmp = (2.0 / math.pow(x, 3.0)) + (2.0 / math.pow(x, 5.0)) elif x <= 12000.0: tmp = (-2.0 / x) + ((1.0 / (x + -1.0)) + (-1.0 / (-1.0 - x))) else: tmp = 2.0 * math.pow(x, -3.0) return tmp
function code(x) tmp = 0.0 if (x <= -560.0) tmp = Float64(Float64(2.0 / (x ^ 3.0)) + Float64(2.0 / (x ^ 5.0))); elseif (x <= 12000.0) tmp = Float64(Float64(-2.0 / x) + Float64(Float64(1.0 / Float64(x + -1.0)) + Float64(-1.0 / Float64(-1.0 - x)))); else tmp = Float64(2.0 * (x ^ -3.0)); end return tmp end
function tmp_2 = code(x) tmp = 0.0; if (x <= -560.0) tmp = (2.0 / (x ^ 3.0)) + (2.0 / (x ^ 5.0)); elseif (x <= 12000.0) tmp = (-2.0 / x) + ((1.0 / (x + -1.0)) + (-1.0 / (-1.0 - x))); else tmp = 2.0 * (x ^ -3.0); end tmp_2 = tmp; end
code[x_] := If[LessEqual[x, -560.0], N[(N[(2.0 / N[Power[x, 3.0], $MachinePrecision]), $MachinePrecision] + N[(2.0 / N[Power[x, 5.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 12000.0], N[(N[(-2.0 / x), $MachinePrecision] + N[(N[(1.0 / N[(x + -1.0), $MachinePrecision]), $MachinePrecision] + N[(-1.0 / N[(-1.0 - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[Power[x, -3.0], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -560:\\
\;\;\;\;\frac{2}{{x}^{3}} + \frac{2}{{x}^{5}}\\
\mathbf{elif}\;x \leq 12000:\\
\;\;\;\;\frac{-2}{x} + \left(\frac{1}{x + -1} + \frac{-1}{-1 - x}\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot {x}^{-3}\\
\end{array}
\end{array}
if x < -560Initial program 69.3%
Simplified69.2%
Taylor expanded in x around inf 99.8%
associate-*r/99.8%
metadata-eval99.8%
associate-*r/99.8%
metadata-eval99.8%
Simplified99.8%
if -560 < x < 12000Initial program 99.7%
Simplified99.8%
if 12000 < x Initial program 67.6%
Simplified67.6%
Taylor expanded in x around inf 99.0%
div-inv99.0%
*-commutative99.0%
pow-flip100.0%
metadata-eval100.0%
Applied egg-rr100.0%
Final simplification99.8%
(FPCore (x)
:precision binary64
(let* ((t_0 (/ 1.0 (+ x -1.0))) (t_1 (+ t_0 (- (/ 1.0 (+ x 1.0)) (/ 2.0 x)))))
(if (<= t_1 -50.0)
(+ (/ -2.0 x) (+ t_0 (/ -1.0 (- -1.0 x))))
(if (<= t_1 0.0) (* 2.0 (pow x -3.0)) t_1))))
double code(double x) {
double t_0 = 1.0 / (x + -1.0);
double t_1 = t_0 + ((1.0 / (x + 1.0)) - (2.0 / x));
double tmp;
if (t_1 <= -50.0) {
tmp = (-2.0 / x) + (t_0 + (-1.0 / (-1.0 - x)));
} else if (t_1 <= 0.0) {
tmp = 2.0 * pow(x, -3.0);
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x)
real(8), intent (in) :: x
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = 1.0d0 / (x + (-1.0d0))
t_1 = t_0 + ((1.0d0 / (x + 1.0d0)) - (2.0d0 / x))
if (t_1 <= (-50.0d0)) then
tmp = ((-2.0d0) / x) + (t_0 + ((-1.0d0) / ((-1.0d0) - x)))
else if (t_1 <= 0.0d0) then
tmp = 2.0d0 * (x ** (-3.0d0))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x) {
double t_0 = 1.0 / (x + -1.0);
double t_1 = t_0 + ((1.0 / (x + 1.0)) - (2.0 / x));
double tmp;
if (t_1 <= -50.0) {
tmp = (-2.0 / x) + (t_0 + (-1.0 / (-1.0 - x)));
} else if (t_1 <= 0.0) {
tmp = 2.0 * Math.pow(x, -3.0);
} else {
tmp = t_1;
}
return tmp;
}
def code(x): t_0 = 1.0 / (x + -1.0) t_1 = t_0 + ((1.0 / (x + 1.0)) - (2.0 / x)) tmp = 0 if t_1 <= -50.0: tmp = (-2.0 / x) + (t_0 + (-1.0 / (-1.0 - x))) elif t_1 <= 0.0: tmp = 2.0 * math.pow(x, -3.0) else: tmp = t_1 return tmp
function code(x) t_0 = Float64(1.0 / Float64(x + -1.0)) t_1 = Float64(t_0 + Float64(Float64(1.0 / Float64(x + 1.0)) - Float64(2.0 / x))) tmp = 0.0 if (t_1 <= -50.0) tmp = Float64(Float64(-2.0 / x) + Float64(t_0 + Float64(-1.0 / Float64(-1.0 - x)))); elseif (t_1 <= 0.0) tmp = Float64(2.0 * (x ^ -3.0)); else tmp = t_1; end return tmp end
function tmp_2 = code(x) t_0 = 1.0 / (x + -1.0); t_1 = t_0 + ((1.0 / (x + 1.0)) - (2.0 / x)); tmp = 0.0; if (t_1 <= -50.0) tmp = (-2.0 / x) + (t_0 + (-1.0 / (-1.0 - x))); elseif (t_1 <= 0.0) tmp = 2.0 * (x ^ -3.0); else tmp = t_1; end tmp_2 = tmp; end
code[x_] := Block[{t$95$0 = N[(1.0 / N[(x + -1.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(t$95$0 + N[(N[(1.0 / N[(x + 1.0), $MachinePrecision]), $MachinePrecision] - N[(2.0 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -50.0], N[(N[(-2.0 / x), $MachinePrecision] + N[(t$95$0 + N[(-1.0 / N[(-1.0 - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 0.0], N[(2.0 * N[Power[x, -3.0], $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{1}{x + -1}\\
t_1 := t_0 + \left(\frac{1}{x + 1} - \frac{2}{x}\right)\\
\mathbf{if}\;t_1 \leq -50:\\
\;\;\;\;\frac{-2}{x} + \left(t_0 + \frac{-1}{-1 - x}\right)\\
\mathbf{elif}\;t_1 \leq 0:\\
\;\;\;\;2 \cdot {x}^{-3}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if (+.f64 (-.f64 (/.f64 1 (+.f64 x 1)) (/.f64 2 x)) (/.f64 1 (-.f64 x 1))) < -50Initial program 100.0%
Simplified100.0%
if -50 < (+.f64 (-.f64 (/.f64 1 (+.f64 x 1)) (/.f64 2 x)) (/.f64 1 (-.f64 x 1))) < 0.0Initial program 68.5%
Simplified68.5%
Taylor expanded in x around inf 99.1%
div-inv99.1%
*-commutative99.1%
pow-flip99.6%
metadata-eval99.6%
Applied egg-rr99.6%
if 0.0 < (+.f64 (-.f64 (/.f64 1 (+.f64 x 1)) (/.f64 2 x)) (/.f64 1 (-.f64 x 1))) Initial program 99.5%
Final simplification99.7%
(FPCore (x) :precision binary64 (+ (/ 1.0 (+ x -1.0)) (- (/ 1.0 (+ x 1.0)) (/ 2.0 x))))
double code(double x) {
return (1.0 / (x + -1.0)) + ((1.0 / (x + 1.0)) - (2.0 / x));
}
real(8) function code(x)
real(8), intent (in) :: x
code = (1.0d0 / (x + (-1.0d0))) + ((1.0d0 / (x + 1.0d0)) - (2.0d0 / x))
end function
public static double code(double x) {
return (1.0 / (x + -1.0)) + ((1.0 / (x + 1.0)) - (2.0 / x));
}
def code(x): return (1.0 / (x + -1.0)) + ((1.0 / (x + 1.0)) - (2.0 / x))
function code(x) return Float64(Float64(1.0 / Float64(x + -1.0)) + Float64(Float64(1.0 / Float64(x + 1.0)) - Float64(2.0 / x))) end
function tmp = code(x) tmp = (1.0 / (x + -1.0)) + ((1.0 / (x + 1.0)) - (2.0 / x)); end
code[x_] := N[(N[(1.0 / N[(x + -1.0), $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 / N[(x + 1.0), $MachinePrecision]), $MachinePrecision] - N[(2.0 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{1}{x + -1} + \left(\frac{1}{x + 1} - \frac{2}{x}\right)
\end{array}
Initial program 84.1%
Final simplification84.1%
(FPCore (x) :precision binary64 (if (<= x -1.0) 0.0 (if (<= x 1.0) (- (* x -2.0) (/ 2.0 x)) 0.0)))
double code(double x) {
double tmp;
if (x <= -1.0) {
tmp = 0.0;
} else if (x <= 1.0) {
tmp = (x * -2.0) - (2.0 / x);
} else {
tmp = 0.0;
}
return tmp;
}
real(8) function code(x)
real(8), intent (in) :: x
real(8) :: tmp
if (x <= (-1.0d0)) then
tmp = 0.0d0
else if (x <= 1.0d0) then
tmp = (x * (-2.0d0)) - (2.0d0 / x)
else
tmp = 0.0d0
end if
code = tmp
end function
public static double code(double x) {
double tmp;
if (x <= -1.0) {
tmp = 0.0;
} else if (x <= 1.0) {
tmp = (x * -2.0) - (2.0 / x);
} else {
tmp = 0.0;
}
return tmp;
}
def code(x): tmp = 0 if x <= -1.0: tmp = 0.0 elif x <= 1.0: tmp = (x * -2.0) - (2.0 / x) else: tmp = 0.0 return tmp
function code(x) tmp = 0.0 if (x <= -1.0) tmp = 0.0; elseif (x <= 1.0) tmp = Float64(Float64(x * -2.0) - Float64(2.0 / x)); else tmp = 0.0; end return tmp end
function tmp_2 = code(x) tmp = 0.0; if (x <= -1.0) tmp = 0.0; elseif (x <= 1.0) tmp = (x * -2.0) - (2.0 / x); else tmp = 0.0; end tmp_2 = tmp; end
code[x_] := If[LessEqual[x, -1.0], 0.0, If[LessEqual[x, 1.0], N[(N[(x * -2.0), $MachinePrecision] - N[(2.0 / x), $MachinePrecision]), $MachinePrecision], 0.0]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1:\\
\;\;\;\;0\\
\mathbf{elif}\;x \leq 1:\\
\;\;\;\;x \cdot -2 - \frac{2}{x}\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\end{array}
if x < -1 or 1 < x Initial program 68.5%
Simplified68.5%
Applied egg-rr6.1%
fma-udef6.1%
*-rgt-identity6.1%
count-26.1%
count-26.1%
associate-*r/6.1%
metadata-eval6.1%
+-commutative6.1%
Simplified6.1%
+-commutative6.1%
associate-*r/6.1%
frac-2neg6.1%
metadata-eval6.1%
frac-add54.7%
+-commutative54.7%
metadata-eval54.7%
Applied egg-rr54.7%
Taylor expanded in x around 0 55.0%
Applied egg-rr67.2%
if -1 < x < 1Initial program 100.0%
Simplified100.0%
Taylor expanded in x around 0 99.5%
associate-*r/99.5%
metadata-eval99.5%
Simplified99.5%
Final simplification83.2%
(FPCore (x) :precision binary64 (+ (/ -2.0 x) (/ 2.0 (+ x 1.0))))
double code(double x) {
return (-2.0 / x) + (2.0 / (x + 1.0));
}
real(8) function code(x)
real(8), intent (in) :: x
code = ((-2.0d0) / x) + (2.0d0 / (x + 1.0d0))
end function
public static double code(double x) {
return (-2.0 / x) + (2.0 / (x + 1.0));
}
def code(x): return (-2.0 / x) + (2.0 / (x + 1.0))
function code(x) return Float64(Float64(-2.0 / x) + Float64(2.0 / Float64(x + 1.0))) end
function tmp = code(x) tmp = (-2.0 / x) + (2.0 / (x + 1.0)); end
code[x_] := N[(N[(-2.0 / x), $MachinePrecision] + N[(2.0 / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{-2}{x} + \frac{2}{x + 1}
\end{array}
Initial program 84.1%
Simplified84.1%
Applied egg-rr62.6%
associate-+l+62.3%
expm1-log1p62.3%
expm1-def49.8%
associate-+l-49.8%
fma-udef49.8%
distribute-lft-neg-out49.8%
pow-sqr51.2%
metadata-eval51.2%
unpow-151.2%
+-commutative51.2%
sub-neg51.2%
+-inverses51.2%
metadata-eval51.2%
Simplified82.6%
Final simplification82.6%
(FPCore (x) :precision binary64 (if (<= x -1.0) 0.0 (if (<= x 1.0) (/ -2.0 x) 0.0)))
double code(double x) {
double tmp;
if (x <= -1.0) {
tmp = 0.0;
} else if (x <= 1.0) {
tmp = -2.0 / x;
} else {
tmp = 0.0;
}
return tmp;
}
real(8) function code(x)
real(8), intent (in) :: x
real(8) :: tmp
if (x <= (-1.0d0)) then
tmp = 0.0d0
else if (x <= 1.0d0) then
tmp = (-2.0d0) / x
else
tmp = 0.0d0
end if
code = tmp
end function
public static double code(double x) {
double tmp;
if (x <= -1.0) {
tmp = 0.0;
} else if (x <= 1.0) {
tmp = -2.0 / x;
} else {
tmp = 0.0;
}
return tmp;
}
def code(x): tmp = 0 if x <= -1.0: tmp = 0.0 elif x <= 1.0: tmp = -2.0 / x else: tmp = 0.0 return tmp
function code(x) tmp = 0.0 if (x <= -1.0) tmp = 0.0; elseif (x <= 1.0) tmp = Float64(-2.0 / x); else tmp = 0.0; end return tmp end
function tmp_2 = code(x) tmp = 0.0; if (x <= -1.0) tmp = 0.0; elseif (x <= 1.0) tmp = -2.0 / x; else tmp = 0.0; end tmp_2 = tmp; end
code[x_] := If[LessEqual[x, -1.0], 0.0, If[LessEqual[x, 1.0], N[(-2.0 / x), $MachinePrecision], 0.0]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1:\\
\;\;\;\;0\\
\mathbf{elif}\;x \leq 1:\\
\;\;\;\;\frac{-2}{x}\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\end{array}
if x < -1 or 1 < x Initial program 68.5%
Simplified68.5%
Applied egg-rr6.1%
fma-udef6.1%
*-rgt-identity6.1%
count-26.1%
count-26.1%
associate-*r/6.1%
metadata-eval6.1%
+-commutative6.1%
Simplified6.1%
+-commutative6.1%
associate-*r/6.1%
frac-2neg6.1%
metadata-eval6.1%
frac-add54.7%
+-commutative54.7%
metadata-eval54.7%
Applied egg-rr54.7%
Taylor expanded in x around 0 55.0%
Applied egg-rr67.2%
if -1 < x < 1Initial program 100.0%
Simplified100.0%
Taylor expanded in x around 0 98.7%
Final simplification82.8%
(FPCore (x) :precision binary64 -8.0)
double code(double x) {
return -8.0;
}
real(8) function code(x)
real(8), intent (in) :: x
code = -8.0d0
end function
public static double code(double x) {
return -8.0;
}
def code(x): return -8.0
function code(x) return -8.0 end
function tmp = code(x) tmp = -8.0; end
code[x_] := -8.0
\begin{array}{l}
\\
-8
\end{array}
Initial program 84.1%
Simplified84.1%
Applied egg-rr51.7%
fma-udef51.7%
*-rgt-identity51.7%
count-251.7%
count-251.7%
associate-*r/51.7%
metadata-eval51.7%
+-commutative51.7%
Simplified51.7%
+-commutative51.7%
associate-*r/51.7%
frac-2neg51.7%
metadata-eval51.7%
frac-add76.2%
+-commutative76.2%
metadata-eval76.2%
Applied egg-rr76.2%
Taylor expanded in x around 0 76.3%
Applied egg-rr3.5%
Final simplification3.5%
(FPCore (x) :precision binary64 0.0)
double code(double x) {
return 0.0;
}
real(8) function code(x)
real(8), intent (in) :: x
code = 0.0d0
end function
public static double code(double x) {
return 0.0;
}
def code(x): return 0.0
function code(x) return 0.0 end
function tmp = code(x) tmp = 0.0; end
code[x_] := 0.0
\begin{array}{l}
\\
0
\end{array}
Initial program 84.1%
Simplified84.1%
Applied egg-rr51.7%
fma-udef51.7%
*-rgt-identity51.7%
count-251.7%
count-251.7%
associate-*r/51.7%
metadata-eval51.7%
+-commutative51.7%
Simplified51.7%
+-commutative51.7%
associate-*r/51.7%
frac-2neg51.7%
metadata-eval51.7%
frac-add76.2%
+-commutative76.2%
metadata-eval76.2%
Applied egg-rr76.2%
Taylor expanded in x around 0 76.3%
Applied egg-rr35.0%
Final simplification35.0%
(FPCore (x) :precision binary64 (/ 2.0 (* x (- (* x x) 1.0))))
double code(double x) {
return 2.0 / (x * ((x * x) - 1.0));
}
real(8) function code(x)
real(8), intent (in) :: x
code = 2.0d0 / (x * ((x * x) - 1.0d0))
end function
public static double code(double x) {
return 2.0 / (x * ((x * x) - 1.0));
}
def code(x): return 2.0 / (x * ((x * x) - 1.0))
function code(x) return Float64(2.0 / Float64(x * Float64(Float64(x * x) - 1.0))) end
function tmp = code(x) tmp = 2.0 / (x * ((x * x) - 1.0)); end
code[x_] := N[(2.0 / N[(x * N[(N[(x * x), $MachinePrecision] - 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{2}{x \cdot \left(x \cdot x - 1\right)}
\end{array}
herbie shell --seed 2023301
(FPCore (x)
:name "3frac (problem 3.3.3)"
:precision binary64
:herbie-target
(/ 2.0 (* x (- (* x x) 1.0)))
(+ (- (/ 1.0 (+ x 1.0)) (/ 2.0 x)) (/ 1.0 (- x 1.0))))