Rust f32::asinh

Percentage Accurate: 38.2% → 99.4%
Time: 11.5s
Alternatives: 16
Speedup: 4.0×

Specification

?
\[\begin{array}{l} \\ \sinh^{-1} x \end{array} \]
(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:

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.

Accuracy vs Speed?

Herbie found 16 alternatives:

AlternativeAccuracySpeedup
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.

Initial Program: 38.2% accurate, 1.0× speedup?

\[\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
 (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}

Alternative 1: 99.4% accurate, 0.2× speedup?

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

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

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


\end{array}
\end{array}
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.5

    1. Initial program 58.7%

      \[\mathsf{copysign}\left(\log \left(\left|x\right| + \sqrt{x \cdot x + 1}\right), x\right) \]
    2. Step-by-step derivation
      1. +-commutative58.7%

        \[\leadsto \mathsf{copysign}\left(\log \left(\left|x\right| + \sqrt{\color{blue}{1 + x \cdot x}}\right), x\right) \]
      2. hypot-1-def100.0%

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

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

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

    1. Initial program 18.4%

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

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

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

        \[\leadsto \mathsf{copysign}\left(\mathsf{log1p}\left(\left|x\right|\right) + \color{blue}{\mathsf{fma}\left(-0.041666666666666664, {x}^{4} \cdot \left(3 \cdot \frac{1}{1 + \left|x\right|} + 3 \cdot \frac{1}{{\left(1 + \left|x\right|\right)}^{2}}\right), 0.5 \cdot \frac{{x}^{2}}{1 + \left|x\right|}\right)}, x\right) \]
      3. associate-*r/99.9%

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

        \[\leadsto \mathsf{copysign}\left(\mathsf{log1p}\left(\left|x\right|\right) + \mathsf{fma}\left(-0.041666666666666664, {x}^{4} \cdot \left(\frac{\color{blue}{3}}{1 + \left|x\right|} + 3 \cdot \frac{1}{{\left(1 + \left|x\right|\right)}^{2}}\right), 0.5 \cdot \frac{{x}^{2}}{1 + \left|x\right|}\right), x\right) \]
      5. associate-*r/99.9%

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

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

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

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

    1. Initial program 52.5%

      \[\mathsf{copysign}\left(\log \left(\left|x\right| + \sqrt{x \cdot x + 1}\right), x\right) \]
    2. Step-by-step derivation
      1. *-un-lft-identity52.5%

        \[\leadsto \mathsf{copysign}\left(\log \color{blue}{\left(1 \cdot \left(\left|x\right| + \sqrt{x \cdot x + 1}\right)\right)}, x\right) \]
      2. *-commutative52.5%

        \[\leadsto \mathsf{copysign}\left(\log \color{blue}{\left(\left(\left|x\right| + \sqrt{x \cdot x + 1}\right) \cdot 1\right)}, x\right) \]
      3. log-prod52.5%

        \[\leadsto \mathsf{copysign}\left(\color{blue}{\log \left(\left|x\right| + \sqrt{x \cdot x + 1}\right) + \log 1}, x\right) \]
      4. +-commutative52.5%

        \[\leadsto \mathsf{copysign}\left(\log \left(\left|x\right| + \sqrt{\color{blue}{1 + x \cdot x}}\right) + \log 1, x\right) \]
      5. hypot-1-def98.6%

        \[\leadsto \mathsf{copysign}\left(\log \left(\left|x\right| + \color{blue}{\mathsf{hypot}\left(1, x\right)}\right) + \log 1, x\right) \]
      6. add-sqr-sqrt98.6%

        \[\leadsto \mathsf{copysign}\left(\log \left(\left|\color{blue}{\sqrt{x} \cdot \sqrt{x}}\right| + \mathsf{hypot}\left(1, x\right)\right) + \log 1, x\right) \]
      7. fabs-sqr98.6%

        \[\leadsto \mathsf{copysign}\left(\log \left(\color{blue}{\sqrt{x} \cdot \sqrt{x}} + \mathsf{hypot}\left(1, x\right)\right) + \log 1, x\right) \]
      8. add-sqr-sqrt98.6%

        \[\leadsto \mathsf{copysign}\left(\log \left(\color{blue}{x} + \mathsf{hypot}\left(1, x\right)\right) + \log 1, x\right) \]
      9. metadata-eval98.6%

        \[\leadsto \mathsf{copysign}\left(\log \left(x + \mathsf{hypot}\left(1, x\right)\right) + \color{blue}{0}, x\right) \]
    3. Applied egg-rr98.6%

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

        \[\leadsto \mathsf{copysign}\left(\color{blue}{\log \left(x + \mathsf{hypot}\left(1, x\right)\right)}, x\right) \]
    5. Simplified98.6%

      \[\leadsto \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 simplification99.5%

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

Alternative 2: 99.5% accurate, 0.3× speedup?

\[\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.03999999910593033:\\ \;\;\;\;\mathsf{copysign}\left(\log \left(\left|x\right| + \mathsf{hypot}\left(1, x\right)\right), x\right)\\ \mathbf{elif}\;t_0 \leq 0.019999999552965164:\\ \;\;\;\;\mathsf{copysign}\left(\mathsf{log1p}\left(\left|x\right|\right) + 0.5 \cdot \frac{{x}^{2}}{\left|x\right| + 1}, x\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{copysign}\left(\log \left(x + \mathsf{hypot}\left(1, x\right)\right), x\right)\\ \end{array} \end{array} \]
(FPCore (x)
 :precision binary32
 (let* ((t_0 (copysign (log (+ (fabs x) (sqrt (+ (* x x) 1.0)))) x)))
   (if (<= t_0 -0.03999999910593033)
     (copysign (log (+ (fabs x) (hypot 1.0 x))) x)
     (if (<= t_0 0.019999999552965164)
       (copysign
        (+ (log1p (fabs x)) (* 0.5 (/ (pow x 2.0) (+ (fabs x) 1.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.03999999910593033f) {
		tmp = copysignf(logf((fabsf(x) + hypotf(1.0f, x))), x);
	} else if (t_0 <= 0.019999999552965164f) {
		tmp = copysignf((log1pf(fabsf(x)) + (0.5f * (powf(x, 2.0f) / (fabsf(x) + 1.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.03999999910593033))
		tmp = copysign(log(Float32(abs(x) + hypot(Float32(1.0), x))), x);
	elseif (t_0 <= Float32(0.019999999552965164))
		tmp = copysign(Float32(log1p(abs(x)) + Float32(Float32(0.5) * Float32((x ^ Float32(2.0)) / Float32(abs(x) + Float32(1.0))))), x);
	else
		tmp = copysign(log(Float32(x + hypot(Float32(1.0), x))), x);
	end
	return 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.03999999910593033:\\
\;\;\;\;\mathsf{copysign}\left(\log \left(\left|x\right| + \mathsf{hypot}\left(1, x\right)\right), x\right)\\

\mathbf{elif}\;t_0 \leq 0.019999999552965164:\\
\;\;\;\;\mathsf{copysign}\left(\mathsf{log1p}\left(\left|x\right|\right) + 0.5 \cdot \frac{{x}^{2}}{\left|x\right| + 1}, x\right)\\

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


\end{array}
\end{array}
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.0399999991

    1. Initial program 59.2%

      \[\mathsf{copysign}\left(\log \left(\left|x\right| + \sqrt{x \cdot x + 1}\right), x\right) \]
    2. Step-by-step derivation
      1. +-commutative59.2%

        \[\leadsto \mathsf{copysign}\left(\log \left(\left|x\right| + \sqrt{\color{blue}{1 + x \cdot x}}\right), x\right) \]
      2. hypot-1-def99.8%

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

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

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

    1. Initial program 17.1%

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

      \[\leadsto \mathsf{copysign}\left(\color{blue}{\log \left(1 + \left|x\right|\right) + 0.5 \cdot \frac{{x}^{2}}{1 + \left|x\right|}}, x\right) \]
    3. Step-by-step derivation
      1. log1p-def99.7%

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

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

      \[\mathsf{copysign}\left(\log \left(\left|x\right| + \sqrt{x \cdot x + 1}\right), x\right) \]
    2. Step-by-step derivation
      1. *-un-lft-identity52.9%

        \[\leadsto \mathsf{copysign}\left(\log \color{blue}{\left(1 \cdot \left(\left|x\right| + \sqrt{x \cdot x + 1}\right)\right)}, x\right) \]
      2. *-commutative52.9%

        \[\leadsto \mathsf{copysign}\left(\log \color{blue}{\left(\left(\left|x\right| + \sqrt{x \cdot x + 1}\right) \cdot 1\right)}, x\right) \]
      3. log-prod52.9%

        \[\leadsto \mathsf{copysign}\left(\color{blue}{\log \left(\left|x\right| + \sqrt{x \cdot x + 1}\right) + \log 1}, x\right) \]
      4. +-commutative52.9%

        \[\leadsto \mathsf{copysign}\left(\log \left(\left|x\right| + \sqrt{\color{blue}{1 + x \cdot x}}\right) + \log 1, x\right) \]
      5. hypot-1-def98.4%

        \[\leadsto \mathsf{copysign}\left(\log \left(\left|x\right| + \color{blue}{\mathsf{hypot}\left(1, x\right)}\right) + \log 1, x\right) \]
      6. add-sqr-sqrt98.4%

        \[\leadsto \mathsf{copysign}\left(\log \left(\left|\color{blue}{\sqrt{x} \cdot \sqrt{x}}\right| + \mathsf{hypot}\left(1, x\right)\right) + \log 1, x\right) \]
      7. fabs-sqr98.4%

        \[\leadsto \mathsf{copysign}\left(\log \left(\color{blue}{\sqrt{x} \cdot \sqrt{x}} + \mathsf{hypot}\left(1, x\right)\right) + \log 1, x\right) \]
      8. add-sqr-sqrt98.4%

        \[\leadsto \mathsf{copysign}\left(\log \left(\color{blue}{x} + \mathsf{hypot}\left(1, x\right)\right) + \log 1, x\right) \]
      9. metadata-eval98.4%

        \[\leadsto \mathsf{copysign}\left(\log \left(x + \mathsf{hypot}\left(1, x\right)\right) + \color{blue}{0}, x\right) \]
    3. Applied egg-rr98.4%

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

        \[\leadsto \mathsf{copysign}\left(\color{blue}{\log \left(x + \mathsf{hypot}\left(1, x\right)\right)}, x\right) \]
    5. Simplified98.4%

      \[\leadsto \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 simplification99.3%

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

Alternative 3: 99.3% accurate, 0.4× speedup?

\[\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.009999999776482582:\\ \;\;\;\;\mathsf{copysign}\left(\log \left(\left|x\right| + \mathsf{hypot}\left(1, x\right)\right), x\right)\\ \mathbf{elif}\;t_0 \leq 0.019999999552965164:\\ \;\;\;\;\mathsf{copysign}\left(\mathsf{log1p}\left(\left|x\right|\right) + 0.5 \cdot \left(x \cdot \frac{x}{x + 1}\right), x\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{copysign}\left(\log \left(x + \mathsf{hypot}\left(1, x\right)\right), x\right)\\ \end{array} \end{array} \]
(FPCore (x)
 :precision binary32
 (let* ((t_0 (copysign (log (+ (fabs x) (sqrt (+ (* x x) 1.0)))) x)))
   (if (<= t_0 -0.009999999776482582)
     (copysign (log (+ (fabs x) (hypot 1.0 x))) x)
     (if (<= t_0 0.019999999552965164)
       (copysign (+ (log1p (fabs x)) (* 0.5 (* x (/ x (+ x 1.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.009999999776482582f) {
		tmp = copysignf(logf((fabsf(x) + hypotf(1.0f, x))), x);
	} else if (t_0 <= 0.019999999552965164f) {
		tmp = copysignf((log1pf(fabsf(x)) + (0.5f * (x * (x / (x + 1.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.009999999776482582))
		tmp = copysign(log(Float32(abs(x) + hypot(Float32(1.0), x))), x);
	elseif (t_0 <= Float32(0.019999999552965164))
		tmp = copysign(Float32(log1p(abs(x)) + Float32(Float32(0.5) * Float32(x * Float32(x / Float32(x + Float32(1.0)))))), x);
	else
		tmp = copysign(log(Float32(x + hypot(Float32(1.0), x))), x);
	end
	return 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.009999999776482582:\\
\;\;\;\;\mathsf{copysign}\left(\log \left(\left|x\right| + \mathsf{hypot}\left(1, x\right)\right), x\right)\\

\mathbf{elif}\;t_0 \leq 0.019999999552965164:\\
\;\;\;\;\mathsf{copysign}\left(\mathsf{log1p}\left(\left|x\right|\right) + 0.5 \cdot \left(x \cdot \frac{x}{x + 1}\right), x\right)\\

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


\end{array}
\end{array}
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.00999999978

    1. Initial program 59.9%

      \[\mathsf{copysign}\left(\log \left(\left|x\right| + \sqrt{x \cdot x + 1}\right), x\right) \]
    2. Step-by-step derivation
      1. +-commutative59.9%

        \[\leadsto \mathsf{copysign}\left(\log \left(\left|x\right| + \sqrt{\color{blue}{1 + x \cdot x}}\right), x\right) \]
      2. hypot-1-def99.5%

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

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

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

    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 0 16.7%

      \[\leadsto \mathsf{copysign}\left(\color{blue}{\log \left(1 + \left|x\right|\right) + 0.5 \cdot \frac{{x}^{2}}{1 + \left|x\right|}}, x\right) \]
    3. Step-by-step derivation
      1. log1p-def99.8%

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

      \[\leadsto \mathsf{copysign}\left(\color{blue}{\mathsf{log1p}\left(\left|x\right|\right) + 0.5 \cdot \frac{{x}^{2}}{1 + \left|x\right|}}, x\right) \]
    5. Step-by-step derivation
      1. unpow299.8%

        \[\leadsto \mathsf{copysign}\left(\mathsf{log1p}\left(\left|x\right|\right) + 0.5 \cdot \frac{\color{blue}{x \cdot x}}{1 + \left|x\right|}, x\right) \]
      2. *-un-lft-identity99.8%

        \[\leadsto \mathsf{copysign}\left(\mathsf{log1p}\left(\left|x\right|\right) + 0.5 \cdot \frac{x \cdot x}{\color{blue}{1 \cdot \left(1 + \left|x\right|\right)}}, x\right) \]
      3. times-frac99.8%

        \[\leadsto \mathsf{copysign}\left(\mathsf{log1p}\left(\left|x\right|\right) + 0.5 \cdot \color{blue}{\left(\frac{x}{1} \cdot \frac{x}{1 + \left|x\right|}\right)}, x\right) \]
      4. add-sqr-sqrt53.1%

        \[\leadsto \mathsf{copysign}\left(\mathsf{log1p}\left(\left|x\right|\right) + 0.5 \cdot \left(\frac{x}{1} \cdot \frac{x}{1 + \left|\color{blue}{\sqrt{x} \cdot \sqrt{x}}\right|}\right), x\right) \]
      5. fabs-sqr53.1%

        \[\leadsto \mathsf{copysign}\left(\mathsf{log1p}\left(\left|x\right|\right) + 0.5 \cdot \left(\frac{x}{1} \cdot \frac{x}{1 + \color{blue}{\sqrt{x} \cdot \sqrt{x}}}\right), x\right) \]
      6. add-sqr-sqrt99.8%

        \[\leadsto \mathsf{copysign}\left(\mathsf{log1p}\left(\left|x\right|\right) + 0.5 \cdot \left(\frac{x}{1} \cdot \frac{x}{1 + \color{blue}{x}}\right), x\right) \]
      7. +-commutative99.8%

        \[\leadsto \mathsf{copysign}\left(\mathsf{log1p}\left(\left|x\right|\right) + 0.5 \cdot \left(\frac{x}{1} \cdot \frac{x}{\color{blue}{x + 1}}\right), x\right) \]
    6. Applied egg-rr99.8%

      \[\leadsto \mathsf{copysign}\left(\mathsf{log1p}\left(\left|x\right|\right) + 0.5 \cdot \color{blue}{\left(\frac{x}{1} \cdot \frac{x}{x + 1}\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 52.9%

      \[\mathsf{copysign}\left(\log \left(\left|x\right| + \sqrt{x \cdot x + 1}\right), x\right) \]
    2. Step-by-step derivation
      1. *-un-lft-identity52.9%

        \[\leadsto \mathsf{copysign}\left(\log \color{blue}{\left(1 \cdot \left(\left|x\right| + \sqrt{x \cdot x + 1}\right)\right)}, x\right) \]
      2. *-commutative52.9%

        \[\leadsto \mathsf{copysign}\left(\log \color{blue}{\left(\left(\left|x\right| + \sqrt{x \cdot x + 1}\right) \cdot 1\right)}, x\right) \]
      3. log-prod52.9%

        \[\leadsto \mathsf{copysign}\left(\color{blue}{\log \left(\left|x\right| + \sqrt{x \cdot x + 1}\right) + \log 1}, x\right) \]
      4. +-commutative52.9%

        \[\leadsto \mathsf{copysign}\left(\log \left(\left|x\right| + \sqrt{\color{blue}{1 + x \cdot x}}\right) + \log 1, x\right) \]
      5. hypot-1-def98.4%

        \[\leadsto \mathsf{copysign}\left(\log \left(\left|x\right| + \color{blue}{\mathsf{hypot}\left(1, x\right)}\right) + \log 1, x\right) \]
      6. add-sqr-sqrt98.4%

        \[\leadsto \mathsf{copysign}\left(\log \left(\left|\color{blue}{\sqrt{x} \cdot \sqrt{x}}\right| + \mathsf{hypot}\left(1, x\right)\right) + \log 1, x\right) \]
      7. fabs-sqr98.4%

        \[\leadsto \mathsf{copysign}\left(\log \left(\color{blue}{\sqrt{x} \cdot \sqrt{x}} + \mathsf{hypot}\left(1, x\right)\right) + \log 1, x\right) \]
      8. add-sqr-sqrt98.4%

        \[\leadsto \mathsf{copysign}\left(\log \left(\color{blue}{x} + \mathsf{hypot}\left(1, x\right)\right) + \log 1, x\right) \]
      9. metadata-eval98.4%

        \[\leadsto \mathsf{copysign}\left(\log \left(x + \mathsf{hypot}\left(1, x\right)\right) + \color{blue}{0}, x\right) \]
    3. Applied egg-rr98.4%

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

        \[\leadsto \mathsf{copysign}\left(\color{blue}{\log \left(x + \mathsf{hypot}\left(1, x\right)\right)}, x\right) \]
    5. Simplified98.4%

      \[\leadsto \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 simplification99.3%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\mathsf{copysign}\left(\log \left(\left|x\right| + \sqrt{x \cdot x + 1}\right), x\right) \leq -0.009999999776482582:\\ \;\;\;\;\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.019999999552965164:\\ \;\;\;\;\mathsf{copysign}\left(\mathsf{log1p}\left(\left|x\right|\right) + 0.5 \cdot \left(x \cdot \frac{x}{x + 1}\right), x\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{copysign}\left(\log \left(x + \mathsf{hypot}\left(1, x\right)\right), x\right)\\ \end{array} \]

Alternative 4: 99.3% accurate, 1.3× speedup?

\[\begin{array}{l} \\ \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 0.019999999552965164:\\ \;\;\;\;\mathsf{copysign}\left(\mathsf{log1p}\left(\left|x\right|\right) + 0.5 \cdot \left(x \cdot \frac{x}{x + 1}\right), x\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{copysign}\left(\log \left(x + \mathsf{hypot}\left(1, x\right)\right), x\right)\\ \end{array} \end{array} \]
(FPCore (x)
 :precision binary32
 (if (<= x -0.009999999776482582)
   (copysign (log (/ 1.0 (- (hypot 1.0 x) x))) x)
   (if (<= x 0.019999999552965164)
     (copysign (+ (log1p (fabs x)) (* 0.5 (* x (/ x (+ x 1.0))))) x)
     (copysign (log (+ x (hypot 1.0 x))) x))))
float code(float x) {
	float tmp;
	if (x <= -0.009999999776482582f) {
		tmp = copysignf(logf((1.0f / (hypotf(1.0f, x) - x))), x);
	} else if (x <= 0.019999999552965164f) {
		tmp = copysignf((log1pf(fabsf(x)) + (0.5f * (x * (x / (x + 1.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.009999999776482582))
		tmp = copysign(log(Float32(Float32(1.0) / Float32(hypot(Float32(1.0), x) - x))), x);
	elseif (x <= Float32(0.019999999552965164))
		tmp = copysign(Float32(log1p(abs(x)) + Float32(Float32(0.5) * Float32(x * Float32(x / Float32(x + Float32(1.0)))))), x);
	else
		tmp = copysign(log(Float32(x + hypot(Float32(1.0), x))), x);
	end
	return tmp
end
\begin{array}{l}

\\
\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 0.019999999552965164:\\
\;\;\;\;\mathsf{copysign}\left(\mathsf{log1p}\left(\left|x\right|\right) + 0.5 \cdot \left(x \cdot \frac{x}{x + 1}\right), x\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -0.00999999978

    1. Initial program 59.9%

      \[\mathsf{copysign}\left(\log \left(\left|x\right| + \sqrt{x \cdot x + 1}\right), x\right) \]
    2. Step-by-step derivation
      1. add-cbrt-cube42.8%

        \[\leadsto \mathsf{copysign}\left(\log \color{blue}{\left(\sqrt[3]{\left(\left(\left|x\right| + \sqrt{x \cdot x + 1}\right) \cdot \left(\left|x\right| + \sqrt{x \cdot x + 1}\right)\right) \cdot \left(\left|x\right| + \sqrt{x \cdot x + 1}\right)}\right)}, x\right) \]
      2. pow1/342.4%

        \[\leadsto \mathsf{copysign}\left(\log \color{blue}{\left({\left(\left(\left(\left|x\right| + \sqrt{x \cdot x + 1}\right) \cdot \left(\left|x\right| + \sqrt{x \cdot x + 1}\right)\right) \cdot \left(\left|x\right| + \sqrt{x \cdot x + 1}\right)\right)}^{0.3333333333333333}\right)}, x\right) \]
      3. log-pow42.3%

        \[\leadsto \mathsf{copysign}\left(\color{blue}{0.3333333333333333 \cdot \log \left(\left(\left(\left|x\right| + \sqrt{x \cdot x + 1}\right) \cdot \left(\left|x\right| + \sqrt{x \cdot x + 1}\right)\right) \cdot \left(\left|x\right| + \sqrt{x \cdot x + 1}\right)\right)}, x\right) \]
      4. pow342.4%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \log \color{blue}{\left({\left(\left|x\right| + \sqrt{x \cdot x + 1}\right)}^{3}\right)}, x\right) \]
      5. log-pow59.4%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \color{blue}{\left(3 \cdot \log \left(\left|x\right| + \sqrt{x \cdot x + 1}\right)\right)}, x\right) \]
      6. +-commutative59.4%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \left(\left|x\right| + \sqrt{\color{blue}{1 + x \cdot x}}\right)\right), x\right) \]
      7. hypot-1-def98.4%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \left(\left|x\right| + \color{blue}{\mathsf{hypot}\left(1, x\right)}\right)\right), x\right) \]
      8. add-sqr-sqrt-0.0%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \left(\left|\color{blue}{\sqrt{x} \cdot \sqrt{x}}\right| + \mathsf{hypot}\left(1, x\right)\right)\right), x\right) \]
      9. fabs-sqr-0.0%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \left(\color{blue}{\sqrt{x} \cdot \sqrt{x}} + \mathsf{hypot}\left(1, x\right)\right)\right), x\right) \]
      10. add-sqr-sqrt20.1%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \left(\color{blue}{x} + \mathsf{hypot}\left(1, x\right)\right)\right), x\right) \]
    3. Applied egg-rr20.1%

      \[\leadsto \mathsf{copysign}\left(\color{blue}{0.3333333333333333 \cdot \left(3 \cdot \log \left(x + \mathsf{hypot}\left(1, x\right)\right)\right)}, x\right) \]
    4. Step-by-step derivation
      1. flip-+19.1%

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

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \left(\frac{\color{blue}{{x}^{2}} - \mathsf{hypot}\left(1, x\right) \cdot \mathsf{hypot}\left(1, x\right)}{x - \mathsf{hypot}\left(1, x\right)}\right)\right), x\right) \]
      3. div-sub17.1%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \color{blue}{\left(\frac{{x}^{2}}{x - \mathsf{hypot}\left(1, x\right)} - \frac{\mathsf{hypot}\left(1, x\right) \cdot \mathsf{hypot}\left(1, x\right)}{x - \mathsf{hypot}\left(1, x\right)}\right)}\right), x\right) \]
      4. hypot-udef17.2%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \left(\frac{{x}^{2}}{x - \mathsf{hypot}\left(1, x\right)} - \frac{\color{blue}{\sqrt{1 \cdot 1 + x \cdot x}} \cdot \mathsf{hypot}\left(1, x\right)}{x - \mathsf{hypot}\left(1, x\right)}\right)\right), x\right) \]
      5. metadata-eval17.2%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \left(\frac{{x}^{2}}{x - \mathsf{hypot}\left(1, x\right)} - \frac{\sqrt{\color{blue}{1} + x \cdot x} \cdot \mathsf{hypot}\left(1, x\right)}{x - \mathsf{hypot}\left(1, x\right)}\right)\right), x\right) \]
      6. unpow217.2%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \left(\frac{{x}^{2}}{x - \mathsf{hypot}\left(1, x\right)} - \frac{\sqrt{1 + \color{blue}{{x}^{2}}} \cdot \mathsf{hypot}\left(1, x\right)}{x - \mathsf{hypot}\left(1, x\right)}\right)\right), x\right) \]
      7. hypot-udef17.0%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \left(\frac{{x}^{2}}{x - \mathsf{hypot}\left(1, x\right)} - \frac{\sqrt{1 + {x}^{2}} \cdot \color{blue}{\sqrt{1 \cdot 1 + x \cdot x}}}{x - \mathsf{hypot}\left(1, x\right)}\right)\right), x\right) \]
      8. metadata-eval17.0%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \left(\frac{{x}^{2}}{x - \mathsf{hypot}\left(1, x\right)} - \frac{\sqrt{1 + {x}^{2}} \cdot \sqrt{\color{blue}{1} + x \cdot x}}{x - \mathsf{hypot}\left(1, x\right)}\right)\right), x\right) \]
      9. unpow217.0%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \left(\frac{{x}^{2}}{x - \mathsf{hypot}\left(1, x\right)} - \frac{\sqrt{1 + {x}^{2}} \cdot \sqrt{1 + \color{blue}{{x}^{2}}}}{x - \mathsf{hypot}\left(1, x\right)}\right)\right), x\right) \]
      10. add-sqr-sqrt17.3%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \left(\frac{{x}^{2}}{x - \mathsf{hypot}\left(1, x\right)} - \frac{\color{blue}{1 + {x}^{2}}}{x - \mathsf{hypot}\left(1, x\right)}\right)\right), x\right) \]
      11. +-commutative17.3%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \left(\frac{{x}^{2}}{x - \mathsf{hypot}\left(1, x\right)} - \frac{\color{blue}{{x}^{2} + 1}}{x - \mathsf{hypot}\left(1, x\right)}\right)\right), x\right) \]
    5. Applied egg-rr17.3%

      \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \color{blue}{\left(\frac{{x}^{2}}{x - \mathsf{hypot}\left(1, x\right)} - \frac{{x}^{2} + 1}{x - \mathsf{hypot}\left(1, x\right)}\right)}\right), x\right) \]
    6. Step-by-step derivation
      1. div-sub20.1%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \color{blue}{\left(\frac{{x}^{2} - \left({x}^{2} + 1\right)}{x - \mathsf{hypot}\left(1, x\right)}\right)}\right), x\right) \]
      2. associate--r+56.5%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \left(\frac{\color{blue}{\left({x}^{2} - {x}^{2}\right) - 1}}{x - \mathsf{hypot}\left(1, x\right)}\right)\right), x\right) \]
      3. +-inverses98.3%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \left(\frac{\color{blue}{0} - 1}{x - \mathsf{hypot}\left(1, x\right)}\right)\right), x\right) \]
      4. metadata-eval98.3%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \left(\frac{\color{blue}{-1}}{x - \mathsf{hypot}\left(1, x\right)}\right)\right), x\right) \]
      5. metadata-eval98.3%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \left(\frac{\color{blue}{\frac{1}{-1}}}{x - \mathsf{hypot}\left(1, x\right)}\right)\right), x\right) \]
      6. metadata-eval98.3%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \left(\frac{\frac{\color{blue}{--1}}{-1}}{x - \mathsf{hypot}\left(1, x\right)}\right)\right), x\right) \]
      7. metadata-eval98.3%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \left(\frac{\frac{-\color{blue}{\left(0 - 1\right)}}{-1}}{x - \mathsf{hypot}\left(1, x\right)}\right)\right), x\right) \]
      8. +-inverses56.5%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \left(\frac{\frac{-\left(\color{blue}{\left({x}^{2} - {x}^{2}\right)} - 1\right)}{-1}}{x - \mathsf{hypot}\left(1, x\right)}\right)\right), x\right) \]
      9. associate--r+20.1%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \left(\frac{\frac{-\color{blue}{\left({x}^{2} - \left({x}^{2} + 1\right)\right)}}{-1}}{x - \mathsf{hypot}\left(1, x\right)}\right)\right), x\right) \]
      10. associate-/r*20.1%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \color{blue}{\left(\frac{-\left({x}^{2} - \left({x}^{2} + 1\right)\right)}{-1 \cdot \left(x - \mathsf{hypot}\left(1, x\right)\right)}\right)}\right), x\right) \]
      11. neg-mul-120.1%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \left(\frac{-\left({x}^{2} - \left({x}^{2} + 1\right)\right)}{\color{blue}{-\left(x - \mathsf{hypot}\left(1, x\right)\right)}}\right)\right), x\right) \]
      12. neg-mul-120.1%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \left(\frac{\color{blue}{-1 \cdot \left({x}^{2} - \left({x}^{2} + 1\right)\right)}}{-\left(x - \mathsf{hypot}\left(1, x\right)\right)}\right)\right), x\right) \]
      13. associate--r+56.5%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \left(\frac{-1 \cdot \color{blue}{\left(\left({x}^{2} - {x}^{2}\right) - 1\right)}}{-\left(x - \mathsf{hypot}\left(1, x\right)\right)}\right)\right), x\right) \]
      14. +-inverses98.3%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \left(\frac{-1 \cdot \left(\color{blue}{0} - 1\right)}{-\left(x - \mathsf{hypot}\left(1, x\right)\right)}\right)\right), x\right) \]
      15. metadata-eval98.3%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \left(\frac{-1 \cdot \color{blue}{-1}}{-\left(x - \mathsf{hypot}\left(1, x\right)\right)}\right)\right), x\right) \]
      16. metadata-eval98.3%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \left(\frac{\color{blue}{1}}{-\left(x - \mathsf{hypot}\left(1, x\right)\right)}\right)\right), x\right) \]
      17. neg-sub098.3%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \left(\frac{1}{\color{blue}{0 - \left(x - \mathsf{hypot}\left(1, x\right)\right)}}\right)\right), x\right) \]
      18. associate--r-98.3%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \left(\frac{1}{\color{blue}{\left(0 - x\right) + \mathsf{hypot}\left(1, x\right)}}\right)\right), x\right) \]
      19. neg-sub098.3%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \left(\frac{1}{\color{blue}{\left(-x\right)} + \mathsf{hypot}\left(1, x\right)}\right)\right), x\right) \]
      20. +-commutative98.3%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \left(\frac{1}{\color{blue}{\mathsf{hypot}\left(1, x\right) + \left(-x\right)}}\right)\right), x\right) \]
      21. sub-neg98.3%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \left(\frac{1}{\color{blue}{\mathsf{hypot}\left(1, x\right) - x}}\right)\right), x\right) \]
    7. Simplified98.3%

      \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \color{blue}{\left(\frac{1}{\mathsf{hypot}\left(1, x\right) - x}\right)}\right), x\right) \]
    8. Step-by-step derivation
      1. associate-*r*99.3%

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

        \[\leadsto \mathsf{copysign}\left(\color{blue}{1} \cdot \log \left(\frac{1}{\mathsf{hypot}\left(1, x\right) - x}\right), x\right) \]
      3. *-un-lft-identity99.3%

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

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

    if -0.00999999978 < x < 0.0199999996

    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 0 16.7%

      \[\leadsto \mathsf{copysign}\left(\color{blue}{\log \left(1 + \left|x\right|\right) + 0.5 \cdot \frac{{x}^{2}}{1 + \left|x\right|}}, x\right) \]
    3. Step-by-step derivation
      1. log1p-def99.8%

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

      \[\leadsto \mathsf{copysign}\left(\color{blue}{\mathsf{log1p}\left(\left|x\right|\right) + 0.5 \cdot \frac{{x}^{2}}{1 + \left|x\right|}}, x\right) \]
    5. Step-by-step derivation
      1. unpow299.8%

        \[\leadsto \mathsf{copysign}\left(\mathsf{log1p}\left(\left|x\right|\right) + 0.5 \cdot \frac{\color{blue}{x \cdot x}}{1 + \left|x\right|}, x\right) \]
      2. *-un-lft-identity99.8%

        \[\leadsto \mathsf{copysign}\left(\mathsf{log1p}\left(\left|x\right|\right) + 0.5 \cdot \frac{x \cdot x}{\color{blue}{1 \cdot \left(1 + \left|x\right|\right)}}, x\right) \]
      3. times-frac99.8%

        \[\leadsto \mathsf{copysign}\left(\mathsf{log1p}\left(\left|x\right|\right) + 0.5 \cdot \color{blue}{\left(\frac{x}{1} \cdot \frac{x}{1 + \left|x\right|}\right)}, x\right) \]
      4. add-sqr-sqrt53.1%

        \[\leadsto \mathsf{copysign}\left(\mathsf{log1p}\left(\left|x\right|\right) + 0.5 \cdot \left(\frac{x}{1} \cdot \frac{x}{1 + \left|\color{blue}{\sqrt{x} \cdot \sqrt{x}}\right|}\right), x\right) \]
      5. fabs-sqr53.1%

        \[\leadsto \mathsf{copysign}\left(\mathsf{log1p}\left(\left|x\right|\right) + 0.5 \cdot \left(\frac{x}{1} \cdot \frac{x}{1 + \color{blue}{\sqrt{x} \cdot \sqrt{x}}}\right), x\right) \]
      6. add-sqr-sqrt99.8%

        \[\leadsto \mathsf{copysign}\left(\mathsf{log1p}\left(\left|x\right|\right) + 0.5 \cdot \left(\frac{x}{1} \cdot \frac{x}{1 + \color{blue}{x}}\right), x\right) \]
      7. +-commutative99.8%

        \[\leadsto \mathsf{copysign}\left(\mathsf{log1p}\left(\left|x\right|\right) + 0.5 \cdot \left(\frac{x}{1} \cdot \frac{x}{\color{blue}{x + 1}}\right), x\right) \]
    6. Applied egg-rr99.8%

      \[\leadsto \mathsf{copysign}\left(\mathsf{log1p}\left(\left|x\right|\right) + 0.5 \cdot \color{blue}{\left(\frac{x}{1} \cdot \frac{x}{x + 1}\right)}, x\right) \]

    if 0.0199999996 < x

    1. Initial program 52.9%

      \[\mathsf{copysign}\left(\log \left(\left|x\right| + \sqrt{x \cdot x + 1}\right), x\right) \]
    2. Step-by-step derivation
      1. *-un-lft-identity52.9%

        \[\leadsto \mathsf{copysign}\left(\log \color{blue}{\left(1 \cdot \left(\left|x\right| + \sqrt{x \cdot x + 1}\right)\right)}, x\right) \]
      2. *-commutative52.9%

        \[\leadsto \mathsf{copysign}\left(\log \color{blue}{\left(\left(\left|x\right| + \sqrt{x \cdot x + 1}\right) \cdot 1\right)}, x\right) \]
      3. log-prod52.9%

        \[\leadsto \mathsf{copysign}\left(\color{blue}{\log \left(\left|x\right| + \sqrt{x \cdot x + 1}\right) + \log 1}, x\right) \]
      4. +-commutative52.9%

        \[\leadsto \mathsf{copysign}\left(\log \left(\left|x\right| + \sqrt{\color{blue}{1 + x \cdot x}}\right) + \log 1, x\right) \]
      5. hypot-1-def98.4%

        \[\leadsto \mathsf{copysign}\left(\log \left(\left|x\right| + \color{blue}{\mathsf{hypot}\left(1, x\right)}\right) + \log 1, x\right) \]
      6. add-sqr-sqrt98.4%

        \[\leadsto \mathsf{copysign}\left(\log \left(\left|\color{blue}{\sqrt{x} \cdot \sqrt{x}}\right| + \mathsf{hypot}\left(1, x\right)\right) + \log 1, x\right) \]
      7. fabs-sqr98.4%

        \[\leadsto \mathsf{copysign}\left(\log \left(\color{blue}{\sqrt{x} \cdot \sqrt{x}} + \mathsf{hypot}\left(1, x\right)\right) + \log 1, x\right) \]
      8. add-sqr-sqrt98.4%

        \[\leadsto \mathsf{copysign}\left(\log \left(\color{blue}{x} + \mathsf{hypot}\left(1, x\right)\right) + \log 1, x\right) \]
      9. metadata-eval98.4%

        \[\leadsto \mathsf{copysign}\left(\log \left(x + \mathsf{hypot}\left(1, x\right)\right) + \color{blue}{0}, x\right) \]
    3. Applied egg-rr98.4%

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

        \[\leadsto \mathsf{copysign}\left(\color{blue}{\log \left(x + \mathsf{hypot}\left(1, x\right)\right)}, x\right) \]
    5. Simplified98.4%

      \[\leadsto \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 simplification99.2%

    \[\leadsto \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 0.019999999552965164:\\ \;\;\;\;\mathsf{copysign}\left(\mathsf{log1p}\left(\left|x\right|\right) + 0.5 \cdot \left(x \cdot \frac{x}{x + 1}\right), x\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{copysign}\left(\log \left(x + \mathsf{hypot}\left(1, x\right)\right), x\right)\\ \end{array} \]

Alternative 5: 98.3% accurate, 1.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -1:\\ \;\;\;\;\mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \left(\frac{1}{x \cdot -2 - \frac{0.5}{x}}\right)\right), x\right)\\ \mathbf{elif}\;x \leq 0.05000000074505806:\\ \;\;\;\;\mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \left(x + {x}^{3} \cdot -0.16666666666666666\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} \]
(FPCore (x)
 :precision binary32
 (if (<= x -1.0)
   (copysign
    (* 0.3333333333333333 (* 3.0 (log (/ 1.0 (- (* x -2.0) (/ 0.5 x))))))
    x)
   (if (<= x 0.05000000074505806)
     (copysign
      (* 0.3333333333333333 (* 3.0 (+ x (* (pow x 3.0) -0.16666666666666666))))
      x)
     (copysign (log (+ x (hypot 1.0 x))) x))))
