| Alternative 1 | |
|---|---|
| Accuracy | 99.8% |
| Cost | 72136 |

(FPCore (x) :precision binary64 (copysign (log (+ (fabs x) (sqrt (+ (* x x) 1.0)))) x))
(FPCore (x)
:precision binary64
(let* ((t_0 (copysign (log (+ (fabs x) (sqrt (+ (* x x) 1.0)))) x)))
(if (<= t_0 -0.2)
(copysign (- (log (- (hypot 1.0 x) x))) x)
(if (<= t_0 5e-7)
(copysign (+ x (* -0.16666666666666666 (pow x 3.0))) x)
(copysign (+ (+ 1.0 (log (+ x (hypot 1.0 x)))) -1.0) x)))))double code(double x) {
return copysign(log((fabs(x) + sqrt(((x * x) + 1.0)))), x);
}
double code(double x) {
double t_0 = copysign(log((fabs(x) + sqrt(((x * x) + 1.0)))), x);
double tmp;
if (t_0 <= -0.2) {
tmp = copysign(-log((hypot(1.0, x) - x)), x);
} else if (t_0 <= 5e-7) {
tmp = copysign((x + (-0.16666666666666666 * pow(x, 3.0))), x);
} else {
tmp = copysign(((1.0 + log((x + hypot(1.0, x)))) + -1.0), x);
}
return tmp;
}
public static double code(double x) {
return Math.copySign(Math.log((Math.abs(x) + Math.sqrt(((x * x) + 1.0)))), x);
}
public static double code(double x) {
double t_0 = Math.copySign(Math.log((Math.abs(x) + Math.sqrt(((x * x) + 1.0)))), x);
double tmp;
if (t_0 <= -0.2) {
tmp = Math.copySign(-Math.log((Math.hypot(1.0, x) - x)), x);
} else if (t_0 <= 5e-7) {
tmp = Math.copySign((x + (-0.16666666666666666 * Math.pow(x, 3.0))), x);
} else {
tmp = Math.copySign(((1.0 + Math.log((x + Math.hypot(1.0, x)))) + -1.0), x);
}
return tmp;
}
def code(x): return math.copysign(math.log((math.fabs(x) + math.sqrt(((x * x) + 1.0)))), x)
def code(x): t_0 = math.copysign(math.log((math.fabs(x) + math.sqrt(((x * x) + 1.0)))), x) tmp = 0 if t_0 <= -0.2: tmp = math.copysign(-math.log((math.hypot(1.0, x) - x)), x) elif t_0 <= 5e-7: tmp = math.copysign((x + (-0.16666666666666666 * math.pow(x, 3.0))), x) else: tmp = math.copysign(((1.0 + math.log((x + math.hypot(1.0, x)))) + -1.0), x) return tmp
function code(x) return copysign(log(Float64(abs(x) + sqrt(Float64(Float64(x * x) + 1.0)))), x) end
function code(x) t_0 = copysign(log(Float64(abs(x) + sqrt(Float64(Float64(x * x) + 1.0)))), x) tmp = 0.0 if (t_0 <= -0.2) tmp = copysign(Float64(-log(Float64(hypot(1.0, x) - x))), x); elseif (t_0 <= 5e-7) tmp = copysign(Float64(x + Float64(-0.16666666666666666 * (x ^ 3.0))), x); else tmp = copysign(Float64(Float64(1.0 + log(Float64(x + hypot(1.0, x)))) + -1.0), x); end return tmp end
function tmp = code(x) tmp = sign(x) * abs(log((abs(x) + sqrt(((x * x) + 1.0))))); end
function tmp_2 = code(x) t_0 = sign(x) * abs(log((abs(x) + sqrt(((x * x) + 1.0))))); tmp = 0.0; if (t_0 <= -0.2) tmp = sign(x) * abs(-log((hypot(1.0, x) - x))); elseif (t_0 <= 5e-7) tmp = sign(x) * abs((x + (-0.16666666666666666 * (x ^ 3.0)))); else tmp = sign(x) * abs(((1.0 + log((x + hypot(1.0, x)))) + -1.0)); end tmp_2 = tmp; end
code[x_] := N[With[{TMP1 = Abs[N[Log[N[(N[Abs[x], $MachinePrecision] + N[Sqrt[N[(N[(x * x), $MachinePrecision] + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[x_] := Block[{t$95$0 = N[With[{TMP1 = Abs[N[Log[N[(N[Abs[x], $MachinePrecision] + N[Sqrt[N[(N[(x * x), $MachinePrecision] + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]}, If[LessEqual[t$95$0, -0.2], N[With[{TMP1 = Abs[(-N[Log[N[(N[Sqrt[1.0 ^ 2 + x ^ 2], $MachinePrecision] - x), $MachinePrecision]], $MachinePrecision])], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision], If[LessEqual[t$95$0, 5e-7], N[With[{TMP1 = Abs[N[(x + N[(-0.16666666666666666 * N[Power[x, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision], N[With[{TMP1 = Abs[N[(N[(1.0 + N[Log[N[(x + N[Sqrt[1.0 ^ 2 + x ^ 2], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision]], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]]]]
\mathsf{copysign}\left(\log \left(\left|x\right| + \sqrt{x \cdot x + 1}\right), x\right)
\begin{array}{l}
t_0 := \mathsf{copysign}\left(\log \left(\left|x\right| + \sqrt{x \cdot x + 1}\right), x\right)\\
\mathbf{if}\;t_0 \leq -0.2:\\
\;\;\;\;\mathsf{copysign}\left(-\log \left(\mathsf{hypot}\left(1, x\right) - x\right), x\right)\\
\mathbf{elif}\;t_0 \leq 5 \cdot 10^{-7}:\\
\;\;\;\;\mathsf{copysign}\left(x + -0.16666666666666666 \cdot {x}^{3}, x\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{copysign}\left(\left(1 + \log \left(x + \mathsf{hypot}\left(1, x\right)\right)\right) + -1, x\right)\\
\end{array}
Herbie found 11 alternatives:
| Alternative | Accuracy | Speedup |
|---|
| Original | 29.6% |
|---|---|
| Target | 99.9% |
| Herbie | 99.8% |
if (copysign.f64 (log.f64 (+.f64 (fabs.f64 x) (sqrt.f64 (+.f64 (*.f64 x x) 1)))) x) < -0.20000000000000001Initial program 44.9%
Simplified100.0%
[Start]44.9% | \[ \mathsf{copysign}\left(\log \left(\left|x\right| + \sqrt{x \cdot x + 1}\right), x\right)
\] |
|---|---|
+-commutative [=>]44.9% | \[ \mathsf{copysign}\left(\log \left(\left|x\right| + \sqrt{\color{blue}{1 + x \cdot x}}\right), x\right)
\] |
hypot-1-def [=>]100.0% | \[ \mathsf{copysign}\left(\log \left(\left|x\right| + \color{blue}{\mathsf{hypot}\left(1, x\right)}\right), x\right)
\] |
Applied egg-rr6.6%
[Start]100.0% | \[ \mathsf{copysign}\left(\log \left(\left|x\right| + \mathsf{hypot}\left(1, x\right)\right), x\right)
\] |
|---|---|
*-un-lft-identity [=>]100.0% | \[ \mathsf{copysign}\left(\log \color{blue}{\left(1 \cdot \left(\left|x\right| + \mathsf{hypot}\left(1, x\right)\right)\right)}, x\right)
\] |
log-prod [=>]100.0% | \[ \mathsf{copysign}\left(\color{blue}{\log 1 + \log \left(\left|x\right| + \mathsf{hypot}\left(1, x\right)\right)}, x\right)
\] |
metadata-eval [=>]100.0% | \[ \mathsf{copysign}\left(\color{blue}{0} + \log \left(\left|x\right| + \mathsf{hypot}\left(1, x\right)\right), x\right)
\] |
*-un-lft-identity [=>]100.0% | \[ \mathsf{copysign}\left(0 + \log \color{blue}{\left(1 \cdot \left(\left|x\right| + \mathsf{hypot}\left(1, x\right)\right)\right)}, x\right)
\] |
*-un-lft-identity [<=]100.0% | \[ \mathsf{copysign}\left(0 + \log \color{blue}{\left(\left|x\right| + \mathsf{hypot}\left(1, x\right)\right)}, x\right)
\] |
add-sqr-sqrt [=>]0.0% | \[ \mathsf{copysign}\left(0 + \log \left(\left|\color{blue}{\sqrt{x} \cdot \sqrt{x}}\right| + \mathsf{hypot}\left(1, x\right)\right), x\right)
\] |
fabs-sqr [=>]0.0% | \[ \mathsf{copysign}\left(0 + \log \left(\color{blue}{\sqrt{x} \cdot \sqrt{x}} + \mathsf{hypot}\left(1, x\right)\right), x\right)
\] |
add-sqr-sqrt [<=]6.6% | \[ \mathsf{copysign}\left(0 + \log \left(\color{blue}{x} + \mathsf{hypot}\left(1, x\right)\right), x\right)
\] |
Simplified6.6%
[Start]6.6% | \[ \mathsf{copysign}\left(0 + \log \left(x + \mathsf{hypot}\left(1, x\right)\right), x\right)
\] |
|---|---|
+-lft-identity [=>]6.6% | \[ \mathsf{copysign}\left(\color{blue}{\log \left(x + \mathsf{hypot}\left(1, x\right)\right)}, x\right)
\] |
Applied egg-rr5.8%
[Start]6.6% | \[ \mathsf{copysign}\left(\log \left(x + \mathsf{hypot}\left(1, x\right)\right), x\right)
\] |
|---|---|
flip-+ [=>]5.6% | \[ \mathsf{copysign}\left(\log \color{blue}{\left(\frac{x \cdot x - \mathsf{hypot}\left(1, x\right) \cdot \mathsf{hypot}\left(1, x\right)}{x - \mathsf{hypot}\left(1, x\right)}\right)}, x\right)
\] |
frac-2neg [=>]5.6% | \[ \mathsf{copysign}\left(\log \color{blue}{\left(\frac{-\left(x \cdot x - \mathsf{hypot}\left(1, x\right) \cdot \mathsf{hypot}\left(1, x\right)\right)}{-\left(x - \mathsf{hypot}\left(1, x\right)\right)}\right)}, x\right)
\] |
log-div [=>]5.6% | \[ \mathsf{copysign}\left(\color{blue}{\log \left(-\left(x \cdot x - \mathsf{hypot}\left(1, x\right) \cdot \mathsf{hypot}\left(1, x\right)\right)\right) - \log \left(-\left(x - \mathsf{hypot}\left(1, x\right)\right)\right)}, x\right)
\] |
hypot-udef [=>]5.6% | \[ \mathsf{copysign}\left(\log \left(-\left(x \cdot x - \color{blue}{\sqrt{1 \cdot 1 + x \cdot x}} \cdot \mathsf{hypot}\left(1, x\right)\right)\right) - \log \left(-\left(x - \mathsf{hypot}\left(1, x\right)\right)\right), x\right)
\] |
hypot-udef [=>]5.6% | \[ \mathsf{copysign}\left(\log \left(-\left(x \cdot x - \sqrt{1 \cdot 1 + x \cdot x} \cdot \color{blue}{\sqrt{1 \cdot 1 + x \cdot x}}\right)\right) - \log \left(-\left(x - \mathsf{hypot}\left(1, x\right)\right)\right), x\right)
\] |
add-sqr-sqrt [<=]5.8% | \[ \mathsf{copysign}\left(\log \left(-\left(x \cdot x - \color{blue}{\left(1 \cdot 1 + x \cdot x\right)}\right)\right) - \log \left(-\left(x - \mathsf{hypot}\left(1, x\right)\right)\right), x\right)
\] |
metadata-eval [=>]5.8% | \[ \mathsf{copysign}\left(\log \left(-\left(x \cdot x - \left(\color{blue}{1} + x \cdot x\right)\right)\right) - \log \left(-\left(x - \mathsf{hypot}\left(1, x\right)\right)\right), x\right)
\] |
+-commutative [=>]5.8% | \[ \mathsf{copysign}\left(\log \left(-\left(x \cdot x - \color{blue}{\left(x \cdot x + 1\right)}\right)\right) - \log \left(-\left(x - \mathsf{hypot}\left(1, x\right)\right)\right), x\right)
\] |
fma-def [=>]5.8% | \[ \mathsf{copysign}\left(\log \left(-\left(x \cdot x - \color{blue}{\mathsf{fma}\left(x, x, 1\right)}\right)\right) - \log \left(-\left(x - \mathsf{hypot}\left(1, x\right)\right)\right), x\right)
\] |
Simplified100.0%
[Start]5.8% | \[ \mathsf{copysign}\left(\log \left(-\left(x \cdot x - \mathsf{fma}\left(x, x, 1\right)\right)\right) - \log \left(-\left(x - \mathsf{hypot}\left(1, x\right)\right)\right), x\right)
\] |
|---|---|
neg-mul-1 [=>]5.8% | \[ \mathsf{copysign}\left(\log \color{blue}{\left(-1 \cdot \left(x \cdot x - \mathsf{fma}\left(x, x, 1\right)\right)\right)} - \log \left(-\left(x - \mathsf{hypot}\left(1, x\right)\right)\right), x\right)
\] |
fma-udef [=>]5.8% | \[ \mathsf{copysign}\left(\log \left(-1 \cdot \left(x \cdot x - \color{blue}{\left(x \cdot x + 1\right)}\right)\right) - \log \left(-\left(x - \mathsf{hypot}\left(1, x\right)\right)\right), x\right)
\] |
associate--r+ [=>]43.1% | \[ \mathsf{copysign}\left(\log \left(-1 \cdot \color{blue}{\left(\left(x \cdot x - x \cdot x\right) - 1\right)}\right) - \log \left(-\left(x - \mathsf{hypot}\left(1, x\right)\right)\right), x\right)
\] |
+-inverses [=>]100.0% | \[ \mathsf{copysign}\left(\log \left(-1 \cdot \left(\color{blue}{0} - 1\right)\right) - \log \left(-\left(x - \mathsf{hypot}\left(1, x\right)\right)\right), x\right)
\] |
metadata-eval [=>]100.0% | \[ \mathsf{copysign}\left(\log \left(-1 \cdot \color{blue}{-1}\right) - \log \left(-\left(x - \mathsf{hypot}\left(1, x\right)\right)\right), x\right)
\] |
metadata-eval [=>]100.0% | \[ \mathsf{copysign}\left(\log \color{blue}{1} - \log \left(-\left(x - \mathsf{hypot}\left(1, x\right)\right)\right), x\right)
\] |
metadata-eval [=>]100.0% | \[ \mathsf{copysign}\left(\color{blue}{0} - \log \left(-\left(x - \mathsf{hypot}\left(1, x\right)\right)\right), x\right)
\] |
neg-sub0 [<=]100.0% | \[ \mathsf{copysign}\left(\color{blue}{-\log \left(-\left(x - \mathsf{hypot}\left(1, x\right)\right)\right)}, x\right)
\] |
neg-sub0 [=>]100.0% | \[ \mathsf{copysign}\left(-\log \color{blue}{\left(0 - \left(x - \mathsf{hypot}\left(1, x\right)\right)\right)}, x\right)
\] |
associate--r- [=>]100.0% | \[ \mathsf{copysign}\left(-\log \color{blue}{\left(\left(0 - x\right) + \mathsf{hypot}\left(1, x\right)\right)}, x\right)
\] |
neg-sub0 [<=]100.0% | \[ \mathsf{copysign}\left(-\log \left(\color{blue}{\left(-x\right)} + \mathsf{hypot}\left(1, x\right)\right), x\right)
\] |
+-commutative [<=]100.0% | \[ \mathsf{copysign}\left(-\log \color{blue}{\left(\mathsf{hypot}\left(1, x\right) + \left(-x\right)\right)}, x\right)
\] |
sub-neg [<=]100.0% | \[ \mathsf{copysign}\left(-\log \color{blue}{\left(\mathsf{hypot}\left(1, x\right) - x\right)}, x\right)
\] |
if -0.20000000000000001 < (copysign.f64 (log.f64 (+.f64 (fabs.f64 x) (sqrt.f64 (+.f64 (*.f64 x x) 1)))) x) < 4.99999999999999977e-7Initial program 8.4%
Simplified8.4%
[Start]8.4% | \[ \mathsf{copysign}\left(\log \left(\left|x\right| + \sqrt{x \cdot x + 1}\right), x\right)
\] |
|---|---|
+-commutative [=>]8.4% | \[ \mathsf{copysign}\left(\log \left(\left|x\right| + \sqrt{\color{blue}{1 + x \cdot x}}\right), x\right)
\] |
hypot-1-def [=>]8.4% | \[ \mathsf{copysign}\left(\log \left(\left|x\right| + \color{blue}{\mathsf{hypot}\left(1, x\right)}\right), x\right)
\] |
Applied egg-rr8.4%
[Start]8.4% | \[ \mathsf{copysign}\left(\log \left(\left|x\right| + \mathsf{hypot}\left(1, x\right)\right), x\right)
\] |
|---|---|
*-un-lft-identity [=>]8.4% | \[ \mathsf{copysign}\left(\log \color{blue}{\left(1 \cdot \left(\left|x\right| + \mathsf{hypot}\left(1, x\right)\right)\right)}, x\right)
\] |
log-prod [=>]8.4% | \[ \mathsf{copysign}\left(\color{blue}{\log 1 + \log \left(\left|x\right| + \mathsf{hypot}\left(1, x\right)\right)}, x\right)
\] |
metadata-eval [=>]8.4% | \[ \mathsf{copysign}\left(\color{blue}{0} + \log \left(\left|x\right| + \mathsf{hypot}\left(1, x\right)\right), x\right)
\] |
*-un-lft-identity [=>]8.4% | \[ \mathsf{copysign}\left(0 + \log \color{blue}{\left(1 \cdot \left(\left|x\right| + \mathsf{hypot}\left(1, x\right)\right)\right)}, x\right)
\] |
*-un-lft-identity [<=]8.4% | \[ \mathsf{copysign}\left(0 + \log \color{blue}{\left(\left|x\right| + \mathsf{hypot}\left(1, x\right)\right)}, x\right)
\] |
add-sqr-sqrt [=>]4.8% | \[ \mathsf{copysign}\left(0 + \log \left(\left|\color{blue}{\sqrt{x} \cdot \sqrt{x}}\right| + \mathsf{hypot}\left(1, x\right)\right), x\right)
\] |
fabs-sqr [=>]4.8% | \[ \mathsf{copysign}\left(0 + \log \left(\color{blue}{\sqrt{x} \cdot \sqrt{x}} + \mathsf{hypot}\left(1, x\right)\right), x\right)
\] |
add-sqr-sqrt [<=]8.4% | \[ \mathsf{copysign}\left(0 + \log \left(\color{blue}{x} + \mathsf{hypot}\left(1, x\right)\right), x\right)
\] |
Simplified8.4%
[Start]8.4% | \[ \mathsf{copysign}\left(0 + \log \left(x + \mathsf{hypot}\left(1, x\right)\right), x\right)
\] |
|---|---|
+-lft-identity [=>]8.4% | \[ \mathsf{copysign}\left(\color{blue}{\log \left(x + \mathsf{hypot}\left(1, x\right)\right)}, x\right)
\] |
Taylor expanded in x around 0 100.0%
if 4.99999999999999977e-7 < (copysign.f64 (log.f64 (+.f64 (fabs.f64 x) (sqrt.f64 (+.f64 (*.f64 x x) 1)))) x) Initial program 53.9%
Simplified100.0%
[Start]53.9% | \[ \mathsf{copysign}\left(\log \left(\left|x\right| + \sqrt{x \cdot x + 1}\right), x\right)
\] |
|---|---|
+-commutative [=>]53.9% | \[ \mathsf{copysign}\left(\log \left(\left|x\right| + \sqrt{\color{blue}{1 + x \cdot x}}\right), x\right)
\] |
hypot-1-def [=>]100.0% | \[ \mathsf{copysign}\left(\log \left(\left|x\right| + \color{blue}{\mathsf{hypot}\left(1, x\right)}\right), x\right)
\] |
Applied egg-rr100.0%
[Start]100.0% | \[ \mathsf{copysign}\left(\log \left(\left|x\right| + \mathsf{hypot}\left(1, x\right)\right), x\right)
\] |
|---|---|
expm1-log1p-u [=>]98.1% | \[ \mathsf{copysign}\left(\color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\log \left(\left|x\right| + \mathsf{hypot}\left(1, x\right)\right)\right)\right)}, x\right)
\] |
expm1-udef [=>]98.2% | \[ \mathsf{copysign}\left(\color{blue}{e^{\mathsf{log1p}\left(\log \left(\left|x\right| + \mathsf{hypot}\left(1, x\right)\right)\right)} - 1}, x\right)
\] |
log1p-udef [=>]98.2% | \[ \mathsf{copysign}\left(e^{\color{blue}{\log \left(1 + \log \left(\left|x\right| + \mathsf{hypot}\left(1, x\right)\right)\right)}} - 1, x\right)
\] |
add-exp-log [<=]100.0% | \[ \mathsf{copysign}\left(\color{blue}{\left(1 + \log \left(\left|x\right| + \mathsf{hypot}\left(1, x\right)\right)\right)} - 1, x\right)
\] |
*-un-lft-identity [=>]100.0% | \[ \mathsf{copysign}\left(\left(1 + \log \color{blue}{\left(1 \cdot \left(\left|x\right| + \mathsf{hypot}\left(1, x\right)\right)\right)}\right) - 1, x\right)
\] |
*-un-lft-identity [<=]100.0% | \[ \mathsf{copysign}\left(\left(1 + \log \color{blue}{\left(\left|x\right| + \mathsf{hypot}\left(1, x\right)\right)}\right) - 1, x\right)
\] |
add-sqr-sqrt [=>]100.0% | \[ \mathsf{copysign}\left(\left(1 + \log \left(\left|\color{blue}{\sqrt{x} \cdot \sqrt{x}}\right| + \mathsf{hypot}\left(1, x\right)\right)\right) - 1, x\right)
\] |
fabs-sqr [=>]100.0% | \[ \mathsf{copysign}\left(\left(1 + \log \left(\color{blue}{\sqrt{x} \cdot \sqrt{x}} + \mathsf{hypot}\left(1, x\right)\right)\right) - 1, x\right)
\] |
add-sqr-sqrt [<=]100.0% | \[ \mathsf{copysign}\left(\left(1 + \log \left(\color{blue}{x} + \mathsf{hypot}\left(1, x\right)\right)\right) - 1, x\right)
\] |
Final simplification100.0%
| Alternative 1 | |
|---|---|
| Accuracy | 99.8% |
| Cost | 72136 |
| Alternative 2 | |
|---|---|
| Accuracy | 99.6% |
| Cost | 19784 |
| Alternative 3 | |
|---|---|
| Accuracy | 99.9% |
| Cost | 19784 |
| Alternative 4 | |
|---|---|
| Accuracy | 99.4% |
| Cost | 13576 |
| Alternative 5 | |
|---|---|
| Accuracy | 99.5% |
| Cost | 13576 |
| Alternative 6 | |
|---|---|
| Accuracy | 99.3% |
| Cost | 13512 |
| Alternative 7 | |
|---|---|
| Accuracy | 82.3% |
| Cost | 13320 |
| Alternative 8 | |
|---|---|
| Accuracy | 99.0% |
| Cost | 13320 |
| Alternative 9 | |
|---|---|
| Accuracy | 64.9% |
| Cost | 13124 |
| Alternative 10 | |
|---|---|
| Accuracy | 59.1% |
| Cost | 13060 |
| Alternative 11 | |
|---|---|
| Accuracy | 52.6% |
| Cost | 6528 |
herbie shell --seed 2023229
(FPCore (x)
:name "Rust f64::asinh"
:precision binary64
:herbie-target
(copysign (log1p (+ (fabs x) (/ (fabs x) (+ (hypot 1.0 (/ 1.0 (fabs x))) (/ 1.0 (fabs x)))))) x)
(copysign (log (+ (fabs x) (sqrt (+ (* x x) 1.0)))) x))