?

Average Error: 20.5 → 12.8
Time: 13.4s
Precision: binary32
Cost: 56040

?

\[\mathsf{copysign}\left(\log \left(\left|x\right| + \sqrt{x \cdot x + 1}\right), x\right) \]
\[\begin{array}{l} t_0 := \left|x\right| - -1\\ t_1 := \frac{0.25}{{x}^{3}}\\ t_2 := \mathsf{copysign}\left(\log \left(\left|x\right| + \sqrt{x \cdot x + 1}\right), x\right)\\ \mathbf{if}\;t_2 \leq -2:\\ \;\;\;\;\mathsf{copysign}\left(\log \left(0.5 \cdot \left(t_1 - \frac{1}{x}\right)\right), x\right)\\ \mathbf{elif}\;t_2 \leq 0.10000000149011612:\\ \;\;\;\;\mathsf{copysign}\left(0.5 \cdot \frac{{x}^{2}}{t_0} + \left(\log t_0 + \left(3 \cdot \left(\frac{1}{{t_0}^{2}} + \frac{1}{t_0}\right)\right) \cdot \left(-0.041666666666666664 \cdot {x}^{4}\right)\right), x\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{copysign}\left(\log \left({\left(\sqrt{\frac{\frac{1}{x} - t_1}{2}}\right)}^{2}\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 (- (fabs x) -1.0))
        (t_1 (/ 0.25 (pow x 3.0)))
        (t_2 (copysign (log (+ (fabs x) (sqrt (+ (* x x) 1.0)))) x)))
   (if (<= t_2 -2.0)
     (copysign (log (* 0.5 (- t_1 (/ 1.0 x)))) x)
     (if (<= t_2 0.10000000149011612)
       (copysign
        (+
         (* 0.5 (/ (pow x 2.0) t_0))
         (+
          (log t_0)
          (*
           (* 3.0 (+ (/ 1.0 (pow t_0 2.0)) (/ 1.0 t_0)))
           (* -0.041666666666666664 (pow x 4.0)))))
        x)
       (copysign (log (pow (sqrt (/ (- (/ 1.0 x) t_1) 2.0)) 2.0)) x)))))