float code(float x) {
	float tmp;
	if (x <= -1.0f) {
		tmp = copysignf((0.3333333333333333f * (3.0f * logf((1.0f / ((x * -2.0f) - (0.5f / x)))))), x);
	} else if (x <= 0.05000000074505806f) {
		tmp = copysignf((0.3333333333333333f * (3.0f * (x + (powf(x, 3.0f) * -0.16666666666666666f)))), 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(Float32(0.3333333333333333) * Float32(Float32(3.0) * log(Float32(Float32(1.0) / Float32(Float32(x * Float32(-2.0)) - Float32(Float32(0.5) / x)))))), x);
	elseif (x <= Float32(0.05000000074505806))
		tmp = copysign(Float32(Float32(0.3333333333333333) * Float32(Float32(3.0) * Float32(x + Float32((x ^ Float32(3.0)) * Float32(-0.16666666666666666))))), 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((single(0.3333333333333333) * (single(3.0) * log((single(1.0) / ((x * single(-2.0)) - (single(0.5) / x)))))));
	elseif (x <= single(0.05000000074505806))
		tmp = sign(x) * abs((single(0.3333333333333333) * (single(3.0) * (x + ((x ^ single(3.0)) * single(-0.16666666666666666))))));
	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(0.3333333333333333 \cdot \left(3 \cdot \log \left(\frac{1}{x \cdot -2 - \frac{0.5}{x}}\right)\right), x\right)\\

\mathbf{elif}\;x \leq 0.05000000074505806:\\
\;\;\;\;\mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \left(x + {x}^{3} \cdot -0.16666666666666666\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}
Derivation
  1. Split input into 3 regimes
  2. if x < -1

    1. Initial program 58.1%

      \[\mathsf{copysign}\left(\log \left(\left|x\right| + \sqrt{x \cdot x + 1}\right), x\right) \]
    2. Step-by-step derivation
      1. add-cbrt-cube40.0%

        \[\leadsto \mathsf{copysign}\left(\log \color{blue}{\left(\sqrt[3]{\left(\left(\left|x\right| + \sqrt{x \cdot x + 1}\right) \cdot \left(\left|x\right| + \sqrt{x \cdot x + 1}\right)\right) \cdot \left(\left|x\right| + \sqrt{x \cdot x + 1}\right)}\right)}, x\right) \]
      2. pow1/339.5%

        \[\leadsto \mathsf{copysign}\left(\log \color{blue}{\left({\left(\left(\left(\left|x\right| + \sqrt{x \cdot x + 1}\right) \cdot \left(\left|x\right| + \sqrt{x \cdot x + 1}\right)\right) \cdot \left(\left|x\right| + \sqrt{x \cdot x + 1}\right)\right)}^{0.3333333333333333}\right)}, x\right) \]
      3. log-pow39.3%

        \[\leadsto \mathsf{copysign}\left(\color{blue}{0.3333333333333333 \cdot \log \left(\left(\left(\left|x\right| + \sqrt{x \cdot x + 1}\right) \cdot \left(\left|x\right| + \sqrt{x \cdot x + 1}\right)\right) \cdot \left(\left|x\right| + \sqrt{x \cdot x + 1}\right)\right)}, x\right) \]
      4. pow339.4%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \log \color{blue}{\left({\left(\left|x\right| + \sqrt{x \cdot x + 1}\right)}^{3}\right)}, x\right) \]
      5. log-pow57.5%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \color{blue}{\left(3 \cdot \log \left(\left|x\right| + \sqrt{x \cdot x + 1}\right)\right)}, x\right) \]
      6. +-commutative57.5%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \left(\left|x\right| + \sqrt{\color{blue}{1 + x \cdot x}}\right)\right), x\right) \]
      7. hypot-1-def98.9%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \left(\left|x\right| + \color{blue}{\mathsf{hypot}\left(1, x\right)}\right)\right), x\right) \]
      8. add-sqr-sqrt-0.0%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \left(\left|\color{blue}{\sqrt{x} \cdot \sqrt{x}}\right| + \mathsf{hypot}\left(1, x\right)\right)\right), x\right) \]
      9. fabs-sqr-0.0%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \left(\color{blue}{\sqrt{x} \cdot \sqrt{x}} + \mathsf{hypot}\left(1, x\right)\right)\right), x\right) \]
      10. add-sqr-sqrt15.9%

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

      \[\leadsto \mathsf{copysign}\left(\color{blue}{0.3333333333333333 \cdot \left(3 \cdot \log \left(x + \mathsf{hypot}\left(1, x\right)\right)\right)}, x\right) \]
    4. Step-by-step derivation
      1. flip-+14.9%

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

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \left(\frac{\color{blue}{{x}^{2}} - \mathsf{hypot}\left(1, x\right) \cdot \mathsf{hypot}\left(1, x\right)}{x - \mathsf{hypot}\left(1, x\right)}\right)\right), x\right) \]
      3. div-sub12.8%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \color{blue}{\left(\frac{{x}^{2}}{x - \mathsf{hypot}\left(1, x\right)} - \frac{\mathsf{hypot}\left(1, x\right) \cdot \mathsf{hypot}\left(1, x\right)}{x - \mathsf{hypot}\left(1, x\right)}\right)}\right), x\right) \]
      4. hypot-udef12.9%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \left(\frac{{x}^{2}}{x - \mathsf{hypot}\left(1, x\right)} - \frac{\color{blue}{\sqrt{1 \cdot 1 + x \cdot x}} \cdot \mathsf{hypot}\left(1, x\right)}{x - \mathsf{hypot}\left(1, x\right)}\right)\right), x\right) \]
      5. metadata-eval12.9%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \left(\frac{{x}^{2}}{x - \mathsf{hypot}\left(1, x\right)} - \frac{\sqrt{\color{blue}{1} + x \cdot x} \cdot \mathsf{hypot}\left(1, x\right)}{x - \mathsf{hypot}\left(1, x\right)}\right)\right), x\right) \]
      6. unpow212.9%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \left(\frac{{x}^{2}}{x - \mathsf{hypot}\left(1, x\right)} - \frac{\sqrt{1 + \color{blue}{{x}^{2}}} \cdot \mathsf{hypot}\left(1, x\right)}{x - \mathsf{hypot}\left(1, x\right)}\right)\right), x\right) \]
      7. hypot-udef12.7%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \left(\frac{{x}^{2}}{x - \mathsf{hypot}\left(1, x\right)} - \frac{\sqrt{1 + {x}^{2}} \cdot \color{blue}{\sqrt{1 \cdot 1 + x \cdot x}}}{x - \mathsf{hypot}\left(1, x\right)}\right)\right), x\right) \]
      8. metadata-eval12.7%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \left(\frac{{x}^{2}}{x - \mathsf{hypot}\left(1, x\right)} - \frac{\sqrt{1 + {x}^{2}} \cdot \sqrt{\color{blue}{1} + x \cdot x}}{x - \mathsf{hypot}\left(1, x\right)}\right)\right), x\right) \]
      9. unpow212.7%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \left(\frac{{x}^{2}}{x - \mathsf{hypot}\left(1, x\right)} - \frac{\sqrt{1 + {x}^{2}} \cdot \sqrt{1 + \color{blue}{{x}^{2}}}}{x - \mathsf{hypot}\left(1, x\right)}\right)\right), x\right) \]
      10. add-sqr-sqrt13.1%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \left(\frac{{x}^{2}}{x - \mathsf{hypot}\left(1, x\right)} - \frac{\color{blue}{1 + {x}^{2}}}{x - \mathsf{hypot}\left(1, x\right)}\right)\right), x\right) \]
      11. +-commutative13.1%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \left(\frac{{x}^{2}}{x - \mathsf{hypot}\left(1, x\right)} - \frac{\color{blue}{{x}^{2} + 1}}{x - \mathsf{hypot}\left(1, x\right)}\right)\right), x\right) \]
    5. Applied egg-rr13.1%

      \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \color{blue}{\left(\frac{{x}^{2}}{x - \mathsf{hypot}\left(1, x\right)} - \frac{{x}^{2} + 1}{x - \mathsf{hypot}\left(1, x\right)}\right)}\right), x\right) \]
    6. Step-by-step derivation
      1. div-sub16.0%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \color{blue}{\left(\frac{{x}^{2} - \left({x}^{2} + 1\right)}{x - \mathsf{hypot}\left(1, x\right)}\right)}\right), x\right) \]
      2. associate--r+54.6%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \left(\frac{\color{blue}{\left({x}^{2} - {x}^{2}\right) - 1}}{x - \mathsf{hypot}\left(1, x\right)}\right)\right), x\right) \]
      3. +-inverses98.9%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \left(\frac{\color{blue}{0} - 1}{x - \mathsf{hypot}\left(1, x\right)}\right)\right), x\right) \]
      4. metadata-eval98.9%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \left(\frac{\color{blue}{-1}}{x - \mathsf{hypot}\left(1, x\right)}\right)\right), x\right) \]
      5. metadata-eval98.9%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \left(\frac{\color{blue}{\frac{1}{-1}}}{x - \mathsf{hypot}\left(1, x\right)}\right)\right), x\right) \]
      6. metadata-eval98.9%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \left(\frac{\frac{\color{blue}{--1}}{-1}}{x - \mathsf{hypot}\left(1, x\right)}\right)\right), x\right) \]
      7. metadata-eval98.9%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \left(\frac{\frac{-\color{blue}{\left(0 - 1\right)}}{-1}}{x - \mathsf{hypot}\left(1, x\right)}\right)\right), x\right) \]
      8. +-inverses54.6%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \left(\frac{\frac{-\left(\color{blue}{\left({x}^{2} - {x}^{2}\right)} - 1\right)}{-1}}{x - \mathsf{hypot}\left(1, x\right)}\right)\right), x\right) \]
      9. associate--r+16.0%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \left(\frac{\frac{-\color{blue}{\left({x}^{2} - \left({x}^{2} + 1\right)\right)}}{-1}}{x - \mathsf{hypot}\left(1, x\right)}\right)\right), x\right) \]
      10. associate-/r*16.0%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \color{blue}{\left(\frac{-\left({x}^{2} - \left({x}^{2} + 1\right)\right)}{-1 \cdot \left(x - \mathsf{hypot}\left(1, x\right)\right)}\right)}\right), x\right) \]
      11. neg-mul-116.0%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \left(\frac{-\left({x}^{2} - \left({x}^{2} + 1\right)\right)}{\color{blue}{-\left(x - \mathsf{hypot}\left(1, x\right)\right)}}\right)\right), x\right) \]
      12. neg-mul-116.0%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \left(\frac{\color{blue}{-1 \cdot \left({x}^{2} - \left({x}^{2} + 1\right)\right)}}{-\left(x - \mathsf{hypot}\left(1, x\right)\right)}\right)\right), x\right) \]
      13. associate--r+54.6%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \left(\frac{-1 \cdot \color{blue}{\left(\left({x}^{2} - {x}^{2}\right) - 1\right)}}{-\left(x - \mathsf{hypot}\left(1, x\right)\right)}\right)\right), x\right) \]
      14. +-inverses98.9%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \left(\frac{-1 \cdot \left(\color{blue}{0} - 1\right)}{-\left(x - \mathsf{hypot}\left(1, x\right)\right)}\right)\right), x\right) \]
      15. metadata-eval98.9%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \left(\frac{-1 \cdot \color{blue}{-1}}{-\left(x - \mathsf{hypot}\left(1, x\right)\right)}\right)\right), x\right) \]
      16. metadata-eval98.9%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \left(\frac{\color{blue}{1}}{-\left(x - \mathsf{hypot}\left(1, x\right)\right)}\right)\right), x\right) \]
      17. neg-sub098.9%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \left(\frac{1}{\color{blue}{0 - \left(x - \mathsf{hypot}\left(1, x\right)\right)}}\right)\right), x\right) \]
      18. associate--r-98.9%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \left(\frac{1}{\color{blue}{\left(0 - x\right) + \mathsf{hypot}\left(1, x\right)}}\right)\right), x\right) \]
      19. neg-sub098.9%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \left(\frac{1}{\color{blue}{\left(-x\right)} + \mathsf{hypot}\left(1, x\right)}\right)\right), x\right) \]
      20. +-commutative98.9%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \left(\frac{1}{\color{blue}{\mathsf{hypot}\left(1, x\right) + \left(-x\right)}}\right)\right), x\right) \]
      21. sub-neg98.9%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \left(\frac{1}{\color{blue}{\mathsf{hypot}\left(1, x\right) - x}}\right)\right), x\right) \]
    7. Simplified98.9%

      \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \color{blue}{\left(\frac{1}{\mathsf{hypot}\left(1, x\right) - x}\right)}\right), x\right) \]
    8. Taylor expanded in x around -inf 97.4%

      \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \left(\frac{1}{\color{blue}{-2 \cdot x - 0.5 \cdot \frac{1}{x}}}\right)\right), x\right) \]
    9. Step-by-step derivation
      1. *-commutative97.4%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \left(\frac{1}{\color{blue}{x \cdot -2} - 0.5 \cdot \frac{1}{x}}\right)\right), x\right) \]
      2. associate-*r/97.4%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \left(\frac{1}{x \cdot -2 - \color{blue}{\frac{0.5 \cdot 1}{x}}}\right)\right), x\right) \]
      3. metadata-eval97.4%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \left(\frac{1}{x \cdot -2 - \frac{\color{blue}{0.5}}{x}}\right)\right), x\right) \]
    10. Simplified97.4%

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

    if -1 < x < 0.0500000007

    1. Initial program 19.1%

      \[\mathsf{copysign}\left(\log \left(\left|x\right| + \sqrt{x \cdot x + 1}\right), x\right) \]
    2. Step-by-step derivation
      1. add-cbrt-cube19.1%

        \[\leadsto \mathsf{copysign}\left(\log \color{blue}{\left(\sqrt[3]{\left(\left(\left|x\right| + \sqrt{x \cdot x + 1}\right) \cdot \left(\left|x\right| + \sqrt{x \cdot x + 1}\right)\right) \cdot \left(\left|x\right| + \sqrt{x \cdot x + 1}\right)}\right)}, x\right) \]
      2. pow1/319.1%

        \[\leadsto \mathsf{copysign}\left(\log \color{blue}{\left({\left(\left(\left(\left|x\right| + \sqrt{x \cdot x + 1}\right) \cdot \left(\left|x\right| + \sqrt{x \cdot x + 1}\right)\right) \cdot \left(\left|x\right| + \sqrt{x \cdot x + 1}\right)\right)}^{0.3333333333333333}\right)}, x\right) \]
      3. log-pow19.2%

        \[\leadsto \mathsf{copysign}\left(\color{blue}{0.3333333333333333 \cdot \log \left(\left(\left(\left|x\right| + \sqrt{x \cdot x + 1}\right) \cdot \left(\left|x\right| + \sqrt{x \cdot x + 1}\right)\right) \cdot \left(\left|x\right| + \sqrt{x \cdot x + 1}\right)\right)}, x\right) \]
      4. pow319.3%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \log \color{blue}{\left({\left(\left|x\right| + \sqrt{x \cdot x + 1}\right)}^{3}\right)}, x\right) \]
      5. log-pow19.1%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \color{blue}{\left(3 \cdot \log \left(\left|x\right| + \sqrt{x \cdot x + 1}\right)\right)}, x\right) \]
      6. +-commutative19.1%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \left(\left|x\right| + \sqrt{\color{blue}{1 + x \cdot x}}\right)\right), x\right) \]
      7. hypot-1-def19.1%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \left(\left|x\right| + \color{blue}{\mathsf{hypot}\left(1, x\right)}\right)\right), x\right) \]
      8. add-sqr-sqrt9.6%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \left(\left|\color{blue}{\sqrt{x} \cdot \sqrt{x}}\right| + \mathsf{hypot}\left(1, x\right)\right)\right), x\right) \]
      9. fabs-sqr9.6%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \left(\color{blue}{\sqrt{x} \cdot \sqrt{x}} + \mathsf{hypot}\left(1, x\right)\right)\right), x\right) \]
      10. add-sqr-sqrt19.4%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \left(\color{blue}{x} + \mathsf{hypot}\left(1, x\right)\right)\right), x\right) \]
    3. Applied egg-rr19.4%

      \[\leadsto \mathsf{copysign}\left(\color{blue}{0.3333333333333333 \cdot \left(3 \cdot \log \left(x + \mathsf{hypot}\left(1, x\right)\right)\right)}, x\right) \]
    4. Taylor expanded in x around 0 98.3%

      \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \color{blue}{\left(x + -0.16666666666666666 \cdot {x}^{3}\right)}\right), x\right) \]
    5. Step-by-step derivation
      1. *-commutative98.3%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \left(x + \color{blue}{{x}^{3} \cdot -0.16666666666666666}\right)\right), x\right) \]
    6. Simplified98.3%

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

    if 0.0500000007 < x

    1. Initial program 52.5%

      \[\mathsf{copysign}\left(\log \left(\left|x\right| + \sqrt{x \cdot x + 1}\right), x\right) \]
    2. Step-by-step derivation
      1. *-un-lft-identity52.5%

        \[\leadsto \mathsf{copysign}\left(\log \color{blue}{\left(1 \cdot \left(\left|x\right| + \sqrt{x \cdot x + 1}\right)\right)}, x\right) \]
      2. *-commutative52.5%

        \[\leadsto \mathsf{copysign}\left(\log \color{blue}{\left(\left(\left|x\right| + \sqrt{x \cdot x + 1}\right) \cdot 1\right)}, x\right) \]
      3. log-prod52.5%

        \[\leadsto \mathsf{copysign}\left(\color{blue}{\log \left(\left|x\right| + \sqrt{x \cdot x + 1}\right) + \log 1}, x\right) \]
      4. +-commutative52.5%

        \[\leadsto \mathsf{copysign}\left(\log \left(\left|x\right| + \sqrt{\color{blue}{1 + x \cdot x}}\right) + \log 1, x\right) \]
      5. hypot-1-def98.6%

        \[\leadsto \mathsf{copysign}\left(\log \left(\left|x\right| + \color{blue}{\mathsf{hypot}\left(1, x\right)}\right) + \log 1, x\right) \]
      6. add-sqr-sqrt98.6%

        \[\leadsto \mathsf{copysign}\left(\log \left(\left|\color{blue}{\sqrt{x} \cdot \sqrt{x}}\right| + \mathsf{hypot}\left(1, x\right)\right) + \log 1, x\right) \]
      7. fabs-sqr98.6%

        \[\leadsto \mathsf{copysign}\left(\log \left(\color{blue}{\sqrt{x} \cdot \sqrt{x}} + \mathsf{hypot}\left(1, x\right)\right) + \log 1, x\right) \]
      8. add-sqr-sqrt98.6%

        \[\leadsto \mathsf{copysign}\left(\log \left(\color{blue}{x} + \mathsf{hypot}\left(1, x\right)\right) + \log 1, x\right) \]
      9. metadata-eval98.6%

        \[\leadsto \mathsf{copysign}\left(\log \left(x + \mathsf{hypot}\left(1, x\right)\right) + \color{blue}{0}, x\right) \]
    3. Applied egg-rr98.6%

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

        \[\leadsto \mathsf{copysign}\left(\color{blue}{\log \left(x + \mathsf{hypot}\left(1, x\right)\right)}, x\right) \]
    5. Simplified98.6%

      \[\leadsto \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 simplification98.2%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -1:\\ \;\;\;\;\mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \left(\frac{1}{x \cdot -2 - \frac{0.5}{x}}\right)\right), x\right)\\ \mathbf{elif}\;x \leq 0.05000000074505806:\\ \;\;\;\;\mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \left(x + {x}^{3} \cdot -0.16666666666666666\right)\right), x\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{copysign}\left(\log \left(x + \mathsf{hypot}\left(1, x\right)\right), x\right)\\ \end{array} \]

