# ?

Average Error: 31.3 → 0.1
Time: 16.4s
Precision: binary64
Cost: 20104

# ?

$-1.79 \cdot 10^{+308} \leq x \land x \leq 1.79 \cdot 10^{+308}$
$\log \left(2 \cdot \frac{\sqrt{x \cdot x + 1}}{\sqrt{x \cdot x + 1} + x}\right)$
$\begin{array}{l} \mathbf{if}\;x \leq -400:\\ \;\;\;\;\mathsf{fma}\left(-2, \log \left(\frac{-1}{x}\right), \log 4 + \frac{0.75}{x \cdot x}\right)\\ \mathbf{elif}\;x \leq 70:\\ \;\;\;\;-\log \left(\left(x + \mathsf{hypot}\left(1, x\right)\right) \cdot \frac{0.5}{\mathsf{hypot}\left(1, x\right)}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{0.25}{x}}{x} + \left(\frac{0.11458333333333333}{{x}^{6}} + \frac{-0.15625}{{x}^{4}}\right)\\ \end{array}$
(FPCore (x)
:precision binary64
(log (* 2.0 (/ (sqrt (+ (* x x) 1.0)) (+ (sqrt (+ (* x x) 1.0)) x)))))
(FPCore (x)
:precision binary64
(if (<= x -400.0)
(fma -2.0 (log (/ -1.0 x)) (+ (log 4.0) (/ 0.75 (* x x))))
(if (<= x 70.0)
(- (log (* (+ x (hypot 1.0 x)) (/ 0.5 (hypot 1.0 x)))))
(+
(/ (/ 0.25 x) x)
(+ (/ 0.11458333333333333 (pow x 6.0)) (/ -0.15625 (pow x 4.0)))))))
double code(double x) {
return log((2.0 * (sqrt(((x * x) + 1.0)) / (sqrt(((x * x) + 1.0)) + x))));
}

double code(double x) {
double tmp;
if (x <= -400.0) {
tmp = fma(-2.0, log((-1.0 / x)), (log(4.0) + (0.75 / (x * x))));
} else if (x <= 70.0) {
tmp = -log(((x + hypot(1.0, x)) * (0.5 / hypot(1.0, x))));
} else {
tmp = ((0.25 / x) / x) + ((0.11458333333333333 / pow(x, 6.0)) + (-0.15625 / pow(x, 4.0)));
}
return tmp;
}

function code(x)
return log(Float64(2.0 * Float64(sqrt(Float64(Float64(x * x) + 1.0)) / Float64(sqrt(Float64(Float64(x * x) + 1.0)) + x))))
end

function code(x)
tmp = 0.0
if (x <= -400.0)
tmp = fma(-2.0, log(Float64(-1.0 / x)), Float64(log(4.0) + Float64(0.75 / Float64(x * x))));
elseif (x <= 70.0)
tmp = Float64(-log(Float64(Float64(x + hypot(1.0, x)) * Float64(0.5 / hypot(1.0, x)))));
else
tmp = Float64(Float64(Float64(0.25 / x) / x) + Float64(Float64(0.11458333333333333 / (x ^ 6.0)) + Float64(-0.15625 / (x ^ 4.0))));
end
return tmp
end

code[x_] := N[Log[N[(2.0 * N[(N[Sqrt[N[(N[(x * x), $MachinePrecision] + 1.0),$MachinePrecision]], $MachinePrecision] / N[(N[Sqrt[N[(N[(x * x),$MachinePrecision] + 1.0), $MachinePrecision]],$MachinePrecision] + x), $MachinePrecision]),$MachinePrecision]), $MachinePrecision]],$MachinePrecision]

code[x_] := If[LessEqual[x, -400.0], N[(-2.0 * N[Log[N[(-1.0 / x), $MachinePrecision]],$MachinePrecision] + N[(N[Log[4.0], $MachinePrecision] + N[(0.75 / N[(x * x),$MachinePrecision]), $MachinePrecision]),$MachinePrecision]), $MachinePrecision], If[LessEqual[x, 70.0], (-N[Log[N[(N[(x + N[Sqrt[1.0 ^ 2 + x ^ 2],$MachinePrecision]), $MachinePrecision] * N[(0.5 / N[Sqrt[1.0 ^ 2 + x ^ 2],$MachinePrecision]), $MachinePrecision]),$MachinePrecision]], $MachinePrecision]), N[(N[(N[(0.25 / x),$MachinePrecision] / x), $MachinePrecision] + N[(N[(0.11458333333333333 / N[Power[x, 6.0],$MachinePrecision]), $MachinePrecision] + N[(-0.15625 / N[Power[x, 4.0],$MachinePrecision]), $MachinePrecision]),$MachinePrecision]), \$MachinePrecision]]]

