
(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 d1) (- d4 d3))))
double code(double d1, double d2, double d3, double d4) {
return d1 * ((d2 - d1) + (d4 - d3));
}
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) + (d4 - d3))
end function
public static double code(double d1, double d2, double d3, double d4) {
return d1 * ((d2 - d1) + (d4 - d3));
}
def code(d1, d2, d3, d4): return d1 * ((d2 - d1) + (d4 - d3))
function code(d1, d2, d3, d4) return Float64(d1 * Float64(Float64(d2 - d1) + Float64(d4 - d3))) end
function tmp = code(d1, d2, d3, d4) tmp = d1 * ((d2 - d1) + (d4 - d3)); end
code[d1_, d2_, d3_, d4_] := N[(d1 * N[(N[(d2 - d1), $MachinePrecision] + N[(d4 - d3), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
d1 \cdot \left(\left(d2 - d1\right) + \left(d4 - d3\right)\right)
\end{array}
Initial program 91.0%
sub-neg91.0%
associate-+l+91.0%
*-commutative91.0%
+-commutative91.0%
*-commutative91.0%
sub-neg91.0%
+-commutative91.0%
associate--l+91.0%
distribute-lft-out--91.8%
distribute-rgt-out--93.0%
distribute-lft-out100.0%
+-commutative100.0%
sub-neg100.0%
+-commutative100.0%
remove-double-neg100.0%
sub-neg100.0%
sub-neg100.0%
distribute-neg-in100.0%
sub-neg100.0%
sub-neg100.0%
Simplified100.0%
Final simplification100.0%
(FPCore (d1 d2 d3 d4)
:precision binary64
(let* ((t_0 (* d1 (- d3))) (t_1 (* d1 (- d1))))
(if (<= d4 -1.1e-208)
(* d1 d2)
(if (<= d4 -1.6e-306)
t_1
(if (<= d4 1e-294)
(* d1 d2)
(if (<= d4 2.7e-70)
t_0
(if (<= d4 1.2e-35) t_1 (if (<= d4 8e+45) t_0 (* d1 d4)))))))))
double code(double d1, double d2, double d3, double d4) {
double t_0 = d1 * -d3;
double t_1 = d1 * -d1;
double tmp;
if (d4 <= -1.1e-208) {
tmp = d1 * d2;
} else if (d4 <= -1.6e-306) {
tmp = t_1;
} else if (d4 <= 1e-294) {
tmp = d1 * d2;
} else if (d4 <= 2.7e-70) {
tmp = t_0;
} else if (d4 <= 1.2e-35) {
tmp = t_1;
} else if (d4 <= 8e+45) {
tmp = t_0;
} else {
tmp = d1 * d4;
}
return tmp;
}
real(8) function code(d1, d2, d3, d4)
real(8), intent (in) :: d1
real(8), intent (in) :: d2
real(8), intent (in) :: d3
real(8), intent (in) :: d4
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = d1 * -d3
t_1 = d1 * -d1
if (d4 <= (-1.1d-208)) then
tmp = d1 * d2
else if (d4 <= (-1.6d-306)) then
tmp = t_1
else if (d4 <= 1d-294) then
tmp = d1 * d2
else if (d4 <= 2.7d-70) then
tmp = t_0
else if (d4 <= 1.2d-35) then
tmp = t_1
else if (d4 <= 8d+45) then
tmp = t_0
else
tmp = d1 * d4
end if
code = tmp
end function
public static double code(double d1, double d2, double d3, double d4) {
double t_0 = d1 * -d3;
double t_1 = d1 * -d1;
double tmp;
if (d4 <= -1.1e-208) {
tmp = d1 * d2;
} else if (d4 <= -1.6e-306) {
tmp = t_1;
} else if (d4 <= 1e-294) {
tmp = d1 * d2;
} else if (d4 <= 2.7e-70) {
tmp = t_0;
} else if (d4 <= 1.2e-35) {
tmp = t_1;
} else if (d4 <= 8e+45) {
tmp = t_0;
} else {
tmp = d1 * d4;
}
return tmp;
}
def code(d1, d2, d3, d4): t_0 = d1 * -d3 t_1 = d1 * -d1 tmp = 0 if d4 <= -1.1e-208: tmp = d1 * d2 elif d4 <= -1.6e-306: tmp = t_1 elif d4 <= 1e-294: tmp = d1 * d2 elif d4 <= 2.7e-70: tmp = t_0 elif d4 <= 1.2e-35: tmp = t_1 elif d4 <= 8e+45: tmp = t_0 else: tmp = d1 * d4 return tmp
function code(d1, d2, d3, d4) t_0 = Float64(d1 * Float64(-d3)) t_1 = Float64(d1 * Float64(-d1)) tmp = 0.0 if (d4 <= -1.1e-208) tmp = Float64(d1 * d2); elseif (d4 <= -1.6e-306) tmp = t_1; elseif (d4 <= 1e-294) tmp = Float64(d1 * d2); elseif (d4 <= 2.7e-70) tmp = t_0; elseif (d4 <= 1.2e-35) tmp = t_1; elseif (d4 <= 8e+45) tmp = t_0; else tmp = Float64(d1 * d4); end return tmp end
function tmp_2 = code(d1, d2, d3, d4) t_0 = d1 * -d3; t_1 = d1 * -d1; tmp = 0.0; if (d4 <= -1.1e-208) tmp = d1 * d2; elseif (d4 <= -1.6e-306) tmp = t_1; elseif (d4 <= 1e-294) tmp = d1 * d2; elseif (d4 <= 2.7e-70) tmp = t_0; elseif (d4 <= 1.2e-35) tmp = t_1; elseif (d4 <= 8e+45) tmp = t_0; else tmp = d1 * d4; end tmp_2 = tmp; end
code[d1_, d2_, d3_, d4_] := Block[{t$95$0 = N[(d1 * (-d3)), $MachinePrecision]}, Block[{t$95$1 = N[(d1 * (-d1)), $MachinePrecision]}, If[LessEqual[d4, -1.1e-208], N[(d1 * d2), $MachinePrecision], If[LessEqual[d4, -1.6e-306], t$95$1, If[LessEqual[d4, 1e-294], N[(d1 * d2), $MachinePrecision], If[LessEqual[d4, 2.7e-70], t$95$0, If[LessEqual[d4, 1.2e-35], t$95$1, If[LessEqual[d4, 8e+45], t$95$0, N[(d1 * d4), $MachinePrecision]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := d1 \cdot \left(-d3\right)\\
t_1 := d1 \cdot \left(-d1\right)\\
\mathbf{if}\;d4 \leq -1.1 \cdot 10^{-208}:\\
\;\;\;\;d1 \cdot d2\\
\mathbf{elif}\;d4 \leq -1.6 \cdot 10^{-306}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;d4 \leq 10^{-294}:\\
\;\;\;\;d1 \cdot d2\\
\mathbf{elif}\;d4 \leq 2.7 \cdot 10^{-70}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;d4 \leq 1.2 \cdot 10^{-35}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;d4 \leq 8 \cdot 10^{+45}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;d1 \cdot d4\\
\end{array}
\end{array}
if d4 < -1.1e-208 or -1.59999999999999985e-306 < d4 < 1.00000000000000002e-294Initial program 86.7%
sub-neg86.7%
associate-+l+86.7%
*-commutative86.7%
+-commutative86.7%
*-commutative86.7%
sub-neg86.7%
+-commutative86.7%
associate--l+86.7%
distribute-lft-out--87.6%
distribute-rgt-out--88.5%
distribute-lft-out100.0%
+-commutative100.0%
sub-neg100.0%
+-commutative100.0%
remove-double-neg100.0%
sub-neg100.0%
sub-neg100.0%
distribute-neg-in100.0%
sub-neg100.0%
sub-neg100.0%
Simplified100.0%
Taylor expanded in d2 around inf 30.4%
if -1.1e-208 < d4 < -1.59999999999999985e-306 or 2.7000000000000001e-70 < d4 < 1.2000000000000001e-35Initial program 100.0%
sub-neg100.0%
associate-+l+100.0%
*-commutative100.0%
+-commutative100.0%
*-commutative100.0%
sub-neg100.0%
+-commutative100.0%
associate--l+100.0%
distribute-lft-out--100.0%
distribute-rgt-out--100.0%
distribute-lft-out100.0%
+-commutative100.0%
sub-neg100.0%
+-commutative100.0%
remove-double-neg100.0%
sub-neg100.0%
sub-neg100.0%
distribute-neg-in100.0%
sub-neg100.0%
sub-neg100.0%
Simplified100.0%
Taylor expanded in d1 around inf 55.7%
neg-mul-155.7%
Simplified55.7%
if 1.00000000000000002e-294 < d4 < 2.7000000000000001e-70 or 1.2000000000000001e-35 < d4 < 7.9999999999999994e45Initial program 92.7%
sub-neg92.7%
associate-+l+92.7%
*-commutative92.7%
+-commutative92.7%
*-commutative92.7%
sub-neg92.7%
+-commutative92.7%
associate--l+92.8%
distribute-lft-out--92.8%
distribute-rgt-out--95.7%
distribute-lft-out99.9%
+-commutative99.9%
sub-neg99.9%
+-commutative99.9%
remove-double-neg99.9%
sub-neg99.9%
sub-neg99.9%
distribute-neg-in99.9%
sub-neg99.9%
sub-neg99.9%
Simplified99.9%
Taylor expanded in d3 around inf 50.4%
mul-1-neg50.4%
distribute-rgt-neg-out50.4%
Simplified50.4%
if 7.9999999999999994e45 < d4 Initial program 94.0%
sub-neg94.0%
associate-+l+94.0%
*-commutative94.0%
+-commutative94.0%
*-commutative94.0%
sub-neg94.0%
+-commutative94.0%
associate--l+94.0%
distribute-lft-out--96.0%
distribute-rgt-out--96.0%
distribute-lft-out100.0%
+-commutative100.0%
sub-neg100.0%
+-commutative100.0%
remove-double-neg100.0%
sub-neg100.0%
sub-neg100.0%
distribute-neg-in100.0%
sub-neg100.0%
sub-neg100.0%
Simplified100.0%
Taylor expanded in d4 around inf 69.5%
Final simplification45.8%
(FPCore (d1 d2 d3 d4)
:precision binary64
(let* ((t_0 (* d1 (- d2 d1))) (t_1 (* d1 (- d2 d3))))
(if (<= d4 -8.5e-299)
t_0
(if (<= d4 6e-70)
t_1
(if (<= d4 7.4e-37)
t_0
(if (<= d4 1.05e+28)
t_1
(if (<= d4 8.2e+152) (* d1 (- d4 d1)) (* d1 (+ d2 d4)))))))))
double code(double d1, double d2, double d3, double d4) {
double t_0 = d1 * (d2 - d1);
double t_1 = d1 * (d2 - d3);
double tmp;
if (d4 <= -8.5e-299) {
tmp = t_0;
} else if (d4 <= 6e-70) {
tmp = t_1;
} else if (d4 <= 7.4e-37) {
tmp = t_0;
} else if (d4 <= 1.05e+28) {
tmp = t_1;
} else if (d4 <= 8.2e+152) {
tmp = d1 * (d4 - 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) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = d1 * (d2 - d1)
t_1 = d1 * (d2 - d3)
if (d4 <= (-8.5d-299)) then
tmp = t_0
else if (d4 <= 6d-70) then
tmp = t_1
else if (d4 <= 7.4d-37) then
tmp = t_0
else if (d4 <= 1.05d+28) then
tmp = t_1
else if (d4 <= 8.2d+152) then
tmp = d1 * (d4 - 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 t_0 = d1 * (d2 - d1);
double t_1 = d1 * (d2 - d3);
double tmp;
if (d4 <= -8.5e-299) {
tmp = t_0;
} else if (d4 <= 6e-70) {
tmp = t_1;
} else if (d4 <= 7.4e-37) {
tmp = t_0;
} else if (d4 <= 1.05e+28) {
tmp = t_1;
} else if (d4 <= 8.2e+152) {
tmp = d1 * (d4 - d1);
} else {
tmp = d1 * (d2 + d4);
}
return tmp;
}
def code(d1, d2, d3, d4): t_0 = d1 * (d2 - d1) t_1 = d1 * (d2 - d3) tmp = 0 if d4 <= -8.5e-299: tmp = t_0 elif d4 <= 6e-70: tmp = t_1 elif d4 <= 7.4e-37: tmp = t_0 elif d4 <= 1.05e+28: tmp = t_1 elif d4 <= 8.2e+152: tmp = d1 * (d4 - d1) else: tmp = d1 * (d2 + d4) return tmp
function code(d1, d2, d3, d4) t_0 = Float64(d1 * Float64(d2 - d1)) t_1 = Float64(d1 * Float64(d2 - d3)) tmp = 0.0 if (d4 <= -8.5e-299) tmp = t_0; elseif (d4 <= 6e-70) tmp = t_1; elseif (d4 <= 7.4e-37) tmp = t_0; elseif (d4 <= 1.05e+28) tmp = t_1; elseif (d4 <= 8.2e+152) tmp = Float64(d1 * Float64(d4 - d1)); else tmp = Float64(d1 * Float64(d2 + d4)); end return tmp end
function tmp_2 = code(d1, d2, d3, d4) t_0 = d1 * (d2 - d1); t_1 = d1 * (d2 - d3); tmp = 0.0; if (d4 <= -8.5e-299) tmp = t_0; elseif (d4 <= 6e-70) tmp = t_1; elseif (d4 <= 7.4e-37) tmp = t_0; elseif (d4 <= 1.05e+28) tmp = t_1; elseif (d4 <= 8.2e+152) tmp = d1 * (d4 - d1); 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]}, Block[{t$95$1 = N[(d1 * N[(d2 - d3), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[d4, -8.5e-299], t$95$0, If[LessEqual[d4, 6e-70], t$95$1, If[LessEqual[d4, 7.4e-37], t$95$0, If[LessEqual[d4, 1.05e+28], t$95$1, If[LessEqual[d4, 8.2e+152], N[(d1 * N[(d4 - d1), $MachinePrecision]), $MachinePrecision], N[(d1 * N[(d2 + d4), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := d1 \cdot \left(d2 - d1\right)\\
t_1 := d1 \cdot \left(d2 - d3\right)\\
\mathbf{if}\;d4 \leq -8.5 \cdot 10^{-299}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;d4 \leq 6 \cdot 10^{-70}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;d4 \leq 7.4 \cdot 10^{-37}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;d4 \leq 1.05 \cdot 10^{+28}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;d4 \leq 8.2 \cdot 10^{+152}:\\
\;\;\;\;d1 \cdot \left(d4 - d1\right)\\
\mathbf{else}:\\
\;\;\;\;d1 \cdot \left(d2 + d4\right)\\
\end{array}
\end{array}
if d4 < -8.5e-299 or 6.0000000000000003e-70 < d4 < 7.4e-37Initial program 89.4%
sub-neg89.4%
associate-+l+89.4%
*-commutative89.4%
+-commutative89.4%
*-commutative89.4%
sub-neg89.4%
+-commutative89.4%
associate--l+89.4%
distribute-lft-out--90.2%
distribute-rgt-out--91.0%
distribute-lft-out100.0%
+-commutative100.0%
sub-neg100.0%
+-commutative100.0%
remove-double-neg100.0%
sub-neg100.0%
sub-neg100.0%
distribute-neg-in100.0%
sub-neg100.0%
sub-neg100.0%
Simplified100.0%
Taylor expanded in d3 around 0 78.3%
Taylor expanded in d4 around 0 56.5%
if -8.5e-299 < d4 < 6.0000000000000003e-70 or 7.4e-37 < d4 < 1.04999999999999995e28Initial program 92.4%
sub-neg92.4%
associate-+l+92.4%
*-commutative92.4%
+-commutative92.4%
*-commutative92.4%
sub-neg92.4%
+-commutative92.4%
associate--l+92.4%
distribute-lft-out--92.4%
distribute-rgt-out--95.5%
distribute-lft-out99.9%
+-commutative99.9%
sub-neg99.9%
+-commutative99.9%
remove-double-neg99.9%
sub-neg99.9%
sub-neg99.9%
distribute-neg-in99.9%
sub-neg99.9%
sub-neg99.9%
Simplified99.9%
Taylor expanded in d1 around 0 83.2%
Taylor expanded in d4 around 0 80.9%
if 1.04999999999999995e28 < d4 < 8.1999999999999996e152Initial program 92.0%
sub-neg92.0%
associate-+l+92.0%
*-commutative92.0%
+-commutative92.0%
*-commutative92.0%
sub-neg92.0%
+-commutative92.0%
associate--l+92.0%
distribute-lft-out--96.0%
distribute-rgt-out--96.0%
distribute-lft-out100.0%
+-commutative100.0%
sub-neg100.0%
+-commutative100.0%
remove-double-neg100.0%
sub-neg100.0%
sub-neg100.0%
distribute-neg-in100.0%
sub-neg100.0%
sub-neg100.0%
Simplified100.0%
Taylor expanded in d3 around 0 80.1%
Taylor expanded in d2 around 0 61.1%
if 8.1999999999999996e152 < d4 Initial program 93.7%
sub-neg93.7%
associate-+l+93.7%
*-commutative93.7%
+-commutative93.7%
*-commutative93.7%
sub-neg93.7%
+-commutative93.7%
associate--l+93.7%
distribute-lft-out--93.7%
distribute-rgt-out--93.7%
distribute-lft-out100.0%
+-commutative100.0%
sub-neg100.0%
+-commutative100.0%
remove-double-neg100.0%
sub-neg100.0%
sub-neg100.0%
distribute-neg-in100.0%
sub-neg100.0%
sub-neg100.0%
Simplified100.0%
Taylor expanded in d1 around 0 100.0%
Taylor expanded in d3 around 0 93.8%
+-commutative93.8%
Simplified93.8%
Final simplification67.9%
(FPCore (d1 d2 d3 d4)
:precision binary64
(let* ((t_0 (* d1 (- d2 d1))) (t_1 (* d1 (- d2 d3))))
(if (<= d4 -1.85e-299)
t_0
(if (<= d4 2e-71)
t_1
(if (<= d4 1.12e-35) t_0 (if (<= d4 1.3e+45) t_1 (* d1 (+ d2 d4))))))))
double code(double d1, double d2, double d3, double d4) {
double t_0 = d1 * (d2 - d1);
double t_1 = d1 * (d2 - d3);
double tmp;
if (d4 <= -1.85e-299) {
tmp = t_0;
} else if (d4 <= 2e-71) {
tmp = t_1;
} else if (d4 <= 1.12e-35) {
tmp = t_0;
} else if (d4 <= 1.3e+45) {
tmp = t_1;
} 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) :: t_1
real(8) :: tmp
t_0 = d1 * (d2 - d1)
t_1 = d1 * (d2 - d3)
if (d4 <= (-1.85d-299)) then
tmp = t_0
else if (d4 <= 2d-71) then
tmp = t_1
else if (d4 <= 1.12d-35) then
tmp = t_0
else if (d4 <= 1.3d+45) then
tmp = t_1
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 t_1 = d1 * (d2 - d3);
double tmp;
if (d4 <= -1.85e-299) {
tmp = t_0;
} else if (d4 <= 2e-71) {
tmp = t_1;
} else if (d4 <= 1.12e-35) {
tmp = t_0;
} else if (d4 <= 1.3e+45) {
tmp = t_1;
} else {
tmp = d1 * (d2 + d4);
}
return tmp;
}
def code(d1, d2, d3, d4): t_0 = d1 * (d2 - d1) t_1 = d1 * (d2 - d3) tmp = 0 if d4 <= -1.85e-299: tmp = t_0 elif d4 <= 2e-71: tmp = t_1 elif d4 <= 1.12e-35: tmp = t_0 elif d4 <= 1.3e+45: tmp = t_1 else: tmp = d1 * (d2 + d4) return tmp
function code(d1, d2, d3, d4) t_0 = Float64(d1 * Float64(d2 - d1)) t_1 = Float64(d1 * Float64(d2 - d3)) tmp = 0.0 if (d4 <= -1.85e-299) tmp = t_0; elseif (d4 <= 2e-71) tmp = t_1; elseif (d4 <= 1.12e-35) tmp = t_0; elseif (d4 <= 1.3e+45) tmp = t_1; else tmp = Float64(d1 * Float64(d2 + d4)); end return tmp end
function tmp_2 = code(d1, d2, d3, d4) t_0 = d1 * (d2 - d1); t_1 = d1 * (d2 - d3); tmp = 0.0; if (d4 <= -1.85e-299) tmp = t_0; elseif (d4 <= 2e-71) tmp = t_1; elseif (d4 <= 1.12e-35) tmp = t_0; elseif (d4 <= 1.3e+45) tmp = t_1; 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]}, Block[{t$95$1 = N[(d1 * N[(d2 - d3), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[d4, -1.85e-299], t$95$0, If[LessEqual[d4, 2e-71], t$95$1, If[LessEqual[d4, 1.12e-35], t$95$0, If[LessEqual[d4, 1.3e+45], t$95$1, N[(d1 * N[(d2 + d4), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := d1 \cdot \left(d2 - d1\right)\\
t_1 := d1 \cdot \left(d2 - d3\right)\\
\mathbf{if}\;d4 \leq -1.85 \cdot 10^{-299}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;d4 \leq 2 \cdot 10^{-71}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;d4 \leq 1.12 \cdot 10^{-35}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;d4 \leq 1.3 \cdot 10^{+45}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;d1 \cdot \left(d2 + d4\right)\\
\end{array}
\end{array}
if d4 < -1.85000000000000007e-299 or 1.9999999999999998e-71 < d4 < 1.12e-35Initial program 89.4%
sub-neg89.4%
associate-+l+89.4%
*-commutative89.4%
+-commutative89.4%
*-commutative89.4%
sub-neg89.4%
+-commutative89.4%
associate--l+89.4%
distribute-lft-out--90.2%
distribute-rgt-out--91.0%
distribute-lft-out100.0%
+-commutative100.0%
sub-neg100.0%
+-commutative100.0%
remove-double-neg100.0%
sub-neg100.0%
sub-neg100.0%
distribute-neg-in100.0%
sub-neg100.0%
sub-neg100.0%
Simplified100.0%
Taylor expanded in d3 around 0 78.3%
Taylor expanded in d4 around 0 56.5%
if -1.85000000000000007e-299 < d4 < 1.9999999999999998e-71 or 1.12e-35 < d4 < 1.30000000000000004e45Initial program 91.8%
sub-neg91.8%
associate-+l+91.8%
*-commutative91.8%
+-commutative91.8%
*-commutative91.8%
sub-neg91.8%
+-commutative91.8%
associate--l+91.8%
distribute-lft-out--91.8%
distribute-rgt-out--94.5%
distribute-lft-out99.9%
+-commutative99.9%
sub-neg99.9%
+-commutative99.9%
remove-double-neg99.9%
sub-neg99.9%
sub-neg99.9%
distribute-neg-in99.9%
sub-neg99.9%
sub-neg99.9%
Simplified99.9%
Taylor expanded in d1 around 0 82.2%
Taylor expanded in d4 around 0 80.1%
if 1.30000000000000004e45 < d4 Initial program 94.0%
sub-neg94.0%
associate-+l+94.0%
*-commutative94.0%
+-commutative94.0%
*-commutative94.0%
sub-neg94.0%
+-commutative94.0%
associate--l+94.0%
distribute-lft-out--96.0%
distribute-rgt-out--96.0%
distribute-lft-out100.0%
+-commutative100.0%
sub-neg100.0%
+-commutative100.0%
remove-double-neg100.0%
sub-neg100.0%
sub-neg100.0%
distribute-neg-in100.0%
sub-neg100.0%
sub-neg100.0%
Simplified100.0%
Taylor expanded in d1 around 0 96.0%
Taylor expanded in d3 around 0 82.0%
+-commutative82.0%
Simplified82.0%
Final simplification68.2%
(FPCore (d1 d2 d3 d4)
:precision binary64
(let* ((t_0 (* d1 (- d2 d1))))
(if (<= d4 -2.7e-298)
t_0
(if (<= d4 5.4e-70)
(* d1 (- d2 d3))
(if (<= d4 2.2e-34) t_0 (* d1 (- d4 d3)))))))
double code(double d1, double d2, double d3, double d4) {
double t_0 = d1 * (d2 - d1);
double tmp;
if (d4 <= -2.7e-298) {
tmp = t_0;
} else if (d4 <= 5.4e-70) {
tmp = d1 * (d2 - d3);
} else if (d4 <= 2.2e-34) {
tmp = t_0;
} else {
tmp = d1 * (d4 - d3);
}
return tmp;
}
real(8) function code(d1, d2, d3, d4)
real(8), intent (in) :: d1
real(8), intent (in) :: d2
real(8), intent (in) :: d3
real(8), intent (in) :: d4
real(8) :: t_0
real(8) :: tmp
t_0 = d1 * (d2 - d1)
if (d4 <= (-2.7d-298)) then
tmp = t_0
else if (d4 <= 5.4d-70) then
tmp = d1 * (d2 - d3)
else if (d4 <= 2.2d-34) then
tmp = t_0
else
tmp = d1 * (d4 - d3)
end if
code = tmp
end function
public static double code(double d1, double d2, double d3, double d4) {
double t_0 = d1 * (d2 - d1);
double tmp;
if (d4 <= -2.7e-298) {
tmp = t_0;
} else if (d4 <= 5.4e-70) {
tmp = d1 * (d2 - d3);
} else if (d4 <= 2.2e-34) {
tmp = t_0;
} else {
tmp = d1 * (d4 - d3);
}
return tmp;
}
def code(d1, d2, d3, d4): t_0 = d1 * (d2 - d1) tmp = 0 if d4 <= -2.7e-298: tmp = t_0 elif d4 <= 5.4e-70: tmp = d1 * (d2 - d3) elif d4 <= 2.2e-34: tmp = t_0 else: tmp = d1 * (d4 - d3) return tmp
function code(d1, d2, d3, d4) t_0 = Float64(d1 * Float64(d2 - d1)) tmp = 0.0 if (d4 <= -2.7e-298) tmp = t_0; elseif (d4 <= 5.4e-70) tmp = Float64(d1 * Float64(d2 - d3)); elseif (d4 <= 2.2e-34) tmp = t_0; else tmp = Float64(d1 * Float64(d4 - d3)); end return tmp end
function tmp_2 = code(d1, d2, d3, d4) t_0 = d1 * (d2 - d1); tmp = 0.0; if (d4 <= -2.7e-298) tmp = t_0; elseif (d4 <= 5.4e-70) tmp = d1 * (d2 - d3); elseif (d4 <= 2.2e-34) tmp = t_0; else tmp = d1 * (d4 - d3); end tmp_2 = tmp; end
code[d1_, d2_, d3_, d4_] := Block[{t$95$0 = N[(d1 * N[(d2 - d1), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[d4, -2.7e-298], t$95$0, If[LessEqual[d4, 5.4e-70], N[(d1 * N[(d2 - d3), $MachinePrecision]), $MachinePrecision], If[LessEqual[d4, 2.2e-34], t$95$0, N[(d1 * N[(d4 - d3), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := d1 \cdot \left(d2 - d1\right)\\
\mathbf{if}\;d4 \leq -2.7 \cdot 10^{-298}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;d4 \leq 5.4 \cdot 10^{-70}:\\
\;\;\;\;d1 \cdot \left(d2 - d3\right)\\
\mathbf{elif}\;d4 \leq 2.2 \cdot 10^{-34}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;d1 \cdot \left(d4 - d3\right)\\
\end{array}
\end{array}
if d4 < -2.7000000000000001e-298 or 5.4000000000000003e-70 < d4 < 2.1999999999999999e-34Initial program 89.4%
sub-neg89.4%
associate-+l+89.4%
*-commutative89.4%
+-commutative89.4%
*-commutative89.4%
sub-neg89.4%
+-commutative89.4%
associate--l+89.4%
distribute-lft-out--90.2%
distribute-rgt-out--91.0%
distribute-lft-out100.0%
+-commutative100.0%
sub-neg100.0%
+-commutative100.0%
remove-double-neg100.0%
sub-neg100.0%
sub-neg100.0%
distribute-neg-in100.0%
sub-neg100.0%
sub-neg100.0%
Simplified100.0%
Taylor expanded in d3 around 0 78.3%
Taylor expanded in d4 around 0 56.5%
if -2.7000000000000001e-298 < d4 < 5.4000000000000003e-70Initial program 90.9%
sub-neg90.9%
associate-+l+90.9%
*-commutative90.9%
+-commutative90.9%
*-commutative90.9%
sub-neg90.9%
+-commutative90.9%
associate--l+90.9%
distribute-lft-out--90.9%
distribute-rgt-out--94.5%
distribute-lft-out99.9%
+-commutative99.9%
sub-neg99.9%
+-commutative99.9%
remove-double-neg99.9%
sub-neg99.9%
sub-neg99.9%
distribute-neg-in99.9%
sub-neg99.9%
sub-neg99.9%
Simplified99.9%
Taylor expanded in d1 around 0 82.2%
Taylor expanded in d4 around 0 82.2%
if 2.1999999999999999e-34 < d4 Initial program 94.1%
sub-neg94.1%
associate-+l+94.1%
*-commutative94.1%
+-commutative94.1%
*-commutative94.1%
sub-neg94.1%
+-commutative94.1%
associate--l+94.1%
distribute-lft-out--95.6%
distribute-rgt-out--95.6%
distribute-lft-out100.0%
+-commutative100.0%
sub-neg100.0%
+-commutative100.0%
remove-double-neg100.0%
sub-neg100.0%
sub-neg100.0%
distribute-neg-in100.0%
sub-neg100.0%
sub-neg100.0%
Simplified100.0%
Taylor expanded in d1 around 0 90.9%
Taylor expanded in d2 around 0 76.0%
Final simplification67.2%
(FPCore (d1 d2 d3 d4) :precision binary64 (if (or (<= d3 -2.9e+182) (not (<= d3 5.6e+105))) (* d1 (- d2 d3)) (* d1 (- (+ d2 d4) d1))))
double code(double d1, double d2, double d3, double d4) {
double tmp;
if ((d3 <= -2.9e+182) || !(d3 <= 5.6e+105)) {
tmp = d1 * (d2 - 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 ((d3 <= (-2.9d+182)) .or. (.not. (d3 <= 5.6d+105))) then
tmp = d1 * (d2 - 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 ((d3 <= -2.9e+182) || !(d3 <= 5.6e+105)) {
tmp = d1 * (d2 - d3);
} else {
tmp = d1 * ((d2 + d4) - d1);
}
return tmp;
}
def code(d1, d2, d3, d4): tmp = 0 if (d3 <= -2.9e+182) or not (d3 <= 5.6e+105): tmp = d1 * (d2 - d3) else: tmp = d1 * ((d2 + d4) - d1) return tmp
function code(d1, d2, d3, d4) tmp = 0.0 if ((d3 <= -2.9e+182) || !(d3 <= 5.6e+105)) tmp = Float64(d1 * Float64(d2 - 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 ((d3 <= -2.9e+182) || ~((d3 <= 5.6e+105))) tmp = d1 * (d2 - d3); else tmp = d1 * ((d2 + d4) - d1); end tmp_2 = tmp; end
code[d1_, d2_, d3_, d4_] := If[Or[LessEqual[d3, -2.9e+182], N[Not[LessEqual[d3, 5.6e+105]], $MachinePrecision]], N[(d1 * N[(d2 - d3), $MachinePrecision]), $MachinePrecision], N[(d1 * N[(N[(d2 + d4), $MachinePrecision] - d1), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;d3 \leq -2.9 \cdot 10^{+182} \lor \neg \left(d3 \leq 5.6 \cdot 10^{+105}\right):\\
\;\;\;\;d1 \cdot \left(d2 - d3\right)\\
\mathbf{else}:\\
\;\;\;\;d1 \cdot \left(\left(d2 + d4\right) - d1\right)\\
\end{array}
\end{array}
if d3 < -2.8999999999999998e182 or 5.6000000000000003e105 < d3 Initial program 87.1%
sub-neg87.1%
associate-+l+87.1%
*-commutative87.1%
+-commutative87.1%
*-commutative87.1%
sub-neg87.1%
+-commutative87.1%
associate--l+87.1%
distribute-lft-out--90.0%
distribute-rgt-out--91.4%
distribute-lft-out99.9%
+-commutative99.9%
sub-neg99.9%
+-commutative99.9%
remove-double-neg99.9%
sub-neg99.9%
sub-neg99.9%
distribute-neg-in99.9%
sub-neg99.9%
sub-neg99.9%
Simplified99.9%
Taylor expanded in d1 around 0 95.6%
Taylor expanded in d4 around 0 86.7%
if -2.8999999999999998e182 < d3 < 5.6000000000000003e105Initial program 92.4%
sub-neg92.4%
associate-+l+92.4%
*-commutative92.4%
+-commutative92.4%
*-commutative92.4%
sub-neg92.4%
+-commutative92.4%
associate--l+92.5%
distribute-lft-out--92.5%
distribute-rgt-out--93.5%
distribute-lft-out100.0%
+-commutative100.0%
sub-neg100.0%
+-commutative100.0%
remove-double-neg100.0%
sub-neg100.0%
sub-neg100.0%
distribute-neg-in100.0%
sub-neg100.0%
sub-neg100.0%
Simplified100.0%
Taylor expanded in d3 around 0 91.3%
Final simplification90.1%
(FPCore (d1 d2 d3 d4) :precision binary64 (if (or (<= d1 -4e+66) (not (<= d1 1.02e+35))) (* d1 (- (+ d2 d4) d1)) (* d1 (- (+ d2 d4) d3))))
double code(double d1, double d2, double d3, double d4) {
double tmp;
if ((d1 <= -4e+66) || !(d1 <= 1.02e+35)) {
tmp = d1 * ((d2 + d4) - d1);
} 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 ((d1 <= (-4d+66)) .or. (.not. (d1 <= 1.02d+35))) then
tmp = d1 * ((d2 + d4) - d1)
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 ((d1 <= -4e+66) || !(d1 <= 1.02e+35)) {
tmp = d1 * ((d2 + d4) - d1);
} else {
tmp = d1 * ((d2 + d4) - d3);
}
return tmp;
}
def code(d1, d2, d3, d4): tmp = 0 if (d1 <= -4e+66) or not (d1 <= 1.02e+35): tmp = d1 * ((d2 + d4) - d1) else: tmp = d1 * ((d2 + d4) - d3) return tmp
function code(d1, d2, d3, d4) tmp = 0.0 if ((d1 <= -4e+66) || !(d1 <= 1.02e+35)) tmp = Float64(d1 * Float64(Float64(d2 + d4) - d1)); 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 ((d1 <= -4e+66) || ~((d1 <= 1.02e+35))) tmp = d1 * ((d2 + d4) - d1); else tmp = d1 * ((d2 + d4) - d3); end tmp_2 = tmp; end
code[d1_, d2_, d3_, d4_] := If[Or[LessEqual[d1, -4e+66], N[Not[LessEqual[d1, 1.02e+35]], $MachinePrecision]], N[(d1 * N[(N[(d2 + d4), $MachinePrecision] - d1), $MachinePrecision]), $MachinePrecision], N[(d1 * N[(N[(d2 + d4), $MachinePrecision] - d3), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;d1 \leq -4 \cdot 10^{+66} \lor \neg \left(d1 \leq 1.02 \cdot 10^{+35}\right):\\
\;\;\;\;d1 \cdot \left(\left(d2 + d4\right) - d1\right)\\
\mathbf{else}:\\
\;\;\;\;d1 \cdot \left(\left(d2 + d4\right) - d3\right)\\
\end{array}
\end{array}
if d1 < -3.99999999999999978e66 or 1.02000000000000007e35 < d1 Initial program 78.7%
sub-neg78.7%
associate-+l+78.7%
*-commutative78.7%
+-commutative78.7%
*-commutative78.7%
sub-neg78.7%
+-commutative78.7%
associate--l+78.7%
distribute-lft-out--80.5%
distribute-rgt-out--83.3%
distribute-lft-out100.0%
+-commutative100.0%
sub-neg100.0%
+-commutative100.0%
remove-double-neg100.0%
sub-neg100.0%
sub-neg100.0%
distribute-neg-in100.0%
sub-neg100.0%
sub-neg100.0%
Simplified100.0%
Taylor expanded in d3 around 0 90.9%
if -3.99999999999999978e66 < d1 < 1.02000000000000007e35Initial program 100.0%
sub-neg100.0%
associate-+l+100.0%
*-commutative100.0%
+-commutative100.0%
*-commutative100.0%
sub-neg100.0%
+-commutative100.0%
associate--l+100.0%
distribute-lft-out--100.0%
distribute-rgt-out--100.0%
distribute-lft-out99.9%
+-commutative99.9%
sub-neg99.9%
+-commutative99.9%
remove-double-neg99.9%
sub-neg99.9%
sub-neg99.9%
distribute-neg-in99.9%
sub-neg99.9%
sub-neg99.9%
Simplified99.9%
Taylor expanded in d1 around 0 97.7%
Final simplification94.8%
(FPCore (d1 d2 d3 d4) :precision binary64 (if (<= d4 1e-294) (* d1 (- d2 d1)) (if (<= d4 9.2e+73) (* d1 (- (- d1) d3)) (* d1 (- d4 d3)))))
double code(double d1, double d2, double d3, double d4) {
double tmp;
if (d4 <= 1e-294) {
tmp = d1 * (d2 - d1);
} else if (d4 <= 9.2e+73) {
tmp = d1 * (-d1 - d3);
} else {
tmp = d1 * (d4 - d3);
}
return tmp;
}
real(8) function code(d1, d2, d3, d4)
real(8), intent (in) :: d1
real(8), intent (in) :: d2
real(8), intent (in) :: d3
real(8), intent (in) :: d4
real(8) :: tmp
if (d4 <= 1d-294) then
tmp = d1 * (d2 - d1)
else if (d4 <= 9.2d+73) then
tmp = d1 * (-d1 - d3)
else
tmp = d1 * (d4 - d3)
end if
code = tmp
end function
public static double code(double d1, double d2, double d3, double d4) {
double tmp;
if (d4 <= 1e-294) {
tmp = d1 * (d2 - d1);
} else if (d4 <= 9.2e+73) {
tmp = d1 * (-d1 - d3);
} else {
tmp = d1 * (d4 - d3);
}
return tmp;
}
def code(d1, d2, d3, d4): tmp = 0 if d4 <= 1e-294: tmp = d1 * (d2 - d1) elif d4 <= 9.2e+73: tmp = d1 * (-d1 - d3) else: tmp = d1 * (d4 - d3) return tmp
function code(d1, d2, d3, d4) tmp = 0.0 if (d4 <= 1e-294) tmp = Float64(d1 * Float64(d2 - d1)); elseif (d4 <= 9.2e+73) tmp = Float64(d1 * Float64(Float64(-d1) - d3)); else tmp = Float64(d1 * Float64(d4 - d3)); end return tmp end
function tmp_2 = code(d1, d2, d3, d4) tmp = 0.0; if (d4 <= 1e-294) tmp = d1 * (d2 - d1); elseif (d4 <= 9.2e+73) tmp = d1 * (-d1 - d3); else tmp = d1 * (d4 - d3); end tmp_2 = tmp; end
code[d1_, d2_, d3_, d4_] := If[LessEqual[d4, 1e-294], N[(d1 * N[(d2 - d1), $MachinePrecision]), $MachinePrecision], If[LessEqual[d4, 9.2e+73], N[(d1 * N[((-d1) - d3), $MachinePrecision]), $MachinePrecision], N[(d1 * N[(d4 - d3), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;d4 \leq 10^{-294}:\\
\;\;\;\;d1 \cdot \left(d2 - d1\right)\\
\mathbf{elif}\;d4 \leq 9.2 \cdot 10^{+73}:\\
\;\;\;\;d1 \cdot \left(\left(-d1\right) - d3\right)\\
\mathbf{else}:\\
\;\;\;\;d1 \cdot \left(d4 - d3\right)\\
\end{array}
\end{array}
if d4 < 1.00000000000000002e-294Initial program 88.3%
sub-neg88.3%
associate-+l+88.3%
*-commutative88.3%
+-commutative88.3%
*-commutative88.3%
sub-neg88.3%
+-commutative88.3%
associate--l+88.3%
distribute-lft-out--89.1%
distribute-rgt-out--89.9%
distribute-lft-out100.0%
+-commutative100.0%
sub-neg100.0%
+-commutative100.0%
remove-double-neg100.0%
sub-neg100.0%
sub-neg100.0%
distribute-neg-in100.0%
sub-neg100.0%
sub-neg100.0%
Simplified100.0%
Taylor expanded in d3 around 0 77.5%
Taylor expanded in d4 around 0 55.1%
if 1.00000000000000002e-294 < d4 < 9.199999999999999e73Initial program 93.9%
sub-neg93.9%
associate-+l+93.9%
*-commutative93.9%
+-commutative93.9%
*-commutative93.9%
sub-neg93.9%
+-commutative93.9%
associate--l+93.9%
distribute-lft-out--93.9%
distribute-rgt-out--96.3%
distribute-lft-out99.9%
+-commutative99.9%
sub-neg99.9%
+-commutative99.9%
remove-double-neg99.9%
sub-neg99.9%
sub-neg99.9%
distribute-neg-in99.9%
sub-neg99.9%
sub-neg99.9%
Simplified99.9%
Taylor expanded in d4 around 0 95.4%
associate--r+95.4%
Simplified95.4%
Taylor expanded in d2 around 0 70.9%
associate-*r*70.9%
neg-mul-170.9%
Simplified70.9%
if 9.199999999999999e73 < d4 Initial program 93.3%
sub-neg93.3%
associate-+l+93.3%
*-commutative93.3%
+-commutative93.3%
*-commutative93.3%
sub-neg93.3%
+-commutative93.3%
associate--l+93.3%
distribute-lft-out--95.5%
distribute-rgt-out--95.5%
distribute-lft-out100.0%
+-commutative100.0%
sub-neg100.0%
+-commutative100.0%
remove-double-neg100.0%
sub-neg100.0%
sub-neg100.0%
distribute-neg-in100.0%
sub-neg100.0%
sub-neg100.0%
Simplified100.0%
Taylor expanded in d1 around 0 100.0%
Taylor expanded in d2 around 0 86.1%
Final simplification65.6%
(FPCore (d1 d2 d3 d4) :precision binary64 (if (or (<= d3 -2e+176) (not (<= d3 7.8e+114))) (* d1 (- d3)) (* d1 (+ d2 d4))))
double code(double d1, double d2, double d3, double d4) {
double tmp;
if ((d3 <= -2e+176) || !(d3 <= 7.8e+114)) {
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 <= (-2d+176)) .or. (.not. (d3 <= 7.8d+114))) 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 <= -2e+176) || !(d3 <= 7.8e+114)) {
tmp = d1 * -d3;
} else {
tmp = d1 * (d2 + d4);
}
return tmp;
}
def code(d1, d2, d3, d4): tmp = 0 if (d3 <= -2e+176) or not (d3 <= 7.8e+114): tmp = d1 * -d3 else: tmp = d1 * (d2 + d4) return tmp
function code(d1, d2, d3, d4) tmp = 0.0 if ((d3 <= -2e+176) || !(d3 <= 7.8e+114)) 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 <= -2e+176) || ~((d3 <= 7.8e+114))) tmp = d1 * -d3; else tmp = d1 * (d2 + d4); end tmp_2 = tmp; end
code[d1_, d2_, d3_, d4_] := If[Or[LessEqual[d3, -2e+176], N[Not[LessEqual[d3, 7.8e+114]], $MachinePrecision]], N[(d1 * (-d3)), $MachinePrecision], N[(d1 * N[(d2 + d4), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;d3 \leq -2 \cdot 10^{+176} \lor \neg \left(d3 \leq 7.8 \cdot 10^{+114}\right):\\
\;\;\;\;d1 \cdot \left(-d3\right)\\
\mathbf{else}:\\
\;\;\;\;d1 \cdot \left(d2 + d4\right)\\
\end{array}
\end{array}
if d3 < -2e176 or 7.8000000000000001e114 < d3 Initial program 85.9%
sub-neg85.9%
associate-+l+85.9%
*-commutative85.9%
+-commutative85.9%
*-commutative85.9%
sub-neg85.9%
+-commutative85.9%
associate--l+85.9%
distribute-lft-out--89.0%
distribute-rgt-out--90.6%
distribute-lft-out99.9%
+-commutative99.9%
sub-neg99.9%
+-commutative99.9%
remove-double-neg99.9%
sub-neg99.9%
sub-neg99.9%
distribute-neg-in99.9%
sub-neg99.9%
sub-neg99.9%
Simplified99.9%
Taylor expanded in d3 around inf 84.9%
mul-1-neg84.9%
distribute-rgt-neg-out84.9%
Simplified84.9%
if -2e176 < d3 < 7.8000000000000001e114Initial program 92.7%
sub-neg92.7%
associate-+l+92.7%
*-commutative92.7%
+-commutative92.7%
*-commutative92.7%
sub-neg92.7%
+-commutative92.7%
associate--l+92.7%
distribute-lft-out--92.7%
distribute-rgt-out--93.7%
distribute-lft-out100.0%
+-commutative100.0%
sub-neg100.0%
+-commutative100.0%
remove-double-neg100.0%
sub-neg100.0%
sub-neg100.0%
distribute-neg-in100.0%
sub-neg100.0%
sub-neg100.0%
Simplified100.0%
Taylor expanded in d1 around 0 77.1%
Taylor expanded in d3 around 0 67.1%
+-commutative67.1%
Simplified67.1%
Final simplification71.6%
(FPCore (d1 d2 d3 d4) :precision binary64 (if (<= d4 5.4e-20) (* d1 (- d2 d1)) (if (<= d4 6.6e+42) (* d1 (- d3)) (* d1 (+ d2 d4)))))
double code(double d1, double d2, double d3, double d4) {
double tmp;
if (d4 <= 5.4e-20) {
tmp = d1 * (d2 - d1);
} else if (d4 <= 6.6e+42) {
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 (d4 <= 5.4d-20) then
tmp = d1 * (d2 - d1)
else if (d4 <= 6.6d+42) 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 (d4 <= 5.4e-20) {
tmp = d1 * (d2 - d1);
} else if (d4 <= 6.6e+42) {
tmp = d1 * -d3;
} else {
tmp = d1 * (d2 + d4);
}
return tmp;
}
def code(d1, d2, d3, d4): tmp = 0 if d4 <= 5.4e-20: tmp = d1 * (d2 - d1) elif d4 <= 6.6e+42: tmp = d1 * -d3 else: tmp = d1 * (d2 + d4) return tmp
function code(d1, d2, d3, d4) tmp = 0.0 if (d4 <= 5.4e-20) tmp = Float64(d1 * Float64(d2 - d1)); elseif (d4 <= 6.6e+42) 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 (d4 <= 5.4e-20) tmp = d1 * (d2 - d1); elseif (d4 <= 6.6e+42) tmp = d1 * -d3; else tmp = d1 * (d2 + d4); end tmp_2 = tmp; end
code[d1_, d2_, d3_, d4_] := If[LessEqual[d4, 5.4e-20], N[(d1 * N[(d2 - d1), $MachinePrecision]), $MachinePrecision], If[LessEqual[d4, 6.6e+42], N[(d1 * (-d3)), $MachinePrecision], N[(d1 * N[(d2 + d4), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;d4 \leq 5.4 \cdot 10^{-20}:\\
\;\;\;\;d1 \cdot \left(d2 - d1\right)\\
\mathbf{elif}\;d4 \leq 6.6 \cdot 10^{+42}:\\
\;\;\;\;d1 \cdot \left(-d3\right)\\
\mathbf{else}:\\
\;\;\;\;d1 \cdot \left(d2 + d4\right)\\
\end{array}
\end{array}
if d4 < 5.3999999999999999e-20Initial program 89.9%
sub-neg89.9%
associate-+l+89.9%
*-commutative89.9%
+-commutative89.9%
*-commutative89.9%
sub-neg89.9%
+-commutative89.9%
associate--l+89.9%
distribute-lft-out--90.5%
distribute-rgt-out--92.0%
distribute-lft-out100.0%
+-commutative100.0%
sub-neg100.0%
+-commutative100.0%
remove-double-neg100.0%
sub-neg100.0%
sub-neg100.0%
distribute-neg-in100.0%
sub-neg100.0%
sub-neg100.0%
Simplified100.0%
Taylor expanded in d3 around 0 73.4%
Taylor expanded in d4 around 0 58.1%
if 5.3999999999999999e-20 < d4 < 6.5999999999999998e42Initial program 93.8%
sub-neg93.8%
associate-+l+93.8%
*-commutative93.8%
+-commutative93.8%
*-commutative93.8%
sub-neg93.8%
+-commutative93.8%
associate--l+93.8%
distribute-lft-out--93.8%
distribute-rgt-out--93.8%
distribute-lft-out100.0%
+-commutative100.0%
sub-neg100.0%
+-commutative100.0%
remove-double-neg100.0%
sub-neg100.0%
sub-neg100.0%
distribute-neg-in100.0%
sub-neg100.0%
sub-neg100.0%
Simplified100.0%
Taylor expanded in d3 around inf 46.0%
mul-1-neg46.0%
distribute-rgt-neg-out46.0%
Simplified46.0%
if 6.5999999999999998e42 < d4 Initial program 94.1%
sub-neg94.1%
associate-+l+94.1%
*-commutative94.1%
+-commutative94.1%
*-commutative94.1%
sub-neg94.1%
+-commutative94.1%
associate--l+94.1%
distribute-lft-out--96.0%
distribute-rgt-out--96.0%
distribute-lft-out100.0%
+-commutative100.0%
sub-neg100.0%
+-commutative100.0%
remove-double-neg100.0%
sub-neg100.0%
sub-neg100.0%
distribute-neg-in100.0%
sub-neg100.0%
sub-neg100.0%
Simplified100.0%
Taylor expanded in d1 around 0 96.1%
Taylor expanded in d3 around 0 82.4%
+-commutative82.4%
Simplified82.4%
Final simplification62.2%
(FPCore (d1 d2 d3 d4) :precision binary64 (if (<= d2 -1.8e+77) (* d1 d2) (if (<= d2 -5.5e-203) (* d1 (- d1)) (* d1 d4))))
double code(double d1, double d2, double d3, double d4) {
double tmp;
if (d2 <= -1.8e+77) {
tmp = d1 * d2;
} else if (d2 <= -5.5e-203) {
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.8d+77)) then
tmp = d1 * d2
else if (d2 <= (-5.5d-203)) 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.8e+77) {
tmp = d1 * d2;
} else if (d2 <= -5.5e-203) {
tmp = d1 * -d1;
} else {
tmp = d1 * d4;
}
return tmp;
}
def code(d1, d2, d3, d4): tmp = 0 if d2 <= -1.8e+77: tmp = d1 * d2 elif d2 <= -5.5e-203: tmp = d1 * -d1 else: tmp = d1 * d4 return tmp
function code(d1, d2, d3, d4) tmp = 0.0 if (d2 <= -1.8e+77) tmp = Float64(d1 * d2); elseif (d2 <= -5.5e-203) 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.8e+77) tmp = d1 * d2; elseif (d2 <= -5.5e-203) tmp = d1 * -d1; else tmp = d1 * d4; end tmp_2 = tmp; end
code[d1_, d2_, d3_, d4_] := If[LessEqual[d2, -1.8e+77], N[(d1 * d2), $MachinePrecision], If[LessEqual[d2, -5.5e-203], N[(d1 * (-d1)), $MachinePrecision], N[(d1 * d4), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;d2 \leq -1.8 \cdot 10^{+77}:\\
\;\;\;\;d1 \cdot d2\\
\mathbf{elif}\;d2 \leq -5.5 \cdot 10^{-203}:\\
\;\;\;\;d1 \cdot \left(-d1\right)\\
\mathbf{else}:\\
\;\;\;\;d1 \cdot d4\\
\end{array}
\end{array}
if d2 < -1.7999999999999999e77Initial program 84.9%
sub-neg84.9%
associate-+l+84.9%
*-commutative84.9%
+-commutative84.9%
*-commutative84.9%
sub-neg84.9%
+-commutative84.9%
associate--l+85.0%
distribute-lft-out--87.5%
distribute-rgt-out--92.5%
distribute-lft-out99.9%
+-commutative99.9%
sub-neg99.9%
+-commutative99.9%
remove-double-neg99.9%
sub-neg99.9%
sub-neg99.9%
distribute-neg-in99.9%
sub-neg99.9%
sub-neg99.9%
Simplified99.9%
Taylor expanded in d2 around inf 70.8%
if -1.7999999999999999e77 < d2 < -5.5000000000000002e-203Initial program 93.2%
sub-neg93.2%
associate-+l+93.2%
*-commutative93.2%
+-commutative93.2%
*-commutative93.2%
sub-neg93.2%
+-commutative93.2%
associate--l+93.2%
distribute-lft-out--94.9%
distribute-rgt-out--94.9%
distribute-lft-out100.0%
+-commutative100.0%
sub-neg100.0%
+-commutative100.0%
remove-double-neg100.0%
sub-neg100.0%
sub-neg100.0%
distribute-neg-in100.0%
sub-neg100.0%
sub-neg100.0%
Simplified100.0%
Taylor expanded in d1 around inf 39.4%
neg-mul-139.4%
Simplified39.4%
if -5.5000000000000002e-203 < d2 Initial program 91.7%
sub-neg91.7%
associate-+l+91.7%
*-commutative91.7%
+-commutative91.7%
*-commutative91.7%
sub-neg91.7%
+-commutative91.7%
associate--l+91.7%
distribute-lft-out--91.7%
distribute-rgt-out--92.3%
distribute-lft-out100.0%
+-commutative100.0%
sub-neg100.0%
+-commutative100.0%
remove-double-neg100.0%
sub-neg100.0%
sub-neg100.0%
distribute-neg-in100.0%
sub-neg100.0%
sub-neg100.0%
Simplified100.0%
Taylor expanded in d4 around inf 34.9%
Final simplification41.6%
(FPCore (d1 d2 d3 d4) :precision binary64 (if (<= d4 9.2e+73) (* d1 (- (- d2 d1) d3)) (* d1 (- (+ d2 d4) d3))))
double code(double d1, double d2, double d3, double d4) {
double tmp;
if (d4 <= 9.2e+73) {
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 <= 9.2d+73) 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 <= 9.2e+73) {
tmp = d1 * ((d2 - d1) - d3);
} else {
tmp = d1 * ((d2 + d4) - d3);
}
return tmp;
}
def code(d1, d2, d3, d4): tmp = 0 if d4 <= 9.2e+73: tmp = d1 * ((d2 - d1) - d3) else: tmp = d1 * ((d2 + d4) - d3) return tmp
function code(d1, d2, d3, d4) tmp = 0.0 if (d4 <= 9.2e+73) tmp = Float64(d1 * Float64(Float64(d2 - d1) - d3)); else tmp = Float64(d1 * Float64(Float64(d2 + d4) - d3)); end return tmp end
function tmp_2 = code(d1, d2, d3, d4) tmp = 0.0; if (d4 <= 9.2e+73) tmp = d1 * ((d2 - d1) - d3); else tmp = d1 * ((d2 + d4) - d3); end tmp_2 = tmp; end
code[d1_, d2_, d3_, d4_] := If[LessEqual[d4, 9.2e+73], N[(d1 * N[(N[(d2 - d1), $MachinePrecision] - d3), $MachinePrecision]), $MachinePrecision], N[(d1 * N[(N[(d2 + d4), $MachinePrecision] - d3), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;d4 \leq 9.2 \cdot 10^{+73}:\\
\;\;\;\;d1 \cdot \left(\left(d2 - d1\right) - d3\right)\\
\mathbf{else}:\\
\;\;\;\;d1 \cdot \left(\left(d2 + d4\right) - d3\right)\\
\end{array}
\end{array}
if d4 < 9.199999999999999e73Initial program 90.5%
sub-neg90.5%
associate-+l+90.5%
*-commutative90.5%
+-commutative90.5%
*-commutative90.5%
sub-neg90.5%
+-commutative90.5%
associate--l+90.5%
distribute-lft-out--91.0%
distribute-rgt-out--92.4%
distribute-lft-out100.0%
+-commutative100.0%
sub-neg100.0%
+-commutative100.0%
remove-double-neg100.0%
sub-neg100.0%
sub-neg100.0%
distribute-neg-in100.0%
sub-neg100.0%
sub-neg100.0%
Simplified100.0%
Taylor expanded in d4 around 0 83.9%
associate--r+83.9%
Simplified83.9%
if 9.199999999999999e73 < d4 Initial program 93.3%
sub-neg93.3%
associate-+l+93.3%
*-commutative93.3%
+-commutative93.3%
*-commutative93.3%
sub-neg93.3%
+-commutative93.3%
associate--l+93.3%
distribute-lft-out--95.5%
distribute-rgt-out--95.5%
distribute-lft-out100.0%
+-commutative100.0%
sub-neg100.0%
+-commutative100.0%
remove-double-neg100.0%
sub-neg100.0%
sub-neg100.0%
distribute-neg-in100.0%
sub-neg100.0%
sub-neg100.0%
Simplified100.0%
Taylor expanded in d1 around 0 100.0%
Final simplification86.7%
(FPCore (d1 d2 d3 d4) :precision binary64 (if (<= d4 6e-37) (* d1 d2) (* d1 d4)))
double code(double d1, double d2, double d3, double d4) {
double tmp;
if (d4 <= 6e-37) {
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 <= 6d-37) 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 <= 6e-37) {
tmp = d1 * d2;
} else {
tmp = d1 * d4;
}
return tmp;
}
def code(d1, d2, d3, d4): tmp = 0 if d4 <= 6e-37: tmp = d1 * d2 else: tmp = d1 * d4 return tmp
function code(d1, d2, d3, d4) tmp = 0.0 if (d4 <= 6e-37) 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 <= 6e-37) tmp = d1 * d2; else tmp = d1 * d4; end tmp_2 = tmp; end
code[d1_, d2_, d3_, d4_] := If[LessEqual[d4, 6e-37], N[(d1 * d2), $MachinePrecision], N[(d1 * d4), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;d4 \leq 6 \cdot 10^{-37}:\\
\;\;\;\;d1 \cdot d2\\
\mathbf{else}:\\
\;\;\;\;d1 \cdot d4\\
\end{array}
\end{array}
if d4 < 6e-37Initial program 89.8%
sub-neg89.8%
associate-+l+89.8%
*-commutative89.8%
+-commutative89.8%
*-commutative89.8%
sub-neg89.8%
+-commutative89.8%
associate--l+89.8%
distribute-lft-out--90.4%
distribute-rgt-out--92.0%
distribute-lft-out100.0%
+-commutative100.0%
sub-neg100.0%
+-commutative100.0%
remove-double-neg100.0%
sub-neg100.0%
sub-neg100.0%
distribute-neg-in100.0%
sub-neg100.0%
sub-neg100.0%
Simplified100.0%
Taylor expanded in d2 around inf 32.6%
if 6e-37 < d4 Initial program 94.2%
sub-neg94.2%
associate-+l+94.2%
*-commutative94.2%
+-commutative94.2%
*-commutative94.2%
sub-neg94.2%
+-commutative94.2%
associate--l+94.2%
distribute-lft-out--95.6%
distribute-rgt-out--95.6%
distribute-lft-out100.0%
+-commutative100.0%
sub-neg100.0%
+-commutative100.0%
remove-double-neg100.0%
sub-neg100.0%
sub-neg100.0%
distribute-neg-in100.0%
sub-neg100.0%
sub-neg100.0%
Simplified100.0%
Taylor expanded in d4 around inf 55.0%
Final simplification38.6%
(FPCore (d1 d2 d3 d4) :precision binary64 (* d1 d2))
double code(double d1, double d2, double d3, double d4) {
return d1 * d2;
}
real(8) function code(d1, d2, d3, d4)
real(8), intent (in) :: d1
real(8), intent (in) :: d2
real(8), intent (in) :: d3
real(8), intent (in) :: d4
code = d1 * d2
end function
public static double code(double d1, double d2, double d3, double d4) {
return d1 * d2;
}
def code(d1, d2, d3, d4): return d1 * d2
function code(d1, d2, d3, d4) return Float64(d1 * d2) end
function tmp = code(d1, d2, d3, d4) tmp = d1 * d2; end
code[d1_, d2_, d3_, d4_] := N[(d1 * d2), $MachinePrecision]
\begin{array}{l}
\\
d1 \cdot d2
\end{array}
Initial program 91.0%
sub-neg91.0%
associate-+l+91.0%
*-commutative91.0%
+-commutative91.0%
*-commutative91.0%
sub-neg91.0%
+-commutative91.0%
associate--l+91.0%
distribute-lft-out--91.8%
distribute-rgt-out--93.0%
distribute-lft-out100.0%
+-commutative100.0%
sub-neg100.0%
+-commutative100.0%
remove-double-neg100.0%
sub-neg100.0%
sub-neg100.0%
distribute-neg-in100.0%
sub-neg100.0%
sub-neg100.0%
Simplified100.0%
Taylor expanded in d2 around inf 30.2%
Final simplification30.2%
(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 2024017
(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)))