Alternative 6: 99.2% accurate, 1.3× speedup?

\[\begin{array}{l} \\ \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 0.0005000000237487257:\\ \;\;\;\;\mathsf{copysign}\left(x, x\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{copysign}\left(\log \left(x + \mathsf{hypot}\left(1, x\right)\right), x\right)\\ \end{array} \end{array} \]
(FPCore (x)
 :precision binary32
 (if (<= x -0.009999999776482582)
   (copysign (log (/ 1.0 (- (hypot 1.0 x) x))) x)
   (if (<= x 0.0005000000237487257)
     (copysign x x)
     (copysign (log (+ x (hypot 1.0 x))) x))))
float code(float x) {
	float tmp;
	if (x <= -0.009999999776482582f) {
		tmp = copysignf(logf((1.0f / (hypotf(1.0f, x) - x))), x);
	} else if (x <= 0.0005000000237487257f) {
		tmp = copysignf(x, x);
	} else {
		tmp = copysignf(logf((x + hypotf(1.0f, x))), x);
	}
	return tmp;
}
function code(x)
	tmp = Float32(0.0)
	if (x <= Float32(-0.009999999776482582))
		tmp = copysign(log(Float32(Float32(1.0) / Float32(hypot(Float32(1.0), x) - x))), x);
	elseif (x <= Float32(0.0005000000237487257))
		tmp = copysign(x, 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.009999999776482582))
		tmp = sign(x) * abs(log((single(1.0) / (hypot(single(1.0), x) - x))));
	elseif (x <= single(0.0005000000237487257))
		tmp = sign(x) * abs(x);
	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.009999999776482582:\\
\;\;\;\;\mathsf{copysign}\left(\log \left(\frac{1}{\mathsf{hypot}\left(1, x\right) - x}\right), x\right)\\

