Rust f32::asinh

?

Percentage Accurate: 37.1% → 99.2%
Time: 8.7s
Precision: binary32
Cost: 59016

?

\[\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)\\ t_1 := \left|x\right| + 1\\ \mathbf{if}\;t_0 \leq -1:\\ \;\;\;\;\mathsf{copysign}\left(\log \left(\left|x\right| + \mathsf{hypot}\left(1, x\right)\right), x\right)\\ \mathbf{elif}\;t_0 \leq 0.004999999888241291:\\ \;\;\;\;\mathsf{copysign}\left(\mathsf{fma}\left(-0.041666666666666664, \left(\frac{3}{t_1} + \frac{3}{{t_1}^{2}}\right) \cdot {x}^{4}, \mathsf{fma}\left(0.5, \frac{x \cdot x}{t_1}, \mathsf{log1p}\left(\left|x\right|\right)\right)\right), x\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{copysign}\left(\mathsf{log1p}\left(-1 + \left(x + \mathsf{hypot}\left(1, x\right)\right)\right), x\right)\\ \end{array} \]
(FPCore (x)
 :precision binary32
 (copysign (log (+ (fabs x) (sqrt (+ (* x x) 1.0)))) x))
(FPCore (x)
 :precision binary32
 (let* ((t_0 (copysign (log (+ (fabs x) (sqrt (+ (* x x) 1.0)))) x))
        (t_1 (+ (fabs x) 1.0)))
   (if (<= t_0 -1.0)
     (copysign (log (+ (fabs x) (hypot 1.0 x))) x)
     (if (<= t_0 0.004999999888241291)
       (copysign
        (fma
         -0.041666666666666664
         (* (+ (/ 3.0 t_1) (/ 3.0 (pow t_1 2.0))) (pow x 4.0))
         (fma 0.5 (/ (* x x) t_1) (log1p (fabs x))))
        x)
       (copysign (log1p (+ -1.0 (+ x (hypot 1.0 x)))) x)))))
float code(float x) {
	return copysignf(logf((fabsf(x) + sqrtf(((x * x) + 1.0f)))), x);
}
float code(float x) {
	float t_0 = copysignf(logf((fabsf(x) + sqrtf(((x * x) + 1.0f)))), x);
	float t_1 = fabsf(x) + 1.0f;
	float tmp;
	if (t_0 <= -1.0f) {
		tmp = copysignf(logf((fabsf(x) + hypotf(1.0f, x))), x);
	} else if (t_0 <= 0.004999999888241291f) {
		tmp = copysignf(fmaf(-0.041666666666666664f, (((3.0f / t_1) + (3.0f / powf(t_1, 2.0f))) * powf(x, 4.0f)), fmaf(0.5f, ((x * x) / t_1), log1pf(fabsf(x)))), x);
	} else {
		tmp = copysignf(log1pf((-1.0f + (x + hypotf(1.0f, x)))), x);
	}
	return tmp;
}
function code(x)
	return copysign(log(Float32(abs(x) + sqrt(Float32(Float32(x * x) + Float32(1.0))))), x)
end
function code(x)
	t_0 = copysign(log(Float32(abs(x) + sqrt(Float32(Float32(x * x) + Float32(1.0))))), x)
	t_1 = Float32(abs(x) + Float32(1.0))
	tmp = Float32(0.0)
	if (t_0 <= Float32(-1.0))
		tmp = copysign(log(Float32(abs(x) + hypot(Float32(1.0), x))), x);
	elseif (t_0 <= Float32(0.004999999888241291))
		tmp = copysign(fma(Float32(-0.041666666666666664), Float32(Float32(Float32(Float32(3.0) / t_1) + Float32(Float32(3.0) / (t_1 ^ Float32(2.0)))) * (x ^ Float32(4.0))), fma(Float32(0.5), Float32(Float32(x * x) / t_1), log1p(abs(x)))), x);
	else
		tmp = copysign(log1p(Float32(Float32(-1.0) + Float32(x + hypot(Float32(1.0), x)))), x);
	end
	return tmp
