\[ \begin{array}{c}[d2, d4] = \mathsf{sort}([d2, d4])\\ \end{array} \]
\[\left(\left(d1 \cdot d2 - d1 \cdot d3\right) + d4 \cdot d1\right) - d1 \cdot d1
\]
↓
\[\left(d1 \cdot d4 - d1 \cdot d1\right) + d1 \cdot \left(d2 - d3\right)
\]
(FPCore (d1 d2 d3 d4)
:precision binary64
(- (+ (- (* d1 d2) (* d1 d3)) (* d4 d1)) (* d1 d1)))
↓
(FPCore (d1 d2 d3 d4)
:precision binary64
(+ (- (* d1 d4) (* d1 d1)) (* d1 (- d2 d3))))
double code(double d1, double d2, double d3, double d4) {
return (((d1 * d2) - (d1 * d3)) + (d4 * d1)) - (d1 * d1);
}
↓
double code(double d1, double d2, double d3, double d4) {
return ((d1 * d4) - (d1 * d1)) + (d1 * (d2 - d3));
}
real(8) function code(d1, d2, d3, d4)
real(8), intent (in) :: d1
real(8), intent (in) :: d2
real(8), intent (in) :: d3
real(8), intent (in) :: d4
code = (((d1 * d2) - (d1 * d3)) + (d4 * d1)) - (d1 * d1)
end function
↓
real(8) function code(d1, d2, d3, d4)
real(8), intent (in) :: d1
real(8), intent (in) :: d2
real(8), intent (in) :: d3
real(8), intent (in) :: d4
code = ((d1 * d4) - (d1 * d1)) + (d1 * (d2 - d3))
end function
public static double code(double d1, double d2, double d3, double d4) {
return (((d1 * d2) - (d1 * d3)) + (d4 * d1)) - (d1 * d1);
}
↓
public static double code(double d1, double d2, double d3, double d4) {
return ((d1 * d4) - (d1 * d1)) + (d1 * (d2 - d3));
}
def code(d1, d2, d3, d4):
return (((d1 * d2) - (d1 * d3)) + (d4 * d1)) - (d1 * d1)
↓
def code(d1, d2, d3, d4):
return ((d1 * d4) - (d1 * d1)) + (d1 * (d2 - d3))
function code(d1, d2, d3, d4)
return Float64(Float64(Float64(Float64(d1 * d2) - Float64(d1 * d3)) + Float64(d4 * d1)) - Float64(d1 * d1))
end
↓
function code(d1, d2, d3, d4)
return Float64(Float64(Float64(d1 * d4) - Float64(d1 * d1)) + Float64(d1 * Float64(d2 - d3)))
end
function tmp = code(d1, d2, d3, d4)
tmp = (((d1 * d2) - (d1 * d3)) + (d4 * d1)) - (d1 * d1);
end
↓
function tmp = code(d1, d2, d3, d4)
tmp = ((d1 * d4) - (d1 * d1)) + (d1 * (d2 - d3));
end
code[d1_, d2_, d3_, d4_] := N[(N[(N[(N[(d1 * d2), $MachinePrecision] - N[(d1 * d3), $MachinePrecision]), $MachinePrecision] + N[(d4 * d1), $MachinePrecision]), $MachinePrecision] - N[(d1 * d1), $MachinePrecision]), $MachinePrecision]
↓
code[d1_, d2_, d3_, d4_] := N[(N[(N[(d1 * d4), $MachinePrecision] - N[(d1 * d1), $MachinePrecision]), $MachinePrecision] + N[(d1 * N[(d2 - d3), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\left(\left(d1 \cdot d2 - d1 \cdot d3\right) + d4 \cdot d1\right) - d1 \cdot d1
↓
\left(d1 \cdot d4 - d1 \cdot d1\right) + d1 \cdot \left(d2 - d3\right)
Alternatives
| Alternative 1 |
|---|
| Error | 80.0% |
|---|
| Cost | 1246.00 |
|---|
\[\begin{array}{l}
t_0 := d1 \cdot \left(d2 - d3\right)\\
t_1 := d1 \cdot \left(d4 - d1\right)\\
\mathbf{if}\;d2 \leq -6 \cdot 10^{+44}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;d2 \leq -7 \cdot 10^{+30}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;d2 \leq -5 \cdot 10^{-33}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;d2 \leq -2.9 \cdot 10^{-162} \lor \neg \left(d2 \leq -1.5 \cdot 10^{-193}\right) \land \left(d2 \leq -2.3 \cdot 10^{-299} \lor \neg \left(d2 \leq 5 \cdot 10^{-305}\right)\right):\\
\;\;\;\;d1 \cdot \left(d4 - d3\right)\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\]
| Alternative 2 |
|---|
| Error | 79.6% |
|---|
| Cost | 1177.00 |
|---|
\[\begin{array}{l}
t_0 := d1 \cdot \left(d2 - d3\right)\\
\mathbf{if}\;d2 \leq -3.2 \cdot 10^{+45}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;d2 \leq -4.7 \cdot 10^{+30}:\\
\;\;\;\;d1 \cdot \left(d4 - d1\right)\\
\mathbf{elif}\;d2 \leq -2.45 \cdot 10^{-33}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;d2 \leq -1.36 \cdot 10^{-170} \lor \neg \left(d2 \leq -2.9 \cdot 10^{-295}\right) \land d2 \leq 1.75 \cdot 10^{-304}:\\
\;\;\;\;-d1 \cdot \left(d1 + d3\right)\\
\mathbf{else}:\\
\;\;\;\;d1 \cdot \left(d4 - d3\right)\\
\end{array}
\]
| Alternative 3 |
|---|
| Error | 69.0% |
|---|
| Cost | 848.00 |
|---|
\[\begin{array}{l}
t_0 := d1 \cdot \left(-d3\right)\\
t_1 := d1 \cdot \left(d2 + d4\right)\\
\mathbf{if}\;d3 \leq -8 \cdot 10^{+91}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;d3 \leq -8.6 \cdot 10^{-171}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;d3 \leq 1.2 \cdot 10^{-177}:\\
\;\;\;\;d1 \cdot \left(d2 - d1\right)\\
\mathbf{elif}\;d3 \leq 1.66 \cdot 10^{+123}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\]
| Alternative 4 |
|---|
| Error | 74.4% |
|---|
| Cost | 848.00 |
|---|
\[\begin{array}{l}
t_0 := d1 \cdot \left(d2 - d3\right)\\
t_1 := d1 \cdot \left(d2 + d4\right)\\
\mathbf{if}\;d3 \leq -3.1 \cdot 10^{+87}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;d3 \leq -6.5 \cdot 10^{-175}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;d3 \leq 6 \cdot 10^{-171}:\\
\;\;\;\;d1 \cdot \left(d2 - d1\right)\\
\mathbf{elif}\;d3 \leq 5.5 \cdot 10^{+69}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\]
| Alternative 5 |
|---|
| Error | 50.8% |
|---|
| Cost | 785.00 |
|---|
\[\begin{array}{l}
\mathbf{if}\;d2 \leq -4.1 \cdot 10^{-33}:\\
\;\;\;\;d1 \cdot d2\\
\mathbf{elif}\;d2 \leq -1.7 \cdot 10^{-194} \lor \neg \left(d2 \leq -1.3 \cdot 10^{-294}\right) \land d2 \leq 7.8 \cdot 10^{-305}:\\
\;\;\;\;d1 \cdot \left(-d1\right)\\
\mathbf{else}:\\
\;\;\;\;d1 \cdot d4\\
\end{array}
\]
| Alternative 6 |
|---|
| Error | 55.1% |
|---|
| Cost | 784.00 |
|---|
\[\begin{array}{l}
t_0 := d1 \cdot \left(-d3\right)\\
\mathbf{if}\;d4 \leq -8.6 \cdot 10^{-181}:\\
\;\;\;\;d1 \cdot d2\\
\mathbf{elif}\;d4 \leq 2.9 \cdot 10^{-11}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;d4 \leq 3.1:\\
\;\;\;\;d1 \cdot \left(-d1\right)\\
\mathbf{elif}\;d4 \leq 1.45 \cdot 10^{+50}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;d1 \cdot d4\\
\end{array}
\]
| Alternative 7 |
|---|
| Error | 87.9% |
|---|
| Cost | 713.00 |
|---|
\[\begin{array}{l}
\mathbf{if}\;d3 \leq -4.6 \cdot 10^{+84} \lor \neg \left(d3 \leq 2.7 \cdot 10^{+97}\right):\\
\;\;\;\;d1 \cdot \left(d4 - d3\right)\\
\mathbf{else}:\\
\;\;\;\;d1 \cdot \left(\left(d2 + d4\right) - d1\right)\\
\end{array}
\]
| Alternative 8 |
|---|
| Error | 94.4% |
|---|
| Cost | 713.00 |
|---|
\[\begin{array}{l}
\mathbf{if}\;d3 \leq -5.2 \cdot 10^{+83} \lor \neg \left(d3 \leq 6.6 \cdot 10^{-91}\right):\\
\;\;\;\;d1 \cdot \left(\left(d2 + d4\right) - d3\right)\\
\mathbf{else}:\\
\;\;\;\;d1 \cdot \left(\left(d2 + d4\right) - d1\right)\\
\end{array}
\]
| Alternative 9 |
|---|
| Error | 72.3% |
|---|
| Cost | 585.00 |
|---|
\[\begin{array}{l}
\mathbf{if}\;d3 \leq -5.5 \cdot 10^{+88} \lor \neg \left(d3 \leq 4 \cdot 10^{+123}\right):\\
\;\;\;\;d1 \cdot \left(-d3\right)\\
\mathbf{else}:\\
\;\;\;\;d1 \cdot \left(d2 + d4\right)\\
\end{array}
\]
| Alternative 10 |
|---|
| Error | 95.2% |
|---|
| Cost | 580.00 |
|---|
\[\begin{array}{l}
\mathbf{if}\;d4 \leq 3.3 \cdot 10^{+52}:\\
\;\;\;\;d1 \cdot \left(d2 - \left(d1 + d3\right)\right)\\
\mathbf{else}:\\
\;\;\;\;d1 \cdot \left(\left(d2 + d4\right) - d3\right)\\
\end{array}
\]
| Alternative 11 |
|---|
| Error | 100.0% |
|---|
| Cost | 576.00 |
|---|
\[d1 \cdot \left(\left(d2 - d3\right) + \left(d4 - d1\right)\right)
\]
| Alternative 12 |
|---|
| Error | 51.5% |
|---|
| Cost | 324.00 |
|---|
\[\begin{array}{l}
\mathbf{if}\;d4 \leq 1.75 \cdot 10^{+53}:\\
\;\;\;\;d1 \cdot d2\\
\mathbf{else}:\\
\;\;\;\;d1 \cdot d4\\
\end{array}
\]
| Alternative 13 |
|---|
| Error | 31.4% |
|---|
| Cost | 192.00 |
|---|
\[d1 \cdot d4
\]