\mathbf{elif}\;x \leq 0.0005000000237487257:\\
\;\;\;\;\mathsf{copysign}\left(x, x\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -0.00999999978

    1. Initial program 59.9%

      \[\mathsf{copysign}\left(\log \left(\left|x\right| + \sqrt{x \cdot x + 1}\right), x\right) \]
    2. Step-by-step derivation
      1. add-cbrt-cube42.8%

        \[\leadsto \mathsf{copysign}\left(\log \color{blue}{\left(\sqrt[3]{\left(\left(\left|x\right| + \sqrt{x \cdot x + 1}\right) \cdot \left(\left|x\right| + \sqrt{x \cdot x + 1}\right)\right) \cdot \left(\left|x\right| + \sqrt{x \cdot x + 1}\right)}\right)}, x\right) \]
      2. pow1/342.4%

        \[\leadsto \mathsf{copysign}\left(\log \color{blue}{\left({\left(\left(\left(\left|x\right| + \sqrt{x \cdot x + 1}\right) \cdot \left(\left|x\right| + \sqrt{x \cdot x + 1}\right)\right) \cdot \left(\left|x\right| + \sqrt{x \cdot x + 1}\right)\right)}^{0.3333333333333333}\right)}, x\right) \]
      3. log-pow42.3%

        \[\leadsto \mathsf{copysign}\left(\color{blue}{0.3333333333333333 \cdot \log \left(\left(\left(\left|x\right| + \sqrt{x \cdot x + 1}\right) \cdot \left(\left|x\right| + \sqrt{x \cdot x + 1}\right)\right) \cdot \left(\left|x\right| + \sqrt{x \cdot x + 1}\right)\right)}, x\right) \]
      4. pow342.4%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \log \color{blue}{\left({\left(\left|x\right| + \sqrt{x \cdot x + 1}\right)}^{3}\right)}, x\right) \]
      5. log-pow59.4%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \color{blue}{\left(3 \cdot \log \left(\left|x\right| + \sqrt{x \cdot x + 1}\right)\right)}, x\right) \]
      6. +-commutative59.4%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \left(\left|x\right| + \sqrt{\color{blue}{1 + x \cdot x}}\right)\right), x\right) \]
      7. hypot-1-def98.4%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \left(\left|x\right| + \color{blue}{\mathsf{hypot}\left(1, x\right)}\right)\right), x\right) \]
      8. add-sqr-sqrt-0.0%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \left(\left|\color{blue}{\sqrt{x} \cdot \sqrt{x}}\right| + \mathsf{hypot}\left(1, x\right)\right)\right), x\right) \]
      9. fabs-sqr-0.0%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \left(\color{blue}{\sqrt{x} \cdot \sqrt{x}} + \mathsf{hypot}\left(1, x\right)\right)\right), x\right) \]
      10. add-sqr-sqrt20.1%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \left(\color{blue}{x} + \mathsf{hypot}\left(1, x\right)\right)\right), x\right) \]
    3. Applied egg-rr20.1%

      \[\leadsto \mathsf{copysign}\left(\color{blue}{0.3333333333333333 \cdot \left(3 \cdot \log \left(x + \mathsf{hypot}\left(1, x\right)\right)\right)}, x\right) \]
    4. Step-by-step derivation
      1. flip-+19.1%

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

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \left(\frac{\color{blue}{{x}^{2}} - \mathsf{hypot}\left(1, x\right) \cdot \mathsf{hypot}\left(1, x\right)}{x - \mathsf{hypot}\left(1, x\right)}\right)\right), x\right) \]
      3. div-sub17.1%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \color{blue}{\left(\frac{{x}^{2}}{x - \mathsf{hypot}\left(1, x\right)} - \frac{\mathsf{hypot}\left(1, x\right) \cdot \mathsf{hypot}\left(1, x\right)}{x - \mathsf{hypot}\left(1, x\right)}\right)}\right), x\right) \]
      4. hypot-udef17.2%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \left(\frac{{x}^{2}}{x - \mathsf{hypot}\left(1, x\right)} - \frac{\color{blue}{\sqrt{1 \cdot 1 + x \cdot x}} \cdot \mathsf{hypot}\left(1, x\right)}{x - \mathsf{hypot}\left(1, x\right)}\right)\right), x\right) \]
      5. metadata-eval17.2%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \left(\frac{{x}^{2}}{x - \mathsf{hypot}\left(1, x\right)} - \frac{\sqrt{\color{blue}{1} + x \cdot x} \cdot \mathsf{hypot}\left(1, x\right)}{x - \mathsf{hypot}\left(1, x\right)}\right)\right), x\right) \]
      6. unpow217.2%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \left(\frac{{x}^{2}}{x - \mathsf{hypot}\left(1, x\right)} - \frac{\sqrt{1 + \color{blue}{{x}^{2}}} \cdot \mathsf{hypot}\left(1, x\right)}{x - \mathsf{hypot}\left(1, x\right)}\right)\right), x\right) \]
      7. hypot-udef17.0%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \left(\frac{{x}^{2}}{x - \mathsf{hypot}\left(1, x\right)} - \frac{\sqrt{1 + {x}^{2}} \cdot \color{blue}{\sqrt{1 \cdot 1 + x \cdot x}}}{x - \mathsf{hypot}\left(1, x\right)}\right)\right), x\right) \]
      8. metadata-eval17.0%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \left(\frac{{x}^{2}}{x - \mathsf{hypot}\left(1, x\right)} - \frac{\sqrt{1 + {x}^{2}} \cdot \sqrt{\color{blue}{1} + x \cdot x}}{x - \mathsf{hypot}\left(1, x\right)}\right)\right), x\right) \]
      9. unpow217.0%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \left(\frac{{x}^{2}}{x - \mathsf{hypot}\left(1, x\right)} - \frac{\sqrt{1 + {x}^{2}} \cdot \sqrt{1 + \color{blue}{{x}^{2}}}}{x - \mathsf{hypot}\left(1, x\right)}\right)\right), x\right) \]
      10. add-sqr-sqrt17.3%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \left(\frac{{x}^{2}}{x - \mathsf{hypot}\left(1, x\right)} - \frac{\color{blue}{1 + {x}^{2}}}{x - \mathsf{hypot}\left(1, x\right)}\right)\right), x\right) \]
      11. +-commutative17.3%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \left(\frac{{x}^{2}}{x - \mathsf{hypot}\left(1, x\right)} - \frac{\color{blue}{{x}^{2} + 1}}{x - \mathsf{hypot}\left(1, x\right)}\right)\right), x\right) \]
    5. Applied egg-rr17.3%

      \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \color{blue}{\left(\frac{{x}^{2}}{x - \mathsf{hypot}\left(1, x\right)} - \frac{{x}^{2} + 1}{x - \mathsf{hypot}\left(1, x\right)}\right)}\right), x\right) \]
    6. Step-by-step derivation
      1. div-sub20.1%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \color{blue}{\left(\frac{{x}^{2} - \left({x}^{2} + 1\right)}{x - \mathsf{hypot}\left(1, x\right)}\right)}\right), x\right) \]
      2. associate--r+56.5%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \left(\frac{\color{blue}{\left({x}^{2} - {x}^{2}\right) - 1}}{x - \mathsf{hypot}\left(1, x\right)}\right)\right), x\right) \]
      3. +-inverses98.3%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \left(\frac{\color{blue}{0} - 1}{x - \mathsf{hypot}\left(1, x\right)}\right)\right), x\right) \]
      4. metadata-eval98.3%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \left(\frac{\color{blue}{-1}}{x - \mathsf{hypot}\left(1, x\right)}\right)\right), x\right) \]
      5. metadata-eval98.3%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \left(\frac{\color{blue}{\frac{1}{-1}}}{x - \mathsf{hypot}\left(1, x\right)}\right)\right), x\right) \]
      6. metadata-eval98.3%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \left(\frac{\frac{\color{blue}{--1}}{-1}}{x - \mathsf{hypot}\left(1, x\right)}\right)\right), x\right) \]
      7. metadata-eval98.3%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \left(\frac{\frac{-\color{blue}{\left(0 - 1\right)}}{-1}}{x - \mathsf{hypot}\left(1, x\right)}\right)\right), x\right) \]
      8. +-inverses56.5%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \left(\frac{\frac{-\left(\color{blue}{\left({x}^{2} - {x}^{2}\right)} - 1\right)}{-1}}{x - \mathsf{hypot}\left(1, x\right)}\right)\right), x\right) \]
      9. associate--r+20.1%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \left(\frac{\frac{-\color{blue}{\left({x}^{2} - \left({x}^{2} + 1\right)\right)}}{-1}}{x - \mathsf{hypot}\left(1, x\right)}\right)\right), x\right) \]
      10. associate-/r*20.1%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \color{blue}{\left(\frac{-\left({x}^{2} - \left({x}^{2} + 1\right)\right)}{-1 \cdot \left(x - \mathsf{hypot}\left(1, x\right)\right)}\right)}\right), x\right) \]
      11. neg-mul-120.1%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \left(\frac{-\left({x}^{2} - \left({x}^{2} + 1\right)\right)}{\color{blue}{-\left(x - \mathsf{hypot}\left(1, x\right)\right)}}\right)\right), x\right) \]
      12. neg-mul-120.1%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \left(\frac{\color{blue}{-1 \cdot \left({x}^{2} - \left({x}^{2} + 1\right)\right)}}{-\left(x - \mathsf{hypot}\left(1, x\right)\right)}\right)\right), x\right) \]
      13. associate--r+56.5%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \left(\frac{-1 \cdot \color{blue}{\left(\left({x}^{2} - {x}^{2}\right) - 1\right)}}{-\left(x - \mathsf{hypot}\left(1, x\right)\right)}\right)\right), x\right) \]
      14. +-inverses98.3%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \left(\frac{-1 \cdot \left(\color{blue}{0} - 1\right)}{-\left(x - \mathsf{hypot}\left(1, x\right)\right)}\right)\right), x\right) \]
      15. metadata-eval98.3%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \left(\frac{-1 \cdot \color{blue}{-1}}{-\left(x - \mathsf{hypot}\left(1, x\right)\right)}\right)\right), x\right) \]
      16. metadata-eval98.3%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \left(\frac{\color{blue}{1}}{-\left(x - \mathsf{hypot}\left(1, x\right)\right)}\right)\right), x\right) \]
      17. neg-sub098.3%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \left(\frac{1}{\color{blue}{0 - \left(x - \mathsf{hypot}\left(1, x\right)\right)}}\right)\right), x\right) \]
      18. associate--r-98.3%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \left(\frac{1}{\color{blue}{\left(0 - x\right) + \mathsf{hypot}\left(1, x\right)}}\right)\right), x\right) \]
      19. neg-sub098.3%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \left(\frac{1}{\color{blue}{\left(-x\right)} + \mathsf{hypot}\left(1, x\right)}\right)\right), x\right) \]
      20. +-commutative98.3%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \left(\frac{1}{\color{blue}{\mathsf{hypot}\left(1, x\right) + \left(-x\right)}}\right)\right), x\right) \]
      21. sub-neg98.3%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \left(\frac{1}{\color{blue}{\mathsf{hypot}\left(1, x\right) - x}}\right)\right), x\right) \]
    7. Simplified98.3%

      \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \color{blue}{\left(\frac{1}{\mathsf{hypot}\left(1, x\right) - x}\right)}\right), x\right) \]
    8. Step-by-step derivation
      1. associate-*r*99.3%

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

        \[\leadsto \mathsf{copysign}\left(\color{blue}{1} \cdot \log \left(\frac{1}{\mathsf{hypot}\left(1, x\right) - x}\right), x\right) \]
      3. *-un-lft-identity99.3%

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

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

    if -0.00999999978 < x < 5.00000024e-4

    1. Initial program 14.4%

      \[\mathsf{copysign}\left(\log \left(\left|x\right| + \sqrt{x \cdot x + 1}\right), x\right) \]
    2. Step-by-step derivation
      1. add-cbrt-cube14.4%

        \[\leadsto \mathsf{copysign}\left(\log \color{blue}{\left(\sqrt[3]{\left(\left(\left|x\right| + \sqrt{x \cdot x + 1}\right) \cdot \left(\left|x\right| + \sqrt{x \cdot x + 1}\right)\right) \cdot \left(\left|x\right| + \sqrt{x \cdot x + 1}\right)}\right)}, x\right) \]
      2. pow1/314.4%

        \[\leadsto \mathsf{copysign}\left(\log \color{blue}{\left({\left(\left(\left(\left|x\right| + \sqrt{x \cdot x + 1}\right) \cdot \left(\left|x\right| + \sqrt{x \cdot x + 1}\right)\right) \cdot \left(\left|x\right| + \sqrt{x \cdot x + 1}\right)\right)}^{0.3333333333333333}\right)}, x\right) \]
      3. log-pow14.4%

        \[\leadsto \mathsf{copysign}\left(\color{blue}{0.3333333333333333 \cdot \log \left(\left(\left(\left|x\right| + \sqrt{x \cdot x + 1}\right) \cdot \left(\left|x\right| + \sqrt{x \cdot x + 1}\right)\right) \cdot \left(\left|x\right| + \sqrt{x \cdot x + 1}\right)\right)}, x\right) \]
      4. pow314.4%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \log \color{blue}{\left({\left(\left|x\right| + \sqrt{x \cdot x + 1}\right)}^{3}\right)}, x\right) \]
      5. log-pow14.4%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \color{blue}{\left(3 \cdot \log \left(\left|x\right| + \sqrt{x \cdot x + 1}\right)\right)}, x\right) \]
      6. +-commutative14.4%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \left(\left|x\right| + \sqrt{\color{blue}{1 + x \cdot x}}\right)\right), x\right) \]
      7. hypot-1-def14.4%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \left(\left|x\right| + \color{blue}{\mathsf{hypot}\left(1, x\right)}\right)\right), x\right) \]
      8. add-sqr-sqrt7.7%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \left(\left|\color{blue}{\sqrt{x} \cdot \sqrt{x}}\right| + \mathsf{hypot}\left(1, x\right)\right)\right), x\right) \]
      9. fabs-sqr7.7%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \left(\color{blue}{\sqrt{x} \cdot \sqrt{x}} + \mathsf{hypot}\left(1, x\right)\right)\right), x\right) \]
      10. add-sqr-sqrt14.7%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \left(\color{blue}{x} + \mathsf{hypot}\left(1, x\right)\right)\right), x\right) \]
    3. Applied egg-rr14.7%

      \[\leadsto \mathsf{copysign}\left(\color{blue}{0.3333333333333333 \cdot \left(3 \cdot \log \left(x + \mathsf{hypot}\left(1, x\right)\right)\right)}, x\right) \]
    4. Taylor expanded in x around 0 98.9%

      \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \color{blue}{\left(3 \cdot x\right)}, x\right) \]
    5. Step-by-step derivation
      1. *-commutative98.9%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \color{blue}{\left(x \cdot 3\right)}, x\right) \]
    6. Simplified98.9%

      \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \color{blue}{\left(x \cdot 3\right)}, x\right) \]
    7. Taylor expanded in x around 0 100.0%

      \[\leadsto \mathsf{copysign}\left(\color{blue}{x}, x\right) \]

    if 5.00000024e-4 < x

    1. Initial program 53.7%

      \[\mathsf{copysign}\left(\log \left(\left|x\right| + \sqrt{x \cdot x + 1}\right), x\right) \]
    2. Step-by-step derivation
      1. *-un-lft-identity53.7%

        \[\leadsto \mathsf{copysign}\left(\log \color{blue}{\left(1 \cdot \left(\left|x\right| + \sqrt{x \cdot x + 1}\right)\right)}, x\right) \]
      2. *-commutative53.7%

        \[\leadsto \mathsf{copysign}\left(\log \color{blue}{\left(\left(\left|x\right| + \sqrt{x \cdot x + 1}\right) \cdot 1\right)}, x\right) \]
      3. log-prod53.7%

        \[\leadsto \mathsf{copysign}\left(\color{blue}{\log \left(\left|x\right| + \sqrt{x \cdot x + 1}\right) + \log 1}, x\right) \]
      4. +-commutative53.7%

        \[\leadsto \mathsf{copysign}\left(\log \left(\left|x\right| + \sqrt{\color{blue}{1 + x \cdot x}}\right) + \log 1, x\right) \]
      5. hypot-1-def98.1%

        \[\leadsto \mathsf{copysign}\left(\log \left(\left|x\right| + \color{blue}{\mathsf{hypot}\left(1, x\right)}\right) + \log 1, x\right) \]
      6. add-sqr-sqrt98.1%

        \[\leadsto \mathsf{copysign}\left(\log \left(\left|\color{blue}{\sqrt{x} \cdot \sqrt{x}}\right| + \mathsf{hypot}\left(1, x\right)\right) + \log 1, x\right) \]
      7. fabs-sqr98.1%

        \[\leadsto \mathsf{copysign}\left(\log \left(\color{blue}{\sqrt{x} \cdot \sqrt{x}} + \mathsf{hypot}\left(1, x\right)\right) + \log 1, x\right) \]
      8. add-sqr-sqrt98.1%

        \[\leadsto \mathsf{copysign}\left(\log \left(\color{blue}{x} + \mathsf{hypot}\left(1, x\right)\right) + \log 1, x\right) \]
      9. metadata-eval98.1%

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

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

        \[\leadsto \mathsf{copysign}\left(\color{blue}{\log \left(x + \mathsf{hypot}\left(1, x\right)\right)}, x\right) \]
    5. Simplified98.1%

      \[\leadsto \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 simplification99.2%

    \[\leadsto \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 0.0005000000237487257:\\ \;\;\;\;\mathsf{copysign}\left(x, x\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{copysign}\left(\log \left(x + \mathsf{hypot}\left(1, x\right)\right), x\right)\\ \end{array} \]

Alternative 7: 97.6% accurate, 1.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -1:\\ \;\;\;\;\mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \left(\frac{1}{x \cdot -2 - \frac{0.5}{x}}\right)\right), x\right)\\ \mathbf{elif}\;x \leq 2:\\ \;\;\;\;\mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \left(x + {x}^{3} \cdot -0.16666666666666666\right)\right), x\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{copysign}\left(\log \left(\frac{0.5}{x}\right), x\right)\\ \end{array} \end{array} \]
(FPCore (x)
 :precision binary32
 (if (<= x -1.0)
   (copysign
    (* 0.3333333333333333 (* 3.0 (log (/ 1.0 (- (* x -2.0) (/ 0.5 x))))))
    x)
   (if (<= x 2.0)
     (copysign
      (* 0.3333333333333333 (* 3.0 (+ x (* (pow x 3.0) -0.16666666666666666))))
      x)
     (copysign (log (/ 0.5 x)) x))))
float code(float x) {
	float tmp;
	if (x <= -1.0f) {
		tmp = copysignf((0.3333333333333333f * (3.0f * logf((1.0f / ((x * -2.0f) - (0.5f / x)))))), x);
	} else if (x <= 2.0f) {
		tmp = copysignf((0.3333333333333333f * (3.0f * (x + (powf(x, 3.0f) * -0.16666666666666666f)))), x);
	} else {
		tmp = copysignf(logf((0.5f / x)), x);
	}
	return tmp;
}
function code(x)
	tmp = Float32(0.0)
	if (x <= Float32(-1.0))
		tmp = copysign(Float32(Float32(0.3333333333333333) * Float32(Float32(3.0) * log(Float32(Float32(1.0) / Float32(Float32(x * Float32(-2.0)) - Float32(Float32(0.5) / x)))))), x);
	elseif (x <= Float32(2.0))
		tmp = copysign(Float32(Float32(0.3333333333333333) * Float32(Float32(3.0) * Float32(x + Float32((x ^ Float32(3.0)) * Float32(-0.16666666666666666))))), x);
	else
		tmp = copysign(log(Float32(Float32(0.5) / x)), x);
	end
	return tmp
end
function tmp_2 = code(x)
	tmp = single(0.0);
	if (x <= single(-1.0))
		tmp = sign(x) * abs((single(0.3333333333333333) * (single(3.0) * log((single(1.0) / ((x * single(-2.0)) - (single(0.5) / x)))))));
	elseif (x <= single(2.0))
		tmp = sign(x) * abs((single(0.3333333333333333) * (single(3.0) * (x + ((x ^ single(3.0)) * single(-0.16666666666666666))))));
	else
		tmp = sign(x) * abs(log((single(0.5) / x)));
	end
	tmp_2 = tmp;
end
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \leq -1:\\
\;\;\;\;\mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \left(\frac{1}{x \cdot -2 - \frac{0.5}{x}}\right)\right), x\right)\\

\mathbf{elif}\;x \leq 2:\\
\;\;\;\;\mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \left(x + {x}^{3} \cdot -0.16666666666666666\right)\right), x\right)\\

\mathbf{else}:\\
\;\;\;\;\mathsf{copysign}\left(\log \left(\frac{0.5}{x}\right), x\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -1

    1. Initial program 58.1%

      \[\mathsf{copysign}\left(\log \left(\left|x\right| + \sqrt{x \cdot x + 1}\right), x\right) \]
    2. Step-by-step derivation
      1. add-cbrt-cube40.0%

        \[\leadsto \mathsf{copysign}\left(\log \color{blue}{\left(\sqrt[3]{\left(\left(\left|x\right| + \sqrt{x \cdot x + 1}\right) \cdot \left(\left|x\right| + \sqrt{x \cdot x + 1}\right)\right) \cdot \left(\left|x\right| + \sqrt{x \cdot x + 1}\right)}\right)}, x\right) \]
      2. pow1/339.5%

        \[\leadsto \mathsf{copysign}\left(\log \color{blue}{\left({\left(\left(\left(\left|x\right| + \sqrt{x \cdot x + 1}\right) \cdot \left(\left|x\right| + \sqrt{x \cdot x + 1}\right)\right) \cdot \left(\left|x\right| + \sqrt{x \cdot x + 1}\right)\right)}^{0.3333333333333333}\right)}, x\right) \]
      3. log-pow39.3%

        \[\leadsto \mathsf{copysign}\left(\color{blue}{0.3333333333333333 \cdot \log \left(\left(\left(\left|x\right| + \sqrt{x \cdot x + 1}\right) \cdot \left(\left|x\right| + \sqrt{x \cdot x + 1}\right)\right) \cdot \left(\left|x\right| + \sqrt{x \cdot x + 1}\right)\right)}, x\right) \]
      4. pow339.4%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \log \color{blue}{\left({\left(\left|x\right| + \sqrt{x \cdot x + 1}\right)}^{3}\right)}, x\right) \]
      5. log-pow57.5%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \color{blue}{\left(3 \cdot \log \left(\left|x\right| + \sqrt{x \cdot x + 1}\right)\right)}, x\right) \]
      6. +-commutative57.5%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \left(\left|x\right| + \sqrt{\color{blue}{1 + x \cdot x}}\right)\right), x\right) \]
      7. hypot-1-def98.9%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \left(\left|x\right| + \color{blue}{\mathsf{hypot}\left(1, x\right)}\right)\right), x\right) \]
      8. add-sqr-sqrt-0.0%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \left(\left|\color{blue}{\sqrt{x} \cdot \sqrt{x}}\right| + \mathsf{hypot}\left(1, x\right)\right)\right), x\right) \]
      9. fabs-sqr-0.0%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \left(\color{blue}{\sqrt{x} \cdot \sqrt{x}} + \mathsf{hypot}\left(1, x\right)\right)\right), x\right) \]
      10. add-sqr-sqrt15.9%

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

      \[\leadsto \mathsf{copysign}\left(\color{blue}{0.3333333333333333 \cdot \left(3 \cdot \log \left(x + \mathsf{hypot}\left(1, x\right)\right)\right)}, x\right) \]
    4. Step-by-step derivation
      1. flip-+14.9%

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

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \left(\frac{\color{blue}{{x}^{2}} - \mathsf{hypot}\left(1, x\right) \cdot \mathsf{hypot}\left(1, x\right)}{x - \mathsf{hypot}\left(1, x\right)}\right)\right), x\right) \]
      3. div-sub12.8%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \color{blue}{\left(\frac{{x}^{2}}{x - \mathsf{hypot}\left(1, x\right)} - \frac{\mathsf{hypot}\left(1, x\right) \cdot \mathsf{hypot}\left(1, x\right)}{x - \mathsf{hypot}\left(1, x\right)}\right)}\right), x\right) \]
      4. hypot-udef12.9%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \left(\frac{{x}^{2}}{x - \mathsf{hypot}\left(1, x\right)} - \frac{\color{blue}{\sqrt{1 \cdot 1 + x \cdot x}} \cdot \mathsf{hypot}\left(1, x\right)}{x - \mathsf{hypot}\left(1, x\right)}\right)\right), x\right) \]
      5. metadata-eval12.9%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \left(\frac{{x}^{2}}{x - \mathsf{hypot}\left(1, x\right)} - \frac{\sqrt{\color{blue}{1} + x \cdot x} \cdot \mathsf{hypot}\left(1, x\right)}{x - \mathsf{hypot}\left(1, x\right)}\right)\right), x\right) \]
      6. unpow212.9%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \left(\frac{{x}^{2}}{x - \mathsf{hypot}\left(1, x\right)} - \frac{\sqrt{1 + \color{blue}{{x}^{2}}} \cdot \mathsf{hypot}\left(1, x\right)}{x - \mathsf{hypot}\left(1, x\right)}\right)\right), x\right) \]
      7. hypot-udef12.7%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \left(\frac{{x}^{2}}{x - \mathsf{hypot}\left(1, x\right)} - \frac{\sqrt{1 + {x}^{2}} \cdot \color{blue}{\sqrt{1 \cdot 1 + x \cdot x}}}{x - \mathsf{hypot}\left(1, x\right)}\right)\right), x\right) \]
      8. metadata-eval12.7%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \left(\frac{{x}^{2}}{x - \mathsf{hypot}\left(1, x\right)} - \frac{\sqrt{1 + {x}^{2}} \cdot \sqrt{\color{blue}{1} + x \cdot x}}{x - \mathsf{hypot}\left(1, x\right)}\right)\right), x\right) \]
      9. unpow212.7%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \left(\frac{{x}^{2}}{x - \mathsf{hypot}\left(1, x\right)} - \frac{\sqrt{1 + {x}^{2}} \cdot \sqrt{1 + \color{blue}{{x}^{2}}}}{x - \mathsf{hypot}\left(1, x\right)}\right)\right), x\right) \]
      10. add-sqr-sqrt13.1%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \left(\frac{{x}^{2}}{x - \mathsf{hypot}\left(1, x\right)} - \frac{\color{blue}{1 + {x}^{2}}}{x - \mathsf{hypot}\left(1, x\right)}\right)\right), x\right) \]
      11. +-commutative13.1%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \left(\frac{{x}^{2}}{x - \mathsf{hypot}\left(1, x\right)} - \frac{\color{blue}{{x}^{2} + 1}}{x - \mathsf{hypot}\left(1, x\right)}\right)\right), x\right) \]
    5. Applied egg-rr13.1%

      \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \color{blue}{\left(\frac{{x}^{2}}{x - \mathsf{hypot}\left(1, x\right)} - \frac{{x}^{2} + 1}{x - \mathsf{hypot}\left(1, x\right)}\right)}\right), x\right) \]
    6. Step-by-step derivation
      1. div-sub16.0%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \color{blue}{\left(\frac{{x}^{2} - \left({x}^{2} + 1\right)}{x - \mathsf{hypot}\left(1, x\right)}\right)}\right), x\right) \]
      2. associate--r+54.6%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \left(\frac{\color{blue}{\left({x}^{2} - {x}^{2}\right) - 1}}{x - \mathsf{hypot}\left(1, x\right)}\right)\right), x\right) \]
      3. +-inverses98.9%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \left(\frac{\color{blue}{0} - 1}{x - \mathsf{hypot}\left(1, x\right)}\right)\right), x\right) \]
      4. metadata-eval98.9%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \left(\frac{\color{blue}{-1}}{x - \mathsf{hypot}\left(1, x\right)}\right)\right), x\right) \]
      5. metadata-eval98.9%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \left(\frac{\color{blue}{\frac{1}{-1}}}{x - \mathsf{hypot}\left(1, x\right)}\right)\right), x\right) \]
      6. metadata-eval98.9%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \left(\frac{\frac{\color{blue}{--1}}{-1}}{x - \mathsf{hypot}\left(1, x\right)}\right)\right), x\right) \]
      7. metadata-eval98.9%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \left(\frac{\frac{-\color{blue}{\left(0 - 1\right)}}{-1}}{x - \mathsf{hypot}\left(1, x\right)}\right)\right), x\right) \]
      8. +-inverses54.6%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \left(\frac{\frac{-\left(\color{blue}{\left({x}^{2} - {x}^{2}\right)} - 1\right)}{-1}}{x - \mathsf{hypot}\left(1, x\right)}\right)\right), x\right) \]
      9. associate--r+16.0%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \left(\frac{\frac{-\color{blue}{\left({x}^{2} - \left({x}^{2} + 1\right)\right)}}{-1}}{x - \mathsf{hypot}\left(1, x\right)}\right)\right), x\right) \]
      10. associate-/r*16.0%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \color{blue}{\left(\frac{-\left({x}^{2} - \left({x}^{2} + 1\right)\right)}{-1 \cdot \left(x - \mathsf{hypot}\left(1, x\right)\right)}\right)}\right), x\right) \]
      11. neg-mul-116.0%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \left(\frac{-\left({x}^{2} - \left({x}^{2} + 1\right)\right)}{\color{blue}{-\left(x - \mathsf{hypot}\left(1, x\right)\right)}}\right)\right), x\right) \]
      12. neg-mul-116.0%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \left(\frac{\color{blue}{-1 \cdot \left({x}^{2} - \left({x}^{2} + 1\right)\right)}}{-\left(x - \mathsf{hypot}\left(1, x\right)\right)}\right)\right), x\right) \]
      13. associate--r+54.6%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \left(\frac{-1 \cdot \color{blue}{\left(\left({x}^{2} - {x}^{2}\right) - 1\right)}}{-\left(x - \mathsf{hypot}\left(1, x\right)\right)}\right)\right), x\right) \]
      14. +-inverses98.9%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \left(\frac{-1 \cdot \left(\color{blue}{0} - 1\right)}{-\left(x - \mathsf{hypot}\left(1, x\right)\right)}\right)\right), x\right) \]
      15. metadata-eval98.9%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \left(\frac{-1 \cdot \color{blue}{-1}}{-\left(x - \mathsf{hypot}\left(1, x\right)\right)}\right)\right), x\right) \]
      16. metadata-eval98.9%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \left(\frac{\color{blue}{1}}{-\left(x - \mathsf{hypot}\left(1, x\right)\right)}\right)\right), x\right) \]
      17. neg-sub098.9%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \left(\frac{1}{\color{blue}{0 - \left(x - \mathsf{hypot}\left(1, x\right)\right)}}\right)\right), x\right) \]
      18. associate--r-98.9%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \left(\frac{1}{\color{blue}{\left(0 - x\right) + \mathsf{hypot}\left(1, x\right)}}\right)\right), x\right) \]
      19. neg-sub098.9%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \left(\frac{1}{\color{blue}{\left(-x\right)} + \mathsf{hypot}\left(1, x\right)}\right)\right), x\right) \]
      20. +-commutative98.9%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \left(\frac{1}{\color{blue}{\mathsf{hypot}\left(1, x\right) + \left(-x\right)}}\right)\right), x\right) \]
      21. sub-neg98.9%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \left(\frac{1}{\color{blue}{\mathsf{hypot}\left(1, x\right) - x}}\right)\right), x\right) \]
    7. Simplified98.9%

      \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \color{blue}{\left(\frac{1}{\mathsf{hypot}\left(1, x\right) - x}\right)}\right), x\right) \]
    8. Taylor expanded in x around -inf 97.4%

      \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \left(\frac{1}{\color{blue}{-2 \cdot x - 0.5 \cdot \frac{1}{x}}}\right)\right), x\right) \]
    9. Step-by-step derivation
      1. *-commutative97.4%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \left(\frac{1}{\color{blue}{x \cdot -2} - 0.5 \cdot \frac{1}{x}}\right)\right), x\right) \]
      2. associate-*r/97.4%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \left(\frac{1}{x \cdot -2 - \color{blue}{\frac{0.5 \cdot 1}{x}}}\right)\right), x\right) \]
      3. metadata-eval97.4%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \left(\frac{1}{x \cdot -2 - \frac{\color{blue}{0.5}}{x}}\right)\right), x\right) \]
    10. Simplified97.4%

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

    if -1 < x < 2

    1. Initial program 23.2%

      \[\mathsf{copysign}\left(\log \left(\left|x\right| + \sqrt{x \cdot x + 1}\right), x\right) \]
    2. Step-by-step derivation
      1. add-cbrt-cube23.2%

        \[\leadsto \mathsf{copysign}\left(\log \color{blue}{\left(\sqrt[3]{\left(\left(\left|x\right| + \sqrt{x \cdot x + 1}\right) \cdot \left(\left|x\right| + \sqrt{x \cdot x + 1}\right)\right) \cdot \left(\left|x\right| + \sqrt{x \cdot x + 1}\right)}\right)}, x\right) \]
      2. pow1/323.2%

        \[\leadsto \mathsf{copysign}\left(\log \color{blue}{\left({\left(\left(\left(\left|x\right| + \sqrt{x \cdot x + 1}\right) \cdot \left(\left|x\right| + \sqrt{x \cdot x + 1}\right)\right) \cdot \left(\left|x\right| + \sqrt{x \cdot x + 1}\right)\right)}^{0.3333333333333333}\right)}, x\right) \]
      3. log-pow23.3%

        \[\leadsto \mathsf{copysign}\left(\color{blue}{0.3333333333333333 \cdot \log \left(\left(\left(\left|x\right| + \sqrt{x \cdot x + 1}\right) \cdot \left(\left|x\right| + \sqrt{x \cdot x + 1}\right)\right) \cdot \left(\left|x\right| + \sqrt{x \cdot x + 1}\right)\right)}, x\right) \]
      4. pow323.3%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \log \color{blue}{\left({\left(\left|x\right| + \sqrt{x \cdot x + 1}\right)}^{3}\right)}, x\right) \]
      5. log-pow23.2%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \color{blue}{\left(3 \cdot \log \left(\left|x\right| + \sqrt{x \cdot x + 1}\right)\right)}, x\right) \]
      6. +-commutative23.2%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \left(\left|x\right| + \sqrt{\color{blue}{1 + x \cdot x}}\right)\right), x\right) \]
      7. hypot-1-def23.2%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \left(\left|x\right| + \color{blue}{\mathsf{hypot}\left(1, x\right)}\right)\right), x\right) \]
      8. add-sqr-sqrt14.1%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \left(\left|\color{blue}{\sqrt{x} \cdot \sqrt{x}}\right| + \mathsf{hypot}\left(1, x\right)\right)\right), x\right) \]
      9. fabs-sqr14.1%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \left(\color{blue}{\sqrt{x} \cdot \sqrt{x}} + \mathsf{hypot}\left(1, x\right)\right)\right), x\right) \]
      10. add-sqr-sqrt23.5%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \left(\color{blue}{x} + \mathsf{hypot}\left(1, x\right)\right)\right), x\right) \]
    3. Applied egg-rr23.5%

      \[\leadsto \mathsf{copysign}\left(\color{blue}{0.3333333333333333 \cdot \left(3 \cdot \log \left(x + \mathsf{hypot}\left(1, x\right)\right)\right)}, x\right) \]
    4. Taylor expanded in x around 0 95.9%

      \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \color{blue}{\left(x + -0.16666666666666666 \cdot {x}^{3}\right)}\right), x\right) \]
    5. Step-by-step derivation
      1. *-commutative95.9%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \left(x + \color{blue}{{x}^{3} \cdot -0.16666666666666666}\right)\right), x\right) \]
    6. Simplified95.9%

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

    if 2 < x

    1. Initial program 48.7%

      \[\mathsf{copysign}\left(\log \left(\left|x\right| + \sqrt{x \cdot x + 1}\right), x\right) \]
    2. Step-by-step derivation
      1. add-cbrt-cube37.2%

        \[\leadsto \mathsf{copysign}\left(\log \color{blue}{\left(\sqrt[3]{\left(\left(\left|x\right| + \sqrt{x \cdot x + 1}\right) \cdot \left(\left|x\right| + \sqrt{x \cdot x + 1}\right)\right) \cdot \left(\left|x\right| + \sqrt{x \cdot x + 1}\right)}\right)}, x\right) \]
      2. pow1/336.9%

        \[\leadsto \mathsf{copysign}\left(\log \color{blue}{\left({\left(\left(\left(\left|x\right| + \sqrt{x \cdot x + 1}\right) \cdot \left(\left|x\right| + \sqrt{x \cdot x + 1}\right)\right) \cdot \left(\left|x\right| + \sqrt{x \cdot x + 1}\right)\right)}^{0.3333333333333333}\right)}, x\right) \]
      3. log-pow37.0%

        \[\leadsto \mathsf{copysign}\left(\color{blue}{0.3333333333333333 \cdot \log \left(\left(\left(\left|x\right| + \sqrt{x \cdot x + 1}\right) \cdot \left(\left|x\right| + \sqrt{x \cdot x + 1}\right)\right) \cdot \left(\left|x\right| + \sqrt{x \cdot x + 1}\right)\right)}, x\right) \]
      4. pow337.0%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \log \color{blue}{\left({\left(\left|x\right| + \sqrt{x \cdot x + 1}\right)}^{3}\right)}, x\right) \]
      5. log-pow48.3%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \color{blue}{\left(3 \cdot \log \left(\left|x\right| + \sqrt{x \cdot x + 1}\right)\right)}, x\right) \]
      6. +-commutative48.3%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \left(\left|x\right| + \sqrt{\color{blue}{1 + x \cdot x}}\right)\right), x\right) \]
      7. hypot-1-def97.9%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \left(\left|x\right| + \color{blue}{\mathsf{hypot}\left(1, x\right)}\right)\right), x\right) \]
      8. add-sqr-sqrt97.9%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \left(\left|\color{blue}{\sqrt{x} \cdot \sqrt{x}}\right| + \mathsf{hypot}\left(1, x\right)\right)\right), x\right) \]
      9. fabs-sqr97.9%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \left(\color{blue}{\sqrt{x} \cdot \sqrt{x}} + \mathsf{hypot}\left(1, x\right)\right)\right), x\right) \]
      10. add-sqr-sqrt97.9%

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

      \[\leadsto \mathsf{copysign}\left(\color{blue}{0.3333333333333333 \cdot \left(3 \cdot \log \left(x + \mathsf{hypot}\left(1, x\right)\right)\right)}, x\right) \]
    4. Taylor expanded in x around inf 97.7%

      \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \color{blue}{\left(2 \cdot x + 0.5 \cdot \frac{1}{x}\right)}\right), x\right) \]
    5. Taylor expanded in x around 0 98.4%

      \[\leadsto \mathsf{copysign}\left(\color{blue}{\log 0.5 + -1 \cdot \log x}, x\right) \]
    6. Step-by-step derivation
      1. mul-1-neg98.4%

        \[\leadsto \mathsf{copysign}\left(\log 0.5 + \color{blue}{\left(-\log x\right)}, x\right) \]
      2. log-rec98.5%

        \[\leadsto \mathsf{copysign}\left(\log 0.5 + \color{blue}{\log \left(\frac{1}{x}\right)}, x\right) \]
      3. log-prod99.1%

        \[\leadsto \mathsf{copysign}\left(\color{blue}{\log \left(0.5 \cdot \frac{1}{x}\right)}, x\right) \]
      4. associate-*r/99.1%

        \[\leadsto \mathsf{copysign}\left(\log \color{blue}{\left(\frac{0.5 \cdot 1}{x}\right)}, x\right) \]
      5. metadata-eval99.1%

        \[\leadsto \mathsf{copysign}\left(\log \left(\frac{\color{blue}{0.5}}{x}\right), x\right) \]
    7. Simplified99.1%

      \[\leadsto \mathsf{copysign}\left(\color{blue}{\log \left(\frac{0.5}{x}\right)}, x\right) \]
  3. Recombined 3 regimes into one program.
  4. Final simplification97.2%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -1:\\ \;\;\;\;\mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \left(\frac{1}{x \cdot -2 - \frac{0.5}{x}}\right)\right), x\right)\\ \mathbf{elif}\;x \leq 2:\\ \;\;\;\;\mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \left(x + {x}^{3} \cdot -0.16666666666666666\right)\right), x\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{copysign}\left(\log \left(\frac{0.5}{x}\right), x\right)\\ \end{array} \]

