
(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 10 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 (/ (/ 2.0 (fma x x x)) (+ x -1.0)))
double code(double x) {
return (2.0 / fma(x, x, x)) / (x + -1.0);
}
function code(x) return Float64(Float64(2.0 / fma(x, x, x)) / Float64(x + -1.0)) end
code[x_] := N[(N[(2.0 / N[(x * x + x), $MachinePrecision]), $MachinePrecision] / N[(x + -1.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\frac{2}{\mathsf{fma}\left(x, x, x\right)}}{x + -1}
\end{array}
Initial program 65.0%
+-commutative65.0%
associate-+r-65.0%
sub-neg65.0%
remove-double-neg65.0%
neg-sub065.0%
associate-+l-65.0%
neg-sub065.0%
distribute-neg-frac265.0%
distribute-frac-neg265.0%
associate-+r+65.0%
+-commutative65.0%
remove-double-neg65.0%
distribute-neg-frac265.0%
sub0-neg65.0%
associate-+l-65.0%
neg-sub065.0%
Simplified65.0%
clear-num65.0%
frac-sub18.5%
*-un-lft-identity18.5%
div-inv18.5%
metadata-eval18.5%
div-inv18.5%
metadata-eval18.5%
Applied egg-rr18.5%
sub-neg18.5%
*-rgt-identity18.5%
sub-neg18.5%
neg-mul-118.5%
*-commutative18.5%
associate-+l+18.5%
neg-mul-118.5%
*-commutative18.5%
associate-*l*18.5%
distribute-lft-out18.5%
metadata-eval18.5%
metadata-eval18.5%
*-commutative18.5%
associate-*r*18.5%
*-commutative18.5%
Simplified18.5%
+-commutative18.5%
frac-add19.3%
+-commutative19.3%
fma-define19.3%
associate-*l*19.3%
associate-*l*19.3%
Applied egg-rr19.3%
Taylor expanded in x around 0 99.1%
inv-pow99.1%
unpow-prod-down99.8%
Applied egg-rr99.8%
unpow-199.8%
associate-*r/99.8%
*-rgt-identity99.8%
*-commutative99.8%
associate-/r*99.8%
metadata-eval99.8%
Simplified99.8%
(FPCore (x) :precision binary64 (* 2.0 (pow x -3.0)))
double code(double x) {
return 2.0 * pow(x, -3.0);
}
real(8) function code(x)
real(8), intent (in) :: x
code = 2.0d0 * (x ** (-3.0d0))
end function
public static double code(double x) {
return 2.0 * Math.pow(x, -3.0);
}
def code(x): return 2.0 * math.pow(x, -3.0)
function code(x) return Float64(2.0 * (x ^ -3.0)) end
function tmp = code(x) tmp = 2.0 * (x ^ -3.0); end
code[x_] := N[(2.0 * N[Power[x, -3.0], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
2 \cdot {x}^{-3}
\end{array}
Initial program 65.0%
+-commutative65.0%
associate-+r-65.0%
sub-neg65.0%
remove-double-neg65.0%
neg-sub065.0%
associate-+l-65.0%
neg-sub065.0%
distribute-neg-frac265.0%
distribute-frac-neg265.0%
associate-+r+65.0%
+-commutative65.0%
remove-double-neg65.0%
distribute-neg-frac265.0%
sub0-neg65.0%
associate-+l-65.0%
neg-sub065.0%
Simplified65.0%
Taylor expanded in x around inf 98.7%
div-inv98.7%
pow-flip99.5%
metadata-eval99.5%
Applied egg-rr99.5%
(FPCore (x) :precision binary64 (/ 1.0 (* x (* (- -1.0 x) (* (+ x -1.0) -0.5)))))
double code(double x) {
return 1.0 / (x * ((-1.0 - x) * ((x + -1.0) * -0.5)));
}
real(8) function code(x)
real(8), intent (in) :: x
code = 1.0d0 / (x * (((-1.0d0) - x) * ((x + (-1.0d0)) * (-0.5d0))))
end function
public static double code(double x) {
return 1.0 / (x * ((-1.0 - x) * ((x + -1.0) * -0.5)));
}
def code(x): return 1.0 / (x * ((-1.0 - x) * ((x + -1.0) * -0.5)))
function code(x) return Float64(1.0 / Float64(x * Float64(Float64(-1.0 - x) * Float64(Float64(x + -1.0) * -0.5)))) end
function tmp = code(x) tmp = 1.0 / (x * ((-1.0 - x) * ((x + -1.0) * -0.5))); end
code[x_] := N[(1.0 / N[(x * N[(N[(-1.0 - x), $MachinePrecision] * N[(N[(x + -1.0), $MachinePrecision] * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{1}{x \cdot \left(\left(-1 - x\right) \cdot \left(\left(x + -1\right) \cdot -0.5\right)\right)}
\end{array}
Initial program 65.0%
+-commutative65.0%
associate-+r-65.0%
sub-neg65.0%
remove-double-neg65.0%
neg-sub065.0%
associate-+l-65.0%
neg-sub065.0%
distribute-neg-frac265.0%
distribute-frac-neg265.0%
associate-+r+65.0%
+-commutative65.0%
remove-double-neg65.0%
distribute-neg-frac265.0%
sub0-neg65.0%
associate-+l-65.0%
neg-sub065.0%
Simplified65.0%
clear-num65.0%
frac-sub18.5%
*-un-lft-identity18.5%
div-inv18.5%
metadata-eval18.5%
div-inv18.5%
metadata-eval18.5%
Applied egg-rr18.5%
sub-neg18.5%
*-rgt-identity18.5%
sub-neg18.5%
neg-mul-118.5%
*-commutative18.5%
associate-+l+18.5%
neg-mul-118.5%
*-commutative18.5%
associate-*l*18.5%
distribute-lft-out18.5%
metadata-eval18.5%
metadata-eval18.5%
*-commutative18.5%
associate-*r*18.5%
*-commutative18.5%
Simplified18.5%
+-commutative18.5%
frac-add19.3%
+-commutative19.3%
fma-define19.3%
associate-*l*19.3%
associate-*l*19.3%
Applied egg-rr19.3%
Taylor expanded in x around 0 99.1%
*-rgt-identity99.1%
distribute-lft-in75.7%
*-rgt-identity75.7%
*-rgt-identity75.7%
Applied egg-rr75.7%
distribute-lft-out99.1%
associate-*r*99.1%
associate-*l*99.1%
Simplified99.1%
Final simplification99.1%
(FPCore (x) :precision binary64 (/ 1.0 (* (+ x -1.0) (* x (* x 0.5)))))
double code(double x) {
return 1.0 / ((x + -1.0) * (x * (x * 0.5)));
}
real(8) function code(x)
real(8), intent (in) :: x
code = 1.0d0 / ((x + (-1.0d0)) * (x * (x * 0.5d0)))
end function
public static double code(double x) {
return 1.0 / ((x + -1.0) * (x * (x * 0.5)));
}
def code(x): return 1.0 / ((x + -1.0) * (x * (x * 0.5)))
function code(x) return Float64(1.0 / Float64(Float64(x + -1.0) * Float64(x * Float64(x * 0.5)))) end
function tmp = code(x) tmp = 1.0 / ((x + -1.0) * (x * (x * 0.5))); end
code[x_] := N[(1.0 / N[(N[(x + -1.0), $MachinePrecision] * N[(x * N[(x * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{1}{\left(x + -1\right) \cdot \left(x \cdot \left(x \cdot 0.5\right)\right)}
\end{array}
Initial program 65.0%
+-commutative65.0%
associate-+r-65.0%
sub-neg65.0%
remove-double-neg65.0%
neg-sub065.0%
associate-+l-65.0%
neg-sub065.0%
distribute-neg-frac265.0%
distribute-frac-neg265.0%
associate-+r+65.0%
+-commutative65.0%
remove-double-neg65.0%
distribute-neg-frac265.0%
sub0-neg65.0%
associate-+l-65.0%
neg-sub065.0%
Simplified65.0%
clear-num65.0%
frac-sub18.5%
*-un-lft-identity18.5%
div-inv18.5%
metadata-eval18.5%
div-inv18.5%
metadata-eval18.5%
Applied egg-rr18.5%
sub-neg18.5%
*-rgt-identity18.5%
sub-neg18.5%
neg-mul-118.5%
*-commutative18.5%
associate-+l+18.5%
neg-mul-118.5%
*-commutative18.5%
associate-*l*18.5%
distribute-lft-out18.5%
metadata-eval18.5%
metadata-eval18.5%
*-commutative18.5%
associate-*r*18.5%
*-commutative18.5%
Simplified18.5%
+-commutative18.5%
frac-add19.3%
+-commutative19.3%
fma-define19.3%
associate-*l*19.3%
associate-*l*19.3%
Applied egg-rr19.3%
Taylor expanded in x around 0 99.1%
Taylor expanded in x around inf 97.0%
*-commutative97.0%
Simplified97.0%
Final simplification97.0%
(FPCore (x) :precision binary64 (/ (/ 1.0 x) (* x (+ x -1.0))))
double code(double x) {
return (1.0 / x) / (x * (x + -1.0));
}
real(8) function code(x)
real(8), intent (in) :: x
code = (1.0d0 / x) / (x * (x + (-1.0d0)))
end function
public static double code(double x) {
return (1.0 / x) / (x * (x + -1.0));
}
def code(x): return (1.0 / x) / (x * (x + -1.0))
function code(x) return Float64(Float64(1.0 / x) / Float64(x * Float64(x + -1.0))) end
function tmp = code(x) tmp = (1.0 / x) / (x * (x + -1.0)); end
code[x_] := N[(N[(1.0 / x), $MachinePrecision] / N[(x * N[(x + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\frac{1}{x}}{x \cdot \left(x + -1\right)}
\end{array}
Initial program 65.0%
+-commutative65.0%
associate-+r-65.0%
sub-neg65.0%
remove-double-neg65.0%
neg-sub065.0%
associate-+l-65.0%
neg-sub065.0%
distribute-neg-frac265.0%
distribute-frac-neg265.0%
associate-+r+65.0%
+-commutative65.0%
remove-double-neg65.0%
distribute-neg-frac265.0%
sub0-neg65.0%
associate-+l-65.0%
neg-sub065.0%
Simplified65.0%
Taylor expanded in x around inf 64.4%
associate-*r/64.4%
neg-mul-164.4%
distribute-neg-in64.4%
metadata-eval64.4%
distribute-neg-frac64.4%
metadata-eval64.4%
Simplified64.4%
frac-add64.4%
*-un-lft-identity64.4%
Applied egg-rr64.4%
Taylor expanded in x around 0 68.9%
Final simplification68.9%
(FPCore (x) :precision binary64 (/ (/ 1.0 x) (* x x)))
double code(double x) {
return (1.0 / x) / (x * x);
}
real(8) function code(x)
real(8), intent (in) :: x
code = (1.0d0 / x) / (x * x)
end function
public static double code(double x) {
return (1.0 / x) / (x * x);
}
def code(x): return (1.0 / x) / (x * x)
function code(x) return Float64(Float64(1.0 / x) / Float64(x * x)) end
function tmp = code(x) tmp = (1.0 / x) / (x * x); end
code[x_] := N[(N[(1.0 / x), $MachinePrecision] / N[(x * x), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\frac{1}{x}}{x \cdot x}
\end{array}
Initial program 65.0%
+-commutative65.0%
associate-+r-65.0%
sub-neg65.0%
remove-double-neg65.0%
neg-sub065.0%
associate-+l-65.0%
neg-sub065.0%
distribute-neg-frac265.0%
distribute-frac-neg265.0%
associate-+r+65.0%
+-commutative65.0%
remove-double-neg65.0%
distribute-neg-frac265.0%
sub0-neg65.0%
associate-+l-65.0%
neg-sub065.0%
Simplified65.0%
Taylor expanded in x around inf 64.4%
associate-*r/64.4%
neg-mul-164.4%
distribute-neg-in64.4%
metadata-eval64.4%
distribute-neg-frac64.4%
metadata-eval64.4%
Simplified64.4%
frac-add64.4%
*-un-lft-identity64.4%
Applied egg-rr64.4%
Taylor expanded in x around 0 68.9%
Taylor expanded in x around inf 68.9%
(FPCore (x) :precision binary64 (/ (/ 1.0 x) x))
double code(double x) {
return (1.0 / x) / x;
}
real(8) function code(x)
real(8), intent (in) :: x
code = (1.0d0 / x) / x
end function
public static double code(double x) {
return (1.0 / x) / x;
}
def code(x): return (1.0 / x) / x
function code(x) return Float64(Float64(1.0 / x) / x) end
function tmp = code(x) tmp = (1.0 / x) / x; end
code[x_] := N[(N[(1.0 / x), $MachinePrecision] / x), $MachinePrecision]
\begin{array}{l}
\\
\frac{\frac{1}{x}}{x}
\end{array}
Initial program 65.0%
+-commutative65.0%
associate-+r-65.0%
sub-neg65.0%
remove-double-neg65.0%
neg-sub065.0%
associate-+l-65.0%
neg-sub065.0%
distribute-neg-frac265.0%
distribute-frac-neg265.0%
associate-+r+65.0%
+-commutative65.0%
remove-double-neg65.0%
distribute-neg-frac265.0%
sub0-neg65.0%
associate-+l-65.0%
neg-sub065.0%
Simplified65.0%
Taylor expanded in x around inf 64.4%
associate-*r/64.4%
neg-mul-164.4%
distribute-neg-in64.4%
metadata-eval64.4%
distribute-neg-frac64.4%
metadata-eval64.4%
Simplified64.4%
Taylor expanded in x around 0 48.9%
sub-neg48.9%
*-commutative48.9%
metadata-eval48.9%
distribute-lft1-in48.9%
distribute-rgt1-in48.9%
*-commutative48.9%
neg-mul-148.9%
sub-neg48.9%
unpow248.9%
associate-/r*4.9%
sub-neg4.9%
neg-mul-14.9%
*-commutative4.9%
distribute-rgt1-in4.9%
distribute-lft1-in4.9%
*-commutative4.9%
metadata-eval4.9%
sub-neg4.9%
div-sub4.9%
neg-mul-14.9%
distribute-frac-neg4.9%
*-inverses4.9%
metadata-eval4.9%
Simplified4.9%
sub-neg4.9%
add-sqr-sqrt2.6%
sqrt-unprod4.9%
frac-times4.9%
metadata-eval4.9%
metadata-eval4.9%
frac-times4.9%
sqrt-unprod2.3%
add-sqr-sqrt4.9%
Applied egg-rr4.9%
distribute-neg-frac4.9%
metadata-eval4.9%
Simplified4.9%
Taylor expanded in x around 0 49.8%
(FPCore (x) :precision binary64 (/ -1.0 (- x)))
double code(double x) {
return -1.0 / -x;
}
real(8) function code(x)
real(8), intent (in) :: x
code = (-1.0d0) / -x
end function
public static double code(double x) {
return -1.0 / -x;
}
def code(x): return -1.0 / -x
function code(x) return Float64(-1.0 / Float64(-x)) end
function tmp = code(x) tmp = -1.0 / -x; end
code[x_] := N[(-1.0 / (-x)), $MachinePrecision]
\begin{array}{l}
\\
\frac{-1}{-x}
\end{array}
Initial program 65.0%
+-commutative65.0%
associate-+r-65.0%
sub-neg65.0%
remove-double-neg65.0%
neg-sub065.0%
associate-+l-65.0%
neg-sub065.0%
distribute-neg-frac265.0%
distribute-frac-neg265.0%
associate-+r+65.0%
+-commutative65.0%
remove-double-neg65.0%
distribute-neg-frac265.0%
sub0-neg65.0%
associate-+l-65.0%
neg-sub065.0%
Simplified65.0%
Taylor expanded in x around inf 64.4%
associate-*r/64.4%
neg-mul-164.4%
distribute-neg-in64.4%
metadata-eval64.4%
distribute-neg-frac64.4%
metadata-eval64.4%
Simplified64.4%
Taylor expanded in x around 0 48.9%
sub-neg48.9%
*-commutative48.9%
metadata-eval48.9%
distribute-lft1-in48.9%
distribute-rgt1-in48.9%
*-commutative48.9%
neg-mul-148.9%
sub-neg48.9%
unpow248.9%
associate-/r*4.9%
sub-neg4.9%
neg-mul-14.9%
*-commutative4.9%
distribute-rgt1-in4.9%
distribute-lft1-in4.9%
*-commutative4.9%
metadata-eval4.9%
sub-neg4.9%
div-sub4.9%
neg-mul-14.9%
distribute-frac-neg4.9%
*-inverses4.9%
metadata-eval4.9%
Simplified4.9%
Taylor expanded in x around inf 4.9%
add-sqr-sqrt2.3%
sqrt-unprod47.5%
frac-times49.7%
metadata-eval49.7%
metadata-eval49.7%
frac-times47.5%
sqrt-prod3.5%
add-sqr-sqrt6.2%
frac-2neg6.2%
metadata-eval6.2%
distribute-frac-neg26.2%
Applied egg-rr6.2%
Final simplification6.2%
(FPCore (x) :precision binary64 (/ -1.0 x))
double code(double x) {
return -1.0 / x;
}
real(8) function code(x)
real(8), intent (in) :: x
code = (-1.0d0) / x
end function
public static double code(double x) {
return -1.0 / x;
}
def code(x): return -1.0 / x
function code(x) return Float64(-1.0 / x) end
function tmp = code(x) tmp = -1.0 / x; end
code[x_] := N[(-1.0 / x), $MachinePrecision]
\begin{array}{l}
\\
\frac{-1}{x}
\end{array}
Initial program 65.0%
+-commutative65.0%
associate-+r-65.0%
sub-neg65.0%
remove-double-neg65.0%
neg-sub065.0%
associate-+l-65.0%
neg-sub065.0%
distribute-neg-frac265.0%
distribute-frac-neg265.0%
associate-+r+65.0%
+-commutative65.0%
remove-double-neg65.0%
distribute-neg-frac265.0%
sub0-neg65.0%
associate-+l-65.0%
neg-sub065.0%
Simplified65.0%
Taylor expanded in x around inf 64.4%
associate-*r/64.4%
neg-mul-164.4%
distribute-neg-in64.4%
metadata-eval64.4%
distribute-neg-frac64.4%
metadata-eval64.4%
Simplified64.4%
Taylor expanded in x around 0 48.9%
sub-neg48.9%
*-commutative48.9%
metadata-eval48.9%
distribute-lft1-in48.9%
distribute-rgt1-in48.9%
*-commutative48.9%
neg-mul-148.9%
sub-neg48.9%
unpow248.9%
associate-/r*4.9%
sub-neg4.9%
neg-mul-14.9%
*-commutative4.9%
distribute-rgt1-in4.9%
distribute-lft1-in4.9%
*-commutative4.9%
metadata-eval4.9%
sub-neg4.9%
div-sub4.9%
neg-mul-14.9%
distribute-frac-neg4.9%
*-inverses4.9%
metadata-eval4.9%
Simplified4.9%
Taylor expanded in x around inf 4.9%
(FPCore (x) :precision binary64 (/ -2.0 x))
double code(double x) {
return -2.0 / x;
}
real(8) function code(x)
real(8), intent (in) :: x
code = (-2.0d0) / x
end function
public static double code(double x) {
return -2.0 / x;
}
def code(x): return -2.0 / x
function code(x) return Float64(-2.0 / x) end
function tmp = code(x) tmp = -2.0 / x; end
code[x_] := N[(-2.0 / x), $MachinePrecision]
\begin{array}{l}
\\
\frac{-2}{x}
\end{array}
Initial program 65.0%
+-commutative65.0%
associate-+r-65.0%
sub-neg65.0%
remove-double-neg65.0%
neg-sub065.0%
associate-+l-65.0%
neg-sub065.0%
distribute-neg-frac265.0%
distribute-frac-neg265.0%
associate-+r+65.0%
+-commutative65.0%
remove-double-neg65.0%
distribute-neg-frac265.0%
sub0-neg65.0%
associate-+l-65.0%
neg-sub065.0%
Simplified65.0%
Taylor expanded in x around 0 4.9%
(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 2024123
(FPCore (x)
:name "3frac (problem 3.3.3)"
:precision binary64
:pre (> (fabs x) 1.0)
:alt
(! :herbie-platform default (/ 2 (* x (- (* x x) 1))))
(+ (- (/ 1.0 (+ x 1.0)) (/ 2.0 x)) (/ 1.0 (- x 1.0))))