Rust f32::asinh

?

Percentage Accurate: 38.0% → 99.5%
Time: 7.4s
Precision: binary32
Cost: 36168

?

\[\mathsf{copysign}\left(\log \left(\left|x\right| + \sqrt{x \cdot x + 1}\right), x\right) \]
\[\begin{array}{l} t_0 := \mathsf{copysign}\left(\log \left(\left|x\right| + \sqrt{x \cdot x + 1}\right), x\right)\\ \mathbf{if}\;t_0 \leq -0.4000000059604645:\\ \;\;\;\;\mathsf{copysign}\left(-\log \left(\mathsf{hypot}\left(1, x\right) - x\right), x\right)\\ \mathbf{elif}\;t_0 \leq 0.019999999552965164:\\ \;\;\;\;\mathsf{copysign}\left(-0.16666666666666666 \cdot {x}^{3} + \left(x + 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} \]
(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)))
   (if (<= t_0 -0.4000000059604645)
     (copysign (- (log (- (hypot 1.0 x) x))) x)
     (if (<= t_0 0.019999999552965164)
       (copysign
        (+ (* -0.16666666666666666 (pow x 3.0)) (+ x (* 0.075 (pow x 5.0))))
        x)
       (copysign (log (+ 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 tmp;
	if (t_0 <= -0.4000000059604645f) {
		tmp = copysignf(-logf((hypotf(1.0f, x) - x)), x);
	} else if (t_0 <= 0.019999999552965164f) {
		tmp = copysignf(((-0.16666666666666666f * powf(x, 3.0f)) + (x + (0.075f * powf(x, 5.0f)))), x);
	} else {
		tmp = copysignf(logf((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)
	tmp = Float32(0.0)
	if (t_0 <= Float32(-0.4000000059604645))
		tmp = copysign(Float32(-log(Float32(hypot(Float32(1.0), x) - x))), x);
	elseif (t_0 <= Float32(0.019999999552965164))
		tmp = copysign(Float32(Float32(Float32(-0.16666666666666666) * (x ^ Float32(3.0))) + Float32(x + 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 = code(x)
	tmp = sign(x) * abs(log((abs(x) + sqrt(((x * x) + single(1.0))))));
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.4000000059604645))
		tmp = sign(x) * abs(-log((hypot(single(1.0), x) - x)));
	elseif (t_0 <= single(0.019999999552965164))
		tmp = sign(x) * abs(((single(-0.16666666666666666) * (x ^ single(3.0))) + (x + (single(0.075) * (x ^ single(5.0))))));
	else
		tmp = sign(x) * abs(log((x + hypot(single(1.0), x))));
	end
	tmp_2 = 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)\\
\mathbf{if}\;t_0 \leq -0.4000000059604645:\\
\;\;\;\;\mathsf{copysign}\left(-\log \left(\mathsf{hypot}\left(1, x\right) - x\right), x\right)\\

\mathbf{elif}\;t_0 \leq 0.019999999552965164:\\
\;\;\;\;\mathsf{copysign}\left(-0.16666666666666666 \cdot {x}^{3} + \left(x + 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}

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 14 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

Original38.0%
Target99.6%
Herbie99.5%
\[\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) < -0.400000006

    1. Initial program 50.8%

      \[\mathsf{copysign}\left(\log \left(\left|x\right| + \sqrt{x \cdot x + 1}\right), x\right) \]
    2. Applied egg-rr12.1%

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

      [Start]50.8%

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

      +-commutative [=>]50.8%

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

      add-sqr-sqrt [=>]-0.0%

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

      fabs-sqr [=>]-0.0%

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

      add-sqr-sqrt [<=]14.3%

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

      flip-+ [=>]12.0%

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

      log-div [=>]11.9%

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

      add-sqr-sqrt [<=]12.6%

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

      fma-def [=>]12.1%

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

      +-commutative [=>]12.1%

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

      hypot-1-def [=>]12.1%

      \[ \mathsf{copysign}\left(\log \left(\mathsf{fma}\left(x, x, 1\right) - x \cdot x\right) - \log \left(\color{blue}{\mathsf{hypot}\left(1, x\right)} - x\right), x\right) \]
    3. Simplified99.9%

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

      [Start]12.1%

      \[ \mathsf{copysign}\left(\log \left(\mathsf{fma}\left(x, x, 1\right) - x \cdot x\right) - \log \left(\mathsf{hypot}\left(1, x\right) - x\right), x\right) \]

      fma-udef [=>]12.6%

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

      +-commutative [<=]12.6%

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

      associate--l+ [=>]47.4%

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

      +-inverses [=>]99.9%

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

      metadata-eval [=>]99.9%

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

      metadata-eval [=>]99.9%

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

      neg-sub0 [<=]99.9%

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

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

    1. Initial program 20.2%

      \[\mathsf{copysign}\left(\log \left(\left|x\right| + \sqrt{x \cdot x + 1}\right), x\right) \]
    2. Applied egg-rr20.2%

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

      [Start]20.2%

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

      +-commutative [=>]20.2%

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

      add-sqr-sqrt [=>]11.0%

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

      fabs-sqr [=>]11.0%

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

      add-sqr-sqrt [<=]20.4%

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

      flip-+ [=>]20.2%

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

      add-sqr-sqrt [<=]20.1%

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

      fma-def [=>]20.1%

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

      +-commutative [=>]20.1%

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

      hypot-1-def [=>]20.2%

      \[ \mathsf{copysign}\left(\log \left(\frac{\mathsf{fma}\left(x, x, 1\right) - x \cdot x}{\color{blue}{\mathsf{hypot}\left(1, x\right)} - x}\right), x\right) \]
    3. Simplified20.2%

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

      [Start]20.2%

      \[ \mathsf{copysign}\left(\log \left(\frac{\mathsf{fma}\left(x, x, 1\right) - x \cdot x}{\mathsf{hypot}\left(1, x\right) - x}\right), x\right) \]

      fma-udef [=>]20.2%

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

      +-commutative [<=]20.2%

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

      associate--l+ [=>]20.2%

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

      +-inverses [=>]20.2%

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

      metadata-eval [=>]20.2%

      \[ \mathsf{copysign}\left(\log \left(\frac{\color{blue}{1}}{\mathsf{hypot}\left(1, x\right) - x}\right), x\right) \]
    4. Taylor expanded in x around 0 100.0%

      \[\leadsto \mathsf{copysign}\left(\color{blue}{-0.16666666666666666 \cdot {x}^{3} + \left(0.075 \cdot {x}^{5} + x\right)}, x\right) \]

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

    1. Initial program 56.3%

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

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

      [Start]56.3%

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

      *-un-lft-identity [=>]56.3%

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

      *-commutative [=>]56.3%

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

      log-prod [=>]56.3%

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

      add-sqr-sqrt [=>]56.3%

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

      fabs-sqr [=>]56.3%

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

      add-sqr-sqrt [<=]56.3%

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

      +-commutative [=>]56.3%

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

      hypot-1-def [=>]99.9%

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

      metadata-eval [=>]99.9%

      \[ \mathsf{copysign}\left(\log \left(x + \mathsf{hypot}\left(1, x\right)\right) + \color{blue}{0}, x\right) \]
    3. Simplified99.9%

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

      [Start]99.9%

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

      +-rgt-identity [=>]99.9%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\mathsf{copysign}\left(\log \left(\left|x\right| + \sqrt{x \cdot x + 1}\right), x\right) \leq -0.4000000059604645:\\ \;\;\;\;\mathsf{copysign}\left(-\log \left(\mathsf{hypot}\left(1, x\right) - x\right), x\right)\\ \mathbf{elif}\;\mathsf{copysign}\left(\log \left(\left|x\right| + \sqrt{x \cdot x + 1}\right), x\right) \leq 0.019999999552965164:\\ \;\;\;\;\mathsf{copysign}\left(-0.16666666666666666 \cdot {x}^{3} + \left(x + 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} \]

Alternatives

Alternative 1
Accuracy99.5%
Cost36168
\[\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.4000000059604645:\\ \;\;\;\;\mathsf{copysign}\left(-\log \left(\mathsf{hypot}\left(1, x\right) - x\right), x\right)\\ \mathbf{elif}\;t_0 \leq 0.019999999552965164:\\ \;\;\;\;\mathsf{copysign}\left(-0.16666666666666666 \cdot {x}^{3} + \left(x + 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} \]
Alternative 2
Accuracy99.0%
Cost9896
\[\begin{array}{l} \mathbf{if}\;x \leq -2:\\ \;\;\;\;\mathsf{copysign}\left(-\log \left(x \cdot -2 + 0.5 \cdot \frac{-1}{x}\right), x\right)\\ \mathbf{elif}\;x \leq 0.019999999552965164:\\ \;\;\;\;\mathsf{copysign}\left(\mathsf{fma}\left(x \cdot x, x \cdot -0.16666666666666666, x\right), x\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{copysign}\left(\log \left(x + \mathsf{hypot}\left(1, x\right)\right), x\right)\\ \end{array} \]
Alternative 3
Accuracy99.5%
Cost9896
\[\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.019999999552965164:\\ \;\;\;\;\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} \]
Alternative 4
Accuracy98.1%
Cost6820
\[\begin{array}{l} \mathbf{if}\;x \leq -2:\\ \;\;\;\;\mathsf{copysign}\left(-\log \left(x \cdot -2 + 0.5 \cdot \frac{-1}{x}\right), x\right)\\ \mathbf{elif}\;x \leq 0.019999999552965164:\\ \;\;\;\;\mathsf{copysign}\left(\mathsf{fma}\left(x \cdot x, x \cdot -0.16666666666666666, 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 5
Accuracy97.8%
Cost6792
\[\begin{array}{l} \mathbf{if}\;x \leq -2:\\ \;\;\;\;\mathsf{copysign}\left(-\log \left(x \cdot -2\right), x\right)\\ \mathbf{elif}\;x \leq 0.019999999552965164:\\ \;\;\;\;\mathsf{copysign}\left(x + -0.16666666666666666 \cdot {x}^{3}, x\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{copysign}\left(\log \left(x + \left(x + \frac{0.5}{x}\right)\right), x\right)\\ \end{array} \]
Alternative 6
Accuracy97.8%
Cost6792
\[\begin{array}{l} \mathbf{if}\;x \leq -2:\\ \;\;\;\;\mathsf{copysign}\left(-\log \left(x \cdot -2\right), x\right)\\ \mathbf{elif}\;x \leq 0.019999999552965164:\\ \;\;\;\;\mathsf{copysign}\left(\mathsf{fma}\left(x \cdot x, x \cdot -0.16666666666666666, 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 7
Accuracy97.4%
Cost6760
\[\begin{array}{l} \mathbf{if}\;x \leq -2:\\ \;\;\;\;\mathsf{copysign}\left(-\log \left(x \cdot -2\right), x\right)\\ \mathbf{elif}\;x \leq 0.019999999552965164:\\ \;\;\;\;\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} \]
Alternative 8
Accuracy78.5%
Cost6664
\[\begin{array}{l} \mathbf{if}\;x \leq -40:\\ \;\;\;\;\mathsf{copysign}\left(15.333333333333334, x\right)\\ \mathbf{elif}\;x \leq 0.019999999552965164:\\ \;\;\;\;\mathsf{copysign}\left(x, x\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{copysign}\left(\log \left(x + x\right), x\right)\\ \end{array} \]
Alternative 9
Accuracy97.0%
Cost6664
\[\begin{array}{l} \mathbf{if}\;x \leq -2:\\ \;\;\;\;\mathsf{copysign}\left(\log \left(\frac{-0.5}{x}\right), x\right)\\ \mathbf{elif}\;x \leq 0.019999999552965164:\\ \;\;\;\;\mathsf{copysign}\left(x, x\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{copysign}\left(\log \left(x + x\right), x\right)\\ \end{array} \]
Alternative 10
Accuracy96.9%
Cost6664
\[\begin{array}{l} \mathbf{if}\;x \leq -2:\\ \;\;\;\;\mathsf{copysign}\left(-\log \left(x \cdot -2\right), x\right)\\ \mathbf{elif}\;x \leq 0.019999999552965164:\\ \;\;\;\;\mathsf{copysign}\left(x, x\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{copysign}\left(\log \left(x + x\right), x\right)\\ \end{array} \]
Alternative 11
Accuracy63.7%
Cost6532
\[\begin{array}{l} \mathbf{if}\;x \leq -2:\\ \;\;\;\;\mathsf{copysign}\left(15.333333333333334, x\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{copysign}\left(\mathsf{log1p}\left(x\right), x\right)\\ \end{array} \]
Alternative 12
Accuracy61.1%
Cost3400
\[\begin{array}{l} \mathbf{if}\;x \leq -40:\\ \;\;\;\;\mathsf{copysign}\left(15.333333333333334, x\right)\\ \mathbf{elif}\;x \leq 15:\\ \;\;\;\;\mathsf{copysign}\left(x, x\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{copysign}\left(15.333333333333334, x\right)\\ \end{array} \]
Alternative 13
Accuracy17.6%
Cost3264
\[\mathsf{copysign}\left(-6, x\right) \]
Alternative 14
Accuracy18.9%
Cost3264
\[\mathsf{copysign}\left(15.333333333333334, x\right) \]

Reproduce?

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