
(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 85.9%
associate--l+85.9%
distribute-lft-out--87.9%
distribute-rgt-out--90.2%
distribute-lft-out100.0%
Simplified100.0%
(FPCore (d1 d2 d3 d4)
:precision binary64
(if (<= d2 -1.05e+154)
(* d1 (+ d2 d4))
(if (or (<= d2 -1.75e+64)
(not
(or (<= d2 -3.4e-8) (and (not (<= d2 3.6e-223)) (<= d2 5.6e-37)))))
(* d1 (- d4 d3))
(* d1 (- d4 d1)))))
double code(double d1, double d2, double d3, double d4) {
double tmp;
if (d2 <= -1.05e+154) {
tmp = d1 * (d2 + d4);
} else if ((d2 <= -1.75e+64) || !((d2 <= -3.4e-8) || (!(d2 <= 3.6e-223) && (d2 <= 5.6e-37)))) {
tmp = d1 * (d4 - 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 <= (-1.05d+154)) then
tmp = d1 * (d2 + d4)
else if ((d2 <= (-1.75d+64)) .or. (.not. (d2 <= (-3.4d-8)) .or. (.not. (d2 <= 3.6d-223)) .and. (d2 <= 5.6d-37))) then
tmp = d1 * (d4 - 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 <= -1.05e+154) {
tmp = d1 * (d2 + d4);
} else if ((d2 <= -1.75e+64) || !((d2 <= -3.4e-8) || (!(d2 <= 3.6e-223) && (d2 <= 5.6e-37)))) {
tmp = d1 * (d4 - d3);
} else {
tmp = d1 * (d4 - d1);
}
return tmp;
}
def code(d1, d2, d3, d4): tmp = 0 if d2 <= -1.05e+154: tmp = d1 * (d2 + d4) elif (d2 <= -1.75e+64) or not ((d2 <= -3.4e-8) or (not (d2 <= 3.6e-223) and (d2 <= 5.6e-37))): tmp = d1 * (d4 - d3) else: tmp = d1 * (d4 - d1) return tmp
function code(d1, d2, d3, d4) tmp = 0.0 if (d2 <= -1.05e+154) tmp = Float64(d1 * Float64(d2 + d4)); elseif ((d2 <= -1.75e+64) || !((d2 <= -3.4e-8) || (!(d2 <= 3.6e-223) && (d2 <= 5.6e-37)))) tmp = Float64(d1 * Float64(d4 - 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 <= -1.05e+154) tmp = d1 * (d2 + d4); elseif ((d2 <= -1.75e+64) || ~(((d2 <= -3.4e-8) || (~((d2 <= 3.6e-223)) && (d2 <= 5.6e-37))))) tmp = d1 * (d4 - d3); else tmp = d1 * (d4 - d1); end tmp_2 = tmp; end
code[d1_, d2_, d3_, d4_] := If[LessEqual[d2, -1.05e+154], N[(d1 * N[(d2 + d4), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[d2, -1.75e+64], N[Not[Or[LessEqual[d2, -3.4e-8], And[N[Not[LessEqual[d2, 3.6e-223]], $MachinePrecision], LessEqual[d2, 5.6e-37]]]], $MachinePrecision]], N[(d1 * N[(d4 - d3), $MachinePrecision]), $MachinePrecision], N[(d1 * N[(d4 - d1), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;d2 \leq -1.05 \cdot 10^{+154}:\\
\;\;\;\;d1 \cdot \left(d2 + d4\right)\\
\mathbf{elif}\;d2 \leq -1.75 \cdot 10^{+64} \lor \neg \left(d2 \leq -3.4 \cdot 10^{-8} \lor \neg \left(d2 \leq 3.6 \cdot 10^{-223}\right) \land d2 \leq 5.6 \cdot 10^{-37}\right):\\
\;\;\;\;d1 \cdot \left(d4 - d3\right)\\
\mathbf{else}:\\
\;\;\;\;d1 \cdot \left(d4 - d1\right)\\
\end{array}
\end{array}
if d2 < -1.04999999999999997e154Initial program 82.4%
associate--l+82.4%
distribute-lft-out--88.2%
distribute-rgt-out--88.2%
distribute-lft-out100.0%
Simplified100.0%
Taylor expanded in d1 around 0 97.1%
Taylor expanded in d3 around 0 87.2%
if -1.04999999999999997e154 < d2 < -1.7499999999999999e64 or -3.4e-8 < d2 < 3.6000000000000004e-223 or 5.6000000000000002e-37 < d2 Initial program 85.2%
associate--l+85.2%
distribute-lft-out--87.2%
distribute-rgt-out--90.4%
distribute-lft-out100.0%
Simplified100.0%
Taylor expanded in d1 around 0 83.2%
associate--l+83.2%
distribute-rgt-in79.4%
Applied egg-rr79.4%
Taylor expanded in d2 around 0 60.9%
if -1.7499999999999999e64 < d2 < -3.4e-8 or 3.6000000000000004e-223 < d2 < 5.6000000000000002e-37Initial program 89.3%
associate--l+89.3%
distribute-lft-out--89.3%
distribute-rgt-out--90.8%
distribute-lft-out99.9%
Simplified99.9%
Taylor expanded in d2 around 0 97.1%
associate--r+97.1%
Simplified97.1%
Taylor expanded in d3 around 0 65.9%
Final simplification65.7%
(FPCore (d1 d2 d3 d4)
:precision binary64
(if (<= d2 -1.5e+148)
(* d1 (+ d2 d4))
(if (<= d2 -2.2e-183)
(* d1 (- (- d3) d1))
(if (or (<= d2 7e-223) (not (<= d2 2.4e-37)))
(* d1 (- d4 d3))
(* d1 (- d4 d1))))))
double code(double d1, double d2, double d3, double d4) {
double tmp;
if (d2 <= -1.5e+148) {
tmp = d1 * (d2 + d4);
} else if (d2 <= -2.2e-183) {
tmp = d1 * (-d3 - d1);
} else if ((d2 <= 7e-223) || !(d2 <= 2.4e-37)) {
tmp = d1 * (d4 - 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 <= (-1.5d+148)) then
tmp = d1 * (d2 + d4)
else if (d2 <= (-2.2d-183)) then
tmp = d1 * (-d3 - d1)
else if ((d2 <= 7d-223) .or. (.not. (d2 <= 2.4d-37))) then
tmp = d1 * (d4 - 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 <= -1.5e+148) {
tmp = d1 * (d2 + d4);
} else if (d2 <= -2.2e-183) {
tmp = d1 * (-d3 - d1);
} else if ((d2 <= 7e-223) || !(d2 <= 2.4e-37)) {
tmp = d1 * (d4 - d3);
} else {
tmp = d1 * (d4 - d1);
}
return tmp;
}
def code(d1, d2, d3, d4): tmp = 0 if d2 <= -1.5e+148: tmp = d1 * (d2 + d4) elif d2 <= -2.2e-183: tmp = d1 * (-d3 - d1) elif (d2 <= 7e-223) or not (d2 <= 2.4e-37): tmp = d1 * (d4 - d3) else: tmp = d1 * (d4 - d1) return tmp
function code(d1, d2, d3, d4) tmp = 0.0 if (d2 <= -1.5e+148) tmp = Float64(d1 * Float64(d2 + d4)); elseif (d2 <= -2.2e-183) tmp = Float64(d1 * Float64(Float64(-d3) - d1)); elseif ((d2 <= 7e-223) || !(d2 <= 2.4e-37)) tmp = Float64(d1 * Float64(d4 - 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 <= -1.5e+148) tmp = d1 * (d2 + d4); elseif (d2 <= -2.2e-183) tmp = d1 * (-d3 - d1); elseif ((d2 <= 7e-223) || ~((d2 <= 2.4e-37))) tmp = d1 * (d4 - d3); else tmp = d1 * (d4 - d1); end tmp_2 = tmp; end
code[d1_, d2_, d3_, d4_] := If[LessEqual[d2, -1.5e+148], N[(d1 * N[(d2 + d4), $MachinePrecision]), $MachinePrecision], If[LessEqual[d2, -2.2e-183], N[(d1 * N[((-d3) - d1), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[d2, 7e-223], N[Not[LessEqual[d2, 2.4e-37]], $MachinePrecision]], N[(d1 * N[(d4 - d3), $MachinePrecision]), $MachinePrecision], N[(d1 * N[(d4 - d1), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;d2 \leq -1.5 \cdot 10^{+148}:\\
\;\;\;\;d1 \cdot \left(d2 + d4\right)\\
\mathbf{elif}\;d2 \leq -2.2 \cdot 10^{-183}:\\
\;\;\;\;d1 \cdot \left(\left(-d3\right) - d1\right)\\
\mathbf{elif}\;d2 \leq 7 \cdot 10^{-223} \lor \neg \left(d2 \leq 2.4 \cdot 10^{-37}\right):\\
\;\;\;\;d1 \cdot \left(d4 - d3\right)\\
\mathbf{else}:\\
\;\;\;\;d1 \cdot \left(d4 - d1\right)\\
\end{array}
\end{array}
if d2 < -1.50000000000000007e148Initial program 82.4%
associate--l+82.4%
distribute-lft-out--88.2%
distribute-rgt-out--88.2%
distribute-lft-out100.0%
Simplified100.0%
Taylor expanded in d1 around 0 97.1%
Taylor expanded in d3 around 0 87.2%
if -1.50000000000000007e148 < d2 < -2.2e-183Initial program 88.4%
associate--l+88.4%
distribute-lft-out--89.8%
distribute-rgt-out--91.3%
distribute-lft-out100.0%
Simplified100.0%
Taylor expanded in d2 around 0 94.4%
associate--r+94.4%
Simplified94.4%
Taylor expanded in d4 around 0 71.3%
associate-*r*71.3%
neg-mul-171.3%
Simplified71.3%
if -2.2e-183 < d2 < 7.00000000000000018e-223 or 2.39999999999999991e-37 < d2 Initial program 83.8%
associate--l+83.8%
distribute-lft-out--85.7%
distribute-rgt-out--89.5%
distribute-lft-out100.0%
Simplified100.0%
Taylor expanded in d1 around 0 88.9%
associate--l+88.9%
distribute-rgt-in84.1%
Applied egg-rr84.1%
Taylor expanded in d2 around 0 58.6%
if 7.00000000000000018e-223 < d2 < 2.39999999999999991e-37Initial program 89.5%
associate--l+89.5%
distribute-lft-out--89.5%
distribute-rgt-out--91.6%
distribute-lft-out99.9%
Simplified99.9%
Taylor expanded in d2 around 0 99.9%
associate--r+99.9%
Simplified99.9%
Taylor expanded in d3 around 0 61.2%
Final simplification66.3%
(FPCore (d1 d2 d3 d4)
:precision binary64
(let* ((t_0 (* d1 (- d3))))
(if (<= d2 -1.6e+148)
(* d1 d2)
(if (<= d2 -4.9e+60)
t_0
(if (<= d2 -5.4e-71)
(* d1 (- d1))
(if (<= d2 -7.2e-230) t_0 (* d1 d4)))))))
double code(double d1, double d2, double d3, double d4) {
double t_0 = d1 * -d3;
double tmp;
if (d2 <= -1.6e+148) {
tmp = d1 * d2;
} else if (d2 <= -4.9e+60) {
tmp = t_0;
} else if (d2 <= -5.4e-71) {
tmp = d1 * -d1;
} else if (d2 <= -7.2e-230) {
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 * -d3
if (d2 <= (-1.6d+148)) then
tmp = d1 * d2
else if (d2 <= (-4.9d+60)) then
tmp = t_0
else if (d2 <= (-5.4d-71)) then
tmp = d1 * -d1
else if (d2 <= (-7.2d-230)) 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 * -d3;
double tmp;
if (d2 <= -1.6e+148) {
tmp = d1 * d2;
} else if (d2 <= -4.9e+60) {
tmp = t_0;
} else if (d2 <= -5.4e-71) {
tmp = d1 * -d1;
} else if (d2 <= -7.2e-230) {
tmp = t_0;
} else {
tmp = d1 * d4;
}
return tmp;
}
def code(d1, d2, d3, d4): t_0 = d1 * -d3 tmp = 0 if d2 <= -1.6e+148: tmp = d1 * d2 elif d2 <= -4.9e+60: tmp = t_0 elif d2 <= -5.4e-71: tmp = d1 * -d1 elif d2 <= -7.2e-230: tmp = t_0 else: tmp = d1 * d4 return tmp
function code(d1, d2, d3, d4) t_0 = Float64(d1 * Float64(-d3)) tmp = 0.0 if (d2 <= -1.6e+148) tmp = Float64(d1 * d2); elseif (d2 <= -4.9e+60) tmp = t_0; elseif (d2 <= -5.4e-71) tmp = Float64(d1 * Float64(-d1)); elseif (d2 <= -7.2e-230) tmp = t_0; else tmp = Float64(d1 * d4); end return tmp end
function tmp_2 = code(d1, d2, d3, d4) t_0 = d1 * -d3; tmp = 0.0; if (d2 <= -1.6e+148) tmp = d1 * d2; elseif (d2 <= -4.9e+60) tmp = t_0; elseif (d2 <= -5.4e-71) tmp = d1 * -d1; elseif (d2 <= -7.2e-230) tmp = t_0; else tmp = d1 * d4; end tmp_2 = tmp; end
code[d1_, d2_, d3_, d4_] := Block[{t$95$0 = N[(d1 * (-d3)), $MachinePrecision]}, If[LessEqual[d2, -1.6e+148], N[(d1 * d2), $MachinePrecision], If[LessEqual[d2, -4.9e+60], t$95$0, If[LessEqual[d2, -5.4e-71], N[(d1 * (-d1)), $MachinePrecision], If[LessEqual[d2, -7.2e-230], t$95$0, N[(d1 * d4), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := d1 \cdot \left(-d3\right)\\
\mathbf{if}\;d2 \leq -1.6 \cdot 10^{+148}:\\
\;\;\;\;d1 \cdot d2\\
\mathbf{elif}\;d2 \leq -4.9 \cdot 10^{+60}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;d2 \leq -5.4 \cdot 10^{-71}:\\
\;\;\;\;d1 \cdot \left(-d1\right)\\
\mathbf{elif}\;d2 \leq -7.2 \cdot 10^{-230}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;d1 \cdot d4\\
\end{array}
\end{array}
if d2 < -1.6e148Initial program 82.4%
associate--l+82.4%
distribute-lft-out--88.2%
distribute-rgt-out--88.2%
distribute-lft-out100.0%
Simplified100.0%
Taylor expanded in d2 around inf 67.7%
if -1.6e148 < d2 < -4.9000000000000003e60 or -5.4000000000000003e-71 < d2 < -7.1999999999999997e-230Initial program 83.0%
associate--l+83.0%
distribute-lft-out--85.1%
distribute-rgt-out--89.3%
distribute-lft-out100.0%
Simplified100.0%
Taylor expanded in d3 around inf 49.5%
associate-*r*49.5%
neg-mul-149.5%
Simplified49.5%
if -4.9000000000000003e60 < d2 < -5.4000000000000003e-71Initial program 90.6%
associate--l+90.6%
distribute-lft-out--90.6%
distribute-rgt-out--90.6%
distribute-lft-out100.0%
Simplified100.0%
Taylor expanded in d1 around inf 45.9%
neg-mul-145.9%
Simplified45.9%
if -7.1999999999999997e-230 < d2 Initial program 86.7%
associate--l+86.7%
distribute-lft-out--88.1%
distribute-rgt-out--90.9%
distribute-lft-out99.9%
Simplified99.9%
Taylor expanded in d4 around inf 33.6%
Final simplification42.6%
(FPCore (d1 d2 d3 d4) :precision binary64 (if (<= d4 820000000000.0) (* d1 (- (- d2 d1) d3)) (if (<= d4 1.65e+125) (* d1 (- (- d4 d1) d3)) (* d1 (- (+ d2 d4) d3)))))
double code(double d1, double d2, double d3, double d4) {
double tmp;
if (d4 <= 820000000000.0) {
tmp = d1 * ((d2 - d1) - d3);
} else if (d4 <= 1.65e+125) {
tmp = d1 * ((d4 - d1) - d3);
} 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 <= 820000000000.0d0) then
tmp = d1 * ((d2 - d1) - d3)
else if (d4 <= 1.65d+125) then
tmp = d1 * ((d4 - d1) - d3)
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 <= 820000000000.0) {
tmp = d1 * ((d2 - d1) - d3);
} else if (d4 <= 1.65e+125) {
tmp = d1 * ((d4 - d1) - d3);
} else {
tmp = d1 * ((d2 + d4) - d3);
}
return tmp;
}
def code(d1, d2, d3, d4): tmp = 0 if d4 <= 820000000000.0: tmp = d1 * ((d2 - d1) - d3) elif d4 <= 1.65e+125: tmp = d1 * ((d4 - d1) - d3) else: tmp = d1 * ((d2 + d4) - d3) return tmp
function code(d1, d2, d3, d4) tmp = 0.0 if (d4 <= 820000000000.0) tmp = Float64(d1 * Float64(Float64(d2 - d1) - d3)); elseif (d4 <= 1.65e+125) tmp = Float64(d1 * Float64(Float64(d4 - d1) - d3)); 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 <= 820000000000.0) tmp = d1 * ((d2 - d1) - d3); elseif (d4 <= 1.65e+125) tmp = d1 * ((d4 - d1) - d3); else tmp = d1 * ((d2 + d4) - d3); end tmp_2 = tmp; end
code[d1_, d2_, d3_, d4_] := If[LessEqual[d4, 820000000000.0], N[(d1 * N[(N[(d2 - d1), $MachinePrecision] - d3), $MachinePrecision]), $MachinePrecision], If[LessEqual[d4, 1.65e+125], N[(d1 * N[(N[(d4 - d1), $MachinePrecision] - d3), $MachinePrecision]), $MachinePrecision], N[(d1 * N[(N[(d2 + d4), $MachinePrecision] - d3), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;d4 \leq 820000000000:\\
\;\;\;\;d1 \cdot \left(\left(d2 - d1\right) - d3\right)\\
\mathbf{elif}\;d4 \leq 1.65 \cdot 10^{+125}:\\
\;\;\;\;d1 \cdot \left(\left(d4 - d1\right) - d3\right)\\
\mathbf{else}:\\
\;\;\;\;d1 \cdot \left(\left(d2 + d4\right) - d3\right)\\
\end{array}
\end{array}
if d4 < 8.2e11Initial program 86.2%
associate--l+86.2%
distribute-lft-out--88.7%
distribute-rgt-out--89.8%
distribute-lft-out100.0%
Simplified100.0%
Taylor expanded in d4 around 0 81.2%
associate--r+81.2%
Simplified81.2%
if 8.2e11 < d4 < 1.65000000000000003e125Initial program 83.3%
associate--l+83.3%
distribute-lft-out--83.2%
distribute-rgt-out--94.4%
distribute-lft-out99.9%
Simplified99.9%
Taylor expanded in d2 around 0 87.1%
associate--r+87.1%
Simplified87.1%
if 1.65000000000000003e125 < d4 Initial program 85.7%
associate--l+85.7%
distribute-lft-out--85.7%
distribute-rgt-out--90.5%
distribute-lft-out100.0%
Simplified100.0%
Taylor expanded in d1 around 0 95.2%
(FPCore (d1 d2 d3 d4) :precision binary64 (if (<= d1 -1.9e+172) (* d1 (- (- d3) d1)) (if (<= d1 5.4e+158) (* d1 (- (+ d2 d4) d3)) (* d1 (- d4 d1)))))
double code(double d1, double d2, double d3, double d4) {
double tmp;
if (d1 <= -1.9e+172) {
tmp = d1 * (-d3 - d1);
} else if (d1 <= 5.4e+158) {
tmp = d1 * ((d2 + d4) - 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 (d1 <= (-1.9d+172)) then
tmp = d1 * (-d3 - d1)
else if (d1 <= 5.4d+158) then
tmp = d1 * ((d2 + d4) - 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 (d1 <= -1.9e+172) {
tmp = d1 * (-d3 - d1);
} else if (d1 <= 5.4e+158) {
tmp = d1 * ((d2 + d4) - d3);
} else {
tmp = d1 * (d4 - d1);
}
return tmp;
}
def code(d1, d2, d3, d4): tmp = 0 if d1 <= -1.9e+172: tmp = d1 * (-d3 - d1) elif d1 <= 5.4e+158: tmp = d1 * ((d2 + d4) - d3) else: tmp = d1 * (d4 - d1) return tmp
function code(d1, d2, d3, d4) tmp = 0.0 if (d1 <= -1.9e+172) tmp = Float64(d1 * Float64(Float64(-d3) - d1)); elseif (d1 <= 5.4e+158) tmp = Float64(d1 * Float64(Float64(d2 + d4) - d3)); else tmp = Float64(d1 * Float64(d4 - d1)); end return tmp end
function tmp_2 = code(d1, d2, d3, d4) tmp = 0.0; if (d1 <= -1.9e+172) tmp = d1 * (-d3 - d1); elseif (d1 <= 5.4e+158) tmp = d1 * ((d2 + d4) - d3); else tmp = d1 * (d4 - d1); end tmp_2 = tmp; end
code[d1_, d2_, d3_, d4_] := If[LessEqual[d1, -1.9e+172], N[(d1 * N[((-d3) - d1), $MachinePrecision]), $MachinePrecision], If[LessEqual[d1, 5.4e+158], N[(d1 * N[(N[(d2 + d4), $MachinePrecision] - d3), $MachinePrecision]), $MachinePrecision], N[(d1 * N[(d4 - d1), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;d1 \leq -1.9 \cdot 10^{+172}:\\
\;\;\;\;d1 \cdot \left(\left(-d3\right) - d1\right)\\
\mathbf{elif}\;d1 \leq 5.4 \cdot 10^{+158}:\\
\;\;\;\;d1 \cdot \left(\left(d2 + d4\right) - d3\right)\\
\mathbf{else}:\\
\;\;\;\;d1 \cdot \left(d4 - d1\right)\\
\end{array}
\end{array}
if d1 < -1.89999999999999985e172Initial program 55.2%
associate--l+55.2%
distribute-lft-out--55.2%
distribute-rgt-out--62.1%
distribute-lft-out100.0%
Simplified100.0%
Taylor expanded in d2 around 0 96.6%
associate--r+96.6%
Simplified96.6%
Taylor expanded in d4 around 0 96.6%
associate-*r*96.6%
neg-mul-196.6%
Simplified96.6%
if -1.89999999999999985e172 < d1 < 5.39999999999999957e158Initial program 96.9%
associate--l+96.9%
distribute-lft-out--98.4%
distribute-rgt-out--98.4%
distribute-lft-out99.9%
Simplified99.9%
Taylor expanded in d1 around 0 89.8%
if 5.39999999999999957e158 < d1 Initial program 43.3%
associate--l+43.3%
distribute-lft-out--50.0%
distribute-rgt-out--63.3%
distribute-lft-out100.0%
Simplified100.0%
Taylor expanded in d2 around 0 93.3%
associate--r+93.3%
Simplified93.3%
Taylor expanded in d3 around 0 86.7%
Final simplification90.2%
(FPCore (d1 d2 d3 d4) :precision binary64 (if (or (<= d3 -3e+89) (not (<= d3 6.2e+148))) (* d1 (- d3)) (* d1 (+ d2 d4))))
double code(double d1, double d2, double d3, double d4) {
double tmp;
if ((d3 <= -3e+89) || !(d3 <= 6.2e+148)) {
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 <= (-3d+89)) .or. (.not. (d3 <= 6.2d+148))) 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 <= -3e+89) || !(d3 <= 6.2e+148)) {
tmp = d1 * -d3;
} else {
tmp = d1 * (d2 + d4);
}
return tmp;
}
def code(d1, d2, d3, d4): tmp = 0 if (d3 <= -3e+89) or not (d3 <= 6.2e+148): tmp = d1 * -d3 else: tmp = d1 * (d2 + d4) return tmp
function code(d1, d2, d3, d4) tmp = 0.0 if ((d3 <= -3e+89) || !(d3 <= 6.2e+148)) 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 <= -3e+89) || ~((d3 <= 6.2e+148))) tmp = d1 * -d3; else tmp = d1 * (d2 + d4); end tmp_2 = tmp; end
code[d1_, d2_, d3_, d4_] := If[Or[LessEqual[d3, -3e+89], N[Not[LessEqual[d3, 6.2e+148]], $MachinePrecision]], N[(d1 * (-d3)), $MachinePrecision], N[(d1 * N[(d2 + d4), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;d3 \leq -3 \cdot 10^{+89} \lor \neg \left(d3 \leq 6.2 \cdot 10^{+148}\right):\\
\;\;\;\;d1 \cdot \left(-d3\right)\\
\mathbf{else}:\\
\;\;\;\;d1 \cdot \left(d2 + d4\right)\\
\end{array}
\end{array}
if d3 < -3.00000000000000013e89 or 6.19999999999999951e148 < d3 Initial program 75.3%
associate--l+75.3%
distribute-lft-out--80.5%
distribute-rgt-out--83.1%
distribute-lft-out99.9%
Simplified99.9%
Taylor expanded in d3 around inf 75.0%
associate-*r*75.0%
neg-mul-175.0%
Simplified75.0%
if -3.00000000000000013e89 < d3 < 6.19999999999999951e148Initial program 90.5%
associate--l+90.5%
distribute-lft-out--91.0%
distribute-rgt-out--93.3%
distribute-lft-out100.0%
Simplified100.0%
Taylor expanded in d1 around 0 75.8%
Taylor expanded in d3 around 0 67.4%
Final simplification69.7%
(FPCore (d1 d2 d3 d4) :precision binary64 (if (<= d2 -1.5e+148) (* d1 (+ d2 d4)) (if (<= d2 -5.8e+71) (* d1 (- d3)) (* d1 (- d4 d1)))))
double code(double d1, double d2, double d3, double d4) {
double tmp;
if (d2 <= -1.5e+148) {
tmp = d1 * (d2 + d4);
} else if (d2 <= -5.8e+71) {
tmp = d1 * -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 <= (-1.5d+148)) then
tmp = d1 * (d2 + d4)
else if (d2 <= (-5.8d+71)) then
tmp = d1 * -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 <= -1.5e+148) {
tmp = d1 * (d2 + d4);
} else if (d2 <= -5.8e+71) {
tmp = d1 * -d3;
} else {
tmp = d1 * (d4 - d1);
}
return tmp;
}
def code(d1, d2, d3, d4): tmp = 0 if d2 <= -1.5e+148: tmp = d1 * (d2 + d4) elif d2 <= -5.8e+71: tmp = d1 * -d3 else: tmp = d1 * (d4 - d1) return tmp
function code(d1, d2, d3, d4) tmp = 0.0 if (d2 <= -1.5e+148) tmp = Float64(d1 * Float64(d2 + d4)); elseif (d2 <= -5.8e+71) tmp = Float64(d1 * Float64(-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 <= -1.5e+148) tmp = d1 * (d2 + d4); elseif (d2 <= -5.8e+71) tmp = d1 * -d3; else tmp = d1 * (d4 - d1); end tmp_2 = tmp; end
code[d1_, d2_, d3_, d4_] := If[LessEqual[d2, -1.5e+148], N[(d1 * N[(d2 + d4), $MachinePrecision]), $MachinePrecision], If[LessEqual[d2, -5.8e+71], N[(d1 * (-d3)), $MachinePrecision], N[(d1 * N[(d4 - d1), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;d2 \leq -1.5 \cdot 10^{+148}:\\
\;\;\;\;d1 \cdot \left(d2 + d4\right)\\
\mathbf{elif}\;d2 \leq -5.8 \cdot 10^{+71}:\\
\;\;\;\;d1 \cdot \left(-d3\right)\\
\mathbf{else}:\\
\;\;\;\;d1 \cdot \left(d4 - d1\right)\\
\end{array}
\end{array}
if d2 < -1.50000000000000007e148Initial program 82.4%
associate--l+82.4%
distribute-lft-out--88.2%
distribute-rgt-out--88.2%
distribute-lft-out100.0%
Simplified100.0%
Taylor expanded in d1 around 0 97.1%
Taylor expanded in d3 around 0 87.2%
if -1.50000000000000007e148 < d2 < -5.80000000000000014e71Initial program 78.6%
associate--l+78.6%
distribute-lft-out--85.6%
distribute-rgt-out--85.6%
distribute-lft-out99.9%
Simplified99.9%
Taylor expanded in d3 around inf 42.3%
associate-*r*42.3%
neg-mul-142.3%
Simplified42.3%
if -5.80000000000000014e71 < d2 Initial program 87.0%
associate--l+87.0%
distribute-lft-out--88.0%
distribute-rgt-out--90.8%
distribute-lft-out100.0%
Simplified100.0%
Taylor expanded in d2 around 0 83.9%
associate--r+83.9%
Simplified83.9%
Taylor expanded in d3 around 0 58.4%
Final simplification61.4%
(FPCore (d1 d2 d3 d4) :precision binary64 (if (<= d2 -7e+111) (* d1 d2) (if (<= d2 -1e-187) (* d1 (- d1)) (* d1 d4))))
double code(double d1, double d2, double d3, double d4) {
double tmp;
if (d2 <= -7e+111) {
tmp = d1 * d2;
} else if (d2 <= -1e-187) {
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 <= (-7d+111)) then
tmp = d1 * d2
else if (d2 <= (-1d-187)) 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 <= -7e+111) {
tmp = d1 * d2;
} else if (d2 <= -1e-187) {
tmp = d1 * -d1;
} else {
tmp = d1 * d4;
}
return tmp;
}
def code(d1, d2, d3, d4): tmp = 0 if d2 <= -7e+111: tmp = d1 * d2 elif d2 <= -1e-187: tmp = d1 * -d1 else: tmp = d1 * d4 return tmp
function code(d1, d2, d3, d4) tmp = 0.0 if (d2 <= -7e+111) tmp = Float64(d1 * d2); elseif (d2 <= -1e-187) 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 <= -7e+111) tmp = d1 * d2; elseif (d2 <= -1e-187) tmp = d1 * -d1; else tmp = d1 * d4; end tmp_2 = tmp; end
code[d1_, d2_, d3_, d4_] := If[LessEqual[d2, -7e+111], N[(d1 * d2), $MachinePrecision], If[LessEqual[d2, -1e-187], N[(d1 * (-d1)), $MachinePrecision], N[(d1 * d4), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;d2 \leq -7 \cdot 10^{+111}:\\
\;\;\;\;d1 \cdot d2\\
\mathbf{elif}\;d2 \leq -1 \cdot 10^{-187}:\\
\;\;\;\;d1 \cdot \left(-d1\right)\\
\mathbf{else}:\\
\;\;\;\;d1 \cdot d4\\
\end{array}
\end{array}
if d2 < -7.0000000000000004e111Initial program 83.8%
associate--l+83.8%
distribute-lft-out--89.2%
distribute-rgt-out--89.2%
distribute-lft-out100.0%
Simplified100.0%
Taylor expanded in d2 around inf 62.6%
if -7.0000000000000004e111 < d2 < -1e-187Initial program 88.0%
associate--l+88.0%
distribute-lft-out--89.5%
distribute-rgt-out--91.0%
distribute-lft-out100.0%
Simplified100.0%
Taylor expanded in d1 around inf 49.5%
neg-mul-149.5%
Simplified49.5%
if -1e-187 < d2 Initial program 85.5%
associate--l+85.5%
distribute-lft-out--86.8%
distribute-rgt-out--90.1%
distribute-lft-out99.9%
Simplified99.9%
Taylor expanded in d4 around inf 33.7%
(FPCore (d1 d2 d3 d4) :precision binary64 (if (<= d4 620000000000.0) (* d1 (- (- d2 d1) d3)) (* d1 (- (+ d2 d4) d3))))
double code(double d1, double d2, double d3, double d4) {
double tmp;
if (d4 <= 620000000000.0) {
tmp = d1 * ((d2 - d1) - d3);
} 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 <= 620000000000.0d0) then
tmp = d1 * ((d2 - d1) - d3)
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 <= 620000000000.0) {
tmp = d1 * ((d2 - d1) - d3);
} else {
tmp = d1 * ((d2 + d4) - d3);
}
return tmp;
}
def code(d1, d2, d3, d4): tmp = 0 if d4 <= 620000000000.0: tmp = d1 * ((d2 - d1) - d3) else: tmp = d1 * ((d2 + d4) - d3) return tmp
function code(d1, d2, d3, d4) tmp = 0.0 if (d4 <= 620000000000.0) tmp = Float64(d1 * Float64(Float64(d2 - d1) - d3)); 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 <= 620000000000.0) tmp = d1 * ((d2 - d1) - d3); else tmp = d1 * ((d2 + d4) - d3); end tmp_2 = tmp; end
code[d1_, d2_, d3_, d4_] := If[LessEqual[d4, 620000000000.0], N[(d1 * N[(N[(d2 - d1), $MachinePrecision] - d3), $MachinePrecision]), $MachinePrecision], N[(d1 * N[(N[(d2 + d4), $MachinePrecision] - d3), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;d4 \leq 620000000000:\\
\;\;\;\;d1 \cdot \left(\left(d2 - d1\right) - d3\right)\\
\mathbf{else}:\\
\;\;\;\;d1 \cdot \left(\left(d2 + d4\right) - d3\right)\\
\end{array}
\end{array}
if d4 < 6.2e11Initial program 86.1%
associate--l+86.1%
distribute-lft-out--88.7%
distribute-rgt-out--89.7%
distribute-lft-out100.0%
Simplified100.0%
Taylor expanded in d4 around 0 81.1%
associate--r+81.1%
Simplified81.1%
if 6.2e11 < d4 Initial program 85.2%
associate--l+85.2%
distribute-lft-out--85.2%
distribute-rgt-out--91.8%
distribute-lft-out99.9%
Simplified99.9%
Taylor expanded in d1 around 0 91.8%
(FPCore (d1 d2 d3 d4) :precision binary64 (if (<= d4 1.8e-20) (* d1 d2) (* d1 d4)))
double code(double d1, double d2, double d3, double d4) {
double tmp;
if (d4 <= 1.8e-20) {
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 <= 1.8d-20) 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 <= 1.8e-20) {
tmp = d1 * d2;
} else {
tmp = d1 * d4;
}
return tmp;
}
def code(d1, d2, d3, d4): tmp = 0 if d4 <= 1.8e-20: tmp = d1 * d2 else: tmp = d1 * d4 return tmp
function code(d1, d2, d3, d4) tmp = 0.0 if (d4 <= 1.8e-20) 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 <= 1.8e-20) tmp = d1 * d2; else tmp = d1 * d4; end tmp_2 = tmp; end
code[d1_, d2_, d3_, d4_] := If[LessEqual[d4, 1.8e-20], N[(d1 * d2), $MachinePrecision], N[(d1 * d4), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;d4 \leq 1.8 \cdot 10^{-20}:\\
\;\;\;\;d1 \cdot d2\\
\mathbf{else}:\\
\;\;\;\;d1 \cdot d4\\
\end{array}
\end{array}
if d4 < 1.79999999999999987e-20Initial program 85.8%
associate--l+85.8%
distribute-lft-out--88.4%
distribute-rgt-out--89.4%
distribute-lft-out100.0%
Simplified100.0%
Taylor expanded in d2 around inf 29.5%
if 1.79999999999999987e-20 < d4 Initial program 86.4%
associate--l+86.4%
distribute-lft-out--86.3%
distribute-rgt-out--92.4%
distribute-lft-out100.0%
Simplified100.0%
Taylor expanded in d4 around inf 52.6%
(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 85.9%
associate--l+85.9%
distribute-lft-out--87.9%
distribute-rgt-out--90.2%
distribute-lft-out100.0%
Simplified100.0%
Taylor expanded in d2 around inf 27.3%
(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 2024100
(FPCore (d1 d2 d3 d4)
:name "FastMath dist4"
:precision binary64
:alt
(* d1 (- (+ (- d2 d3) d4) d1))
(- (+ (- (* d1 d2) (* d1 d3)) (* d4 d1)) (* d1 d1)))