
(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 17 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 -1.0)
(copysign (- (log (- (hypot 1.0 x) x))) x)
(if (<= t_0 0.05000000074505806)
(copysign
(+
x
(+
(* -0.16666666666666666 (pow x 3.0))
(+ (* -0.044642857142857144 (pow x 7.0)) (* 0.075 (pow x 5.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 <= -1.0f) {
tmp = copysignf(-logf((hypotf(1.0f, x) - x)), x);
} else if (t_0 <= 0.05000000074505806f) {
tmp = copysignf((x + ((-0.16666666666666666f * powf(x, 3.0f)) + ((-0.044642857142857144f * powf(x, 7.0f)) + (0.075f * powf(x, 5.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(-1.0)) tmp = copysign(Float32(-log(Float32(hypot(Float32(1.0), x) - x))), x); elseif (t_0 <= Float32(0.05000000074505806)) tmp = copysign(Float32(x + Float32(Float32(Float32(-0.16666666666666666) * (x ^ Float32(3.0))) + Float32(Float32(Float32(-0.044642857142857144) * (x ^ Float32(7.0))) + Float32(Float32(0.075) * (x ^ Float32(5.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(-1.0)) tmp = sign(x) * abs(-log((hypot(single(1.0), x) - x))); elseif (t_0 <= single(0.05000000074505806)) tmp = sign(x) * abs((x + ((single(-0.16666666666666666) * (x ^ single(3.0))) + ((single(-0.044642857142857144) * (x ^ single(7.0))) + (single(0.075) * (x ^ single(5.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 -1:\\
\;\;\;\;\mathsf{copysign}\left(-\log \left(\mathsf{hypot}\left(1, x\right) - x\right), x\right)\\
\mathbf{elif}\;t_0 \leq 0.05000000074505806:\\
\;\;\;\;\mathsf{copysign}\left(x + \left(-0.16666666666666666 \cdot {x}^{3} + \left(-0.044642857142857144 \cdot {x}^{7} + 0.075 \cdot {x}^{5}\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 (copysign.f32 (log.f32 (+.f32 (fabs.f32 x) (sqrt.f32 (+.f32 (*.f32 x x) 1)))) x) < -1Initial program 49.5%
+-commutative49.5%
hypot-1-def100.0%
Simplified100.0%
flip-+7.4%
frac-2neg7.4%
log-div7.4%
Applied egg-rr11.8%
sub-neg11.8%
sub-neg11.8%
fma-udef11.8%
unpow211.8%
associate--r+46.0%
+-inverses100.0%
metadata-eval100.0%
metadata-eval100.0%
metadata-eval100.0%
neg-sub0100.0%
sub-neg100.0%
+-commutative100.0%
distribute-neg-in100.0%
remove-double-neg100.0%
sub-neg100.0%
Simplified100.0%
if -1 < (copysign.f32 (log.f32 (+.f32 (fabs.f32 x) (sqrt.f32 (+.f32 (*.f32 x x) 1)))) x) < 0.0500000007Initial program 21.5%
+-commutative21.5%
hypot-1-def21.7%
Simplified21.7%
add-cube-cbrt20.9%
pow321.0%
log-pow21.1%
add-sqr-sqrt10.3%
fabs-sqr10.3%
add-sqr-sqrt21.2%
Applied egg-rr21.2%
Taylor expanded in x around 0 100.0%
if 0.0500000007 < (copysign.f32 (log.f32 (+.f32 (fabs.f32 x) (sqrt.f32 (+.f32 (*.f32 x x) 1)))) x) Initial program 61.6%
+-commutative61.6%
hypot-1-def100.0%
Simplified100.0%
*-un-lft-identity100.0%
*-commutative100.0%
log-prod100.0%
*-un-lft-identity100.0%
*-un-lft-identity100.0%
add-sqr-sqrt100.0%
fabs-sqr100.0%
add-sqr-sqrt100.0%
metadata-eval100.0%
Applied egg-rr100.0%
+-rgt-identity100.0%
Simplified100.0%
Final simplification100.0%
(FPCore (x)
:precision binary32
(let* ((t_0 (copysign (log (+ (fabs x) (sqrt (+ (* x x) 1.0)))) x)))
(if (<= t_0 -1.0)
(copysign (- (log (- (hypot 1.0 x) x))) x)
(if (<= t_0 0.05000000074505806)
(copysign
(+ x (+ (* -0.16666666666666666 (pow x 3.0)) (* 0.075 (pow x 5.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 <= -1.0f) {
tmp = copysignf(-logf((hypotf(1.0f, x) - x)), x);
} else if (t_0 <= 0.05000000074505806f) {
tmp = copysignf((x + ((-0.16666666666666666f * powf(x, 3.0f)) + (0.075f * powf(x, 5.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(-1.0)) tmp = copysign(Float32(-log(Float32(hypot(Float32(1.0), x) - x))), x); elseif (t_0 <= Float32(0.05000000074505806)) tmp = copysign(Float32(x + Float32(Float32(Float32(-0.16666666666666666) * (x ^ Float32(3.0))) + Float32(Float32(0.075) * (x ^ Float32(5.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(-1.0)) tmp = sign(x) * abs(-log((hypot(single(1.0), x) - x))); elseif (t_0 <= single(0.05000000074505806)) tmp = sign(x) * abs((x + ((single(-0.16666666666666666) * (x ^ single(3.0))) + (single(0.075) * (x ^ single(5.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 -1:\\
\;\;\;\;\mathsf{copysign}\left(-\log \left(\mathsf{hypot}\left(1, x\right) - x\right), x\right)\\
\mathbf{elif}\;t_0 \leq 0.05000000074505806:\\
\;\;\;\;\mathsf{copysign}\left(x + \left(-0.16666666666666666 \cdot {x}^{3} + 0.075 \cdot {x}^{5}\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 (copysign.f32 (log.f32 (+.f32 (fabs.f32 x) (sqrt.f32 (+.f32 (*.f32 x x) 1)))) x) < -1Initial program 49.5%
+-commutative49.5%
hypot-1-def100.0%
Simplified100.0%
flip-+7.4%
frac-2neg7.4%
log-div7.4%
Applied egg-rr11.8%
sub-neg11.8%
sub-neg11.8%
fma-udef11.8%
unpow211.8%
associate--r+46.0%
+-inverses100.0%
metadata-eval100.0%
metadata-eval100.0%
metadata-eval100.0%
neg-sub0100.0%
sub-neg100.0%
+-commutative100.0%
distribute-neg-in100.0%
remove-double-neg100.0%
sub-neg100.0%
Simplified100.0%
if -1 < (copysign.f32 (log.f32 (+.f32 (fabs.f32 x) (sqrt.f32 (+.f32 (*.f32 x x) 1)))) x) < 0.0500000007Initial program 21.5%
+-commutative21.5%
hypot-1-def21.7%
Simplified21.7%
add-cube-cbrt20.9%
pow321.0%
log-pow21.1%
add-sqr-sqrt10.3%
fabs-sqr10.3%
add-sqr-sqrt21.2%
Applied egg-rr21.2%
Taylor expanded in x around 0 100.0%
if 0.0500000007 < (copysign.f32 (log.f32 (+.f32 (fabs.f32 x) (sqrt.f32 (+.f32 (*.f32 x x) 1)))) x) Initial program 61.6%
+-commutative61.6%
hypot-1-def100.0%
Simplified100.0%
*-un-lft-identity100.0%
*-commutative100.0%
log-prod100.0%
*-un-lft-identity100.0%
*-un-lft-identity100.0%
add-sqr-sqrt100.0%
fabs-sqr100.0%
add-sqr-sqrt100.0%
metadata-eval100.0%
Applied egg-rr100.0%
+-rgt-identity100.0%
Simplified100.0%
Final simplification100.0%
(FPCore (x)
:precision binary32
(if (<= x -1.0)
(copysign (log (- (fabs x) x)) x)
(if (<= x 0.05000000074505806)
(copysign (+ x (* -0.16666666666666666 (pow x 3.0))) x)
(copysign (log (+ x (hypot 1.0 x))) x))))
float code(float x) {
float tmp;
if (x <= -1.0f) {
tmp = copysignf(logf((fabsf(x) - x)), x);
} else if (x <= 0.05000000074505806f) {
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) tmp = Float32(0.0) if (x <= Float32(-1.0)) tmp = copysign(log(Float32(abs(x) - x)), x); elseif (x <= Float32(0.05000000074505806)) 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) tmp = single(0.0); if (x <= single(-1.0)) tmp = sign(x) * abs(log((abs(x) - x))); elseif (x <= single(0.05000000074505806)) 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}
\mathbf{if}\;x \leq -1:\\
\;\;\;\;\mathsf{copysign}\left(\log \left(\left|x\right| - x\right), x\right)\\
\mathbf{elif}\;x \leq 0.05000000074505806:\\
\;\;\;\;\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 x < -1Initial program 49.5%
+-commutative49.5%
hypot-1-def100.0%
Simplified100.0%
Taylor expanded in x around -inf 97.7%
mul-1-neg97.7%
unsub-neg97.7%
Simplified97.7%
if -1 < x < 0.0500000007Initial program 21.5%
+-commutative21.5%
hypot-1-def21.7%
Simplified21.7%
add-cube-cbrt20.9%
pow321.0%
log-pow21.1%
add-sqr-sqrt10.3%
fabs-sqr10.3%
add-sqr-sqrt21.2%
Applied egg-rr21.2%
Taylor expanded in x around 0 99.6%
*-commutative99.6%
Simplified99.6%
if 0.0500000007 < x Initial program 61.6%
+-commutative61.6%
hypot-1-def100.0%
Simplified100.0%
*-un-lft-identity100.0%
*-commutative100.0%
log-prod100.0%
*-un-lft-identity100.0%
*-un-lft-identity100.0%
add-sqr-sqrt100.0%
fabs-sqr100.0%
add-sqr-sqrt100.0%
metadata-eval100.0%
Applied egg-rr100.0%
+-rgt-identity100.0%
Simplified100.0%
Final simplification99.2%
(FPCore (x)
:precision binary32
(if (<= x -0.10000000149011612)
(copysign (- (log (- (hypot 1.0 x) x))) x)
(if (<= x 0.05000000074505806)
(copysign (+ x (* -0.16666666666666666 (pow x 3.0))) x)
(copysign (log (+ x (hypot 1.0 x))) x))))
float code(float x) {
float tmp;
if (x <= -0.10000000149011612f) {
tmp = copysignf(-logf((hypotf(1.0f, x) - x)), x);
} else if (x <= 0.05000000074505806f) {
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) tmp = Float32(0.0) if (x <= Float32(-0.10000000149011612)) tmp = copysign(Float32(-log(Float32(hypot(Float32(1.0), x) - x))), x); elseif (x <= Float32(0.05000000074505806)) 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) tmp = single(0.0); if (x <= single(-0.10000000149011612)) tmp = sign(x) * abs(-log((hypot(single(1.0), x) - x))); elseif (x <= single(0.05000000074505806)) 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}
\mathbf{if}\;x \leq -0.10000000149011612:\\
\;\;\;\;\mathsf{copysign}\left(-\log \left(\mathsf{hypot}\left(1, x\right) - x\right), x\right)\\
\mathbf{elif}\;x \leq 0.05000000074505806:\\
\;\;\;\;\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 x < -0.100000001Initial program 50.1%
+-commutative50.1%
hypot-1-def99.8%
Simplified99.8%
flip-+8.6%
frac-2neg8.6%
log-div8.6%
Applied egg-rr13.0%
sub-neg13.0%
sub-neg13.0%
fma-udef13.0%
unpow213.0%
associate--r+46.7%
+-inverses99.8%
metadata-eval99.8%
metadata-eval99.8%
metadata-eval99.8%
neg-sub099.8%
sub-neg99.8%
+-commutative99.8%
distribute-neg-in99.8%
remove-double-neg99.8%
sub-neg99.8%
Simplified99.8%
if -0.100000001 < x < 0.0500000007Initial program 20.9%
+-commutative20.9%
hypot-1-def21.2%
Simplified21.2%
add-cube-cbrt20.3%
pow320.4%
log-pow20.5%
add-sqr-sqrt10.4%
fabs-sqr10.4%
add-sqr-sqrt20.6%
Applied egg-rr20.6%
Taylor expanded in x around 0 99.8%
*-commutative99.8%
Simplified99.8%
if 0.0500000007 < x Initial program 61.6%
+-commutative61.6%
hypot-1-def100.0%
Simplified100.0%
*-un-lft-identity100.0%
*-commutative100.0%
log-prod100.0%
*-un-lft-identity100.0%
*-un-lft-identity100.0%
add-sqr-sqrt100.0%
fabs-sqr100.0%
add-sqr-sqrt100.0%
metadata-eval100.0%
Applied egg-rr100.0%
+-rgt-identity100.0%
Simplified100.0%
Final simplification99.9%
(FPCore (x)
:precision binary32
(if (<= x -0.03999999910593033)
(copysign (log (/ -1.0 (- x (hypot 1.0 x)))) x)
(if (<= x 0.05000000074505806)
(copysign (+ x (* -0.16666666666666666 (pow x 3.0))) x)
(copysign (log (+ x (hypot 1.0 x))) x))))
float code(float x) {
float tmp;
if (x <= -0.03999999910593033f) {
tmp = copysignf(logf((-1.0f / (x - hypotf(1.0f, x)))), x);
} else if (x <= 0.05000000074505806f) {
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) tmp = Float32(0.0) if (x <= Float32(-0.03999999910593033)) tmp = copysign(log(Float32(Float32(-1.0) / Float32(x - hypot(Float32(1.0), x)))), x); elseif (x <= Float32(0.05000000074505806)) 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) tmp = single(0.0); if (x <= single(-0.03999999910593033)) tmp = sign(x) * abs(log((single(-1.0) / (x - hypot(single(1.0), x))))); elseif (x <= single(0.05000000074505806)) 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}
\mathbf{if}\;x \leq -0.03999999910593033:\\
\;\;\;\;\mathsf{copysign}\left(\log \left(\frac{-1}{x - \mathsf{hypot}\left(1, x\right)}\right), x\right)\\
\mathbf{elif}\;x \leq 0.05000000074505806:\\
\;\;\;\;\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 x < -0.0399999991Initial program 51.3%
+-commutative51.3%
hypot-1-def99.5%
Simplified99.5%
flip-+11.0%
div-sub10.7%
pow210.7%
add-sqr-sqrt-0.0%
fabs-sqr-0.0%
add-sqr-sqrt10.7%
add-sqr-sqrt-0.0%
fabs-sqr-0.0%
add-sqr-sqrt4.6%
Applied egg-rr13.2%
div-sub15.4%
fma-udef15.4%
unpow215.4%
associate--r+48.0%
+-inverses99.5%
metadata-eval99.5%
Simplified99.5%
if -0.0399999991 < x < 0.0500000007Initial program 19.8%
+-commutative19.8%
hypot-1-def20.0%
Simplified20.0%
add-cube-cbrt19.2%
pow319.2%
log-pow19.3%
add-sqr-sqrt10.6%
fabs-sqr10.6%
add-sqr-sqrt19.5%
Applied egg-rr19.5%
Taylor expanded in x around 0 100.0%
*-commutative100.0%
Simplified100.0%
if 0.0500000007 < x Initial program 61.6%
+-commutative61.6%
hypot-1-def100.0%
Simplified100.0%
*-un-lft-identity100.0%
*-commutative100.0%
log-prod100.0%
*-un-lft-identity100.0%
*-un-lft-identity100.0%
add-sqr-sqrt100.0%
fabs-sqr100.0%
add-sqr-sqrt100.0%
metadata-eval100.0%
Applied egg-rr100.0%
+-rgt-identity100.0%
Simplified100.0%
Final simplification99.9%
(FPCore (x)
:precision binary32
(if (<= x -1.0)
(copysign (log (- (fabs x) x)) x)
(if (<= x 1.0)
(copysign (+ x (* -0.16666666666666666 (pow x 3.0))) x)
(copysign (log (+ (+ x x) (/ 0.5 x))) x))))
float code(float x) {
float tmp;
if (x <= -1.0f) {
tmp = copysignf(logf((fabsf(x) - x)), x);
} else if (x <= 1.0f) {
tmp = copysignf((x + (-0.16666666666666666f * powf(x, 3.0f))), x);
} else {
tmp = copysignf(logf(((x + x) + (0.5f / x))), x);
}
return tmp;
}
function code(x) tmp = Float32(0.0) if (x <= Float32(-1.0)) tmp = copysign(log(Float32(abs(x) - x)), x); elseif (x <= Float32(1.0)) tmp = copysign(Float32(x + Float32(Float32(-0.16666666666666666) * (x ^ Float32(3.0)))), x); else tmp = copysign(log(Float32(Float32(x + x) + Float32(Float32(0.5) / x))), x); end return tmp end
function tmp_2 = code(x) tmp = single(0.0); if (x <= single(-1.0)) tmp = sign(x) * abs(log((abs(x) - x))); elseif (x <= single(1.0)) tmp = sign(x) * abs((x + (single(-0.16666666666666666) * (x ^ single(3.0))))); else tmp = sign(x) * abs(log(((x + x) + (single(0.5) / x)))); end tmp_2 = tmp; end
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1:\\
\;\;\;\;\mathsf{copysign}\left(\log \left(\left|x\right| - x\right), x\right)\\
\mathbf{elif}\;x \leq 1:\\
\;\;\;\;\mathsf{copysign}\left(x + -0.16666666666666666 \cdot {x}^{3}, x\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{copysign}\left(\log \left(\left(x + x\right) + \frac{0.5}{x}\right), x\right)\\
\end{array}
\end{array}
if x < -1Initial program 49.5%
+-commutative49.5%
hypot-1-def100.0%
Simplified100.0%
Taylor expanded in x around -inf 97.7%
mul-1-neg97.7%
unsub-neg97.7%
Simplified97.7%
if -1 < x < 1Initial program 22.2%
+-commutative22.2%
hypot-1-def22.4%
Simplified22.4%
add-cube-cbrt21.5%
pow321.6%
log-pow21.7%
add-sqr-sqrt11.0%
fabs-sqr11.0%
add-sqr-sqrt21.8%
Applied egg-rr21.8%
Taylor expanded in x around 0 99.2%
*-commutative99.2%
Simplified99.2%
if 1 < x Initial program 61.0%
+-commutative61.0%
hypot-1-def100.0%
Simplified100.0%
Taylor expanded in x around inf 99.9%
rem-square-sqrt99.9%
fabs-sqr99.9%
rem-square-sqrt99.9%
associate-+r+99.9%
associate-*r/99.9%
metadata-eval99.9%
Simplified99.9%
Final simplification99.0%
(FPCore (x)
:precision binary32
(if (<= x -1.0)
(copysign (log (/ -0.5 x)) x)
(if (<= x 1.0)
(copysign (+ x (* -0.16666666666666666 (pow x 3.0))) x)
(copysign (log (+ (+ x x) (/ 0.5 x))) x))))
float code(float x) {
float tmp;
if (x <= -1.0f) {
tmp = copysignf(logf((-0.5f / x)), x);
} else if (x <= 1.0f) {
tmp = copysignf((x + (-0.16666666666666666f * powf(x, 3.0f))), x);
} else {
tmp = copysignf(logf(((x + x) + (0.5f / x))), x);
}
return tmp;
}
function code(x) tmp = Float32(0.0) if (x <= Float32(-1.0)) tmp = copysign(log(Float32(Float32(-0.5) / x)), x); elseif (x <= Float32(1.0)) tmp = copysign(Float32(x + Float32(Float32(-0.16666666666666666) * (x ^ Float32(3.0)))), x); else tmp = copysign(log(Float32(Float32(x + x) + Float32(Float32(0.5) / x))), x); end return tmp end
function tmp_2 = code(x) tmp = single(0.0); if (x <= single(-1.0)) tmp = sign(x) * abs(log((single(-0.5) / x))); elseif (x <= single(1.0)) tmp = sign(x) * abs((x + (single(-0.16666666666666666) * (x ^ single(3.0))))); else tmp = sign(x) * abs(log(((x + x) + (single(0.5) / x)))); end tmp_2 = tmp; end
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1:\\
\;\;\;\;\mathsf{copysign}\left(\log \left(\frac{-0.5}{x}\right), x\right)\\
\mathbf{elif}\;x \leq 1:\\
\;\;\;\;\mathsf{copysign}\left(x + -0.16666666666666666 \cdot {x}^{3}, x\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{copysign}\left(\log \left(\left(x + x\right) + \frac{0.5}{x}\right), x\right)\\
\end{array}
\end{array}
if x < -1Initial program 49.5%
+-commutative49.5%
hypot-1-def100.0%
Simplified100.0%
*-un-lft-identity100.0%
*-commutative100.0%
log-prod100.0%
*-un-lft-identity100.0%
*-un-lft-identity100.0%
add-sqr-sqrt-0.0%
fabs-sqr-0.0%
add-sqr-sqrt12.9%
metadata-eval12.9%
Applied egg-rr12.9%
+-rgt-identity12.9%
Simplified12.9%
Taylor expanded in x around -inf 97.7%
if -1 < x < 1Initial program 22.2%
+-commutative22.2%
hypot-1-def22.4%
Simplified22.4%
add-cube-cbrt21.5%
pow321.6%
log-pow21.7%
add-sqr-sqrt11.0%
fabs-sqr11.0%
add-sqr-sqrt21.8%
Applied egg-rr21.8%
Taylor expanded in x around 0 99.2%
*-commutative99.2%
Simplified99.2%
if 1 < x Initial program 61.0%
+-commutative61.0%
hypot-1-def100.0%
Simplified100.0%
Taylor expanded in x around inf 99.9%
rem-square-sqrt99.9%
fabs-sqr99.9%
rem-square-sqrt99.9%
associate-+r+99.9%
associate-*r/99.9%
metadata-eval99.9%
Simplified99.9%
Final simplification99.0%
(FPCore (x)
:precision binary32
(if (<= x -1.0)
(copysign (log (/ -0.5 x)) x)
(if (<= x 1.0)
(copysign (+ x (* -0.16666666666666666 (pow x 3.0))) x)
(copysign (log (/ 0.5 x)) x))))
float code(float x) {
float tmp;
if (x <= -1.0f) {
tmp = copysignf(logf((-0.5f / x)), x);
} else if (x <= 1.0f) {
tmp = copysignf((x + (-0.16666666666666666f * powf(x, 3.0f))), x);
} else {
tmp = copysignf(logf((0.5f / x)), x);
}
return tmp;
}
function code(x) tmp = Float32(0.0) if (x <= Float32(-1.0)) tmp = copysign(log(Float32(Float32(-0.5) / x)), x); elseif (x <= Float32(1.0)) tmp = copysign(Float32(x + Float32(Float32(-0.16666666666666666) * (x ^ Float32(3.0)))), x); else tmp = copysign(log(Float32(Float32(0.5) / x)), x); end return tmp end
function tmp_2 = code(x) tmp = single(0.0); if (x <= single(-1.0)) tmp = sign(x) * abs(log((single(-0.5) / x))); elseif (x <= single(1.0)) tmp = sign(x) * abs((x + (single(-0.16666666666666666) * (x ^ single(3.0))))); else tmp = sign(x) * abs(log((single(0.5) / x))); end tmp_2 = tmp; end
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1:\\
\;\;\;\;\mathsf{copysign}\left(\log \left(\frac{-0.5}{x}\right), x\right)\\
\mathbf{elif}\;x \leq 1:\\
\;\;\;\;\mathsf{copysign}\left(x + -0.16666666666666666 \cdot {x}^{3}, x\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{copysign}\left(\log \left(\frac{0.5}{x}\right), x\right)\\
\end{array}
\end{array}
if x < -1Initial program 49.5%
+-commutative49.5%
hypot-1-def100.0%
Simplified100.0%
*-un-lft-identity100.0%
*-commutative100.0%
log-prod100.0%
*-un-lft-identity100.0%
*-un-lft-identity100.0%
add-sqr-sqrt-0.0%
fabs-sqr-0.0%
add-sqr-sqrt12.9%
metadata-eval12.9%
Applied egg-rr12.9%
+-rgt-identity12.9%
Simplified12.9%
Taylor expanded in x around -inf 97.7%
if -1 < x < 1Initial program 22.2%
+-commutative22.2%
hypot-1-def22.4%
Simplified22.4%
add-cube-cbrt21.5%
pow321.6%
log-pow21.7%
add-sqr-sqrt11.0%
fabs-sqr11.0%
add-sqr-sqrt21.8%
Applied egg-rr21.8%
Taylor expanded in x around 0 99.2%
*-commutative99.2%
Simplified99.2%
if 1 < x Initial program 61.0%
+-commutative61.0%
hypot-1-def100.0%
Simplified100.0%
Taylor expanded in x around inf 99.9%
rem-square-sqrt99.9%
fabs-sqr99.9%
rem-square-sqrt99.9%
associate-+r+99.9%
associate-*r/99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in x around 0 99.0%
Final simplification98.8%
(FPCore (x) :precision binary32 (if (<= x -20.0) (copysign (log (- x)) x) (if (<= x 1.0) (copysign x x) (copysign (log (+ x x)) x))))
float code(float x) {
float tmp;
if (x <= -20.0f) {
tmp = copysignf(logf(-x), x);
} else if (x <= 1.0f) {
tmp = copysignf(x, x);
} else {
tmp = copysignf(logf((x + x)), x);
}
return tmp;
}
function code(x) tmp = Float32(0.0) if (x <= Float32(-20.0)) tmp = copysign(log(Float32(-x)), x); elseif (x <= Float32(1.0)) tmp = copysign(x, x); else tmp = copysign(log(Float32(x + x)), x); end return tmp end
function tmp_2 = code(x) tmp = single(0.0); if (x <= single(-20.0)) tmp = sign(x) * abs(log(-x)); elseif (x <= single(1.0)) tmp = sign(x) * abs(x); else tmp = sign(x) * abs(log((x + x))); end tmp_2 = tmp; end
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -20:\\
\;\;\;\;\mathsf{copysign}\left(\log \left(-x\right), x\right)\\
\mathbf{elif}\;x \leq 1:\\
\;\;\;\;\mathsf{copysign}\left(x, x\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{copysign}\left(\log \left(x + x\right), x\right)\\
\end{array}
\end{array}
if x < -20Initial program 48.7%
+-commutative48.7%
hypot-1-def99.9%
Simplified99.9%
Taylor expanded in x around -inf 44.7%
mul-1-neg44.7%
Simplified44.7%
if -20 < x < 1Initial program 22.8%
+-commutative22.8%
hypot-1-def23.0%
Simplified23.0%
add-cube-cbrt22.2%
pow322.3%
log-pow22.3%
add-sqr-sqrt10.9%
fabs-sqr10.9%
add-sqr-sqrt22.5%
Applied egg-rr22.5%
Taylor expanded in x around 0 96.2%
if 1 < x Initial program 61.0%
+-commutative61.0%
hypot-1-def100.0%
Simplified100.0%
Taylor expanded in x around inf 99.0%
rem-square-sqrt99.0%
fabs-sqr99.0%
rem-square-sqrt99.0%
Simplified99.0%
Final simplification84.5%
(FPCore (x) :precision binary32 (if (<= x -1.0) (copysign (log (/ -0.5 x)) x) (if (<= x 1.0) (copysign x x) (copysign (log (+ x x)) x))))
float code(float x) {
float tmp;
if (x <= -1.0f) {
tmp = copysignf(logf((-0.5f / x)), x);
} else if (x <= 1.0f) {
tmp = copysignf(x, x);
} else {
tmp = copysignf(logf((x + x)), x);
}
return tmp;
}
function code(x) tmp = Float32(0.0) if (x <= Float32(-1.0)) tmp = copysign(log(Float32(Float32(-0.5) / x)), x); elseif (x <= Float32(1.0)) tmp = copysign(x, x); else tmp = copysign(log(Float32(x + x)), x); end return tmp end
function tmp_2 = code(x) tmp = single(0.0); if (x <= single(-1.0)) tmp = sign(x) * abs(log((single(-0.5) / x))); elseif (x <= single(1.0)) tmp = sign(x) * abs(x); else tmp = sign(x) * abs(log((x + x))); end tmp_2 = tmp; end
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1:\\
\;\;\;\;\mathsf{copysign}\left(\log \left(\frac{-0.5}{x}\right), x\right)\\
\mathbf{elif}\;x \leq 1:\\
\;\;\;\;\mathsf{copysign}\left(x, x\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{copysign}\left(\log \left(x + x\right), x\right)\\
\end{array}
\end{array}
if x < -1Initial program 49.5%
+-commutative49.5%
hypot-1-def100.0%
Simplified100.0%
*-un-lft-identity100.0%
*-commutative100.0%
log-prod100.0%
*-un-lft-identity100.0%
*-un-lft-identity100.0%
add-sqr-sqrt-0.0%
fabs-sqr-0.0%
add-sqr-sqrt12.9%
metadata-eval12.9%
Applied egg-rr12.9%
+-rgt-identity12.9%
Simplified12.9%
Taylor expanded in x around -inf 97.7%
if -1 < x < 1Initial program 22.2%
+-commutative22.2%
hypot-1-def22.4%
Simplified22.4%
add-cube-cbrt21.5%
pow321.6%
log-pow21.7%
add-sqr-sqrt11.0%
fabs-sqr11.0%
add-sqr-sqrt21.8%
Applied egg-rr21.8%
Taylor expanded in x around 0 96.7%
if 1 < x Initial program 61.0%
+-commutative61.0%
hypot-1-def100.0%
Simplified100.0%
Taylor expanded in x around inf 99.0%
rem-square-sqrt99.0%
fabs-sqr99.0%
rem-square-sqrt99.0%
Simplified99.0%
Final simplification97.6%
(FPCore (x) :precision binary32 (if (<= x -1.0) (copysign (log (/ -0.5 x)) x) (if (<= x 1.0) (copysign x x) (copysign (log (/ 0.5 x)) x))))
float code(float x) {
float tmp;
if (x <= -1.0f) {
tmp = copysignf(logf((-0.5f / x)), x);
} else if (x <= 1.0f) {
tmp = copysignf(x, x);
} else {
tmp = copysignf(logf((0.5f / x)), x);
}
return tmp;
}
function code(x) tmp = Float32(0.0) if (x <= Float32(-1.0)) tmp = copysign(log(Float32(Float32(-0.5) / x)), x); elseif (x <= Float32(1.0)) tmp = copysign(x, x); else tmp = copysign(log(Float32(Float32(0.5) / x)), x); end return tmp end
function tmp_2 = code(x) tmp = single(0.0); if (x <= single(-1.0)) tmp = sign(x) * abs(log((single(-0.5) / x))); elseif (x <= single(1.0)) tmp = sign(x) * abs(x); else tmp = sign(x) * abs(log((single(0.5) / x))); end tmp_2 = tmp; end
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1:\\
\;\;\;\;\mathsf{copysign}\left(\log \left(\frac{-0.5}{x}\right), x\right)\\
\mathbf{elif}\;x \leq 1:\\
\;\;\;\;\mathsf{copysign}\left(x, x\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{copysign}\left(\log \left(\frac{0.5}{x}\right), x\right)\\
\end{array}
\end{array}
if x < -1Initial program 49.5%
+-commutative49.5%
hypot-1-def100.0%
Simplified100.0%
*-un-lft-identity100.0%
*-commutative100.0%
log-prod100.0%
*-un-lft-identity100.0%
*-un-lft-identity100.0%
add-sqr-sqrt-0.0%
fabs-sqr-0.0%
add-sqr-sqrt12.9%
metadata-eval12.9%
Applied egg-rr12.9%
+-rgt-identity12.9%
Simplified12.9%
Taylor expanded in x around -inf 97.7%
if -1 < x < 1Initial program 22.2%
+-commutative22.2%
hypot-1-def22.4%
Simplified22.4%
add-cube-cbrt21.5%
pow321.6%
log-pow21.7%
add-sqr-sqrt11.0%
fabs-sqr11.0%
add-sqr-sqrt21.8%
Applied egg-rr21.8%
Taylor expanded in x around 0 96.7%
if 1 < x Initial program 61.0%
+-commutative61.0%
hypot-1-def100.0%
Simplified100.0%
Taylor expanded in x around inf 99.9%
rem-square-sqrt99.9%
fabs-sqr99.9%
rem-square-sqrt99.9%
associate-+r+99.9%
associate-*r/99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in x around 0 99.0%
Final simplification97.6%
(FPCore (x) :precision binary32 (if (<= x -20.0) (copysign 14.333333333333334 x) (if (<= x 1.0) (copysign x x) (copysign (log x) x))))
float code(float x) {
float tmp;
if (x <= -20.0f) {
tmp = copysignf(14.333333333333334f, x);
} else if (x <= 1.0f) {
tmp = copysignf(x, x);
} else {
tmp = copysignf(logf(x), x);
}
return tmp;
}
function code(x) tmp = Float32(0.0) if (x <= Float32(-20.0)) tmp = copysign(Float32(14.333333333333334), x); elseif (x <= Float32(1.0)) tmp = copysign(x, x); else tmp = copysign(log(x), x); end return tmp end
function tmp_2 = code(x) tmp = single(0.0); if (x <= single(-20.0)) tmp = sign(x) * abs(single(14.333333333333334)); elseif (x <= single(1.0)) tmp = sign(x) * abs(x); else tmp = sign(x) * abs(log(x)); end tmp_2 = tmp; end
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -20:\\
\;\;\;\;\mathsf{copysign}\left(14.333333333333334, x\right)\\
\mathbf{elif}\;x \leq 1:\\
\;\;\;\;\mathsf{copysign}\left(x, x\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{copysign}\left(\log x, x\right)\\
\end{array}
\end{array}
if x < -20Initial program 48.7%
+-commutative48.7%
hypot-1-def99.9%
Simplified99.9%
Taylor expanded in x around inf 5.9%
rem-square-sqrt-0.0%
fabs-sqr-0.0%
rem-square-sqrt-0.0%
associate-+r+-0.0%
associate-*r/-0.0%
metadata-eval-0.0%
Simplified-0.0%
Taylor expanded in x around 0 -0.0%
Simplified26.5%
if -20 < x < 1Initial program 22.8%
+-commutative22.8%
hypot-1-def23.0%
Simplified23.0%
add-cube-cbrt22.2%
pow322.3%
log-pow22.3%
add-sqr-sqrt10.9%
fabs-sqr10.9%
add-sqr-sqrt22.5%
Applied egg-rr22.5%
Taylor expanded in x around 0 96.2%
if 1 < x Initial program 61.0%
+-commutative61.0%
hypot-1-def100.0%
Simplified100.0%
Taylor expanded in x around inf 43.9%
mul-1-neg43.9%
log-rec43.9%
remove-double-neg43.9%
Simplified43.9%
Final simplification64.6%
(FPCore (x) :precision binary32 (if (<= x -1.0) (copysign (log (- x)) x) (copysign (log1p x) x)))
float code(float x) {
float tmp;
if (x <= -1.0f) {
tmp = copysignf(logf(-x), x);
} else {
tmp = copysignf(log1pf(x), x);
}
return tmp;
}
function code(x) tmp = Float32(0.0) if (x <= Float32(-1.0)) tmp = copysign(log(Float32(-x)), x); else tmp = copysign(log1p(x), x); end return tmp end
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1:\\
\;\;\;\;\mathsf{copysign}\left(\log \left(-x\right), x\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{copysign}\left(\mathsf{log1p}\left(x\right), x\right)\\
\end{array}
\end{array}
if x < -1Initial program 49.5%
+-commutative49.5%
hypot-1-def100.0%
Simplified100.0%
Taylor expanded in x around -inf 44.4%
mul-1-neg44.4%
Simplified44.4%
if -1 < x Initial program 36.7%
+-commutative36.7%
hypot-1-def51.3%
Simplified51.3%
Taylor expanded in x around 0 27.7%
log1p-def74.9%
rem-square-sqrt44.7%
fabs-sqr44.7%
rem-square-sqrt74.9%
Simplified74.9%
Final simplification67.4%
(FPCore (x) :precision binary32 (if (<= x -1.0) (copysign 14.333333333333334 x) (copysign (log1p x) x)))
float code(float x) {
float tmp;
if (x <= -1.0f) {
tmp = copysignf(14.333333333333334f, x);
} else {
tmp = copysignf(log1pf(x), x);
}
return tmp;
}
function code(x) tmp = Float32(0.0) if (x <= Float32(-1.0)) tmp = copysign(Float32(14.333333333333334), x); else tmp = copysign(log1p(x), x); end return tmp end
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1:\\
\;\;\;\;\mathsf{copysign}\left(14.333333333333334, x\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{copysign}\left(\mathsf{log1p}\left(x\right), x\right)\\
\end{array}
\end{array}
if x < -1Initial program 49.5%
+-commutative49.5%
hypot-1-def100.0%
Simplified100.0%
Taylor expanded in x around inf 5.8%
rem-square-sqrt-0.0%
fabs-sqr-0.0%
rem-square-sqrt-0.0%
associate-+r+-0.0%
associate-*r/-0.0%
metadata-eval-0.0%
Simplified-0.0%
Taylor expanded in x around 0 -0.0%
Simplified26.4%
if -1 < x Initial program 36.7%
+-commutative36.7%
hypot-1-def51.3%
Simplified51.3%
Taylor expanded in x around 0 27.7%
log1p-def74.9%
rem-square-sqrt44.7%
fabs-sqr44.7%
rem-square-sqrt74.9%
Simplified74.9%
Final simplification63.0%
(FPCore (x) :precision binary32 (if (or (<= x -20.0) (not (<= x 20.0))) (copysign 14.333333333333334 x) (copysign x x)))
float code(float x) {
float tmp;
if ((x <= -20.0f) || !(x <= 20.0f)) {
tmp = copysignf(14.333333333333334f, x);
} else {
tmp = copysignf(x, x);
}
return tmp;
}
function code(x) tmp = Float32(0.0) if ((x <= Float32(-20.0)) || !(x <= Float32(20.0))) tmp = copysign(Float32(14.333333333333334), x); else tmp = copysign(x, x); end return tmp end
function tmp_2 = code(x) tmp = single(0.0); if ((x <= single(-20.0)) || ~((x <= single(20.0)))) tmp = sign(x) * abs(single(14.333333333333334)); else tmp = sign(x) * abs(x); end tmp_2 = tmp; end
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -20 \lor \neg \left(x \leq 20\right):\\
\;\;\;\;\mathsf{copysign}\left(14.333333333333334, x\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{copysign}\left(x, x\right)\\
\end{array}
\end{array}
if x < -20 or 20 < x Initial program 55.0%
+-commutative55.0%
hypot-1-def100.0%
Simplified100.0%
Taylor expanded in x around inf 56.1%
rem-square-sqrt53.4%
fabs-sqr53.4%
rem-square-sqrt53.4%
associate-+r+53.4%
associate-*r/53.4%
metadata-eval53.4%
Simplified53.4%
Taylor expanded in x around 0 1.3%
Simplified27.4%
if -20 < x < 20Initial program 23.4%
+-commutative23.4%
hypot-1-def23.6%
Simplified23.6%
add-cube-cbrt22.8%
pow322.9%
log-pow23.0%
add-sqr-sqrt11.7%
fabs-sqr11.7%
add-sqr-sqrt23.1%
Applied egg-rr23.1%
Taylor expanded in x around 0 95.6%
Final simplification60.2%
(FPCore (x) :precision binary32 (copysign -7.0 x))
float code(float x) {
return copysignf(-7.0f, x);
}
function code(x) return copysign(Float32(-7.0), x) end
function tmp = code(x) tmp = sign(x) * abs(single(-7.0)); end
\begin{array}{l}
\\
\mathsf{copysign}\left(-7, x\right)
\end{array}
Initial program 39.8%
+-commutative39.8%
hypot-1-def63.3%
Simplified63.3%
Taylor expanded in x around inf 31.9%
rem-square-sqrt30.5%
fabs-sqr30.5%
rem-square-sqrt30.5%
associate-+r+30.5%
associate-*r/30.5%
metadata-eval30.5%
Simplified30.5%
Taylor expanded in x around 0 3.7%
Simplified18.0%
Final simplification18.0%
(FPCore (x) :precision binary32 (copysign 14.333333333333334 x))
float code(float x) {
return copysignf(14.333333333333334f, x);
}
function code(x) return copysign(Float32(14.333333333333334), x) end
function tmp = code(x) tmp = sign(x) * abs(single(14.333333333333334)); end
\begin{array}{l}
\\
\mathsf{copysign}\left(14.333333333333334, x\right)
\end{array}
Initial program 39.8%
+-commutative39.8%
hypot-1-def63.3%
Simplified63.3%
Taylor expanded in x around inf 31.9%
rem-square-sqrt30.5%
fabs-sqr30.5%
rem-square-sqrt30.5%
associate-+r+30.5%
associate-*r/30.5%
metadata-eval30.5%
Simplified30.5%
Taylor expanded in x around 0 3.1%
Simplified19.0%
Final simplification19.0%
(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 2024026
(FPCore (x)
:name "Rust f32::asinh"
:precision binary32
: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))