\[\frac{\left(1 - x\right) \cdot \left(3 - x\right)}{y \cdot 3}
\]
↓
\[\frac{1 - x}{y} \cdot \frac{-3 + x}{-3}
\]
(FPCore (x y) :precision binary64 (/ (* (- 1.0 x) (- 3.0 x)) (* y 3.0)))
↓
(FPCore (x y) :precision binary64 (* (/ (- 1.0 x) y) (/ (+ -3.0 x) -3.0)))
double code(double x, double y) {
return ((1.0 - x) * (3.0 - x)) / (y * 3.0);
}
↓
double code(double x, double y) {
return ((1.0 - x) / y) * ((-3.0 + x) / -3.0);
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = ((1.0d0 - x) * (3.0d0 - x)) / (y * 3.0d0)
end function
↓
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = ((1.0d0 - x) / y) * (((-3.0d0) + x) / (-3.0d0))
end function
public static double code(double x, double y) {
return ((1.0 - x) * (3.0 - x)) / (y * 3.0);
}
↓
public static double code(double x, double y) {
return ((1.0 - x) / y) * ((-3.0 + x) / -3.0);
}
def code(x, y):
return ((1.0 - x) * (3.0 - x)) / (y * 3.0)
↓
def code(x, y):
return ((1.0 - x) / y) * ((-3.0 + x) / -3.0)
function code(x, y)
return Float64(Float64(Float64(1.0 - x) * Float64(3.0 - x)) / Float64(y * 3.0))
end
↓
function code(x, y)
return Float64(Float64(Float64(1.0 - x) / y) * Float64(Float64(-3.0 + x) / -3.0))
end
function tmp = code(x, y)
tmp = ((1.0 - x) * (3.0 - x)) / (y * 3.0);
end
↓
function tmp = code(x, y)
tmp = ((1.0 - x) / y) * ((-3.0 + x) / -3.0);
end
code[x_, y_] := N[(N[(N[(1.0 - x), $MachinePrecision] * N[(3.0 - x), $MachinePrecision]), $MachinePrecision] / N[(y * 3.0), $MachinePrecision]), $MachinePrecision]
↓
code[x_, y_] := N[(N[(N[(1.0 - x), $MachinePrecision] / y), $MachinePrecision] * N[(N[(-3.0 + x), $MachinePrecision] / -3.0), $MachinePrecision]), $MachinePrecision]
\frac{\left(1 - x\right) \cdot \left(3 - x\right)}{y \cdot 3}
↓
\frac{1 - x}{y} \cdot \frac{-3 + x}{-3}
Alternatives
| Alternative 1 |
|---|
| Error | 1.5 |
|---|
| Cost | 904 |
|---|
\[\begin{array}{l}
t_0 := \frac{-x}{y}\\
\mathbf{if}\;x \leq -2.3:\\
\;\;\;\;t_0 \cdot \left(x \cdot -0.3333333333333333 - -1\right)\\
\mathbf{elif}\;x \leq 1.35:\\
\;\;\;\;\frac{1 + -1.3333333333333333 \cdot x}{y}\\
\mathbf{else}:\\
\;\;\;\;t_0 \cdot \frac{-3 + x}{-3}\\
\end{array}
\]
| Alternative 2 |
|---|
| Error | 1.5 |
|---|
| Cost | 840 |
|---|
\[\begin{array}{l}
t_0 := \left(-0.3333333333333333 \cdot \frac{1 - x}{y}\right) \cdot x\\
\mathbf{if}\;x \leq -3.8:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x \leq 3:\\
\;\;\;\;\frac{1 + -1.3333333333333333 \cdot x}{y}\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\]
| Alternative 3 |
|---|
| Error | 1.5 |
|---|
| Cost | 840 |
|---|
\[\begin{array}{l}
\mathbf{if}\;x \leq -3.8:\\
\;\;\;\;\frac{x}{3 \cdot y} \cdot \left(-1 + x\right)\\
\mathbf{elif}\;x \leq 3:\\
\;\;\;\;\frac{1 + -1.3333333333333333 \cdot x}{y}\\
\mathbf{else}:\\
\;\;\;\;\left(-0.3333333333333333 \cdot \frac{1 - x}{y}\right) \cdot x\\
\end{array}
\]
| Alternative 4 |
|---|
| Error | 1.5 |
|---|
| Cost | 840 |
|---|
\[\begin{array}{l}
\mathbf{if}\;x \leq -3.8:\\
\;\;\;\;\frac{x}{3 \cdot y} \cdot \left(-1 + x\right)\\
\mathbf{elif}\;x \leq 3:\\
\;\;\;\;\frac{1 + -1.3333333333333333 \cdot x}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{y} \cdot \frac{x}{-3}\\
\end{array}
\]
| Alternative 5 |
|---|
| Error | 1.5 |
|---|
| Cost | 840 |
|---|
\[\begin{array}{l}
\mathbf{if}\;x \leq -3.8:\\
\;\;\;\;\frac{x}{3 \cdot y} \cdot \left(-1 + x\right)\\
\mathbf{elif}\;x \leq 3:\\
\;\;\;\;\frac{1 + -1.3333333333333333 \cdot x}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y}}{-3} \cdot \left(1 - x\right)\\
\end{array}
\]
| Alternative 6 |
|---|
| Error | 1.5 |
|---|
| Cost | 840 |
|---|
\[\begin{array}{l}
\mathbf{if}\;x \leq -2.3:\\
\;\;\;\;\frac{-x}{y} \cdot \left(\left(-3 + x\right) \cdot -0.3333333333333333\right)\\
\mathbf{elif}\;x \leq 3:\\
\;\;\;\;\frac{1 + -1.3333333333333333 \cdot x}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y}}{-3} \cdot \left(1 - x\right)\\
\end{array}
\]
| Alternative 7 |
|---|
| Error | 1.5 |
|---|
| Cost | 840 |
|---|
\[\begin{array}{l}
\mathbf{if}\;x \leq -2.3:\\
\;\;\;\;\frac{-x}{y} \cdot \left(x \cdot -0.3333333333333333 - -1\right)\\
\mathbf{elif}\;x \leq 3:\\
\;\;\;\;\frac{1 + -1.3333333333333333 \cdot x}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y}}{-3} \cdot \left(1 - x\right)\\
\end{array}
\]
| Alternative 8 |
|---|
| Error | 1.5 |
|---|
| Cost | 776 |
|---|
\[\begin{array}{l}
t_0 := \frac{-x}{y} \cdot \left(x \cdot -0.3333333333333333\right)\\
\mathbf{if}\;x \leq -4.6:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x \leq 3:\\
\;\;\;\;\frac{1 + -1.3333333333333333 \cdot x}{y}\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\]
| Alternative 9 |
|---|
| Error | 0.4 |
|---|
| Cost | 704 |
|---|
\[\left(\left(3 - x\right) \cdot \frac{-1 + x}{y}\right) \cdot -0.3333333333333333
\]
| Alternative 10 |
|---|
| Error | 0.2 |
|---|
| Cost | 704 |
|---|
\[\frac{1 - x}{y} \cdot \left(\left(-3 + x\right) \cdot -0.3333333333333333\right)
\]
| Alternative 11 |
|---|
| Error | 0.2 |
|---|
| Cost | 704 |
|---|
\[\frac{1 - x}{y} \cdot \left(x \cdot -0.3333333333333333 - -1\right)
\]
| Alternative 12 |
|---|
| Error | 20.8 |
|---|
| Cost | 448 |
|---|
\[\frac{1 + -1.3333333333333333 \cdot x}{y}
\]
| Alternative 13 |
|---|
| Error | 21.1 |
|---|
| Cost | 192 |
|---|
\[\frac{1}{y}
\]