
(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 87.8%
associate--l+87.8%
distribute-lft-out--89.0%
distribute-rgt-out--92.1%
distribute-lft-out100.0%
Simplified100.0%
Final simplification100.0%
(FPCore (d1 d2 d3 d4)
:precision binary64
(let* ((t_0 (* d1 (- (- d3) d1))))
(if (<= d2 -1.52e+57)
(* d1 (- d2 d3))
(if (<= d2 -3.6e-26)
t_0
(if (<= d2 -1.6e-40)
(* d1 (+ d2 d4))
(if (<= d2 -4.8e-208) t_0 (* d1 (- d4 d1))))))))
double code(double d1, double d2, double d3, double d4) {
double t_0 = d1 * (-d3 - d1);
double tmp;
if (d2 <= -1.52e+57) {
tmp = d1 * (d2 - d3);
} else if (d2 <= -3.6e-26) {
tmp = t_0;
} else if (d2 <= -1.6e-40) {
tmp = d1 * (d2 + d4);
} else if (d2 <= -4.8e-208) {
tmp = t_0;
} 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) :: t_0
real(8) :: tmp
t_0 = d1 * (-d3 - d1)
if (d2 <= (-1.52d+57)) then
tmp = d1 * (d2 - d3)
else if (d2 <= (-3.6d-26)) then
tmp = t_0
else if (d2 <= (-1.6d-40)) then
tmp = d1 * (d2 + d4)
else if (d2 <= (-4.8d-208)) then
tmp = t_0
else
tmp = d1 * (d4 - d1)
end if
code = tmp
end function
public static double code(double d1, double d2, double d3, double d4) {
double t_0 = d1 * (-d3 - d1);
double tmp;
if (d2 <= -1.52e+57) {
tmp = d1 * (d2 - d3);
} else if (d2 <= -3.6e-26) {
tmp = t_0;
} else if (d2 <= -1.6e-40) {
tmp = d1 * (d2 + d4);
} else if (d2 <= -4.8e-208) {
tmp = t_0;
} else {
tmp = d1 * (d4 - d1);
}
return tmp;
}
def code(d1, d2, d3, d4): t_0 = d1 * (-d3 - d1) tmp = 0 if d2 <= -1.52e+57: tmp = d1 * (d2 - d3) elif d2 <= -3.6e-26: tmp = t_0 elif d2 <= -1.6e-40: tmp = d1 * (d2 + d4) elif d2 <= -4.8e-208: tmp = t_0 else: tmp = d1 * (d4 - d1) return tmp
function code(d1, d2, d3, d4) t_0 = Float64(d1 * Float64(Float64(-d3) - d1)) tmp = 0.0 if (d2 <= -1.52e+57) tmp = Float64(d1 * Float64(d2 - d3)); elseif (d2 <= -3.6e-26) tmp = t_0; elseif (d2 <= -1.6e-40) tmp = Float64(d1 * Float64(d2 + d4)); elseif (d2 <= -4.8e-208) tmp = t_0; else tmp = Float64(d1 * Float64(d4 - d1)); end return tmp end
function tmp_2 = code(d1, d2, d3, d4) t_0 = d1 * (-d3 - d1); tmp = 0.0; if (d2 <= -1.52e+57) tmp = d1 * (d2 - d3); elseif (d2 <= -3.6e-26) tmp = t_0; elseif (d2 <= -1.6e-40) tmp = d1 * (d2 + d4); elseif (d2 <= -4.8e-208) tmp = t_0; else tmp = d1 * (d4 - d1); end tmp_2 = tmp; end
code[d1_, d2_, d3_, d4_] := Block[{t$95$0 = N[(d1 * N[((-d3) - d1), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[d2, -1.52e+57], N[(d1 * N[(d2 - d3), $MachinePrecision]), $MachinePrecision], If[LessEqual[d2, -3.6e-26], t$95$0, If[LessEqual[d2, -1.6e-40], N[(d1 * N[(d2 + d4), $MachinePrecision]), $MachinePrecision], If[LessEqual[d2, -4.8e-208], t$95$0, N[(d1 * N[(d4 - d1), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := d1 \cdot \left(\left(-d3\right) - d1\right)\\
\mathbf{if}\;d2 \leq -1.52 \cdot 10^{+57}:\\
\;\;\;\;d1 \cdot \left(d2 - d3\right)\\
\mathbf{elif}\;d2 \leq -3.6 \cdot 10^{-26}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;d2 \leq -1.6 \cdot 10^{-40}:\\
\;\;\;\;d1 \cdot \left(d2 + d4\right)\\
\mathbf{elif}\;d2 \leq -4.8 \cdot 10^{-208}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;d1 \cdot \left(d4 - d1\right)\\
\end{array}
\end{array}
if d2 < -1.51999999999999998e57Initial program 83.2%
associate--l+83.2%
distribute-lft-out--85.1%
distribute-rgt-out--88.8%
distribute-lft-out100.0%
Simplified100.0%
Taylor expanded in d4 around 0 88.6%
Taylor expanded in d1 around 0 79.7%
if -1.51999999999999998e57 < d2 < -3.6000000000000001e-26 or -1.60000000000000001e-40 < d2 < -4.7999999999999998e-208Initial program 93.4%
associate--l+93.4%
distribute-lft-out--93.3%
distribute-rgt-out--93.3%
distribute-lft-out99.9%
Simplified99.9%
Taylor expanded in d4 around 0 75.4%
Taylor expanded in d2 around 0 71.9%
neg-mul-171.9%
distribute-neg-in71.9%
sub-neg71.9%
Simplified71.9%
if -3.6000000000000001e-26 < d2 < -1.60000000000000001e-40Initial program 100.0%
associate--l+100.0%
distribute-lft-out--100.0%
distribute-rgt-out--100.0%
distribute-lft-out99.5%
Simplified99.5%
Taylor expanded in d1 around 0 99.5%
Taylor expanded in d3 around 0 67.7%
+-commutative67.7%
Simplified67.7%
if -4.7999999999999998e-208 < d2 Initial program 87.6%
associate--l+87.6%
distribute-lft-out--88.9%
distribute-rgt-out--92.8%
distribute-lft-out100.0%
Simplified100.0%
Taylor expanded in d2 around 0 83.5%
Taylor expanded in d3 around 0 62.2%
Final simplification67.7%
(FPCore (d1 d2 d3 d4)
:precision binary64
(let* ((t_0 (* d1 (- d3))) (t_1 (* d1 (+ d2 d4))))
(if (<= d3 -5.6e+166)
t_0
(if (<= d3 9e-303)
t_1
(if (<= d3 3.1e-164) (- (* d1 d1)) (if (<= d3 6.5e+95) t_1 t_0))))))
double code(double d1, double d2, double d3, double d4) {
double t_0 = d1 * -d3;
double t_1 = d1 * (d2 + d4);
double tmp;
if (d3 <= -5.6e+166) {
tmp = t_0;
} else if (d3 <= 9e-303) {
tmp = t_1;
} else if (d3 <= 3.1e-164) {
tmp = -(d1 * d1);
} else if (d3 <= 6.5e+95) {
tmp = t_1;
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(d1, d2, d3, d4)
real(8), intent (in) :: d1
real(8), intent (in) :: d2
real(8), intent (in) :: d3
real(8), intent (in) :: d4
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = d1 * -d3
t_1 = d1 * (d2 + d4)
if (d3 <= (-5.6d+166)) then
tmp = t_0
else if (d3 <= 9d-303) then
tmp = t_1
else if (d3 <= 3.1d-164) then
tmp = -(d1 * d1)
else if (d3 <= 6.5d+95) then
tmp = t_1
else
tmp = t_0
end if
code = tmp
end function
public static double code(double d1, double d2, double d3, double d4) {
double t_0 = d1 * -d3;
double t_1 = d1 * (d2 + d4);
double tmp;
if (d3 <= -5.6e+166) {
tmp = t_0;
} else if (d3 <= 9e-303) {
tmp = t_1;
} else if (d3 <= 3.1e-164) {
tmp = -(d1 * d1);
} else if (d3 <= 6.5e+95) {
tmp = t_1;
} else {
tmp = t_0;
}
return tmp;
}
def code(d1, d2, d3, d4): t_0 = d1 * -d3 t_1 = d1 * (d2 + d4) tmp = 0 if d3 <= -5.6e+166: tmp = t_0 elif d3 <= 9e-303: tmp = t_1 elif d3 <= 3.1e-164: tmp = -(d1 * d1) elif d3 <= 6.5e+95: tmp = t_1 else: tmp = t_0 return tmp
function code(d1, d2, d3, d4) t_0 = Float64(d1 * Float64(-d3)) t_1 = Float64(d1 * Float64(d2 + d4)) tmp = 0.0 if (d3 <= -5.6e+166) tmp = t_0; elseif (d3 <= 9e-303) tmp = t_1; elseif (d3 <= 3.1e-164) tmp = Float64(-Float64(d1 * d1)); elseif (d3 <= 6.5e+95) tmp = t_1; else tmp = t_0; end return tmp end
function tmp_2 = code(d1, d2, d3, d4) t_0 = d1 * -d3; t_1 = d1 * (d2 + d4); tmp = 0.0; if (d3 <= -5.6e+166) tmp = t_0; elseif (d3 <= 9e-303) tmp = t_1; elseif (d3 <= 3.1e-164) tmp = -(d1 * d1); elseif (d3 <= 6.5e+95) tmp = t_1; else tmp = t_0; end tmp_2 = tmp; end
code[d1_, d2_, d3_, d4_] := Block[{t$95$0 = N[(d1 * (-d3)), $MachinePrecision]}, Block[{t$95$1 = N[(d1 * N[(d2 + d4), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[d3, -5.6e+166], t$95$0, If[LessEqual[d3, 9e-303], t$95$1, If[LessEqual[d3, 3.1e-164], (-N[(d1 * d1), $MachinePrecision]), If[LessEqual[d3, 6.5e+95], t$95$1, t$95$0]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := d1 \cdot \left(-d3\right)\\
t_1 := d1 \cdot \left(d2 + d4\right)\\
\mathbf{if}\;d3 \leq -5.6 \cdot 10^{+166}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;d3 \leq 9 \cdot 10^{-303}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;d3 \leq 3.1 \cdot 10^{-164}:\\
\;\;\;\;-d1 \cdot d1\\
\mathbf{elif}\;d3 \leq 6.5 \cdot 10^{+95}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if d3 < -5.59999999999999993e166 or 6.5e95 < d3 Initial program 79.3%
associate--l+79.3%
distribute-lft-out--80.8%
distribute-rgt-out--85.2%
distribute-lft-out100.0%
Simplified100.0%
Taylor expanded in d3 around inf 71.9%
mul-1-neg71.9%
*-commutative71.9%
distribute-rgt-neg-in71.9%
Simplified71.9%
if -5.59999999999999993e166 < d3 < 9.0000000000000002e-303 or 3.1000000000000001e-164 < d3 < 6.5e95Initial program 91.3%
associate--l+91.3%
distribute-lft-out--92.5%
distribute-rgt-out--95.6%
distribute-lft-out100.0%
Simplified100.0%
Taylor expanded in d1 around 0 82.2%
Taylor expanded in d3 around 0 73.2%
+-commutative73.2%
Simplified73.2%
if 9.0000000000000002e-303 < d3 < 3.1000000000000001e-164Initial program 88.5%
associate--l+88.5%
distribute-lft-out--88.5%
distribute-rgt-out--88.5%
distribute-lft-out100.0%
Simplified100.0%
Taylor expanded in d1 around inf 63.3%
neg-mul-163.3%
unpow263.3%
distribute-rgt-neg-in63.3%
Simplified63.3%
Final simplification71.9%
(FPCore (d1 d2 d3 d4)
:precision binary64
(if (<= d2 -4.1e+62)
(* d1 d2)
(if (<= d2 -5.5e-208)
(* d1 (- d3))
(if (<= d2 2.4e-263) (- (* d1 d1)) (* d1 d4)))))
double code(double d1, double d2, double d3, double d4) {
double tmp;
if (d2 <= -4.1e+62) {
tmp = d1 * d2;
} else if (d2 <= -5.5e-208) {
tmp = d1 * -d3;
} else if (d2 <= 2.4e-263) {
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 <= (-4.1d+62)) then
tmp = d1 * d2
else if (d2 <= (-5.5d-208)) then
tmp = d1 * -d3
else if (d2 <= 2.4d-263) 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 <= -4.1e+62) {
tmp = d1 * d2;
} else if (d2 <= -5.5e-208) {
tmp = d1 * -d3;
} else if (d2 <= 2.4e-263) {
tmp = -(d1 * d1);
} else {
tmp = d1 * d4;
}
return tmp;
}
def code(d1, d2, d3, d4): tmp = 0 if d2 <= -4.1e+62: tmp = d1 * d2 elif d2 <= -5.5e-208: tmp = d1 * -d3 elif d2 <= 2.4e-263: tmp = -(d1 * d1) else: tmp = d1 * d4 return tmp
function code(d1, d2, d3, d4) tmp = 0.0 if (d2 <= -4.1e+62) tmp = Float64(d1 * d2); elseif (d2 <= -5.5e-208) tmp = Float64(d1 * Float64(-d3)); elseif (d2 <= 2.4e-263) tmp = Float64(-Float64(d1 * d1)); else tmp = Float64(d1 * d4); end return tmp end
function tmp_2 = code(d1, d2, d3, d4) tmp = 0.0; if (d2 <= -4.1e+62) tmp = d1 * d2; elseif (d2 <= -5.5e-208) tmp = d1 * -d3; elseif (d2 <= 2.4e-263) tmp = -(d1 * d1); else tmp = d1 * d4; end tmp_2 = tmp; end
code[d1_, d2_, d3_, d4_] := If[LessEqual[d2, -4.1e+62], N[(d1 * d2), $MachinePrecision], If[LessEqual[d2, -5.5e-208], N[(d1 * (-d3)), $MachinePrecision], If[LessEqual[d2, 2.4e-263], (-N[(d1 * d1), $MachinePrecision]), N[(d1 * d4), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;d2 \leq -4.1 \cdot 10^{+62}:\\
\;\;\;\;d1 \cdot d2\\
\mathbf{elif}\;d2 \leq -5.5 \cdot 10^{-208}:\\
\;\;\;\;d1 \cdot \left(-d3\right)\\
\mathbf{elif}\;d2 \leq 2.4 \cdot 10^{-263}:\\
\;\;\;\;-d1 \cdot d1\\
\mathbf{else}:\\
\;\;\;\;d1 \cdot d4\\
\end{array}
\end{array}
if d2 < -4.09999999999999984e62Initial program 82.9%
associate--l+82.9%
distribute-lft-out--84.8%
distribute-rgt-out--88.6%
distribute-lft-out100.0%
Simplified100.0%
Taylor expanded in d2 around inf 74.5%
if -4.09999999999999984e62 < d2 < -5.4999999999999997e-208Initial 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 42.3%
mul-1-neg42.3%
*-commutative42.3%
distribute-rgt-neg-in42.3%
Simplified42.3%
if -5.4999999999999997e-208 < d2 < 2.4e-263Initial program 93.5%
associate--l+93.5%
distribute-lft-out--93.5%
distribute-rgt-out--96.8%
distribute-lft-out100.0%
Simplified100.0%
Taylor expanded in d1 around inf 38.4%
neg-mul-138.4%
unpow238.4%
distribute-rgt-neg-in38.4%
Simplified38.4%
if 2.4e-263 < d2 Initial program 86.0%
associate--l+86.0%
distribute-lft-out--87.7%
distribute-rgt-out--91.8%
distribute-lft-out100.0%
Simplified100.0%
Taylor expanded in d4 around inf 42.0%
Final simplification48.4%
(FPCore (d1 d2 d3 d4) :precision binary64 (if (<= d2 -4.6e-69) (* d1 (- d2 d3)) (if (<= d2 -1.66e-273) (* d1 (- d4 d3)) (* d1 (- d4 d1)))))
double code(double d1, double d2, double d3, double d4) {
double tmp;
if (d2 <= -4.6e-69) {
tmp = d1 * (d2 - d3);
} else if (d2 <= -1.66e-273) {
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 <= (-4.6d-69)) then
tmp = d1 * (d2 - d3)
else if (d2 <= (-1.66d-273)) 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 <= -4.6e-69) {
tmp = d1 * (d2 - d3);
} else if (d2 <= -1.66e-273) {
tmp = d1 * (d4 - d3);
} else {
tmp = d1 * (d4 - d1);
}
return tmp;
}
def code(d1, d2, d3, d4): tmp = 0 if d2 <= -4.6e-69: tmp = d1 * (d2 - d3) elif d2 <= -1.66e-273: tmp = d1 * (d4 - d3) else: tmp = d1 * (d4 - d1) return tmp
function code(d1, d2, d3, d4) tmp = 0.0 if (d2 <= -4.6e-69) tmp = Float64(d1 * Float64(d2 - d3)); elseif (d2 <= -1.66e-273) 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 <= -4.6e-69) tmp = d1 * (d2 - d3); elseif (d2 <= -1.66e-273) tmp = d1 * (d4 - d3); else tmp = d1 * (d4 - d1); end tmp_2 = tmp; end
code[d1_, d2_, d3_, d4_] := If[LessEqual[d2, -4.6e-69], N[(d1 * N[(d2 - d3), $MachinePrecision]), $MachinePrecision], If[LessEqual[d2, -1.66e-273], N[(d1 * N[(d4 - d3), $MachinePrecision]), $MachinePrecision], N[(d1 * N[(d4 - d1), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;d2 \leq -4.6 \cdot 10^{-69}:\\
\;\;\;\;d1 \cdot \left(d2 - d3\right)\\
\mathbf{elif}\;d2 \leq -1.66 \cdot 10^{-273}:\\
\;\;\;\;d1 \cdot \left(d4 - d3\right)\\
\mathbf{else}:\\
\;\;\;\;d1 \cdot \left(d4 - d1\right)\\
\end{array}
\end{array}
if d2 < -4.6000000000000001e-69Initial program 87.1%
associate--l+87.1%
distribute-lft-out--88.4%
distribute-rgt-out--91.0%
distribute-lft-out100.0%
Simplified100.0%
Taylor expanded in d4 around 0 84.5%
Taylor expanded in d1 around 0 71.1%
if -4.6000000000000001e-69 < d2 < -1.65999999999999995e-273Initial program 94.5%
associate--l+94.5%
distribute-lft-out--94.5%
distribute-rgt-out--94.5%
distribute-lft-out100.0%
Simplified100.0%
Taylor expanded in d2 around 0 99.1%
Taylor expanded in d1 around 0 73.2%
if -1.65999999999999995e-273 < d2 Initial program 86.5%
associate--l+86.5%
distribute-lft-out--87.9%
distribute-rgt-out--92.2%
distribute-lft-out100.0%
Simplified100.0%
Taylor expanded in d2 around 0 82.0%
Taylor expanded in d3 around 0 60.9%
Final simplification65.8%
(FPCore (d1 d2 d3 d4) :precision binary64 (if (<= d2 -1.15e+63) (* d1 (- d2 d3)) (* d1 (- d4 (+ d1 d3)))))
double code(double d1, double d2, double d3, double d4) {
double tmp;
if (d2 <= -1.15e+63) {
tmp = d1 * (d2 - d3);
} else {
tmp = d1 * (d4 - (d1 + d3));
}
return tmp;
}
real(8) function code(d1, d2, d3, d4)
real(8), intent (in) :: d1
real(8), intent (in) :: d2
real(8), intent (in) :: d3
real(8), intent (in) :: d4
real(8) :: tmp
if (d2 <= (-1.15d+63)) then
tmp = d1 * (d2 - d3)
else
tmp = d1 * (d4 - (d1 + d3))
end if
code = tmp
end function
public static double code(double d1, double d2, double d3, double d4) {
double tmp;
if (d2 <= -1.15e+63) {
tmp = d1 * (d2 - d3);
} else {
tmp = d1 * (d4 - (d1 + d3));
}
return tmp;
}
def code(d1, d2, d3, d4): tmp = 0 if d2 <= -1.15e+63: tmp = d1 * (d2 - d3) else: tmp = d1 * (d4 - (d1 + d3)) return tmp
function code(d1, d2, d3, d4) tmp = 0.0 if (d2 <= -1.15e+63) tmp = Float64(d1 * Float64(d2 - d3)); else tmp = Float64(d1 * Float64(d4 - Float64(d1 + d3))); end return tmp end
function tmp_2 = code(d1, d2, d3, d4) tmp = 0.0; if (d2 <= -1.15e+63) tmp = d1 * (d2 - d3); else tmp = d1 * (d4 - (d1 + d3)); end tmp_2 = tmp; end
code[d1_, d2_, d3_, d4_] := If[LessEqual[d2, -1.15e+63], N[(d1 * N[(d2 - d3), $MachinePrecision]), $MachinePrecision], N[(d1 * N[(d4 - N[(d1 + d3), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;d2 \leq -1.15 \cdot 10^{+63}:\\
\;\;\;\;d1 \cdot \left(d2 - d3\right)\\
\mathbf{else}:\\
\;\;\;\;d1 \cdot \left(d4 - \left(d1 + d3\right)\right)\\
\end{array}
\end{array}
if d2 < -1.14999999999999997e63Initial program 82.9%
associate--l+82.9%
distribute-lft-out--84.8%
distribute-rgt-out--88.6%
distribute-lft-out100.0%
Simplified100.0%
Taylor expanded in d4 around 0 90.2%
Taylor expanded in d1 around 0 81.1%
if -1.14999999999999997e63 < d2 Initial program 89.1%
associate--l+89.1%
distribute-lft-out--90.1%
distribute-rgt-out--93.1%
distribute-lft-out100.0%
Simplified100.0%
Taylor expanded in d2 around 0 85.9%
Final simplification84.9%
(FPCore (d1 d2 d3 d4) :precision binary64 (if (<= d2 -2.65e-61) (* d1 (- (+ d2 d4) d3)) (* d1 (- d4 (+ d1 d3)))))
double code(double d1, double d2, double d3, double d4) {
double tmp;
if (d2 <= -2.65e-61) {
tmp = d1 * ((d2 + d4) - d3);
} else {
tmp = d1 * (d4 - (d1 + d3));
}
return tmp;
}
real(8) function code(d1, d2, d3, d4)
real(8), intent (in) :: d1
real(8), intent (in) :: d2
real(8), intent (in) :: d3
real(8), intent (in) :: d4
real(8) :: tmp
if (d2 <= (-2.65d-61)) then
tmp = d1 * ((d2 + d4) - d3)
else
tmp = d1 * (d4 - (d1 + d3))
end if
code = tmp
end function
public static double code(double d1, double d2, double d3, double d4) {
double tmp;
if (d2 <= -2.65e-61) {
tmp = d1 * ((d2 + d4) - d3);
} else {
tmp = d1 * (d4 - (d1 + d3));
}
return tmp;
}
def code(d1, d2, d3, d4): tmp = 0 if d2 <= -2.65e-61: tmp = d1 * ((d2 + d4) - d3) else: tmp = d1 * (d4 - (d1 + d3)) return tmp
function code(d1, d2, d3, d4) tmp = 0.0 if (d2 <= -2.65e-61) tmp = Float64(d1 * Float64(Float64(d2 + d4) - d3)); else tmp = Float64(d1 * Float64(d4 - Float64(d1 + d3))); end return tmp end
function tmp_2 = code(d1, d2, d3, d4) tmp = 0.0; if (d2 <= -2.65e-61) tmp = d1 * ((d2 + d4) - d3); else tmp = d1 * (d4 - (d1 + d3)); end tmp_2 = tmp; end
code[d1_, d2_, d3_, d4_] := If[LessEqual[d2, -2.65e-61], N[(d1 * N[(N[(d2 + d4), $MachinePrecision] - d3), $MachinePrecision]), $MachinePrecision], N[(d1 * N[(d4 - N[(d1 + d3), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;d2 \leq -2.65 \cdot 10^{-61}:\\
\;\;\;\;d1 \cdot \left(\left(d2 + d4\right) - d3\right)\\
\mathbf{else}:\\
\;\;\;\;d1 \cdot \left(d4 - \left(d1 + d3\right)\right)\\
\end{array}
\end{array}
if d2 < -2.65e-61Initial program 88.1%
associate--l+88.1%
distribute-lft-out--89.4%
distribute-rgt-out--92.0%
distribute-lft-out100.0%
Simplified100.0%
Taylor expanded in d1 around 0 89.9%
if -2.65e-61 < d2 Initial program 87.7%
associate--l+87.7%
distribute-lft-out--88.9%
distribute-rgt-out--92.2%
distribute-lft-out100.0%
Simplified100.0%
Taylor expanded in d2 around 0 85.8%
Final simplification87.0%
(FPCore (d1 d2 d3 d4) :precision binary64 (if (<= d4 3.5e+36) (* d1 (- d2 (+ d1 d3))) (* d1 (- (+ d2 d4) d3))))
double code(double d1, double d2, double d3, double d4) {
double tmp;
if (d4 <= 3.5e+36) {
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 <= 3.5d+36) 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 <= 3.5e+36) {
tmp = d1 * (d2 - (d1 + d3));
} else {
tmp = d1 * ((d2 + d4) - d3);
}
return tmp;
}
def code(d1, d2, d3, d4): tmp = 0 if d4 <= 3.5e+36: tmp = d1 * (d2 - (d1 + d3)) else: tmp = d1 * ((d2 + d4) - d3) return tmp
function code(d1, d2, d3, d4) tmp = 0.0 if (d4 <= 3.5e+36) tmp = Float64(d1 * Float64(d2 - Float64(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 <= 3.5e+36) tmp = d1 * (d2 - (d1 + d3)); else tmp = d1 * ((d2 + d4) - d3); end tmp_2 = tmp; end
code[d1_, d2_, d3_, d4_] := If[LessEqual[d4, 3.5e+36], N[(d1 * N[(d2 - N[(d1 + d3), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(d1 * N[(N[(d2 + d4), $MachinePrecision] - d3), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;d4 \leq 3.5 \cdot 10^{+36}:\\
\;\;\;\;d1 \cdot \left(d2 - \left(d1 + d3\right)\right)\\
\mathbf{else}:\\
\;\;\;\;d1 \cdot \left(\left(d2 + d4\right) - d3\right)\\
\end{array}
\end{array}
if d4 < 3.4999999999999998e36Initial program 91.4%
associate--l+91.4%
distribute-lft-out--92.4%
distribute-rgt-out--94.9%
distribute-lft-out100.0%
Simplified100.0%
Taylor expanded in d4 around 0 79.1%
if 3.4999999999999998e36 < d4 Initial program 75.4%
associate--l+75.4%
distribute-lft-out--77.1%
distribute-rgt-out--82.4%
distribute-lft-out100.0%
Simplified100.0%
Taylor expanded in d1 around 0 87.8%
Final simplification81.0%
(FPCore (d1 d2 d3 d4) :precision binary64 (if (<= d2 -2.1e+56) (* d1 d2) (if (<= d2 2.3e-263) (- (* d1 d1)) (* d1 d4))))
double code(double d1, double d2, double d3, double d4) {
double tmp;
if (d2 <= -2.1e+56) {
tmp = d1 * d2;
} else if (d2 <= 2.3e-263) {
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 <= (-2.1d+56)) then
tmp = d1 * d2
else if (d2 <= 2.3d-263) 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 <= -2.1e+56) {
tmp = d1 * d2;
} else if (d2 <= 2.3e-263) {
tmp = -(d1 * d1);
} else {
tmp = d1 * d4;
}
return tmp;
}
def code(d1, d2, d3, d4): tmp = 0 if d2 <= -2.1e+56: tmp = d1 * d2 elif d2 <= 2.3e-263: tmp = -(d1 * d1) else: tmp = d1 * d4 return tmp
function code(d1, d2, d3, d4) tmp = 0.0 if (d2 <= -2.1e+56) tmp = Float64(d1 * d2); elseif (d2 <= 2.3e-263) tmp = Float64(-Float64(d1 * d1)); else tmp = Float64(d1 * d4); end return tmp end
function tmp_2 = code(d1, d2, d3, d4) tmp = 0.0; if (d2 <= -2.1e+56) tmp = d1 * d2; elseif (d2 <= 2.3e-263) tmp = -(d1 * d1); else tmp = d1 * d4; end tmp_2 = tmp; end
code[d1_, d2_, d3_, d4_] := If[LessEqual[d2, -2.1e+56], N[(d1 * d2), $MachinePrecision], If[LessEqual[d2, 2.3e-263], (-N[(d1 * d1), $MachinePrecision]), N[(d1 * d4), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;d2 \leq -2.1 \cdot 10^{+56}:\\
\;\;\;\;d1 \cdot d2\\
\mathbf{elif}\;d2 \leq 2.3 \cdot 10^{-263}:\\
\;\;\;\;-d1 \cdot d1\\
\mathbf{else}:\\
\;\;\;\;d1 \cdot d4\\
\end{array}
\end{array}
if d2 < -2.10000000000000017e56Initial program 83.6%
associate--l+83.6%
distribute-lft-out--85.4%
distribute-rgt-out--89.0%
distribute-lft-out100.0%
Simplified100.0%
Taylor expanded in d2 around inf 72.0%
if -2.10000000000000017e56 < d2 < 2.30000000000000003e-263Initial program 93.6%
associate--l+93.6%
distribute-lft-out--93.6%
distribute-rgt-out--94.9%
distribute-lft-out99.9%
Simplified99.9%
Taylor expanded in d1 around inf 36.1%
neg-mul-136.1%
unpow236.1%
distribute-rgt-neg-in36.1%
Simplified36.1%
if 2.30000000000000003e-263 < d2 Initial program 86.0%
associate--l+86.0%
distribute-lft-out--87.7%
distribute-rgt-out--91.8%
distribute-lft-out100.0%
Simplified100.0%
Taylor expanded in d4 around inf 42.0%
Final simplification46.6%
(FPCore (d1 d2 d3 d4) :precision binary64 (if (<= d2 -2.1e-66) (* d1 (+ d2 d4)) (* d1 (- d4 d1))))
double code(double d1, double d2, double d3, double d4) {
double tmp;
if (d2 <= -2.1e-66) {
tmp = d1 * (d2 + d4);
} else {
tmp = d1 * (d4 - d1);
}
return tmp;
}
real(8) function code(d1, d2, d3, d4)
real(8), intent (in) :: d1
real(8), intent (in) :: d2
real(8), intent (in) :: d3
real(8), intent (in) :: d4
real(8) :: tmp
if (d2 <= (-2.1d-66)) then
tmp = d1 * (d2 + d4)
else
tmp = d1 * (d4 - d1)
end if
code = tmp
end function
public static double code(double d1, double d2, double d3, double d4) {
double tmp;
if (d2 <= -2.1e-66) {
tmp = d1 * (d2 + d4);
} else {
tmp = d1 * (d4 - d1);
}
return tmp;
}
def code(d1, d2, d3, d4): tmp = 0 if d2 <= -2.1e-66: tmp = d1 * (d2 + d4) else: tmp = d1 * (d4 - d1) return tmp
function code(d1, d2, d3, d4) tmp = 0.0 if (d2 <= -2.1e-66) tmp = Float64(d1 * Float64(d2 + d4)); else tmp = Float64(d1 * Float64(d4 - d1)); end return tmp end
function tmp_2 = code(d1, d2, d3, d4) tmp = 0.0; if (d2 <= -2.1e-66) tmp = d1 * (d2 + d4); else tmp = d1 * (d4 - d1); end tmp_2 = tmp; end
code[d1_, d2_, d3_, d4_] := If[LessEqual[d2, -2.1e-66], N[(d1 * N[(d2 + d4), $MachinePrecision]), $MachinePrecision], N[(d1 * N[(d4 - d1), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;d2 \leq -2.1 \cdot 10^{-66}:\\
\;\;\;\;d1 \cdot \left(d2 + d4\right)\\
\mathbf{else}:\\
\;\;\;\;d1 \cdot \left(d4 - d1\right)\\
\end{array}
\end{array}
if d2 < -2.1e-66Initial program 86.9%
associate--l+86.9%
distribute-lft-out--88.3%
distribute-rgt-out--90.8%
distribute-lft-out100.0%
Simplified100.0%
Taylor expanded in d1 around 0 90.1%
Taylor expanded in d3 around 0 73.0%
+-commutative73.0%
Simplified73.0%
if -2.1e-66 < d2 Initial program 88.2%
associate--l+88.2%
distribute-lft-out--89.4%
distribute-rgt-out--92.7%
distribute-lft-out100.0%
Simplified100.0%
Taylor expanded in d2 around 0 85.7%
Taylor expanded in d3 around 0 62.0%
Final simplification65.3%
(FPCore (d1 d2 d3 d4) :precision binary64 (if (<= d2 -2.65e-61) (* d1 (- d2 d1)) (* d1 (- d4 d1))))
double code(double d1, double d2, double d3, double d4) {
double tmp;
if (d2 <= -2.65e-61) {
tmp = d1 * (d2 - d1);
} else {
tmp = d1 * (d4 - d1);
}
return tmp;
}
real(8) function code(d1, d2, d3, d4)
real(8), intent (in) :: d1
real(8), intent (in) :: d2
real(8), intent (in) :: d3
real(8), intent (in) :: d4
real(8) :: tmp
if (d2 <= (-2.65d-61)) then
tmp = d1 * (d2 - d1)
else
tmp = d1 * (d4 - d1)
end if
code = tmp
end function
public static double code(double d1, double d2, double d3, double d4) {
double tmp;
if (d2 <= -2.65e-61) {
tmp = d1 * (d2 - d1);
} else {
tmp = d1 * (d4 - d1);
}
return tmp;
}
def code(d1, d2, d3, d4): tmp = 0 if d2 <= -2.65e-61: tmp = d1 * (d2 - d1) else: tmp = d1 * (d4 - d1) return tmp
function code(d1, d2, d3, d4) tmp = 0.0 if (d2 <= -2.65e-61) tmp = Float64(d1 * Float64(d2 - d1)); else tmp = Float64(d1 * Float64(d4 - d1)); end return tmp end
function tmp_2 = code(d1, d2, d3, d4) tmp = 0.0; if (d2 <= -2.65e-61) tmp = d1 * (d2 - d1); else tmp = d1 * (d4 - d1); end tmp_2 = tmp; end
code[d1_, d2_, d3_, d4_] := If[LessEqual[d2, -2.65e-61], N[(d1 * N[(d2 - d1), $MachinePrecision]), $MachinePrecision], N[(d1 * N[(d4 - d1), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;d2 \leq -2.65 \cdot 10^{-61}:\\
\;\;\;\;d1 \cdot \left(d2 - d1\right)\\
\mathbf{else}:\\
\;\;\;\;d1 \cdot \left(d4 - d1\right)\\
\end{array}
\end{array}
if d2 < -2.65e-61Initial program 88.1%
associate--l+88.1%
distribute-lft-out--89.4%
distribute-rgt-out--92.0%
distribute-lft-out100.0%
Simplified100.0%
Taylor expanded in d4 around 0 85.4%
Taylor expanded in d3 around 0 67.9%
if -2.65e-61 < d2 Initial program 87.7%
associate--l+87.7%
distribute-lft-out--88.9%
distribute-rgt-out--92.2%
distribute-lft-out100.0%
Simplified100.0%
Taylor expanded in d2 around 0 85.8%
Taylor expanded in d3 around 0 62.2%
Final simplification63.9%
(FPCore (d1 d2 d3 d4) :precision binary64 (if (<= d2 -2.1e-66) (* d1 (- d2 d3)) (* d1 (- d4 d1))))
double code(double d1, double d2, double d3, double d4) {
double tmp;
if (d2 <= -2.1e-66) {
tmp = d1 * (d2 - d3);
} else {
tmp = d1 * (d4 - d1);
}
return tmp;
}
real(8) function code(d1, d2, d3, d4)
real(8), intent (in) :: d1
real(8), intent (in) :: d2
real(8), intent (in) :: d3
real(8), intent (in) :: d4
real(8) :: tmp
if (d2 <= (-2.1d-66)) then
tmp = d1 * (d2 - d3)
else
tmp = d1 * (d4 - d1)
end if
code = tmp
end function
public static double code(double d1, double d2, double d3, double d4) {
double tmp;
if (d2 <= -2.1e-66) {
tmp = d1 * (d2 - d3);
} else {
tmp = d1 * (d4 - d1);
}
return tmp;
}
def code(d1, d2, d3, d4): tmp = 0 if d2 <= -2.1e-66: tmp = d1 * (d2 - d3) else: tmp = d1 * (d4 - d1) return tmp
function code(d1, d2, d3, d4) tmp = 0.0 if (d2 <= -2.1e-66) tmp = Float64(d1 * Float64(d2 - d3)); else tmp = Float64(d1 * Float64(d4 - d1)); end return tmp end
function tmp_2 = code(d1, d2, d3, d4) tmp = 0.0; if (d2 <= -2.1e-66) tmp = d1 * (d2 - d3); else tmp = d1 * (d4 - d1); end tmp_2 = tmp; end
code[d1_, d2_, d3_, d4_] := If[LessEqual[d2, -2.1e-66], N[(d1 * N[(d2 - d3), $MachinePrecision]), $MachinePrecision], N[(d1 * N[(d4 - d1), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;d2 \leq -2.1 \cdot 10^{-66}:\\
\;\;\;\;d1 \cdot \left(d2 - d3\right)\\
\mathbf{else}:\\
\;\;\;\;d1 \cdot \left(d4 - d1\right)\\
\end{array}
\end{array}
if d2 < -2.1e-66Initial program 86.9%
associate--l+86.9%
distribute-lft-out--88.3%
distribute-rgt-out--90.8%
distribute-lft-out100.0%
Simplified100.0%
Taylor expanded in d4 around 0 84.3%
Taylor expanded in d1 around 0 72.1%
if -2.1e-66 < d2 Initial program 88.2%
associate--l+88.2%
distribute-lft-out--89.4%
distribute-rgt-out--92.7%
distribute-lft-out100.0%
Simplified100.0%
Taylor expanded in d2 around 0 85.7%
Taylor expanded in d3 around 0 62.0%
Final simplification65.0%
(FPCore (d1 d2 d3 d4) :precision binary64 (if (<= d4 4.5e+87) (* d1 d2) (* d1 d4)))
double code(double d1, double d2, double d3, double d4) {
double tmp;
if (d4 <= 4.5e+87) {
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 <= 4.5d+87) 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 <= 4.5e+87) {
tmp = d1 * d2;
} else {
tmp = d1 * d4;
}
return tmp;
}
def code(d1, d2, d3, d4): tmp = 0 if d4 <= 4.5e+87: tmp = d1 * d2 else: tmp = d1 * d4 return tmp
function code(d1, d2, d3, d4) tmp = 0.0 if (d4 <= 4.5e+87) 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 <= 4.5e+87) tmp = d1 * d2; else tmp = d1 * d4; end tmp_2 = tmp; end
code[d1_, d2_, d3_, d4_] := If[LessEqual[d4, 4.5e+87], N[(d1 * d2), $MachinePrecision], N[(d1 * d4), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;d4 \leq 4.5 \cdot 10^{+87}:\\
\;\;\;\;d1 \cdot d2\\
\mathbf{else}:\\
\;\;\;\;d1 \cdot d4\\
\end{array}
\end{array}
if d4 < 4.5000000000000003e87Initial program 91.0%
associate--l+91.0%
distribute-lft-out--92.4%
distribute-rgt-out--94.8%
distribute-lft-out100.0%
Simplified100.0%
Taylor expanded in d2 around inf 36.0%
if 4.5000000000000003e87 < d4 Initial program 72.7%
associate--l+72.7%
distribute-lft-out--72.7%
distribute-rgt-out--79.5%
distribute-lft-out100.0%
Simplified100.0%
Taylor expanded in d4 around inf 72.5%
Final simplification42.3%
(FPCore (d1 d2 d3 d4) :precision binary64 (* d1 d4))
double code(double d1, double d2, double d3, double d4) {
return d1 * d4;
}
real(8) function code(d1, d2, d3, d4)
real(8), intent (in) :: d1
real(8), intent (in) :: d2
real(8), intent (in) :: d3
real(8), intent (in) :: d4
code = d1 * d4
end function
public static double code(double d1, double d2, double d3, double d4) {
return d1 * d4;
}
def code(d1, d2, d3, d4): return d1 * d4
function code(d1, d2, d3, d4) return Float64(d1 * d4) end
function tmp = code(d1, d2, d3, d4) tmp = d1 * d4; end
code[d1_, d2_, d3_, d4_] := N[(d1 * d4), $MachinePrecision]
\begin{array}{l}
\\
d1 \cdot d4
\end{array}
Initial program 87.8%
associate--l+87.8%
distribute-lft-out--89.0%
distribute-rgt-out--92.1%
distribute-lft-out100.0%
Simplified100.0%
Taylor expanded in d4 around inf 34.7%
Final simplification34.7%
(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 2023193
(FPCore (d1 d2 d3 d4)
:name "FastMath dist4"
:precision binary64
:herbie-target
(* d1 (- (+ (- d2 d3) d4) d1))
(- (+ (- (* d1 d2) (* d1 d3)) (* d4 d1)) (* d1 d1)))