Average Error: 45.3 → 0.0
Time: 6.3s
Precision: binary64
Cost: 19784
\[\mathsf{copysign}\left(\log \left(\left|x\right| + \sqrt{x \cdot x + 1}\right), x\right) \]
\[\begin{array}{l} \mathbf{if}\;x \leq -0.0044:\\ \;\;\;\;\mathsf{copysign}\left(-\log \left(\mathsf{hypot}\left(1, x\right) - x\right), x\right)\\ \mathbf{elif}\;x \leq 0.0038:\\ \;\;\;\;\mathsf{copysign}\left(\mathsf{log1p}\left(x + x \cdot \frac{x}{x \cdot \left(x \cdot 0.5\right) + 2}\right), x\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{copysign}\left(\log \left(x + \mathsf{hypot}\left(1, x\right)\right), x\right)\\ \end{array} \]
(FPCore (x)
 :precision binary64
 (copysign (log (+ (fabs x) (sqrt (+ (* x x) 1.0)))) x))
(FPCore (x)
 :precision binary64
 (if (<= x -0.0044)
   (copysign (- (log (- (hypot 1.0 x) x))) x)
   (if (<= x 0.0038)
     (copysign (log1p (+ x (* x (/ x (+ (* x (* x 0.5)) 2.0))))) x)
     (copysign (log (+ x (hypot 1.0 x))) x))))
double code(double x) {
	return copysign(log((fabs(x) + sqrt(((x * x) + 1.0)))), x);
}
double code(double x) {
	double tmp;
	if (x <= -0.0044) {
		tmp = copysign(-log((hypot(1.0, x) - x)), x);
	} else if (x <= 0.0038) {
		tmp = copysign(log1p((x + (x * (x / ((x * (x * 0.5)) + 2.0))))), x);
	} else {
		tmp = copysign(log((x + hypot(1.0, x))), x);
	}
	return tmp;
}
public static double code(double x) {
	return Math.copySign(Math.log((Math.abs(x) + Math.sqrt(((x * x) + 1.0)))), x);
}
public static double code(double x) {
	double tmp;
	if (x <= -0.0044) {
		tmp = Math.copySign(-Math.log((Math.hypot(1.0, x) - x)), x);
	} else if (x <= 0.0038) {
		tmp = Math.copySign(Math.log1p((x + (x * (x / ((x * (x * 0.5)) + 2.0))))), x);
	} else {
		tmp = Math.copySign(Math.log((x + Math.hypot(1.0, x))), x);
	}
	return tmp;
}
def code(x):
	return math.copysign(math.log((math.fabs(x) + math.sqrt(((x * x) + 1.0)))), x)
def code(x):
	tmp = 0
	if x <= -0.0044:
		tmp = math.copysign(-math.log((math.hypot(1.0, x) - x)), x)
	elif x <= 0.0038:
		tmp = math.copysign(math.log1p((x + (x * (x / ((x * (x * 0.5)) + 2.0))))), x)
	else:
		tmp = math.copysign(math.log((x + math.hypot(1.0, x))), x)
	return tmp
function code(x)
	return copysign(log(Float64(abs(x) + sqrt(Float64(Float64(x * x) + 1.0)))), x)
end
function code(x)
	tmp = 0.0
	if (x <= -0.0044)
		tmp = copysign(Float64(-log(Float64(hypot(1.0, x) - x))), x);
	elseif (x <= 0.0038)
		tmp = copysign(log1p(Float64(x + Float64(x * Float64(x / Float64(Float64(x * Float64(x * 0.5)) + 2.0))))), x);
	else
		tmp = copysign(log(Float64(x + hypot(1.0, x))), x);
	end
	return tmp
end
code[x_] := N[With[{TMP1 = Abs[N[Log[N[(N[Abs[x], $MachinePrecision] + N[Sqrt[N[(N[(x * x), $MachinePrecision] + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[x_] := If[LessEqual[x, -0.0044], N[With[{TMP1 = Abs[(-N[Log[N[(N[Sqrt[1.0 ^ 2 + x ^ 2], $MachinePrecision] - x), $MachinePrecision]], $MachinePrecision])], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision], If[LessEqual[x, 0.0038], N[With[{TMP1 = Abs[N[Log[1 + N[(x + N[(x * N[(x / N[(N[(x * N[(x * 0.5), $MachinePrecision]), $MachinePrecision] + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision], N[With[{TMP1 = Abs[N[Log[N[(x + N[Sqrt[1.0 ^ 2 + x ^ 2], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]]]
\mathsf{copysign}\left(\log \left(\left|x\right| + \sqrt{x \cdot x + 1}\right), x\right)
\begin{array}{l}
\mathbf{if}\;x \leq -0.0044:\\
\;\;\;\;\mathsf{copysign}\left(-\log \left(\mathsf{hypot}\left(1, x\right) - x\right), x\right)\\

\mathbf{elif}\;x \leq 0.0038:\\
\;\;\;\;\mathsf{copysign}\left(\mathsf{log1p}\left(x + x \cdot \frac{x}{x \cdot \left(x \cdot 0.5\right) + 2}\right), x\right)\\

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


\end{array}

Error

Target

Original45.3
Target0.0
Herbie0.0
\[\mathsf{copysign}\left(\mathsf{log1p}\left(\left|x\right| + \frac{\left|x\right|}{\mathsf{hypot}\left(1, \frac{1}{\left|x\right|}\right) + \frac{1}{\left|x\right|}}\right), x\right) \]

Derivation

  1. Split input into 3 regimes
  2. if x < -0.00440000000000000027

    1. Initial program 31.9

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

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

      [Start]31.9

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

      +-commutative [=>]31.9

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

      hypot-1-def [=>]0.1

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

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

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

      [Start]62.5

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

      div-sub [<=]61.9

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

      +-commutative [=>]61.9

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

      associate--r+ [=>]31.9

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

      +-inverses [=>]0.1

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

      metadata-eval [=>]0.1

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

      metadata-eval [<=]0.1

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

      associate-/r* [<=]0.1

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

      distribute-lft-out-- [<=]0.1

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

      cancel-sign-sub-inv [=>]0.1

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

      metadata-eval [=>]0.1

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

      *-lft-identity [=>]0.1

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

      +-commutative [<=]0.1

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

      mul-1-neg [=>]0.1

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

      sub-neg [<=]0.1

      \[ \mathsf{copysign}\left(\log \left(\frac{1}{\color{blue}{\mathsf{hypot}\left(1, x\right) - x}}\right), x\right) \]
    5. Applied egg-rr0.1

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

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

      [Start]0.1

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

      +-lft-identity [=>]0.1

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

    if -0.00440000000000000027 < x < 0.00379999999999999999

    1. Initial program 59.1

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

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

      [Start]59.1

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

      +-commutative [=>]59.1

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

      hypot-1-def [=>]59.1

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

      \[\leadsto \mathsf{copysign}\left(\color{blue}{\mathsf{log1p}\left(\left(x + \mathsf{hypot}\left(1, x\right)\right) - 1\right)}, x\right) \]
    4. Simplified0.6

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

      [Start]59.0

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

      sub-neg [=>]59.0

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

      metadata-eval [=>]59.0

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

      associate-+l+ [=>]0.6

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

      +-commutative [=>]0.6

      \[ \mathsf{copysign}\left(\mathsf{log1p}\left(x + \color{blue}{\left(-1 + \mathsf{hypot}\left(1, x\right)\right)}\right), x\right) \]
    5. Applied egg-rr0.0

      \[\leadsto \mathsf{copysign}\left(\mathsf{log1p}\left(x + \color{blue}{\frac{x \cdot x + 0}{\mathsf{hypot}\left(1, x\right) - -1}}\right), x\right) \]
    6. Simplified0.0

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

      [Start]0.0

      \[ \mathsf{copysign}\left(\mathsf{log1p}\left(x + \frac{x \cdot x + 0}{\mathsf{hypot}\left(1, x\right) - -1}\right), x\right) \]

      +-rgt-identity [=>]0.0

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

      sub-neg [=>]0.0

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

      metadata-eval [=>]0.0

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

      +-commutative [<=]0.0

      \[ \mathsf{copysign}\left(\mathsf{log1p}\left(x + \frac{x \cdot x}{\color{blue}{1 + \mathsf{hypot}\left(1, x\right)}}\right), x\right) \]
    7. Taylor expanded in x around 0 0.0

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

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

      [Start]0.0

      \[ \mathsf{copysign}\left(\mathsf{log1p}\left(x + \frac{x \cdot x}{1 + \left(1 + 0.5 \cdot {x}^{2}\right)}\right), x\right) \]

      unpow2 [=>]0.0

      \[ \mathsf{copysign}\left(\mathsf{log1p}\left(x + \frac{x \cdot x}{1 + \left(1 + 0.5 \cdot \color{blue}{\left(x \cdot x\right)}\right)}\right), x\right) \]
    9. Applied egg-rr0.0

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

    if 0.00379999999999999999 < x

    1. Initial program 31.9

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

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

      [Start]31.9

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

      +-commutative [=>]31.9

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

      hypot-1-def [=>]0.0

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

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

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

      [Start]0.0

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

      +-lft-identity [=>]0.0

      \[ \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 simplification0.0

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

Alternatives

Alternative 1
Error0.3
Cost45828
\[\begin{array}{l} \mathbf{if}\;\mathsf{copysign}\left(\log \left(\left|x\right| + \sqrt{x \cdot x + 1}\right), x\right) \leq -1 \cdot 10^{-8}:\\ \;\;\;\;\mathsf{copysign}\left(-\log \left(\mathsf{hypot}\left(1, x\right) - x\right), x\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{copysign}\left(\mathsf{log1p}\left(x + \left(\mathsf{hypot}\left(1, x\right) + -1\right)\right), x\right)\\ \end{array} \]
Alternative 2
Error0.1
Cost19784
\[\begin{array}{l} \mathbf{if}\;x \leq -1:\\ \;\;\;\;\mathsf{copysign}\left(\log \left(\frac{1}{x \cdot -2 - \frac{0.5}{x}}\right), x\right)\\ \mathbf{elif}\;x \leq 0.0038:\\ \;\;\;\;\mathsf{copysign}\left(\mathsf{log1p}\left(x + x \cdot \frac{x}{x \cdot \left(x \cdot 0.5\right) + 2}\right), x\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{copysign}\left(\log \left(x + \mathsf{hypot}\left(1, x\right)\right), x\right)\\ \end{array} \]
Alternative 3
Error0.4
Cost13960
\[\begin{array}{l} \mathbf{if}\;x \leq -1:\\ \;\;\;\;\mathsf{copysign}\left(\log \left(\frac{1}{x \cdot -2 - \frac{0.5}{x}}\right), x\right)\\ \mathbf{elif}\;x \leq 2:\\ \;\;\;\;\mathsf{copysign}\left(\mathsf{log1p}\left(x + x \cdot \frac{x}{x \cdot \left(x \cdot 0.5\right) + 2}\right), x\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{copysign}\left(\log \left(\frac{0.5}{x}\right), x\right)\\ \end{array} \]
Alternative 4
Error0.4
Cost13572
\[\begin{array}{l} \mathbf{if}\;x \leq -0.95:\\ \;\;\;\;\mathsf{copysign}\left(\log \left(\frac{1}{x \cdot -2 - \frac{0.5}{x}}\right), x\right)\\ \mathbf{elif}\;x \leq 1.25:\\ \;\;\;\;\mathsf{copysign}\left(x + -0.16666666666666666 \cdot {x}^{3}, x\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{copysign}\left(\log \left(\frac{0.5}{x}\right), x\right)\\ \end{array} \]
Alternative 5
Error0.5
Cost13512
\[\begin{array}{l} \mathbf{if}\;x \leq -1.25:\\ \;\;\;\;\mathsf{copysign}\left(\log \left(\frac{-0.5}{x}\right), x\right)\\ \mathbf{elif}\;x \leq 1.25:\\ \;\;\;\;\mathsf{copysign}\left(x + -0.16666666666666666 \cdot {x}^{3}, x\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{copysign}\left(\log \left(\frac{0.5}{x}\right), x\right)\\ \end{array} \]
Alternative 6
Error0.6
Cost13320
\[\begin{array}{l} \mathbf{if}\;x \leq -1.25:\\ \;\;\;\;\mathsf{copysign}\left(\log \left(\frac{-0.5}{x}\right), x\right)\\ \mathbf{elif}\;x \leq 1.25:\\ \;\;\;\;\mathsf{copysign}\left(x, x\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{copysign}\left(\log \left(x + x\right), x\right)\\ \end{array} \]
Alternative 7
Error0.6
Cost13320
\[\begin{array}{l} \mathbf{if}\;x \leq -1.25:\\ \;\;\;\;\mathsf{copysign}\left(\log \left(\frac{-0.5}{x}\right), x\right)\\ \mathbf{elif}\;x \leq 1.25:\\ \;\;\;\;\mathsf{copysign}\left(x, x\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{copysign}\left(\log \left(\frac{0.5}{x}\right), x\right)\\ \end{array} \]
Alternative 8
Error15.4
Cost13188
\[\begin{array}{l} \mathbf{if}\;x \leq 1.25:\\ \;\;\;\;\mathsf{copysign}\left(x, x\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{copysign}\left(\log \left(x + x\right), x\right)\\ \end{array} \]
Alternative 9
Error26.4
Cost13060
\[\begin{array}{l} \mathbf{if}\;x \leq 3.2:\\ \;\;\;\;\mathsf{copysign}\left(x, x\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{copysign}\left(\log x, x\right)\\ \end{array} \]
Alternative 10
Error26.4
Cost13060
\[\begin{array}{l} \mathbf{if}\;x \leq 1.6:\\ \;\;\;\;\mathsf{copysign}\left(x, x\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{copysign}\left(\mathsf{log1p}\left(x\right), x\right)\\ \end{array} \]
Alternative 11
Error30.6
Cost6528
\[\mathsf{copysign}\left(x, x\right) \]

Error

Reproduce

herbie shell --seed 2022356 
(FPCore (x)
  :name "Rust f64::asinh"
  :precision binary64

  :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))