\[3 \cdot \left(\left(\left(x \cdot 3\right) \cdot x - x \cdot 4\right) + 1\right)
\]
↓
\[\left(3 + \left(x \cdot x\right) \cdot 9\right) + 3 \cdot \left(x \cdot -4\right)
\]
(FPCore (x) :precision binary64 (* 3.0 (+ (- (* (* x 3.0) x) (* x 4.0)) 1.0)))
↓
(FPCore (x) :precision binary64 (+ (+ 3.0 (* (* x x) 9.0)) (* 3.0 (* x -4.0))))
double code(double x) {
return 3.0 * ((((x * 3.0) * x) - (x * 4.0)) + 1.0);
}
↓
double code(double x) {
return (3.0 + ((x * x) * 9.0)) + (3.0 * (x * -4.0));
}
real(8) function code(x)
real(8), intent (in) :: x
code = 3.0d0 * ((((x * 3.0d0) * x) - (x * 4.0d0)) + 1.0d0)
end function
↓
real(8) function code(x)
real(8), intent (in) :: x
code = (3.0d0 + ((x * x) * 9.0d0)) + (3.0d0 * (x * (-4.0d0)))
end function
public static double code(double x) {
return 3.0 * ((((x * 3.0) * x) - (x * 4.0)) + 1.0);
}
↓
public static double code(double x) {
return (3.0 + ((x * x) * 9.0)) + (3.0 * (x * -4.0));
}
def code(x):
return 3.0 * ((((x * 3.0) * x) - (x * 4.0)) + 1.0)
↓
def code(x):
return (3.0 + ((x * x) * 9.0)) + (3.0 * (x * -4.0))
function code(x)
return Float64(3.0 * Float64(Float64(Float64(Float64(x * 3.0) * x) - Float64(x * 4.0)) + 1.0))
end
↓
function code(x)
return Float64(Float64(3.0 + Float64(Float64(x * x) * 9.0)) + Float64(3.0 * Float64(x * -4.0)))
end
function tmp = code(x)
tmp = 3.0 * ((((x * 3.0) * x) - (x * 4.0)) + 1.0);
end
↓
function tmp = code(x)
tmp = (3.0 + ((x * x) * 9.0)) + (3.0 * (x * -4.0));
end
code[x_] := N[(3.0 * N[(N[(N[(N[(x * 3.0), $MachinePrecision] * x), $MachinePrecision] - N[(x * 4.0), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]
↓
code[x_] := N[(N[(3.0 + N[(N[(x * x), $MachinePrecision] * 9.0), $MachinePrecision]), $MachinePrecision] + N[(3.0 * N[(x * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
3 \cdot \left(\left(\left(x \cdot 3\right) \cdot x - x \cdot 4\right) + 1\right)
↓
\left(3 + \left(x \cdot x\right) \cdot 9\right) + 3 \cdot \left(x \cdot -4\right)
Alternatives
| Alternative 1 |
|---|
| Error | 1.0 |
|---|
| Cost | 840 |
|---|
\[\begin{array}{l}
\mathbf{if}\;x \leq -0.58:\\
\;\;\;\;x \cdot \left(x \cdot 9 + -12\right)\\
\mathbf{elif}\;x \leq 0.58:\\
\;\;\;\;3 \cdot \left(x \cdot -4 + 1\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(x \cdot 9\right) + x \cdot -12\\
\end{array}
\]
| Alternative 2 |
|---|
| Error | 1.5 |
|---|
| Cost | 713 |
|---|
\[\begin{array}{l}
\mathbf{if}\;x \leq -1.55 \lor \neg \left(x \leq 1\right):\\
\;\;\;\;\left(x \cdot x\right) \cdot 9\\
\mathbf{else}:\\
\;\;\;\;3 \cdot \left(x \cdot -4 + 1\right)\\
\end{array}
\]
| Alternative 3 |
|---|
| Error | 1.0 |
|---|
| Cost | 713 |
|---|
\[\begin{array}{l}
\mathbf{if}\;x \leq -0.58 \lor \neg \left(x \leq 0.58\right):\\
\;\;\;\;x \cdot \left(x \cdot 9 + -12\right)\\
\mathbf{else}:\\
\;\;\;\;3 \cdot \left(x \cdot -4 + 1\right)\\
\end{array}
\]
| Alternative 4 |
|---|
| Error | 0.1 |
|---|
| Cost | 704 |
|---|
\[3 + \left(x \cdot \left(x \cdot 9\right) + x \cdot -12\right)
\]
| Alternative 5 |
|---|
| Error | 2.1 |
|---|
| Cost | 585 |
|---|
\[\begin{array}{l}
\mathbf{if}\;x \leq -0.58 \lor \neg \left(x \leq 0.195\right):\\
\;\;\;\;\left(x \cdot x\right) \cdot 9\\
\mathbf{else}:\\
\;\;\;\;3\\
\end{array}
\]
| Alternative 6 |
|---|
| Error | 1.5 |
|---|
| Cost | 585 |
|---|
\[\begin{array}{l}
\mathbf{if}\;x \leq -1.55 \lor \neg \left(x \leq 1\right):\\
\;\;\;\;\left(x \cdot x\right) \cdot 9\\
\mathbf{else}:\\
\;\;\;\;3 + x \cdot -12\\
\end{array}
\]
| Alternative 7 |
|---|
| Error | 0.1 |
|---|
| Cost | 576 |
|---|
\[3 + x \cdot \left(x \cdot 9 + -12\right)
\]
| Alternative 8 |
|---|
| Error | 21.1 |
|---|
| Cost | 64 |
|---|
\[3
\]