
(FPCore (d1 d2 d3 d4) :precision binary64 (- (+ (- (* d1 d2) (* d1 d3)) (* d4 d1)) (* d1 d1)))
double code(double d1, double d2, double d3, double d4) {
return (((d1 * d2) - (d1 * d3)) + (d4 * d1)) - (d1 * 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
public static double code(double d1, double d2, double d3, double d4) {
return (((d1 * d2) - (d1 * d3)) + (d4 * d1)) - (d1 * d1);
}
def code(d1, d2, d3, d4): return (((d1 * d2) - (d1 * d3)) + (d4 * d1)) - (d1 * 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 tmp = code(d1, d2, d3, d4) tmp = (((d1 * d2) - (d1 * d3)) + (d4 * d1)) - (d1 * 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]
\begin{array}{l}
\\
\left(\left(d1 \cdot d2 - d1 \cdot d3\right) + d4 \cdot d1\right) - d1 \cdot d1
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 13 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (d1 d2 d3 d4) :precision binary64 (- (+ (- (* d1 d2) (* d1 d3)) (* d4 d1)) (* d1 d1)))
double code(double d1, double d2, double d3, double d4) {
return (((d1 * d2) - (d1 * d3)) + (d4 * d1)) - (d1 * 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
public static double code(double d1, double d2, double d3, double d4) {
return (((d1 * d2) - (d1 * d3)) + (d4 * d1)) - (d1 * d1);
}
def code(d1, d2, d3, d4): return (((d1 * d2) - (d1 * d3)) + (d4 * d1)) - (d1 * 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 tmp = code(d1, d2, d3, d4) tmp = (((d1 * d2) - (d1 * d3)) + (d4 * d1)) - (d1 * 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]
\begin{array}{l}
\\
\left(\left(d1 \cdot d2 - d1 \cdot d3\right) + d4 \cdot d1\right) - d1 \cdot d1
\end{array}
(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 - 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 - d3) + (d4 - d1))
end function
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 - d3) + (d4 - d1))
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 - d3) + (d4 - d1)); end
code[d1_, d2_, d3_, d4_] := N[(d1 * N[(N[(d2 - d3), $MachinePrecision] + N[(d4 - d1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
d1 \cdot \left(\left(d2 - d3\right) + \left(d4 - d1\right)\right)
\end{array}
Initial program 90.2%
associate--l+90.2%
distribute-lft-out--91.0%
distribute-rgt-out--93.7%
distribute-lft-out100.0%
Simplified100.0%
Final simplification100.0%
(FPCore (d1 d2 d3 d4)
:precision binary64
(let* ((t_0 (* d1 (- d2 d1))) (t_1 (* d1 (- d2 d3))))
(if (<= d4 1.95e-149)
t_1
(if (<= d4 2.75e-52)
t_0
(if (<= d4 24.0) t_1 (if (<= d4 1.95e+114) t_0 (* d1 (+ d2 d4))))))))
double code(double d1, double d2, double d3, double d4) {
double t_0 = d1 * (d2 - d1);
double t_1 = d1 * (d2 - d3);
double tmp;
if (d4 <= 1.95e-149) {
tmp = t_1;
} else if (d4 <= 2.75e-52) {
tmp = t_0;
} else if (d4 <= 24.0) {
tmp = t_1;
} else if (d4 <= 1.95e+114) {
tmp = t_0;
} else {
tmp = d1 * (d2 + d4);
}
return tmp;
}
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
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = d1 * (d2 - d1)
t_1 = d1 * (d2 - d3)
if (d4 <= 1.95d-149) then
tmp = t_1
else if (d4 <= 2.75d-52) then
tmp = t_0
else if (d4 <= 24.0d0) then
tmp = t_1
else if (d4 <= 1.95d+114) then
tmp = t_0
else
tmp = d1 * (d2 + d4)
end if
code = tmp
end function
public static double code(double d1, double d2, double d3, double d4) {
double t_0 = d1 * (d2 - d1);
double t_1 = d1 * (d2 - d3);
double tmp;
if (d4 <= 1.95e-149) {
tmp = t_1;
} else if (d4 <= 2.75e-52) {
tmp = t_0;
} else if (d4 <= 24.0) {
tmp = t_1;
} else if (d4 <= 1.95e+114) {
tmp = t_0;
} else {
tmp = d1 * (d2 + d4);
}
return tmp;
}
def code(d1, d2, d3, d4): t_0 = d1 * (d2 - d1) t_1 = d1 * (d2 - d3) tmp = 0 if d4 <= 1.95e-149: tmp = t_1 elif d4 <= 2.75e-52: tmp = t_0 elif d4 <= 24.0: tmp = t_1 elif d4 <= 1.95e+114: tmp = t_0 else: tmp = d1 * (d2 + d4) return tmp
function code(d1, d2, d3, d4) t_0 = Float64(d1 * Float64(d2 - d1)) t_1 = Float64(d1 * Float64(d2 - d3)) tmp = 0.0 if (d4 <= 1.95e-149) tmp = t_1; elseif (d4 <= 2.75e-52) tmp = t_0; elseif (d4 <= 24.0) tmp = t_1; elseif (d4 <= 1.95e+114) tmp = t_0; else tmp = Float64(d1 * Float64(d2 + d4)); end return tmp end
function tmp_2 = code(d1, d2, d3, d4) t_0 = d1 * (d2 - d1); t_1 = d1 * (d2 - d3); tmp = 0.0; if (d4 <= 1.95e-149) tmp = t_1; elseif (d4 <= 2.75e-52) tmp = t_0; elseif (d4 <= 24.0) tmp = t_1; elseif (d4 <= 1.95e+114) tmp = t_0; else tmp = d1 * (d2 + d4); end tmp_2 = tmp; end
code[d1_, d2_, d3_, d4_] := Block[{t$95$0 = N[(d1 * N[(d2 - d1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(d1 * N[(d2 - d3), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[d4, 1.95e-149], t$95$1, If[LessEqual[d4, 2.75e-52], t$95$0, If[LessEqual[d4, 24.0], t$95$1, If[LessEqual[d4, 1.95e+114], t$95$0, N[(d1 * N[(d2 + d4), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := d1 \cdot \left(d2 - d1\right)\\
t_1 := d1 \cdot \left(d2 - d3\right)\\
\mathbf{if}\;d4 \leq 1.95 \cdot 10^{-149}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;d4 \leq 2.75 \cdot 10^{-52}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;d4 \leq 24:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;d4 \leq 1.95 \cdot 10^{+114}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;d1 \cdot \left(d2 + d4\right)\\
\end{array}
\end{array}
if d4 < 1.9500000000000001e-149 or 2.75e-52 < d4 < 24Initial program 90.1%
associate--l+90.1%
distribute-lft-out--91.2%
distribute-rgt-out--93.0%
distribute-lft-out100.0%
Simplified100.0%
Taylor expanded in d4 around 0 80.2%
+-commutative80.2%
associate--r+80.2%
Simplified80.2%
Taylor expanded in d1 around 0 59.6%
if 1.9500000000000001e-149 < d4 < 2.75e-52 or 24 < d4 < 1.95e114Initial program 92.3%
associate--l+92.3%
distribute-lft-out--92.3%
distribute-rgt-out--97.4%
distribute-lft-out100.0%
Simplified100.0%
Taylor expanded in d4 around 0 92.9%
+-commutative92.9%
associate--r+92.9%
Simplified92.9%
Taylor expanded in d3 around 0 77.9%
if 1.95e114 < d4 Initial program 88.9%
associate-+l-88.9%
*-commutative88.9%
fma-neg93.3%
*-commutative93.3%
distribute-lft-out--93.3%
Applied egg-rr93.3%
Taylor expanded in d1 around 0 97.7%
Taylor expanded in d3 around 0 83.3%
+-commutative83.3%
Simplified83.3%
Final simplification66.5%
(FPCore (d1 d2 d3 d4)
:precision binary64
(let* ((t_0 (* d1 (- d1))))
(if (<= d4 2.9e-137)
(* d1 d2)
(if (<= d4 1e-26)
t_0
(if (<= d4 180.0) (* d1 d2) (if (<= d4 4.5e+113) t_0 (* d1 d4)))))))
double code(double d1, double d2, double d3, double d4) {
double t_0 = d1 * -d1;
double tmp;
if (d4 <= 2.9e-137) {
tmp = d1 * d2;
} else if (d4 <= 1e-26) {
tmp = t_0;
} else if (d4 <= 180.0) {
tmp = d1 * d2;
} else if (d4 <= 4.5e+113) {
tmp = t_0;
} else {
tmp = d1 * d4;
}
return tmp;
}
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
real(8) :: t_0
real(8) :: tmp
t_0 = d1 * -d1
if (d4 <= 2.9d-137) then
tmp = d1 * d2
else if (d4 <= 1d-26) then
tmp = t_0
else if (d4 <= 180.0d0) then
tmp = d1 * d2
else if (d4 <= 4.5d+113) then
tmp = t_0
else
tmp = d1 * d4
end if
code = tmp
end function
public static double code(double d1, double d2, double d3, double d4) {
double t_0 = d1 * -d1;
double tmp;
if (d4 <= 2.9e-137) {
tmp = d1 * d2;
} else if (d4 <= 1e-26) {
tmp = t_0;
} else if (d4 <= 180.0) {
tmp = d1 * d2;
} else if (d4 <= 4.5e+113) {
tmp = t_0;
} else {
tmp = d1 * d4;
}
return tmp;
}
def code(d1, d2, d3, d4): t_0 = d1 * -d1 tmp = 0 if d4 <= 2.9e-137: tmp = d1 * d2 elif d4 <= 1e-26: tmp = t_0 elif d4 <= 180.0: tmp = d1 * d2 elif d4 <= 4.5e+113: tmp = t_0 else: tmp = d1 * d4 return tmp
function code(d1, d2, d3, d4) t_0 = Float64(d1 * Float64(-d1)) tmp = 0.0 if (d4 <= 2.9e-137) tmp = Float64(d1 * d2); elseif (d4 <= 1e-26) tmp = t_0; elseif (d4 <= 180.0) tmp = Float64(d1 * d2); elseif (d4 <= 4.5e+113) tmp = t_0; else tmp = Float64(d1 * d4); end return tmp end
function tmp_2 = code(d1, d2, d3, d4) t_0 = d1 * -d1; tmp = 0.0; if (d4 <= 2.9e-137) tmp = d1 * d2; elseif (d4 <= 1e-26) tmp = t_0; elseif (d4 <= 180.0) tmp = d1 * d2; elseif (d4 <= 4.5e+113) tmp = t_0; else tmp = d1 * d4; end tmp_2 = tmp; end
code[d1_, d2_, d3_, d4_] := Block[{t$95$0 = N[(d1 * (-d1)), $MachinePrecision]}, If[LessEqual[d4, 2.9e-137], N[(d1 * d2), $MachinePrecision], If[LessEqual[d4, 1e-26], t$95$0, If[LessEqual[d4, 180.0], N[(d1 * d2), $MachinePrecision], If[LessEqual[d4, 4.5e+113], t$95$0, N[(d1 * d4), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := d1 \cdot \left(-d1\right)\\
\mathbf{if}\;d4 \leq 2.9 \cdot 10^{-137}:\\
\;\;\;\;d1 \cdot d2\\
\mathbf{elif}\;d4 \leq 10^{-26}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;d4 \leq 180:\\
\;\;\;\;d1 \cdot d2\\
\mathbf{elif}\;d4 \leq 4.5 \cdot 10^{+113}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;d1 \cdot d4\\
\end{array}
\end{array}
if d4 < 2.89999999999999985e-137 or 1e-26 < d4 < 180Initial program 90.4%
associate--l+90.4%
distribute-lft-out--91.6%
distribute-rgt-out--93.4%
distribute-lft-out100.0%
Simplified100.0%
Taylor expanded in d2 around inf 35.7%
if 2.89999999999999985e-137 < d4 < 1e-26 or 180 < d4 < 4.5000000000000001e113Initial program 90.7%
associate--l+90.7%
distribute-lft-out--90.7%
distribute-rgt-out--95.3%
distribute-lft-out100.0%
Simplified100.0%
Taylor expanded in d4 around 0 93.6%
+-commutative93.6%
associate--r+93.6%
Simplified93.6%
Taylor expanded in d1 around inf 53.0%
neg-mul-153.0%
Simplified53.0%
if 4.5000000000000001e113 < d4 Initial program 88.9%
associate--l+88.9%
distribute-lft-out--88.9%
distribute-rgt-out--93.3%
distribute-lft-out100.0%
Simplified100.0%
Taylor expanded in d4 around inf 71.8%
Final simplification45.0%
(FPCore (d1 d2 d3 d4)
:precision binary64
(let* ((t_0 (* d1 (- d1))))
(if (<= d4 1.95e-138)
(* d1 d2)
(if (<= d4 2.65e-51)
t_0
(if (<= d4 124.0) (* d1 (- d3)) (if (<= d4 1.3e+112) t_0 (* d1 d4)))))))
double code(double d1, double d2, double d3, double d4) {
double t_0 = d1 * -d1;
double tmp;
if (d4 <= 1.95e-138) {
tmp = d1 * d2;
} else if (d4 <= 2.65e-51) {
tmp = t_0;
} else if (d4 <= 124.0) {
tmp = d1 * -d3;
} else if (d4 <= 1.3e+112) {
tmp = t_0;
} else {
tmp = d1 * d4;
}
return tmp;
}
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
real(8) :: t_0
real(8) :: tmp
t_0 = d1 * -d1
if (d4 <= 1.95d-138) then
tmp = d1 * d2
else if (d4 <= 2.65d-51) then
tmp = t_0
else if (d4 <= 124.0d0) then
tmp = d1 * -d3
else if (d4 <= 1.3d+112) then
tmp = t_0
else
tmp = d1 * d4
end if
code = tmp
end function
public static double code(double d1, double d2, double d3, double d4) {
double t_0 = d1 * -d1;
double tmp;
if (d4 <= 1.95e-138) {
tmp = d1 * d2;
} else if (d4 <= 2.65e-51) {
tmp = t_0;
} else if (d4 <= 124.0) {
tmp = d1 * -d3;
} else if (d4 <= 1.3e+112) {
tmp = t_0;
} else {
tmp = d1 * d4;
}
return tmp;
}
def code(d1, d2, d3, d4): t_0 = d1 * -d1 tmp = 0 if d4 <= 1.95e-138: tmp = d1 * d2 elif d4 <= 2.65e-51: tmp = t_0 elif d4 <= 124.0: tmp = d1 * -d3 elif d4 <= 1.3e+112: tmp = t_0 else: tmp = d1 * d4 return tmp
function code(d1, d2, d3, d4) t_0 = Float64(d1 * Float64(-d1)) tmp = 0.0 if (d4 <= 1.95e-138) tmp = Float64(d1 * d2); elseif (d4 <= 2.65e-51) tmp = t_0; elseif (d4 <= 124.0) tmp = Float64(d1 * Float64(-d3)); elseif (d4 <= 1.3e+112) tmp = t_0; else tmp = Float64(d1 * d4); end return tmp end
function tmp_2 = code(d1, d2, d3, d4) t_0 = d1 * -d1; tmp = 0.0; if (d4 <= 1.95e-138) tmp = d1 * d2; elseif (d4 <= 2.65e-51) tmp = t_0; elseif (d4 <= 124.0) tmp = d1 * -d3; elseif (d4 <= 1.3e+112) tmp = t_0; else tmp = d1 * d4; end tmp_2 = tmp; end
code[d1_, d2_, d3_, d4_] := Block[{t$95$0 = N[(d1 * (-d1)), $MachinePrecision]}, If[LessEqual[d4, 1.95e-138], N[(d1 * d2), $MachinePrecision], If[LessEqual[d4, 2.65e-51], t$95$0, If[LessEqual[d4, 124.0], N[(d1 * (-d3)), $MachinePrecision], If[LessEqual[d4, 1.3e+112], t$95$0, N[(d1 * d4), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := d1 \cdot \left(-d1\right)\\
\mathbf{if}\;d4 \leq 1.95 \cdot 10^{-138}:\\
\;\;\;\;d1 \cdot d2\\
\mathbf{elif}\;d4 \leq 2.65 \cdot 10^{-51}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;d4 \leq 124:\\
\;\;\;\;d1 \cdot \left(-d3\right)\\
\mathbf{elif}\;d4 \leq 1.3 \cdot 10^{+112}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;d1 \cdot d4\\
\end{array}
\end{array}
if d4 < 1.95e-138Initial program 90.1%
associate--l+90.1%
distribute-lft-out--91.4%
distribute-rgt-out--93.2%
distribute-lft-out100.0%
Simplified100.0%
Taylor expanded in d2 around inf 35.0%
if 1.95e-138 < d4 < 2.64999999999999987e-51 or 124 < d4 < 1.3e112Initial program 91.9%
associate--l+91.9%
distribute-lft-out--91.9%
distribute-rgt-out--97.3%
distribute-lft-out100.0%
Simplified100.0%
Taylor expanded in d4 around 0 92.5%
+-commutative92.5%
associate--r+92.5%
Simplified92.5%
Taylor expanded in d1 around inf 55.8%
neg-mul-155.8%
Simplified55.8%
if 2.64999999999999987e-51 < d4 < 124Initial program 90.9%
associate--l+90.9%
distribute-lft-out--90.9%
distribute-rgt-out--90.9%
distribute-lft-out100.0%
Simplified100.0%
Taylor expanded in d3 around inf 47.2%
mul-1-neg47.2%
distribute-rgt-neg-out47.2%
Simplified47.2%
if 1.3e112 < d4 Initial program 88.9%
associate--l+88.9%
distribute-lft-out--88.9%
distribute-rgt-out--93.3%
distribute-lft-out100.0%
Simplified100.0%
Taylor expanded in d4 around inf 71.8%
Final simplification45.0%
(FPCore (d1 d2 d3 d4) :precision binary64 (if (or (<= d3 -1.65e+91) (not (<= d3 3.8e+94))) (* d1 (- d2 d3)) (* d1 (- (+ d2 d4) d1))))
double code(double d1, double d2, double d3, double d4) {
double tmp;
if ((d3 <= -1.65e+91) || !(d3 <= 3.8e+94)) {
tmp = d1 * (d2 - d3);
} else {
tmp = d1 * ((d2 + d4) - d1);
}
return tmp;
}
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
real(8) :: tmp
if ((d3 <= (-1.65d+91)) .or. (.not. (d3 <= 3.8d+94))) then
tmp = d1 * (d2 - d3)
else
tmp = d1 * ((d2 + d4) - d1)
end if
code = tmp
end function
public static double code(double d1, double d2, double d3, double d4) {
double tmp;
if ((d3 <= -1.65e+91) || !(d3 <= 3.8e+94)) {
tmp = d1 * (d2 - d3);
} else {
tmp = d1 * ((d2 + d4) - d1);
}
return tmp;
}
def code(d1, d2, d3, d4): tmp = 0 if (d3 <= -1.65e+91) or not (d3 <= 3.8e+94): tmp = d1 * (d2 - d3) else: tmp = d1 * ((d2 + d4) - d1) return tmp
function code(d1, d2, d3, d4) tmp = 0.0 if ((d3 <= -1.65e+91) || !(d3 <= 3.8e+94)) tmp = Float64(d1 * Float64(d2 - d3)); else tmp = Float64(d1 * Float64(Float64(d2 + d4) - d1)); end return tmp end
function tmp_2 = code(d1, d2, d3, d4) tmp = 0.0; if ((d3 <= -1.65e+91) || ~((d3 <= 3.8e+94))) tmp = d1 * (d2 - d3); else tmp = d1 * ((d2 + d4) - d1); end tmp_2 = tmp; end
code[d1_, d2_, d3_, d4_] := If[Or[LessEqual[d3, -1.65e+91], N[Not[LessEqual[d3, 3.8e+94]], $MachinePrecision]], N[(d1 * N[(d2 - d3), $MachinePrecision]), $MachinePrecision], N[(d1 * N[(N[(d2 + d4), $MachinePrecision] - d1), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;d3 \leq -1.65 \cdot 10^{+91} \lor \neg \left(d3 \leq 3.8 \cdot 10^{+94}\right):\\
\;\;\;\;d1 \cdot \left(d2 - d3\right)\\
\mathbf{else}:\\
\;\;\;\;d1 \cdot \left(\left(d2 + d4\right) - d1\right)\\
\end{array}
\end{array}
if d3 < -1.65000000000000009e91 or 3.7999999999999996e94 < d3 Initial program 83.6%
associate--l+83.6%
distribute-lft-out--85.8%
distribute-rgt-out--89.1%
distribute-lft-out99.9%
Simplified99.9%
Taylor expanded in d4 around 0 83.2%
+-commutative83.2%
associate--r+83.2%
Simplified83.2%
Taylor expanded in d1 around 0 78.9%
if -1.65000000000000009e91 < d3 < 3.7999999999999996e94Initial program 93.9%
associate--l+93.9%
distribute-lft-out--93.9%
distribute-rgt-out--96.3%
distribute-lft-out100.0%
Simplified100.0%
Taylor expanded in d3 around 0 95.1%
Final simplification89.2%
(FPCore (d1 d2 d3 d4) :precision binary64 (if (or (<= d3 -5.5e+74) (not (<= d3 2.8e+32))) (* d1 (- (+ d2 d4) d3)) (* d1 (- (+ d2 d4) d1))))
double code(double d1, double d2, double d3, double d4) {
double tmp;
if ((d3 <= -5.5e+74) || !(d3 <= 2.8e+32)) {
tmp = d1 * ((d2 + d4) - d3);
} else {
tmp = d1 * ((d2 + d4) - d1);
}
return tmp;
}
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
real(8) :: tmp
if ((d3 <= (-5.5d+74)) .or. (.not. (d3 <= 2.8d+32))) then
tmp = d1 * ((d2 + d4) - d3)
else
tmp = d1 * ((d2 + d4) - d1)
end if
code = tmp
end function
public static double code(double d1, double d2, double d3, double d4) {
double tmp;
if ((d3 <= -5.5e+74) || !(d3 <= 2.8e+32)) {
tmp = d1 * ((d2 + d4) - d3);
} else {
tmp = d1 * ((d2 + d4) - d1);
}
return tmp;
}
def code(d1, d2, d3, d4): tmp = 0 if (d3 <= -5.5e+74) or not (d3 <= 2.8e+32): tmp = d1 * ((d2 + d4) - d3) else: tmp = d1 * ((d2 + d4) - d1) return tmp
function code(d1, d2, d3, d4) tmp = 0.0 if ((d3 <= -5.5e+74) || !(d3 <= 2.8e+32)) tmp = Float64(d1 * Float64(Float64(d2 + d4) - d3)); else tmp = Float64(d1 * Float64(Float64(d2 + d4) - d1)); end return tmp end
function tmp_2 = code(d1, d2, d3, d4) tmp = 0.0; if ((d3 <= -5.5e+74) || ~((d3 <= 2.8e+32))) tmp = d1 * ((d2 + d4) - d3); else tmp = d1 * ((d2 + d4) - d1); end tmp_2 = tmp; end
code[d1_, d2_, d3_, d4_] := If[Or[LessEqual[d3, -5.5e+74], N[Not[LessEqual[d3, 2.8e+32]], $MachinePrecision]], N[(d1 * N[(N[(d2 + d4), $MachinePrecision] - d3), $MachinePrecision]), $MachinePrecision], N[(d1 * N[(N[(d2 + d4), $MachinePrecision] - d1), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;d3 \leq -5.5 \cdot 10^{+74} \lor \neg \left(d3 \leq 2.8 \cdot 10^{+32}\right):\\
\;\;\;\;d1 \cdot \left(\left(d2 + d4\right) - d3\right)\\
\mathbf{else}:\\
\;\;\;\;d1 \cdot \left(\left(d2 + d4\right) - d1\right)\\
\end{array}
\end{array}
if d3 < -5.5000000000000003e74 or 2.8e32 < d3 Initial program 83.3%
associate-+l-83.3%
*-commutative83.3%
fma-neg85.1%
*-commutative85.1%
distribute-lft-out--88.6%
Applied egg-rr88.6%
Taylor expanded in d1 around 0 92.1%
if -5.5000000000000003e74 < d3 < 2.8e32Initial program 95.8%
associate--l+95.8%
distribute-lft-out--95.8%
distribute-rgt-out--98.6%
distribute-lft-out100.0%
Simplified100.0%
Taylor expanded in d3 around 0 98.7%
Final simplification95.8%
(FPCore (d1 d2 d3 d4) :precision binary64 (if (or (<= d3 -5.8e+192) (not (<= d3 2.1e+87))) (* d1 (- d3)) (* d1 (+ d2 d4))))
double code(double d1, double d2, double d3, double d4) {
double tmp;
if ((d3 <= -5.8e+192) || !(d3 <= 2.1e+87)) {
tmp = d1 * -d3;
} else {
tmp = d1 * (d2 + d4);
}
return tmp;
}
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
real(8) :: tmp
if ((d3 <= (-5.8d+192)) .or. (.not. (d3 <= 2.1d+87))) then
tmp = d1 * -d3
else
tmp = d1 * (d2 + d4)
end if
code = tmp
end function
public static double code(double d1, double d2, double d3, double d4) {
double tmp;
if ((d3 <= -5.8e+192) || !(d3 <= 2.1e+87)) {
tmp = d1 * -d3;
} else {
tmp = d1 * (d2 + d4);
}
return tmp;
}
def code(d1, d2, d3, d4): tmp = 0 if (d3 <= -5.8e+192) or not (d3 <= 2.1e+87): tmp = d1 * -d3 else: tmp = d1 * (d2 + d4) return tmp
function code(d1, d2, d3, d4) tmp = 0.0 if ((d3 <= -5.8e+192) || !(d3 <= 2.1e+87)) tmp = Float64(d1 * Float64(-d3)); else tmp = Float64(d1 * Float64(d2 + d4)); end return tmp end
function tmp_2 = code(d1, d2, d3, d4) tmp = 0.0; if ((d3 <= -5.8e+192) || ~((d3 <= 2.1e+87))) tmp = d1 * -d3; else tmp = d1 * (d2 + d4); end tmp_2 = tmp; end
code[d1_, d2_, d3_, d4_] := If[Or[LessEqual[d3, -5.8e+192], N[Not[LessEqual[d3, 2.1e+87]], $MachinePrecision]], N[(d1 * (-d3)), $MachinePrecision], N[(d1 * N[(d2 + d4), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;d3 \leq -5.8 \cdot 10^{+192} \lor \neg \left(d3 \leq 2.1 \cdot 10^{+87}\right):\\
\;\;\;\;d1 \cdot \left(-d3\right)\\
\mathbf{else}:\\
\;\;\;\;d1 \cdot \left(d2 + d4\right)\\
\end{array}
\end{array}
if d3 < -5.8000000000000003e192 or 2.1e87 < d3 Initial program 81.3%
associate--l+81.3%
distribute-lft-out--84.0%
distribute-rgt-out--88.0%
distribute-lft-out99.9%
Simplified99.9%
Taylor expanded in d3 around inf 72.2%
mul-1-neg72.2%
distribute-rgt-neg-out72.2%
Simplified72.2%
if -5.8000000000000003e192 < d3 < 2.1e87Initial program 93.9%
associate-+l-93.9%
*-commutative93.9%
fma-neg95.0%
*-commutative95.0%
distribute-lft-out--95.0%
Applied egg-rr95.0%
Taylor expanded in d1 around 0 77.9%
Taylor expanded in d3 around 0 70.7%
+-commutative70.7%
Simplified70.7%
Final simplification71.1%
(FPCore (d1 d2 d3 d4) :precision binary64 (if (<= d4 3e+71) (* d1 (- (- d2 d3) d1)) (* d1 (- (+ d2 d4) d3))))
double code(double d1, double d2, double d3, double d4) {
double tmp;
if (d4 <= 3e+71) {
tmp = d1 * ((d2 - d3) - d1);
} else {
tmp = d1 * ((d2 + d4) - d3);
}
return tmp;
}
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
real(8) :: tmp
if (d4 <= 3d+71) then
tmp = d1 * ((d2 - d3) - d1)
else
tmp = d1 * ((d2 + d4) - d3)
end if
code = tmp
end function
public static double code(double d1, double d2, double d3, double d4) {
double tmp;
if (d4 <= 3e+71) {
tmp = d1 * ((d2 - d3) - d1);
} else {
tmp = d1 * ((d2 + d4) - d3);
}
return tmp;
}
def code(d1, d2, d3, d4): tmp = 0 if d4 <= 3e+71: tmp = d1 * ((d2 - d3) - d1) else: tmp = d1 * ((d2 + d4) - d3) return tmp
function code(d1, d2, d3, d4) tmp = 0.0 if (d4 <= 3e+71) tmp = Float64(d1 * Float64(Float64(d2 - d3) - d1)); else tmp = Float64(d1 * Float64(Float64(d2 + d4) - d3)); end return tmp end
function tmp_2 = code(d1, d2, d3, d4) tmp = 0.0; if (d4 <= 3e+71) tmp = d1 * ((d2 - d3) - d1); else tmp = d1 * ((d2 + d4) - d3); end tmp_2 = tmp; end
code[d1_, d2_, d3_, d4_] := If[LessEqual[d4, 3e+71], N[(d1 * N[(N[(d2 - d3), $MachinePrecision] - d1), $MachinePrecision]), $MachinePrecision], N[(d1 * N[(N[(d2 + d4), $MachinePrecision] - d3), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;d4 \leq 3 \cdot 10^{+71}:\\
\;\;\;\;d1 \cdot \left(\left(d2 - d3\right) - d1\right)\\
\mathbf{else}:\\
\;\;\;\;d1 \cdot \left(\left(d2 + d4\right) - d3\right)\\
\end{array}
\end{array}
if d4 < 3.00000000000000013e71Initial program 91.3%
associate--l+91.3%
distribute-lft-out--92.2%
distribute-rgt-out--93.7%
distribute-lft-out100.0%
Simplified100.0%
Taylor expanded in d4 around 0 82.2%
+-commutative82.2%
associate--r+82.2%
Simplified82.2%
if 3.00000000000000013e71 < d4 Initial program 85.7%
associate-+l-85.7%
*-commutative85.7%
fma-neg89.8%
*-commutative89.8%
distribute-lft-out--93.9%
Applied egg-rr93.9%
Taylor expanded in d1 around 0 97.9%
Final simplification85.2%
(FPCore (d1 d2 d3 d4) :precision binary64 (if (<= d2 -4.4e+14) (* d1 (- (+ d2 d4) d3)) (* d1 (- (- d4 d3) d1))))
double code(double d1, double d2, double d3, double d4) {
double tmp;
if (d2 <= -4.4e+14) {
tmp = d1 * ((d2 + d4) - d3);
} else {
tmp = d1 * ((d4 - d3) - d1);
}
return tmp;
}
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
real(8) :: tmp
if (d2 <= (-4.4d+14)) then
tmp = d1 * ((d2 + d4) - d3)
else
tmp = d1 * ((d4 - d3) - d1)
end if
code = tmp
end function
public static double code(double d1, double d2, double d3, double d4) {
double tmp;
if (d2 <= -4.4e+14) {
tmp = d1 * ((d2 + d4) - d3);
} else {
tmp = d1 * ((d4 - d3) - d1);
}
return tmp;
}
def code(d1, d2, d3, d4): tmp = 0 if d2 <= -4.4e+14: tmp = d1 * ((d2 + d4) - d3) else: tmp = d1 * ((d4 - d3) - d1) return tmp
function code(d1, d2, d3, d4) tmp = 0.0 if (d2 <= -4.4e+14) tmp = Float64(d1 * Float64(Float64(d2 + d4) - d3)); else tmp = Float64(d1 * Float64(Float64(d4 - d3) - d1)); end return tmp end
function tmp_2 = code(d1, d2, d3, d4) tmp = 0.0; if (d2 <= -4.4e+14) tmp = d1 * ((d2 + d4) - d3); else tmp = d1 * ((d4 - d3) - d1); end tmp_2 = tmp; end
code[d1_, d2_, d3_, d4_] := If[LessEqual[d2, -4.4e+14], N[(d1 * N[(N[(d2 + d4), $MachinePrecision] - d3), $MachinePrecision]), $MachinePrecision], N[(d1 * N[(N[(d4 - d3), $MachinePrecision] - d1), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;d2 \leq -4.4 \cdot 10^{+14}:\\
\;\;\;\;d1 \cdot \left(\left(d2 + d4\right) - d3\right)\\
\mathbf{else}:\\
\;\;\;\;d1 \cdot \left(\left(d4 - d3\right) - d1\right)\\
\end{array}
\end{array}
if d2 < -4.4e14Initial program 88.3%
associate-+l-88.3%
*-commutative88.3%
fma-neg93.3%
*-commutative93.3%
distribute-lft-out--93.3%
Applied egg-rr93.3%
Taylor expanded in d1 around 0 95.0%
if -4.4e14 < d2 Initial program 90.8%
associate--l+90.8%
distribute-lft-out--91.3%
distribute-rgt-out--94.4%
distribute-lft-out100.0%
Simplified100.0%
Taylor expanded in d2 around 0 84.4%
+-commutative84.4%
associate--r+84.4%
Simplified84.4%
Final simplification86.9%
(FPCore (d1 d2 d3 d4) :precision binary64 (if (<= d4 5.8e+107) (* d1 (- d2 d1)) (* d1 (+ d2 d4))))
double code(double d1, double d2, double d3, double d4) {
double tmp;
if (d4 <= 5.8e+107) {
tmp = d1 * (d2 - d1);
} else {
tmp = d1 * (d2 + d4);
}
return tmp;
}
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
real(8) :: tmp
if (d4 <= 5.8d+107) then
tmp = d1 * (d2 - d1)
else
tmp = d1 * (d2 + d4)
end if
code = tmp
end function
public static double code(double d1, double d2, double d3, double d4) {
double tmp;
if (d4 <= 5.8e+107) {
tmp = d1 * (d2 - d1);
} else {
tmp = d1 * (d2 + d4);
}
return tmp;
}
def code(d1, d2, d3, d4): tmp = 0 if d4 <= 5.8e+107: tmp = d1 * (d2 - d1) else: tmp = d1 * (d2 + d4) return tmp
function code(d1, d2, d3, d4) tmp = 0.0 if (d4 <= 5.8e+107) tmp = Float64(d1 * Float64(d2 - d1)); else tmp = Float64(d1 * Float64(d2 + d4)); end return tmp end
function tmp_2 = code(d1, d2, d3, d4) tmp = 0.0; if (d4 <= 5.8e+107) tmp = d1 * (d2 - d1); else tmp = d1 * (d2 + d4); end tmp_2 = tmp; end
code[d1_, d2_, d3_, d4_] := If[LessEqual[d4, 5.8e+107], N[(d1 * N[(d2 - d1), $MachinePrecision]), $MachinePrecision], N[(d1 * N[(d2 + d4), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;d4 \leq 5.8 \cdot 10^{+107}:\\
\;\;\;\;d1 \cdot \left(d2 - d1\right)\\
\mathbf{else}:\\
\;\;\;\;d1 \cdot \left(d2 + d4\right)\\
\end{array}
\end{array}
if d4 < 5.79999999999999975e107Initial program 90.4%
associate--l+90.4%
distribute-lft-out--91.4%
distribute-rgt-out--93.8%
distribute-lft-out100.0%
Simplified100.0%
Taylor expanded in d4 around 0 82.5%
+-commutative82.5%
associate--r+82.5%
Simplified82.5%
Taylor expanded in d3 around 0 59.0%
if 5.79999999999999975e107 < d4 Initial program 89.1%
associate-+l-89.1%
*-commutative89.1%
fma-neg93.5%
*-commutative93.5%
distribute-lft-out--93.5%
Applied egg-rr93.5%
Taylor expanded in d1 around 0 97.8%
Taylor expanded in d3 around 0 83.6%
+-commutative83.6%
Simplified83.6%
Final simplification63.4%
(FPCore (d1 d2 d3 d4) :precision binary64 (if (<= d2 -0.00037) (* d1 (- d2 d3)) (* d1 (- d4 d3))))
double code(double d1, double d2, double d3, double d4) {
double tmp;
if (d2 <= -0.00037) {
tmp = d1 * (d2 - d3);
} else {
tmp = d1 * (d4 - d3);
}
return tmp;
}
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
real(8) :: tmp
if (d2 <= (-0.00037d0)) then
tmp = d1 * (d2 - d3)
else
tmp = d1 * (d4 - d3)
end if
code = tmp
end function
public static double code(double d1, double d2, double d3, double d4) {
double tmp;
if (d2 <= -0.00037) {
tmp = d1 * (d2 - d3);
} else {
tmp = d1 * (d4 - d3);
}
return tmp;
}
def code(d1, d2, d3, d4): tmp = 0 if d2 <= -0.00037: tmp = d1 * (d2 - d3) else: tmp = d1 * (d4 - d3) return tmp
function code(d1, d2, d3, d4) tmp = 0.0 if (d2 <= -0.00037) tmp = Float64(d1 * Float64(d2 - d3)); else tmp = Float64(d1 * Float64(d4 - d3)); end return tmp end
function tmp_2 = code(d1, d2, d3, d4) tmp = 0.0; if (d2 <= -0.00037) tmp = d1 * (d2 - d3); else tmp = d1 * (d4 - d3); end tmp_2 = tmp; end
code[d1_, d2_, d3_, d4_] := If[LessEqual[d2, -0.00037], N[(d1 * N[(d2 - d3), $MachinePrecision]), $MachinePrecision], N[(d1 * N[(d4 - d3), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;d2 \leq -0.00037:\\
\;\;\;\;d1 \cdot \left(d2 - d3\right)\\
\mathbf{else}:\\
\;\;\;\;d1 \cdot \left(d4 - d3\right)\\
\end{array}
\end{array}
if d2 < -3.6999999999999999e-4Initial program 88.5%
associate--l+88.5%
distribute-lft-out--90.1%
distribute-rgt-out--91.8%
distribute-lft-out99.9%
Simplified99.9%
Taylor expanded in d4 around 0 85.3%
+-commutative85.3%
associate--r+85.3%
Simplified85.3%
Taylor expanded in d1 around 0 78.9%
if -3.6999999999999999e-4 < d2 Initial program 90.7%
associate-+l-90.7%
*-commutative90.7%
fma-neg90.7%
*-commutative90.7%
distribute-lft-out--92.8%
Applied egg-rr92.8%
Taylor expanded in d1 around 0 78.9%
Taylor expanded in d2 around 0 62.4%
Final simplification66.4%
(FPCore (d1 d2 d3 d4) :precision binary64 (if (<= d2 -0.00037) (* d1 d2) (* d1 d4)))
double code(double d1, double d2, double d3, double d4) {
double tmp;
if (d2 <= -0.00037) {
tmp = d1 * d2;
} else {
tmp = d1 * d4;
}
return tmp;
}
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
real(8) :: tmp
if (d2 <= (-0.00037d0)) then
tmp = d1 * d2
else
tmp = d1 * d4
end if
code = tmp
end function
public static double code(double d1, double d2, double d3, double d4) {
double tmp;
if (d2 <= -0.00037) {
tmp = d1 * d2;
} else {
tmp = d1 * d4;
}
return tmp;
}
def code(d1, d2, d3, d4): tmp = 0 if d2 <= -0.00037: tmp = d1 * d2 else: tmp = d1 * d4 return tmp
function code(d1, d2, d3, d4) tmp = 0.0 if (d2 <= -0.00037) tmp = Float64(d1 * d2); else tmp = Float64(d1 * d4); end return tmp end
function tmp_2 = code(d1, d2, d3, d4) tmp = 0.0; if (d2 <= -0.00037) tmp = d1 * d2; else tmp = d1 * d4; end tmp_2 = tmp; end
code[d1_, d2_, d3_, d4_] := If[LessEqual[d2, -0.00037], N[(d1 * d2), $MachinePrecision], N[(d1 * d4), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;d2 \leq -0.00037:\\
\;\;\;\;d1 \cdot d2\\
\mathbf{else}:\\
\;\;\;\;d1 \cdot d4\\
\end{array}
\end{array}
if d2 < -3.6999999999999999e-4Initial program 88.5%
associate--l+88.5%
distribute-lft-out--90.1%
distribute-rgt-out--91.8%
distribute-lft-out99.9%
Simplified99.9%
Taylor expanded in d2 around inf 56.5%
if -3.6999999999999999e-4 < d2 Initial program 90.7%
associate--l+90.7%
distribute-lft-out--91.3%
distribute-rgt-out--94.3%
distribute-lft-out100.0%
Simplified100.0%
Taylor expanded in d4 around inf 39.2%
Final simplification43.3%
(FPCore (d1 d2 d3 d4) :precision binary64 (* d1 d2))
double code(double d1, double d2, double d3, double d4) {
return d1 * d2;
}
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
end function
public static double code(double d1, double d2, double d3, double d4) {
return d1 * d2;
}
def code(d1, d2, d3, d4): return d1 * d2
function code(d1, d2, d3, d4) return Float64(d1 * d2) end
function tmp = code(d1, d2, d3, d4) tmp = d1 * d2; end
code[d1_, d2_, d3_, d4_] := N[(d1 * d2), $MachinePrecision]
\begin{array}{l}
\\
d1 \cdot d2
\end{array}
Initial program 90.2%
associate--l+90.2%
distribute-lft-out--91.0%
distribute-rgt-out--93.7%
distribute-lft-out100.0%
Simplified100.0%
Taylor expanded in d2 around inf 32.0%
Final simplification32.0%
(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 - 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 - d3) + d4) - d1)
end function
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 - d3) + d4) - d1)
function code(d1, d2, d3, d4) return Float64(d1 * Float64(Float64(Float64(d2 - d3) + d4) - d1)) end
function tmp = code(d1, d2, d3, d4) tmp = d1 * (((d2 - d3) + d4) - d1); end
code[d1_, d2_, d3_, d4_] := N[(d1 * N[(N[(N[(d2 - d3), $MachinePrecision] + d4), $MachinePrecision] - d1), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
d1 \cdot \left(\left(\left(d2 - d3\right) + d4\right) - d1\right)
\end{array}
herbie shell --seed 2024078
(FPCore (d1 d2 d3 d4)
:name "FastMath dist4"
:precision binary64
:alt
(* d1 (- (+ (- d2 d3) d4) d1))
(- (+ (- (* d1 d2) (* d1 d3)) (* d4 d1)) (* d1 d1)))