\log \left(2 \cdot \frac{\sqrt{x \cdot x + 1}}{\sqrt{x \cdot x + 1} + x}\right)

\begin{array}{l}
\mathbf{if}\;x \leq -400:\\
\;\;\;\;\mathsf{fma}\left(-2, \log \left(\frac{-1}{x}\right), \log 4 + \frac{0.75}{x \cdot x}\right)\\

\mathbf{elif}\;x \leq 70:\\
\;\;\;\;-\log \left(\left(x + \mathsf{hypot}\left(1, x\right)\right) \cdot \frac{0.5}{\mathsf{hypot}\left(1, x\right)}\right)\\

\mathbf{else}:\\
\;\;\;\;\frac{\frac{0.25}{x}}{x} + \left(\frac{0.11458333333333333}{{x}^{6}} + \frac{-0.15625}{{x}^{4}}\right)\\

\end{array}


# Derivation?

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

1. Initial program 63.6

$\log \left(2 \cdot \frac{\sqrt{x \cdot x + 1}}{\sqrt{x \cdot x + 1} + x}\right)$
2. Simplified63.6

$\leadsto \color{blue}{\log \left(\frac{2 \cdot \mathsf{hypot}\left(1, x\right)}{x + \mathsf{hypot}\left(1, x\right)}\right)}$
Proof
[Start]63.6 $\log \left(2 \cdot \frac{\sqrt{x \cdot x + 1}}{\sqrt{x \cdot x + 1} + x}\right)$ $\log \color{blue}{\left(\frac{2 \cdot \sqrt{x \cdot x + 1}}{\sqrt{x \cdot x + 1} + x}\right)}$ $\log \left(\frac{2 \cdot \sqrt{\color{blue}{1 + x \cdot x}}}{\sqrt{x \cdot x + 1} + x}\right)$ $\log \left(\frac{2 \cdot \color{blue}{\mathsf{hypot}\left(1, x\right)}}{\sqrt{x \cdot x + 1} + x}\right)$ $\log \left(\frac{2 \cdot \mathsf{hypot}\left(1, x\right)}{\color{blue}{x + \sqrt{x \cdot x + 1}}}\right)$ $\log \left(\frac{2 \cdot \mathsf{hypot}\left(1, x\right)}{x + \sqrt{\color{blue}{1 + x \cdot x}}}\right)$ $\log \left(\frac{2 \cdot \mathsf{hypot}\left(1, x\right)}{x + \color{blue}{\mathsf{hypot}\left(1, x\right)}}\right)$
3. Taylor expanded in x around -inf 0.2

$\leadsto \color{blue}{-2 \cdot \log \left(\frac{-1}{x}\right) + \left(0.75 \cdot \frac{1}{{x}^{2}} + \log 4\right)}$
4. Simplified0.2

$\leadsto \color{blue}{\mathsf{fma}\left(-2, \log \left(\frac{-1}{x}\right), \log 4 + \frac{0.75}{x \cdot x}\right)}$
Proof
[Start]0.2 $-2 \cdot \log \left(\frac{-1}{x}\right) + \left(0.75 \cdot \frac{1}{{x}^{2}} + \log 4\right)$ $\color{blue}{\mathsf{fma}\left(-2, \log \left(\frac{-1}{x}\right), 0.75 \cdot \frac{1}{{x}^{2}} + \log 4\right)}$ $\mathsf{fma}\left(-2, \log \left(\frac{-1}{x}\right), \color{blue}{\log 4 + 0.75 \cdot \frac{1}{{x}^{2}}}\right)$ $\mathsf{fma}\left(-2, \log \left(\frac{-1}{x}\right), \log 4 + \color{blue}{\frac{0.75 \cdot 1}{{x}^{2}}}\right)$ $\mathsf{fma}\left(-2, \log \left(\frac{-1}{x}\right), \log 4 + \frac{\color{blue}{0.75}}{{x}^{2}}\right)$ $\mathsf{fma}\left(-2, \log \left(\frac{-1}{x}\right), \log 4 + \frac{0.75}{\color{blue}{x \cdot x}}\right)$

## if -400 < x < 70

1. Initial program 0.1

