
(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 86.3%
associate--l+86.3%
distribute-lft-out--87.1%
distribute-rgt-out--91.4%
distribute-lft-out100.0%
Simplified100.0%
Final simplification100.0%
(FPCore (d1 d2 d3 d4)
:precision binary64
(if (<= d4 2.1e-185)
(* d1 d2)
(if (<= d4 7800000000000.0)
(* d1 (- d1))
(if (<= d4 1.15e+44)
(* d1 (- d3))
(if (<= d4 4.6e+163) (* d1 d2) (* d1 d4))))))
double code(double d1, double d2, double d3, double d4) {
double tmp;
if (d4 <= 2.1e-185) {
tmp = d1 * d2;
} else if (d4 <= 7800000000000.0) {
tmp = d1 * -d1;
} else if (d4 <= 1.15e+44) {
tmp = d1 * -d3;
} else if (d4 <= 4.6e+163) {
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 <= 2.1d-185) then
tmp = d1 * d2
else if (d4 <= 7800000000000.0d0) then
tmp = d1 * -d1
else if (d4 <= 1.15d+44) then
tmp = d1 * -d3
else if (d4 <= 4.6d+163) 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 <= 2.1e-185) {
tmp = d1 * d2;
} else if (d4 <= 7800000000000.0) {
tmp = d1 * -d1;
} else if (d4 <= 1.15e+44) {
tmp = d1 * -d3;
} else if (d4 <= 4.6e+163) {
tmp = d1 * d2;
} else {
tmp = d1 * d4;
}
return tmp;
}
def code(d1, d2, d3, d4): tmp = 0 if d4 <= 2.1e-185: tmp = d1 * d2 elif d4 <= 7800000000000.0: tmp = d1 * -d1 elif d4 <= 1.15e+44: tmp = d1 * -d3 elif d4 <= 4.6e+163: tmp = d1 * d2 else: tmp = d1 * d4 return tmp
function code(d1, d2, d3, d4) tmp = 0.0 if (d4 <= 2.1e-185) tmp = Float64(d1 * d2); elseif (d4 <= 7800000000000.0) tmp = Float64(d1 * Float64(-d1)); elseif (d4 <= 1.15e+44) tmp = Float64(d1 * Float64(-d3)); elseif (d4 <= 4.6e+163) 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 <= 2.1e-185) tmp = d1 * d2; elseif (d4 <= 7800000000000.0) tmp = d1 * -d1; elseif (d4 <= 1.15e+44) tmp = d1 * -d3; elseif (d4 <= 4.6e+163) tmp = d1 * d2; else tmp = d1 * d4; end tmp_2 = tmp; end
code[d1_, d2_, d3_, d4_] := If[LessEqual[d4, 2.1e-185], N[(d1 * d2), $MachinePrecision], If[LessEqual[d4, 7800000000000.0], N[(d1 * (-d1)), $MachinePrecision], If[LessEqual[d4, 1.15e+44], N[(d1 * (-d3)), $MachinePrecision], If[LessEqual[d4, 4.6e+163], N[(d1 * d2), $MachinePrecision], N[(d1 * d4), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;d4 \leq 2.1 \cdot 10^{-185}:\\
\;\;\;\;d1 \cdot d2\\
\mathbf{elif}\;d4 \leq 7800000000000:\\
\;\;\;\;d1 \cdot \left(-d1\right)\\
\mathbf{elif}\;d4 \leq 1.15 \cdot 10^{+44}:\\
\;\;\;\;d1 \cdot \left(-d3\right)\\
\mathbf{elif}\;d4 \leq 4.6 \cdot 10^{+163}:\\
\;\;\;\;d1 \cdot d2\\
\mathbf{else}:\\
\;\;\;\;d1 \cdot d4\\
\end{array}
\end{array}
if d4 < 2.1e-185 or 1.15000000000000002e44 < d4 < 4.60000000000000003e163Initial program 86.7%
associate--l+86.7%
distribute-lft-out--87.2%
distribute-rgt-out--91.9%
distribute-lft-out100.0%
Simplified100.0%
Taylor expanded in d2 around inf 38.7%
if 2.1e-185 < d4 < 7.8e12Initial program 88.1%
associate--l+88.1%
distribute-lft-out--90.5%
distribute-rgt-out--90.5%
distribute-lft-out100.0%
Simplified100.0%
Taylor expanded in d4 around 0 93.4%
+-commutative93.4%
associate--r+93.4%
Simplified93.4%
Taylor expanded in d2 around inf 86.4%
mul-1-neg86.4%
unsub-neg86.4%
Simplified86.4%
Taylor expanded in d1 around inf 50.9%
mul-1-neg50.9%
Simplified50.9%
if 7.8e12 < d4 < 1.15000000000000002e44Initial program 75.0%
associate--l+75.0%
distribute-lft-out--75.0%
distribute-rgt-out--91.7%
distribute-lft-out100.0%
Simplified100.0%
Taylor expanded in d3 around inf 43.4%
associate-*r*43.4%
neg-mul-143.4%
Simplified43.4%
if 4.60000000000000003e163 < d4 Initial program 86.2%
associate--l+86.2%
distribute-lft-out--86.2%
distribute-rgt-out--89.7%
distribute-lft-out100.0%
Simplified100.0%
Taylor expanded in d4 around inf 73.4%
Final simplification44.9%
(FPCore (d1 d2 d3 d4)
:precision binary64
(if (<= d4 2.35e-267)
(* d1 (- d2 d3))
(if (<= d4 2.35e-132)
(* d1 (- d2 d1))
(if (<= d4 2.6e+44) (* d1 (- (- d1) d3)) (* d1 (+ d2 d4))))))
double code(double d1, double d2, double d3, double d4) {
double tmp;
if (d4 <= 2.35e-267) {
tmp = d1 * (d2 - d3);
} else if (d4 <= 2.35e-132) {
tmp = d1 * (d2 - d1);
} else if (d4 <= 2.6e+44) {
tmp = d1 * (-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 (d4 <= 2.35d-267) then
tmp = d1 * (d2 - d3)
else if (d4 <= 2.35d-132) then
tmp = d1 * (d2 - d1)
else if (d4 <= 2.6d+44) then
tmp = d1 * (-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 (d4 <= 2.35e-267) {
tmp = d1 * (d2 - d3);
} else if (d4 <= 2.35e-132) {
tmp = d1 * (d2 - d1);
} else if (d4 <= 2.6e+44) {
tmp = d1 * (-d1 - d3);
} else {
tmp = d1 * (d2 + d4);
}
return tmp;
}
def code(d1, d2, d3, d4): tmp = 0 if d4 <= 2.35e-267: tmp = d1 * (d2 - d3) elif d4 <= 2.35e-132: tmp = d1 * (d2 - d1) elif d4 <= 2.6e+44: tmp = d1 * (-d1 - d3) else: tmp = d1 * (d2 + d4) return tmp
function code(d1, d2, d3, d4) tmp = 0.0 if (d4 <= 2.35e-267) tmp = Float64(d1 * Float64(d2 - d3)); elseif (d4 <= 2.35e-132) tmp = Float64(d1 * Float64(d2 - d1)); elseif (d4 <= 2.6e+44) tmp = Float64(d1 * Float64(Float64(-d1) - 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 <= 2.35e-267) tmp = d1 * (d2 - d3); elseif (d4 <= 2.35e-132) tmp = d1 * (d2 - d1); elseif (d4 <= 2.6e+44) tmp = d1 * (-d1 - d3); else tmp = d1 * (d2 + d4); end tmp_2 = tmp; end
code[d1_, d2_, d3_, d4_] := If[LessEqual[d4, 2.35e-267], N[(d1 * N[(d2 - d3), $MachinePrecision]), $MachinePrecision], If[LessEqual[d4, 2.35e-132], N[(d1 * N[(d2 - d1), $MachinePrecision]), $MachinePrecision], If[LessEqual[d4, 2.6e+44], N[(d1 * N[((-d1) - d3), $MachinePrecision]), $MachinePrecision], N[(d1 * N[(d2 + d4), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;d4 \leq 2.35 \cdot 10^{-267}:\\
\;\;\;\;d1 \cdot \left(d2 - d3\right)\\
\mathbf{elif}\;d4 \leq 2.35 \cdot 10^{-132}:\\
\;\;\;\;d1 \cdot \left(d2 - d1\right)\\
\mathbf{elif}\;d4 \leq 2.6 \cdot 10^{+44}:\\
\;\;\;\;d1 \cdot \left(\left(-d1\right) - d3\right)\\
\mathbf{else}:\\
\;\;\;\;d1 \cdot \left(d2 + d4\right)\\
\end{array}
\end{array}
if d4 < 2.3500000000000001e-267Initial program 84.2%
associate--l+84.2%
distribute-lft-out--85.0%
distribute-rgt-out--89.7%
distribute-lft-out100.0%
Simplified100.0%
Taylor expanded in d4 around 0 76.0%
+-commutative76.0%
associate--r+76.0%
Simplified76.0%
Taylor expanded in d1 around 0 58.5%
if 2.3500000000000001e-267 < d4 < 2.3500000000000001e-132Initial program 94.1%
associate--l+94.1%
distribute-lft-out--94.1%
distribute-rgt-out--94.1%
distribute-lft-out100.0%
Simplified100.0%
Taylor expanded in d4 around 0 100.0%
+-commutative100.0%
associate--r+100.0%
Simplified100.0%
Taylor expanded in d3 around 0 85.5%
if 2.3500000000000001e-132 < d4 < 2.5999999999999999e44Initial program 85.7%
associate--l+85.7%
distribute-lft-out--88.1%
distribute-rgt-out--92.9%
distribute-lft-out100.0%
Simplified100.0%
Taylor expanded in d4 around 0 93.4%
+-commutative93.4%
associate--r+93.4%
Simplified93.4%
Taylor expanded in d2 around 0 73.4%
associate-*r*73.4%
neg-mul-173.4%
Simplified73.4%
if 2.5999999999999999e44 < d4 Initial program 86.8%
Taylor expanded in d3 around 0 74.3%
distribute-lft-out76.2%
Simplified76.2%
distribute-lft-out--83.7%
*-commutative83.7%
associate--l+83.7%
Applied egg-rr83.7%
Taylor expanded in d1 around 0 75.9%
+-commutative75.9%
Simplified75.9%
Final simplification68.1%
(FPCore (d1 d2 d3 d4)
:precision binary64
(let* ((t_0 (* d1 (- d2 d1))))
(if (<= d4 7800000000000.0)
t_0
(if (<= d4 1.22e+39)
(* d1 (- d3))
(if (<= d4 5.2e+43) t_0 (* d1 (+ d2 d4)))))))
double code(double d1, double d2, double d3, double d4) {
double t_0 = d1 * (d2 - d1);
double tmp;
if (d4 <= 7800000000000.0) {
tmp = t_0;
} else if (d4 <= 1.22e+39) {
tmp = d1 * -d3;
} else if (d4 <= 5.2e+43) {
tmp = t_0;
} else {
tmp = d1 * (d2 + d4);
}
return tmp;
}
real(8) function code(d1, d2, d3, d4)
real(8), intent (in) :: d1
real(8), intent (in) :: d2
real(8), intent (in) :: d3
real(8), intent (in) :: d4
real(8) :: t_0
real(8) :: tmp
t_0 = d1 * (d2 - d1)
if (d4 <= 7800000000000.0d0) then
tmp = t_0
else if (d4 <= 1.22d+39) then
tmp = d1 * -d3
else if (d4 <= 5.2d+43) then
tmp = t_0
else
tmp = d1 * (d2 + d4)
end if
code = tmp
end function
public static double code(double d1, double d2, double d3, double d4) {
double t_0 = d1 * (d2 - d1);
double tmp;
if (d4 <= 7800000000000.0) {
tmp = t_0;
} else if (d4 <= 1.22e+39) {
tmp = d1 * -d3;
} else if (d4 <= 5.2e+43) {
tmp = t_0;
} else {
tmp = d1 * (d2 + d4);
}
return tmp;
}
def code(d1, d2, d3, d4): t_0 = d1 * (d2 - d1) tmp = 0 if d4 <= 7800000000000.0: tmp = t_0 elif d4 <= 1.22e+39: tmp = d1 * -d3 elif d4 <= 5.2e+43: tmp = t_0 else: tmp = d1 * (d2 + d4) return tmp
function code(d1, d2, d3, d4) t_0 = Float64(d1 * Float64(d2 - d1)) tmp = 0.0 if (d4 <= 7800000000000.0) tmp = t_0; elseif (d4 <= 1.22e+39) tmp = Float64(d1 * Float64(-d3)); elseif (d4 <= 5.2e+43) tmp = t_0; else tmp = Float64(d1 * Float64(d2 + d4)); end return tmp end
function tmp_2 = code(d1, d2, d3, d4) t_0 = d1 * (d2 - d1); tmp = 0.0; if (d4 <= 7800000000000.0) tmp = t_0; elseif (d4 <= 1.22e+39) tmp = d1 * -d3; elseif (d4 <= 5.2e+43) tmp = t_0; else tmp = d1 * (d2 + d4); end tmp_2 = tmp; end
code[d1_, d2_, d3_, d4_] := Block[{t$95$0 = N[(d1 * N[(d2 - d1), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[d4, 7800000000000.0], t$95$0, If[LessEqual[d4, 1.22e+39], N[(d1 * (-d3)), $MachinePrecision], If[LessEqual[d4, 5.2e+43], t$95$0, N[(d1 * N[(d2 + d4), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := d1 \cdot \left(d2 - d1\right)\\
\mathbf{if}\;d4 \leq 7800000000000:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;d4 \leq 1.22 \cdot 10^{+39}:\\
\;\;\;\;d1 \cdot \left(-d3\right)\\
\mathbf{elif}\;d4 \leq 5.2 \cdot 10^{+43}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;d1 \cdot \left(d2 + d4\right)\\
\end{array}
\end{array}
if d4 < 7.8e12 or 1.22e39 < d4 < 5.20000000000000042e43Initial program 87.1%
associate--l+87.1%
distribute-lft-out--88.2%
distribute-rgt-out--91.2%
distribute-lft-out100.0%
Simplified100.0%
Taylor expanded in d4 around 0 82.9%
+-commutative82.9%
associate--r+82.9%
Simplified82.9%
Taylor expanded in d3 around 0 60.6%
if 7.8e12 < d4 < 1.22e39Initial program 71.4%
associate--l+71.4%
distribute-lft-out--71.4%
distribute-rgt-out--100.0%
distribute-lft-out100.0%
Simplified100.0%
Taylor expanded in d3 around inf 58.6%
associate-*r*58.6%
neg-mul-158.6%
Simplified58.6%
if 5.20000000000000042e43 < d4 Initial program 85.2%
Taylor expanded in d3 around 0 72.9%
distribute-lft-out74.8%
Simplified74.8%
distribute-lft-out--82.2%
*-commutative82.2%
associate--l+82.2%
Applied egg-rr82.2%
Taylor expanded in d1 around 0 74.5%
+-commutative74.5%
Simplified74.5%
Final simplification63.4%
(FPCore (d1 d2 d3 d4)
:precision binary64
(let* ((t_0 (* d1 (- d2 d3))))
(if (<= d4 2.35e-269)
t_0
(if (<= d4 7800000000000.0)
(* d1 (- d2 d1))
(if (<= d4 3.1e+44) t_0 (* d1 (+ d2 d4)))))))
double code(double d1, double d2, double d3, double d4) {
double t_0 = d1 * (d2 - d3);
double tmp;
if (d4 <= 2.35e-269) {
tmp = t_0;
} else if (d4 <= 7800000000000.0) {
tmp = d1 * (d2 - d1);
} else if (d4 <= 3.1e+44) {
tmp = t_0;
} else {
tmp = d1 * (d2 + d4);
}
return tmp;
}
real(8) function code(d1, d2, d3, d4)
real(8), intent (in) :: d1
real(8), intent (in) :: d2
real(8), intent (in) :: d3
real(8), intent (in) :: d4
real(8) :: t_0
real(8) :: tmp
t_0 = d1 * (d2 - d3)
if (d4 <= 2.35d-269) then
tmp = t_0
else if (d4 <= 7800000000000.0d0) then
tmp = d1 * (d2 - d1)
else if (d4 <= 3.1d+44) then
tmp = t_0
else
tmp = d1 * (d2 + d4)
end if
code = tmp
end function
public static double code(double d1, double d2, double d3, double d4) {
double t_0 = d1 * (d2 - d3);
double tmp;
if (d4 <= 2.35e-269) {
tmp = t_0;
} else if (d4 <= 7800000000000.0) {
tmp = d1 * (d2 - d1);
} else if (d4 <= 3.1e+44) {
tmp = t_0;
} else {
tmp = d1 * (d2 + d4);
}
return tmp;
}
def code(d1, d2, d3, d4): t_0 = d1 * (d2 - d3) tmp = 0 if d4 <= 2.35e-269: tmp = t_0 elif d4 <= 7800000000000.0: tmp = d1 * (d2 - d1) elif d4 <= 3.1e+44: tmp = t_0 else: tmp = d1 * (d2 + d4) return tmp
function code(d1, d2, d3, d4) t_0 = Float64(d1 * Float64(d2 - d3)) tmp = 0.0 if (d4 <= 2.35e-269) tmp = t_0; elseif (d4 <= 7800000000000.0) tmp = Float64(d1 * Float64(d2 - d1)); elseif (d4 <= 3.1e+44) tmp = t_0; else tmp = Float64(d1 * Float64(d2 + d4)); end return tmp end
function tmp_2 = code(d1, d2, d3, d4) t_0 = d1 * (d2 - d3); tmp = 0.0; if (d4 <= 2.35e-269) tmp = t_0; elseif (d4 <= 7800000000000.0) tmp = d1 * (d2 - d1); elseif (d4 <= 3.1e+44) tmp = t_0; else tmp = d1 * (d2 + d4); end tmp_2 = tmp; end
code[d1_, d2_, d3_, d4_] := Block[{t$95$0 = N[(d1 * N[(d2 - d3), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[d4, 2.35e-269], t$95$0, If[LessEqual[d4, 7800000000000.0], N[(d1 * N[(d2 - d1), $MachinePrecision]), $MachinePrecision], If[LessEqual[d4, 3.1e+44], t$95$0, N[(d1 * N[(d2 + d4), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := d1 \cdot \left(d2 - d3\right)\\
\mathbf{if}\;d4 \leq 2.35 \cdot 10^{-269}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;d4 \leq 7800000000000:\\
\;\;\;\;d1 \cdot \left(d2 - d1\right)\\
\mathbf{elif}\;d4 \leq 3.1 \cdot 10^{+44}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;d1 \cdot \left(d2 + d4\right)\\
\end{array}
\end{array}
if d4 < 2.3499999999999999e-269 or 7.8e12 < d4 < 3.09999999999999996e44Initial program 83.4%
associate--l+83.4%
distribute-lft-out--84.1%
distribute-rgt-out--89.9%
distribute-lft-out100.0%
Simplified100.0%
Taylor expanded in d4 around 0 78.0%
+-commutative78.0%
associate--r+78.0%
Simplified78.0%
Taylor expanded in d1 around 0 60.0%
if 2.3499999999999999e-269 < d4 < 7.8e12Initial program 92.2%
associate--l+92.2%
distribute-lft-out--93.7%
distribute-rgt-out--93.7%
distribute-lft-out100.0%
Simplified100.0%
Taylor expanded in d4 around 0 95.6%
+-commutative95.6%
associate--r+95.6%
Simplified95.6%
Taylor expanded in d3 around 0 77.5%
if 3.09999999999999996e44 < d4 Initial program 86.8%
Taylor expanded in d3 around 0 74.3%
distribute-lft-out76.2%
Simplified76.2%
distribute-lft-out--83.7%
*-commutative83.7%
associate--l+83.7%
Applied egg-rr83.7%
Taylor expanded in d1 around 0 75.9%
+-commutative75.9%
Simplified75.9%
Final simplification67.7%
(FPCore (d1 d2 d3 d4) :precision binary64 (if (<= d4 2.4e-185) (* d1 d2) (if (<= d4 3.9e+43) (* d1 (- d1)) (if (<= d4 3e+164) (* d1 d2) (* d1 d4)))))
double code(double d1, double d2, double d3, double d4) {
double tmp;
if (d4 <= 2.4e-185) {
tmp = d1 * d2;
} else if (d4 <= 3.9e+43) {
tmp = d1 * -d1;
} else if (d4 <= 3e+164) {
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 <= 2.4d-185) then
tmp = d1 * d2
else if (d4 <= 3.9d+43) then
tmp = d1 * -d1
else if (d4 <= 3d+164) 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 <= 2.4e-185) {
tmp = d1 * d2;
} else if (d4 <= 3.9e+43) {
tmp = d1 * -d1;
} else if (d4 <= 3e+164) {
tmp = d1 * d2;
} else {
tmp = d1 * d4;
}
return tmp;
}
def code(d1, d2, d3, d4): tmp = 0 if d4 <= 2.4e-185: tmp = d1 * d2 elif d4 <= 3.9e+43: tmp = d1 * -d1 elif d4 <= 3e+164: tmp = d1 * d2 else: tmp = d1 * d4 return tmp
function code(d1, d2, d3, d4) tmp = 0.0 if (d4 <= 2.4e-185) tmp = Float64(d1 * d2); elseif (d4 <= 3.9e+43) tmp = Float64(d1 * Float64(-d1)); elseif (d4 <= 3e+164) 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 <= 2.4e-185) tmp = d1 * d2; elseif (d4 <= 3.9e+43) tmp = d1 * -d1; elseif (d4 <= 3e+164) tmp = d1 * d2; else tmp = d1 * d4; end tmp_2 = tmp; end
code[d1_, d2_, d3_, d4_] := If[LessEqual[d4, 2.4e-185], N[(d1 * d2), $MachinePrecision], If[LessEqual[d4, 3.9e+43], N[(d1 * (-d1)), $MachinePrecision], If[LessEqual[d4, 3e+164], N[(d1 * d2), $MachinePrecision], N[(d1 * d4), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;d4 \leq 2.4 \cdot 10^{-185}:\\
\;\;\;\;d1 \cdot d2\\
\mathbf{elif}\;d4 \leq 3.9 \cdot 10^{+43}:\\
\;\;\;\;d1 \cdot \left(-d1\right)\\
\mathbf{elif}\;d4 \leq 3 \cdot 10^{+164}:\\
\;\;\;\;d1 \cdot d2\\
\mathbf{else}:\\
\;\;\;\;d1 \cdot d4\\
\end{array}
\end{array}
if d4 < 2.4000000000000001e-185 or 3.9000000000000001e43 < d4 < 3.00000000000000001e164Initial program 86.2%
associate--l+86.2%
distribute-lft-out--86.7%
distribute-rgt-out--91.3%
distribute-lft-out100.0%
Simplified100.0%
Taylor expanded in d2 around inf 38.5%
if 2.4000000000000001e-185 < d4 < 3.9000000000000001e43Initial program 86.8%
associate--l+86.8%
distribute-lft-out--88.7%
distribute-rgt-out--92.5%
distribute-lft-out100.0%
Simplified100.0%
Taylor expanded in d4 around 0 94.7%
+-commutative94.7%
associate--r+94.7%
Simplified94.7%
Taylor expanded in d2 around inf 87.4%
mul-1-neg87.4%
unsub-neg87.4%
Simplified87.4%
Taylor expanded in d1 around inf 48.4%
mul-1-neg48.4%
Simplified48.4%
if 3.00000000000000001e164 < d4 Initial program 86.2%
associate--l+86.2%
distribute-lft-out--86.2%
distribute-rgt-out--89.7%
distribute-lft-out100.0%
Simplified100.0%
Taylor expanded in d4 around inf 73.4%
Final simplification44.5%
(FPCore (d1 d2 d3 d4) :precision binary64 (if (<= d3 -8.5e+109) (* d1 (- d2 d3)) (if (<= d3 8e+149) (* d1 (- (+ d2 d4) d1)) (* d1 (- (- d1) d3)))))
double code(double d1, double d2, double d3, double d4) {
double tmp;
if (d3 <= -8.5e+109) {
tmp = d1 * (d2 - d3);
} else if (d3 <= 8e+149) {
tmp = d1 * ((d2 + d4) - d1);
} else {
tmp = d1 * (-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 (d3 <= (-8.5d+109)) then
tmp = d1 * (d2 - d3)
else if (d3 <= 8d+149) then
tmp = d1 * ((d2 + d4) - d1)
else
tmp = d1 * (-d1 - d3)
end if
code = tmp
end function
public static double code(double d1, double d2, double d3, double d4) {
double tmp;
if (d3 <= -8.5e+109) {
tmp = d1 * (d2 - d3);
} else if (d3 <= 8e+149) {
tmp = d1 * ((d2 + d4) - d1);
} else {
tmp = d1 * (-d1 - d3);
}
return tmp;
}
def code(d1, d2, d3, d4): tmp = 0 if d3 <= -8.5e+109: tmp = d1 * (d2 - d3) elif d3 <= 8e+149: tmp = d1 * ((d2 + d4) - d1) else: tmp = d1 * (-d1 - d3) return tmp
function code(d1, d2, d3, d4) tmp = 0.0 if (d3 <= -8.5e+109) tmp = Float64(d1 * Float64(d2 - d3)); elseif (d3 <= 8e+149) tmp = Float64(d1 * Float64(Float64(d2 + d4) - d1)); else tmp = Float64(d1 * Float64(Float64(-d1) - d3)); end return tmp end
function tmp_2 = code(d1, d2, d3, d4) tmp = 0.0; if (d3 <= -8.5e+109) tmp = d1 * (d2 - d3); elseif (d3 <= 8e+149) tmp = d1 * ((d2 + d4) - d1); else tmp = d1 * (-d1 - d3); end tmp_2 = tmp; end
code[d1_, d2_, d3_, d4_] := If[LessEqual[d3, -8.5e+109], N[(d1 * N[(d2 - d3), $MachinePrecision]), $MachinePrecision], If[LessEqual[d3, 8e+149], N[(d1 * N[(N[(d2 + d4), $MachinePrecision] - d1), $MachinePrecision]), $MachinePrecision], N[(d1 * N[((-d1) - d3), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;d3 \leq -8.5 \cdot 10^{+109}:\\
\;\;\;\;d1 \cdot \left(d2 - d3\right)\\
\mathbf{elif}\;d3 \leq 8 \cdot 10^{+149}:\\
\;\;\;\;d1 \cdot \left(\left(d2 + d4\right) - d1\right)\\
\mathbf{else}:\\
\;\;\;\;d1 \cdot \left(\left(-d1\right) - d3\right)\\
\end{array}
\end{array}
if d3 < -8.5000000000000004e109Initial program 85.3%
associate--l+85.3%
distribute-lft-out--85.4%
distribute-rgt-out--85.4%
distribute-lft-out100.0%
Simplified100.0%
Taylor expanded in d4 around 0 77.3%
+-commutative77.3%
associate--r+77.3%
Simplified77.3%
Taylor expanded in d1 around 0 72.4%
if -8.5000000000000004e109 < d3 < 8.00000000000000039e149Initial program 88.9%
associate--l+88.9%
distribute-lft-out--89.4%
distribute-rgt-out--94.4%
distribute-lft-out100.0%
Simplified100.0%
Taylor expanded in d3 around 0 95.5%
if 8.00000000000000039e149 < d3 Initial program 74.2%
associate--l+74.2%
distribute-lft-out--77.1%
distribute-rgt-out--82.8%
distribute-lft-out100.0%
Simplified100.0%
Taylor expanded in d4 around 0 92.8%
+-commutative92.8%
associate--r+92.8%
Simplified92.8%
Taylor expanded in d2 around 0 83.8%
associate-*r*83.8%
neg-mul-183.8%
Simplified83.8%
Final simplification90.2%
(FPCore (d1 d2 d3 d4) :precision binary64 (if (or (<= d1 -4.8e+103) (not (<= d1 7.3e+136))) (* d1 (- d1)) (* d1 (+ d2 d4))))
double code(double d1, double d2, double d3, double d4) {
double tmp;
if ((d1 <= -4.8e+103) || !(d1 <= 7.3e+136)) {
tmp = d1 * -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 ((d1 <= (-4.8d+103)) .or. (.not. (d1 <= 7.3d+136))) then
tmp = d1 * -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 ((d1 <= -4.8e+103) || !(d1 <= 7.3e+136)) {
tmp = d1 * -d1;
} else {
tmp = d1 * (d2 + d4);
}
return tmp;
}
def code(d1, d2, d3, d4): tmp = 0 if (d1 <= -4.8e+103) or not (d1 <= 7.3e+136): tmp = d1 * -d1 else: tmp = d1 * (d2 + d4) return tmp
function code(d1, d2, d3, d4) tmp = 0.0 if ((d1 <= -4.8e+103) || !(d1 <= 7.3e+136)) tmp = Float64(d1 * Float64(-d1)); else tmp = Float64(d1 * Float64(d2 + d4)); end return tmp end
function tmp_2 = code(d1, d2, d3, d4) tmp = 0.0; if ((d1 <= -4.8e+103) || ~((d1 <= 7.3e+136))) tmp = d1 * -d1; else tmp = d1 * (d2 + d4); end tmp_2 = tmp; end
code[d1_, d2_, d3_, d4_] := If[Or[LessEqual[d1, -4.8e+103], N[Not[LessEqual[d1, 7.3e+136]], $MachinePrecision]], N[(d1 * (-d1)), $MachinePrecision], N[(d1 * N[(d2 + d4), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;d1 \leq -4.8 \cdot 10^{+103} \lor \neg \left(d1 \leq 7.3 \cdot 10^{+136}\right):\\
\;\;\;\;d1 \cdot \left(-d1\right)\\
\mathbf{else}:\\
\;\;\;\;d1 \cdot \left(d2 + d4\right)\\
\end{array}
\end{array}
if d1 < -4.7999999999999997e103 or 7.3000000000000002e136 < d1 Initial program 53.4%
associate--l+53.4%
distribute-lft-out--56.2%
distribute-rgt-out--71.2%
distribute-lft-out100.0%
Simplified100.0%
Taylor expanded in d4 around 0 95.9%
+-commutative95.9%
associate--r+95.9%
Simplified95.9%
Taylor expanded in d2 around inf 95.9%
mul-1-neg95.9%
unsub-neg95.9%
Simplified95.9%
Taylor expanded in d1 around inf 77.2%
mul-1-neg77.2%
Simplified77.2%
if -4.7999999999999997e103 < d1 < 7.3000000000000002e136Initial program 99.4%
Taylor expanded in d3 around 0 76.5%
distribute-lft-out76.5%
Simplified76.5%
distribute-lft-out--76.5%
*-commutative76.5%
associate--l+76.5%
Applied egg-rr76.5%
Taylor expanded in d1 around 0 67.3%
+-commutative67.3%
Simplified67.3%
Final simplification70.1%
(FPCore (d1 d2 d3 d4) :precision binary64 (if (<= d4 2.3e+44) (* d1 (- (- d2 d3) d1)) (* d1 (- (+ d2 d4) d1))))
double code(double d1, double d2, double d3, double d4) {
double tmp;
if (d4 <= 2.3e+44) {
tmp = d1 * ((d2 - d3) - d1);
} 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 <= 2.3d+44) then
tmp = d1 * ((d2 - d3) - d1)
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 <= 2.3e+44) {
tmp = d1 * ((d2 - d3) - d1);
} else {
tmp = d1 * ((d2 + d4) - d1);
}
return tmp;
}
def code(d1, d2, d3, d4): tmp = 0 if d4 <= 2.3e+44: tmp = d1 * ((d2 - d3) - d1) else: tmp = d1 * ((d2 + d4) - d1) return tmp
function code(d1, d2, d3, d4) tmp = 0.0 if (d4 <= 2.3e+44) tmp = Float64(d1 * Float64(Float64(d2 - d3) - d1)); 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 <= 2.3e+44) tmp = d1 * ((d2 - d3) - d1); else tmp = d1 * ((d2 + d4) - d1); end tmp_2 = tmp; end
code[d1_, d2_, d3_, d4_] := If[LessEqual[d4, 2.3e+44], N[(d1 * N[(N[(d2 - d3), $MachinePrecision] - d1), $MachinePrecision]), $MachinePrecision], N[(d1 * N[(N[(d2 + d4), $MachinePrecision] - d1), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;d4 \leq 2.3 \cdot 10^{+44}:\\
\;\;\;\;d1 \cdot \left(\left(d2 - d3\right) - d1\right)\\
\mathbf{else}:\\
\;\;\;\;d1 \cdot \left(\left(d2 + d4\right) - d1\right)\\
\end{array}
\end{array}
if d4 < 2.30000000000000004e44Initial program 86.2%
associate--l+86.2%
distribute-lft-out--87.2%
distribute-rgt-out--91.1%
distribute-lft-out100.0%
Simplified100.0%
Taylor expanded in d4 around 0 83.6%
+-commutative83.6%
associate--r+83.6%
Simplified83.6%
if 2.30000000000000004e44 < d4 Initial program 86.8%
associate--l+86.8%
distribute-lft-out--86.8%
distribute-rgt-out--92.5%
distribute-lft-out100.0%
Simplified100.0%
Taylor expanded in d3 around 0 83.7%
Final simplification83.6%
(FPCore (d1 d2 d3 d4) :precision binary64 (if (<= d2 -1.9e-69) (* d1 (- (- d2 d3) d1)) (* d1 (- (- d4 d1) d3))))
double code(double d1, double d2, double d3, double d4) {
double tmp;
if (d2 <= -1.9e-69) {
tmp = d1 * ((d2 - d3) - d1);
} 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.9d-69)) then
tmp = d1 * ((d2 - d3) - d1)
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.9e-69) {
tmp = d1 * ((d2 - d3) - d1);
} else {
tmp = d1 * ((d4 - d1) - d3);
}
return tmp;
}
def code(d1, d2, d3, d4): tmp = 0 if d2 <= -1.9e-69: tmp = d1 * ((d2 - d3) - d1) else: tmp = d1 * ((d4 - d1) - d3) return tmp
function code(d1, d2, d3, d4) tmp = 0.0 if (d2 <= -1.9e-69) tmp = Float64(d1 * Float64(Float64(d2 - d3) - d1)); 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 (d2 <= -1.9e-69) tmp = d1 * ((d2 - d3) - d1); else tmp = d1 * ((d4 - d1) - d3); end tmp_2 = tmp; end
code[d1_, d2_, d3_, d4_] := If[LessEqual[d2, -1.9e-69], N[(d1 * N[(N[(d2 - d3), $MachinePrecision] - d1), $MachinePrecision]), $MachinePrecision], N[(d1 * N[(N[(d4 - d1), $MachinePrecision] - d3), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;d2 \leq -1.9 \cdot 10^{-69}:\\
\;\;\;\;d1 \cdot \left(\left(d2 - d3\right) - d1\right)\\
\mathbf{else}:\\
\;\;\;\;d1 \cdot \left(\left(d4 - d1\right) - d3\right)\\
\end{array}
\end{array}
if d2 < -1.8999999999999999e-69Initial program 81.6%
associate--l+81.6%
distribute-lft-out--82.9%
distribute-rgt-out--86.8%
distribute-lft-out100.0%
Simplified100.0%
Taylor expanded in d4 around 0 89.8%
+-commutative89.8%
associate--r+89.8%
Simplified89.8%
if -1.8999999999999999e-69 < d2 Initial program 88.3%
associate--l+88.3%
distribute-lft-out--88.9%
distribute-rgt-out--93.3%
distribute-lft-out100.0%
Simplified100.0%
Taylor expanded in d2 around 0 81.0%
associate--r+81.0%
Simplified81.0%
Final simplification83.6%
(FPCore (d1 d2 d3 d4) :precision binary64 (if (<= d2 -1.9e-69) (* d1 d2) (* d1 d4)))
double code(double d1, double d2, double d3, double d4) {
double tmp;
if (d2 <= -1.9e-69) {
tmp = d1 * d2;
} else {
tmp = d1 * d4;
}
return tmp;
}
real(8) function code(d1, d2, d3, d4)
real(8), intent (in) :: d1
real(8), intent (in) :: d2
real(8), intent (in) :: d3
real(8), intent (in) :: d4
real(8) :: tmp
if (d2 <= (-1.9d-69)) then
tmp = d1 * d2
else
tmp = d1 * d4
end if
code = tmp
end function
public static double code(double d1, double d2, double d3, double d4) {
double tmp;
if (d2 <= -1.9e-69) {
tmp = d1 * d2;
} else {
tmp = d1 * d4;
}
return tmp;
}
def code(d1, d2, d3, d4): tmp = 0 if d2 <= -1.9e-69: tmp = d1 * d2 else: tmp = d1 * d4 return tmp
function code(d1, d2, d3, d4) tmp = 0.0 if (d2 <= -1.9e-69) tmp = Float64(d1 * d2); else tmp = Float64(d1 * d4); end return tmp end
function tmp_2 = code(d1, d2, d3, d4) tmp = 0.0; if (d2 <= -1.9e-69) tmp = d1 * d2; else tmp = d1 * d4; end tmp_2 = tmp; end
code[d1_, d2_, d3_, d4_] := If[LessEqual[d2, -1.9e-69], N[(d1 * d2), $MachinePrecision], N[(d1 * d4), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;d2 \leq -1.9 \cdot 10^{-69}:\\
\;\;\;\;d1 \cdot d2\\
\mathbf{else}:\\
\;\;\;\;d1 \cdot d4\\
\end{array}
\end{array}
if d2 < -1.8999999999999999e-69Initial program 81.6%
associate--l+81.6%
distribute-lft-out--82.9%
distribute-rgt-out--86.8%
distribute-lft-out100.0%
Simplified100.0%
Taylor expanded in d2 around inf 57.4%
if -1.8999999999999999e-69 < d2 Initial program 88.3%
associate--l+88.3%
distribute-lft-out--88.9%
distribute-rgt-out--93.3%
distribute-lft-out100.0%
Simplified100.0%
Taylor expanded in d4 around inf 34.4%
Final simplification41.2%
(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 86.3%
associate--l+86.3%
distribute-lft-out--87.1%
distribute-rgt-out--91.4%
distribute-lft-out100.0%
Simplified100.0%
Taylor expanded in d2 around inf 33.9%
Final simplification33.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 2024071
(FPCore (d1 d2 d3 d4)
:name "FastMath dist4"
:precision binary64
:alt
(* d1 (- (+ (- d2 d3) d4) d1))
(- (+ (- (* d1 d2) (* d1 d3)) (* d4 d1)) (* d1 d1)))