
(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 12 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 87.9%
associate--l+87.9%
distribute-lft-out--89.4%
distribute-rgt-out--92.9%
distribute-lft-out100.0%
Simplified100.0%
Final simplification100.0%
(FPCore (d1 d2 d3 d4)
:precision binary64
(let* ((t_0 (* d1 (- d3))) (t_1 (* d1 (- d1))))
(if (<= d2 -9.4e+111)
(* d1 d2)
(if (<= d2 -48000000.0)
t_1
(if (<= d2 -1.05e-30)
t_0
(if (<= d2 -9.2e-212)
t_1
(if (<= d2 8.5e-301) t_0 (if (<= d2 1.95e-283) t_1 (* d1 d4)))))))))
double code(double d1, double d2, double d3, double d4) {
double t_0 = d1 * -d3;
double t_1 = d1 * -d1;
double tmp;
if (d2 <= -9.4e+111) {
tmp = d1 * d2;
} else if (d2 <= -48000000.0) {
tmp = t_1;
} else if (d2 <= -1.05e-30) {
tmp = t_0;
} else if (d2 <= -9.2e-212) {
tmp = t_1;
} else if (d2 <= 8.5e-301) {
tmp = t_0;
} else if (d2 <= 1.95e-283) {
tmp = t_1;
} 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) :: t_1
real(8) :: tmp
t_0 = d1 * -d3
t_1 = d1 * -d1
if (d2 <= (-9.4d+111)) then
tmp = d1 * d2
else if (d2 <= (-48000000.0d0)) then
tmp = t_1
else if (d2 <= (-1.05d-30)) then
tmp = t_0
else if (d2 <= (-9.2d-212)) then
tmp = t_1
else if (d2 <= 8.5d-301) then
tmp = t_0
else if (d2 <= 1.95d-283) then
tmp = t_1
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 * -d3;
double t_1 = d1 * -d1;
double tmp;
if (d2 <= -9.4e+111) {
tmp = d1 * d2;
} else if (d2 <= -48000000.0) {
tmp = t_1;
} else if (d2 <= -1.05e-30) {
tmp = t_0;
} else if (d2 <= -9.2e-212) {
tmp = t_1;
} else if (d2 <= 8.5e-301) {
tmp = t_0;
} else if (d2 <= 1.95e-283) {
tmp = t_1;
} else {
tmp = d1 * d4;
}
return tmp;
}
def code(d1, d2, d3, d4): t_0 = d1 * -d3 t_1 = d1 * -d1 tmp = 0 if d2 <= -9.4e+111: tmp = d1 * d2 elif d2 <= -48000000.0: tmp = t_1 elif d2 <= -1.05e-30: tmp = t_0 elif d2 <= -9.2e-212: tmp = t_1 elif d2 <= 8.5e-301: tmp = t_0 elif d2 <= 1.95e-283: tmp = t_1 else: tmp = d1 * d4 return tmp
function code(d1, d2, d3, d4) t_0 = Float64(d1 * Float64(-d3)) t_1 = Float64(d1 * Float64(-d1)) tmp = 0.0 if (d2 <= -9.4e+111) tmp = Float64(d1 * d2); elseif (d2 <= -48000000.0) tmp = t_1; elseif (d2 <= -1.05e-30) tmp = t_0; elseif (d2 <= -9.2e-212) tmp = t_1; elseif (d2 <= 8.5e-301) tmp = t_0; elseif (d2 <= 1.95e-283) tmp = t_1; else tmp = Float64(d1 * d4); end return tmp end
function tmp_2 = code(d1, d2, d3, d4) t_0 = d1 * -d3; t_1 = d1 * -d1; tmp = 0.0; if (d2 <= -9.4e+111) tmp = d1 * d2; elseif (d2 <= -48000000.0) tmp = t_1; elseif (d2 <= -1.05e-30) tmp = t_0; elseif (d2 <= -9.2e-212) tmp = t_1; elseif (d2 <= 8.5e-301) tmp = t_0; elseif (d2 <= 1.95e-283) tmp = t_1; else tmp = d1 * d4; end tmp_2 = tmp; end
code[d1_, d2_, d3_, d4_] := Block[{t$95$0 = N[(d1 * (-d3)), $MachinePrecision]}, Block[{t$95$1 = N[(d1 * (-d1)), $MachinePrecision]}, If[LessEqual[d2, -9.4e+111], N[(d1 * d2), $MachinePrecision], If[LessEqual[d2, -48000000.0], t$95$1, If[LessEqual[d2, -1.05e-30], t$95$0, If[LessEqual[d2, -9.2e-212], t$95$1, If[LessEqual[d2, 8.5e-301], t$95$0, If[LessEqual[d2, 1.95e-283], t$95$1, N[(d1 * d4), $MachinePrecision]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := d1 \cdot \left(-d3\right)\\
t_1 := d1 \cdot \left(-d1\right)\\
\mathbf{if}\;d2 \leq -9.4 \cdot 10^{+111}:\\
\;\;\;\;d1 \cdot d2\\
\mathbf{elif}\;d2 \leq -48000000:\\
\;\;\;\;t_1\\
\mathbf{elif}\;d2 \leq -1.05 \cdot 10^{-30}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;d2 \leq -9.2 \cdot 10^{-212}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;d2 \leq 8.5 \cdot 10^{-301}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;d2 \leq 1.95 \cdot 10^{-283}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;d1 \cdot d4\\
\end{array}
\end{array}
if d2 < -9.40000000000000015e111Initial program 89.7%
associate--l+89.7%
distribute-lft-out--94.8%
distribute-rgt-out--94.8%
distribute-lft-out100.0%
Simplified100.0%
Taylor expanded in d2 around inf 75.8%
if -9.40000000000000015e111 < d2 < -4.8e7 or -1.0500000000000001e-30 < d2 < -9.2000000000000004e-212 or 8.50000000000000046e-301 < d2 < 1.9500000000000001e-283Initial program 88.2%
associate--l+88.2%
distribute-lft-out--88.2%
distribute-rgt-out--95.5%
distribute-lft-out100.0%
Simplified100.0%
Taylor expanded in d1 around inf 40.3%
unpow240.3%
mul-1-neg40.3%
distribute-rgt-neg-out40.3%
Simplified40.3%
if -4.8e7 < d2 < -1.0500000000000001e-30 or -9.2000000000000004e-212 < d2 < 8.50000000000000046e-301Initial program 87.0%
associate--l+87.0%
distribute-lft-out--87.0%
distribute-rgt-out--91.3%
distribute-lft-out100.0%
Simplified100.0%
Taylor expanded in d3 around inf 50.5%
associate-*r*50.5%
neg-mul-150.5%
Simplified50.5%
if 1.9500000000000001e-283 < d2 Initial program 87.3%
associate--l+87.3%
distribute-lft-out--88.9%
distribute-rgt-out--91.2%
distribute-lft-out100.0%
Simplified100.0%
Taylor expanded in d4 around inf 34.5%
Final simplification43.8%
(FPCore (d1 d2 d3 d4)
:precision binary64
(let* ((t_0 (* d1 (- d4 d1))) (t_1 (* d1 (- d2 d3))))
(if (<= d4 5.8e-155)
t_1
(if (<= d4 1.95e-115)
t_0
(if (<= d4 1.55e-46) t_1 (if (<= d4 5.4e+62) t_0 (* d1 (- d4 d3))))))))
double code(double d1, double d2, double d3, double d4) {
double t_0 = d1 * (d4 - d1);
double t_1 = d1 * (d2 - d3);
double tmp;
if (d4 <= 5.8e-155) {
tmp = t_1;
} else if (d4 <= 1.95e-115) {
tmp = t_0;
} else if (d4 <= 1.55e-46) {
tmp = t_1;
} else if (d4 <= 5.4e+62) {
tmp = t_0;
} 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) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = d1 * (d4 - d1)
t_1 = d1 * (d2 - d3)
if (d4 <= 5.8d-155) then
tmp = t_1
else if (d4 <= 1.95d-115) then
tmp = t_0
else if (d4 <= 1.55d-46) then
tmp = t_1
else if (d4 <= 5.4d+62) then
tmp = t_0
else
tmp = d1 * (d4 - d3)
end if
code = tmp
end function
public static double code(double d1, double d2, double d3, double d4) {
double t_0 = d1 * (d4 - d1);
double t_1 = d1 * (d2 - d3);
double tmp;
if (d4 <= 5.8e-155) {
tmp = t_1;
} else if (d4 <= 1.95e-115) {
tmp = t_0;
} else if (d4 <= 1.55e-46) {
tmp = t_1;
} else if (d4 <= 5.4e+62) {
tmp = t_0;
} else {
tmp = d1 * (d4 - d3);
}
return tmp;
}
def code(d1, d2, d3, d4): t_0 = d1 * (d4 - d1) t_1 = d1 * (d2 - d3) tmp = 0 if d4 <= 5.8e-155: tmp = t_1 elif d4 <= 1.95e-115: tmp = t_0 elif d4 <= 1.55e-46: tmp = t_1 elif d4 <= 5.4e+62: tmp = t_0 else: tmp = d1 * (d4 - d3) return tmp
function code(d1, d2, d3, d4) t_0 = Float64(d1 * Float64(d4 - d1)) t_1 = Float64(d1 * Float64(d2 - d3)) tmp = 0.0 if (d4 <= 5.8e-155) tmp = t_1; elseif (d4 <= 1.95e-115) tmp = t_0; elseif (d4 <= 1.55e-46) tmp = t_1; elseif (d4 <= 5.4e+62) tmp = t_0; else tmp = Float64(d1 * Float64(d4 - d3)); end return tmp end
function tmp_2 = code(d1, d2, d3, d4) t_0 = d1 * (d4 - d1); t_1 = d1 * (d2 - d3); tmp = 0.0; if (d4 <= 5.8e-155) tmp = t_1; elseif (d4 <= 1.95e-115) tmp = t_0; elseif (d4 <= 1.55e-46) tmp = t_1; elseif (d4 <= 5.4e+62) tmp = t_0; else tmp = d1 * (d4 - d3); end tmp_2 = tmp; end
code[d1_, d2_, d3_, d4_] := Block[{t$95$0 = N[(d1 * N[(d4 - d1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(d1 * N[(d2 - d3), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[d4, 5.8e-155], t$95$1, If[LessEqual[d4, 1.95e-115], t$95$0, If[LessEqual[d4, 1.55e-46], t$95$1, If[LessEqual[d4, 5.4e+62], t$95$0, N[(d1 * N[(d4 - d3), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := d1 \cdot \left(d4 - d1\right)\\
t_1 := d1 \cdot \left(d2 - d3\right)\\
\mathbf{if}\;d4 \leq 5.8 \cdot 10^{-155}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;d4 \leq 1.95 \cdot 10^{-115}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;d4 \leq 1.55 \cdot 10^{-46}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;d4 \leq 5.4 \cdot 10^{+62}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;d1 \cdot \left(d4 - d3\right)\\
\end{array}
\end{array}
if d4 < 5.80000000000000021e-155 or 1.9499999999999999e-115 < d4 < 1.55e-46Initial program 88.5%
associate--l+88.5%
distribute-lft-out--90.8%
distribute-rgt-out--94.2%
distribute-lft-out100.0%
Simplified100.0%
Taylor expanded in d1 around 0 79.5%
Taylor expanded in d4 around 0 59.7%
if 5.80000000000000021e-155 < d4 < 1.9499999999999999e-115 or 1.55e-46 < d4 < 5.4e62Initial program 88.9%
associate--l+88.9%
distribute-lft-out--88.9%
distribute-rgt-out--88.8%
distribute-lft-out99.9%
Simplified99.9%
Taylor expanded in d2 around 0 77.1%
Taylor expanded in d3 around 0 52.7%
if 5.4e62 < d4 Initial program 85.4%
associate--l+85.4%
distribute-lft-out--85.4%
distribute-rgt-out--90.9%
distribute-lft-out100.0%
Simplified100.0%
Taylor expanded in d1 around 0 92.7%
Taylor expanded in d2 around 0 78.7%
Final simplification63.0%
(FPCore (d1 d2 d3 d4)
:precision binary64
(if (<= d2 -7.8e+111)
(* d1 d2)
(if (or (<= d2 -1050000.0) (not (<= d2 -6e-27)))
(* d1 (- d4 d1))
(* d1 (- d3)))))
double code(double d1, double d2, double d3, double d4) {
double tmp;
if (d2 <= -7.8e+111) {
tmp = d1 * d2;
} else if ((d2 <= -1050000.0) || !(d2 <= -6e-27)) {
tmp = d1 * (d4 - d1);
} else {
tmp = d1 * -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 <= (-7.8d+111)) then
tmp = d1 * d2
else if ((d2 <= (-1050000.0d0)) .or. (.not. (d2 <= (-6d-27)))) then
tmp = d1 * (d4 - d1)
else
tmp = d1 * -d3
end if
code = tmp
end function
public static double code(double d1, double d2, double d3, double d4) {
double tmp;
if (d2 <= -7.8e+111) {
tmp = d1 * d2;
} else if ((d2 <= -1050000.0) || !(d2 <= -6e-27)) {
tmp = d1 * (d4 - d1);
} else {
tmp = d1 * -d3;
}
return tmp;
}
def code(d1, d2, d3, d4): tmp = 0 if d2 <= -7.8e+111: tmp = d1 * d2 elif (d2 <= -1050000.0) or not (d2 <= -6e-27): tmp = d1 * (d4 - d1) else: tmp = d1 * -d3 return tmp
function code(d1, d2, d3, d4) tmp = 0.0 if (d2 <= -7.8e+111) tmp = Float64(d1 * d2); elseif ((d2 <= -1050000.0) || !(d2 <= -6e-27)) tmp = Float64(d1 * Float64(d4 - d1)); else tmp = Float64(d1 * Float64(-d3)); end return tmp end
function tmp_2 = code(d1, d2, d3, d4) tmp = 0.0; if (d2 <= -7.8e+111) tmp = d1 * d2; elseif ((d2 <= -1050000.0) || ~((d2 <= -6e-27))) tmp = d1 * (d4 - d1); else tmp = d1 * -d3; end tmp_2 = tmp; end
code[d1_, d2_, d3_, d4_] := If[LessEqual[d2, -7.8e+111], N[(d1 * d2), $MachinePrecision], If[Or[LessEqual[d2, -1050000.0], N[Not[LessEqual[d2, -6e-27]], $MachinePrecision]], N[(d1 * N[(d4 - d1), $MachinePrecision]), $MachinePrecision], N[(d1 * (-d3)), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;d2 \leq -7.8 \cdot 10^{+111}:\\
\;\;\;\;d1 \cdot d2\\
\mathbf{elif}\;d2 \leq -1050000 \lor \neg \left(d2 \leq -6 \cdot 10^{-27}\right):\\
\;\;\;\;d1 \cdot \left(d4 - d1\right)\\
\mathbf{else}:\\
\;\;\;\;d1 \cdot \left(-d3\right)\\
\end{array}
\end{array}
if d2 < -7.79999999999999958e111Initial program 89.7%
associate--l+89.7%
distribute-lft-out--94.8%
distribute-rgt-out--94.8%
distribute-lft-out100.0%
Simplified100.0%
Taylor expanded in d2 around inf 75.8%
if -7.79999999999999958e111 < d2 < -1.05e6 or -6.0000000000000002e-27 < d2 Initial program 87.2%
associate--l+87.2%
distribute-lft-out--88.2%
distribute-rgt-out--92.4%
distribute-lft-out100.0%
Simplified100.0%
Taylor expanded in d2 around 0 84.3%
Taylor expanded in d3 around 0 61.5%
if -1.05e6 < d2 < -6.0000000000000002e-27Initial program 100.0%
associate--l+100.0%
distribute-lft-out--100.0%
distribute-rgt-out--100.0%
distribute-lft-out100.0%
Simplified100.0%
Taylor expanded in d3 around inf 80.5%
associate-*r*80.5%
neg-mul-180.5%
Simplified80.5%
Final simplification64.0%
(FPCore (d1 d2 d3 d4)
:precision binary64
(if (<= d2 -5.5e+111)
(* d1 (+ d2 d4))
(if (or (<= d2 -1050000.0) (not (<= d2 -1.05e-30)))
(* d1 (- d4 d1))
(* d1 (- d3)))))
double code(double d1, double d2, double d3, double d4) {
double tmp;
if (d2 <= -5.5e+111) {
tmp = d1 * (d2 + d4);
} else if ((d2 <= -1050000.0) || !(d2 <= -1.05e-30)) {
tmp = d1 * (d4 - d1);
} else {
tmp = d1 * -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 <= (-5.5d+111)) then
tmp = d1 * (d2 + d4)
else if ((d2 <= (-1050000.0d0)) .or. (.not. (d2 <= (-1.05d-30)))) then
tmp = d1 * (d4 - d1)
else
tmp = d1 * -d3
end if
code = tmp
end function
public static double code(double d1, double d2, double d3, double d4) {
double tmp;
if (d2 <= -5.5e+111) {
tmp = d1 * (d2 + d4);
} else if ((d2 <= -1050000.0) || !(d2 <= -1.05e-30)) {
tmp = d1 * (d4 - d1);
} else {
tmp = d1 * -d3;
}
return tmp;
}
def code(d1, d2, d3, d4): tmp = 0 if d2 <= -5.5e+111: tmp = d1 * (d2 + d4) elif (d2 <= -1050000.0) or not (d2 <= -1.05e-30): tmp = d1 * (d4 - d1) else: tmp = d1 * -d3 return tmp
function code(d1, d2, d3, d4) tmp = 0.0 if (d2 <= -5.5e+111) tmp = Float64(d1 * Float64(d2 + d4)); elseif ((d2 <= -1050000.0) || !(d2 <= -1.05e-30)) tmp = Float64(d1 * Float64(d4 - d1)); else tmp = Float64(d1 * Float64(-d3)); end return tmp end
function tmp_2 = code(d1, d2, d3, d4) tmp = 0.0; if (d2 <= -5.5e+111) tmp = d1 * (d2 + d4); elseif ((d2 <= -1050000.0) || ~((d2 <= -1.05e-30))) tmp = d1 * (d4 - d1); else tmp = d1 * -d3; end tmp_2 = tmp; end
code[d1_, d2_, d3_, d4_] := If[LessEqual[d2, -5.5e+111], N[(d1 * N[(d2 + d4), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[d2, -1050000.0], N[Not[LessEqual[d2, -1.05e-30]], $MachinePrecision]], N[(d1 * N[(d4 - d1), $MachinePrecision]), $MachinePrecision], N[(d1 * (-d3)), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;d2 \leq -5.5 \cdot 10^{+111}:\\
\;\;\;\;d1 \cdot \left(d2 + d4\right)\\
\mathbf{elif}\;d2 \leq -1050000 \lor \neg \left(d2 \leq -1.05 \cdot 10^{-30}\right):\\
\;\;\;\;d1 \cdot \left(d4 - d1\right)\\
\mathbf{else}:\\
\;\;\;\;d1 \cdot \left(-d3\right)\\
\end{array}
\end{array}
if d2 < -5.4999999999999998e111Initial program 89.7%
associate--l+89.7%
distribute-lft-out--94.8%
distribute-rgt-out--94.8%
distribute-lft-out100.0%
Simplified100.0%
Taylor expanded in d1 around 0 100.0%
Taylor expanded in d3 around 0 92.4%
*-commutative92.4%
+-commutative92.4%
Simplified92.4%
if -5.4999999999999998e111 < d2 < -1.05e6 or -1.0500000000000001e-30 < d2 Initial program 87.2%
associate--l+87.2%
distribute-lft-out--88.2%
distribute-rgt-out--92.4%
distribute-lft-out100.0%
Simplified100.0%
Taylor expanded in d2 around 0 84.3%
Taylor expanded in d3 around 0 61.5%
if -1.05e6 < d2 < -1.0500000000000001e-30Initial program 100.0%
associate--l+100.0%
distribute-lft-out--100.0%
distribute-rgt-out--100.0%
distribute-lft-out100.0%
Simplified100.0%
Taylor expanded in d3 around inf 80.5%
associate-*r*80.5%
neg-mul-180.5%
Simplified80.5%
Final simplification66.5%
(FPCore (d1 d2 d3 d4) :precision binary64 (if (or (<= d2 -2.9e+39) (and (not (<= d2 -4200000.0)) (<= d2 -6e-27))) (* d1 (- d2 d3)) (* d1 (- d4 d1))))
double code(double d1, double d2, double d3, double d4) {
double tmp;
if ((d2 <= -2.9e+39) || (!(d2 <= -4200000.0) && (d2 <= -6e-27))) {
tmp = d1 * (d2 - d3);
} else {
tmp = d1 * (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 ((d2 <= (-2.9d+39)) .or. (.not. (d2 <= (-4200000.0d0))) .and. (d2 <= (-6d-27))) then
tmp = d1 * (d2 - d3)
else
tmp = d1 * (d4 - d1)
end if
code = tmp
end function
public static double code(double d1, double d2, double d3, double d4) {
double tmp;
if ((d2 <= -2.9e+39) || (!(d2 <= -4200000.0) && (d2 <= -6e-27))) {
tmp = d1 * (d2 - d3);
} else {
tmp = d1 * (d4 - d1);
}
return tmp;
}
def code(d1, d2, d3, d4): tmp = 0 if (d2 <= -2.9e+39) or (not (d2 <= -4200000.0) and (d2 <= -6e-27)): tmp = d1 * (d2 - d3) else: tmp = d1 * (d4 - d1) return tmp
function code(d1, d2, d3, d4) tmp = 0.0 if ((d2 <= -2.9e+39) || (!(d2 <= -4200000.0) && (d2 <= -6e-27))) tmp = Float64(d1 * Float64(d2 - d3)); else tmp = Float64(d1 * Float64(d4 - d1)); end return tmp end
function tmp_2 = code(d1, d2, d3, d4) tmp = 0.0; if ((d2 <= -2.9e+39) || (~((d2 <= -4200000.0)) && (d2 <= -6e-27))) tmp = d1 * (d2 - d3); else tmp = d1 * (d4 - d1); end tmp_2 = tmp; end
code[d1_, d2_, d3_, d4_] := If[Or[LessEqual[d2, -2.9e+39], And[N[Not[LessEqual[d2, -4200000.0]], $MachinePrecision], LessEqual[d2, -6e-27]]], N[(d1 * N[(d2 - d3), $MachinePrecision]), $MachinePrecision], N[(d1 * N[(d4 - d1), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;d2 \leq -2.9 \cdot 10^{+39} \lor \neg \left(d2 \leq -4200000\right) \land d2 \leq -6 \cdot 10^{-27}:\\
\;\;\;\;d1 \cdot \left(d2 - d3\right)\\
\mathbf{else}:\\
\;\;\;\;d1 \cdot \left(d4 - d1\right)\\
\end{array}
\end{array}
if d2 < -2.90000000000000029e39 or -4.2e6 < d2 < -6.0000000000000002e-27Initial program 88.5%
associate--l+88.5%
distribute-lft-out--91.8%
distribute-rgt-out--93.4%
distribute-lft-out100.0%
Simplified100.0%
Taylor expanded in d1 around 0 93.9%
Taylor expanded in d4 around 0 74.0%
if -2.90000000000000029e39 < d2 < -4.2e6 or -6.0000000000000002e-27 < d2 Initial program 87.7%
associate--l+87.7%
distribute-lft-out--88.7%
distribute-rgt-out--92.8%
distribute-lft-out100.0%
Simplified100.0%
Taylor expanded in d2 around 0 83.6%
Taylor expanded in d3 around 0 61.6%
Final simplification64.5%
(FPCore (d1 d2 d3 d4) :precision binary64 (if (<= d2 -8.4e+111) (* d1 (- d2 d3)) (if (<= d2 1.2e-283) (* d1 (- (- d1) d3)) (* d1 (- d4 d3)))))
double code(double d1, double d2, double d3, double d4) {
double tmp;
if (d2 <= -8.4e+111) {
tmp = d1 * (d2 - d3);
} else if (d2 <= 1.2e-283) {
tmp = d1 * (-d1 - 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 <= (-8.4d+111)) then
tmp = d1 * (d2 - d3)
else if (d2 <= 1.2d-283) then
tmp = d1 * (-d1 - 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 <= -8.4e+111) {
tmp = d1 * (d2 - d3);
} else if (d2 <= 1.2e-283) {
tmp = d1 * (-d1 - d3);
} else {
tmp = d1 * (d4 - d3);
}
return tmp;
}
def code(d1, d2, d3, d4): tmp = 0 if d2 <= -8.4e+111: tmp = d1 * (d2 - d3) elif d2 <= 1.2e-283: tmp = d1 * (-d1 - d3) else: tmp = d1 * (d4 - d3) return tmp
function code(d1, d2, d3, d4) tmp = 0.0 if (d2 <= -8.4e+111) tmp = Float64(d1 * Float64(d2 - d3)); elseif (d2 <= 1.2e-283) tmp = Float64(d1 * Float64(Float64(-d1) - 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 <= -8.4e+111) tmp = d1 * (d2 - d3); elseif (d2 <= 1.2e-283) tmp = d1 * (-d1 - d3); else tmp = d1 * (d4 - d3); end tmp_2 = tmp; end
code[d1_, d2_, d3_, d4_] := If[LessEqual[d2, -8.4e+111], N[(d1 * N[(d2 - d3), $MachinePrecision]), $MachinePrecision], If[LessEqual[d2, 1.2e-283], N[(d1 * N[((-d1) - d3), $MachinePrecision]), $MachinePrecision], N[(d1 * N[(d4 - d3), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;d2 \leq -8.4 \cdot 10^{+111}:\\
\;\;\;\;d1 \cdot \left(d2 - d3\right)\\
\mathbf{elif}\;d2 \leq 1.2 \cdot 10^{-283}:\\
\;\;\;\;d1 \cdot \left(\left(-d1\right) - d3\right)\\
\mathbf{else}:\\
\;\;\;\;d1 \cdot \left(d4 - d3\right)\\
\end{array}
\end{array}
if d2 < -8.3999999999999998e111Initial program 89.7%
associate--l+89.7%
distribute-lft-out--94.8%
distribute-rgt-out--94.8%
distribute-lft-out100.0%
Simplified100.0%
Taylor expanded in d1 around 0 100.0%
Taylor expanded in d4 around 0 83.4%
if -8.3999999999999998e111 < d2 < 1.2e-283Initial program 87.7%
associate--l+87.7%
distribute-lft-out--87.7%
distribute-rgt-out--94.4%
distribute-lft-out100.0%
Simplified100.0%
Taylor expanded in d2 around 0 95.4%
Taylor expanded in d4 around 0 70.4%
associate-*r*70.4%
neg-mul-170.4%
*-commutative70.4%
distribute-neg-in70.4%
sub-neg70.4%
Simplified70.4%
if 1.2e-283 < d2 Initial program 87.4%
associate--l+87.4%
distribute-lft-out--89.0%
distribute-rgt-out--91.3%
distribute-lft-out100.0%
Simplified100.0%
Taylor expanded in d1 around 0 78.1%
Taylor expanded in d2 around 0 53.1%
Final simplification63.8%
(FPCore (d1 d2 d3 d4) :precision binary64 (if (<= d2 -1.05e+112) (* d1 (- d2 d3)) (* d1 (- d4 (+ d1 d3)))))
double code(double d1, double d2, double d3, double d4) {
double tmp;
if (d2 <= -1.05e+112) {
tmp = d1 * (d2 - d3);
} else {
tmp = d1 * (d4 - (d1 + 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 <= (-1.05d+112)) then
tmp = d1 * (d2 - d3)
else
tmp = d1 * (d4 - (d1 + d3))
end if
code = tmp
end function
public static double code(double d1, double d2, double d3, double d4) {
double tmp;
if (d2 <= -1.05e+112) {
tmp = d1 * (d2 - d3);
} else {
tmp = d1 * (d4 - (d1 + d3));
}
return tmp;
}
def code(d1, d2, d3, d4): tmp = 0 if d2 <= -1.05e+112: tmp = d1 * (d2 - d3) else: tmp = d1 * (d4 - (d1 + d3)) return tmp
function code(d1, d2, d3, d4) tmp = 0.0 if (d2 <= -1.05e+112) tmp = Float64(d1 * Float64(d2 - d3)); else tmp = Float64(d1 * Float64(d4 - Float64(d1 + d3))); end return tmp end
function tmp_2 = code(d1, d2, d3, d4) tmp = 0.0; if (d2 <= -1.05e+112) tmp = d1 * (d2 - d3); else tmp = d1 * (d4 - (d1 + d3)); end tmp_2 = tmp; end
code[d1_, d2_, d3_, d4_] := If[LessEqual[d2, -1.05e+112], N[(d1 * N[(d2 - d3), $MachinePrecision]), $MachinePrecision], N[(d1 * N[(d4 - N[(d1 + d3), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;d2 \leq -1.05 \cdot 10^{+112}:\\
\;\;\;\;d1 \cdot \left(d2 - d3\right)\\
\mathbf{else}:\\
\;\;\;\;d1 \cdot \left(d4 - \left(d1 + d3\right)\right)\\
\end{array}
\end{array}
if d2 < -1.0499999999999999e112Initial program 89.7%
associate--l+89.7%
distribute-lft-out--94.8%
distribute-rgt-out--94.8%
distribute-lft-out100.0%
Simplified100.0%
Taylor expanded in d1 around 0 100.0%
Taylor expanded in d4 around 0 83.4%
if -1.0499999999999999e112 < d2 Initial program 87.5%
associate--l+87.5%
distribute-lft-out--88.5%
distribute-rgt-out--92.6%
distribute-lft-out100.0%
Simplified100.0%
Taylor expanded in d2 around 0 84.6%
Final simplification84.4%
(FPCore (d1 d2 d3 d4) :precision binary64 (if (<= d2 -6.2e+111) (* d1 (- (+ d2 d4) d3)) (* d1 (- d4 (+ d1 d3)))))
double code(double d1, double d2, double d3, double d4) {
double tmp;
if (d2 <= -6.2e+111) {
tmp = d1 * ((d2 + d4) - d3);
} else {
tmp = d1 * (d4 - (d1 + 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 <= (-6.2d+111)) then
tmp = d1 * ((d2 + d4) - d3)
else
tmp = d1 * (d4 - (d1 + d3))
end if
code = tmp
end function
public static double code(double d1, double d2, double d3, double d4) {
double tmp;
if (d2 <= -6.2e+111) {
tmp = d1 * ((d2 + d4) - d3);
} else {
tmp = d1 * (d4 - (d1 + d3));
}
return tmp;
}
def code(d1, d2, d3, d4): tmp = 0 if d2 <= -6.2e+111: tmp = d1 * ((d2 + d4) - d3) else: tmp = d1 * (d4 - (d1 + d3)) return tmp
function code(d1, d2, d3, d4) tmp = 0.0 if (d2 <= -6.2e+111) tmp = Float64(d1 * Float64(Float64(d2 + d4) - d3)); else tmp = Float64(d1 * Float64(d4 - Float64(d1 + d3))); end return tmp end
function tmp_2 = code(d1, d2, d3, d4) tmp = 0.0; if (d2 <= -6.2e+111) tmp = d1 * ((d2 + d4) - d3); else tmp = d1 * (d4 - (d1 + d3)); end tmp_2 = tmp; end
code[d1_, d2_, d3_, d4_] := If[LessEqual[d2, -6.2e+111], N[(d1 * N[(N[(d2 + d4), $MachinePrecision] - d3), $MachinePrecision]), $MachinePrecision], N[(d1 * N[(d4 - N[(d1 + d3), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;d2 \leq -6.2 \cdot 10^{+111}:\\
\;\;\;\;d1 \cdot \left(\left(d2 + d4\right) - d3\right)\\
\mathbf{else}:\\
\;\;\;\;d1 \cdot \left(d4 - \left(d1 + d3\right)\right)\\
\end{array}
\end{array}
if d2 < -6.2000000000000001e111Initial program 89.7%
associate--l+89.7%
distribute-lft-out--94.8%
distribute-rgt-out--94.8%
distribute-lft-out100.0%
Simplified100.0%
Taylor expanded in d1 around 0 100.0%
if -6.2000000000000001e111 < d2 Initial program 87.5%
associate--l+87.5%
distribute-lft-out--88.5%
distribute-rgt-out--92.6%
distribute-lft-out100.0%
Simplified100.0%
Taylor expanded in d2 around 0 84.6%
Final simplification87.0%
(FPCore (d1 d2 d3 d4) :precision binary64 (if (<= d2 -9e+111) (* d1 d2) (if (<= d2 2.1e-283) (* d1 (- d1)) (* d1 d4))))
double code(double d1, double d2, double d3, double d4) {
double tmp;
if (d2 <= -9e+111) {
tmp = d1 * d2;
} else if (d2 <= 2.1e-283) {
tmp = d1 * -d1;
} 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 <= (-9d+111)) then
tmp = d1 * d2
else if (d2 <= 2.1d-283) then
tmp = d1 * -d1
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 <= -9e+111) {
tmp = d1 * d2;
} else if (d2 <= 2.1e-283) {
tmp = d1 * -d1;
} else {
tmp = d1 * d4;
}
return tmp;
}
def code(d1, d2, d3, d4): tmp = 0 if d2 <= -9e+111: tmp = d1 * d2 elif d2 <= 2.1e-283: tmp = d1 * -d1 else: tmp = d1 * d4 return tmp
function code(d1, d2, d3, d4) tmp = 0.0 if (d2 <= -9e+111) tmp = Float64(d1 * d2); elseif (d2 <= 2.1e-283) tmp = Float64(d1 * Float64(-d1)); else tmp = Float64(d1 * d4); end return tmp end
function tmp_2 = code(d1, d2, d3, d4) tmp = 0.0; if (d2 <= -9e+111) tmp = d1 * d2; elseif (d2 <= 2.1e-283) tmp = d1 * -d1; else tmp = d1 * d4; end tmp_2 = tmp; end
code[d1_, d2_, d3_, d4_] := If[LessEqual[d2, -9e+111], N[(d1 * d2), $MachinePrecision], If[LessEqual[d2, 2.1e-283], N[(d1 * (-d1)), $MachinePrecision], N[(d1 * d4), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;d2 \leq -9 \cdot 10^{+111}:\\
\;\;\;\;d1 \cdot d2\\
\mathbf{elif}\;d2 \leq 2.1 \cdot 10^{-283}:\\
\;\;\;\;d1 \cdot \left(-d1\right)\\
\mathbf{else}:\\
\;\;\;\;d1 \cdot d4\\
\end{array}
\end{array}
if d2 < -9.00000000000000001e111Initial program 89.7%
associate--l+89.7%
distribute-lft-out--94.8%
distribute-rgt-out--94.8%
distribute-lft-out100.0%
Simplified100.0%
Taylor expanded in d2 around inf 75.8%
if -9.00000000000000001e111 < d2 < 2.09999999999999997e-283Initial program 87.9%
associate--l+87.9%
distribute-lft-out--87.9%
distribute-rgt-out--94.5%
distribute-lft-out100.0%
Simplified100.0%
Taylor expanded in d1 around inf 38.4%
unpow238.4%
mul-1-neg38.4%
distribute-rgt-neg-out38.4%
Simplified38.4%
if 2.09999999999999997e-283 < d2 Initial program 87.3%
associate--l+87.3%
distribute-lft-out--88.9%
distribute-rgt-out--91.2%
distribute-lft-out100.0%
Simplified100.0%
Taylor expanded in d4 around inf 34.5%
Final simplification42.2%
(FPCore (d1 d2 d3 d4) :precision binary64 (if (<= d4 3.5e+50) (* d1 d2) (* d1 d4)))
double code(double d1, double d2, double d3, double d4) {
double tmp;
if (d4 <= 3.5e+50) {
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 (d4 <= 3.5d+50) 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 (d4 <= 3.5e+50) {
tmp = d1 * d2;
} else {
tmp = d1 * d4;
}
return tmp;
}
def code(d1, d2, d3, d4): tmp = 0 if d4 <= 3.5e+50: tmp = d1 * d2 else: tmp = d1 * d4 return tmp
function code(d1, d2, d3, d4) tmp = 0.0 if (d4 <= 3.5e+50) 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 (d4 <= 3.5e+50) tmp = d1 * d2; else tmp = d1 * d4; end tmp_2 = tmp; end
code[d1_, d2_, d3_, d4_] := If[LessEqual[d4, 3.5e+50], N[(d1 * d2), $MachinePrecision], N[(d1 * d4), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;d4 \leq 3.5 \cdot 10^{+50}:\\
\;\;\;\;d1 \cdot d2\\
\mathbf{else}:\\
\;\;\;\;d1 \cdot d4\\
\end{array}
\end{array}
if d4 < 3.50000000000000006e50Initial program 88.5%
associate--l+88.5%
distribute-lft-out--90.5%
distribute-rgt-out--93.5%
distribute-lft-out100.0%
Simplified100.0%
Taylor expanded in d2 around inf 35.2%
if 3.50000000000000006e50 < d4 Initial program 85.4%
associate--l+85.4%
distribute-lft-out--85.4%
distribute-rgt-out--90.9%
distribute-lft-out100.0%
Simplified100.0%
Taylor expanded in d4 around inf 65.5%
Final simplification41.7%
(FPCore (d1 d2 d3 d4) :precision binary64 (* d1 d4))
double code(double d1, double d2, double d3, double d4) {
return d1 * d4;
}
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
end function
public static double code(double d1, double d2, double d3, double d4) {
return d1 * d4;
}
def code(d1, d2, d3, d4): return d1 * d4
function code(d1, d2, d3, d4) return Float64(d1 * d4) end
function tmp = code(d1, d2, d3, d4) tmp = d1 * d4; end
code[d1_, d2_, d3_, d4_] := N[(d1 * d4), $MachinePrecision]
\begin{array}{l}
\\
d1 \cdot d4
\end{array}
Initial program 87.9%
associate--l+87.9%
distribute-lft-out--89.4%
distribute-rgt-out--92.9%
distribute-lft-out100.0%
Simplified100.0%
Taylor expanded in d4 around inf 31.9%
Final simplification31.9%
(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 2023187
(FPCore (d1 d2 d3 d4)
:name "FastMath dist4"
:precision binary64
:herbie-target
(* d1 (- (+ (- d2 d3) d4) d1))
(- (+ (- (* d1 d2) (* d1 d3)) (* d4 d1)) (* d1 d1)))