Alternative 8: 97.4% accurate, 1.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -2:\\ \;\;\;\;\mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \left(\frac{-0.5}{x}\right)\right), x\right)\\ \mathbf{elif}\;x \leq 2:\\ \;\;\;\;\mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \left(x + {x}^{3} \cdot -0.16666666666666666\right)\right), x\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{copysign}\left(\log \left(\frac{0.5}{x}\right), x\right)\\ \end{array} \end{array} \]
(FPCore (x)
 :precision binary32
 (if (<= x -2.0)
   (copysign (* 0.3333333333333333 (* 3.0 (log (/ -0.5 x)))) x)
   (if (<= x 2.0)
     (copysign
      (* 0.3333333333333333 (* 3.0 (+ x (* (pow x 3.0) -0.16666666666666666))))
      x)
     (copysign (log (/ 0.5 x)) x))))
float code(float x) {
	float tmp;
	if (x <= -2.0f) {
		tmp = copysignf((0.3333333333333333f * (3.0f * logf((-0.5f / x)))), x);
	} else if (x <= 2.0f) {
		tmp = copysignf((0.3333333333333333f * (3.0f * (x + (powf(x, 3.0f) * -0.16666666666666666f)))), x);
	} else {
		tmp = copysignf(logf((0.5f / x)), x);
	}
	return tmp;
}
function code(x)
	tmp = Float32(0.0)
	if (x <= Float32(-2.0))
		tmp = copysign(Float32(Float32(0.3333333333333333) * Float32(Float32(3.0) * log(Float32(Float32(-0.5) / x)))), x);
	elseif (x <= Float32(2.0))
		tmp = copysign(Float32(Float32(0.3333333333333333) * Float32(Float32(3.0) * Float32(x + Float32((x ^ Float32(3.0)) * Float32(-0.16666666666666666))))), x);
	else
		tmp = copysign(log(Float32(Float32(0.5) / x)), x);
	end
	return tmp
end
function tmp_2 = code(x)
	tmp = single(0.0);
	if (x <= single(-2.0))
		tmp = sign(x) * abs((single(0.3333333333333333) * (single(3.0) * log((single(-0.5) / x)))));
	elseif (x <= single(2.0))
		tmp = sign(x) * abs((single(0.3333333333333333) * (single(3.0) * (x + ((x ^ single(3.0)) * single(-0.16666666666666666))))));
	else
		tmp = sign(x) * abs(log((single(0.5) / x)));
	end
	tmp_2 = tmp;
end
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \leq -2:\\
\;\;\;\;\mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \left(\frac{-0.5}{x}\right)\right), x\right)\\

\mathbf{elif}\;x \leq 2:\\
\;\;\;\;\mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \left(x + {x}^{3} \cdot -0.16666666666666666\right)\right), x\right)\\

\mathbf{else}:\\
\;\;\;\;\mathsf{copysign}\left(\log \left(\frac{0.5}{x}\right), x\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -2

    1. Initial program 57.5%

      \[\mathsf{copysign}\left(\log \left(\left|x\right| + \sqrt{x \cdot x + 1}\right), x\right) \]
    2. Step-by-step derivation
      1. add-cbrt-cube39.1%

        \[\leadsto \mathsf{copysign}\left(\log \color{blue}{\left(\sqrt[3]{\left(\left(\left|x\right| + \sqrt{x \cdot x + 1}\right) \cdot \left(\left|x\right| + \sqrt{x \cdot x + 1}\right)\right) \cdot \left(\left|x\right| + \sqrt{x \cdot x + 1}\right)}\right)}, x\right) \]
      2. pow1/338.6%

        \[\leadsto \mathsf{copysign}\left(\log \color{blue}{\left({\left(\left(\left(\left|x\right| + \sqrt{x \cdot x + 1}\right) \cdot \left(\left|x\right| + \sqrt{x \cdot x + 1}\right)\right) \cdot \left(\left|x\right| + \sqrt{x \cdot x + 1}\right)\right)}^{0.3333333333333333}\right)}, x\right) \]
      3. log-pow38.4%

        \[\leadsto \mathsf{copysign}\left(\color{blue}{0.3333333333333333 \cdot \log \left(\left(\left(\left|x\right| + \sqrt{x \cdot x + 1}\right) \cdot \left(\left|x\right| + \sqrt{x \cdot x + 1}\right)\right) \cdot \left(\left|x\right| + \sqrt{x \cdot x + 1}\right)\right)}, x\right) \]
      4. pow338.5%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \log \color{blue}{\left({\left(\left|x\right| + \sqrt{x \cdot x + 1}\right)}^{3}\right)}, x\right) \]
      5. log-pow56.9%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \color{blue}{\left(3 \cdot \log \left(\left|x\right| + \sqrt{x \cdot x + 1}\right)\right)}, x\right) \]
      6. +-commutative56.9%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \left(\left|x\right| + \sqrt{\color{blue}{1 + x \cdot x}}\right)\right), x\right) \]
      7. hypot-1-def98.9%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \left(\left|x\right| + \color{blue}{\mathsf{hypot}\left(1, x\right)}\right)\right), x\right) \]
      8. add-sqr-sqrt-0.0%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \left(\left|\color{blue}{\sqrt{x} \cdot \sqrt{x}}\right| + \mathsf{hypot}\left(1, x\right)\right)\right), x\right) \]
      9. fabs-sqr-0.0%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \left(\color{blue}{\sqrt{x} \cdot \sqrt{x}} + \mathsf{hypot}\left(1, x\right)\right)\right), x\right) \]
      10. add-sqr-sqrt14.7%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \left(\color{blue}{x} + \mathsf{hypot}\left(1, x\right)\right)\right), x\right) \]
    3. Applied egg-rr14.7%

      \[\leadsto \mathsf{copysign}\left(\color{blue}{0.3333333333333333 \cdot \left(3 \cdot \log \left(x + \mathsf{hypot}\left(1, x\right)\right)\right)}, x\right) \]
    4. Taylor expanded in x around -inf 96.0%

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

    if -2 < x < 2

    1. Initial program 23.9%

      \[\mathsf{copysign}\left(\log \left(\left|x\right| + \sqrt{x \cdot x + 1}\right), x\right) \]
    2. Step-by-step derivation
      1. add-cbrt-cube23.9%

        \[\leadsto \mathsf{copysign}\left(\log \color{blue}{\left(\sqrt[3]{\left(\left(\left|x\right| + \sqrt{x \cdot x + 1}\right) \cdot \left(\left|x\right| + \sqrt{x \cdot x + 1}\right)\right) \cdot \left(\left|x\right| + \sqrt{x \cdot x + 1}\right)}\right)}, x\right) \]
      2. pow1/323.9%

        \[\leadsto \mathsf{copysign}\left(\log \color{blue}{\left({\left(\left(\left(\left|x\right| + \sqrt{x \cdot x + 1}\right) \cdot \left(\left|x\right| + \sqrt{x \cdot x + 1}\right)\right) \cdot \left(\left|x\right| + \sqrt{x \cdot x + 1}\right)\right)}^{0.3333333333333333}\right)}, x\right) \]
      3. log-pow23.9%

        \[\leadsto \mathsf{copysign}\left(\color{blue}{0.3333333333333333 \cdot \log \left(\left(\left(\left|x\right| + \sqrt{x \cdot x + 1}\right) \cdot \left(\left|x\right| + \sqrt{x \cdot x + 1}\right)\right) \cdot \left(\left|x\right| + \sqrt{x \cdot x + 1}\right)\right)}, x\right) \]
      4. pow324.0%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \log \color{blue}{\left({\left(\left|x\right| + \sqrt{x \cdot x + 1}\right)}^{3}\right)}, x\right) \]
      5. log-pow23.8%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \color{blue}{\left(3 \cdot \log \left(\left|x\right| + \sqrt{x \cdot x + 1}\right)\right)}, x\right) \]
      6. +-commutative23.8%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \left(\left|x\right| + \sqrt{\color{blue}{1 + x \cdot x}}\right)\right), x\right) \]
      7. hypot-1-def23.8%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \left(\left|x\right| + \color{blue}{\mathsf{hypot}\left(1, x\right)}\right)\right), x\right) \]
      8. add-sqr-sqrt14.0%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \left(\left|\color{blue}{\sqrt{x} \cdot \sqrt{x}}\right| + \mathsf{hypot}\left(1, x\right)\right)\right), x\right) \]
      9. fabs-sqr14.0%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \left(\color{blue}{\sqrt{x} \cdot \sqrt{x}} + \mathsf{hypot}\left(1, x\right)\right)\right), x\right) \]
      10. add-sqr-sqrt24.1%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \left(\color{blue}{x} + \mathsf{hypot}\left(1, x\right)\right)\right), x\right) \]
    3. Applied egg-rr24.1%

      \[\leadsto \mathsf{copysign}\left(\color{blue}{0.3333333333333333 \cdot \left(3 \cdot \log \left(x + \mathsf{hypot}\left(1, x\right)\right)\right)}, x\right) \]
    4. Taylor expanded in x around 0 95.4%

      \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \color{blue}{\left(x + -0.16666666666666666 \cdot {x}^{3}\right)}\right), x\right) \]
    5. Step-by-step derivation
      1. *-commutative95.4%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \left(x + \color{blue}{{x}^{3} \cdot -0.16666666666666666}\right)\right), x\right) \]
    6. Simplified95.4%

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

    if 2 < x

    1. Initial program 48.7%

      \[\mathsf{copysign}\left(\log \left(\left|x\right| + \sqrt{x \cdot x + 1}\right), x\right) \]
    2. Step-by-step derivation
      1. add-cbrt-cube37.2%

        \[\leadsto \mathsf{copysign}\left(\log \color{blue}{\left(\sqrt[3]{\left(\left(\left|x\right| + \sqrt{x \cdot x + 1}\right) \cdot \left(\left|x\right| + \sqrt{x \cdot x + 1}\right)\right) \cdot \left(\left|x\right| + \sqrt{x \cdot x + 1}\right)}\right)}, x\right) \]
      2. pow1/336.9%

        \[\leadsto \mathsf{copysign}\left(\log \color{blue}{\left({\left(\left(\left(\left|x\right| + \sqrt{x \cdot x + 1}\right) \cdot \left(\left|x\right| + \sqrt{x \cdot x + 1}\right)\right) \cdot \left(\left|x\right| + \sqrt{x \cdot x + 1}\right)\right)}^{0.3333333333333333}\right)}, x\right) \]
      3. log-pow37.0%

        \[\leadsto \mathsf{copysign}\left(\color{blue}{0.3333333333333333 \cdot \log \left(\left(\left(\left|x\right| + \sqrt{x \cdot x + 1}\right) \cdot \left(\left|x\right| + \sqrt{x \cdot x + 1}\right)\right) \cdot \left(\left|x\right| + \sqrt{x \cdot x + 1}\right)\right)}, x\right) \]
      4. pow337.0%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \log \color{blue}{\left({\left(\left|x\right| + \sqrt{x \cdot x + 1}\right)}^{3}\right)}, x\right) \]
      5. log-pow48.3%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \color{blue}{\left(3 \cdot \log \left(\left|x\right| + \sqrt{x \cdot x + 1}\right)\right)}, x\right) \]
      6. +-commutative48.3%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \left(\left|x\right| + \sqrt{\color{blue}{1 + x \cdot x}}\right)\right), x\right) \]
      7. hypot-1-def97.9%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \left(\left|x\right| + \color{blue}{\mathsf{hypot}\left(1, x\right)}\right)\right), x\right) \]
      8. add-sqr-sqrt97.9%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \left(\left|\color{blue}{\sqrt{x} \cdot \sqrt{x}}\right| + \mathsf{hypot}\left(1, x\right)\right)\right), x\right) \]
      9. fabs-sqr97.9%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \left(\color{blue}{\sqrt{x} \cdot \sqrt{x}} + \mathsf{hypot}\left(1, x\right)\right)\right), x\right) \]
      10. add-sqr-sqrt97.9%

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

      \[\leadsto \mathsf{copysign}\left(\color{blue}{0.3333333333333333 \cdot \left(3 \cdot \log \left(x + \mathsf{hypot}\left(1, x\right)\right)\right)}, x\right) \]
    4. Taylor expanded in x around inf 97.7%

      \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \color{blue}{\left(2 \cdot x + 0.5 \cdot \frac{1}{x}\right)}\right), x\right) \]
    5. Taylor expanded in x around 0 98.4%

      \[\leadsto \mathsf{copysign}\left(\color{blue}{\log 0.5 + -1 \cdot \log x}, x\right) \]
    6. Step-by-step derivation
      1. mul-1-neg98.4%

        \[\leadsto \mathsf{copysign}\left(\log 0.5 + \color{blue}{\left(-\log x\right)}, x\right) \]
      2. log-rec98.5%

        \[\leadsto \mathsf{copysign}\left(\log 0.5 + \color{blue}{\log \left(\frac{1}{x}\right)}, x\right) \]
      3. log-prod99.1%

        \[\leadsto \mathsf{copysign}\left(\color{blue}{\log \left(0.5 \cdot \frac{1}{x}\right)}, x\right) \]
      4. associate-*r/99.1%

        \[\leadsto \mathsf{copysign}\left(\log \color{blue}{\left(\frac{0.5 \cdot 1}{x}\right)}, x\right) \]
      5. metadata-eval99.1%

        \[\leadsto \mathsf{copysign}\left(\log \left(\frac{\color{blue}{0.5}}{x}\right), x\right) \]
    7. Simplified99.1%

      \[\leadsto \mathsf{copysign}\left(\color{blue}{\log \left(\frac{0.5}{x}\right)}, x\right) \]
  3. Recombined 3 regimes into one program.
  4. Final simplification96.6%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -2:\\ \;\;\;\;\mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \left(\frac{-0.5}{x}\right)\right), x\right)\\ \mathbf{elif}\;x \leq 2:\\ \;\;\;\;\mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \left(x + {x}^{3} \cdot -0.16666666666666666\right)\right), x\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{copysign}\left(\log \left(\frac{0.5}{x}\right), x\right)\\ \end{array} \]

Alternative 9: 97.2% accurate, 1.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -2:\\ \;\;\;\;\mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \left(\frac{-0.5}{x}\right)\right), x\right)\\ \mathbf{elif}\;x \leq 2:\\ \;\;\;\;\mathsf{copysign}\left(x, x\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{copysign}\left(\log \left(\frac{0.5}{x}\right), x\right)\\ \end{array} \end{array} \]
(FPCore (x)
 :precision binary32
 (if (<= x -2.0)
   (copysign (* 0.3333333333333333 (* 3.0 (log (/ -0.5 x)))) x)
   (if (<= x 2.0) (copysign x x) (copysign (log (/ 0.5 x)) x))))
