
(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 14 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.20000000298023224)
(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 <= -0.5f) {
tmp = copysignf(-logf((hypotf(1.0f, x) - x)), x);
} else if (t_0 <= 0.20000000298023224f) {
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(-0.5)) tmp = copysign(Float32(-log(Float32(hypot(Float32(1.0), x) - x))), x); elseif (t_0 <= Float32(0.20000000298023224)) 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(-0.5)) tmp = sign(x) * abs(-log((hypot(single(1.0), x) - x))); elseif (t_0 <= single(0.20000000298023224)) 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 -0.5:\\
\;\;\;\;\mathsf{copysign}\left(-\log \left(\mathsf{hypot}\left(1, x\right) - x\right), x\right)\\
\mathbf{elif}\;t_0 \leq 0.20000000298023224:\\
\;\;\;\;\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) < -0.5Initial program 55.8%
+-commutative55.8%
hypot-1-def98.4%
Simplified98.4%
flip-+15.3%
frac-2neg15.3%
log-div15.3%
Applied egg-rr18.7%
sub-neg18.7%
sub-neg18.7%
fma-udef18.7%
unpow218.7%
associate--r+52.8%
+-inverses98.4%
metadata-eval98.4%
metadata-eval98.4%
metadata-eval98.4%
neg-sub098.4%
sub-neg98.4%
+-commutative98.4%
distribute-neg-in98.4%
remove-double-neg98.4%
sub-neg98.4%
Simplified98.4%
if -0.5 < (copysign.f32 (log.f32 (+.f32 (fabs.f32 x) (sqrt.f32 (+.f32 (*.f32 x x) 1)))) x) < 0.200000003Initial program 20.9%
+-commutative20.9%
hypot-1-def20.9%
Simplified20.9%
*-un-lft-identity20.9%
*-commutative20.9%
log-prod20.9%
*-un-lft-identity20.9%
*-un-lft-identity20.9%
add-sqr-sqrt9.8%
fabs-sqr9.8%
add-sqr-sqrt21.2%
metadata-eval21.2%
Applied egg-rr21.2%
+-rgt-identity21.2%
Simplified21.2%
Taylor expanded in x around 0 100.0%
if 0.200000003 < (copysign.f32 (log.f32 (+.f32 (fabs.f32 x) (sqrt.f32 (+.f32 (*.f32 x x) 1)))) x) Initial program 54.7%
+-commutative54.7%
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.6%
(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.10000000149011612)
(copysign
(+ x (+ (* -0.16666666666666666 (pow x 3.0)) (* 0.075 (pow x 5.0))))
x)
(copysign (+ (+ 1.0 (log (+ x (hypot 1.0 x)))) -1.0) 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.10000000149011612f) {
tmp = copysignf((x + ((-0.16666666666666666f * powf(x, 3.0f)) + (0.075f * powf(x, 5.0f)))), x);
} else {
tmp = copysignf(((1.0f + logf((x + hypotf(1.0f, x)))) + -1.0f), 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(Float32(-log(Float32(hypot(Float32(1.0), x) - x))), x); elseif (t_0 <= Float32(0.10000000149011612)) 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(Float32(Float32(Float32(1.0) + log(Float32(x + hypot(Float32(1.0), x)))) + Float32(-1.0)), 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.10000000149011612)) tmp = sign(x) * abs((x + ((single(-0.16666666666666666) * (x ^ single(3.0))) + (single(0.075) * (x ^ single(5.0)))))); else tmp = sign(x) * abs(((single(1.0) + log((x + hypot(single(1.0), x)))) + single(-1.0))); 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.10000000149011612:\\
\;\;\;\;\mathsf{copysign}\left(x + \left(-0.16666666666666666 \cdot {x}^{3} + 0.075 \cdot {x}^{5}\right), 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}
\end{array}
if (copysign.f32 (log.f32 (+.f32 (fabs.f32 x) (sqrt.f32 (+.f32 (*.f32 x x) 1)))) x) < -0.5Initial program 55.8%
+-commutative55.8%
hypot-1-def98.4%
Simplified98.4%
flip-+15.3%
frac-2neg15.3%
log-div15.3%
Applied egg-rr18.7%
sub-neg18.7%
sub-neg18.7%
fma-udef18.7%
unpow218.7%
associate--r+52.8%
+-inverses98.4%
metadata-eval98.4%
metadata-eval98.4%
metadata-eval98.4%
neg-sub098.4%
sub-neg98.4%
+-commutative98.4%
distribute-neg-in98.4%
remove-double-neg98.4%
sub-neg98.4%
Simplified98.4%
if -0.5 < (copysign.f32 (log.f32 (+.f32 (fabs.f32 x) (sqrt.f32 (+.f32 (*.f32 x x) 1)))) x) < 0.100000001Initial program 20.3%
+-commutative20.3%
hypot-1-def20.4%
Simplified20.4%
*-un-lft-identity20.4%
*-commutative20.4%
log-prod20.4%
*-un-lft-identity20.4%
*-un-lft-identity20.4%
add-sqr-sqrt9.1%
fabs-sqr9.1%
add-sqr-sqrt20.6%
metadata-eval20.6%
Applied egg-rr20.6%
+-rgt-identity20.6%
Simplified20.6%
Taylor expanded in x around 0 100.0%
if 0.100000001 < (copysign.f32 (log.f32 (+.f32 (fabs.f32 x) (sqrt.f32 (+.f32 (*.f32 x x) 1)))) x) Initial program 55.2%
+-commutative55.2%
hypot-1-def99.9%
Simplified99.9%
expm1-log1p-u97.0%
expm1-udef97.1%
log1p-udef97.1%
rem-exp-log100.0%
*-un-lft-identity100.0%
*-un-lft-identity100.0%
add-sqr-sqrt99.9%
fabs-sqr99.9%
add-sqr-sqrt100.0%
Applied egg-rr100.0%
Final simplification99.6%
(FPCore (x)
:precision binary32
(if (<= x -0.05000000074505806)
(copysign (- (log (- (hypot 1.0 x) x))) x)
(if (<= x 0.009999999776482582)
(copysign (+ x (* -0.16666666666666666 (pow x 3.0))) x)
(copysign (+ (+ 1.0 (log (+ x (hypot 1.0 x)))) -1.0) x))))
float code(float x) {
float tmp;
if (x <= -0.05000000074505806f) {
tmp = copysignf(-logf((hypotf(1.0f, x) - x)), x);
} else if (x <= 0.009999999776482582f) {
tmp = copysignf((x + (-0.16666666666666666f * powf(x, 3.0f))), x);
} else {
tmp = copysignf(((1.0f + logf((x + hypotf(1.0f, x)))) + -1.0f), x);
}
return tmp;
}
function code(x) tmp = Float32(0.0) if (x <= Float32(-0.05000000074505806)) tmp = copysign(Float32(-log(Float32(hypot(Float32(1.0), x) - x))), x); elseif (x <= Float32(0.009999999776482582)) tmp = copysign(Float32(x + Float32(Float32(-0.16666666666666666) * (x ^ Float32(3.0)))), x); else tmp = copysign(Float32(Float32(Float32(1.0) + log(Float32(x + hypot(Float32(1.0), x)))) + Float32(-1.0)), x); end return tmp end
function tmp_2 = code(x) tmp = single(0.0); if (x <= single(-0.05000000074505806)) tmp = sign(x) * abs(-log((hypot(single(1.0), x) - x))); elseif (x <= single(0.009999999776482582)) tmp = sign(x) * abs((x + (single(-0.16666666666666666) * (x ^ single(3.0))))); else tmp = sign(x) * abs(((single(1.0) + log((x + hypot(single(1.0), x)))) + single(-1.0))); end tmp_2 = tmp; end
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -0.05000000074505806:\\
\;\;\;\;\mathsf{copysign}\left(-\log \left(\mathsf{hypot}\left(1, x\right) - x\right), x\right)\\
\mathbf{elif}\;x \leq 0.009999999776482582:\\
\;\;\;\;\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}
\end{array}
if x < -0.0500000007Initial program 56.4%
+-commutative56.4%
hypot-1-def98.3%
Simplified98.3%
flip-+16.5%
frac-2neg16.5%
log-div16.5%
Applied egg-rr19.9%
sub-neg19.9%
sub-neg19.9%
fma-udef19.9%
unpow219.9%
associate--r+53.5%
+-inverses98.3%
metadata-eval98.3%
metadata-eval98.3%
metadata-eval98.3%
neg-sub098.3%
sub-neg98.3%
+-commutative98.3%
distribute-neg-in98.3%
remove-double-neg98.3%
sub-neg98.3%
Simplified98.3%
if -0.0500000007 < x < 0.00999999978Initial program 19.1%
+-commutative19.1%
hypot-1-def19.2%
Simplified19.2%
*-un-lft-identity19.2%
*-commutative19.2%
log-prod19.2%
*-un-lft-identity19.2%
*-un-lft-identity19.2%
add-sqr-sqrt8.5%
fabs-sqr8.5%
add-sqr-sqrt19.5%
metadata-eval19.5%
Applied egg-rr19.5%
+-rgt-identity19.5%
Simplified19.5%
Taylor expanded in x around 0 100.0%
if 0.00999999978 < x Initial program 55.8%
+-commutative55.8%
hypot-1-def99.8%
Simplified99.8%
expm1-log1p-u97.0%
expm1-udef97.0%
log1p-udef97.0%
rem-exp-log99.8%
*-un-lft-identity99.8%
*-un-lft-identity99.8%
add-sqr-sqrt99.8%
fabs-sqr99.8%
add-sqr-sqrt99.8%
Applied egg-rr99.8%
Final simplification99.5%
(FPCore (x)
:precision binary32
(if (<= x -0.05000000074505806)
(copysign (- (log (- (hypot 1.0 x) x))) x)
(if (<= x 0.009999999776482582)
(copysign (+ x (* -0.16666666666666666 (pow x 3.0))) x)
(copysign (- (log (/ 1.0 (+ x (hypot 1.0 x))))) x))))
float code(float x) {
float tmp;
if (x <= -0.05000000074505806f) {
tmp = copysignf(-logf((hypotf(1.0f, x) - x)), x);
} else if (x <= 0.009999999776482582f) {
tmp = copysignf((x + (-0.16666666666666666f * powf(x, 3.0f))), x);
} else {
tmp = copysignf(-logf((1.0f / (x + hypotf(1.0f, x)))), x);
}
return tmp;
}
function code(x) tmp = Float32(0.0) if (x <= Float32(-0.05000000074505806)) tmp = copysign(Float32(-log(Float32(hypot(Float32(1.0), x) - x))), x); elseif (x <= Float32(0.009999999776482582)) tmp = copysign(Float32(x + Float32(Float32(-0.16666666666666666) * (x ^ Float32(3.0)))), x); else tmp = copysign(Float32(-log(Float32(Float32(1.0) / 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.05000000074505806)) tmp = sign(x) * abs(-log((hypot(single(1.0), x) - x))); elseif (x <= single(0.009999999776482582)) tmp = sign(x) * abs((x + (single(-0.16666666666666666) * (x ^ single(3.0))))); else tmp = sign(x) * abs(-log((single(1.0) / (x + hypot(single(1.0), x))))); end tmp_2 = tmp; end
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -0.05000000074505806:\\
\;\;\;\;\mathsf{copysign}\left(-\log \left(\mathsf{hypot}\left(1, x\right) - x\right), x\right)\\
\mathbf{elif}\;x \leq 0.009999999776482582:\\
\;\;\;\;\mathsf{copysign}\left(x + -0.16666666666666666 \cdot {x}^{3}, x\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{copysign}\left(-\log \left(\frac{1}{x + \mathsf{hypot}\left(1, x\right)}\right), x\right)\\
\end{array}
\end{array}
if x < -0.0500000007Initial program 56.4%
+-commutative56.4%
hypot-1-def98.3%
Simplified98.3%
flip-+16.5%
frac-2neg16.5%
log-div16.5%
Applied egg-rr19.9%
sub-neg19.9%
sub-neg19.9%
fma-udef19.9%
unpow219.9%
associate--r+53.5%
+-inverses98.3%
metadata-eval98.3%
metadata-eval98.3%
metadata-eval98.3%
neg-sub098.3%
sub-neg98.3%
+-commutative98.3%
distribute-neg-in98.3%
remove-double-neg98.3%
sub-neg98.3%
Simplified98.3%
if -0.0500000007 < x < 0.00999999978Initial program 19.1%
+-commutative19.1%
hypot-1-def19.2%
Simplified19.2%
*-un-lft-identity19.2%
*-commutative19.2%
log-prod19.2%
*-un-lft-identity19.2%
*-un-lft-identity19.2%
add-sqr-sqrt8.5%
fabs-sqr8.5%
add-sqr-sqrt19.5%
metadata-eval19.5%
Applied egg-rr19.5%
+-rgt-identity19.5%
Simplified19.5%
Taylor expanded in x around 0 100.0%
if 0.00999999978 < x Initial program 55.8%
+-commutative55.8%
hypot-1-def99.8%
Simplified99.8%
flip-+12.4%
frac-2neg12.4%
log-div12.5%
Applied egg-rr12.2%
sub-neg12.2%
sub-neg12.2%
fma-udef12.2%
unpow212.2%
associate--r+14.5%
+-inverses17.6%
metadata-eval17.6%
metadata-eval17.6%
metadata-eval17.6%
neg-sub017.6%
sub-neg17.6%
+-commutative17.6%
distribute-neg-in17.6%
remove-double-neg17.6%
sub-neg17.6%
Simplified17.6%
flip--16.0%
+-commutative16.0%
div-inv16.0%
hypot-1-def16.1%
hypot-1-def15.9%
add-sqr-sqrt20.2%
+-commutative20.2%
fma-def20.2%
pow220.2%
Applied egg-rr20.2%
*-lft-identity20.2%
metadata-eval20.2%
associate-*r/20.2%
*-rgt-identity20.2%
times-frac20.2%
neg-mul-120.2%
associate-/r*20.2%
neg-sub020.2%
associate--r-20.2%
neg-sub020.2%
+-commutative20.2%
sub-neg20.2%
fma-udef20.2%
unpow220.2%
associate--r+52.8%
+-inverses99.8%
metadata-eval99.8%
metadata-eval99.8%
Simplified99.8%
Final simplification99.5%
(FPCore (x)
:precision binary32
(if (<= x -1.0)
(copysign (- (log (- (* x -2.0) (/ 0.5 x)))) x)
(if (<= x 0.009999999776482582)
(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(((x * -2.0f) - (0.5f / x))), x);
} else if (x <= 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) tmp = Float32(0.0) if (x <= Float32(-1.0)) tmp = copysign(Float32(-log(Float32(Float32(x * Float32(-2.0)) - Float32(Float32(0.5) / x)))), x); elseif (x <= 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) tmp = single(0.0); if (x <= single(-1.0)) tmp = sign(x) * abs(-log(((x * single(-2.0)) - (single(0.5) / x)))); elseif (x <= 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}
\mathbf{if}\;x \leq -1:\\
\;\;\;\;\mathsf{copysign}\left(-\log \left(x \cdot -2 - \frac{0.5}{x}\right), x\right)\\
\mathbf{elif}\;x \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 x < -1Initial program 55.8%
+-commutative55.8%
hypot-1-def98.4%
Simplified98.4%
flip-+15.3%
frac-2neg15.3%
log-div15.3%
Applied egg-rr18.7%
sub-neg18.7%
sub-neg18.7%
fma-udef18.7%
unpow218.7%
associate--r+52.8%
+-inverses98.4%
metadata-eval98.4%
metadata-eval98.4%
metadata-eval98.4%
neg-sub098.4%
sub-neg98.4%
+-commutative98.4%
distribute-neg-in98.4%
remove-double-neg98.4%
sub-neg98.4%
Simplified98.4%
Taylor expanded in x around -inf 92.9%
*-commutative92.9%
associate-*r/92.9%
metadata-eval92.9%
Simplified92.9%
if -1 < x < 0.00999999978Initial program 19.7%
+-commutative19.7%
hypot-1-def19.8%
Simplified19.8%
*-un-lft-identity19.8%
*-commutative19.8%
log-prod19.8%
*-un-lft-identity19.8%
*-un-lft-identity19.8%
add-sqr-sqrt8.5%
fabs-sqr8.5%
add-sqr-sqrt20.0%
metadata-eval20.0%
Applied egg-rr20.0%
+-rgt-identity20.0%
Simplified20.0%
Taylor expanded in x around 0 99.9%
if 0.00999999978 < x Initial program 55.8%
+-commutative55.8%
hypot-1-def99.8%
Simplified99.8%
*-un-lft-identity99.8%
*-commutative99.8%
log-prod99.8%
*-un-lft-identity99.8%
*-un-lft-identity99.8%
add-sqr-sqrt99.7%
fabs-sqr99.7%
add-sqr-sqrt99.8%
metadata-eval99.8%
Applied egg-rr99.8%
+-rgt-identity99.8%
Simplified99.8%
Final simplification98.0%
(FPCore (x)
:precision binary32
(if (<= x -0.05000000074505806)
(copysign (- (log (- (hypot 1.0 x) x))) x)
(if (<= x 0.009999999776482582)
(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.05000000074505806f) {
tmp = copysignf(-logf((hypotf(1.0f, x) - x)), x);
} else if (x <= 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) tmp = Float32(0.0) if (x <= Float32(-0.05000000074505806)) tmp = copysign(Float32(-log(Float32(hypot(Float32(1.0), x) - x))), x); elseif (x <= 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) tmp = single(0.0); if (x <= single(-0.05000000074505806)) tmp = sign(x) * abs(-log((hypot(single(1.0), x) - x))); elseif (x <= 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}
\mathbf{if}\;x \leq -0.05000000074505806:\\
\;\;\;\;\mathsf{copysign}\left(-\log \left(\mathsf{hypot}\left(1, x\right) - x\right), x\right)\\
\mathbf{elif}\;x \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 x < -0.0500000007Initial program 56.4%
+-commutative56.4%
hypot-1-def98.3%
Simplified98.3%
flip-+16.5%
frac-2neg16.5%
log-div16.5%
Applied egg-rr19.9%
sub-neg19.9%
sub-neg19.9%
fma-udef19.9%
unpow219.9%
associate--r+53.5%
+-inverses98.3%
metadata-eval98.3%
metadata-eval98.3%
metadata-eval98.3%
neg-sub098.3%
sub-neg98.3%
+-commutative98.3%
distribute-neg-in98.3%
remove-double-neg98.3%
sub-neg98.3%
Simplified98.3%
if -0.0500000007 < x < 0.00999999978Initial program 19.1%
+-commutative19.1%
hypot-1-def19.2%
Simplified19.2%
*-un-lft-identity19.2%
*-commutative19.2%
log-prod19.2%
*-un-lft-identity19.2%
*-un-lft-identity19.2%
add-sqr-sqrt8.5%
fabs-sqr8.5%
add-sqr-sqrt19.5%
metadata-eval19.5%
Applied egg-rr19.5%
+-rgt-identity19.5%
Simplified19.5%
Taylor expanded in x around 0 100.0%
if 0.00999999978 < x Initial program 55.8%
+-commutative55.8%
hypot-1-def99.8%
Simplified99.8%
*-un-lft-identity99.8%
*-commutative99.8%
log-prod99.8%
*-un-lft-identity99.8%
*-un-lft-identity99.8%
add-sqr-sqrt99.7%
fabs-sqr99.7%
add-sqr-sqrt99.8%
metadata-eval99.8%
Applied egg-rr99.8%
+-rgt-identity99.8%
Simplified99.8%
Final simplification99.5%
(FPCore (x)
:precision binary32
(if (<= x -1.5)
(copysign (log (/ -0.5 x)) x)
(if (<= x 0.20000000298023224)
(copysign (+ x (* -0.16666666666666666 (pow x 3.0))) x)
(copysign (log (+ (/ 0.5 x) (+ x x))) x))))
float code(float x) {
float tmp;
if (x <= -1.5f) {
tmp = copysignf(logf((-0.5f / x)), x);
} else if (x <= 0.20000000298023224f) {
tmp = copysignf((x + (-0.16666666666666666f * powf(x, 3.0f))), x);
} else {
tmp = copysignf(logf(((0.5f / x) + (x + x))), x);
}
return tmp;
}
function code(x) tmp = Float32(0.0) if (x <= Float32(-1.5)) tmp = copysign(log(Float32(Float32(-0.5) / x)), x); elseif (x <= Float32(0.20000000298023224)) tmp = copysign(Float32(x + Float32(Float32(-0.16666666666666666) * (x ^ Float32(3.0)))), x); else tmp = copysign(log(Float32(Float32(Float32(0.5) / x) + Float32(x + x))), x); end return tmp end
function tmp_2 = code(x) tmp = single(0.0); if (x <= single(-1.5)) tmp = sign(x) * abs(log((single(-0.5) / x))); elseif (x <= single(0.20000000298023224)) tmp = sign(x) * abs((x + (single(-0.16666666666666666) * (x ^ single(3.0))))); else tmp = sign(x) * abs(log(((single(0.5) / x) + (x + x)))); end tmp_2 = tmp; end
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.5:\\
\;\;\;\;\mathsf{copysign}\left(\log \left(\frac{-0.5}{x}\right), x\right)\\
\mathbf{elif}\;x \leq 0.20000000298023224:\\
\;\;\;\;\mathsf{copysign}\left(x + -0.16666666666666666 \cdot {x}^{3}, x\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{copysign}\left(\log \left(\frac{0.5}{x} + \left(x + x\right)\right), x\right)\\
\end{array}
\end{array}
if x < -1.5Initial program 53.8%
+-commutative53.8%
hypot-1-def98.4%
Simplified98.4%
*-un-lft-identity98.4%
*-commutative98.4%
log-prod98.4%
*-un-lft-identity98.4%
*-un-lft-identity98.4%
add-sqr-sqrt-0.0%
fabs-sqr-0.0%
add-sqr-sqrt16.8%
metadata-eval16.8%
Applied egg-rr16.8%
+-rgt-identity16.8%
Simplified16.8%
Taylor expanded in x around -inf 94.5%
if -1.5 < x < 0.200000003Initial program 22.7%
+-commutative22.7%
hypot-1-def22.8%
Simplified22.8%
*-un-lft-identity22.8%
*-commutative22.8%
log-prod22.8%
*-un-lft-identity22.8%
*-un-lft-identity22.8%
add-sqr-sqrt9.6%
fabs-sqr9.6%
add-sqr-sqrt23.0%
metadata-eval23.0%
Applied egg-rr23.0%
+-rgt-identity23.0%
Simplified23.0%
Taylor expanded in x around 0 98.1%
if 0.200000003 < x Initial program 54.7%
+-commutative54.7%
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 simplification97.6%
(FPCore (x)
:precision binary32
(if (<= x -1.0)
(copysign (- (log (- (* x -2.0) (/ 0.5 x)))) x)
(if (<= x 0.20000000298023224)
(copysign (+ x (* -0.16666666666666666 (pow x 3.0))) x)
(copysign (log (+ (/ 0.5 x) (+ x x))) x))))
float code(float x) {
float tmp;
if (x <= -1.0f) {
tmp = copysignf(-logf(((x * -2.0f) - (0.5f / x))), x);
} else if (x <= 0.20000000298023224f) {
tmp = copysignf((x + (-0.16666666666666666f * powf(x, 3.0f))), x);
} else {
tmp = copysignf(logf(((0.5f / x) + (x + x))), x);
}
return tmp;
}
function code(x) tmp = Float32(0.0) if (x <= Float32(-1.0)) tmp = copysign(Float32(-log(Float32(Float32(x * Float32(-2.0)) - Float32(Float32(0.5) / x)))), x); elseif (x <= Float32(0.20000000298023224)) tmp = copysign(Float32(x + Float32(Float32(-0.16666666666666666) * (x ^ Float32(3.0)))), x); else tmp = copysign(log(Float32(Float32(Float32(0.5) / x) + 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(((x * single(-2.0)) - (single(0.5) / x)))); elseif (x <= single(0.20000000298023224)) tmp = sign(x) * abs((x + (single(-0.16666666666666666) * (x ^ single(3.0))))); else tmp = sign(x) * abs(log(((single(0.5) / x) + (x + x)))); end tmp_2 = tmp; end
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1:\\
\;\;\;\;\mathsf{copysign}\left(-\log \left(x \cdot -2 - \frac{0.5}{x}\right), x\right)\\
\mathbf{elif}\;x \leq 0.20000000298023224:\\
\;\;\;\;\mathsf{copysign}\left(x + -0.16666666666666666 \cdot {x}^{3}, x\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{copysign}\left(\log \left(\frac{0.5}{x} + \left(x + x\right)\right), x\right)\\
\end{array}
\end{array}
if x < -1Initial program 55.8%
+-commutative55.8%
hypot-1-def98.4%
Simplified98.4%
flip-+15.3%
frac-2neg15.3%
log-div15.3%
Applied egg-rr18.7%
sub-neg18.7%
sub-neg18.7%
fma-udef18.7%
unpow218.7%
associate--r+52.8%
+-inverses98.4%
metadata-eval98.4%
metadata-eval98.4%
metadata-eval98.4%
neg-sub098.4%
sub-neg98.4%
+-commutative98.4%
distribute-neg-in98.4%
remove-double-neg98.4%
sub-neg98.4%
Simplified98.4%
Taylor expanded in x around -inf 92.9%
*-commutative92.9%
associate-*r/92.9%
metadata-eval92.9%
Simplified92.9%
if -1 < x < 0.200000003Initial program 20.9%
+-commutative20.9%
hypot-1-def20.9%
Simplified20.9%
*-un-lft-identity20.9%
*-commutative20.9%
log-prod20.9%
*-un-lft-identity20.9%
*-un-lft-identity20.9%
add-sqr-sqrt9.8%
fabs-sqr9.8%
add-sqr-sqrt21.2%
metadata-eval21.2%
Applied egg-rr21.2%
+-rgt-identity21.2%
Simplified21.2%
Taylor expanded in x around 0 99.6%
if 0.200000003 < x Initial program 54.7%
+-commutative54.7%
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 simplification97.9%
(FPCore (x)
:precision binary32
(if (<= x -1.5)
(copysign (log (/ -0.5 x)) x)
(if (<= x 0.20000000298023224)
(copysign (+ x (* -0.16666666666666666 (pow x 3.0))) x)
(copysign (log (+ x x)) x))))
float code(float x) {
float tmp;
if (x <= -1.5f) {
tmp = copysignf(logf((-0.5f / x)), x);
} else if (x <= 0.20000000298023224f) {
tmp = copysignf((x + (-0.16666666666666666f * powf(x, 3.0f))), x);
} else {
tmp = copysignf(logf((x + x)), x);
}
return tmp;
}
function code(x) tmp = Float32(0.0) if (x <= Float32(-1.5)) tmp = copysign(log(Float32(Float32(-0.5) / x)), x); elseif (x <= Float32(0.20000000298023224)) tmp = copysign(Float32(x + Float32(Float32(-0.16666666666666666) * (x ^ Float32(3.0)))), 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.5)) tmp = sign(x) * abs(log((single(-0.5) / x))); elseif (x <= single(0.20000000298023224)) tmp = sign(x) * abs((x + (single(-0.16666666666666666) * (x ^ single(3.0))))); else tmp = sign(x) * abs(log((x + x))); end tmp_2 = tmp; end
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.5:\\
\;\;\;\;\mathsf{copysign}\left(\log \left(\frac{-0.5}{x}\right), x\right)\\
\mathbf{elif}\;x \leq 0.20000000298023224:\\
\;\;\;\;\mathsf{copysign}\left(x + -0.16666666666666666 \cdot {x}^{3}, x\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{copysign}\left(\log \left(x + x\right), x\right)\\
\end{array}
\end{array}
if x < -1.5Initial program 53.8%
+-commutative53.8%
hypot-1-def98.4%
Simplified98.4%
*-un-lft-identity98.4%
*-commutative98.4%
log-prod98.4%
*-un-lft-identity98.4%
*-un-lft-identity98.4%
add-sqr-sqrt-0.0%
fabs-sqr-0.0%
add-sqr-sqrt16.8%
metadata-eval16.8%
Applied egg-rr16.8%
+-rgt-identity16.8%
Simplified16.8%
Taylor expanded in x around -inf 94.5%
if -1.5 < x < 0.200000003Initial program 22.7%
+-commutative22.7%
hypot-1-def22.8%
Simplified22.8%
*-un-lft-identity22.8%
*-commutative22.8%
log-prod22.8%
*-un-lft-identity22.8%
*-un-lft-identity22.8%
add-sqr-sqrt9.6%
fabs-sqr9.6%
add-sqr-sqrt23.0%
metadata-eval23.0%
Applied egg-rr23.0%
+-rgt-identity23.0%
Simplified23.0%
Taylor expanded in x around 0 98.1%
if 0.200000003 < x Initial program 54.7%
+-commutative54.7%
hypot-1-def100.0%
Simplified100.0%
Taylor expanded in x around inf 98.0%
rem-square-sqrt98.0%
fabs-sqr98.0%
rem-square-sqrt98.0%
Simplified98.0%
Final simplification97.2%
(FPCore (x) :precision binary32 (if (<= x -4.0) (copysign (log (- x)) x) (if (<= x 0.20000000298023224) (copysign x x) (copysign (log (+ x x)) x))))
float code(float x) {
float tmp;
if (x <= -4.0f) {
tmp = copysignf(logf(-x), x);
} else if (x <= 0.20000000298023224f) {
tmp = copysignf(x, x);
} else {
tmp = copysignf(logf((x + x)), x);
}
return tmp;
}
function code(x) tmp = Float32(0.0) if (x <= Float32(-4.0)) tmp = copysign(log(Float32(-x)), x); elseif (x <= Float32(0.20000000298023224)) 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(-4.0)) tmp = sign(x) * abs(log(-x)); elseif (x <= single(0.20000000298023224)) 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 -4:\\
\;\;\;\;\mathsf{copysign}\left(\log \left(-x\right), x\right)\\
\mathbf{elif}\;x \leq 0.20000000298023224:\\
\;\;\;\;\mathsf{copysign}\left(x, x\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{copysign}\left(\log \left(x + x\right), x\right)\\
\end{array}
\end{array}
if x < -4Initial program 51.6%
+-commutative51.6%
hypot-1-def98.3%
Simplified98.3%
Taylor expanded in x around -inf 43.9%
mul-1-neg43.9%
Simplified43.9%
if -4 < x < 0.200000003Initial program 24.4%
+-commutative24.4%
hypot-1-def24.5%
Simplified24.5%
*-un-lft-identity24.5%
*-commutative24.5%
log-prod24.5%
*-un-lft-identity24.5%
*-un-lft-identity24.5%
add-sqr-sqrt9.3%
fabs-sqr9.3%
add-sqr-sqrt24.6%
metadata-eval24.6%
Applied egg-rr24.6%
+-rgt-identity24.6%
Simplified24.6%
Taylor expanded in x around 0 95.4%
if 0.200000003 < x Initial program 54.7%
+-commutative54.7%
hypot-1-def100.0%
Simplified100.0%
Taylor expanded in x around inf 98.0%
rem-square-sqrt98.0%
fabs-sqr98.0%
rem-square-sqrt98.0%
Simplified98.0%
Final simplification84.0%
(FPCore (x) :precision binary32 (if (<= x -1.5) (copysign (log (/ -0.5 x)) x) (if (<= x 0.20000000298023224) (copysign x x) (copysign (log (+ x x)) x))))
float code(float x) {
float tmp;
if (x <= -1.5f) {
tmp = copysignf(logf((-0.5f / x)), x);
} else if (x <= 0.20000000298023224f) {
tmp = copysignf(x, x);
} else {
tmp = copysignf(logf((x + x)), x);
}
return tmp;
}
function code(x) tmp = Float32(0.0) if (x <= Float32(-1.5)) tmp = copysign(log(Float32(Float32(-0.5) / x)), x); elseif (x <= Float32(0.20000000298023224)) 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.5)) tmp = sign(x) * abs(log((single(-0.5) / x))); elseif (x <= single(0.20000000298023224)) 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.5:\\
\;\;\;\;\mathsf{copysign}\left(\log \left(\frac{-0.5}{x}\right), x\right)\\
\mathbf{elif}\;x \leq 0.20000000298023224:\\
\;\;\;\;\mathsf{copysign}\left(x, x\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{copysign}\left(\log \left(x + x\right), x\right)\\
\end{array}
\end{array}
if x < -1.5Initial program 53.8%
+-commutative53.8%
hypot-1-def98.4%
Simplified98.4%
*-un-lft-identity98.4%
*-commutative98.4%
log-prod98.4%
*-un-lft-identity98.4%
*-un-lft-identity98.4%
add-sqr-sqrt-0.0%
fabs-sqr-0.0%
add-sqr-sqrt16.8%
metadata-eval16.8%
Applied egg-rr16.8%
+-rgt-identity16.8%
Simplified16.8%
Taylor expanded in x around -inf 94.5%
if -1.5 < x < 0.200000003Initial program 22.7%
+-commutative22.7%
hypot-1-def22.8%
Simplified22.8%
*-un-lft-identity22.8%
*-commutative22.8%
log-prod22.8%
*-un-lft-identity22.8%
*-un-lft-identity22.8%
add-sqr-sqrt9.6%
fabs-sqr9.6%
add-sqr-sqrt23.0%
metadata-eval23.0%
Applied egg-rr23.0%
+-rgt-identity23.0%
Simplified23.0%
Taylor expanded in x around 0 96.9%
if 0.200000003 < x Initial program 54.7%
+-commutative54.7%
hypot-1-def100.0%
Simplified100.0%
Taylor expanded in x around inf 98.0%
rem-square-sqrt98.0%
fabs-sqr98.0%
rem-square-sqrt98.0%
Simplified98.0%
Final simplification96.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 55.8%
+-commutative55.8%
hypot-1-def98.4%
Simplified98.4%
Taylor expanded in x around -inf 42.2%
mul-1-neg42.2%
Simplified42.2%
if -1 < x Initial program 32.3%
+-commutative32.3%
hypot-1-def47.6%
Simplified47.6%
Taylor expanded in x around 0 27.1%
log1p-def77.6%
rem-square-sqrt42.3%
fabs-sqr42.3%
rem-square-sqrt77.6%
Simplified77.6%
Final simplification68.5%
(FPCore (x) :precision binary32 (if (<= x 0.20000000298023224) (copysign x x) (copysign (log1p x) x)))
float code(float x) {
float tmp;
if (x <= 0.20000000298023224f) {
tmp = copysignf(x, x);
} else {
tmp = copysignf(log1pf(x), x);
}
return tmp;
}
function code(x) tmp = Float32(0.0) if (x <= Float32(0.20000000298023224)) 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.20000000298023224:\\
\;\;\;\;\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.200000003Initial program 32.9%
+-commutative32.9%
hypot-1-def47.6%
Simplified47.6%
*-un-lft-identity47.6%
*-commutative47.6%
log-prod47.6%
*-un-lft-identity47.6%
*-un-lft-identity47.6%
add-sqr-sqrt6.4%
fabs-sqr6.4%
add-sqr-sqrt20.9%
metadata-eval20.9%
Applied egg-rr20.9%
+-rgt-identity20.9%
Simplified20.9%
Taylor expanded in x around 0 69.2%
if 0.200000003 < x Initial program 54.7%
+-commutative54.7%
hypot-1-def100.0%
Simplified100.0%
Taylor expanded in x around 0 43.5%
log1p-def43.5%
rem-square-sqrt43.5%
fabs-sqr43.5%
rem-square-sqrt43.5%
Simplified43.5%
Final simplification62.8%
(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.3%
+-commutative38.3%
hypot-1-def60.7%
Simplified60.7%
*-un-lft-identity60.7%
*-commutative60.7%
log-prod60.7%
*-un-lft-identity60.7%
*-un-lft-identity60.7%
add-sqr-sqrt29.8%
fabs-sqr29.8%
add-sqr-sqrt40.7%
metadata-eval40.7%
Applied egg-rr40.7%
+-rgt-identity40.7%
Simplified40.7%
Taylor expanded in x around 0 54.9%
Final simplification54.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 2023334
(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))