end
\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)\\
t_1 := \left|x\right| + 1\\
\mathbf{if}\;t_0 \leq -1:\\
\;\;\;\;\mathsf{copysign}\left(\log \left(\left|x\right| + \mathsf{hypot}\left(1, x\right)\right), x\right)\\

\mathbf{elif}\;t_0 \leq 0.004999999888241291:\\
\;\;\;\;\mathsf{copysign}\left(\mathsf{fma}\left(-0.041666666666666664, \left(\frac{3}{t_1} + \frac{3}{{t_1}^{2}}\right) \cdot {x}^{4}, \mathsf{fma}\left(0.5, \frac{x \cdot x}{t_1}, \mathsf{log1p}\left(\left|x\right|\right)\right)\right), x\right)\\

\mathbf{else}:\\
\;\;\;\;\mathsf{copysign}\left(\mathsf{log1p}\left(-1 + \left(x + \mathsf{hypot}\left(1, x\right)\right)\right), x\right)\\


\end{array}

Local Percentage Accuracy vs ?

The average percentage accuracy by input value. Horizontal axis shows value of an input variable; the variable is choosen in the title. Vertical axis is accuracy; higher is better. Red represent the original program, while blue represents Herbie's suggestion. These can be toggled with buttons below the plot. The line is an average while dots represent individual samples.

Herbie found 16 alternatives:

AlternativeAccuracySpeedup

Accuracy vs Speed

The accuracy (vertical axis) and speed (horizontal axis) of each alternatives. Up and to the right is better. The red square shows the initial program, and each blue circle shows an alternative.The line shows the best available speed-accuracy tradeoffs.

Bogosity?

Bogosity

Target

Original37.1%
Target99.5%
Herbie99.2%
\[\mathsf{copysign}\left(\mathsf{log1p}\left(\left|x\right| + \frac{\left|x\right|}{\mathsf{hypot}\left(1, \frac{1}{\left|x\right|}\right) + \frac{1}{\left|x\right|}}\right), x\right) \]

