
(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 14 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.6%
associate--l+90.6%
distribute-lft-out--90.6%
distribute-rgt-out--93.3%
distribute-lft-out100.0%
Simplified100.0%
(FPCore (d1 d2 d3 d4) :precision binary64 (if (<= d3 -1.3e+77) (* d1 (- d4 d3)) (if (<= d3 4.7e+112) (* d1 (- (+ d2 d4) d1)) (* d1 (- d2 d3)))))
double code(double d1, double d2, double d3, double d4) {
double tmp;
if (d3 <= -1.3e+77) {
tmp = d1 * (d4 - d3);
} else if (d3 <= 4.7e+112) {
tmp = d1 * ((d2 + d4) - d1);
} else {
tmp = d1 * (d2 - 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 (d3 <= (-1.3d+77)) then
tmp = d1 * (d4 - d3)
else if (d3 <= 4.7d+112) then
tmp = d1 * ((d2 + d4) - d1)
else
tmp = d1 * (d2 - d3)
end if
code = tmp
end function
public static double code(double d1, double d2, double d3, double d4) {
double tmp;
if (d3 <= -1.3e+77) {
tmp = d1 * (d4 - d3);
} else if (d3 <= 4.7e+112) {
tmp = d1 * ((d2 + d4) - d1);
} else {
tmp = d1 * (d2 - d3);
}
return tmp;
}
def code(d1, d2, d3, d4): tmp = 0 if d3 <= -1.3e+77: tmp = d1 * (d4 - d3) elif d3 <= 4.7e+112: tmp = d1 * ((d2 + d4) - d1) else: tmp = d1 * (d2 - d3) return tmp
function code(d1, d2, d3, d4) tmp = 0.0 if (d3 <= -1.3e+77) tmp = Float64(d1 * Float64(d4 - d3)); elseif (d3 <= 4.7e+112) tmp = Float64(d1 * Float64(Float64(d2 + d4) - d1)); else tmp = Float64(d1 * Float64(d2 - d3)); end return tmp end
function tmp_2 = code(d1, d2, d3, d4) tmp = 0.0; if (d3 <= -1.3e+77) tmp = d1 * (d4 - d3); elseif (d3 <= 4.7e+112) tmp = d1 * ((d2 + d4) - d1); else tmp = d1 * (d2 - d3); end tmp_2 = tmp; end
code[d1_, d2_, d3_, d4_] := If[LessEqual[d3, -1.3e+77], N[(d1 * N[(d4 - d3), $MachinePrecision]), $MachinePrecision], If[LessEqual[d3, 4.7e+112], N[(d1 * N[(N[(d2 + d4), $MachinePrecision] - d1), $MachinePrecision]), $MachinePrecision], N[(d1 * N[(d2 - d3), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;d3 \leq -1.3 \cdot 10^{+77}:\\
\;\;\;\;d1 \cdot \left(d4 - d3\right)\\
\mathbf{elif}\;d3 \leq 4.7 \cdot 10^{+112}:\\
\;\;\;\;d1 \cdot \left(\left(d2 + d4\right) - d1\right)\\
\mathbf{else}:\\
\;\;\;\;d1 \cdot \left(d2 - d3\right)\\
\end{array}
\end{array}
if d3 < -1.3000000000000001e77Initial program 87.8%
associate--l+87.8%
distribute-lft-out--87.7%
distribute-rgt-out--90.2%
distribute-lft-out100.0%
Simplified100.0%
Taylor expanded in d2 around 0 79.4%
associate--r+79.4%
Simplified79.4%
Taylor expanded in d1 around 0 77.1%
if -1.3000000000000001e77 < d3 < 4.69999999999999997e112Initial program 92.8%
associate--l+92.8%
distribute-lft-out--92.8%
distribute-rgt-out--95.6%
distribute-lft-out100.0%
Simplified100.0%
Taylor expanded in d3 around 0 93.6%
if 4.69999999999999997e112 < d3 Initial program 82.3%
associate--l+82.3%
distribute-lft-out--82.3%
distribute-rgt-out--85.2%
distribute-lft-out99.9%
Simplified99.9%
Taylor expanded in d4 around 0 85.9%
associate--r+85.9%
Simplified85.9%
Taylor expanded in d1 around 0 77.7%
(FPCore (d1 d2 d3 d4) :precision binary64 (if (<= d2 -6e+16) (* d1 (- d2 d3)) (if (<= d2 -7.2e-287) (* d1 (- (- d3) d1)) (* d1 (- d4 d3)))))
double code(double d1, double d2, double d3, double d4) {
double tmp;
if (d2 <= -6e+16) {
tmp = d1 * (d2 - d3);
} else if (d2 <= -7.2e-287) {
tmp = d1 * (-d3 - d1);
} 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 <= (-6d+16)) then
tmp = d1 * (d2 - d3)
else if (d2 <= (-7.2d-287)) then
tmp = d1 * (-d3 - d1)
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 <= -6e+16) {
tmp = d1 * (d2 - d3);
} else if (d2 <= -7.2e-287) {
tmp = d1 * (-d3 - d1);
} else {
tmp = d1 * (d4 - d3);
}
return tmp;
}
def code(d1, d2, d3, d4): tmp = 0 if d2 <= -6e+16: tmp = d1 * (d2 - d3) elif d2 <= -7.2e-287: tmp = d1 * (-d3 - d1) else: tmp = d1 * (d4 - d3) return tmp
function code(d1, d2, d3, d4) tmp = 0.0 if (d2 <= -6e+16) tmp = Float64(d1 * Float64(d2 - d3)); elseif (d2 <= -7.2e-287) tmp = Float64(d1 * Float64(Float64(-d3) - d1)); else tmp = Float64(d1 * Float64(d4 - d3)); end return tmp end
function tmp_2 = code(d1, d2, d3, d4) tmp = 0.0; if (d2 <= -6e+16) tmp = d1 * (d2 - d3); elseif (d2 <= -7.2e-287) tmp = d1 * (-d3 - d1); else tmp = d1 * (d4 - d3); end tmp_2 = tmp; end
code[d1_, d2_, d3_, d4_] := If[LessEqual[d2, -6e+16], N[(d1 * N[(d2 - d3), $MachinePrecision]), $MachinePrecision], If[LessEqual[d2, -7.2e-287], N[(d1 * N[((-d3) - d1), $MachinePrecision]), $MachinePrecision], N[(d1 * N[(d4 - d3), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;d2 \leq -6 \cdot 10^{+16}:\\
\;\;\;\;d1 \cdot \left(d2 - d3\right)\\
\mathbf{elif}\;d2 \leq -7.2 \cdot 10^{-287}:\\
\;\;\;\;d1 \cdot \left(\left(-d3\right) - d1\right)\\
\mathbf{else}:\\
\;\;\;\;d1 \cdot \left(d4 - d3\right)\\
\end{array}
\end{array}
if d2 < -6e16Initial program 90.0%
associate--l+90.0%
distribute-lft-out--89.9%
distribute-rgt-out--94.2%
distribute-lft-out100.0%
Simplified100.0%
Taylor expanded in d4 around 0 86.5%
associate--r+86.5%
Simplified86.5%
Taylor expanded in d1 around 0 83.0%
if -6e16 < d2 < -7.2000000000000003e-287Initial program 92.4%
associate--l+92.4%
distribute-lft-out--92.4%
distribute-rgt-out--96.2%
distribute-lft-out99.9%
Simplified99.9%
Taylor expanded in d2 around 0 94.2%
associate--r+94.2%
Simplified94.2%
Taylor expanded in d4 around 0 55.6%
associate-*r*55.6%
mul-1-neg55.6%
Simplified55.6%
if -7.2000000000000003e-287 < d2 Initial program 90.2%
associate--l+90.2%
distribute-lft-out--90.2%
distribute-rgt-out--91.7%
distribute-lft-out100.0%
Simplified100.0%
Taylor expanded in d2 around 0 73.1%
associate--r+73.1%
Simplified73.1%
Taylor expanded in d1 around 0 54.8%
Final simplification62.7%
(FPCore (d1 d2 d3 d4) :precision binary64 (if (or (<= d3 -2.4e+96) (not (<= d3 6.2e+112))) (* d1 (- d3)) (* d1 (+ d2 d4))))
double code(double d1, double d2, double d3, double d4) {
double tmp;
if ((d3 <= -2.4e+96) || !(d3 <= 6.2e+112)) {
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 <= (-2.4d+96)) .or. (.not. (d3 <= 6.2d+112))) 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 <= -2.4e+96) || !(d3 <= 6.2e+112)) {
tmp = d1 * -d3;
} else {
tmp = d1 * (d2 + d4);
}
return tmp;
}
def code(d1, d2, d3, d4): tmp = 0 if (d3 <= -2.4e+96) or not (d3 <= 6.2e+112): tmp = d1 * -d3 else: tmp = d1 * (d2 + d4) return tmp
function code(d1, d2, d3, d4) tmp = 0.0 if ((d3 <= -2.4e+96) || !(d3 <= 6.2e+112)) 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 <= -2.4e+96) || ~((d3 <= 6.2e+112))) tmp = d1 * -d3; else tmp = d1 * (d2 + d4); end tmp_2 = tmp; end
code[d1_, d2_, d3_, d4_] := If[Or[LessEqual[d3, -2.4e+96], N[Not[LessEqual[d3, 6.2e+112]], $MachinePrecision]], N[(d1 * (-d3)), $MachinePrecision], N[(d1 * N[(d2 + d4), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;d3 \leq -2.4 \cdot 10^{+96} \lor \neg \left(d3 \leq 6.2 \cdot 10^{+112}\right):\\
\;\;\;\;d1 \cdot \left(-d3\right)\\
\mathbf{else}:\\
\;\;\;\;d1 \cdot \left(d2 + d4\right)\\
\end{array}
\end{array}
if d3 < -2.39999999999999993e96 or 6.19999999999999965e112 < d3 Initial program 84.7%
associate--l+84.7%
distribute-lft-out--84.6%
distribute-rgt-out--87.4%
distribute-lft-out99.9%
Simplified99.9%
Taylor expanded in d3 around inf 71.5%
mul-1-neg71.5%
distribute-rgt-neg-out71.5%
Simplified71.5%
if -2.39999999999999993e96 < d3 < 6.19999999999999965e112Initial program 92.9%
associate--l+92.9%
distribute-lft-out--92.9%
distribute-rgt-out--95.6%
distribute-lft-out100.0%
Simplified100.0%
Taylor expanded in d3 around 0 93.2%
Taylor expanded in d1 around 0 73.0%
+-commutative73.0%
Simplified73.0%
Final simplification72.5%
(FPCore (d1 d2 d3 d4) :precision binary64 (if (<= d4 -1.15e-292) (* d1 (- d2 d1)) (if (<= d4 2.45e+57) (* d1 (- d2 d3)) (* d1 (- d4 d3)))))
double code(double d1, double d2, double d3, double d4) {
double tmp;
if (d4 <= -1.15e-292) {
tmp = d1 * (d2 - d1);
} else if (d4 <= 2.45e+57) {
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 (d4 <= (-1.15d-292)) then
tmp = d1 * (d2 - d1)
else if (d4 <= 2.45d+57) 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 (d4 <= -1.15e-292) {
tmp = d1 * (d2 - d1);
} else if (d4 <= 2.45e+57) {
tmp = d1 * (d2 - d3);
} else {
tmp = d1 * (d4 - d3);
}
return tmp;
}
def code(d1, d2, d3, d4): tmp = 0 if d4 <= -1.15e-292: tmp = d1 * (d2 - d1) elif d4 <= 2.45e+57: tmp = d1 * (d2 - d3) else: tmp = d1 * (d4 - d3) return tmp
function code(d1, d2, d3, d4) tmp = 0.0 if (d4 <= -1.15e-292) tmp = Float64(d1 * Float64(d2 - d1)); elseif (d4 <= 2.45e+57) 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 (d4 <= -1.15e-292) tmp = d1 * (d2 - d1); elseif (d4 <= 2.45e+57) tmp = d1 * (d2 - d3); else tmp = d1 * (d4 - d3); end tmp_2 = tmp; end
code[d1_, d2_, d3_, d4_] := If[LessEqual[d4, -1.15e-292], N[(d1 * N[(d2 - d1), $MachinePrecision]), $MachinePrecision], If[LessEqual[d4, 2.45e+57], N[(d1 * N[(d2 - d3), $MachinePrecision]), $MachinePrecision], N[(d1 * N[(d4 - d3), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;d4 \leq -1.15 \cdot 10^{-292}:\\
\;\;\;\;d1 \cdot \left(d2 - d1\right)\\
\mathbf{elif}\;d4 \leq 2.45 \cdot 10^{+57}:\\
\;\;\;\;d1 \cdot \left(d2 - d3\right)\\
\mathbf{else}:\\
\;\;\;\;d1 \cdot \left(d4 - d3\right)\\
\end{array}
\end{array}
if d4 < -1.1499999999999999e-292Initial program 88.9%
associate--l+88.9%
distribute-lft-out--88.9%
distribute-rgt-out--92.8%
distribute-lft-out100.0%
Simplified100.0%
Taylor expanded in d3 around 0 83.3%
Taylor expanded in d4 around 0 57.3%
if -1.1499999999999999e-292 < d4 < 2.45e57Initial program 92.4%
associate--l+92.4%
distribute-lft-out--92.3%
distribute-rgt-out--92.3%
distribute-lft-out99.9%
Simplified99.9%
Taylor expanded in d4 around 0 97.0%
associate--r+97.0%
Simplified97.0%
Taylor expanded in d1 around 0 77.7%
if 2.45e57 < d4 Initial program 92.1%
associate--l+92.1%
distribute-lft-out--92.1%
distribute-rgt-out--96.0%
distribute-lft-out100.0%
Simplified100.0%
Taylor expanded in d2 around 0 83.1%
associate--r+83.1%
Simplified83.1%
Taylor expanded in d1 around 0 77.2%
(FPCore (d1 d2 d3 d4) :precision binary64 (if (<= d4 -2.4e-292) (* d1 (- d2 d1)) (if (<= d4 1.36e+56) (* d1 (- d2 d3)) (* d1 (- d4 d1)))))
double code(double d1, double d2, double d3, double d4) {
double tmp;
if (d4 <= -2.4e-292) {
tmp = d1 * (d2 - d1);
} else if (d4 <= 1.36e+56) {
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 (d4 <= (-2.4d-292)) then
tmp = d1 * (d2 - d1)
else if (d4 <= 1.36d+56) 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 (d4 <= -2.4e-292) {
tmp = d1 * (d2 - d1);
} else if (d4 <= 1.36e+56) {
tmp = d1 * (d2 - d3);
} else {
tmp = d1 * (d4 - d1);
}
return tmp;
}
def code(d1, d2, d3, d4): tmp = 0 if d4 <= -2.4e-292: tmp = d1 * (d2 - d1) elif d4 <= 1.36e+56: tmp = d1 * (d2 - d3) else: tmp = d1 * (d4 - d1) return tmp
function code(d1, d2, d3, d4) tmp = 0.0 if (d4 <= -2.4e-292) tmp = Float64(d1 * Float64(d2 - d1)); elseif (d4 <= 1.36e+56) 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 (d4 <= -2.4e-292) tmp = d1 * (d2 - d1); elseif (d4 <= 1.36e+56) tmp = d1 * (d2 - d3); else tmp = d1 * (d4 - d1); end tmp_2 = tmp; end
code[d1_, d2_, d3_, d4_] := If[LessEqual[d4, -2.4e-292], N[(d1 * N[(d2 - d1), $MachinePrecision]), $MachinePrecision], If[LessEqual[d4, 1.36e+56], N[(d1 * N[(d2 - d3), $MachinePrecision]), $MachinePrecision], N[(d1 * N[(d4 - d1), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;d4 \leq -2.4 \cdot 10^{-292}:\\
\;\;\;\;d1 \cdot \left(d2 - d1\right)\\
\mathbf{elif}\;d4 \leq 1.36 \cdot 10^{+56}:\\
\;\;\;\;d1 \cdot \left(d2 - d3\right)\\
\mathbf{else}:\\
\;\;\;\;d1 \cdot \left(d4 - d1\right)\\
\end{array}
\end{array}
if d4 < -2.4000000000000001e-292Initial program 88.9%
associate--l+88.9%
distribute-lft-out--88.9%
distribute-rgt-out--92.8%
distribute-lft-out100.0%
Simplified100.0%
Taylor expanded in d3 around 0 83.3%
Taylor expanded in d4 around 0 57.3%
if -2.4000000000000001e-292 < d4 < 1.3599999999999999e56Initial program 92.3%
associate--l+92.3%
distribute-lft-out--92.2%
distribute-rgt-out--92.2%
distribute-lft-out99.9%
Simplified99.9%
Taylor expanded in d4 around 0 97.0%
associate--r+97.0%
Simplified97.0%
Taylor expanded in d1 around 0 78.7%
if 1.3599999999999999e56 < d4 Initial program 92.2%
associate--l+92.2%
distribute-lft-out--92.2%
distribute-rgt-out--96.1%
distribute-lft-out100.0%
Simplified100.0%
Taylor expanded in d2 around 0 83.4%
associate--r+83.4%
Simplified83.4%
Taylor expanded in d3 around 0 66.5%
(FPCore (d1 d2 d3 d4) :precision binary64 (if (<= d4 -1.65e-292) (* d1 (- d2 d1)) (if (<= d4 4.4e+45) (* d1 (- d2 d3)) (* d1 (+ d2 d4)))))
double code(double d1, double d2, double d3, double d4) {
double tmp;
if (d4 <= -1.65e-292) {
tmp = d1 * (d2 - d1);
} else if (d4 <= 4.4e+45) {
tmp = d1 * (d2 - 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 (d4 <= (-1.65d-292)) then
tmp = d1 * (d2 - d1)
else if (d4 <= 4.4d+45) then
tmp = d1 * (d2 - 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 (d4 <= -1.65e-292) {
tmp = d1 * (d2 - d1);
} else if (d4 <= 4.4e+45) {
tmp = d1 * (d2 - d3);
} else {
tmp = d1 * (d2 + d4);
}
return tmp;
}
def code(d1, d2, d3, d4): tmp = 0 if d4 <= -1.65e-292: tmp = d1 * (d2 - d1) elif d4 <= 4.4e+45: tmp = d1 * (d2 - d3) else: tmp = d1 * (d2 + d4) return tmp
function code(d1, d2, d3, d4) tmp = 0.0 if (d4 <= -1.65e-292) tmp = Float64(d1 * Float64(d2 - d1)); elseif (d4 <= 4.4e+45) tmp = Float64(d1 * Float64(d2 - d3)); else tmp = Float64(d1 * Float64(d2 + d4)); end return tmp end
function tmp_2 = code(d1, d2, d3, d4) tmp = 0.0; if (d4 <= -1.65e-292) tmp = d1 * (d2 - d1); elseif (d4 <= 4.4e+45) tmp = d1 * (d2 - d3); else tmp = d1 * (d2 + d4); end tmp_2 = tmp; end
code[d1_, d2_, d3_, d4_] := If[LessEqual[d4, -1.65e-292], N[(d1 * N[(d2 - d1), $MachinePrecision]), $MachinePrecision], If[LessEqual[d4, 4.4e+45], N[(d1 * N[(d2 - d3), $MachinePrecision]), $MachinePrecision], N[(d1 * N[(d2 + d4), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;d4 \leq -1.65 \cdot 10^{-292}:\\
\;\;\;\;d1 \cdot \left(d2 - d1\right)\\
\mathbf{elif}\;d4 \leq 4.4 \cdot 10^{+45}:\\
\;\;\;\;d1 \cdot \left(d2 - d3\right)\\
\mathbf{else}:\\
\;\;\;\;d1 \cdot \left(d2 + d4\right)\\
\end{array}
\end{array}
if d4 < -1.64999999999999997e-292Initial program 88.9%
associate--l+88.9%
distribute-lft-out--88.9%
distribute-rgt-out--92.8%
distribute-lft-out100.0%
Simplified100.0%
Taylor expanded in d3 around 0 83.3%
Taylor expanded in d4 around 0 57.3%
if -1.64999999999999997e-292 < d4 < 4.4000000000000001e45Initial program 92.3%
associate--l+92.3%
distribute-lft-out--92.2%
distribute-rgt-out--92.2%
distribute-lft-out99.9%
Simplified99.9%
Taylor expanded in d4 around 0 97.0%
associate--r+97.0%
Simplified97.0%
Taylor expanded in d1 around 0 78.7%
if 4.4000000000000001e45 < d4 Initial program 92.2%
associate--l+92.2%
distribute-lft-out--92.2%
distribute-rgt-out--96.1%
distribute-lft-out100.0%
Simplified100.0%
Taylor expanded in d3 around 0 83.1%
Taylor expanded in d1 around 0 76.0%
+-commutative76.0%
Simplified76.0%
Final simplification67.6%
(FPCore (d1 d2 d3 d4) :precision binary64 (if (<= d4 2.3e-253) (* d1 d2) (if (<= d4 2.1e+57) (* d1 (- d3)) (* d1 d4))))
double code(double d1, double d2, double d3, double d4) {
double tmp;
if (d4 <= 2.3e-253) {
tmp = d1 * d2;
} else if (d4 <= 2.1e+57) {
tmp = d1 * -d3;
} 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 <= 2.3d-253) then
tmp = d1 * d2
else if (d4 <= 2.1d+57) then
tmp = d1 * -d3
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 <= 2.3e-253) {
tmp = d1 * d2;
} else if (d4 <= 2.1e+57) {
tmp = d1 * -d3;
} else {
tmp = d1 * d4;
}
return tmp;
}
def code(d1, d2, d3, d4): tmp = 0 if d4 <= 2.3e-253: tmp = d1 * d2 elif d4 <= 2.1e+57: tmp = d1 * -d3 else: tmp = d1 * d4 return tmp
function code(d1, d2, d3, d4) tmp = 0.0 if (d4 <= 2.3e-253) tmp = Float64(d1 * d2); elseif (d4 <= 2.1e+57) tmp = Float64(d1 * Float64(-d3)); else tmp = Float64(d1 * d4); end return tmp end
function tmp_2 = code(d1, d2, d3, d4) tmp = 0.0; if (d4 <= 2.3e-253) tmp = d1 * d2; elseif (d4 <= 2.1e+57) tmp = d1 * -d3; else tmp = d1 * d4; end tmp_2 = tmp; end
code[d1_, d2_, d3_, d4_] := If[LessEqual[d4, 2.3e-253], N[(d1 * d2), $MachinePrecision], If[LessEqual[d4, 2.1e+57], N[(d1 * (-d3)), $MachinePrecision], N[(d1 * d4), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;d4 \leq 2.3 \cdot 10^{-253}:\\
\;\;\;\;d1 \cdot d2\\
\mathbf{elif}\;d4 \leq 2.1 \cdot 10^{+57}:\\
\;\;\;\;d1 \cdot \left(-d3\right)\\
\mathbf{else}:\\
\;\;\;\;d1 \cdot d4\\
\end{array}
\end{array}
if d4 < 2.3e-253Initial program 88.5%
associate--l+88.5%
distribute-lft-out--88.5%
distribute-rgt-out--92.1%
distribute-lft-out100.0%
Simplified100.0%
Taylor expanded in d2 around inf 36.0%
if 2.3e-253 < d4 < 2.09999999999999991e57Initial program 93.9%
associate--l+93.9%
distribute-lft-out--93.9%
distribute-rgt-out--93.9%
distribute-lft-out99.9%
Simplified99.9%
Taylor expanded in d3 around inf 33.4%
mul-1-neg33.4%
distribute-rgt-neg-out33.4%
Simplified33.4%
if 2.09999999999999991e57 < d4 Initial program 92.1%
associate--l+92.1%
distribute-lft-out--92.1%
distribute-rgt-out--96.0%
distribute-lft-out100.0%
Simplified100.0%
Taylor expanded in d4 around inf 60.6%
(FPCore (d1 d2 d3 d4) :precision binary64 (if (<= d2 -1.4e+64) (* d1 d2) (if (<= d2 -8.5e-288) (* d1 (- d1)) (* d1 d4))))
double code(double d1, double d2, double d3, double d4) {
double tmp;
if (d2 <= -1.4e+64) {
tmp = d1 * d2;
} else if (d2 <= -8.5e-288) {
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 <= (-1.4d+64)) then
tmp = d1 * d2
else if (d2 <= (-8.5d-288)) 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 <= -1.4e+64) {
tmp = d1 * d2;
} else if (d2 <= -8.5e-288) {
tmp = d1 * -d1;
} else {
tmp = d1 * d4;
}
return tmp;
}
def code(d1, d2, d3, d4): tmp = 0 if d2 <= -1.4e+64: tmp = d1 * d2 elif d2 <= -8.5e-288: tmp = d1 * -d1 else: tmp = d1 * d4 return tmp
function code(d1, d2, d3, d4) tmp = 0.0 if (d2 <= -1.4e+64) tmp = Float64(d1 * d2); elseif (d2 <= -8.5e-288) 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 <= -1.4e+64) tmp = d1 * d2; elseif (d2 <= -8.5e-288) tmp = d1 * -d1; else tmp = d1 * d4; end tmp_2 = tmp; end
code[d1_, d2_, d3_, d4_] := If[LessEqual[d2, -1.4e+64], N[(d1 * d2), $MachinePrecision], If[LessEqual[d2, -8.5e-288], N[(d1 * (-d1)), $MachinePrecision], N[(d1 * d4), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;d2 \leq -1.4 \cdot 10^{+64}:\\
\;\;\;\;d1 \cdot d2\\
\mathbf{elif}\;d2 \leq -8.5 \cdot 10^{-288}:\\
\;\;\;\;d1 \cdot \left(-d1\right)\\
\mathbf{else}:\\
\;\;\;\;d1 \cdot d4\\
\end{array}
\end{array}
if d2 < -1.40000000000000012e64Initial program 89.4%
associate--l+89.4%
distribute-lft-out--89.4%
distribute-rgt-out--92.9%
distribute-lft-out100.0%
Simplified100.0%
Taylor expanded in d2 around inf 79.0%
if -1.40000000000000012e64 < d2 < -8.4999999999999997e-288Initial program 92.3%
associate--l+92.3%
distribute-lft-out--92.4%
distribute-rgt-out--96.9%
distribute-lft-out99.9%
Simplified99.9%
Taylor expanded in d1 around inf 30.1%
neg-mul-130.1%
Simplified30.1%
if -8.4999999999999997e-288 < d2 Initial program 90.2%
associate--l+90.2%
distribute-lft-out--90.2%
distribute-rgt-out--91.7%
distribute-lft-out100.0%
Simplified100.0%
Taylor expanded in d4 around inf 31.4%
(FPCore (d1 d2 d3 d4) :precision binary64 (if (<= d4 3.5e+57) (* d1 (- (- d2 d1) d3)) (* d1 (- (- d4 d1) d3))))
double code(double d1, double d2, double d3, double d4) {
double tmp;
if (d4 <= 3.5e+57) {
tmp = d1 * ((d2 - d1) - 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 (d4 <= 3.5d+57) then
tmp = d1 * ((d2 - d1) - 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 (d4 <= 3.5e+57) {
tmp = d1 * ((d2 - d1) - d3);
} else {
tmp = d1 * ((d4 - d1) - d3);
}
return tmp;
}
def code(d1, d2, d3, d4): tmp = 0 if d4 <= 3.5e+57: tmp = d1 * ((d2 - d1) - d3) else: tmp = d1 * ((d4 - d1) - d3) return tmp
function code(d1, d2, d3, d4) tmp = 0.0 if (d4 <= 3.5e+57) tmp = Float64(d1 * Float64(Float64(d2 - d1) - d3)); else tmp = Float64(d1 * Float64(Float64(d4 - d1) - d3)); end return tmp end
function tmp_2 = code(d1, d2, d3, d4) tmp = 0.0; if (d4 <= 3.5e+57) tmp = d1 * ((d2 - d1) - d3); else tmp = d1 * ((d4 - d1) - d3); end tmp_2 = tmp; end
code[d1_, d2_, d3_, d4_] := If[LessEqual[d4, 3.5e+57], N[(d1 * N[(N[(d2 - d1), $MachinePrecision] - d3), $MachinePrecision]), $MachinePrecision], N[(d1 * N[(N[(d4 - d1), $MachinePrecision] - d3), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;d4 \leq 3.5 \cdot 10^{+57}:\\
\;\;\;\;d1 \cdot \left(\left(d2 - d1\right) - d3\right)\\
\mathbf{else}:\\
\;\;\;\;d1 \cdot \left(\left(d4 - d1\right) - d3\right)\\
\end{array}
\end{array}
if d4 < 3.4999999999999997e57Initial program 90.2%
associate--l+90.2%
distribute-lft-out--90.2%
distribute-rgt-out--92.6%
distribute-lft-out99.9%
Simplified99.9%
Taylor expanded in d4 around 0 81.9%
associate--r+81.9%
Simplified81.9%
if 3.4999999999999997e57 < d4 Initial program 92.1%
associate--l+92.1%
distribute-lft-out--92.1%
distribute-rgt-out--96.0%
distribute-lft-out100.0%
Simplified100.0%
Taylor expanded in d2 around 0 83.1%
associate--r+83.1%
Simplified83.1%
(FPCore (d1 d2 d3 d4) :precision binary64 (if (<= d4 1.45e+24) (* d1 (- (- d2 d1) d3)) (* d1 (- (+ d2 d4) d1))))
double code(double d1, double d2, double d3, double d4) {
double tmp;
if (d4 <= 1.45e+24) {
tmp = d1 * ((d2 - d1) - 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 (d4 <= 1.45d+24) then
tmp = d1 * ((d2 - d1) - 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 (d4 <= 1.45e+24) {
tmp = d1 * ((d2 - d1) - d3);
} else {
tmp = d1 * ((d2 + d4) - d1);
}
return tmp;
}
def code(d1, d2, d3, d4): tmp = 0 if d4 <= 1.45e+24: tmp = d1 * ((d2 - d1) - d3) else: tmp = d1 * ((d2 + d4) - d1) return tmp
function code(d1, d2, d3, d4) tmp = 0.0 if (d4 <= 1.45e+24) tmp = Float64(d1 * Float64(Float64(d2 - d1) - 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 (d4 <= 1.45e+24) tmp = d1 * ((d2 - d1) - d3); else tmp = d1 * ((d2 + d4) - d1); end tmp_2 = tmp; end
code[d1_, d2_, d3_, d4_] := If[LessEqual[d4, 1.45e+24], N[(d1 * N[(N[(d2 - d1), $MachinePrecision] - d3), $MachinePrecision]), $MachinePrecision], N[(d1 * N[(N[(d2 + d4), $MachinePrecision] - d1), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;d4 \leq 1.45 \cdot 10^{+24}:\\
\;\;\;\;d1 \cdot \left(\left(d2 - d1\right) - d3\right)\\
\mathbf{else}:\\
\;\;\;\;d1 \cdot \left(\left(d2 + d4\right) - d1\right)\\
\end{array}
\end{array}
if d4 < 1.4499999999999999e24Initial program 90.0%
associate--l+90.0%
distribute-lft-out--90.0%
distribute-rgt-out--92.5%
distribute-lft-out99.9%
Simplified99.9%
Taylor expanded in d4 around 0 81.8%
associate--r+81.8%
Simplified81.8%
if 1.4499999999999999e24 < d4 Initial program 92.7%
associate--l+92.7%
distribute-lft-out--92.7%
distribute-rgt-out--96.3%
distribute-lft-out100.0%
Simplified100.0%
Taylor expanded in d3 around 0 84.0%
(FPCore (d1 d2 d3 d4) :precision binary64 (if (<= d4 1.3e-18) (* d1 (- d2 d1)) (* d1 (+ d2 d4))))
double code(double d1, double d2, double d3, double d4) {
double tmp;
if (d4 <= 1.3e-18) {
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 <= 1.3d-18) 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 <= 1.3e-18) {
tmp = d1 * (d2 - d1);
} else {
tmp = d1 * (d2 + d4);
}
return tmp;
}
def code(d1, d2, d3, d4): tmp = 0 if d4 <= 1.3e-18: tmp = d1 * (d2 - d1) else: tmp = d1 * (d2 + d4) return tmp
function code(d1, d2, d3, d4) tmp = 0.0 if (d4 <= 1.3e-18) 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 <= 1.3e-18) tmp = d1 * (d2 - d1); else tmp = d1 * (d2 + d4); end tmp_2 = tmp; end
code[d1_, d2_, d3_, d4_] := If[LessEqual[d4, 1.3e-18], N[(d1 * N[(d2 - d1), $MachinePrecision]), $MachinePrecision], N[(d1 * N[(d2 + d4), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;d4 \leq 1.3 \cdot 10^{-18}:\\
\;\;\;\;d1 \cdot \left(d2 - d1\right)\\
\mathbf{else}:\\
\;\;\;\;d1 \cdot \left(d2 + d4\right)\\
\end{array}
\end{array}
if d4 < 1.3e-18Initial program 89.5%
associate--l+89.5%
distribute-lft-out--89.5%
distribute-rgt-out--92.1%
distribute-lft-out100.0%
Simplified100.0%
Taylor expanded in d3 around 0 77.4%
Taylor expanded in d4 around 0 60.3%
if 1.3e-18 < d4 Initial program 93.7%
associate--l+93.7%
distribute-lft-out--93.7%
distribute-rgt-out--96.8%
distribute-lft-out100.0%
Simplified100.0%
Taylor expanded in d3 around 0 83.1%
Taylor expanded in d1 around 0 75.9%
+-commutative75.9%
Simplified75.9%
Final simplification64.2%
(FPCore (d1 d2 d3 d4) :precision binary64 (if (<= d4 8.6e+55) (* d1 d2) (* d1 d4)))
double code(double d1, double d2, double d3, double d4) {
double tmp;
if (d4 <= 8.6e+55) {
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 <= 8.6d+55) 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 <= 8.6e+55) {
tmp = d1 * d2;
} else {
tmp = d1 * d4;
}
return tmp;
}
def code(d1, d2, d3, d4): tmp = 0 if d4 <= 8.6e+55: tmp = d1 * d2 else: tmp = d1 * d4 return tmp
function code(d1, d2, d3, d4) tmp = 0.0 if (d4 <= 8.6e+55) 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 <= 8.6e+55) tmp = d1 * d2; else tmp = d1 * d4; end tmp_2 = tmp; end
code[d1_, d2_, d3_, d4_] := If[LessEqual[d4, 8.6e+55], N[(d1 * d2), $MachinePrecision], N[(d1 * d4), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;d4 \leq 8.6 \cdot 10^{+55}:\\
\;\;\;\;d1 \cdot d2\\
\mathbf{else}:\\
\;\;\;\;d1 \cdot d4\\
\end{array}
\end{array}
if d4 < 8.5999999999999998e55Initial program 90.2%
associate--l+90.2%
distribute-lft-out--90.2%
distribute-rgt-out--92.6%
distribute-lft-out99.9%
Simplified99.9%
Taylor expanded in d2 around inf 39.6%
if 8.5999999999999998e55 < d4 Initial program 92.2%
associate--l+92.2%
distribute-lft-out--92.2%
distribute-rgt-out--96.1%
distribute-lft-out100.0%
Simplified100.0%
Taylor expanded in d4 around inf 59.4%
(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.6%
associate--l+90.6%
distribute-lft-out--90.6%
distribute-rgt-out--93.3%
distribute-lft-out100.0%
Simplified100.0%
Taylor expanded in d2 around inf 36.4%
(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 2024145
(FPCore (d1 d2 d3 d4)
:name "FastMath dist4"
:precision binary64
:alt
(! :herbie-platform default (* d1 (- (+ (- d2 d3) d4) d1)))
(- (+ (- (* d1 d2) (* d1 d3)) (* d4 d1)) (* d1 d1)))