float code(float x) {
	float tmp;
	if (x <= -2.0f) {
		tmp = copysignf((0.3333333333333333f * (3.0f * logf((-0.5f / x)))), x);
	} else if (x <= 2.0f) {
		tmp = copysignf(x, x);
	} else {
		tmp = copysignf(logf((0.5f / x)), x);
	}
	return tmp;
}
function code(x)
	tmp = Float32(0.0)
	if (x <= Float32(-2.0))
		tmp = copysign(Float32(Float32(0.3333333333333333) * Float32(Float32(3.0) * log(Float32(Float32(-0.5) / x)))), x);
	elseif (x <= Float32(2.0))
		tmp = copysign(x, x);
	else
		tmp = copysign(log(Float32(Float32(0.5) / x)), x);
	end
	return tmp
end
function tmp_2 = code(x)
	tmp = single(0.0);
	if (x <= single(-2.0))
		tmp = sign(x) * abs((single(0.3333333333333333) * (single(3.0) * log((single(-0.5) / x)))));
	elseif (x <= single(2.0))
		tmp = sign(x) * abs(x);
	else
		tmp = sign(x) * abs(log((single(0.5) / x)));
	end
	tmp_2 = tmp;
end
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \leq -2:\\
\;\;\;\;\mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \left(\frac{-0.5}{x}\right)\right), x\right)\\

\mathbf{elif}\;x \leq 2:\\
\;\;\;\;\mathsf{copysign}\left(x, x\right)\\

\mathbf{else}:\\
\;\;\;\;\mathsf{copysign}\left(\log \left(\frac{0.5}{x}\right), x\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -2

    1. Initial program 57.5%

      \[\mathsf{copysign}\left(\log \left(\left|x\right| + \sqrt{x \cdot x + 1}\right), x\right) \]
    2. Step-by-step derivation
      1. add-cbrt-cube39.1%

        \[\leadsto \mathsf{copysign}\left(\log \color{blue}{\left(\sqrt[3]{\left(\left(\left|x\right| + \sqrt{x \cdot x + 1}\right) \cdot \left(\left|x\right| + \sqrt{x \cdot x + 1}\right)\right) \cdot \left(\left|x\right| + \sqrt{x \cdot x + 1}\right)}\right)}, x\right) \]
      2. pow1/338.6%

        \[\leadsto \mathsf{copysign}\left(\log \color{blue}{\left({\left(\left(\left(\left|x\right| + \sqrt{x \cdot x + 1}\right) \cdot \left(\left|x\right| + \sqrt{x \cdot x + 1}\right)\right) \cdot \left(\left|x\right| + \sqrt{x \cdot x + 1}\right)\right)}^{0.3333333333333333}\right)}, x\right) \]
      3. log-pow38.4%

        \[\leadsto \mathsf{copysign}\left(\color{blue}{0.3333333333333333 \cdot \log \left(\left(\left(\left|x\right| + \sqrt{x \cdot x + 1}\right) \cdot \left(\left|x\right| + \sqrt{x \cdot x + 1}\right)\right) \cdot \left(\left|x\right| + \sqrt{x \cdot x + 1}\right)\right)}, x\right) \]
      4. pow338.5%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \log \color{blue}{\left({\left(\left|x\right| + \sqrt{x \cdot x + 1}\right)}^{3}\right)}, x\right) \]
      5. log-pow56.9%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \color{blue}{\left(3 \cdot \log \left(\left|x\right| + \sqrt{x \cdot x + 1}\right)\right)}, x\right) \]
      6. +-commutative56.9%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \left(\left|x\right| + \sqrt{\color{blue}{1 + x \cdot x}}\right)\right), x\right) \]
      7. hypot-1-def98.9%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \left(\left|x\right| + \color{blue}{\mathsf{hypot}\left(1, x\right)}\right)\right), x\right) \]
      8. add-sqr-sqrt-0.0%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \left(\left|\color{blue}{\sqrt{x} \cdot \sqrt{x}}\right| + \mathsf{hypot}\left(1, x\right)\right)\right), x\right) \]
      9. fabs-sqr-0.0%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \left(\color{blue}{\sqrt{x} \cdot \sqrt{x}} + \mathsf{hypot}\left(1, x\right)\right)\right), x\right) \]
      10. add-sqr-sqrt14.7%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \left(\color{blue}{x} + \mathsf{hypot}\left(1, x\right)\right)\right), x\right) \]
    3. Applied egg-rr14.7%

      \[\leadsto \mathsf{copysign}\left(\color{blue}{0.3333333333333333 \cdot \left(3 \cdot \log \left(x + \mathsf{hypot}\left(1, x\right)\right)\right)}, x\right) \]
    4. Taylor expanded in x around -inf 96.0%

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

    if -2 < x < 2

    1. Initial program 23.9%

      \[\mathsf{copysign}\left(\log \left(\left|x\right| + \sqrt{x \cdot x + 1}\right), x\right) \]
    2. Step-by-step derivation
      1. add-cbrt-cube23.9%

        \[\leadsto \mathsf{copysign}\left(\log \color{blue}{\left(\sqrt[3]{\left(\left(\left|x\right| + \sqrt{x \cdot x + 1}\right) \cdot \left(\left|x\right| + \sqrt{x \cdot x + 1}\right)\right) \cdot \left(\left|x\right| + \sqrt{x \cdot x + 1}\right)}\right)}, x\right) \]
      2. pow1/323.9%

        \[\leadsto \mathsf{copysign}\left(\log \color{blue}{\left({\left(\left(\left(\left|x\right| + \sqrt{x \cdot x + 1}\right) \cdot \left(\left|x\right| + \sqrt{x \cdot x + 1}\right)\right) \cdot \left(\left|x\right| + \sqrt{x \cdot x + 1}\right)\right)}^{0.3333333333333333}\right)}, x\right) \]
      3. log-pow23.9%

        \[\leadsto \mathsf{copysign}\left(\color{blue}{0.3333333333333333 \cdot \log \left(\left(\left(\left|x\right| + \sqrt{x \cdot x + 1}\right) \cdot \left(\left|x\right| + \sqrt{x \cdot x + 1}\right)\right) \cdot \left(\left|x\right| + \sqrt{x \cdot x + 1}\right)\right)}, x\right) \]
      4. pow324.0%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \log \color{blue}{\left({\left(\left|x\right| + \sqrt{x \cdot x + 1}\right)}^{3}\right)}, x\right) \]
      5. log-pow23.8%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \color{blue}{\left(3 \cdot \log \left(\left|x\right| + \sqrt{x \cdot x + 1}\right)\right)}, x\right) \]
      6. +-commutative23.8%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \left(\left|x\right| + \sqrt{\color{blue}{1 + x \cdot x}}\right)\right), x\right) \]
      7. hypot-1-def23.8%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \left(\left|x\right| + \color{blue}{\mathsf{hypot}\left(1, x\right)}\right)\right), x\right) \]
      8. add-sqr-sqrt14.0%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \left(\left|\color{blue}{\sqrt{x} \cdot \sqrt{x}}\right| + \mathsf{hypot}\left(1, x\right)\right)\right), x\right) \]
      9. fabs-sqr14.0%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \left(\color{blue}{\sqrt{x} \cdot \sqrt{x}} + \mathsf{hypot}\left(1, x\right)\right)\right), x\right) \]
      10. add-sqr-sqrt24.1%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \left(\color{blue}{x} + \mathsf{hypot}\left(1, x\right)\right)\right), x\right) \]
    3. Applied egg-rr24.1%

      \[\leadsto \mathsf{copysign}\left(\color{blue}{0.3333333333333333 \cdot \left(3 \cdot \log \left(x + \mathsf{hypot}\left(1, x\right)\right)\right)}, x\right) \]
    4. Taylor expanded in x around 0 93.4%

      \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \color{blue}{\left(3 \cdot x\right)}, x\right) \]
    5. Step-by-step derivation
      1. *-commutative93.4%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \color{blue}{\left(x \cdot 3\right)}, x\right) \]
    6. Simplified93.4%

      \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \color{blue}{\left(x \cdot 3\right)}, x\right) \]
    7. Taylor expanded in x around 0 94.4%

      \[\leadsto \mathsf{copysign}\left(\color{blue}{x}, x\right) \]

    if 2 < x

    1. Initial program 48.7%

      \[\mathsf{copysign}\left(\log \left(\left|x\right| + \sqrt{x \cdot x + 1}\right), x\right) \]
    2. Step-by-step derivation
      1. add-cbrt-cube37.2%

        \[\leadsto \mathsf{copysign}\left(\log \color{blue}{\left(\sqrt[3]{\left(\left(\left|x\right| + \sqrt{x \cdot x + 1}\right) \cdot \left(\left|x\right| + \sqrt{x \cdot x + 1}\right)\right) \cdot \left(\left|x\right| + \sqrt{x \cdot x + 1}\right)}\right)}, x\right) \]
      2. pow1/336.9%

        \[\leadsto \mathsf{copysign}\left(\log \color{blue}{\left({\left(\left(\left(\left|x\right| + \sqrt{x \cdot x + 1}\right) \cdot \left(\left|x\right| + \sqrt{x \cdot x + 1}\right)\right) \cdot \left(\left|x\right| + \sqrt{x \cdot x + 1}\right)\right)}^{0.3333333333333333}\right)}, x\right) \]
      3. log-pow37.0%

        \[\leadsto \mathsf{copysign}\left(\color{blue}{0.3333333333333333 \cdot \log \left(\left(\left(\left|x\right| + \sqrt{x \cdot x + 1}\right) \cdot \left(\left|x\right| + \sqrt{x \cdot x + 1}\right)\right) \cdot \left(\left|x\right| + \sqrt{x \cdot x + 1}\right)\right)}, x\right) \]
      4. pow337.0%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \log \color{blue}{\left({\left(\left|x\right| + \sqrt{x \cdot x + 1}\right)}^{3}\right)}, x\right) \]
      5. log-pow48.3%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \color{blue}{\left(3 \cdot \log \left(\left|x\right| + \sqrt{x \cdot x + 1}\right)\right)}, x\right) \]
      6. +-commutative48.3%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \left(\left|x\right| + \sqrt{\color{blue}{1 + x \cdot x}}\right)\right), x\right) \]
      7. hypot-1-def97.9%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \left(\left|x\right| + \color{blue}{\mathsf{hypot}\left(1, x\right)}\right)\right), x\right) \]
      8. add-sqr-sqrt97.9%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \left(\left|\color{blue}{\sqrt{x} \cdot \sqrt{x}}\right| + \mathsf{hypot}\left(1, x\right)\right)\right), x\right) \]
      9. fabs-sqr97.9%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \left(\color{blue}{\sqrt{x} \cdot \sqrt{x}} + \mathsf{hypot}\left(1, x\right)\right)\right), x\right) \]
      10. add-sqr-sqrt97.9%

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

      \[\leadsto \mathsf{copysign}\left(\color{blue}{0.3333333333333333 \cdot \left(3 \cdot \log \left(x + \mathsf{hypot}\left(1, x\right)\right)\right)}, x\right) \]
    4. Taylor expanded in x around inf 97.7%

      \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \color{blue}{\left(2 \cdot x + 0.5 \cdot \frac{1}{x}\right)}\right), x\right) \]
    5. Taylor expanded in x around 0 98.4%

      \[\leadsto \mathsf{copysign}\left(\color{blue}{\log 0.5 + -1 \cdot \log x}, x\right) \]
    6. Step-by-step derivation
      1. mul-1-neg98.4%

        \[\leadsto \mathsf{copysign}\left(\log 0.5 + \color{blue}{\left(-\log x\right)}, x\right) \]
      2. log-rec98.5%

        \[\leadsto \mathsf{copysign}\left(\log 0.5 + \color{blue}{\log \left(\frac{1}{x}\right)}, x\right) \]
      3. log-prod99.1%

        \[\leadsto \mathsf{copysign}\left(\color{blue}{\log \left(0.5 \cdot \frac{1}{x}\right)}, x\right) \]
      4. associate-*r/99.1%

        \[\leadsto \mathsf{copysign}\left(\log \color{blue}{\left(\frac{0.5 \cdot 1}{x}\right)}, x\right) \]
      5. metadata-eval99.1%

        \[\leadsto \mathsf{copysign}\left(\log \left(\frac{\color{blue}{0.5}}{x}\right), x\right) \]
    7. Simplified99.1%

      \[\leadsto \mathsf{copysign}\left(\color{blue}{\log \left(\frac{0.5}{x}\right)}, x\right) \]
  3. Recombined 3 regimes into one program.
  4. Final simplification96.2%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -2:\\ \;\;\;\;\mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \left(\frac{-0.5}{x}\right)\right), x\right)\\ \mathbf{elif}\;x \leq 2:\\ \;\;\;\;\mathsf{copysign}\left(x, x\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{copysign}\left(\log \left(\frac{0.5}{x}\right), x\right)\\ \end{array} \]

Alternative 10: 84.0% accurate, 2.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -2:\\ \;\;\;\;\mathsf{copysign}\left(-\log \left(\frac{-1}{x}\right), x\right)\\ \mathbf{elif}\;x \leq 2:\\ \;\;\;\;\mathsf{copysign}\left(x, x\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{copysign}\left(\log \left(\frac{0.5}{x}\right), x\right)\\ \end{array} \end{array} \]
(FPCore (x)
 :precision binary32
 (if (<= x -2.0)
   (copysign (- (log (/ -1.0 x))) x)
   (if (<= x 2.0) (copysign x x) (copysign (log (/ 0.5 x)) x))))
float code(float x) {
	float tmp;
	if (x <= -2.0f) {
		tmp = copysignf(-logf((-1.0f / x)), x);
	} else if (x <= 2.0f) {
		tmp = copysignf(x, x);
	} else {
		tmp = copysignf(logf((0.5f / x)), x);
	}
	return tmp;
}
function code(x)
	tmp = Float32(0.0)
	if (x <= Float32(-2.0))
		tmp = copysign(Float32(-log(Float32(Float32(-1.0) / x))), x);
	elseif (x <= Float32(2.0))
		tmp = copysign(x, x);
	else
		tmp = copysign(log(Float32(Float32(0.5) / x)), x);
	end
	return tmp
end
function tmp_2 = code(x)
	tmp = single(0.0);
	if (x <= single(-2.0))
		tmp = sign(x) * abs(-log((single(-1.0) / x)));
	elseif (x <= single(2.0))
		tmp = sign(x) * abs(x);
	else
		tmp = sign(x) * abs(log((single(0.5) / x)));
	end
	tmp_2 = tmp;
end
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \leq -2:\\
\;\;\;\;\mathsf{copysign}\left(-\log \left(\frac{-1}{x}\right), x\right)\\

\mathbf{elif}\;x \leq 2:\\
\;\;\;\;\mathsf{copysign}\left(x, x\right)\\

\mathbf{else}:\\
\;\;\;\;\mathsf{copysign}\left(\log \left(\frac{0.5}{x}\right), x\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -2

    1. Initial program 57.5%

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

      \[\leadsto \mathsf{copysign}\left(\color{blue}{-1 \cdot \log \left(\frac{-1}{x}\right)}, x\right) \]
    3. Step-by-step derivation
      1. mul-1-neg43.7%

        \[\leadsto \mathsf{copysign}\left(\color{blue}{-\log \left(\frac{-1}{x}\right)}, x\right) \]
    4. Simplified43.7%

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

    if -2 < x < 2

    1. Initial program 23.9%

      \[\mathsf{copysign}\left(\log \left(\left|x\right| + \sqrt{x \cdot x + 1}\right), x\right) \]
    2. Step-by-step derivation
      1. add-cbrt-cube23.9%

        \[\leadsto \mathsf{copysign}\left(\log \color{blue}{\left(\sqrt[3]{\left(\left(\left|x\right| + \sqrt{x \cdot x + 1}\right) \cdot \left(\left|x\right| + \sqrt{x \cdot x + 1}\right)\right) \cdot \left(\left|x\right| + \sqrt{x \cdot x + 1}\right)}\right)}, x\right) \]
      2. pow1/323.9%

        \[\leadsto \mathsf{copysign}\left(\log \color{blue}{\left({\left(\left(\left(\left|x\right| + \sqrt{x \cdot x + 1}\right) \cdot \left(\left|x\right| + \sqrt{x \cdot x + 1}\right)\right) \cdot \left(\left|x\right| + \sqrt{x \cdot x + 1}\right)\right)}^{0.3333333333333333}\right)}, x\right) \]
      3. log-pow23.9%

        \[\leadsto \mathsf{copysign}\left(\color{blue}{0.3333333333333333 \cdot \log \left(\left(\left(\left|x\right| + \sqrt{x \cdot x + 1}\right) \cdot \left(\left|x\right| + \sqrt{x \cdot x + 1}\right)\right) \cdot \left(\left|x\right| + \sqrt{x \cdot x + 1}\right)\right)}, x\right) \]
      4. pow324.0%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \log \color{blue}{\left({\left(\left|x\right| + \sqrt{x \cdot x + 1}\right)}^{3}\right)}, x\right) \]
      5. log-pow23.8%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \color{blue}{\left(3 \cdot \log \left(\left|x\right| + \sqrt{x \cdot x + 1}\right)\right)}, x\right) \]
      6. +-commutative23.8%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \left(\left|x\right| + \sqrt{\color{blue}{1 + x \cdot x}}\right)\right), x\right) \]
      7. hypot-1-def23.8%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \left(\left|x\right| + \color{blue}{\mathsf{hypot}\left(1, x\right)}\right)\right), x\right) \]
      8. add-sqr-sqrt14.0%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \left(\left|\color{blue}{\sqrt{x} \cdot \sqrt{x}}\right| + \mathsf{hypot}\left(1, x\right)\right)\right), x\right) \]
      9. fabs-sqr14.0%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \left(\color{blue}{\sqrt{x} \cdot \sqrt{x}} + \mathsf{hypot}\left(1, x\right)\right)\right), x\right) \]
      10. add-sqr-sqrt24.1%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \left(\color{blue}{x} + \mathsf{hypot}\left(1, x\right)\right)\right), x\right) \]
    3. Applied egg-rr24.1%

      \[\leadsto \mathsf{copysign}\left(\color{blue}{0.3333333333333333 \cdot \left(3 \cdot \log \left(x + \mathsf{hypot}\left(1, x\right)\right)\right)}, x\right) \]
    4. Taylor expanded in x around 0 93.4%

      \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \color{blue}{\left(3 \cdot x\right)}, x\right) \]
    5. Step-by-step derivation
      1. *-commutative93.4%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \color{blue}{\left(x \cdot 3\right)}, x\right) \]
    6. Simplified93.4%

      \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \color{blue}{\left(x \cdot 3\right)}, x\right) \]
    7. Taylor expanded in x around 0 94.4%

      \[\leadsto \mathsf{copysign}\left(\color{blue}{x}, x\right) \]

    if 2 < x

    1. Initial program 48.7%

      \[\mathsf{copysign}\left(\log \left(\left|x\right| + \sqrt{x \cdot x + 1}\right), x\right) \]
    2. Step-by-step derivation
      1. add-cbrt-cube37.2%

        \[\leadsto \mathsf{copysign}\left(\log \color{blue}{\left(\sqrt[3]{\left(\left(\left|x\right| + \sqrt{x \cdot x + 1}\right) \cdot \left(\left|x\right| + \sqrt{x \cdot x + 1}\right)\right) \cdot \left(\left|x\right| + \sqrt{x \cdot x + 1}\right)}\right)}, x\right) \]
      2. pow1/336.9%

        \[\leadsto \mathsf{copysign}\left(\log \color{blue}{\left({\left(\left(\left(\left|x\right| + \sqrt{x \cdot x + 1}\right) \cdot \left(\left|x\right| + \sqrt{x \cdot x + 1}\right)\right) \cdot \left(\left|x\right| + \sqrt{x \cdot x + 1}\right)\right)}^{0.3333333333333333}\right)}, x\right) \]
      3. log-pow37.0%

        \[\leadsto \mathsf{copysign}\left(\color{blue}{0.3333333333333333 \cdot \log \left(\left(\left(\left|x\right| + \sqrt{x \cdot x + 1}\right) \cdot \left(\left|x\right| + \sqrt{x \cdot x + 1}\right)\right) \cdot \left(\left|x\right| + \sqrt{x \cdot x + 1}\right)\right)}, x\right) \]
      4. pow337.0%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \log \color{blue}{\left({\left(\left|x\right| + \sqrt{x \cdot x + 1}\right)}^{3}\right)}, x\right) \]
      5. log-pow48.3%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \color{blue}{\left(3 \cdot \log \left(\left|x\right| + \sqrt{x \cdot x + 1}\right)\right)}, x\right) \]
      6. +-commutative48.3%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \left(\left|x\right| + \sqrt{\color{blue}{1 + x \cdot x}}\right)\right), x\right) \]
      7. hypot-1-def97.9%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \left(\left|x\right| + \color{blue}{\mathsf{hypot}\left(1, x\right)}\right)\right), x\right) \]
      8. add-sqr-sqrt97.9%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \left(\left|\color{blue}{\sqrt{x} \cdot \sqrt{x}}\right| + \mathsf{hypot}\left(1, x\right)\right)\right), x\right) \]
      9. fabs-sqr97.9%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \left(\color{blue}{\sqrt{x} \cdot \sqrt{x}} + \mathsf{hypot}\left(1, x\right)\right)\right), x\right) \]
      10. add-sqr-sqrt97.9%

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

      \[\leadsto \mathsf{copysign}\left(\color{blue}{0.3333333333333333 \cdot \left(3 \cdot \log \left(x + \mathsf{hypot}\left(1, x\right)\right)\right)}, x\right) \]
    4. Taylor expanded in x around inf 97.7%

      \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \color{blue}{\left(2 \cdot x + 0.5 \cdot \frac{1}{x}\right)}\right), x\right) \]
    5. Taylor expanded in x around 0 98.4%

      \[\leadsto \mathsf{copysign}\left(\color{blue}{\log 0.5 + -1 \cdot \log x}, x\right) \]
    6. Step-by-step derivation
      1. mul-1-neg98.4%

        \[\leadsto \mathsf{copysign}\left(\log 0.5 + \color{blue}{\left(-\log x\right)}, x\right) \]
      2. log-rec98.5%

        \[\leadsto \mathsf{copysign}\left(\log 0.5 + \color{blue}{\log \left(\frac{1}{x}\right)}, x\right) \]
      3. log-prod99.1%

        \[\leadsto \mathsf{copysign}\left(\color{blue}{\log \left(0.5 \cdot \frac{1}{x}\right)}, x\right) \]
      4. associate-*r/99.1%

        \[\leadsto \mathsf{copysign}\left(\log \color{blue}{\left(\frac{0.5 \cdot 1}{x}\right)}, x\right) \]
      5. metadata-eval99.1%

        \[\leadsto \mathsf{copysign}\left(\log \left(\frac{\color{blue}{0.5}}{x}\right), x\right) \]
    7. Simplified99.1%

      \[\leadsto \mathsf{copysign}\left(\color{blue}{\log \left(\frac{0.5}{x}\right)}, x\right) \]
  3. Recombined 3 regimes into one program.
  4. Final simplification82.7%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -2:\\ \;\;\;\;\mathsf{copysign}\left(-\log \left(\frac{-1}{x}\right), x\right)\\ \mathbf{elif}\;x \leq 2:\\ \;\;\;\;\mathsf{copysign}\left(x, x\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{copysign}\left(\log \left(\frac{0.5}{x}\right), x\right)\\ \end{array} \]

