\[\log \left(x + \sqrt{x \cdot x + 1}\right)
\]
↓
\[\begin{array}{l}
\mathbf{if}\;x \leq -1.02:\\
\;\;\;\;\log \left(\left(-0.125 \cdot \frac{\frac{-1}{x \cdot x}}{x} + \left(0.0390625 \cdot {x}^{-7} + -0.0625 \cdot {x}^{-5}\right)\right) - 0.5 \cdot \frac{1}{x}\right)\\
\mathbf{elif}\;x \leq 0.0076:\\
\;\;\;\;\left(\left(-0.16666666666666666 \cdot x\right) \cdot x\right) \cdot x + \left(0.075 \cdot {x}^{5} + x\right)\\
\mathbf{else}:\\
\;\;\;\;\log \left(x + \mathsf{hypot}\left(x, 1\right)\right)\\
\end{array}
\]
(FPCore (x) :precision binary64 (log (+ x (sqrt (+ (* x x) 1.0)))))
↓
(FPCore (x)
:precision binary64
(if (<= x -1.02)
(log
(-
(+
(* -0.125 (/ (/ -1.0 (* x x)) x))
(+ (* 0.0390625 (pow x -7.0)) (* -0.0625 (pow x -5.0))))
(* 0.5 (/ 1.0 x))))
(if (<= x 0.0076)
(+ (* (* (* -0.16666666666666666 x) x) x) (+ (* 0.075 (pow x 5.0)) x))
(log (+ x (hypot x 1.0))))))double code(double x) {
return log((x + sqrt(((x * x) + 1.0))));
}
↓
double code(double x) {
double tmp;
if (x <= -1.02) {
tmp = log((((-0.125 * ((-1.0 / (x * x)) / x)) + ((0.0390625 * pow(x, -7.0)) + (-0.0625 * pow(x, -5.0)))) - (0.5 * (1.0 / x))));
} else if (x <= 0.0076) {
tmp = (((-0.16666666666666666 * x) * x) * x) + ((0.075 * pow(x, 5.0)) + x);
} else {
tmp = log((x + hypot(x, 1.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 tmp;
if (x <= -1.02) {
tmp = Math.log((((-0.125 * ((-1.0 / (x * x)) / x)) + ((0.0390625 * Math.pow(x, -7.0)) + (-0.0625 * Math.pow(x, -5.0)))) - (0.5 * (1.0 / x))));
} else if (x <= 0.0076) {
tmp = (((-0.16666666666666666 * x) * x) * x) + ((0.075 * Math.pow(x, 5.0)) + x);
} else {
tmp = Math.log((x + Math.hypot(x, 1.0)));
}
return tmp;
}
def code(x):
return math.log((x + math.sqrt(((x * x) + 1.0))))
↓
def code(x):
tmp = 0
if x <= -1.02:
tmp = math.log((((-0.125 * ((-1.0 / (x * x)) / x)) + ((0.0390625 * math.pow(x, -7.0)) + (-0.0625 * math.pow(x, -5.0)))) - (0.5 * (1.0 / x))))
elif x <= 0.0076:
tmp = (((-0.16666666666666666 * x) * x) * x) + ((0.075 * math.pow(x, 5.0)) + x)
else:
tmp = math.log((x + math.hypot(x, 1.0)))
return tmp
function code(x)
return log(Float64(x + sqrt(Float64(Float64(x * x) + 1.0))))
end
↓
function code(x)
tmp = 0.0
if (x <= -1.02)
tmp = log(Float64(Float64(Float64(-0.125 * Float64(Float64(-1.0 / Float64(x * x)) / x)) + Float64(Float64(0.0390625 * (x ^ -7.0)) + Float64(-0.0625 * (x ^ -5.0)))) - Float64(0.5 * Float64(1.0 / x))));
elseif (x <= 0.0076)
tmp = Float64(Float64(Float64(Float64(-0.16666666666666666 * x) * x) * x) + Float64(Float64(0.075 * (x ^ 5.0)) + x));
else
tmp = log(Float64(x + hypot(x, 1.0)));
end
return tmp
end
function tmp = code(x)
tmp = log((x + sqrt(((x * x) + 1.0))));
end
↓
function tmp_2 = code(x)
tmp = 0.0;
if (x <= -1.02)
tmp = log((((-0.125 * ((-1.0 / (x * x)) / x)) + ((0.0390625 * (x ^ -7.0)) + (-0.0625 * (x ^ -5.0)))) - (0.5 * (1.0 / x))));
elseif (x <= 0.0076)
tmp = (((-0.16666666666666666 * x) * x) * x) + ((0.075 * (x ^ 5.0)) + x);
else
tmp = log((x + hypot(x, 1.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_] := If[LessEqual[x, -1.02], N[Log[N[(N[(N[(-0.125 * N[(N[(-1.0 / N[(x * x), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision] + N[(N[(0.0390625 * N[Power[x, -7.0], $MachinePrecision]), $MachinePrecision] + N[(-0.0625 * N[Power[x, -5.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(0.5 * N[(1.0 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[x, 0.0076], N[(N[(N[(N[(-0.16666666666666666 * x), $MachinePrecision] * x), $MachinePrecision] * x), $MachinePrecision] + N[(N[(0.075 * N[Power[x, 5.0], $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]), $MachinePrecision], N[Log[N[(x + N[Sqrt[x ^ 2 + 1.0 ^ 2], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]
\log \left(x + \sqrt{x \cdot x + 1}\right)
↓
\begin{array}{l}
\mathbf{if}\;x \leq -1.02:\\
\;\;\;\;\log \left(\left(-0.125 \cdot \frac{\frac{-1}{x \cdot x}}{x} + \left(0.0390625 \cdot {x}^{-7} + -0.0625 \cdot {x}^{-5}\right)\right) - 0.5 \cdot \frac{1}{x}\right)\\
\mathbf{elif}\;x \leq 0.0076:\\
\;\;\;\;\left(\left(-0.16666666666666666 \cdot x\right) \cdot x\right) \cdot x + \left(0.075 \cdot {x}^{5} + x\right)\\
\mathbf{else}:\\
\;\;\;\;\log \left(x + \mathsf{hypot}\left(x, 1\right)\right)\\
\end{array}
Alternatives
| Alternative 1 |
|---|
| Error | 0.1 |
|---|
| Cost | 14276 |
|---|
\[\begin{array}{l}
\mathbf{if}\;x \leq -1.05:\\
\;\;\;\;\log \left(\left(-0.125 \cdot \frac{\frac{-1}{x \cdot x}}{x} + 0.0625 \cdot \left(-{x}^{-5}\right)\right) - 0.5 \cdot \frac{1}{x}\right)\\
\mathbf{elif}\;x \leq 0.0076:\\
\;\;\;\;\left(\left(-0.16666666666666666 \cdot x\right) \cdot x\right) \cdot x + \left(0.075 \cdot {x}^{5} + x\right)\\
\mathbf{else}:\\
\;\;\;\;\log \left(x + \mathsf{hypot}\left(x, 1\right)\right)\\
\end{array}
\]
| Alternative 2 |
|---|
| Error | 0.2 |
|---|
| Cost | 13320 |
|---|
\[\begin{array}{l}
\mathbf{if}\;x \leq -1.12:\\
\;\;\;\;\log \left(\frac{-0.5 + \frac{0.125}{x \cdot x}}{x}\right)\\
\mathbf{elif}\;x \leq 0.0076:\\
\;\;\;\;\left(\left(-0.16666666666666666 \cdot x\right) \cdot x\right) \cdot x + \left(0.075 \cdot {x}^{5} + x\right)\\
\mathbf{else}:\\
\;\;\;\;\log \left(x + \mathsf{hypot}\left(x, 1\right)\right)\\
\end{array}
\]
| Alternative 3 |
|---|
| Error | 0.3 |
|---|
| Cost | 7560 |
|---|
\[\begin{array}{l}
\mathbf{if}\;x \leq -1.12:\\
\;\;\;\;\log \left(\frac{-0.5 + \frac{0.125}{x \cdot x}}{x}\right)\\
\mathbf{elif}\;x \leq 1.3:\\
\;\;\;\;\left(\left(-0.16666666666666666 \cdot x\right) \cdot x\right) \cdot x + \left(0.075 \cdot {x}^{5} + x\right)\\
\mathbf{else}:\\
\;\;\;\;\log \left(2 \cdot x\right)\\
\end{array}
\]
| Alternative 4 |
|---|
| Error | 0.4 |
|---|
| Cost | 7108 |
|---|
\[\begin{array}{l}
\mathbf{if}\;x \leq -1.1:\\
\;\;\;\;\log \left(\frac{-0.5 + \frac{0.125}{x \cdot x}}{x}\right)\\
\mathbf{elif}\;x \leq 1.25:\\
\;\;\;\;\left(\left(-0.16666666666666666 \cdot x\right) \cdot x\right) \cdot x + x\\
\mathbf{else}:\\
\;\;\;\;\log \left(2 \cdot x\right)\\
\end{array}
\]
| Alternative 5 |
|---|
| Error | 0.5 |
|---|
| Cost | 6856 |
|---|
\[\begin{array}{l}
\mathbf{if}\;x \leq -1.25:\\
\;\;\;\;\log \left(\frac{-0.5}{x}\right)\\
\mathbf{elif}\;x \leq 1.25:\\
\;\;\;\;\left(\left(-0.16666666666666666 \cdot x\right) \cdot x\right) \cdot x + x\\
\mathbf{else}:\\
\;\;\;\;\log \left(2 \cdot x\right)\\
\end{array}
\]
| Alternative 6 |
|---|
| Error | 15.9 |
|---|
| Cost | 6724 |
|---|
\[\begin{array}{l}
\mathbf{if}\;x \leq 1.25:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;\log \left(2 \cdot x\right)\\
\end{array}
\]
| Alternative 7 |
|---|
| Error | 30.7 |
|---|
| Cost | 64 |
|---|
\[x
\]