$\log \left(2 \cdot \frac{\sqrt{x \cdot x + 1}}{\sqrt{x \cdot x + 1} + x}\right)$
2. Simplified0.1

$\leadsto \color{blue}{\log \left(\frac{2 \cdot \mathsf{hypot}\left(1, x\right)}{x + \mathsf{hypot}\left(1, x\right)}\right)}$
Proof
[Start]0.1 $\log \left(2 \cdot \frac{\sqrt{x \cdot x + 1}}{\sqrt{x \cdot x + 1} + x}\right)$ $\log \color{blue}{\left(\frac{2 \cdot \sqrt{x \cdot x + 1}}{\sqrt{x \cdot x + 1} + x}\right)}$ $\log \left(\frac{2 \cdot \sqrt{\color{blue}{1 + x \cdot x}}}{\sqrt{x \cdot x + 1} + x}\right)$ $\log \left(\frac{2 \cdot \color{blue}{\mathsf{hypot}\left(1, x\right)}}{\sqrt{x \cdot x + 1} + x}\right)$ $\log \left(\frac{2 \cdot \mathsf{hypot}\left(1, x\right)}{\color{blue}{x + \sqrt{x \cdot x + 1}}}\right)$ $\log \left(\frac{2 \cdot \mathsf{hypot}\left(1, x\right)}{x + \sqrt{\color{blue}{1 + x \cdot x}}}\right)$ $\log \left(\frac{2 \cdot \mathsf{hypot}\left(1, x\right)}{x + \color{blue}{\mathsf{hypot}\left(1, x\right)}}\right)$
3. Applied egg-rr0.1

$\leadsto \color{blue}{0 - \log \left(\left(x + \mathsf{hypot}\left(1, x\right)\right) \cdot \frac{0.5}{\mathsf{hypot}\left(1, x\right)}\right)}$
4. Simplified0.1

$\leadsto \color{blue}{-\log \left(\left(x + \mathsf{hypot}\left(1, x\right)\right) \cdot \frac{0.5}{\mathsf{hypot}\left(1, x\right)}\right)}$
Proof
[Start]0.1 $0 - \log \left(\left(x + \mathsf{hypot}\left(1, x\right)\right) \cdot \frac{0.5}{\mathsf{hypot}\left(1, x\right)}\right)$ $\color{blue}{-\log \left(\left(x + \mathsf{hypot}\left(1, x\right)\right) \cdot \frac{0.5}{\mathsf{hypot}\left(1, x\right)}\right)}$

## if 70 < x

1. Initial program 61.8

$\log \left(2 \cdot \frac{\sqrt{x \cdot x + 1}}{\sqrt{x \cdot x + 1} + x}\right)$
2. Simplified30.7

$\leadsto \color{blue}{\log \left(\frac{2 \cdot \mathsf{hypot}\left(1, x\right)}{x + \mathsf{hypot}\left(1, x\right)}\right)}$
Proof
[Start]61.8 $\log \left(2 \cdot \frac{\sqrt{x \cdot x + 1}}{\sqrt{x \cdot x + 1} + x}\right)$ $\log \color{blue}{\left(\frac{2 \cdot \sqrt{x \cdot x + 1}}{\sqrt{x \cdot x + 1} + x}\right)}$ $\log \left(\frac{2 \cdot \sqrt{\color{blue}{1 + x \cdot x}}}{\sqrt{x \cdot x + 1} + x}\right)$ $\log \left(\frac{2 \cdot \color{blue}{\mathsf{hypot}\left(1, x\right)}}{\sqrt{x \cdot x + 1} + x}\right)$ $\log \left(\frac{2 \cdot \mathsf{hypot}\left(1, x\right)}{\color{blue}{x + \sqrt{x \cdot x + 1}}}\right)$ $\log \left(\frac{2 \cdot \mathsf{hypot}\left(1, x\right)}{x + \sqrt{\color{blue}{1 + x \cdot x}}}\right)$ $\log \left(\frac{2 \cdot \mathsf{hypot}\left(1, x\right)}{x + \color{blue}{\mathsf{hypot}\left(1, x\right)}}\right)$
3. Taylor expanded in x around inf 0.7

$\leadsto \color{blue}{\left(0.11458333333333333 \cdot \frac{1}{{x}^{6}} + 0.25 \cdot \frac{1}{{x}^{2}}\right) - 0.15625 \cdot \frac{1}{{x}^{4}}}$
4. Simplified0.1

