
(FPCore (x) :precision binary32 (asinh x))
float code(float x) {
return asinhf(x);
}
function code(x) return asinh(x) end
function tmp = code(x) tmp = asinh(x); end
\begin{array}{l}
\\
\sinh^{-1} x
\end{array}
Sampling outcomes in binary32 precision:
Herbie found 8 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x) :precision binary32 (copysign (log (+ (fabs x) (sqrt (+ (* x x) 1.0)))) x))
float code(float x) {
return copysignf(logf((fabsf(x) + sqrtf(((x * x) + 1.0f)))), x);
}
function code(x) return copysign(log(Float32(abs(x) + sqrt(Float32(Float32(x * x) + Float32(1.0))))), x) end
function tmp = code(x) tmp = sign(x) * abs(log((abs(x) + sqrt(((x * x) + single(1.0)))))); end
\begin{array}{l}
\\
\mathsf{copysign}\left(\log \left(\left|x\right| + \sqrt{x \cdot x + 1}\right), x\right)
\end{array}
(FPCore (x)
:precision binary32
(let* ((t_0 (copysign (log (+ (fabs x) (sqrt (+ (* x x) 1.0)))) x)))
(if (<= t_0 -0.5)
(copysign (log (- (hypot 1.0 x) x)) x)
(if (<= t_0 0.009999999776482582)
(copysign (+ x (* -0.16666666666666666 (pow x 3.0))) x)
(copysign (log (+ x (hypot 1.0 x))) x)))))
float code(float x) {
float t_0 = copysignf(logf((fabsf(x) + sqrtf(((x * x) + 1.0f)))), x);
float tmp;
if (t_0 <= -0.5f) {
tmp = copysignf(logf((hypotf(1.0f, x) - x)), x);
} else if (t_0 <= 0.009999999776482582f) {
tmp = copysignf((x + (-0.16666666666666666f * powf(x, 3.0f))), x);
} else {
tmp = copysignf(logf((x + hypotf(1.0f, x))), x);
}
return tmp;
}
function code(x) t_0 = copysign(log(Float32(abs(x) + sqrt(Float32(Float32(x * x) + Float32(1.0))))), x) tmp = Float32(0.0) if (t_0 <= Float32(-0.5)) tmp = copysign(log(Float32(hypot(Float32(1.0), x) - x)), x); elseif (t_0 <= Float32(0.009999999776482582)) tmp = copysign(Float32(x + Float32(Float32(-0.16666666666666666) * (x ^ Float32(3.0)))), x); else tmp = copysign(log(Float32(x + hypot(Float32(1.0), x))), x); end return tmp end
function tmp_2 = code(x) t_0 = sign(x) * abs(log((abs(x) + sqrt(((x * x) + single(1.0)))))); tmp = single(0.0); if (t_0 <= single(-0.5)) tmp = sign(x) * abs(log((hypot(single(1.0), x) - x))); elseif (t_0 <= single(0.009999999776482582)) tmp = sign(x) * abs((x + (single(-0.16666666666666666) * (x ^ single(3.0))))); else tmp = sign(x) * abs(log((x + hypot(single(1.0), x)))); end tmp_2 = tmp; end
\begin{array}{l}
\\
\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.5:\\
\;\;\;\;\mathsf{copysign}\left(\log \left(\mathsf{hypot}\left(1, x\right) - x\right), x\right)\\
\mathbf{elif}\;t\_0 \leq 0.009999999776482582:\\
\;\;\;\;\mathsf{copysign}\left(x + -0.16666666666666666 \cdot {x}^{3}, x\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{copysign}\left(\log \left(x + \mathsf{hypot}\left(1, x\right)\right), x\right)\\
\end{array}
\end{array}
if (copysign.f32 (log.f32 (+.f32 (fabs.f32 x) (sqrt.f32 (+.f32 (*.f32 x x) #s(literal 1 binary32))))) x) < -0.5Initial program 59.1%
flip-+10.2%
clear-num10.2%
log-div10.2%
metadata-eval10.2%
+-commutative10.2%
hypot-1-def10.2%
add-sqr-sqrt-0.0%
fabs-sqr-0.0%
add-sqr-sqrt11.3%
Applied egg-rr12.4%
neg-sub012.4%
div-sub12.4%
*-rgt-identity12.4%
associate-/l*12.4%
*-rgt-identity12.4%
associate-/l*12.4%
fma-undefine12.4%
unpow212.4%
associate--r+12.4%
+-inverses12.4%
metadata-eval12.4%
metadata-eval12.4%
*-commutative12.4%
neg-mul-112.4%
fma-undefine13.1%
unpow213.1%
associate--r+56.2%
Simplified100.0%
*-un-lft-identity100.0%
add-sqr-sqrt-0.0%
sqrt-unprod100.0%
sqr-neg100.0%
sqrt-unprod98.5%
add-sqr-sqrt100.0%
Applied egg-rr100.0%
*-lft-identity100.0%
Simplified100.0%
if -0.5 < (copysign.f32 (log.f32 (+.f32 (fabs.f32 x) (sqrt.f32 (+.f32 (*.f32 x x) #s(literal 1 binary32))))) x) < 0.00999999978Initial program 18.4%
+-commutative18.4%
hypot-1-def18.3%
Simplified18.3%
Taylor expanded in x around 0 18.4%
rem-square-sqrt9.8%
fabs-sqr9.8%
metadata-eval9.8%
unpow29.8%
hypot-undefine9.7%
rem-square-sqrt18.5%
Simplified18.5%
Taylor expanded in x around 0 100.0%
distribute-rgt-in100.0%
*-lft-identity100.0%
associate-*l*100.0%
unpow2100.0%
unpow3100.0%
Simplified100.0%
if 0.00999999978 < (copysign.f32 (log.f32 (+.f32 (fabs.f32 x) (sqrt.f32 (+.f32 (*.f32 x x) #s(literal 1 binary32))))) x) Initial program 58.9%
+-commutative58.9%
hypot-1-def100.0%
Simplified100.0%
Taylor expanded in x around 0 58.9%
rem-square-sqrt58.8%
fabs-sqr58.8%
metadata-eval58.8%
unpow258.8%
hypot-undefine99.9%
rem-square-sqrt100.0%
Simplified100.0%
(FPCore (x)
:precision binary32
(if (<= x -2.0)
(copysign (log (/ -0.5 x)) x)
(if (<= x 0.10000000149011612)
(copysign
(* x (+ 1.0 (* (pow x 2.0) (- (* (* x x) 0.075) 0.16666666666666666))))
x)
(copysign (log (+ x (hypot 1.0 x))) x))))
float code(float x) {
float tmp;
if (x <= -2.0f) {
tmp = copysignf(logf((-0.5f / x)), x);
} else if (x <= 0.10000000149011612f) {
tmp = copysignf((x * (1.0f + (powf(x, 2.0f) * (((x * x) * 0.075f) - 0.16666666666666666f)))), x);
} else {
tmp = copysignf(logf((x + hypotf(1.0f, x))), x);
}
return tmp;
}
function code(x) tmp = Float32(0.0) if (x <= Float32(-2.0)) tmp = copysign(log(Float32(Float32(-0.5) / x)), x); elseif (x <= Float32(0.10000000149011612)) tmp = copysign(Float32(x * Float32(Float32(1.0) + Float32((x ^ Float32(2.0)) * Float32(Float32(Float32(x * x) * Float32(0.075)) - Float32(0.16666666666666666))))), x); else tmp = copysign(log(Float32(x + hypot(Float32(1.0), x))), x); end return tmp end
function tmp_2 = code(x) tmp = single(0.0); if (x <= single(-2.0)) tmp = sign(x) * abs(log((single(-0.5) / x))); elseif (x <= single(0.10000000149011612)) tmp = sign(x) * abs((x * (single(1.0) + ((x ^ single(2.0)) * (((x * x) * single(0.075)) - single(0.16666666666666666)))))); else tmp = sign(x) * abs(log((x + hypot(single(1.0), x)))); end tmp_2 = tmp; end
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2:\\
\;\;\;\;\mathsf{copysign}\left(\log \left(\frac{-0.5}{x}\right), x\right)\\
\mathbf{elif}\;x \leq 0.10000000149011612:\\
\;\;\;\;\mathsf{copysign}\left(x \cdot \left(1 + {x}^{2} \cdot \left(\left(x \cdot x\right) \cdot 0.075 - 0.16666666666666666\right)\right), x\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{copysign}\left(\log \left(x + \mathsf{hypot}\left(1, x\right)\right), x\right)\\
\end{array}
\end{array}
if x < -2Initial program 58.4%
+-commutative58.4%
hypot-1-def100.0%
Simplified100.0%
Taylor expanded in x around 0 58.4%
rem-square-sqrt-0.0%
fabs-sqr-0.0%
metadata-eval-0.0%
unpow2-0.0%
hypot-undefine-0.0%
rem-square-sqrt14.7%
Simplified14.7%
Taylor expanded in x around -inf 96.6%
if -2 < x < 0.100000001Initial program 19.5%
+-commutative19.5%
hypot-1-def19.5%
Simplified19.5%
Taylor expanded in x around 0 19.5%
rem-square-sqrt10.3%
fabs-sqr10.3%
metadata-eval10.3%
unpow210.3%
hypot-undefine10.3%
rem-square-sqrt19.7%
Simplified19.7%
Taylor expanded in x around 0 99.5%
unpow299.5%
Applied egg-rr99.5%
if 0.100000001 < x Initial program 58.4%
+-commutative58.4%
hypot-1-def100.0%
Simplified100.0%
Taylor expanded in x around 0 58.4%
rem-square-sqrt58.4%
fabs-sqr58.4%
metadata-eval58.4%
unpow258.4%
hypot-undefine100.0%
rem-square-sqrt100.0%
Simplified100.0%
Final simplification98.9%
(FPCore (x)
:precision binary32
(if (<= x -2.0)
(copysign (log (/ -0.5 x)) x)
(if (<= x 0.10000000149011612)
(copysign
(* x (+ 1.0 (* (pow x 2.0) (- (* (* x x) 0.075) 0.16666666666666666))))
x)
(copysign (log (* x 2.0)) x))))
float code(float x) {
float tmp;
if (x <= -2.0f) {
tmp = copysignf(logf((-0.5f / x)), x);
} else if (x <= 0.10000000149011612f) {
tmp = copysignf((x * (1.0f + (powf(x, 2.0f) * (((x * x) * 0.075f) - 0.16666666666666666f)))), x);
} else {
tmp = copysignf(logf((x * 2.0f)), x);
}
return tmp;
}
function code(x) tmp = Float32(0.0) if (x <= Float32(-2.0)) tmp = copysign(log(Float32(Float32(-0.5) / x)), x); elseif (x <= Float32(0.10000000149011612)) tmp = copysign(Float32(x * Float32(Float32(1.0) + Float32((x ^ Float32(2.0)) * Float32(Float32(Float32(x * x) * Float32(0.075)) - Float32(0.16666666666666666))))), x); else tmp = copysign(log(Float32(x * Float32(2.0))), x); end return tmp end
function tmp_2 = code(x) tmp = single(0.0); if (x <= single(-2.0)) tmp = sign(x) * abs(log((single(-0.5) / x))); elseif (x <= single(0.10000000149011612)) tmp = sign(x) * abs((x * (single(1.0) + ((x ^ single(2.0)) * (((x * x) * single(0.075)) - single(0.16666666666666666)))))); else tmp = sign(x) * abs(log((x * single(2.0)))); end tmp_2 = tmp; end
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2:\\
\;\;\;\;\mathsf{copysign}\left(\log \left(\frac{-0.5}{x}\right), x\right)\\
\mathbf{elif}\;x \leq 0.10000000149011612:\\
\;\;\;\;\mathsf{copysign}\left(x \cdot \left(1 + {x}^{2} \cdot \left(\left(x \cdot x\right) \cdot 0.075 - 0.16666666666666666\right)\right), x\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{copysign}\left(\log \left(x \cdot 2\right), x\right)\\
\end{array}
\end{array}
if x < -2Initial program 58.4%
+-commutative58.4%
hypot-1-def100.0%
Simplified100.0%
Taylor expanded in x around 0 58.4%
rem-square-sqrt-0.0%
fabs-sqr-0.0%
metadata-eval-0.0%
unpow2-0.0%
hypot-undefine-0.0%
rem-square-sqrt14.7%
Simplified14.7%
Taylor expanded in x around -inf 96.6%
if -2 < x < 0.100000001Initial program 19.5%
+-commutative19.5%
hypot-1-def19.5%
Simplified19.5%
Taylor expanded in x around 0 19.5%
rem-square-sqrt10.3%
fabs-sqr10.3%
metadata-eval10.3%
unpow210.3%
hypot-undefine10.3%
rem-square-sqrt19.7%
Simplified19.7%
Taylor expanded in x around 0 99.5%
unpow299.5%
Applied egg-rr99.5%
if 0.100000001 < x Initial program 58.4%
Taylor expanded in x around inf 99.0%
rem-square-sqrt99.0%
fabs-sqr99.0%
rem-square-sqrt99.0%
*-inverses99.0%
metadata-eval99.0%
Simplified99.0%
Final simplification98.7%
(FPCore (x)
:precision binary32
(if (<= x -2.0)
(copysign (log (/ -0.5 x)) x)
(if (<= x 0.10000000149011612)
(copysign (+ x (* -0.16666666666666666 (pow x 3.0))) x)
(copysign (log (* x 2.0)) x))))
float code(float x) {
float tmp;
if (x <= -2.0f) {
tmp = copysignf(logf((-0.5f / x)), x);
} else if (x <= 0.10000000149011612f) {
tmp = copysignf((x + (-0.16666666666666666f * powf(x, 3.0f))), x);
} else {
tmp = copysignf(logf((x * 2.0f)), x);
}
return tmp;
}
function code(x) tmp = Float32(0.0) if (x <= Float32(-2.0)) tmp = copysign(log(Float32(Float32(-0.5) / x)), x); elseif (x <= Float32(0.10000000149011612)) tmp = copysign(Float32(x + Float32(Float32(-0.16666666666666666) * (x ^ Float32(3.0)))), x); else tmp = copysign(log(Float32(x * Float32(2.0))), x); end return tmp end
function tmp_2 = code(x) tmp = single(0.0); if (x <= single(-2.0)) tmp = sign(x) * abs(log((single(-0.5) / x))); elseif (x <= single(0.10000000149011612)) tmp = sign(x) * abs((x + (single(-0.16666666666666666) * (x ^ single(3.0))))); else tmp = sign(x) * abs(log((x * single(2.0)))); end tmp_2 = tmp; end
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2:\\
\;\;\;\;\mathsf{copysign}\left(\log \left(\frac{-0.5}{x}\right), x\right)\\
\mathbf{elif}\;x \leq 0.10000000149011612:\\
\;\;\;\;\mathsf{copysign}\left(x + -0.16666666666666666 \cdot {x}^{3}, x\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{copysign}\left(\log \left(x \cdot 2\right), x\right)\\
\end{array}
\end{array}
if x < -2Initial program 58.4%
+-commutative58.4%
hypot-1-def100.0%
Simplified100.0%
Taylor expanded in x around 0 58.4%
rem-square-sqrt-0.0%
fabs-sqr-0.0%
metadata-eval-0.0%
unpow2-0.0%
hypot-undefine-0.0%
rem-square-sqrt14.7%
Simplified14.7%
Taylor expanded in x around -inf 96.6%
if -2 < x < 0.100000001Initial program 19.5%
+-commutative19.5%
hypot-1-def19.5%
Simplified19.5%
Taylor expanded in x around 0 19.5%
rem-square-sqrt10.3%
fabs-sqr10.3%
metadata-eval10.3%
unpow210.3%
hypot-undefine10.3%
rem-square-sqrt19.7%
Simplified19.7%
Taylor expanded in x around 0 99.3%
distribute-rgt-in99.4%
*-lft-identity99.4%
associate-*l*99.4%
unpow299.4%
unpow399.4%
Simplified99.4%
if 0.100000001 < x Initial program 58.4%
Taylor expanded in x around inf 99.0%
rem-square-sqrt99.0%
fabs-sqr99.0%
rem-square-sqrt99.0%
*-inverses99.0%
metadata-eval99.0%
Simplified99.0%
(FPCore (x)
:precision binary32
(if (<= x -2.0)
(copysign (log (/ -0.5 x)) x)
(if (<= x 0.10000000149011612)
(copysign x x)
(copysign (log (* x 2.0)) x))))
float code(float x) {
float tmp;
if (x <= -2.0f) {
tmp = copysignf(logf((-0.5f / x)), x);
} else if (x <= 0.10000000149011612f) {
tmp = copysignf(x, x);
} else {
tmp = copysignf(logf((x * 2.0f)), x);
}
return tmp;
}
function code(x) tmp = Float32(0.0) if (x <= Float32(-2.0)) tmp = copysign(log(Float32(Float32(-0.5) / x)), x); elseif (x <= Float32(0.10000000149011612)) tmp = copysign(x, x); else tmp = copysign(log(Float32(x * Float32(2.0))), x); end return tmp end
function tmp_2 = code(x) tmp = single(0.0); if (x <= single(-2.0)) tmp = sign(x) * abs(log((single(-0.5) / x))); elseif (x <= single(0.10000000149011612)) tmp = sign(x) * abs(x); else tmp = sign(x) * abs(log((x * single(2.0)))); end tmp_2 = tmp; end
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2:\\
\;\;\;\;\mathsf{copysign}\left(\log \left(\frac{-0.5}{x}\right), x\right)\\
\mathbf{elif}\;x \leq 0.10000000149011612:\\
\;\;\;\;\mathsf{copysign}\left(x, x\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{copysign}\left(\log \left(x \cdot 2\right), x\right)\\
\end{array}
\end{array}
if x < -2Initial program 58.4%
+-commutative58.4%
hypot-1-def100.0%
Simplified100.0%
Taylor expanded in x around 0 58.4%
rem-square-sqrt-0.0%
fabs-sqr-0.0%
metadata-eval-0.0%
unpow2-0.0%
hypot-undefine-0.0%
rem-square-sqrt14.7%
Simplified14.7%
Taylor expanded in x around -inf 96.6%
if -2 < x < 0.100000001Initial program 19.5%
+-commutative19.5%
hypot-1-def19.5%
Simplified19.5%
Taylor expanded in x around 0 19.5%
rem-square-sqrt10.3%
fabs-sqr10.3%
metadata-eval10.3%
unpow210.3%
hypot-undefine10.3%
rem-square-sqrt19.7%
Simplified19.7%
Taylor expanded in x around 0 98.7%
if 0.100000001 < x Initial program 58.4%
Taylor expanded in x around inf 99.0%
rem-square-sqrt99.0%
fabs-sqr99.0%
rem-square-sqrt99.0%
*-inverses99.0%
metadata-eval99.0%
Simplified99.0%
(FPCore (x) :precision binary32 (if (<= x 0.10000000149011612) (copysign x x) (copysign (log (* x 2.0)) x)))
float code(float x) {
float tmp;
if (x <= 0.10000000149011612f) {
tmp = copysignf(x, x);
} else {
tmp = copysignf(logf((x * 2.0f)), x);
}
return tmp;
}
function code(x) tmp = Float32(0.0) if (x <= Float32(0.10000000149011612)) tmp = copysign(x, x); else tmp = copysign(log(Float32(x * Float32(2.0))), x); end return tmp end
function tmp_2 = code(x) tmp = single(0.0); if (x <= single(0.10000000149011612)) tmp = sign(x) * abs(x); else tmp = sign(x) * abs(log((x * single(2.0)))); end tmp_2 = tmp; end
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 0.10000000149011612:\\
\;\;\;\;\mathsf{copysign}\left(x, x\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{copysign}\left(\log \left(x \cdot 2\right), x\right)\\
\end{array}
\end{array}
if x < 0.100000001Initial program 32.2%
+-commutative32.2%
hypot-1-def45.8%
Simplified45.8%
Taylor expanded in x around 0 32.2%
rem-square-sqrt6.9%
fabs-sqr6.9%
metadata-eval6.9%
unpow26.9%
hypot-undefine7.0%
rem-square-sqrt18.0%
Simplified18.0%
Taylor expanded in x around 0 70.5%
if 0.100000001 < x Initial program 58.4%
Taylor expanded in x around inf 99.0%
rem-square-sqrt99.0%
fabs-sqr99.0%
rem-square-sqrt99.0%
*-inverses99.0%
metadata-eval99.0%
Simplified99.0%
(FPCore (x) :precision binary32 (if (<= x 0.10000000149011612) (copysign x x) (copysign (log1p x) x)))
float code(float x) {
float tmp;
if (x <= 0.10000000149011612f) {
tmp = copysignf(x, x);
} else {
tmp = copysignf(log1pf(x), x);
}
return tmp;
}
function code(x) tmp = Float32(0.0) if (x <= Float32(0.10000000149011612)) tmp = copysign(x, x); else tmp = copysign(log1p(x), x); end return tmp end
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 0.10000000149011612:\\
\;\;\;\;\mathsf{copysign}\left(x, x\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{copysign}\left(\mathsf{log1p}\left(x\right), x\right)\\
\end{array}
\end{array}
if x < 0.100000001Initial program 32.2%
+-commutative32.2%
hypot-1-def45.8%
Simplified45.8%
Taylor expanded in x around 0 32.2%
rem-square-sqrt6.9%
fabs-sqr6.9%
metadata-eval6.9%
unpow26.9%
hypot-undefine7.0%
rem-square-sqrt18.0%
Simplified18.0%
Taylor expanded in x around 0 70.5%
if 0.100000001 < x Initial program 58.4%
Taylor expanded in x around 0 44.3%
log1p-define44.3%
rem-square-sqrt44.3%
fabs-sqr44.3%
rem-square-sqrt44.3%
Simplified44.3%
(FPCore (x) :precision binary32 (copysign x x))
float code(float x) {
return copysignf(x, x);
}
function code(x) return copysign(x, x) end
function tmp = code(x) tmp = sign(x) * abs(x); end
\begin{array}{l}
\\
\mathsf{copysign}\left(x, x\right)
\end{array}
Initial program 38.7%
+-commutative38.7%
hypot-1-def59.1%
Simplified59.1%
Taylor expanded in x around 0 38.7%
rem-square-sqrt19.6%
fabs-sqr19.6%
metadata-eval19.6%
unpow219.6%
hypot-undefine29.8%
rem-square-sqrt38.2%
Simplified38.2%
Taylor expanded in x around 0 55.9%
(FPCore (x) :precision binary32 (let* ((t_0 (/ 1.0 (fabs x)))) (copysign (log1p (+ (fabs x) (/ (fabs x) (+ (hypot 1.0 t_0) t_0)))) x)))
float code(float x) {
float t_0 = 1.0f / fabsf(x);
return copysignf(log1pf((fabsf(x) + (fabsf(x) / (hypotf(1.0f, t_0) + t_0)))), x);
}
function code(x) t_0 = Float32(Float32(1.0) / abs(x)) return copysign(log1p(Float32(abs(x) + Float32(abs(x) / Float32(hypot(Float32(1.0), t_0) + t_0)))), x) end
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{1}{\left|x\right|}\\
\mathsf{copysign}\left(\mathsf{log1p}\left(\left|x\right| + \frac{\left|x\right|}{\mathsf{hypot}\left(1, t\_0\right) + t\_0}\right), x\right)
\end{array}
\end{array}
herbie shell --seed 2024110
(FPCore (x)
:name "Rust f32::asinh"
:precision binary32
:alt
(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))