float code(float x) {
	return copysignf(logf((fabsf(x) + sqrtf(((x * x) + 1.0f)))), x);
}
float code(float x) {
	float t_0 = fabsf(x) - -1.0f;
	float t_1 = 0.25f / powf(x, 3.0f);
	float t_2 = copysignf(logf((fabsf(x) + sqrtf(((x * x) + 1.0f)))), x);
	float tmp;
	if (t_2 <= -2.0f) {
		tmp = copysignf(logf((0.5f * (t_1 - (1.0f / x)))), x);
	} else if (t_2 <= 0.10000000149011612f) {
		tmp = copysignf(((0.5f * (powf(x, 2.0f) / t_0)) + (logf(t_0) + ((3.0f * ((1.0f / powf(t_0, 2.0f)) + (1.0f / t_0))) * (-0.041666666666666664f * powf(x, 4.0f))))), x);
	} else {
		tmp = copysignf(logf(powf(sqrtf((((1.0f / x) - t_1) / 2.0f)), 2.0f)), 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 = Float32(abs(x) - Float32(-1.0))
	t_1 = Float32(Float32(0.25) / (x ^ Float32(3.0)))
	t_2 = copysign(log(Float32(abs(x) + sqrt(Float32(Float32(x * x) + Float32(1.0))))), x)
	tmp = Float32(0.0)
	if (t_2 <= Float32(-2.0))
		tmp = copysign(log(Float32(Float32(0.5) * Float32(t_1 - Float32(Float32(1.0) / x)))), x);
	elseif (t_2 <= Float32(0.10000000149011612))
		tmp = copysign(Float32(Float32(Float32(0.5) * Float32((x ^ Float32(2.0)) / t_0)) + Float32(log(t_0) + Float32(Float32(Float32(3.0) * Float32(Float32(Float32(1.0) / (t_0 ^ Float32(2.0))) + Float32(Float32(1.0) / t_0))) * Float32(Float32(-0.041666666666666664) * (x ^ Float32(4.0)))))), x);
	else
		tmp = copysign(log((sqrt(Float32(Float32(Float32(Float32(1.0) / x) - t_1) / Float32(2.0))) ^ Float32(2.0))), 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 = abs(x) - single(-1.0);
	t_1 = single(0.25) / (x ^ single(3.0));
	t_2 = sign(x) * abs(log((abs(x) + sqrt(((x * x) + single(1.0))))));
	tmp = single(0.0);
	if (t_2 <= single(-2.0))
		tmp = sign(x) * abs(log((single(0.5) * (t_1 - (single(1.0) / x)))));
	elseif (t_2 <= single(0.10000000149011612))
		tmp = sign(x) * abs(((single(0.5) * ((x ^ single(2.0)) / t_0)) + (log(t_0) + ((single(3.0) * ((single(1.0) / (t_0 ^ single(2.0))) + (single(1.0) / t_0))) * (single(-0.041666666666666664) * (x ^ single(4.0)))))));
	else
		tmp = sign(x) * abs(log((sqrt((((single(1.0) / x) - t_1) / single(2.0))) ^ single(2.0))));
	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 := \left|x\right| - -1\\
t_1 := \frac{0.25}{{x}^{3}}\\
t_2 := \mathsf{copysign}\left(\log \left(\left|x\right| + \sqrt{x \cdot x + 1}\right), x\right)\\
\mathbf{if}\;t_2 \leq -2:\\
\;\;\;\;\mathsf{copysign}\left(\log \left(0.5 \cdot \left(t_1 - \frac{1}{x}\right)\right), x\right)\\

\mathbf{elif}\;t_2 \leq 0.10000000149011612:\\
\;\;\;\;\mathsf{copysign}\left(0.5 \cdot \frac{{x}^{2}}{t_0} + \left(\log t_0 + \left(3 \cdot \left(\frac{1}{{t_0}^{2}} + \frac{1}{t_0}\right)\right) \cdot \left(-0.041666666666666664 \cdot {x}^{4}\right)\right), x\right)\\

\mathbf{else}:\\
\;\;\;\;\mathsf{copysign}\left(\log \left({\left(\sqrt{\frac{\frac{1}{x} - t_1}{2}}\right)}^{2}\right), x\right)\\


\end{array}

Error?

Target

Original20.5
Target0.2
Herbie12.8
\[\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) < -2

    1. Initial program 16.2

      \[\mathsf{copysign}\left(\log \left(\left|x\right| + \sqrt{x \cdot x + 1}\right), x\right) \]
    2. Taylor expanded in x around -inf 0.3

      \[\leadsto \mathsf{copysign}\left(\log \color{blue}{\left(\left(0.125 \cdot \frac{1}{{x}^{3}} + \left(\left|x\right| + -1 \cdot x\right)\right) - 0.5 \cdot \frac{1}{x}\right)}, x\right) \]
    3. Simplified0.3

      \[\leadsto \mathsf{copysign}\left(\log \color{blue}{\left(\left(\left|x\right| + \left(-x\right)\right) + \left(0.125 \cdot \frac{1}{{x}^{3}} - 0.5 \cdot \frac{1}{x}\right)\right)}, x\right) \]
      Proof

      [Start]0.3

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

      rational.json-simplify-48 [=>]0.3

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

      rational.json-simplify-2 [=>]0.3

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

      rational.json-simplify-8 [<=]0.3

      \[ \mathsf{copysign}\left(\log \left(\left(\left|x\right| + \color{blue}{\left(-x\right)}\right) + \left(0.125 \cdot \frac{1}{{x}^{3}} - 0.5 \cdot \frac{1}{x}\right)\right), x\right) \]
    4. Taylor expanded in x around 0 0.2

      \[\leadsto \mathsf{copysign}\left(\log \color{blue}{\left(0.125 \cdot \frac{1}{{x}^{3}} - 0.5 \cdot \frac{1}{x}\right)}, x\right) \]
    5. Simplified0.2

      \[\leadsto \mathsf{copysign}\left(\log \color{blue}{\left(0.5 \cdot \left(\frac{0.25}{{x}^{3}} - \frac{1}{x}\right)\right)}, x\right) \]
      Proof

      [Start]0.2

      \[ \mathsf{copysign}\left(\log \left(0.125 \cdot \frac{1}{{x}^{3}} - 0.5 \cdot \frac{1}{x}\right), x\right) \]

      rational.json-simplify-6 [<=]0.2

      \[ \mathsf{copysign}\left(\log \left(0.125 \cdot \color{blue}{\left(1 \cdot \frac{1}{{x}^{3}}\right)} - 0.5 \cdot \frac{1}{x}\right), x\right) \]

      rational.json-simplify-2 [=>]0.2

      \[ \mathsf{copysign}\left(\log \left(0.125 \cdot \color{blue}{\left(\frac{1}{{x}^{3}} \cdot 1\right)} - 0.5 \cdot \frac{1}{x}\right), x\right) \]

      metadata-eval [<=]0.2

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

      rational.json-simplify-51 [<=]0.2

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

      rational.json-simplify-2 [=>]0.2

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

      rational.json-simplify-2 [<=]0.2

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

      rational.json-simplify-51 [=>]0.2

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

      rational.json-simplify-43 [=>]0.2

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

      metadata-eval [<=]0.2

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

      rational.json-simplify-49 [<=]0.2

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

      rational.json-simplify-51 [<=]0.2

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

      rational.json-simplify-2 [<=]0.2

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

      rational.json-simplify-2 [=>]0.2

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

      rational.json-simplify-51 [=>]0.2

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

      metadata-eval [=>]0.2

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

      rational.json-simplify-2 [<=]0.2

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

      rational.json-simplify-6 [=>]0.2

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

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

    1. Initial program 25.0

      \[\mathsf{copysign}\left(\log \left(\left|x\right| + \sqrt{x \cdot x + 1}\right), x\right) \]
    2. Taylor expanded in x around 0 25.0

      \[\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) \]
    3. Simplified25.0

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

      [Start]25.0

      \[ \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) \]

      rational.json-simplify-41 [=>]25.0

      \[ \mathsf{copysign}\left(\color{blue}{0.5 \cdot \frac{{x}^{2}}{1 + \left|x\right|} + \left(\log \left(1 + \left|x\right|\right) + -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)\right)}, x\right) \]

      rational.json-simplify-17 [=>]25.0

      \[ \mathsf{copysign}\left(0.5 \cdot \frac{{x}^{2}}{\color{blue}{\left|x\right| - -1}} + \left(\log \left(1 + \left|x\right|\right) + -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)\right), x\right) \]

      rational.json-simplify-17 [=>]25.0

      \[ \mathsf{copysign}\left(0.5 \cdot \frac{{x}^{2}}{\left|x\right| - -1} + \left(\log \color{blue}{\left(\left|x\right| - -1\right)} + -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)\right), x\right) \]

      rational.json-simplify-43 [=>]25.0

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

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

    1. Initial program 15.8

      \[\mathsf{copysign}\left(\log \left(\left|x\right| + \sqrt{x \cdot x + 1}\right), x\right) \]
    2. Taylor expanded in x around -inf 31.9

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

      \[\leadsto \mathsf{copysign}\left(\log \color{blue}{\left(\left(\left|x\right| + \left(-x\right)\right) + \left(0.125 \cdot \frac{1}{{x}^{3}} - 0.5 \cdot \frac{1}{x}\right)\right)}, x\right) \]
      Proof

      [Start]31.9

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

      rational.json-simplify-48 [=>]31.9

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

      rational.json-simplify-2 [=>]31.9

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

      rational.json-simplify-8 [<=]31.9

      \[ \mathsf{copysign}\left(\log \left(\left(\left|x\right| + \color{blue}{\left(-x\right)}\right) + \left(0.125 \cdot \frac{1}{{x}^{3}} - 0.5 \cdot \frac{1}{x}\right)\right), x\right) \]
    4. Taylor expanded in x around 0 31.9

      \[\leadsto \mathsf{copysign}\left(\log \color{blue}{\left(0.125 \cdot \frac{1}{{x}^{3}} - 0.5 \cdot \frac{1}{x}\right)}, x\right) \]
    5. Simplified31.9

      \[\leadsto \mathsf{copysign}\left(\log \color{blue}{\left(0.5 \cdot \left(\frac{0.25}{{x}^{3}} - \frac{1}{x}\right)\right)}, x\right) \]
      Proof

      [Start]31.9

      \[ \mathsf{copysign}\left(\log \left(0.125 \cdot \frac{1}{{x}^{3}} - 0.5 \cdot \frac{1}{x}\right), x\right) \]

      rational.json-simplify-6 [<=]31.9

      \[ \mathsf{copysign}\left(\log \left(0.125 \cdot \color{blue}{\left(1 \cdot \frac{1}{{x}^{3}}\right)} - 0.5 \cdot \frac{1}{x}\right), x\right) \]

      rational.json-simplify-2 [=>]31.9

      \[ \mathsf{copysign}\left(\log \left(0.125 \cdot \color{blue}{\left(\frac{1}{{x}^{3}} \cdot 1\right)} - 0.5 \cdot \frac{1}{x}\right), x\right) \]

      metadata-eval [<=]31.9

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

      rational.json-simplify-51 [<=]31.9

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

      rational.json-simplify-2 [=>]31.9

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

      rational.json-simplify-2 [<=]31.9

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

      rational.json-simplify-51 [=>]31.9

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

      rational.json-simplify-43 [=>]31.9

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

      metadata-eval [<=]31.9

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

      rational.json-simplify-49 [<=]31.9

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

      rational.json-simplify-51 [<=]31.9

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

      rational.json-simplify-2 [<=]31.9

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

      rational.json-simplify-2 [=>]31.9

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

      rational.json-simplify-51 [=>]31.9

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

      metadata-eval [=>]31.9

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

      rational.json-simplify-2 [<=]31.9

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

      rational.json-simplify-6 [=>]31.9

      \[ \mathsf{copysign}\left(\log \left(0.5 \cdot \frac{\color{blue}{\frac{1}{{x}^{3}}}}{4} - 0.5 \cdot \frac{1}{x}\right), x\right) \]
    6. Applied egg-rr14.4

      \[\leadsto \mathsf{copysign}\left(\color{blue}{0.5 \cdot \log \left({\left(\frac{\frac{1}{x} - \frac{0.25}{{x}^{3}}}{2}\right)}^{2}\right)}, x\right) \]
    7. Simplified1.0

      \[\leadsto \mathsf{copysign}\left(\color{blue}{\log \left({\left(\sqrt{\frac{\frac{1}{x} - \frac{0.25}{{x}^{3}}}{2}}\right)}^{2}\right)}, x\right) \]
      Proof

      [Start]14.4

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

      exponential.json-simplify-13 [=>]14.4

      \[ \mathsf{copysign}\left(\color{blue}{\log \left(\sqrt{{\left(\frac{\frac{1}{x} - \frac{0.25}{{x}^{3}}}{2}\right)}^{2}}\right)}, x\right) \]

      exponential.json-simplify-23 [=>]1.0

      \[ \mathsf{copysign}\left(\log \color{blue}{\left({\left(\sqrt{\frac{\frac{1}{x} - \frac{0.25}{{x}^{3}}}{2}}\right)}^{2}\right)}, x\right) \]
  3. Recombined 3 regimes into one program.
  4. Final simplification12.8

    \[\leadsto \begin{array}{l} \mathbf{if}\;\mathsf{copysign}\left(\log \left(\left|x\right| + \sqrt{x \cdot x + 1}\right), x\right) \leq -2:\\ \;\;\;\;\mathsf{copysign}\left(\log \left(0.5 \cdot \left(\frac{0.25}{{x}^{3}} - \frac{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.10000000149011612:\\ \;\;\;\;\mathsf{copysign}\left(0.5 \cdot \frac{{x}^{2}}{\left|x\right| - -1} + \left(\log \left(\left|x\right| - -1\right) + \left(3 \cdot \left(\frac{1}{{\left(\left|x\right| - -1\right)}^{2}} + \frac{1}{\left|x\right| - -1}\right)\right) \cdot \left(-0.041666666666666664 \cdot {x}^{4}\right)\right), x\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{copysign}\left(\log \left({\left(\sqrt{\frac{\frac{1}{x} - \frac{0.25}{{x}^{3}}}{2}}\right)}^{2}\right), x\right)\\ \end{array} \]

Alternatives

Alternative 1
Error12.6
Cost16520
\[\begin{array}{l} \mathbf{if}\;x \leq -3.999999992202579 \cdot 10^{+19}:\\ \;\;\;\;\mathsf{copysign}\left(\log \left(\frac{-0.5}{x}\right), x\right)\\ \mathbf{elif}\;x \leq 20:\\ \;\;\;\;\mathsf{copysign}\left(\log \left(\left|x\right| + \sqrt{x \cdot x + 1}\right), x\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{copysign}\left(\log \left({\left(\sqrt{\frac{\frac{1}{x} - \frac{0.25}{{x}^{3}}}{2}}\right)}^{2}\right), x\right)\\ \end{array} \]
Alternative 2
Error12.6
Cost13192
\[\begin{array}{l} \mathbf{if}\;x \leq -3.999999992202579 \cdot 10^{+19}:\\ \;\;\;\;\mathsf{copysign}\left(\log \left(\frac{-0.5}{x}\right), x\right)\\ \mathbf{elif}\;x \leq 100:\\ \;\;\;\;\mathsf{copysign}\left(\log \left(\left|x\right| + \sqrt{x \cdot x + 1}\right), x\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{copysign}\left(\log \left(\frac{0.5}{x} - 0.125 \cdot \frac{1}{{x}^{3}}\right), x\right)\\ \end{array} \]
Alternative 3
Error13.3
Cost10088
\[\begin{array}{l} \mathbf{if}\;x \leq -2:\\ \;\;\;\;\mathsf{copysign}\left(\log \left(0.5 \cdot \left(\frac{0.25}{{x}^{3}} - \frac{1}{x}\right)\right), x\right)\\ \mathbf{elif}\;x \leq 0.10000000149011612:\\ \;\;\;\;\mathsf{copysign}\left(\log \left(\left|x\right| - -1\right), x\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{copysign}\left(\log \left(\frac{0.5}{x} - 0.125 \cdot \frac{1}{{x}^{3}}\right), x\right)\\ \end{array} \]
Alternative 4
Error13.5
Cost10056
\[\begin{array}{l} \mathbf{if}\;x \leq -2:\\ \;\;\;\;\mathsf{copysign}\left(\log \left(\frac{-0.5}{x}\right), x\right)\\ \mathbf{elif}\;x \leq 0.10000000149011612:\\ \;\;\;\;\mathsf{copysign}\left(\log \left(\left|x\right| - -1\right), x\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{copysign}\left(\log \left(\left|x\right| + \left(0.5 \cdot \frac{1}{x} + x\right)\right), x\right)\\ \end{array} \]
Alternative 5
Error13.4
Cost10056
\[\begin{array}{l} \mathbf{if}\;x \leq -2:\\ \;\;\;\;\mathsf{copysign}\left(\log \left(0.5 \cdot \left(\frac{0.25}{{x}^{3}} - \frac{1}{x}\right)\right), x\right)\\ \mathbf{elif}\;x \leq 0.10000000149011612:\\ \;\;\;\;\mathsf{copysign}\left(\log \left(\left|x\right| - -1\right), x\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{copysign}\left(\log \left(\left|x\right| + \left(0.5 \cdot \frac{1}{x} + x\right)\right), x\right)\\ \end{array} \]
Alternative 6
Error13.6
Cost9864
\[\begin{array}{l} \mathbf{if}\;x \leq -2:\\ \;\;\;\;\mathsf{copysign}\left(\log \left(\frac{-0.5}{x}\right), x\right)\\ \mathbf{elif}\;x \leq 0.10000000149011612:\\ \;\;\;\;\mathsf{copysign}\left(\log \left(\left|x\right| - -1\right), x\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{copysign}\left(\log \left(\left|x\right| + x\right), x\right)\\ \end{array} \]
Alternative 7
Error15.0
Cost9796
\[\begin{array}{l} \mathbf{if}\;x \leq -2.0000000102211272 \cdot 10^{-38}:\\ \;\;\;\;\mathsf{copysign}\left(\log \left(\frac{-0.5}{x}\right), x\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{copysign}\left(\log \left(\left|x\right| + x\right), x\right)\\ \end{array} \]
Alternative 8
Error19.1
Cost6596
\[\begin{array}{l} \mathbf{if}\;x \leq -2.0000000102211272 \cdot 10^{-38}:\\ \;\;\;\;\mathsf{copysign}\left(\log \left(\frac{-0.5}{x}\right), x\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{copysign}\left(\log x, x\right)\\ \end{array} \]
Alternative 9
Error23.3
Cost6564
\[\begin{array}{l} \mathbf{if}\;x \leq -2.0000000102211272 \cdot 10^{-38}:\\ \;\;\;\;\mathsf{copysign}\left(\log \left(-x\right), x\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{copysign}\left(\log x, x\right)\\ \end{array} \]
Alternative 10
Error27.6
Cost6464
\[\mathsf{copysign}\left(\log x, x\right) \]

Error

Reproduce?

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