$\leadsto \color{blue}{\frac{\frac{0.25}{x}}{x} + \left(\frac{0.11458333333333333}{{x}^{6}} + \frac{-0.15625}{{x}^{4}}\right)}$
Proof
[Start]0.7 $\left(0.11458333333333333 \cdot \frac{1}{{x}^{6}} + 0.25 \cdot \frac{1}{{x}^{2}}\right) - 0.15625 \cdot \frac{1}{{x}^{4}}$ $\color{blue}{\left(0.11458333333333333 \cdot \frac{1}{{x}^{6}} + 0.25 \cdot \frac{1}{{x}^{2}}\right) + \left(-0.15625\right) \cdot \frac{1}{{x}^{4}}}$ $\color{blue}{\left(0.25 \cdot \frac{1}{{x}^{2}} + 0.11458333333333333 \cdot \frac{1}{{x}^{6}}\right)} + \left(-0.15625\right) \cdot \frac{1}{{x}^{4}}$ $\color{blue}{0.25 \cdot \frac{1}{{x}^{2}} + \left(0.11458333333333333 \cdot \frac{1}{{x}^{6}} + \left(-0.15625\right) \cdot \frac{1}{{x}^{4}}\right)}$ $\color{blue}{\frac{0.25 \cdot 1}{{x}^{2}}} + \left(0.11458333333333333 \cdot \frac{1}{{x}^{6}} + \left(-0.15625\right) \cdot \frac{1}{{x}^{4}}\right)$ $\frac{\color{blue}{0.25}}{{x}^{2}} + \left(0.11458333333333333 \cdot \frac{1}{{x}^{6}} + \left(-0.15625\right) \cdot \frac{1}{{x}^{4}}\right)$ $\frac{0.25}{\color{blue}{x \cdot x}} + \left(0.11458333333333333 \cdot \frac{1}{{x}^{6}} + \left(-0.15625\right) \cdot \frac{1}{{x}^{4}}\right)$ $\color{blue}{\frac{\frac{0.25}{x}}{x}} + \left(0.11458333333333333 \cdot \frac{1}{{x}^{6}} + \left(-0.15625\right) \cdot \frac{1}{{x}^{4}}\right)$ $\frac{\frac{0.25}{x}}{x} + \left(\color{blue}{\frac{0.11458333333333333 \cdot 1}{{x}^{6}}} + \left(-0.15625\right) \cdot \frac{1}{{x}^{4}}\right)$ $\frac{\frac{0.25}{x}}{x} + \left(\frac{\color{blue}{0.11458333333333333}}{{x}^{6}} + \left(-0.15625\right) \cdot \frac{1}{{x}^{4}}\right)$ $\frac{\frac{0.25}{x}}{x} + \left(\frac{0.11458333333333333}{{x}^{6}} + \left(-0.15625\right) \cdot \frac{1}{{x}^{\color{blue}{\left(2 \cdot 2\right)}}}\right)$ $\frac{\frac{0.25}{x}}{x} + \left(\frac{0.11458333333333333}{{x}^{6}} + \left(-0.15625\right) \cdot \frac{1}{\color{blue}{{x}^{2} \cdot {x}^{2}}}\right)$ $\frac{\frac{0.25}{x}}{x} + \left(\frac{0.11458333333333333}{{x}^{6}} + \left(-0.15625\right) \cdot \frac{1}{\color{blue}{\left(x \cdot x\right)} \cdot {x}^{2}}\right)$ $\frac{\frac{0.25}{x}}{x} + \left(\frac{0.11458333333333333}{{x}^{6}} + \left(-0.15625\right) \cdot \frac{1}{\left(x \cdot x\right) \cdot \color{blue}{\left(x \cdot x\right)}}\right)$ $\frac{\frac{0.25}{x}}{x} + \left(\frac{0.11458333333333333}{{x}^{6}} + \color{blue}{\frac{\left(-0.15625\right) \cdot 1}{\left(x \cdot x\right) \cdot \left(x \cdot x\right)}}\right)$ $\frac{\frac{0.25}{x}}{x} + \left(\frac{0.11458333333333333}{{x}^{6}} + \frac{\color{blue}{-0.15625} \cdot 1}{\left(x \cdot x\right) \cdot \left(x \cdot x\right)}\right)$ $\frac{\frac{0.25}{x}}{x} + \left(\frac{0.11458333333333333}{{x}^{6}} + \frac{\color{blue}{-0.15625}}{\left(x \cdot x\right) \cdot \left(x \cdot x\right)}\right)$ $\frac{\frac{0.25}{x}}{x} + \left(\frac{0.11458333333333333}{{x}^{6}} + \frac{-0.15625}{\color{blue}{{x}^{2}} \cdot \left(x \cdot x\right)}\right)$ $\frac{\frac{0.25}{x}}{x} + \left(\frac{0.11458333333333333}{{x}^{6}} + \frac{-0.15625}{{x}^{2} \cdot \color{blue}{{x}^{2}}}\right)$ $\frac{\frac{0.25}{x}}{x} + \left(\frac{0.11458333333333333}{{x}^{6}} + \frac{-0.15625}{\color{blue}{{x}^{\left(2 \cdot 2\right)}}}\right)$
3. Recombined 3 regimes into one program.
4. Final simplification0.1