Alternative 11: 84.0% accurate, 2.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -2:\\ \;\;\;\;\mathsf{copysign}\left(\log \left(-x\right), x\right)\\ \mathbf{elif}\;x \leq 2:\\ \;\;\;\;\mathsf{copysign}\left(x, x\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{copysign}\left(\log \left(\frac{0.5}{x}\right), x\right)\\ \end{array} \end{array} \]
(FPCore (x)
 :precision binary32
 (if (<= x -2.0)
   (copysign (log (- x)) x)
   (if (<= x 2.0) (copysign x x) (copysign (log (/ 0.5 x)) x))))
float code(float x) {
	float tmp;
	if (x <= -2.0f) {
		tmp = copysignf(logf(-x), x);
	} else if (x <= 2.0f) {
		tmp = copysignf(x, x);
	} else {
		tmp = copysignf(logf((0.5f / x)), x);
	}
	return tmp;
}
function code(x)
	tmp = Float32(0.0)
	if (x <= Float32(-2.0))
		tmp = copysign(log(Float32(-x)), x);
	elseif (x <= Float32(2.0))
		tmp = copysign(x, x);
	else
		tmp = copysign(log(Float32(Float32(0.5) / x)), x);
	end
	return tmp
end
function tmp_2 = code(x)
	tmp = single(0.0);
	if (x <= single(-2.0))
		tmp = sign(x) * abs(log(-x));
	elseif (x <= single(2.0))
		tmp = sign(x) * abs(x);
	else
		tmp = sign(x) * abs(log((single(0.5) / x)));
	end
	tmp_2 = tmp;
end
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \leq -2:\\
\;\;\;\;\mathsf{copysign}\left(\log \left(-x\right), x\right)\\

\mathbf{elif}\;x \leq 2:\\
\;\;\;\;\mathsf{copysign}\left(x, x\right)\\

\mathbf{else}:\\
\;\;\;\;\mathsf{copysign}\left(\log \left(\frac{0.5}{x}\right), x\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -2

    1. Initial program 57.5%

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

      \[\leadsto \mathsf{copysign}\left(\color{blue}{-1 \cdot \log \left(\frac{-1}{x}\right)}, x\right) \]
    3. Step-by-step derivation
      1. mul-1-neg43.7%

        \[\leadsto \mathsf{copysign}\left(\color{blue}{-\log \left(\frac{-1}{x}\right)}, x\right) \]
    4. Simplified43.7%

      \[\leadsto \mathsf{copysign}\left(\color{blue}{-\log \left(\frac{-1}{x}\right)}, x\right) \]
    5. Step-by-step derivation
      1. frac-2neg43.7%

        \[\leadsto \mathsf{copysign}\left(-\log \color{blue}{\left(\frac{--1}{-x}\right)}, x\right) \]
      2. metadata-eval43.7%

        \[\leadsto \mathsf{copysign}\left(-\log \left(\frac{\color{blue}{1}}{-x}\right), x\right) \]
      3. log-div43.7%

        \[\leadsto \mathsf{copysign}\left(-\color{blue}{\left(\log 1 - \log \left(-x\right)\right)}, x\right) \]
      4. metadata-eval43.7%

        \[\leadsto \mathsf{copysign}\left(-\left(\color{blue}{0} - \log \left(-x\right)\right), x\right) \]
    6. Applied egg-rr43.7%

      \[\leadsto \mathsf{copysign}\left(-\color{blue}{\left(0 - \log \left(-x\right)\right)}, x\right) \]
    7. Step-by-step derivation
      1. neg-sub043.7%

        \[\leadsto \mathsf{copysign}\left(-\color{blue}{\left(-\log \left(-x\right)\right)}, x\right) \]
    8. Simplified43.7%

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

    if -2 < x < 2

    1. Initial program 23.9%

      \[\mathsf{copysign}\left(\log \left(\left|x\right| + \sqrt{x \cdot x + 1}\right), x\right) \]
    2. Step-by-step derivation
      1. add-cbrt-cube23.9%

        \[\leadsto \mathsf{copysign}\left(\log \color{blue}{\left(\sqrt[3]{\left(\left(\left|x\right| + \sqrt{x \cdot x + 1}\right) \cdot \left(\left|x\right| + \sqrt{x \cdot x + 1}\right)\right) \cdot \left(\left|x\right| + \sqrt{x \cdot x + 1}\right)}\right)}, x\right) \]
      2. pow1/323.9%

        \[\leadsto \mathsf{copysign}\left(\log \color{blue}{\left({\left(\left(\left(\left|x\right| + \sqrt{x \cdot x + 1}\right) \cdot \left(\left|x\right| + \sqrt{x \cdot x + 1}\right)\right) \cdot \left(\left|x\right| + \sqrt{x \cdot x + 1}\right)\right)}^{0.3333333333333333}\right)}, x\right) \]
      3. log-pow23.9%

        \[\leadsto \mathsf{copysign}\left(\color{blue}{0.3333333333333333 \cdot \log \left(\left(\left(\left|x\right| + \sqrt{x \cdot x + 1}\right) \cdot \left(\left|x\right| + \sqrt{x \cdot x + 1}\right)\right) \cdot \left(\left|x\right| + \sqrt{x \cdot x + 1}\right)\right)}, x\right) \]
      4. pow324.0%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \log \color{blue}{\left({\left(\left|x\right| + \sqrt{x \cdot x + 1}\right)}^{3}\right)}, x\right) \]
      5. log-pow23.8%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \color{blue}{\left(3 \cdot \log \left(\left|x\right| + \sqrt{x \cdot x + 1}\right)\right)}, x\right) \]
      6. +-commutative23.8%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \left(\left|x\right| + \sqrt{\color{blue}{1 + x \cdot x}}\right)\right), x\right) \]
      7. hypot-1-def23.8%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \left(\left|x\right| + \color{blue}{\mathsf{hypot}\left(1, x\right)}\right)\right), x\right) \]
      8. add-sqr-sqrt14.0%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \left(\left|\color{blue}{\sqrt{x} \cdot \sqrt{x}}\right| + \mathsf{hypot}\left(1, x\right)\right)\right), x\right) \]
      9. fabs-sqr14.0%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \left(\color{blue}{\sqrt{x} \cdot \sqrt{x}} + \mathsf{hypot}\left(1, x\right)\right)\right), x\right) \]
      10. add-sqr-sqrt24.1%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \left(\color{blue}{x} + \mathsf{hypot}\left(1, x\right)\right)\right), x\right) \]
    3. Applied egg-rr24.1%

      \[\leadsto \mathsf{copysign}\left(\color{blue}{0.3333333333333333 \cdot \left(3 \cdot \log \left(x + \mathsf{hypot}\left(1, x\right)\right)\right)}, x\right) \]
    4. Taylor expanded in x around 0 93.4%

      \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \color{blue}{\left(3 \cdot x\right)}, x\right) \]
    5. Step-by-step derivation
      1. *-commutative93.4%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \color{blue}{\left(x \cdot 3\right)}, x\right) \]
    6. Simplified93.4%

      \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \color{blue}{\left(x \cdot 3\right)}, x\right) \]
    7. Taylor expanded in x around 0 94.4%

      \[\leadsto \mathsf{copysign}\left(\color{blue}{x}, x\right) \]

    if 2 < x

    1. Initial program 48.7%

      \[\mathsf{copysign}\left(\log \left(\left|x\right| + \sqrt{x \cdot x + 1}\right), x\right) \]
    2. Step-by-step derivation
      1. add-cbrt-cube37.2%

        \[\leadsto \mathsf{copysign}\left(\log \color{blue}{\left(\sqrt[3]{\left(\left(\left|x\right| + \sqrt{x \cdot x + 1}\right) \cdot \left(\left|x\right| + \sqrt{x \cdot x + 1}\right)\right) \cdot \left(\left|x\right| + \sqrt{x \cdot x + 1}\right)}\right)}, x\right) \]
      2. pow1/336.9%

        \[\leadsto \mathsf{copysign}\left(\log \color{blue}{\left({\left(\left(\left(\left|x\right| + \sqrt{x \cdot x + 1}\right) \cdot \left(\left|x\right| + \sqrt{x \cdot x + 1}\right)\right) \cdot \left(\left|x\right| + \sqrt{x \cdot x + 1}\right)\right)}^{0.3333333333333333}\right)}, x\right) \]
      3. log-pow37.0%

        \[\leadsto \mathsf{copysign}\left(\color{blue}{0.3333333333333333 \cdot \log \left(\left(\left(\left|x\right| + \sqrt{x \cdot x + 1}\right) \cdot \left(\left|x\right| + \sqrt{x \cdot x + 1}\right)\right) \cdot \left(\left|x\right| + \sqrt{x \cdot x + 1}\right)\right)}, x\right) \]
      4. pow337.0%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \log \color{blue}{\left({\left(\left|x\right| + \sqrt{x \cdot x + 1}\right)}^{3}\right)}, x\right) \]
      5. log-pow48.3%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \color{blue}{\left(3 \cdot \log \left(\left|x\right| + \sqrt{x \cdot x + 1}\right)\right)}, x\right) \]
      6. +-commutative48.3%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \left(\left|x\right| + \sqrt{\color{blue}{1 + x \cdot x}}\right)\right), x\right) \]
      7. hypot-1-def97.9%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \left(\left|x\right| + \color{blue}{\mathsf{hypot}\left(1, x\right)}\right)\right), x\right) \]
      8. add-sqr-sqrt97.9%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \left(\left|\color{blue}{\sqrt{x} \cdot \sqrt{x}}\right| + \mathsf{hypot}\left(1, x\right)\right)\right), x\right) \]
      9. fabs-sqr97.9%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \left(\color{blue}{\sqrt{x} \cdot \sqrt{x}} + \mathsf{hypot}\left(1, x\right)\right)\right), x\right) \]
      10. add-sqr-sqrt97.9%

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

      \[\leadsto \mathsf{copysign}\left(\color{blue}{0.3333333333333333 \cdot \left(3 \cdot \log \left(x + \mathsf{hypot}\left(1, x\right)\right)\right)}, x\right) \]
    4. Taylor expanded in x around inf 97.7%

      \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \color{blue}{\left(2 \cdot x + 0.5 \cdot \frac{1}{x}\right)}\right), x\right) \]
    5. Taylor expanded in x around 0 98.4%

      \[\leadsto \mathsf{copysign}\left(\color{blue}{\log 0.5 + -1 \cdot \log x}, x\right) \]
    6. Step-by-step derivation
      1. mul-1-neg98.4%

        \[\leadsto \mathsf{copysign}\left(\log 0.5 + \color{blue}{\left(-\log x\right)}, x\right) \]
      2. log-rec98.5%

        \[\leadsto \mathsf{copysign}\left(\log 0.5 + \color{blue}{\log \left(\frac{1}{x}\right)}, x\right) \]
      3. log-prod99.1%

        \[\leadsto \mathsf{copysign}\left(\color{blue}{\log \left(0.5 \cdot \frac{1}{x}\right)}, x\right) \]
      4. associate-*r/99.1%

        \[\leadsto \mathsf{copysign}\left(\log \color{blue}{\left(\frac{0.5 \cdot 1}{x}\right)}, x\right) \]
      5. metadata-eval99.1%

        \[\leadsto \mathsf{copysign}\left(\log \left(\frac{\color{blue}{0.5}}{x}\right), x\right) \]
    7. Simplified99.1%

      \[\leadsto \mathsf{copysign}\left(\color{blue}{\log \left(\frac{0.5}{x}\right)}, x\right) \]
  3. Recombined 3 regimes into one program.
  4. Final simplification82.7%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -2:\\ \;\;\;\;\mathsf{copysign}\left(\log \left(-x\right), x\right)\\ \mathbf{elif}\;x \leq 2:\\ \;\;\;\;\mathsf{copysign}\left(x, x\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{copysign}\left(\log \left(\frac{0.5}{x}\right), x\right)\\ \end{array} \]

Alternative 12: 75.5% accurate, 2.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq 2:\\ \;\;\;\;\mathsf{copysign}\left(x, x\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{copysign}\left(\log \left(x \cdot 2\right), x\right)\\ \end{array} \end{array} \]
(FPCore (x)
 :precision binary32
 (if (<= x 2.0) (copysign x x) (copysign (log (* x 2.0)) x)))
float code(float x) {
	float tmp;
	if (x <= 2.0f) {
		tmp = copysignf(x, x);
	} else {
		tmp = copysignf(logf((x * 2.0f)), x);
	}
	return tmp;
}
function code(x)
	tmp = Float32(0.0)
	if (x <= Float32(2.0))
		tmp = copysign(x, x);
	else
		tmp = copysign(log(Float32(x * Float32(2.0))), x);
	end
	return tmp
end
function tmp_2 = code(x)
	tmp = single(0.0);
	if (x <= single(2.0))
		tmp = sign(x) * abs(x);
	else
		tmp = sign(x) * abs(log((x * single(2.0))));
	end
	tmp_2 = tmp;
end
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \leq 2:\\
\;\;\;\;\mathsf{copysign}\left(x, x\right)\\

\mathbf{else}:\\
\;\;\;\;\mathsf{copysign}\left(\log \left(x \cdot 2\right), x\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < 2

    1. Initial program 36.0%

      \[\mathsf{copysign}\left(\log \left(\left|x\right| + \sqrt{x \cdot x + 1}\right), x\right) \]
    2. Step-by-step derivation
      1. add-cbrt-cube29.3%

        \[\leadsto \mathsf{copysign}\left(\log \color{blue}{\left(\sqrt[3]{\left(\left(\left|x\right| + \sqrt{x \cdot x + 1}\right) \cdot \left(\left|x\right| + \sqrt{x \cdot x + 1}\right)\right) \cdot \left(\left|x\right| + \sqrt{x \cdot x + 1}\right)}\right)}, x\right) \]
      2. pow1/329.2%

        \[\leadsto \mathsf{copysign}\left(\log \color{blue}{\left({\left(\left(\left(\left|x\right| + \sqrt{x \cdot x + 1}\right) \cdot \left(\left|x\right| + \sqrt{x \cdot x + 1}\right)\right) \cdot \left(\left|x\right| + \sqrt{x \cdot x + 1}\right)\right)}^{0.3333333333333333}\right)}, x\right) \]
      3. log-pow29.1%

        \[\leadsto \mathsf{copysign}\left(\color{blue}{0.3333333333333333 \cdot \log \left(\left(\left(\left|x\right| + \sqrt{x \cdot x + 1}\right) \cdot \left(\left|x\right| + \sqrt{x \cdot x + 1}\right)\right) \cdot \left(\left|x\right| + \sqrt{x \cdot x + 1}\right)\right)}, x\right) \]
      4. pow329.2%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \log \color{blue}{\left({\left(\left|x\right| + \sqrt{x \cdot x + 1}\right)}^{3}\right)}, x\right) \]
      5. log-pow35.8%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \color{blue}{\left(3 \cdot \log \left(\left|x\right| + \sqrt{x \cdot x + 1}\right)\right)}, x\right) \]
      6. +-commutative35.8%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \left(\left|x\right| + \sqrt{\color{blue}{1 + x \cdot x}}\right)\right), x\right) \]
      7. hypot-1-def50.9%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \left(\left|x\right| + \color{blue}{\mathsf{hypot}\left(1, x\right)}\right)\right), x\right) \]
      8. add-sqr-sqrt8.9%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \left(\left|\color{blue}{\sqrt{x} \cdot \sqrt{x}}\right| + \mathsf{hypot}\left(1, x\right)\right)\right), x\right) \]
      9. fabs-sqr8.9%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \left(\color{blue}{\sqrt{x} \cdot \sqrt{x}} + \mathsf{hypot}\left(1, x\right)\right)\right), x\right) \]
      10. add-sqr-sqrt20.7%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \left(\color{blue}{x} + \mathsf{hypot}\left(1, x\right)\right)\right), x\right) \]
    3. Applied egg-rr20.7%

      \[\leadsto \mathsf{copysign}\left(\color{blue}{0.3333333333333333 \cdot \left(3 \cdot \log \left(x + \mathsf{hypot}\left(1, x\right)\right)\right)}, x\right) \]
    4. Taylor expanded in x around 0 64.0%

      \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \color{blue}{\left(3 \cdot x\right)}, x\right) \]
    5. Step-by-step derivation
      1. *-commutative64.0%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \color{blue}{\left(x \cdot 3\right)}, x\right) \]
    6. Simplified64.0%

      \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \color{blue}{\left(x \cdot 3\right)}, x\right) \]
    7. Taylor expanded in x around 0 64.6%

      \[\leadsto \mathsf{copysign}\left(\color{blue}{x}, x\right) \]

    if 2 < x

    1. Initial program 48.7%

      \[\mathsf{copysign}\left(\log \left(\left|x\right| + \sqrt{x \cdot x + 1}\right), x\right) \]
    2. Step-by-step derivation
      1. add-cbrt-cube37.2%

        \[\leadsto \mathsf{copysign}\left(\log \color{blue}{\left(\sqrt[3]{\left(\left(\left|x\right| + \sqrt{x \cdot x + 1}\right) \cdot \left(\left|x\right| + \sqrt{x \cdot x + 1}\right)\right) \cdot \left(\left|x\right| + \sqrt{x \cdot x + 1}\right)}\right)}, x\right) \]
      2. pow1/336.9%

        \[\leadsto \mathsf{copysign}\left(\log \color{blue}{\left({\left(\left(\left(\left|x\right| + \sqrt{x \cdot x + 1}\right) \cdot \left(\left|x\right| + \sqrt{x \cdot x + 1}\right)\right) \cdot \left(\left|x\right| + \sqrt{x \cdot x + 1}\right)\right)}^{0.3333333333333333}\right)}, x\right) \]
      3. log-pow37.0%

        \[\leadsto \mathsf{copysign}\left(\color{blue}{0.3333333333333333 \cdot \log \left(\left(\left(\left|x\right| + \sqrt{x \cdot x + 1}\right) \cdot \left(\left|x\right| + \sqrt{x \cdot x + 1}\right)\right) \cdot \left(\left|x\right| + \sqrt{x \cdot x + 1}\right)\right)}, x\right) \]
      4. pow337.0%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \log \color{blue}{\left({\left(\left|x\right| + \sqrt{x \cdot x + 1}\right)}^{3}\right)}, x\right) \]
      5. log-pow48.3%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \color{blue}{\left(3 \cdot \log \left(\left|x\right| + \sqrt{x \cdot x + 1}\right)\right)}, x\right) \]
      6. +-commutative48.3%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \left(\left|x\right| + \sqrt{\color{blue}{1 + x \cdot x}}\right)\right), x\right) \]
      7. hypot-1-def97.9%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \left(\left|x\right| + \color{blue}{\mathsf{hypot}\left(1, x\right)}\right)\right), x\right) \]
      8. add-sqr-sqrt97.9%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \left(\left|\color{blue}{\sqrt{x} \cdot \sqrt{x}}\right| + \mathsf{hypot}\left(1, x\right)\right)\right), x\right) \]
      9. fabs-sqr97.9%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \left(\color{blue}{\sqrt{x} \cdot \sqrt{x}} + \mathsf{hypot}\left(1, x\right)\right)\right), x\right) \]
      10. add-sqr-sqrt97.9%

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

      \[\leadsto \mathsf{copysign}\left(\color{blue}{0.3333333333333333 \cdot \left(3 \cdot \log \left(x + \mathsf{hypot}\left(1, x\right)\right)\right)}, x\right) \]
    4. Taylor expanded in x around inf 97.1%

      \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \color{blue}{\left(2 \cdot x\right)}\right), x\right) \]
    5. Step-by-step derivation
      1. *-commutative97.1%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \color{blue}{\left(x \cdot 2\right)}\right), x\right) \]
    6. Simplified97.1%

      \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \color{blue}{\left(x \cdot 2\right)}\right), x\right) \]
    7. Taylor expanded in x around 0 98.4%

      \[\leadsto \mathsf{copysign}\left(\color{blue}{\log 2 + \log x}, x\right) \]
    8. Step-by-step derivation
      1. +-commutative98.4%

        \[\leadsto \mathsf{copysign}\left(\color{blue}{\log x + \log 2}, x\right) \]
      2. log-prod97.9%

        \[\leadsto \mathsf{copysign}\left(\color{blue}{\log \left(x \cdot 2\right)}, x\right) \]
    9. Simplified97.9%

      \[\leadsto \mathsf{copysign}\left(\color{blue}{\log \left(x \cdot 2\right)}, x\right) \]
  3. Recombined 2 regimes into one program.
  4. Final simplification74.1%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq 2:\\ \;\;\;\;\mathsf{copysign}\left(x, x\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{copysign}\left(\log \left(x \cdot 2\right), x\right)\\ \end{array} \]

Alternative 13: 75.7% accurate, 2.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq 2:\\ \;\;\;\;\mathsf{copysign}\left(x, x\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{copysign}\left(\log \left(\frac{0.5}{x}\right), x\right)\\ \end{array} \end{array} \]
(FPCore (x)
 :precision binary32
 (if (<= x 2.0) (copysign x x) (copysign (log (/ 0.5 x)) x)))
float code(float x) {
	float tmp;
	if (x <= 2.0f) {
		tmp = copysignf(x, x);
	} else {
		tmp = copysignf(logf((0.5f / x)), x);
	}
	return tmp;
}
function code(x)
	tmp = Float32(0.0)
	if (x <= Float32(2.0))
		tmp = copysign(x, x);
	else
		tmp = copysign(log(Float32(Float32(0.5) / x)), x);
	end
	return tmp
end
function tmp_2 = code(x)
	tmp = single(0.0);
	if (x <= single(2.0))
		tmp = sign(x) * abs(x);
	else
		tmp = sign(x) * abs(log((single(0.5) / x)));
	end
	tmp_2 = tmp;
end
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \leq 2:\\
\;\;\;\;\mathsf{copysign}\left(x, x\right)\\

