\[\log \left(x + \sqrt{x \cdot x + 1}\right)
\]
↓
\[\begin{array}{l}
t_0 := \log \left(\sqrt{x + \mathsf{hypot}\left(1, x\right)}\right)\\
\mathbf{if}\;x \leq -48450.84557538221:\\
\;\;\;\;-\log \left(\left(\frac{-0.5}{x} - x\right) - x\right)\\
\mathbf{elif}\;x \leq 9.821702311257485 \cdot 10^{-8}:\\
\;\;\;\;x + -0.16666666666666666 \cdot {x}^{3}\\
\mathbf{else}:\\
\;\;\;\;t_0 + t_0\\
\end{array}
\]
(FPCore (x) :precision binary64 (log (+ x (sqrt (+ (* x x) 1.0)))))
↓
(FPCore (x)
:precision binary64
(let* ((t_0 (log (sqrt (+ x (hypot 1.0 x))))))
(if (<= x -48450.84557538221)
(- (log (- (- (/ -0.5 x) x) x)))
(if (<= x 9.821702311257485e-8)
(+ x (* -0.16666666666666666 (pow x 3.0)))
(+ t_0 t_0)))))double code(double x) {
return log((x + sqrt(((x * x) + 1.0))));
}
↓
double code(double x) {
double t_0 = log(sqrt((x + hypot(1.0, x))));
double tmp;
if (x <= -48450.84557538221) {
tmp = -log((((-0.5 / x) - x) - x));
} else if (x <= 9.821702311257485e-8) {
tmp = x + (-0.16666666666666666 * pow(x, 3.0));
} else {
tmp = t_0 + t_0;
}
return tmp;
}
public static double code(double x) {
return Math.log((x + Math.sqrt(((x * x) + 1.0))));
}
↓
public static double code(double x) {
double t_0 = Math.log(Math.sqrt((x + Math.hypot(1.0, x))));
double tmp;
if (x <= -48450.84557538221) {
tmp = -Math.log((((-0.5 / x) - x) - x));
} else if (x <= 9.821702311257485e-8) {
tmp = x + (-0.16666666666666666 * Math.pow(x, 3.0));
} else {
tmp = t_0 + t_0;
}
return tmp;
}
def code(x):
return math.log((x + math.sqrt(((x * x) + 1.0))))
↓
def code(x):
t_0 = math.log(math.sqrt((x + math.hypot(1.0, x))))
tmp = 0
if x <= -48450.84557538221:
tmp = -math.log((((-0.5 / x) - x) - x))
elif x <= 9.821702311257485e-8:
tmp = x + (-0.16666666666666666 * math.pow(x, 3.0))
else:
tmp = t_0 + t_0
return tmp
function code(x)
return log(Float64(x + sqrt(Float64(Float64(x * x) + 1.0))))
end
↓
function code(x)
t_0 = log(sqrt(Float64(x + hypot(1.0, x))))
tmp = 0.0
if (x <= -48450.84557538221)
tmp = Float64(-log(Float64(Float64(Float64(-0.5 / x) - x) - x)));
elseif (x <= 9.821702311257485e-8)
tmp = Float64(x + Float64(-0.16666666666666666 * (x ^ 3.0)));
else
tmp = Float64(t_0 + t_0);
end
return tmp
end
function tmp = code(x)
tmp = log((x + sqrt(((x * x) + 1.0))));
end
↓
function tmp_2 = code(x)
t_0 = log(sqrt((x + hypot(1.0, x))));
tmp = 0.0;
if (x <= -48450.84557538221)
tmp = -log((((-0.5 / x) - x) - x));
elseif (x <= 9.821702311257485e-8)
tmp = x + (-0.16666666666666666 * (x ^ 3.0));
else
tmp = t_0 + t_0;
end
tmp_2 = tmp;
end
code[x_] := N[Log[N[(x + N[Sqrt[N[(N[(x * x), $MachinePrecision] + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
↓
code[x_] := Block[{t$95$0 = N[Log[N[Sqrt[N[(x + N[Sqrt[1.0 ^ 2 + x ^ 2], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]}, If[LessEqual[x, -48450.84557538221], (-N[Log[N[(N[(N[(-0.5 / x), $MachinePrecision] - x), $MachinePrecision] - x), $MachinePrecision]], $MachinePrecision]), If[LessEqual[x, 9.821702311257485e-8], N[(x + N[(-0.16666666666666666 * N[Power[x, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$0 + t$95$0), $MachinePrecision]]]]
\log \left(x + \sqrt{x \cdot x + 1}\right)
↓
\begin{array}{l}
t_0 := \log \left(\sqrt{x + \mathsf{hypot}\left(1, x\right)}\right)\\
\mathbf{if}\;x \leq -48450.84557538221:\\
\;\;\;\;-\log \left(\left(\frac{-0.5}{x} - x\right) - x\right)\\
\mathbf{elif}\;x \leq 9.821702311257485 \cdot 10^{-8}:\\
\;\;\;\;x + -0.16666666666666666 \cdot {x}^{3}\\
\mathbf{else}:\\
\;\;\;\;t_0 + t_0\\
\end{array}
Alternatives
| Alternative 1 |
|---|
| Error | 0.4 |
|---|
| Cost | 13576 |
|---|
\[\begin{array}{l}
\mathbf{if}\;x \leq -48450.84557538221:\\
\;\;\;\;-\log \left(\left(\frac{-0.5}{x} - x\right) - x\right)\\
\mathbf{elif}\;x \leq 9.821702311257485 \cdot 10^{-8}:\\
\;\;\;\;x + -0.16666666666666666 \cdot {x}^{3}\\
\mathbf{else}:\\
\;\;\;\;1 + \left(\log \left(x + \mathsf{hypot}\left(1, x\right)\right) + -1\right)\\
\end{array}
\]
| Alternative 2 |
|---|
| Error | 0.4 |
|---|
| Cost | 13320 |
|---|
\[\begin{array}{l}
\mathbf{if}\;x \leq -48450.84557538221:\\
\;\;\;\;-\log \left(\left(\frac{-0.5}{x} - x\right) - x\right)\\
\mathbf{elif}\;x \leq 9.821702311257485 \cdot 10^{-8}:\\
\;\;\;\;x + -0.16666666666666666 \cdot {x}^{3}\\
\mathbf{else}:\\
\;\;\;\;\log \left(x + \mathsf{hypot}\left(1, x\right)\right)\\
\end{array}
\]
| Alternative 3 |
|---|
| Error | 0.5 |
|---|
| Cost | 7112 |
|---|
\[\begin{array}{l}
\mathbf{if}\;x \leq -48450.84557538221:\\
\;\;\;\;\log \left(\frac{-0.5}{x}\right)\\
\mathbf{elif}\;x \leq 0.028846596609468356:\\
\;\;\;\;x + -0.16666666666666666 \cdot {x}^{3}\\
\mathbf{else}:\\
\;\;\;\;\log \left(x + \left(x + \frac{0.5}{x}\right)\right)\\
\end{array}
\]
| Alternative 4 |
|---|
| Error | 0.5 |
|---|
| Cost | 7112 |
|---|
\[\begin{array}{l}
\mathbf{if}\;x \leq -48450.84557538221:\\
\;\;\;\;-\log \left(\left(\frac{-0.5}{x} - x\right) - x\right)\\
\mathbf{elif}\;x \leq 0.028846596609468356:\\
\;\;\;\;x + -0.16666666666666666 \cdot {x}^{3}\\
\mathbf{else}:\\
\;\;\;\;\log \left(x + \left(x + \frac{0.5}{x}\right)\right)\\
\end{array}
\]
| Alternative 5 |
|---|
| Error | 0.6 |
|---|
| Cost | 7048 |
|---|
\[\begin{array}{l}
\mathbf{if}\;x \leq -48450.84557538221:\\
\;\;\;\;\log \left(\frac{-0.5}{x}\right)\\
\mathbf{elif}\;x \leq 0.028846596609468356:\\
\;\;\;\;x + -0.16666666666666666 \cdot {x}^{3}\\
\mathbf{else}:\\
\;\;\;\;\log \left(x \cdot 2\right)\\
\end{array}
\]
| Alternative 6 |
|---|
| Error | 0.7 |
|---|
| Cost | 6856 |
|---|
\[\begin{array}{l}
\mathbf{if}\;x \leq -48450.84557538221:\\
\;\;\;\;\log \left(\frac{-0.5}{x}\right)\\
\mathbf{elif}\;x \leq 0.028846596609468356:\\
\;\;\;\;\left(x \cdot \left(x + -2\right)\right) \cdot \frac{1}{x + -2}\\
\mathbf{else}:\\
\;\;\;\;\log \left(x \cdot 2\right)\\
\end{array}
\]
| Alternative 7 |
|---|
| Error | 15.6 |
|---|
| Cost | 6724 |
|---|
\[\begin{array}{l}
\mathbf{if}\;x \leq -48450.84557538221:\\
\;\;\;\;\log \left(\frac{-0.5}{x}\right)\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\]
| Alternative 8 |
|---|
| Error | 30.4 |
|---|
| Cost | 64 |
|---|
\[x
\]