$\leadsto \begin{array}{l} \mathbf{if}\;x \leq -400:\\ \;\;\;\;\mathsf{fma}\left(-2, \log \left(\frac{-1}{x}\right), \log 4 + \frac{0.75}{x \cdot x}\right)\\ \mathbf{elif}\;x \leq 70:\\ \;\;\;\;-\log \left(\left(x + \mathsf{hypot}\left(1, x\right)\right) \cdot \frac{0.5}{\mathsf{hypot}\left(1, x\right)}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{0.25}{x}}{x} + \left(\frac{0.11458333333333333}{{x}^{6}} + \frac{-0.15625}{{x}^{4}}\right)\\ \end{array}$

# Alternatives

Alternative 1
Error0.1
Cost20104
$\begin{array}{l} \mathbf{if}\;x \leq -8000:\\ \;\;\;\;\log \left(\mathsf{hypot}\left(1, x\right) \cdot 2\right) - \log \left(\frac{-0.5}{x}\right)\\ \mathbf{elif}\;x \leq 70:\\ \;\;\;\;-\log \left(\left(x + \mathsf{hypot}\left(1, x\right)\right) \cdot \frac{0.5}{\mathsf{hypot}\left(1, x\right)}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{0.25}{x}}{x} + \left(\frac{0.11458333333333333}{{x}^{6}} + \frac{-0.15625}{{x}^{4}}\right)\\ \end{array}$
Alternative 2
Error0.1
Cost20040
$\begin{array}{l} t_0 := \mathsf{hypot}\left(1, x\right) \cdot 2\\ \mathbf{if}\;x \leq -8000:\\ \;\;\;\;\log t_0 - \log \left(\frac{-0.5}{x}\right)\\ \mathbf{elif}\;x \leq 70:\\ \;\;\;\;\log \left(\frac{t_0}{x + \mathsf{hypot}\left(1, x\right)}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{0.25}{x}}{x} + \left(\frac{0.11458333333333333}{{x}^{6}} + \frac{-0.15625}{{x}^{4}}\right)\\ \end{array}$
Alternative 3
Error0.3
Cost19844
$\begin{array}{l} \mathbf{if}\;x \leq -1.1:\\ \;\;\;\;\log \left(\mathsf{hypot}\left(1, x\right) \cdot 2\right) - \log \left(\frac{-0.5}{x}\right)\\ \mathbf{elif}\;x \leq 1.1:\\ \;\;\;\;\log \left(\frac{2 \cdot \left(1 + x \cdot \left(x \cdot 0.5\right)\right)}{1 + \mathsf{fma}\left(0.5, x \cdot x, x\right)}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{0.25}{x}}{x} + \left(\frac{0.11458333333333333}{{x}^{6}} + \frac{-0.15625}{{x}^{4}}\right)\\ \end{array}$
Alternative 4
Error0.3
Cost14152
$\begin{array}{l} \mathbf{if}\;x \leq -1.3:\\ \;\;\;\;\log 4 + -2 \cdot \log \left(\frac{-1}{x}\right)\\ \mathbf{elif}\;x \leq 1.1:\\ \;\;\;\;\log \left(\frac{2 \cdot \left(1 + x \cdot \left(x \cdot 0.5\right)\right)}{1 + \mathsf{fma}\left(0.5, x \cdot x, x\right)}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{0.25}{x}}{x} + \left(\frac{0.11458333333333333}{{x}^{6}} + \frac{-0.15625}{{x}^{4}}\right)\\ \end{array}$
Alternative 5
Error0.3
Cost14024
$\begin{array}{l} t_0 := 1 + x \cdot \left(x \cdot 0.5\right)\\ \mathbf{if}\;x \leq -1.3:\\ \;\;\;\;\log 4 + -2 \cdot \log \left(\frac{-1}{x}\right)\\ \mathbf{elif}\;x \leq 1.1:\\ \;\;\;\;\log \left(\frac{2 \cdot t_0}{x + t_0}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{0.25}{x}}{x} + \left(\frac{0.11458333333333333}{{x}^{6}} + \frac{-0.15625}{{x}^{4}}\right)\\ \end{array}$
Alternative 6
Error0.4
Cost13380
$\begin{array}{l} t_0 := 1 + x \cdot \left(x \cdot 0.5\right)\\ \mathbf{if}\;x \leq -1.3:\\ \;\;\;\;\log 4 + -2 \cdot \log \left(\frac{-1}{x}\right)\\ \mathbf{elif}\;x \leq 1.25:\\ \;\;\;\;\log \left(\frac{2 \cdot t_0}{x + t_0}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{0.25}{x}}{x} + \frac{1}{x \cdot x} \cdot \frac{-0.15625}{x \cdot x}\\ \end{array}$
Alternative 7
Error7.1
Cost8012
$\begin{array}{l} t_0 := 1 + x \cdot \left(x \cdot 0.5\right)\\ \mathbf{if}\;x \leq -6.8 \cdot 10^{+153}:\\ \;\;\;\;\log \left(2 + x \cdot -2\right)\\ \mathbf{elif}\;x \leq -0.78:\\ \;\;\;\;\log \left(3 + x \cdot \left(x \cdot 4\right)\right)\\ \mathbf{elif}\;x \leq 1.25:\\ \;\;\;\;\log \left(\frac{2 \cdot t_0}{x + t_0}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{0.25}{x}}{x} + \frac{1}{x \cdot x} \cdot \frac{-0.15625}{x \cdot x}\\ \end{array}$
Alternative 8
Error7.3
Cost7112
$\begin{array}{l} \mathbf{if}\;x \leq -6.8 \cdot 10^{+153}:\\ \;\;\;\;\log \left(2 + x \cdot -2\right)\\ \mathbf{elif}\;x \leq -0.52:\\ \;\;\;\;\log \left(3 + x \cdot \left(x \cdot 4\right)\right)\\ \mathbf{elif}\;x \leq 0.75:\\ \;\;\;\;\log 2 - x\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{0.25}{x}}{x} + \frac{1}{x \cdot x} \cdot \frac{-0.15625}{x \cdot x}\\ \end{array}$
Alternative 9
Error7.8
Cost6988
$\begin{array}{l} \mathbf{if}\;x \leq -6.8 \cdot 10^{+153}:\\ \;\;\;\;\log 2\\ \mathbf{elif}\;x \leq -1.5:\\ \;\;\;\;\log \left(x \cdot \left(x \cdot 4\right)\right)\\ \mathbf{elif}\;x \leq 0.75:\\ \;\;\;\;\log 2 - x\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{0.25}{x}}{x} + \frac{1}{x \cdot x} \cdot \frac{-0.15625}{x \cdot x}\\ \end{array}$
Alternative 10
Error7.3
Cost6988
$\begin{array}{l} \mathbf{if}\;x \leq -6.8 \cdot 10^{+153}:\\ \;\;\;\;\log \left(2 + x \cdot -2\right)\\ \mathbf{elif}\;x \leq -1.5:\\ \;\;\;\;\log \left(x \cdot \left(x \cdot 4\right)\right)\\ \mathbf{elif}\;x \leq 0.75:\\ \;\;\;\;\log 2 - x\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{0.25}{x}}{x} + \frac{1}{x \cdot x} \cdot \frac{-0.15625}{x \cdot x}\\ \end{array}$
Alternative 11
Error14.8
Cost6596
$\begin{array}{l} \mathbf{if}\;x \leq 0.86:\\ \;\;\;\;\log 2\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{0.25}{x}}{x} + \frac{1}{x \cdot x} \cdot \frac{-0.15625}{x \cdot x}\\ \end{array}$
Alternative 12
Error47.0
Cost320
$\frac{0.25}{x \cdot x}$
Alternative 13
Error46.9
Cost320
$\frac{\frac{0.25}{x}}{x}$

# Reproduce?

herbie shell --seed 1
(FPCore (x)
:name "log(2sqrt(x*x + 1) / (sqrt(x*x + 1) + x))"
:precision binary64
:pre (and (<= -1.79e+308 x) (<= x 1.79e+308))
(log (* 2.0 (/ (sqrt (+ (* x x) 1.0)) (+ (sqrt (+ (* x x) 1.0)) x)))))