Derivation?

  1. Split input into 3 regimes
  2. if (copysign.f32 (log.f32 (+.f32 (fabs.f32 x) (sqrt.f32 (+.f32 (*.f32 x x) 1)))) x) < -1

    1. Initial program 63.5%

      \[\mathsf{copysign}\left(\log \left(\left|x\right| + \sqrt{x \cdot x + 1}\right), x\right) \]
    2. Simplified99.9%

      \[\leadsto \color{blue}{\mathsf{copysign}\left(\log \left(\left|x\right| + \mathsf{hypot}\left(1, x\right)\right), x\right)} \]
      Step-by-step derivation

      [Start]63.5%

      \[ \mathsf{copysign}\left(\log \left(\left|x\right| + \sqrt{x \cdot x + 1}\right), x\right) \]

      +-commutative [=>]63.5%

      \[ \mathsf{copysign}\left(\log \left(\left|x\right| + \sqrt{\color{blue}{1 + x \cdot x}}\right), x\right) \]

      hypot-1-def [=>]99.9%

      \[ \mathsf{copysign}\left(\log \left(\left|x\right| + \color{blue}{\mathsf{hypot}\left(1, x\right)}\right), x\right) \]

    if -1 < (copysign.f32 (log.f32 (+.f32 (fabs.f32 x) (sqrt.f32 (+.f32 (*.f32 x x) 1)))) x) < 0.00499999989

    1. Initial program 17.4%

      \[\mathsf{copysign}\left(\log \left(\left|x\right| + \sqrt{x \cdot x + 1}\right), x\right) \]
    2. Simplified17.5%

      \[\leadsto \color{blue}{\mathsf{copysign}\left(\log \left(\left|x\right| + \mathsf{hypot}\left(1, x\right)\right), x\right)} \]
      Step-by-step derivation

      [Start]17.4%

      \[ \mathsf{copysign}\left(\log \left(\left|x\right| + \sqrt{x \cdot x + 1}\right), x\right) \]

      +-commutative [=>]17.4%

      \[ \mathsf{copysign}\left(\log \left(\left|x\right| + \sqrt{\color{blue}{1 + x \cdot x}}\right), x\right) \]

      hypot-1-def [=>]17.5%

      \[ \mathsf{copysign}\left(\log \left(\left|x\right| + \color{blue}{\mathsf{hypot}\left(1, x\right)}\right), x\right) \]
    3. Taylor expanded in x around 0 18.5%

      \[\leadsto \mathsf{copysign}\left(\color{blue}{-0.041666666666666664 \cdot \left(\left(3 \cdot \frac{1}{1 + \left|x\right|} + 3 \cdot \frac{1}{{\left(1 + \left|x\right|\right)}^{2}}\right) \cdot {x}^{4}\right) + \left(0.5 \cdot \frac{{x}^{2}}{1 + \left|x\right|} + \log \left(1 + \left|x\right|\right)\right)}, x\right) \]
    4. Simplified99.9%

      \[\leadsto \mathsf{copysign}\left(\color{blue}{\mathsf{fma}\left(-0.041666666666666664, \left(\frac{3}{1 + \left|x\right|} + \frac{3}{{\left(1 + \left|x\right|\right)}^{2}}\right) \cdot {x}^{4}, \mathsf{fma}\left(0.5, \frac{x \cdot x}{1 + \left|x\right|}, \mathsf{log1p}\left(\left|x\right|\right)\right)\right)}, x\right) \]
      Step-by-step derivation

      [Start]18.5%

      \[ \mathsf{copysign}\left(-0.041666666666666664 \cdot \left(\left(3 \cdot \frac{1}{1 + \left|x\right|} + 3 \cdot \frac{1}{{\left(1 + \left|x\right|\right)}^{2}}\right) \cdot {x}^{4}\right) + \left(0.5 \cdot \frac{{x}^{2}}{1 + \left|x\right|} + \log \left(1 + \left|x\right|\right)\right), x\right) \]

      fma-def [=>]18.5%

      \[ \mathsf{copysign}\left(\color{blue}{\mathsf{fma}\left(-0.041666666666666664, \left(3 \cdot \frac{1}{1 + \left|x\right|} + 3 \cdot \frac{1}{{\left(1 + \left|x\right|\right)}^{2}}\right) \cdot {x}^{4}, 0.5 \cdot \frac{{x}^{2}}{1 + \left|x\right|} + \log \left(1 + \left|x\right|\right)\right)}, x\right) \]

      associate-*r/ [=>]18.5%

      \[ \mathsf{copysign}\left(\mathsf{fma}\left(-0.041666666666666664, \left(\color{blue}{\frac{3 \cdot 1}{1 + \left|x\right|}} + 3 \cdot \frac{1}{{\left(1 + \left|x\right|\right)}^{2}}\right) \cdot {x}^{4}, 0.5 \cdot \frac{{x}^{2}}{1 + \left|x\right|} + \log \left(1 + \left|x\right|\right)\right), x\right) \]

      metadata-eval [=>]18.5%

      \[ \mathsf{copysign}\left(\mathsf{fma}\left(-0.041666666666666664, \left(\frac{\color{blue}{3}}{1 + \left|x\right|} + 3 \cdot \frac{1}{{\left(1 + \left|x\right|\right)}^{2}}\right) \cdot {x}^{4}, 0.5 \cdot \frac{{x}^{2}}{1 + \left|x\right|} + \log \left(1 + \left|x\right|\right)\right), x\right) \]

      associate-*r/ [=>]18.5%

      \[ \mathsf{copysign}\left(\mathsf{fma}\left(-0.041666666666666664, \left(\frac{3}{1 + \left|x\right|} + \color{blue}{\frac{3 \cdot 1}{{\left(1 + \left|x\right|\right)}^{2}}}\right) \cdot {x}^{4}, 0.5 \cdot \frac{{x}^{2}}{1 + \left|x\right|} + \log \left(1 + \left|x\right|\right)\right), x\right) \]

      metadata-eval [=>]18.5%

      \[ \mathsf{copysign}\left(\mathsf{fma}\left(-0.041666666666666664, \left(\frac{3}{1 + \left|x\right|} + \frac{\color{blue}{3}}{{\left(1 + \left|x\right|\right)}^{2}}\right) \cdot {x}^{4}, 0.5 \cdot \frac{{x}^{2}}{1 + \left|x\right|} + \log \left(1 + \left|x\right|\right)\right), x\right) \]

      fma-def [=>]18.5%

      \[ \mathsf{copysign}\left(\mathsf{fma}\left(-0.041666666666666664, \left(\frac{3}{1 + \left|x\right|} + \frac{3}{{\left(1 + \left|x\right|\right)}^{2}}\right) \cdot {x}^{4}, \color{blue}{\mathsf{fma}\left(0.5, \frac{{x}^{2}}{1 + \left|x\right|}, \log \left(1 + \left|x\right|\right)\right)}\right), x\right) \]

      unpow2 [=>]18.5%

      \[ \mathsf{copysign}\left(\mathsf{fma}\left(-0.041666666666666664, \left(\frac{3}{1 + \left|x\right|} + \frac{3}{{\left(1 + \left|x\right|\right)}^{2}}\right) \cdot {x}^{4}, \mathsf{fma}\left(0.5, \frac{\color{blue}{x \cdot x}}{1 + \left|x\right|}, \log \left(1 + \left|x\right|\right)\right)\right), x\right) \]

      log1p-def [=>]99.9%

      \[ \mathsf{copysign}\left(\mathsf{fma}\left(-0.041666666666666664, \left(\frac{3}{1 + \left|x\right|} + \frac{3}{{\left(1 + \left|x\right|\right)}^{2}}\right) \cdot {x}^{4}, \mathsf{fma}\left(0.5, \frac{x \cdot x}{1 + \left|x\right|}, \color{blue}{\mathsf{log1p}\left(\left|x\right|\right)}\right)\right), x\right) \]

    if 0.00499999989 < (copysign.f32 (log.f32 (+.f32 (fabs.f32 x) (sqrt.f32 (+.f32 (*.f32 x x) 1)))) x)

    1. Initial program 45.6%

      \[\mathsf{copysign}\left(\log \left(\left|x\right| + \sqrt{x \cdot x + 1}\right), x\right) \]
    2. Simplified96.9%

      \[\leadsto \color{blue}{\mathsf{copysign}\left(\log \left(\left|x\right| + \mathsf{hypot}\left(1, x\right)\right), x\right)} \]
      Step-by-step derivation

      [Start]45.6%

      \[ \mathsf{copysign}\left(\log \left(\left|x\right| + \sqrt{x \cdot x + 1}\right), x\right) \]

      +-commutative [=>]45.6%

      \[ \mathsf{copysign}\left(\log \left(\left|x\right| + \sqrt{\color{blue}{1 + x \cdot x}}\right), x\right) \]

      hypot-1-def [=>]96.9%

      \[ \mathsf{copysign}\left(\log \left(\left|x\right| + \color{blue}{\mathsf{hypot}\left(1, x\right)}\right), x\right) \]
    3. Applied egg-rr96.9%

      \[\leadsto \mathsf{copysign}\left(\color{blue}{\mathsf{log1p}\left(\left(x + \mathsf{hypot}\left(1, x\right)\right) - 1\right)}, x\right) \]
      Step-by-step derivation

      [Start]96.9%

      \[ \mathsf{copysign}\left(\log \left(\left|x\right| + \mathsf{hypot}\left(1, x\right)\right), x\right) \]

      log1p-expm1-u [=>]96.9%

      \[ \mathsf{copysign}\left(\color{blue}{\mathsf{log1p}\left(\mathsf{expm1}\left(\log \left(\left|x\right| + \mathsf{hypot}\left(1, x\right)\right)\right)\right)}, x\right) \]

      expm1-udef [=>]96.9%

      \[ \mathsf{copysign}\left(\mathsf{log1p}\left(\color{blue}{e^{\log \left(\left|x\right| + \mathsf{hypot}\left(1, x\right)\right)} - 1}\right), x\right) \]

      add-exp-log [<=]96.9%

      \[ \mathsf{copysign}\left(\mathsf{log1p}\left(\color{blue}{\left(\left|x\right| + \mathsf{hypot}\left(1, x\right)\right)} - 1\right), x\right) \]

      add-sqr-sqrt [=>]97.0%

      \[ \mathsf{copysign}\left(\mathsf{log1p}\left(\left(\left|\color{blue}{\sqrt{x} \cdot \sqrt{x}}\right| + \mathsf{hypot}\left(1, x\right)\right) - 1\right), x\right) \]

      fabs-sqr [=>]97.0%

      \[ \mathsf{copysign}\left(\mathsf{log1p}\left(\left(\color{blue}{\sqrt{x} \cdot \sqrt{x}} + \mathsf{hypot}\left(1, x\right)\right) - 1\right), x\right) \]

      add-sqr-sqrt [<=]96.9%

      \[ \mathsf{copysign}\left(\mathsf{log1p}\left(\left(\color{blue}{x} + \mathsf{hypot}\left(1, x\right)\right) - 1\right), x\right) \]
  3. Recombined 3 regimes into one program.
  4. Final simplification99.2%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\mathsf{copysign}\left(\log \left(\left|x\right| + \sqrt{x \cdot x + 1}\right), x\right) \leq -1:\\ \;\;\;\;\mathsf{copysign}\left(\log \left(\left|x\right| + \mathsf{hypot}\left(1, x\right)\right), x\right)\\ \mathbf{elif}\;\mathsf{copysign}\left(\log \left(\left|x\right| + \sqrt{x \cdot x + 1}\right), x\right) \leq 0.004999999888241291:\\ \;\;\;\;\mathsf{copysign}\left(\mathsf{fma}\left(-0.041666666666666664, \left(\frac{3}{\left|x\right| + 1} + \frac{3}{{\left(\left|x\right| + 1\right)}^{2}}\right) \cdot {x}^{4}, \mathsf{fma}\left(0.5, \frac{x \cdot x}{\left|x\right| + 1}, \mathsf{log1p}\left(\left|x\right|\right)\right)\right), x\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{copysign}\left(\mathsf{log1p}\left(-1 + \left(x + \mathsf{hypot}\left(1, x\right)\right)\right), x\right)\\ \end{array} \]

