\[\left(\left(d1 \cdot d2 - d1 \cdot d3\right) + d4 \cdot d1\right) - d1 \cdot d1
\]
↓
\[d1 \cdot \left(\left(d2 - d3\right) + \left(d4 - d1\right)\right)
\]
(FPCore (d1 d2 d3 d4)
:precision binary64
(- (+ (- (* d1 d2) (* d1 d3)) (* d4 d1)) (* d1 d1)))
↓
(FPCore (d1 d2 d3 d4) :precision binary64 (* d1 (+ (- d2 d3) (- d4 d1))))
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 * ((d2 - d3) + (d4 - d1));
}
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 * ((d2 - d3) + (d4 - d1))
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 * ((d2 - d3) + (d4 - d1));
}
def code(d1, d2, d3, d4):
return (((d1 * d2) - (d1 * d3)) + (d4 * d1)) - (d1 * d1)
↓
def code(d1, d2, d3, d4):
return d1 * ((d2 - d3) + (d4 - d1))
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(d1 * Float64(Float64(d2 - d3) + Float64(d4 - d1)))
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 * ((d2 - d3) + (d4 - d1));
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[(d1 * N[(N[(d2 - d3), $MachinePrecision] + N[(d4 - d1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\left(\left(d1 \cdot d2 - d1 \cdot d3\right) + d4 \cdot d1\right) - d1 \cdot d1
↓
d1 \cdot \left(\left(d2 - d3\right) + \left(d4 - d1\right)\right)
Alternatives
| Alternative 1 |
|---|
| Error | 32.8 |
|---|
| Cost | 1180 |
|---|
\[\begin{array}{l}
t_0 := d3 \cdot \left(-d1\right)\\
\mathbf{if}\;d3 \leq -6.2 \cdot 10^{+81}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;d3 \leq -5.6 \cdot 10^{-159}:\\
\;\;\;\;d2 \cdot d1\\
\mathbf{elif}\;d3 \leq 7.2 \cdot 10^{-287}:\\
\;\;\;\;d1 \cdot d4\\
\mathbf{elif}\;d3 \leq 3.1 \cdot 10^{-251}:\\
\;\;\;\;d2 \cdot d1\\
\mathbf{elif}\;d3 \leq 1.1 \cdot 10^{-195}:\\
\;\;\;\;d1 \cdot d4\\
\mathbf{elif}\;d3 \leq 5.2 \cdot 10^{+93}:\\
\;\;\;\;d2 \cdot d1\\
\mathbf{elif}\;d3 \leq 4.4 \cdot 10^{+125}:\\
\;\;\;\;d1 \cdot d4\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\]
| Alternative 2 |
|---|
| Error | 19.2 |
|---|
| Cost | 1112 |
|---|
\[\begin{array}{l}
t_0 := d1 \cdot \left(d4 - d1\right)\\
t_1 := d3 \cdot \left(-d1\right)\\
t_2 := d1 \cdot \left(d4 + d2\right)\\
\mathbf{if}\;d3 \leq -2.1 \cdot 10^{+84}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;d3 \leq -6.5 \cdot 10^{-38}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;d3 \leq -1.9 \cdot 10^{-106}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;d3 \leq 6.4 \cdot 10^{-251}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;d3 \leq 1.02 \cdot 10^{-176}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;d3 \leq 1.25 \cdot 10^{+126}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\]
| Alternative 3 |
|---|
| Error | 16.6 |
|---|
| Cost | 1112 |
|---|
\[\begin{array}{l}
t_0 := d1 \cdot \left(d4 - d1\right)\\
t_1 := \left(d4 - d3\right) \cdot d1\\
t_2 := d1 \cdot \left(d4 + d2\right)\\
\mathbf{if}\;d3 \leq -5 \cdot 10^{+81}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;d3 \leq -2.6 \cdot 10^{-55}:\\
\;\;\;\;\left(d2 - d3\right) \cdot d1\\
\mathbf{elif}\;d3 \leq -2 \cdot 10^{-106}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;d3 \leq 6.6 \cdot 10^{-251}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;d3 \leq 2.8 \cdot 10^{-174}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;d3 \leq 3.4 \cdot 10^{+72}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\]
| Alternative 4 |
|---|
| Error | 17.0 |
|---|
| Cost | 980 |
|---|
\[\begin{array}{l}
t_0 := d1 \cdot \left(d4 + d2\right)\\
t_1 := \left(d2 - d3\right) \cdot d1\\
t_2 := d1 \cdot \left(d4 - d1\right)\\
\mathbf{if}\;d3 \leq -2.1 \cdot 10^{-45}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;d3 \leq -1.55 \cdot 10^{-106}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;d3 \leq 6.5 \cdot 10^{-251}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;d3 \leq 1.9 \cdot 10^{-177}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;d3 \leq 4.5 \cdot 10^{+125}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\]
| Alternative 5 |
|---|
| Error | 7.2 |
|---|
| Cost | 712 |
|---|
\[\begin{array}{l}
\mathbf{if}\;d3 \leq -8.2 \cdot 10^{+82}:\\
\;\;\;\;\left(d4 - d3\right) \cdot d1\\
\mathbf{elif}\;d3 \leq 3.6 \cdot 10^{+66}:\\
\;\;\;\;d1 \cdot \left(\left(d2 + d4\right) - d1\right)\\
\mathbf{else}:\\
\;\;\;\;d1 \cdot \left(d4 - \left(d1 + d3\right)\right)\\
\end{array}
\]
| Alternative 6 |
|---|
| Error | 17.9 |
|---|
| Cost | 584 |
|---|
\[\begin{array}{l}
t_0 := d3 \cdot \left(-d1\right)\\
\mathbf{if}\;d3 \leq -2 \cdot 10^{+84}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;d3 \leq 8.2 \cdot 10^{+125}:\\
\;\;\;\;d1 \cdot \left(d4 + d2\right)\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\]
| Alternative 7 |
|---|
| Error | 12.6 |
|---|
| Cost | 580 |
|---|
\[\begin{array}{l}
\mathbf{if}\;d2 \leq -4.5 \cdot 10^{+58}:\\
\;\;\;\;\left(d2 - d3\right) \cdot d1\\
\mathbf{else}:\\
\;\;\;\;d1 \cdot \left(d4 - \left(d1 + d3\right)\right)\\
\end{array}
\]
| Alternative 8 |
|---|
| Error | 38.5 |
|---|
| Cost | 324 |
|---|
\[\begin{array}{l}
\mathbf{if}\;d2 \leq -8.5 \cdot 10^{+17}:\\
\;\;\;\;d2 \cdot d1\\
\mathbf{else}:\\
\;\;\;\;d1 \cdot d4\\
\end{array}
\]
| Alternative 9 |
|---|
| Error | 43.4 |
|---|
| Cost | 192 |
|---|
\[d1 \cdot d4
\]