\mathbf{else}:\\
\;\;\;\;\mathsf{copysign}\left(\log \left(\frac{0.5}{x}\right), x\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < 2

    1. Initial program 36.0%

      \[\mathsf{copysign}\left(\log \left(\left|x\right| + \sqrt{x \cdot x + 1}\right), x\right) \]
    2. Step-by-step derivation
      1. add-cbrt-cube29.3%

        \[\leadsto \mathsf{copysign}\left(\log \color{blue}{\left(\sqrt[3]{\left(\left(\left|x\right| + \sqrt{x \cdot x + 1}\right) \cdot \left(\left|x\right| + \sqrt{x \cdot x + 1}\right)\right) \cdot \left(\left|x\right| + \sqrt{x \cdot x + 1}\right)}\right)}, x\right) \]
      2. pow1/329.2%

        \[\leadsto \mathsf{copysign}\left(\log \color{blue}{\left({\left(\left(\left(\left|x\right| + \sqrt{x \cdot x + 1}\right) \cdot \left(\left|x\right| + \sqrt{x \cdot x + 1}\right)\right) \cdot \left(\left|x\right| + \sqrt{x \cdot x + 1}\right)\right)}^{0.3333333333333333}\right)}, x\right) \]
      3. log-pow29.1%

        \[\leadsto \mathsf{copysign}\left(\color{blue}{0.3333333333333333 \cdot \log \left(\left(\left(\left|x\right| + \sqrt{x \cdot x + 1}\right) \cdot \left(\left|x\right| + \sqrt{x \cdot x + 1}\right)\right) \cdot \left(\left|x\right| + \sqrt{x \cdot x + 1}\right)\right)}, x\right) \]
      4. pow329.2%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \log \color{blue}{\left({\left(\left|x\right| + \sqrt{x \cdot x + 1}\right)}^{3}\right)}, x\right) \]
      5. log-pow35.8%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \color{blue}{\left(3 \cdot \log \left(\left|x\right| + \sqrt{x \cdot x + 1}\right)\right)}, x\right) \]
      6. +-commutative35.8%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \left(\left|x\right| + \sqrt{\color{blue}{1 + x \cdot x}}\right)\right), x\right) \]
      7. hypot-1-def50.9%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \left(\left|x\right| + \color{blue}{\mathsf{hypot}\left(1, x\right)}\right)\right), x\right) \]
      8. add-sqr-sqrt8.9%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \left(\left|\color{blue}{\sqrt{x} \cdot \sqrt{x}}\right| + \mathsf{hypot}\left(1, x\right)\right)\right), x\right) \]
      9. fabs-sqr8.9%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \left(\color{blue}{\sqrt{x} \cdot \sqrt{x}} + \mathsf{hypot}\left(1, x\right)\right)\right), x\right) \]
      10. add-sqr-sqrt20.7%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \left(\color{blue}{x} + \mathsf{hypot}\left(1, x\right)\right)\right), x\right) \]
    3. Applied egg-rr20.7%

      \[\leadsto \mathsf{copysign}\left(\color{blue}{0.3333333333333333 \cdot \left(3 \cdot \log \left(x + \mathsf{hypot}\left(1, x\right)\right)\right)}, x\right) \]
    4. Taylor expanded in x around 0 64.0%

      \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \color{blue}{\left(3 \cdot x\right)}, x\right) \]
    5. Step-by-step derivation
      1. *-commutative64.0%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \color{blue}{\left(x \cdot 3\right)}, x\right) \]
    6. Simplified64.0%

      \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \color{blue}{\left(x \cdot 3\right)}, x\right) \]
    7. Taylor expanded in x around 0 64.6%

      \[\leadsto \mathsf{copysign}\left(\color{blue}{x}, x\right) \]

    if 2 < x

    1. Initial program 48.7%

      \[\mathsf{copysign}\left(\log \left(\left|x\right| + \sqrt{x \cdot x + 1}\right), x\right) \]
    2. Step-by-step derivation
      1. add-cbrt-cube37.2%

        \[\leadsto \mathsf{copysign}\left(\log \color{blue}{\left(\sqrt[3]{\left(\left(\left|x\right| + \sqrt{x \cdot x + 1}\right) \cdot \left(\left|x\right| + \sqrt{x \cdot x + 1}\right)\right) \cdot \left(\left|x\right| + \sqrt{x \cdot x + 1}\right)}\right)}, x\right) \]
      2. pow1/336.9%

        \[\leadsto \mathsf{copysign}\left(\log \color{blue}{\left({\left(\left(\left(\left|x\right| + \sqrt{x \cdot x + 1}\right) \cdot \left(\left|x\right| + \sqrt{x \cdot x + 1}\right)\right) \cdot \left(\left|x\right| + \sqrt{x \cdot x + 1}\right)\right)}^{0.3333333333333333}\right)}, x\right) \]
      3. log-pow37.0%

        \[\leadsto \mathsf{copysign}\left(\color{blue}{0.3333333333333333 \cdot \log \left(\left(\left(\left|x\right| + \sqrt{x \cdot x + 1}\right) \cdot \left(\left|x\right| + \sqrt{x \cdot x + 1}\right)\right) \cdot \left(\left|x\right| + \sqrt{x \cdot x + 1}\right)\right)}, x\right) \]
      4. pow337.0%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \log \color{blue}{\left({\left(\left|x\right| + \sqrt{x \cdot x + 1}\right)}^{3}\right)}, x\right) \]
      5. log-pow48.3%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \color{blue}{\left(3 \cdot \log \left(\left|x\right| + \sqrt{x \cdot x + 1}\right)\right)}, x\right) \]
      6. +-commutative48.3%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \left(\left|x\right| + \sqrt{\color{blue}{1 + x \cdot x}}\right)\right), x\right) \]
      7. hypot-1-def97.9%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \left(\left|x\right| + \color{blue}{\mathsf{hypot}\left(1, x\right)}\right)\right), x\right) \]
      8. add-sqr-sqrt97.9%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \left(\left|\color{blue}{\sqrt{x} \cdot \sqrt{x}}\right| + \mathsf{hypot}\left(1, x\right)\right)\right), x\right) \]
      9. fabs-sqr97.9%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \left(\color{blue}{\sqrt{x} \cdot \sqrt{x}} + \mathsf{hypot}\left(1, x\right)\right)\right), x\right) \]
      10. add-sqr-sqrt97.9%

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

      \[\leadsto \mathsf{copysign}\left(\color{blue}{0.3333333333333333 \cdot \left(3 \cdot \log \left(x + \mathsf{hypot}\left(1, x\right)\right)\right)}, x\right) \]
    4. Taylor expanded in x around inf 97.7%

      \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \color{blue}{\left(2 \cdot x + 0.5 \cdot \frac{1}{x}\right)}\right), x\right) \]
    5. Taylor expanded in x around 0 98.4%

      \[\leadsto \mathsf{copysign}\left(\color{blue}{\log 0.5 + -1 \cdot \log x}, x\right) \]
    6. Step-by-step derivation
      1. mul-1-neg98.4%

        \[\leadsto \mathsf{copysign}\left(\log 0.5 + \color{blue}{\left(-\log x\right)}, x\right) \]
      2. log-rec98.5%

        \[\leadsto \mathsf{copysign}\left(\log 0.5 + \color{blue}{\log \left(\frac{1}{x}\right)}, x\right) \]
      3. log-prod99.1%

        \[\leadsto \mathsf{copysign}\left(\color{blue}{\log \left(0.5 \cdot \frac{1}{x}\right)}, x\right) \]
      4. associate-*r/99.1%

        \[\leadsto \mathsf{copysign}\left(\log \color{blue}{\left(\frac{0.5 \cdot 1}{x}\right)}, x\right) \]
      5. metadata-eval99.1%

        \[\leadsto \mathsf{copysign}\left(\log \left(\frac{\color{blue}{0.5}}{x}\right), x\right) \]
    7. Simplified99.1%

      \[\leadsto \mathsf{copysign}\left(\color{blue}{\log \left(\frac{0.5}{x}\right)}, x\right) \]
  3. Recombined 2 regimes into one program.
  4. Final simplification74.5%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq 2:\\ \;\;\;\;\mathsf{copysign}\left(x, x\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{copysign}\left(\log \left(\frac{0.5}{x}\right), x\right)\\ \end{array} \]

Alternative 14: 62.3% accurate, 2.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq 2:\\ \;\;\;\;\mathsf{copysign}\left(x, x\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{copysign}\left(\log x, x\right)\\ \end{array} \end{array} \]
(FPCore (x)
 :precision binary32
 (if (<= x 2.0) (copysign x x) (copysign (log x) x)))
float code(float x) {
	float tmp;
	if (x <= 2.0f) {
		tmp = copysignf(x, x);
	} else {
		tmp = copysignf(logf(x), x);
	}
	return tmp;
}
function code(x)
	tmp = Float32(0.0)
	if (x <= Float32(2.0))
		tmp = copysign(x, x);
	else
		tmp = copysign(log(x), x);
	end
	return tmp
end
function tmp_2 = code(x)
	tmp = single(0.0);
	if (x <= single(2.0))
		tmp = sign(x) * abs(x);
	else
		tmp = sign(x) * abs(log(x));
	end
	tmp_2 = tmp;
end
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \leq 2:\\
\;\;\;\;\mathsf{copysign}\left(x, x\right)\\

\mathbf{else}:\\
\;\;\;\;\mathsf{copysign}\left(\log x, x\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < 2

    1. Initial program 36.0%

      \[\mathsf{copysign}\left(\log \left(\left|x\right| + \sqrt{x \cdot x + 1}\right), x\right) \]
    2. Step-by-step derivation
      1. add-cbrt-cube29.3%

        \[\leadsto \mathsf{copysign}\left(\log \color{blue}{\left(\sqrt[3]{\left(\left(\left|x\right| + \sqrt{x \cdot x + 1}\right) \cdot \left(\left|x\right| + \sqrt{x \cdot x + 1}\right)\right) \cdot \left(\left|x\right| + \sqrt{x \cdot x + 1}\right)}\right)}, x\right) \]
      2. pow1/329.2%

        \[\leadsto \mathsf{copysign}\left(\log \color{blue}{\left({\left(\left(\left(\left|x\right| + \sqrt{x \cdot x + 1}\right) \cdot \left(\left|x\right| + \sqrt{x \cdot x + 1}\right)\right) \cdot \left(\left|x\right| + \sqrt{x \cdot x + 1}\right)\right)}^{0.3333333333333333}\right)}, x\right) \]
      3. log-pow29.1%

        \[\leadsto \mathsf{copysign}\left(\color{blue}{0.3333333333333333 \cdot \log \left(\left(\left(\left|x\right| + \sqrt{x \cdot x + 1}\right) \cdot \left(\left|x\right| + \sqrt{x \cdot x + 1}\right)\right) \cdot \left(\left|x\right| + \sqrt{x \cdot x + 1}\right)\right)}, x\right) \]
      4. pow329.2%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \log \color{blue}{\left({\left(\left|x\right| + \sqrt{x \cdot x + 1}\right)}^{3}\right)}, x\right) \]
      5. log-pow35.8%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \color{blue}{\left(3 \cdot \log \left(\left|x\right| + \sqrt{x \cdot x + 1}\right)\right)}, x\right) \]
      6. +-commutative35.8%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \left(\left|x\right| + \sqrt{\color{blue}{1 + x \cdot x}}\right)\right), x\right) \]
      7. hypot-1-def50.9%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \left(\left|x\right| + \color{blue}{\mathsf{hypot}\left(1, x\right)}\right)\right), x\right) \]
      8. add-sqr-sqrt8.9%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \left(\left|\color{blue}{\sqrt{x} \cdot \sqrt{x}}\right| + \mathsf{hypot}\left(1, x\right)\right)\right), x\right) \]
      9. fabs-sqr8.9%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \left(\color{blue}{\sqrt{x} \cdot \sqrt{x}} + \mathsf{hypot}\left(1, x\right)\right)\right), x\right) \]
      10. add-sqr-sqrt20.7%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \left(\color{blue}{x} + \mathsf{hypot}\left(1, x\right)\right)\right), x\right) \]
    3. Applied egg-rr20.7%

      \[\leadsto \mathsf{copysign}\left(\color{blue}{0.3333333333333333 \cdot \left(3 \cdot \log \left(x + \mathsf{hypot}\left(1, x\right)\right)\right)}, x\right) \]
    4. Taylor expanded in x around 0 64.0%

      \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \color{blue}{\left(3 \cdot x\right)}, x\right) \]
    5. Step-by-step derivation
      1. *-commutative64.0%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \color{blue}{\left(x \cdot 3\right)}, x\right) \]
    6. Simplified64.0%

      \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \color{blue}{\left(x \cdot 3\right)}, x\right) \]
    7. Taylor expanded in x around 0 64.6%

      \[\leadsto \mathsf{copysign}\left(\color{blue}{x}, x\right) \]

    if 2 < x

    1. Initial program 48.7%

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

      \[\leadsto \mathsf{copysign}\left(\color{blue}{-1 \cdot \log \left(\frac{1}{x}\right)}, x\right) \]
    3. Step-by-step derivation
      1. mul-1-neg44.6%

        \[\leadsto \mathsf{copysign}\left(\color{blue}{-\log \left(\frac{1}{x}\right)}, x\right) \]
      2. log-rec44.6%

        \[\leadsto \mathsf{copysign}\left(-\color{blue}{\left(-\log x\right)}, x\right) \]
      3. remove-double-neg44.6%

        \[\leadsto \mathsf{copysign}\left(\color{blue}{\log x}, x\right) \]
    4. Simplified44.6%

      \[\leadsto \mathsf{copysign}\left(\color{blue}{\log x}, x\right) \]
  3. Recombined 2 regimes into one program.
  4. Final simplification58.9%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq 2:\\ \;\;\;\;\mathsf{copysign}\left(x, x\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{copysign}\left(\log x, x\right)\\ \end{array} \]

Alternative 15: 62.3% accurate, 2.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq 2:\\ \;\;\;\;\mathsf{copysign}\left(x, x\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{copysign}\left(\mathsf{log1p}\left(x\right), x\right)\\ \end{array} \end{array} \]
(FPCore (x)
 :precision binary32
 (if (<= x 2.0) (copysign x x) (copysign (log1p x) x)))
float code(float x) {
	float tmp;
	if (x <= 2.0f) {
		tmp = copysignf(x, x);
	} else {
		tmp = copysignf(log1pf(x), x);
	}
	return tmp;
}
function code(x)
	tmp = Float32(0.0)
	if (x <= Float32(2.0))
		tmp = copysign(x, x);
	else
		tmp = copysign(log1p(x), x);
	end
	return tmp
end
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \leq 2:\\
\;\;\;\;\mathsf{copysign}\left(x, x\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < 2

    1. Initial program 36.0%

      \[\mathsf{copysign}\left(\log \left(\left|x\right| + \sqrt{x \cdot x + 1}\right), x\right) \]
    2. Step-by-step derivation
      1. add-cbrt-cube29.3%

        \[\leadsto \mathsf{copysign}\left(\log \color{blue}{\left(\sqrt[3]{\left(\left(\left|x\right| + \sqrt{x \cdot x + 1}\right) \cdot \left(\left|x\right| + \sqrt{x \cdot x + 1}\right)\right) \cdot \left(\left|x\right| + \sqrt{x \cdot x + 1}\right)}\right)}, x\right) \]
      2. pow1/329.2%

        \[\leadsto \mathsf{copysign}\left(\log \color{blue}{\left({\left(\left(\left(\left|x\right| + \sqrt{x \cdot x + 1}\right) \cdot \left(\left|x\right| + \sqrt{x \cdot x + 1}\right)\right) \cdot \left(\left|x\right| + \sqrt{x \cdot x + 1}\right)\right)}^{0.3333333333333333}\right)}, x\right) \]
      3. log-pow29.1%

        \[\leadsto \mathsf{copysign}\left(\color{blue}{0.3333333333333333 \cdot \log \left(\left(\left(\left|x\right| + \sqrt{x \cdot x + 1}\right) \cdot \left(\left|x\right| + \sqrt{x \cdot x + 1}\right)\right) \cdot \left(\left|x\right| + \sqrt{x \cdot x + 1}\right)\right)}, x\right) \]
      4. pow329.2%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \log \color{blue}{\left({\left(\left|x\right| + \sqrt{x \cdot x + 1}\right)}^{3}\right)}, x\right) \]
      5. log-pow35.8%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \color{blue}{\left(3 \cdot \log \left(\left|x\right| + \sqrt{x \cdot x + 1}\right)\right)}, x\right) \]
      6. +-commutative35.8%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \left(\left|x\right| + \sqrt{\color{blue}{1 + x \cdot x}}\right)\right), x\right) \]
      7. hypot-1-def50.9%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \left(\left|x\right| + \color{blue}{\mathsf{hypot}\left(1, x\right)}\right)\right), x\right) \]
      8. add-sqr-sqrt8.9%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \left(\left|\color{blue}{\sqrt{x} \cdot \sqrt{x}}\right| + \mathsf{hypot}\left(1, x\right)\right)\right), x\right) \]
      9. fabs-sqr8.9%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \left(\color{blue}{\sqrt{x} \cdot \sqrt{x}} + \mathsf{hypot}\left(1, x\right)\right)\right), x\right) \]
      10. add-sqr-sqrt20.7%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \left(\color{blue}{x} + \mathsf{hypot}\left(1, x\right)\right)\right), x\right) \]
    3. Applied egg-rr20.7%

      \[\leadsto \mathsf{copysign}\left(\color{blue}{0.3333333333333333 \cdot \left(3 \cdot \log \left(x + \mathsf{hypot}\left(1, x\right)\right)\right)}, x\right) \]
    4. Taylor expanded in x around 0 64.0%

      \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \color{blue}{\left(3 \cdot x\right)}, x\right) \]
    5. Step-by-step derivation
      1. *-commutative64.0%

        \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \color{blue}{\left(x \cdot 3\right)}, x\right) \]
    6. Simplified64.0%

      \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \color{blue}{\left(x \cdot 3\right)}, x\right) \]
    7. Taylor expanded in x around 0 64.6%

      \[\leadsto \mathsf{copysign}\left(\color{blue}{x}, x\right) \]

    if 2 < x

    1. Initial program 48.7%

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

      \[\leadsto \mathsf{copysign}\left(\color{blue}{\log \left(1 + \left|x\right|\right) + 0.5 \cdot \frac{{x}^{2}}{1 + \left|x\right|}}, x\right) \]
    3. Step-by-step derivation
      1. log1p-def10.0%

        \[\leadsto \mathsf{copysign}\left(\color{blue}{\mathsf{log1p}\left(\left|x\right|\right)} + 0.5 \cdot \frac{{x}^{2}}{1 + \left|x\right|}, x\right) \]
    4. Simplified10.0%

      \[\leadsto \mathsf{copysign}\left(\color{blue}{\mathsf{log1p}\left(\left|x\right|\right) + 0.5 \cdot \frac{{x}^{2}}{1 + \left|x\right|}}, x\right) \]
    5. Taylor expanded in x around 0 44.6%

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

        \[\leadsto \mathsf{copysign}\left(\color{blue}{\mathsf{log1p}\left(\left|x\right|\right)}, x\right) \]
      2. rem-square-sqrt44.6%

        \[\leadsto \mathsf{copysign}\left(\mathsf{log1p}\left(\left|\color{blue}{\sqrt{x} \cdot \sqrt{x}}\right|\right), x\right) \]
      3. fabs-sqr44.6%

        \[\leadsto \mathsf{copysign}\left(\mathsf{log1p}\left(\color{blue}{\sqrt{x} \cdot \sqrt{x}}\right), x\right) \]
      4. rem-square-sqrt44.6%

        \[\leadsto \mathsf{copysign}\left(\mathsf{log1p}\left(\color{blue}{x}\right), x\right) \]
    7. Simplified44.6%

      \[\leadsto \mathsf{copysign}\left(\color{blue}{\mathsf{log1p}\left(x\right)}, x\right) \]
  3. Recombined 2 regimes into one program.
  4. Final simplification58.9%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq 2:\\ \;\;\;\;\mathsf{copysign}\left(x, x\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{copysign}\left(\mathsf{log1p}\left(x\right), x\right)\\ \end{array} \]

Alternative 16: 54.1% accurate, 4.0× speedup?

\[\begin{array}{l} \\ \mathsf{copysign}\left(x, x\right) \end{array} \]
(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}
Derivation
  1. Initial program 39.6%

    \[\mathsf{copysign}\left(\log \left(\left|x\right| + \sqrt{x \cdot x + 1}\right), x\right) \]
  2. Step-by-step derivation
    1. add-cbrt-cube31.6%

      \[\leadsto \mathsf{copysign}\left(\log \color{blue}{\left(\sqrt[3]{\left(\left(\left|x\right| + \sqrt{x \cdot x + 1}\right) \cdot \left(\left|x\right| + \sqrt{x \cdot x + 1}\right)\right) \cdot \left(\left|x\right| + \sqrt{x \cdot x + 1}\right)}\right)}, x\right) \]
    2. pow1/331.4%

      \[\leadsto \mathsf{copysign}\left(\log \color{blue}{\left({\left(\left(\left(\left|x\right| + \sqrt{x \cdot x + 1}\right) \cdot \left(\left|x\right| + \sqrt{x \cdot x + 1}\right)\right) \cdot \left(\left|x\right| + \sqrt{x \cdot x + 1}\right)\right)}^{0.3333333333333333}\right)}, x\right) \]
    3. log-pow31.4%

      \[\leadsto \mathsf{copysign}\left(\color{blue}{0.3333333333333333 \cdot \log \left(\left(\left(\left|x\right| + \sqrt{x \cdot x + 1}\right) \cdot \left(\left|x\right| + \sqrt{x \cdot x + 1}\right)\right) \cdot \left(\left|x\right| + \sqrt{x \cdot x + 1}\right)\right)}, x\right) \]
    4. pow331.4%

      \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \log \color{blue}{\left({\left(\left|x\right| + \sqrt{x \cdot x + 1}\right)}^{3}\right)}, x\right) \]
    5. log-pow39.3%

      \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \color{blue}{\left(3 \cdot \log \left(\left|x\right| + \sqrt{x \cdot x + 1}\right)\right)}, x\right) \]
    6. +-commutative39.3%

      \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \left(\left|x\right| + \sqrt{\color{blue}{1 + x \cdot x}}\right)\right), x\right) \]
    7. hypot-1-def64.3%

      \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \left(\left|x\right| + \color{blue}{\mathsf{hypot}\left(1, x\right)}\right)\right), x\right) \]
    8. add-sqr-sqrt34.3%

      \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \left(\left|\color{blue}{\sqrt{x} \cdot \sqrt{x}}\right| + \mathsf{hypot}\left(1, x\right)\right)\right), x\right) \]
    9. fabs-sqr34.3%

      \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \left(\color{blue}{\sqrt{x} \cdot \sqrt{x}} + \mathsf{hypot}\left(1, x\right)\right)\right), x\right) \]
    10. add-sqr-sqrt42.7%

      \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \left(3 \cdot \log \left(\color{blue}{x} + \mathsf{hypot}\left(1, x\right)\right)\right), x\right) \]
  3. Applied egg-rr42.7%

    \[\leadsto \mathsf{copysign}\left(\color{blue}{0.3333333333333333 \cdot \left(3 \cdot \log \left(x + \mathsf{hypot}\left(1, x\right)\right)\right)}, x\right) \]
  4. Taylor expanded in x around 0 48.8%

    \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \color{blue}{\left(3 \cdot x\right)}, x\right) \]
  5. Step-by-step derivation
    1. *-commutative48.8%

      \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \color{blue}{\left(x \cdot 3\right)}, x\right) \]
  6. Simplified48.8%

    \[\leadsto \mathsf{copysign}\left(0.3333333333333333 \cdot \color{blue}{\left(x \cdot 3\right)}, x\right) \]
  7. Taylor expanded in x around 0 49.3%

    \[\leadsto \mathsf{copysign}\left(\color{blue}{x}, x\right) \]
  8. Final simplification49.3%

    \[\leadsto \mathsf{copysign}\left(x, x\right) \]

Developer target: 99.6% accurate, 0.6× speedup?

\[\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} \]
(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}

Reproduce

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