Alternatives

Alternative 1
Accuracy99.2%
Cost59016
\[\begin{array}{l} t_0 := \mathsf{copysign}\left(\log \left(\left|x\right| + \sqrt{x \cdot x + 1}\right), x\right)\\ t_1 := \left|x\right| + 1\\ \mathbf{if}\;t_0 \leq -1:\\ \;\;\;\;\mathsf{copysign}\left(\log \left(\left|x\right| + \mathsf{hypot}\left(1, x\right)\right), x\right)\\ \mathbf{elif}\;t_0 \leq 0.004999999888241291:\\ \;\;\;\;\mathsf{copysign}\left(\mathsf{fma}\left(-0.041666666666666664, \left(\frac{3}{t_1} + \frac{3}{{t_1}^{2}}\right) \cdot {x}^{4}, \mathsf{fma}\left(0.5, \frac{x \cdot x}{t_1}, \mathsf{log1p}\left(\left|x\right|\right)\right)\right), x\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{copysign}\left(\mathsf{log1p}\left(-1 + \left(x + \mathsf{hypot}\left(1, x\right)\right)\right), x\right)\\ \end{array} \]
Alternative 2
Accuracy99.1%
Cost46152
\[\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(\left|x\right| + \mathsf{hypot}\left(1, x\right)\right), x\right)\\ \mathbf{elif}\;t_0 \leq 0.004999999888241291:\\ \;\;\;\;\mathsf{copysign}\left(\mathsf{fma}\left({x}^{4}, \frac{-0.125}{x + 1} + \frac{-0.125}{{\left(x + 1\right)}^{2}}, \mathsf{fma}\left(0.5, \frac{x \cdot x}{x + 1}, \mathsf{log1p}\left(x\right)\right)\right), x\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{copysign}\left(\mathsf{log1p}\left(-1 + \left(x + \mathsf{hypot}\left(1, x\right)\right)\right), x\right)\\ \end{array} \]
Alternative 3
Accuracy99.4%
Cost42504
\[\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.019999999552965164:\\ \;\;\;\;\mathsf{copysign}\left(\log \left(\left|x\right| + \mathsf{hypot}\left(1, x\right)\right), x\right)\\ \mathbf{elif}\;t_0 \leq 0.004999999888241291:\\ \;\;\;\;\mathsf{copysign}\left(\mathsf{fma}\left(0.5, \frac{x \cdot x}{\left|x\right| + 1}, \mathsf{log1p}\left(\left|x\right|\right)\right), x\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{copysign}\left(\mathsf{log1p}\left(-1 + \left(x + \mathsf{hypot}\left(1, x\right)\right)\right), x\right)\\ \end{array} \]
Alternative 4
Accuracy99.4%
Cost36104
\[\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.009999999776482582:\\ \;\;\;\;\mathsf{copysign}\left(\log \left(\left|x\right| + \mathsf{hypot}\left(1, x\right)\right), x\right)\\ \mathbf{elif}\;t_0 \leq 0.004999999888241291:\\ \;\;\;\;\mathsf{copysign}\left(\mathsf{fma}\left(0.5, \frac{x \cdot x}{x + 1}, \mathsf{log1p}\left(x\right)\right), x\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{copysign}\left(\mathsf{log1p}\left(-1 + \left(x + \mathsf{hypot}\left(1, x\right)\right)\right), x\right)\\ \end{array} \]
Alternative 5
Accuracy99.4%
Cost10056
\[\begin{array}{l} \mathbf{if}\;x \leq -0.019999999552965164:\\ \;\;\;\;\mathsf{copysign}\left(\log \left(\frac{1}{\mathsf{hypot}\left(1, x\right) - x}\right), x\right)\\ \mathbf{elif}\;x \leq 0.004999999888241291:\\ \;\;\;\;\mathsf{copysign}\left(\mathsf{fma}\left(0.5, \frac{x \cdot x}{x + 1}, \mathsf{log1p}\left(x\right)\right), x\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{copysign}\left(\mathsf{log1p}\left(-1 + \left(x + \mathsf{hypot}\left(1, x\right)\right)\right), x\right)\\ \end{array} \]
Alternative 6
Accuracy98.1%
Cost9960
\[\begin{array}{l} \mathbf{if}\;x \leq -0.009999999776482582:\\ \;\;\;\;\mathsf{copysign}\left(\log \left(\frac{1}{\mathsf{hypot}\left(1, x\right) - x}\right), x\right)\\ \mathbf{elif}\;x \leq 3.9999998989515007 \cdot 10^{-5}:\\ \;\;\;\;\mathsf{copysign}\left(\mathsf{log1p}\left(x\right), x\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{copysign}\left(\mathsf{log1p}\left(-1 + \left(x + \mathsf{hypot}\left(1, x\right)\right)\right), x\right)\\ \end{array} \]
Alternative 7
Accuracy96.8%
Cost9896
\[\begin{array}{l} \mathbf{if}\;x \leq -1:\\ \;\;\;\;\mathsf{copysign}\left(\log \left(\left|x\right| - x\right), x\right)\\ \mathbf{elif}\;x \leq 3.9999998989515007 \cdot 10^{-5}:\\ \;\;\;\;\mathsf{copysign}\left(\mathsf{log1p}\left(\left|x\right|\right), x\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{copysign}\left(\log \left(x + \mathsf{hypot}\left(1, x\right)\right), x\right)\\ \end{array} \]
Alternative 8
Accuracy98.1%
Cost9896
\[\begin{array}{l} \mathbf{if}\;x \leq -0.009999999776482582:\\ \;\;\;\;\mathsf{copysign}\left(\log \left(\frac{1}{\mathsf{hypot}\left(1, x\right) - x}\right), x\right)\\ \mathbf{elif}\;x \leq 3.9999998989515007 \cdot 10^{-5}:\\ \;\;\;\;\mathsf{copysign}\left(\mathsf{log1p}\left(x\right), x\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{copysign}\left(\log \left(x + \mathsf{hypot}\left(1, x\right)\right), x\right)\\ \end{array} \]
Alternative 9
Accuracy95.8%
Cost9800
\[\begin{array}{l} \mathbf{if}\;x \leq -1:\\ \;\;\;\;\mathsf{copysign}\left(\log \left(\frac{-0.5}{x}\right), x\right)\\ \mathbf{elif}\;x \leq 0.004999999888241291:\\ \;\;\;\;\mathsf{copysign}\left(\mathsf{log1p}\left(\left|x\right|\right), x\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{copysign}\left(\log \left(x + \left(x + \frac{0.5}{x}\right)\right), x\right)\\ \end{array} \]
Alternative 10
Accuracy95.5%
Cost9800
\[\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.004999999888241291:\\ \;\;\;\;\mathsf{copysign}\left(\mathsf{log1p}\left(\left|x\right|\right), x\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{copysign}\left(\log \left(x + \left(x + \frac{0.5}{x}\right)\right), x\right)\\ \end{array} \]
Alternative 11
Accuracy95.7%
Cost6792
\[\begin{array}{l} \mathbf{if}\;x \leq -1:\\ \;\;\;\;\mathsf{copysign}\left(\log \left(\frac{-0.5}{x}\right), x\right)\\ \mathbf{elif}\;x \leq 0.004999999888241291:\\ \;\;\;\;\mathsf{copysign}\left(\mathsf{log1p}\left(x\right), x\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{copysign}\left(\log \left(x + \left(x + \frac{0.5}{x}\right)\right), x\right)\\ \end{array} \]
Alternative 12
Accuracy81.8%
Cost6664
\[\begin{array}{l} \mathbf{if}\;x \leq -1:\\ \;\;\;\;\mathsf{copysign}\left(\log \left(-x\right), x\right)\\ \mathbf{elif}\;x \leq 0.004999999888241291:\\ \;\;\;\;\mathsf{copysign}\left(\mathsf{log1p}\left(x\right), x\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{copysign}\left(\log \left(x + x\right), x\right)\\ \end{array} \]
Alternative 13
Accuracy95.4%
Cost6664
\[\begin{array}{l} \mathbf{if}\;x \leq -1:\\ \;\;\;\;\mathsf{copysign}\left(\log \left(\frac{-0.5}{x}\right), x\right)\\ \mathbf{elif}\;x \leq 0.004999999888241291:\\ \;\;\;\;\mathsf{copysign}\left(\mathsf{log1p}\left(x\right), x\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{copysign}\left(\log \left(x + x\right), x\right)\\ \end{array} \]
Alternative 14
Accuracy68.8%
Cost6564
\[\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} \]
Alternative 15
Accuracy5.5%
Cost6464
\[\mathsf{copysign}\left(\log 0, x\right) \]
Alternative 16
Accuracy57.6%
Cost6464
\[\mathsf{copysign}\left(\mathsf{log1p}\left(x\right), x\right) \]

Reproduce?

herbie shell --seed 2023277 
(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))