
(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 11 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 (- d4 (+ d1 d3)))))
double code(double d1, double d2, double d3, double d4) {
return d1 * (d2 + (d4 - (d1 + 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 + (d4 - (d1 + d3)))
end function
public static double code(double d1, double d2, double d3, double d4) {
return d1 * (d2 + (d4 - (d1 + d3)));
}
def code(d1, d2, d3, d4): return d1 * (d2 + (d4 - (d1 + d3)))
function code(d1, d2, d3, d4) return Float64(d1 * Float64(d2 + Float64(d4 - Float64(d1 + d3)))) end
function tmp = code(d1, d2, d3, d4) tmp = d1 * (d2 + (d4 - (d1 + d3))); end
code[d1_, d2_, d3_, d4_] := N[(d1 * N[(d2 + N[(d4 - N[(d1 + d3), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
d1 \cdot \left(d2 + \left(d4 - \left(d1 + d3\right)\right)\right)
\end{array}
Initial program 89.0%
distribute-lft-out--N/A
*-commutativeN/A
distribute-lft-outN/A
distribute-lft-out--N/A
*-lowering-*.f64N/A
associate-+r-N/A
sub-negN/A
associate-+l+N/A
+-lowering-+.f64N/A
+-commutativeN/A
unsub-negN/A
associate--l-N/A
+-commutativeN/A
--lowering--.f64N/A
+-commutativeN/A
+-lowering-+.f64100.0%
Simplified100.0%
(FPCore (d1 d2 d3 d4)
:precision binary64
(let* ((t_0 (* d1 (- d2 d3))) (t_1 (* d1 (+ d2 d4))))
(if (<= d3 -2.8e+43)
t_0
(if (<= d3 -2.1e-241)
t_1
(if (<= d3 8.2e-19) (* d1 (- d4 d1)) (if (<= d3 1.65e+115) t_1 t_0))))))
double code(double d1, double d2, double d3, double d4) {
double t_0 = d1 * (d2 - d3);
double t_1 = d1 * (d2 + d4);
double tmp;
if (d3 <= -2.8e+43) {
tmp = t_0;
} else if (d3 <= -2.1e-241) {
tmp = t_1;
} else if (d3 <= 8.2e-19) {
tmp = d1 * (d4 - d1);
} else if (d3 <= 1.65e+115) {
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 * (d2 - d3)
t_1 = d1 * (d2 + d4)
if (d3 <= (-2.8d+43)) then
tmp = t_0
else if (d3 <= (-2.1d-241)) then
tmp = t_1
else if (d3 <= 8.2d-19) then
tmp = d1 * (d4 - d1)
else if (d3 <= 1.65d+115) 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 * (d2 - d3);
double t_1 = d1 * (d2 + d4);
double tmp;
if (d3 <= -2.8e+43) {
tmp = t_0;
} else if (d3 <= -2.1e-241) {
tmp = t_1;
} else if (d3 <= 8.2e-19) {
tmp = d1 * (d4 - d1);
} else if (d3 <= 1.65e+115) {
tmp = t_1;
} else {
tmp = t_0;
}
return tmp;
}
def code(d1, d2, d3, d4): t_0 = d1 * (d2 - d3) t_1 = d1 * (d2 + d4) tmp = 0 if d3 <= -2.8e+43: tmp = t_0 elif d3 <= -2.1e-241: tmp = t_1 elif d3 <= 8.2e-19: tmp = d1 * (d4 - d1) elif d3 <= 1.65e+115: tmp = t_1 else: tmp = t_0 return tmp
function code(d1, d2, d3, d4) t_0 = Float64(d1 * Float64(d2 - d3)) t_1 = Float64(d1 * Float64(d2 + d4)) tmp = 0.0 if (d3 <= -2.8e+43) tmp = t_0; elseif (d3 <= -2.1e-241) tmp = t_1; elseif (d3 <= 8.2e-19) tmp = Float64(d1 * Float64(d4 - d1)); elseif (d3 <= 1.65e+115) tmp = t_1; else tmp = t_0; end return tmp end
function tmp_2 = code(d1, d2, d3, d4) t_0 = d1 * (d2 - d3); t_1 = d1 * (d2 + d4); tmp = 0.0; if (d3 <= -2.8e+43) tmp = t_0; elseif (d3 <= -2.1e-241) tmp = t_1; elseif (d3 <= 8.2e-19) tmp = d1 * (d4 - d1); elseif (d3 <= 1.65e+115) tmp = t_1; else tmp = t_0; end tmp_2 = tmp; end
code[d1_, d2_, d3_, d4_] := Block[{t$95$0 = N[(d1 * N[(d2 - d3), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(d1 * N[(d2 + d4), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[d3, -2.8e+43], t$95$0, If[LessEqual[d3, -2.1e-241], t$95$1, If[LessEqual[d3, 8.2e-19], N[(d1 * N[(d4 - d1), $MachinePrecision]), $MachinePrecision], If[LessEqual[d3, 1.65e+115], t$95$1, t$95$0]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := d1 \cdot \left(d2 - d3\right)\\
t_1 := d1 \cdot \left(d2 + d4\right)\\
\mathbf{if}\;d3 \leq -2.8 \cdot 10^{+43}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;d3 \leq -2.1 \cdot 10^{-241}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;d3 \leq 8.2 \cdot 10^{-19}:\\
\;\;\;\;d1 \cdot \left(d4 - d1\right)\\
\mathbf{elif}\;d3 \leq 1.65 \cdot 10^{+115}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if d3 < -2.80000000000000019e43 or 1.65000000000000003e115 < d3 Initial program 87.1%
distribute-lft-out--N/A
*-commutativeN/A
distribute-lft-outN/A
distribute-lft-out--N/A
*-lowering-*.f64N/A
associate-+r-N/A
sub-negN/A
associate-+l+N/A
+-lowering-+.f64N/A
+-commutativeN/A
unsub-negN/A
associate--l-N/A
+-commutativeN/A
--lowering--.f64N/A
+-commutativeN/A
+-lowering-+.f6499.9%
Simplified99.9%
Taylor expanded in d4 around 0
*-lowering-*.f64N/A
--lowering--.f64N/A
+-lowering-+.f6487.7%
Simplified87.7%
Taylor expanded in d1 around 0
*-lowering-*.f64N/A
--lowering--.f6482.5%
Simplified82.5%
if -2.80000000000000019e43 < d3 < -2.0999999999999999e-241 or 8.1999999999999997e-19 < d3 < 1.65000000000000003e115Initial program 90.9%
distribute-lft-out--N/A
*-commutativeN/A
distribute-lft-outN/A
distribute-lft-out--N/A
*-lowering-*.f64N/A
associate-+r-N/A
sub-negN/A
associate-+l+N/A
+-lowering-+.f64N/A
+-commutativeN/A
unsub-negN/A
associate--l-N/A
+-commutativeN/A
--lowering--.f64N/A
+-commutativeN/A
+-lowering-+.f64100.0%
Simplified100.0%
Taylor expanded in d4 around inf
Simplified78.7%
if -2.0999999999999999e-241 < d3 < 8.1999999999999997e-19Initial program 89.7%
distribute-lft-out--N/A
*-commutativeN/A
distribute-lft-outN/A
distribute-lft-out--N/A
*-lowering-*.f64N/A
associate-+r-N/A
sub-negN/A
associate-+l+N/A
+-lowering-+.f64N/A
+-commutativeN/A
unsub-negN/A
associate--l-N/A
+-commutativeN/A
--lowering--.f64N/A
+-commutativeN/A
+-lowering-+.f64100.0%
Simplified100.0%
Taylor expanded in d2 around 0
*-lowering-*.f64N/A
--lowering--.f64N/A
+-lowering-+.f6474.1%
Simplified74.1%
Taylor expanded in d3 around 0
*-lowering-*.f64N/A
--lowering--.f6470.5%
Simplified70.5%
(FPCore (d1 d2 d3 d4)
:precision binary64
(let* ((t_0 (* d1 (- d2 d3))) (t_1 (* d1 (+ d2 d4))))
(if (<= d3 -1.3e+48)
t_0
(if (<= d3 -1.6e-109)
t_1
(if (<= d3 3.4e-18) (* d1 (- d2 d1)) (if (<= d3 2.7e+116) t_1 t_0))))))
double code(double d1, double d2, double d3, double d4) {
double t_0 = d1 * (d2 - d3);
double t_1 = d1 * (d2 + d4);
double tmp;
if (d3 <= -1.3e+48) {
tmp = t_0;
} else if (d3 <= -1.6e-109) {
tmp = t_1;
} else if (d3 <= 3.4e-18) {
tmp = d1 * (d2 - d1);
} else if (d3 <= 2.7e+116) {
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 * (d2 - d3)
t_1 = d1 * (d2 + d4)
if (d3 <= (-1.3d+48)) then
tmp = t_0
else if (d3 <= (-1.6d-109)) then
tmp = t_1
else if (d3 <= 3.4d-18) then
tmp = d1 * (d2 - d1)
else if (d3 <= 2.7d+116) 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 * (d2 - d3);
double t_1 = d1 * (d2 + d4);
double tmp;
if (d3 <= -1.3e+48) {
tmp = t_0;
} else if (d3 <= -1.6e-109) {
tmp = t_1;
} else if (d3 <= 3.4e-18) {
tmp = d1 * (d2 - d1);
} else if (d3 <= 2.7e+116) {
tmp = t_1;
} else {
tmp = t_0;
}
return tmp;
}
def code(d1, d2, d3, d4): t_0 = d1 * (d2 - d3) t_1 = d1 * (d2 + d4) tmp = 0 if d3 <= -1.3e+48: tmp = t_0 elif d3 <= -1.6e-109: tmp = t_1 elif d3 <= 3.4e-18: tmp = d1 * (d2 - d1) elif d3 <= 2.7e+116: tmp = t_1 else: tmp = t_0 return tmp
function code(d1, d2, d3, d4) t_0 = Float64(d1 * Float64(d2 - d3)) t_1 = Float64(d1 * Float64(d2 + d4)) tmp = 0.0 if (d3 <= -1.3e+48) tmp = t_0; elseif (d3 <= -1.6e-109) tmp = t_1; elseif (d3 <= 3.4e-18) tmp = Float64(d1 * Float64(d2 - d1)); elseif (d3 <= 2.7e+116) tmp = t_1; else tmp = t_0; end return tmp end
function tmp_2 = code(d1, d2, d3, d4) t_0 = d1 * (d2 - d3); t_1 = d1 * (d2 + d4); tmp = 0.0; if (d3 <= -1.3e+48) tmp = t_0; elseif (d3 <= -1.6e-109) tmp = t_1; elseif (d3 <= 3.4e-18) tmp = d1 * (d2 - d1); elseif (d3 <= 2.7e+116) tmp = t_1; else tmp = t_0; end tmp_2 = tmp; end
code[d1_, d2_, d3_, d4_] := Block[{t$95$0 = N[(d1 * N[(d2 - d3), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(d1 * N[(d2 + d4), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[d3, -1.3e+48], t$95$0, If[LessEqual[d3, -1.6e-109], t$95$1, If[LessEqual[d3, 3.4e-18], N[(d1 * N[(d2 - d1), $MachinePrecision]), $MachinePrecision], If[LessEqual[d3, 2.7e+116], t$95$1, t$95$0]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := d1 \cdot \left(d2 - d3\right)\\
t_1 := d1 \cdot \left(d2 + d4\right)\\
\mathbf{if}\;d3 \leq -1.3 \cdot 10^{+48}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;d3 \leq -1.6 \cdot 10^{-109}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;d3 \leq 3.4 \cdot 10^{-18}:\\
\;\;\;\;d1 \cdot \left(d2 - d1\right)\\
\mathbf{elif}\;d3 \leq 2.7 \cdot 10^{+116}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if d3 < -1.29999999999999998e48 or 2.7e116 < d3 Initial program 87.1%
distribute-lft-out--N/A
*-commutativeN/A
distribute-lft-outN/A
distribute-lft-out--N/A
*-lowering-*.f64N/A
associate-+r-N/A
sub-negN/A
associate-+l+N/A
+-lowering-+.f64N/A
+-commutativeN/A
unsub-negN/A
associate--l-N/A
+-commutativeN/A
--lowering--.f64N/A
+-commutativeN/A
+-lowering-+.f6499.9%
Simplified99.9%
Taylor expanded in d4 around 0
*-lowering-*.f64N/A
--lowering--.f64N/A
+-lowering-+.f6487.7%
Simplified87.7%
Taylor expanded in d1 around 0
*-lowering-*.f64N/A
--lowering--.f6482.5%
Simplified82.5%
if -1.29999999999999998e48 < d3 < -1.6000000000000001e-109 or 3.40000000000000001e-18 < d3 < 2.7e116Initial program 90.2%
distribute-lft-out--N/A
*-commutativeN/A
distribute-lft-outN/A
distribute-lft-out--N/A
*-lowering-*.f64N/A
associate-+r-N/A
sub-negN/A
associate-+l+N/A
+-lowering-+.f64N/A
+-commutativeN/A
unsub-negN/A
associate--l-N/A
+-commutativeN/A
--lowering--.f64N/A
+-commutativeN/A
+-lowering-+.f64100.0%
Simplified100.0%
Taylor expanded in d4 around inf
Simplified84.6%
if -1.6000000000000001e-109 < d3 < 3.40000000000000001e-18Initial program 90.3%
distribute-lft-out--N/A
*-commutativeN/A
distribute-lft-outN/A
distribute-lft-out--N/A
*-lowering-*.f64N/A
associate-+r-N/A
sub-negN/A
associate-+l+N/A
+-lowering-+.f64N/A
+-commutativeN/A
unsub-negN/A
associate--l-N/A
+-commutativeN/A
--lowering--.f64N/A
+-commutativeN/A
+-lowering-+.f64100.0%
Simplified100.0%
Taylor expanded in d4 around 0
*-lowering-*.f64N/A
--lowering--.f64N/A
+-lowering-+.f6471.9%
Simplified71.9%
Taylor expanded in d3 around 0
*-lowering-*.f64N/A
--lowering--.f6469.3%
Simplified69.3%
(FPCore (d1 d2 d3 d4)
:precision binary64
(let* ((t_0 (* d3 (- 0.0 d1))))
(if (<= d3 -3.3e+108)
t_0
(if (<= d3 3.8e-18)
(* d1 (- d2 d1))
(if (<= d3 3.6e+162) (* d1 (+ d2 d4)) t_0)))))
double code(double d1, double d2, double d3, double d4) {
double t_0 = d3 * (0.0 - d1);
double tmp;
if (d3 <= -3.3e+108) {
tmp = t_0;
} else if (d3 <= 3.8e-18) {
tmp = d1 * (d2 - d1);
} else if (d3 <= 3.6e+162) {
tmp = d1 * (d2 + d4);
} 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) :: tmp
t_0 = d3 * (0.0d0 - d1)
if (d3 <= (-3.3d+108)) then
tmp = t_0
else if (d3 <= 3.8d-18) then
tmp = d1 * (d2 - d1)
else if (d3 <= 3.6d+162) then
tmp = d1 * (d2 + d4)
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 = d3 * (0.0 - d1);
double tmp;
if (d3 <= -3.3e+108) {
tmp = t_0;
} else if (d3 <= 3.8e-18) {
tmp = d1 * (d2 - d1);
} else if (d3 <= 3.6e+162) {
tmp = d1 * (d2 + d4);
} else {
tmp = t_0;
}
return tmp;
}
def code(d1, d2, d3, d4): t_0 = d3 * (0.0 - d1) tmp = 0 if d3 <= -3.3e+108: tmp = t_0 elif d3 <= 3.8e-18: tmp = d1 * (d2 - d1) elif d3 <= 3.6e+162: tmp = d1 * (d2 + d4) else: tmp = t_0 return tmp
function code(d1, d2, d3, d4) t_0 = Float64(d3 * Float64(0.0 - d1)) tmp = 0.0 if (d3 <= -3.3e+108) tmp = t_0; elseif (d3 <= 3.8e-18) tmp = Float64(d1 * Float64(d2 - d1)); elseif (d3 <= 3.6e+162) tmp = Float64(d1 * Float64(d2 + d4)); else tmp = t_0; end return tmp end
function tmp_2 = code(d1, d2, d3, d4) t_0 = d3 * (0.0 - d1); tmp = 0.0; if (d3 <= -3.3e+108) tmp = t_0; elseif (d3 <= 3.8e-18) tmp = d1 * (d2 - d1); elseif (d3 <= 3.6e+162) tmp = d1 * (d2 + d4); else tmp = t_0; end tmp_2 = tmp; end
code[d1_, d2_, d3_, d4_] := Block[{t$95$0 = N[(d3 * N[(0.0 - d1), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[d3, -3.3e+108], t$95$0, If[LessEqual[d3, 3.8e-18], N[(d1 * N[(d2 - d1), $MachinePrecision]), $MachinePrecision], If[LessEqual[d3, 3.6e+162], N[(d1 * N[(d2 + d4), $MachinePrecision]), $MachinePrecision], t$95$0]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := d3 \cdot \left(0 - d1\right)\\
\mathbf{if}\;d3 \leq -3.3 \cdot 10^{+108}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;d3 \leq 3.8 \cdot 10^{-18}:\\
\;\;\;\;d1 \cdot \left(d2 - d1\right)\\
\mathbf{elif}\;d3 \leq 3.6 \cdot 10^{+162}:\\
\;\;\;\;d1 \cdot \left(d2 + d4\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if d3 < -3.30000000000000019e108 or 3.59999999999999994e162 < d3 Initial program 92.2%
distribute-lft-out--N/A
*-commutativeN/A
distribute-lft-outN/A
distribute-lft-out--N/A
*-lowering-*.f64N/A
associate-+r-N/A
sub-negN/A
associate-+l+N/A
+-lowering-+.f64N/A
+-commutativeN/A
unsub-negN/A
associate--l-N/A
+-commutativeN/A
--lowering--.f64N/A
+-commutativeN/A
+-lowering-+.f64100.0%
Simplified100.0%
Taylor expanded in d3 around inf
mul-1-negN/A
neg-sub0N/A
--lowering--.f64N/A
*-lowering-*.f6483.1%
Simplified83.1%
sub0-negN/A
neg-lowering-neg.f64N/A
*-lowering-*.f6483.1%
Applied egg-rr83.1%
if -3.30000000000000019e108 < d3 < 3.7999999999999998e-18Initial program 88.5%
distribute-lft-out--N/A
*-commutativeN/A
distribute-lft-outN/A
distribute-lft-out--N/A
*-lowering-*.f64N/A
associate-+r-N/A
sub-negN/A
associate-+l+N/A
+-lowering-+.f64N/A
+-commutativeN/A
unsub-negN/A
associate--l-N/A
+-commutativeN/A
--lowering--.f64N/A
+-commutativeN/A
+-lowering-+.f64100.0%
Simplified100.0%
Taylor expanded in d4 around 0
*-lowering-*.f64N/A
--lowering--.f64N/A
+-lowering-+.f6471.4%
Simplified71.4%
Taylor expanded in d3 around 0
*-lowering-*.f64N/A
--lowering--.f6466.2%
Simplified66.2%
if 3.7999999999999998e-18 < d3 < 3.59999999999999994e162Initial program 84.6%
distribute-lft-out--N/A
*-commutativeN/A
distribute-lft-outN/A
distribute-lft-out--N/A
*-lowering-*.f64N/A
associate-+r-N/A
sub-negN/A
associate-+l+N/A
+-lowering-+.f64N/A
+-commutativeN/A
unsub-negN/A
associate--l-N/A
+-commutativeN/A
--lowering--.f64N/A
+-commutativeN/A
+-lowering-+.f64100.0%
Simplified100.0%
Taylor expanded in d4 around inf
Simplified77.7%
Final simplification73.1%
(FPCore (d1 d2 d3 d4) :precision binary64 (if (<= d2 -3.3e+55) (* d1 (- d2 d3)) (if (<= d2 -1.15e-184) (* d1 (- d4 d1)) (* d1 (- d4 d3)))))
double code(double d1, double d2, double d3, double d4) {
double tmp;
if (d2 <= -3.3e+55) {
tmp = d1 * (d2 - d3);
} else if (d2 <= -1.15e-184) {
tmp = d1 * (d4 - d1);
} else {
tmp = d1 * (d4 - d3);
}
return tmp;
}
real(8) function code(d1, d2, d3, d4)
real(8), intent (in) :: d1
real(8), intent (in) :: d2
real(8), intent (in) :: d3
real(8), intent (in) :: d4
real(8) :: tmp
if (d2 <= (-3.3d+55)) then
tmp = d1 * (d2 - d3)
else if (d2 <= (-1.15d-184)) then
tmp = d1 * (d4 - d1)
else
tmp = d1 * (d4 - d3)
end if
code = tmp
end function
public static double code(double d1, double d2, double d3, double d4) {
double tmp;
if (d2 <= -3.3e+55) {
tmp = d1 * (d2 - d3);
} else if (d2 <= -1.15e-184) {
tmp = d1 * (d4 - d1);
} else {
tmp = d1 * (d4 - d3);
}
return tmp;
}
def code(d1, d2, d3, d4): tmp = 0 if d2 <= -3.3e+55: tmp = d1 * (d2 - d3) elif d2 <= -1.15e-184: tmp = d1 * (d4 - d1) else: tmp = d1 * (d4 - d3) return tmp
function code(d1, d2, d3, d4) tmp = 0.0 if (d2 <= -3.3e+55) tmp = Float64(d1 * Float64(d2 - d3)); elseif (d2 <= -1.15e-184) tmp = Float64(d1 * Float64(d4 - d1)); else tmp = Float64(d1 * Float64(d4 - d3)); end return tmp end
function tmp_2 = code(d1, d2, d3, d4) tmp = 0.0; if (d2 <= -3.3e+55) tmp = d1 * (d2 - d3); elseif (d2 <= -1.15e-184) tmp = d1 * (d4 - d1); else tmp = d1 * (d4 - d3); end tmp_2 = tmp; end
code[d1_, d2_, d3_, d4_] := If[LessEqual[d2, -3.3e+55], N[(d1 * N[(d2 - d3), $MachinePrecision]), $MachinePrecision], If[LessEqual[d2, -1.15e-184], N[(d1 * N[(d4 - d1), $MachinePrecision]), $MachinePrecision], N[(d1 * N[(d4 - d3), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;d2 \leq -3.3 \cdot 10^{+55}:\\
\;\;\;\;d1 \cdot \left(d2 - d3\right)\\
\mathbf{elif}\;d2 \leq -1.15 \cdot 10^{-184}:\\
\;\;\;\;d1 \cdot \left(d4 - d1\right)\\
\mathbf{else}:\\
\;\;\;\;d1 \cdot \left(d4 - d3\right)\\
\end{array}
\end{array}
if d2 < -3.3e55Initial program 90.1%
distribute-lft-out--N/A
*-commutativeN/A
distribute-lft-outN/A
distribute-lft-out--N/A
*-lowering-*.f64N/A
associate-+r-N/A
sub-negN/A
associate-+l+N/A
+-lowering-+.f64N/A
+-commutativeN/A
unsub-negN/A
associate--l-N/A
+-commutativeN/A
--lowering--.f64N/A
+-commutativeN/A
+-lowering-+.f6499.9%
Simplified99.9%
Taylor expanded in d4 around 0
*-lowering-*.f64N/A
--lowering--.f64N/A
+-lowering-+.f6487.1%
Simplified87.1%
Taylor expanded in d1 around 0
*-lowering-*.f64N/A
--lowering--.f6477.6%
Simplified77.6%
if -3.3e55 < d2 < -1.15e-184Initial program 92.4%
distribute-lft-out--N/A
*-commutativeN/A
distribute-lft-outN/A
distribute-lft-out--N/A
*-lowering-*.f64N/A
associate-+r-N/A
sub-negN/A
associate-+l+N/A
+-lowering-+.f64N/A
+-commutativeN/A
unsub-negN/A
associate--l-N/A
+-commutativeN/A
--lowering--.f64N/A
+-commutativeN/A
+-lowering-+.f64100.0%
Simplified100.0%
Taylor expanded in d2 around 0
*-lowering-*.f64N/A
--lowering--.f64N/A
+-lowering-+.f6496.2%
Simplified96.2%
Taylor expanded in d3 around 0
*-lowering-*.f64N/A
--lowering--.f6476.4%
Simplified76.4%
if -1.15e-184 < d2 Initial program 87.5%
distribute-lft-out--N/A
*-commutativeN/A
distribute-lft-outN/A
distribute-lft-out--N/A
*-lowering-*.f64N/A
associate-+r-N/A
sub-negN/A
associate-+l+N/A
+-lowering-+.f64N/A
+-commutativeN/A
unsub-negN/A
associate--l-N/A
+-commutativeN/A
--lowering--.f64N/A
+-commutativeN/A
+-lowering-+.f64100.0%
Simplified100.0%
Taylor expanded in d2 around 0
*-lowering-*.f64N/A
--lowering--.f64N/A
+-lowering-+.f6480.6%
Simplified80.6%
Taylor expanded in d1 around 0
*-lowering-*.f64N/A
--lowering--.f6459.4%
Simplified59.4%
(FPCore (d1 d2 d3 d4) :precision binary64 (let* ((t_0 (* d3 (- 0.0 d1)))) (if (<= d3 -2.55e+100) t_0 (if (<= d3 6.2e+160) (* d1 (+ d2 d4)) t_0))))
double code(double d1, double d2, double d3, double d4) {
double t_0 = d3 * (0.0 - d1);
double tmp;
if (d3 <= -2.55e+100) {
tmp = t_0;
} else if (d3 <= 6.2e+160) {
tmp = d1 * (d2 + d4);
} 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) :: tmp
t_0 = d3 * (0.0d0 - d1)
if (d3 <= (-2.55d+100)) then
tmp = t_0
else if (d3 <= 6.2d+160) then
tmp = d1 * (d2 + d4)
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 = d3 * (0.0 - d1);
double tmp;
if (d3 <= -2.55e+100) {
tmp = t_0;
} else if (d3 <= 6.2e+160) {
tmp = d1 * (d2 + d4);
} else {
tmp = t_0;
}
return tmp;
}
def code(d1, d2, d3, d4): t_0 = d3 * (0.0 - d1) tmp = 0 if d3 <= -2.55e+100: tmp = t_0 elif d3 <= 6.2e+160: tmp = d1 * (d2 + d4) else: tmp = t_0 return tmp
function code(d1, d2, d3, d4) t_0 = Float64(d3 * Float64(0.0 - d1)) tmp = 0.0 if (d3 <= -2.55e+100) tmp = t_0; elseif (d3 <= 6.2e+160) tmp = Float64(d1 * Float64(d2 + d4)); else tmp = t_0; end return tmp end
function tmp_2 = code(d1, d2, d3, d4) t_0 = d3 * (0.0 - d1); tmp = 0.0; if (d3 <= -2.55e+100) tmp = t_0; elseif (d3 <= 6.2e+160) tmp = d1 * (d2 + d4); else tmp = t_0; end tmp_2 = tmp; end
code[d1_, d2_, d3_, d4_] := Block[{t$95$0 = N[(d3 * N[(0.0 - d1), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[d3, -2.55e+100], t$95$0, If[LessEqual[d3, 6.2e+160], N[(d1 * N[(d2 + d4), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := d3 \cdot \left(0 - d1\right)\\
\mathbf{if}\;d3 \leq -2.55 \cdot 10^{+100}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;d3 \leq 6.2 \cdot 10^{+160}:\\
\;\;\;\;d1 \cdot \left(d2 + d4\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if d3 < -2.55000000000000005e100 or 6.1999999999999996e160 < d3 Initial program 91.1%
distribute-lft-out--N/A
*-commutativeN/A
distribute-lft-outN/A
distribute-lft-out--N/A
*-lowering-*.f64N/A
associate-+r-N/A
sub-negN/A
associate-+l+N/A
+-lowering-+.f64N/A
+-commutativeN/A
unsub-negN/A
associate--l-N/A
+-commutativeN/A
--lowering--.f64N/A
+-commutativeN/A
+-lowering-+.f64100.0%
Simplified100.0%
Taylor expanded in d3 around inf
mul-1-negN/A
neg-sub0N/A
--lowering--.f64N/A
*-lowering-*.f6482.3%
Simplified82.3%
sub0-negN/A
neg-lowering-neg.f64N/A
*-lowering-*.f6482.3%
Applied egg-rr82.3%
if -2.55000000000000005e100 < d3 < 6.1999999999999996e160Initial program 88.1%
distribute-lft-out--N/A
*-commutativeN/A
distribute-lft-outN/A
distribute-lft-out--N/A
*-lowering-*.f64N/A
associate-+r-N/A
sub-negN/A
associate-+l+N/A
+-lowering-+.f64N/A
+-commutativeN/A
unsub-negN/A
associate--l-N/A
+-commutativeN/A
--lowering--.f64N/A
+-commutativeN/A
+-lowering-+.f64100.0%
Simplified100.0%
Taylor expanded in d4 around inf
Simplified63.9%
Final simplification69.5%
(FPCore (d1 d2 d3 d4) :precision binary64 (if (<= d2 -1.4e+108) (* d1 d2) (if (<= d2 -7e-276) (* d3 (- 0.0 d1)) (* d1 d4))))
double code(double d1, double d2, double d3, double d4) {
double tmp;
if (d2 <= -1.4e+108) {
tmp = d1 * d2;
} else if (d2 <= -7e-276) {
tmp = d3 * (0.0 - d1);
} else {
tmp = d1 * d4;
}
return tmp;
}
real(8) function code(d1, d2, d3, d4)
real(8), intent (in) :: d1
real(8), intent (in) :: d2
real(8), intent (in) :: d3
real(8), intent (in) :: d4
real(8) :: tmp
if (d2 <= (-1.4d+108)) then
tmp = d1 * d2
else if (d2 <= (-7d-276)) then
tmp = d3 * (0.0d0 - d1)
else
tmp = d1 * d4
end if
code = tmp
end function
public static double code(double d1, double d2, double d3, double d4) {
double tmp;
if (d2 <= -1.4e+108) {
tmp = d1 * d2;
} else if (d2 <= -7e-276) {
tmp = d3 * (0.0 - d1);
} else {
tmp = d1 * d4;
}
return tmp;
}
def code(d1, d2, d3, d4): tmp = 0 if d2 <= -1.4e+108: tmp = d1 * d2 elif d2 <= -7e-276: tmp = d3 * (0.0 - d1) else: tmp = d1 * d4 return tmp
function code(d1, d2, d3, d4) tmp = 0.0 if (d2 <= -1.4e+108) tmp = Float64(d1 * d2); elseif (d2 <= -7e-276) tmp = Float64(d3 * Float64(0.0 - d1)); else tmp = Float64(d1 * d4); end return tmp end
function tmp_2 = code(d1, d2, d3, d4) tmp = 0.0; if (d2 <= -1.4e+108) tmp = d1 * d2; elseif (d2 <= -7e-276) tmp = d3 * (0.0 - d1); else tmp = d1 * d4; end tmp_2 = tmp; end
code[d1_, d2_, d3_, d4_] := If[LessEqual[d2, -1.4e+108], N[(d1 * d2), $MachinePrecision], If[LessEqual[d2, -7e-276], N[(d3 * N[(0.0 - d1), $MachinePrecision]), $MachinePrecision], N[(d1 * d4), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;d2 \leq -1.4 \cdot 10^{+108}:\\
\;\;\;\;d1 \cdot d2\\
\mathbf{elif}\;d2 \leq -7 \cdot 10^{-276}:\\
\;\;\;\;d3 \cdot \left(0 - d1\right)\\
\mathbf{else}:\\
\;\;\;\;d1 \cdot d4\\
\end{array}
\end{array}
if d2 < -1.3999999999999999e108Initial program 88.5%
distribute-lft-out--N/A
*-commutativeN/A
distribute-lft-outN/A
distribute-lft-out--N/A
*-lowering-*.f64N/A
associate-+r-N/A
sub-negN/A
associate-+l+N/A
+-lowering-+.f64N/A
+-commutativeN/A
unsub-negN/A
associate--l-N/A
+-commutativeN/A
--lowering--.f64N/A
+-commutativeN/A
+-lowering-+.f6499.9%
Simplified99.9%
Taylor expanded in d2 around inf
*-lowering-*.f6470.0%
Simplified70.0%
if -1.3999999999999999e108 < d2 < -6.99999999999999986e-276Initial program 93.5%
distribute-lft-out--N/A
*-commutativeN/A
distribute-lft-outN/A
distribute-lft-out--N/A
*-lowering-*.f64N/A
associate-+r-N/A
sub-negN/A
associate-+l+N/A
+-lowering-+.f64N/A
+-commutativeN/A
unsub-negN/A
associate--l-N/A
+-commutativeN/A
--lowering--.f64N/A
+-commutativeN/A
+-lowering-+.f64100.0%
Simplified100.0%
Taylor expanded in d3 around inf
mul-1-negN/A
neg-sub0N/A
--lowering--.f64N/A
*-lowering-*.f6438.3%
Simplified38.3%
sub0-negN/A
neg-lowering-neg.f64N/A
*-lowering-*.f6438.3%
Applied egg-rr38.3%
if -6.99999999999999986e-276 < d2 Initial program 86.0%
distribute-lft-out--N/A
*-commutativeN/A
distribute-lft-outN/A
distribute-lft-out--N/A
*-lowering-*.f64N/A
associate-+r-N/A
sub-negN/A
associate-+l+N/A
+-lowering-+.f64N/A
+-commutativeN/A
unsub-negN/A
associate--l-N/A
+-commutativeN/A
--lowering--.f64N/A
+-commutativeN/A
+-lowering-+.f64100.0%
Simplified100.0%
Taylor expanded in d4 around inf
*-lowering-*.f6429.7%
Simplified29.7%
Final simplification38.3%
(FPCore (d1 d2 d3 d4) :precision binary64 (if (<= d2 -3.6e+76) (* d1 (- d2 (+ d1 d3))) (* d1 (- d4 (+ d1 d3)))))
double code(double d1, double d2, double d3, double d4) {
double tmp;
if (d2 <= -3.6e+76) {
tmp = d1 * (d2 - (d1 + d3));
} else {
tmp = d1 * (d4 - (d1 + d3));
}
return tmp;
}
real(8) function code(d1, d2, d3, d4)
real(8), intent (in) :: d1
real(8), intent (in) :: d2
real(8), intent (in) :: d3
real(8), intent (in) :: d4
real(8) :: tmp
if (d2 <= (-3.6d+76)) then
tmp = d1 * (d2 - (d1 + d3))
else
tmp = d1 * (d4 - (d1 + d3))
end if
code = tmp
end function
public static double code(double d1, double d2, double d3, double d4) {
double tmp;
if (d2 <= -3.6e+76) {
tmp = d1 * (d2 - (d1 + d3));
} else {
tmp = d1 * (d4 - (d1 + d3));
}
return tmp;
}
def code(d1, d2, d3, d4): tmp = 0 if d2 <= -3.6e+76: tmp = d1 * (d2 - (d1 + d3)) else: tmp = d1 * (d4 - (d1 + d3)) return tmp
function code(d1, d2, d3, d4) tmp = 0.0 if (d2 <= -3.6e+76) tmp = Float64(d1 * Float64(d2 - Float64(d1 + 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 <= -3.6e+76) tmp = d1 * (d2 - (d1 + d3)); else tmp = d1 * (d4 - (d1 + d3)); end tmp_2 = tmp; end
code[d1_, d2_, d3_, d4_] := If[LessEqual[d2, -3.6e+76], N[(d1 * N[(d2 - N[(d1 + d3), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(d1 * N[(d4 - N[(d1 + d3), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;d2 \leq -3.6 \cdot 10^{+76}:\\
\;\;\;\;d1 \cdot \left(d2 - \left(d1 + d3\right)\right)\\
\mathbf{else}:\\
\;\;\;\;d1 \cdot \left(d4 - \left(d1 + d3\right)\right)\\
\end{array}
\end{array}
if d2 < -3.6000000000000003e76Initial program 91.2%
distribute-lft-out--N/A
*-commutativeN/A
distribute-lft-outN/A
distribute-lft-out--N/A
*-lowering-*.f64N/A
associate-+r-N/A
sub-negN/A
associate-+l+N/A
+-lowering-+.f64N/A
+-commutativeN/A
unsub-negN/A
associate--l-N/A
+-commutativeN/A
--lowering--.f64N/A
+-commutativeN/A
+-lowering-+.f6499.9%
Simplified99.9%
Taylor expanded in d4 around 0
*-lowering-*.f64N/A
--lowering--.f64N/A
+-lowering-+.f6490.0%
Simplified90.0%
if -3.6000000000000003e76 < d2 Initial program 88.6%
distribute-lft-out--N/A
*-commutativeN/A
distribute-lft-outN/A
distribute-lft-out--N/A
*-lowering-*.f64N/A
associate-+r-N/A
sub-negN/A
associate-+l+N/A
+-lowering-+.f64N/A
+-commutativeN/A
unsub-negN/A
associate--l-N/A
+-commutativeN/A
--lowering--.f64N/A
+-commutativeN/A
+-lowering-+.f64100.0%
Simplified100.0%
Taylor expanded in d2 around 0
*-lowering-*.f64N/A
--lowering--.f64N/A
+-lowering-+.f6485.0%
Simplified85.0%
(FPCore (d1 d2 d3 d4) :precision binary64 (if (<= d4 5.2e+60) (* d1 (- d2 (+ d1 d3))) (* d1 (- d4 d3))))
double code(double d1, double d2, double d3, double d4) {
double tmp;
if (d4 <= 5.2e+60) {
tmp = d1 * (d2 - (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 <= 5.2d+60) then
tmp = d1 * (d2 - (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 <= 5.2e+60) {
tmp = d1 * (d2 - (d1 + d3));
} else {
tmp = d1 * (d4 - d3);
}
return tmp;
}
def code(d1, d2, d3, d4): tmp = 0 if d4 <= 5.2e+60: tmp = d1 * (d2 - (d1 + d3)) else: tmp = d1 * (d4 - d3) return tmp
function code(d1, d2, d3, d4) tmp = 0.0 if (d4 <= 5.2e+60) tmp = Float64(d1 * Float64(d2 - 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 <= 5.2e+60) tmp = d1 * (d2 - (d1 + d3)); else tmp = d1 * (d4 - d3); end tmp_2 = tmp; end
code[d1_, d2_, d3_, d4_] := If[LessEqual[d4, 5.2e+60], N[(d1 * N[(d2 - N[(d1 + d3), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(d1 * N[(d4 - d3), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;d4 \leq 5.2 \cdot 10^{+60}:\\
\;\;\;\;d1 \cdot \left(d2 - \left(d1 + d3\right)\right)\\
\mathbf{else}:\\
\;\;\;\;d1 \cdot \left(d4 - d3\right)\\
\end{array}
\end{array}
if d4 < 5.20000000000000016e60Initial program 90.8%
distribute-lft-out--N/A
*-commutativeN/A
distribute-lft-outN/A
distribute-lft-out--N/A
*-lowering-*.f64N/A
associate-+r-N/A
sub-negN/A
associate-+l+N/A
+-lowering-+.f64N/A
+-commutativeN/A
unsub-negN/A
associate--l-N/A
+-commutativeN/A
--lowering--.f64N/A
+-commutativeN/A
+-lowering-+.f64100.0%
Simplified100.0%
Taylor expanded in d4 around 0
*-lowering-*.f64N/A
--lowering--.f64N/A
+-lowering-+.f6483.5%
Simplified83.5%
if 5.20000000000000016e60 < d4 Initial program 82.0%
distribute-lft-out--N/A
*-commutativeN/A
distribute-lft-outN/A
distribute-lft-out--N/A
*-lowering-*.f64N/A
associate-+r-N/A
sub-negN/A
associate-+l+N/A
+-lowering-+.f64N/A
+-commutativeN/A
unsub-negN/A
associate--l-N/A
+-commutativeN/A
--lowering--.f64N/A
+-commutativeN/A
+-lowering-+.f64100.0%
Simplified100.0%
Taylor expanded in d2 around 0
*-lowering-*.f64N/A
--lowering--.f64N/A
+-lowering-+.f6486.4%
Simplified86.4%
Taylor expanded in d1 around 0
*-lowering-*.f64N/A
--lowering--.f6474.9%
Simplified74.9%
(FPCore (d1 d2 d3 d4) :precision binary64 (if (<= d2 -1.36e+76) (* d1 d2) (* d1 d4)))
double code(double d1, double d2, double d3, double d4) {
double tmp;
if (d2 <= -1.36e+76) {
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.36d+76)) 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.36e+76) {
tmp = d1 * d2;
} else {
tmp = d1 * d4;
}
return tmp;
}
def code(d1, d2, d3, d4): tmp = 0 if d2 <= -1.36e+76: tmp = d1 * d2 else: tmp = d1 * d4 return tmp
function code(d1, d2, d3, d4) tmp = 0.0 if (d2 <= -1.36e+76) 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.36e+76) tmp = d1 * d2; else tmp = d1 * d4; end tmp_2 = tmp; end
code[d1_, d2_, d3_, d4_] := If[LessEqual[d2, -1.36e+76], N[(d1 * d2), $MachinePrecision], N[(d1 * d4), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;d2 \leq -1.36 \cdot 10^{+76}:\\
\;\;\;\;d1 \cdot d2\\
\mathbf{else}:\\
\;\;\;\;d1 \cdot d4\\
\end{array}
\end{array}
if d2 < -1.36000000000000004e76Initial program 91.2%
distribute-lft-out--N/A
*-commutativeN/A
distribute-lft-outN/A
distribute-lft-out--N/A
*-lowering-*.f64N/A
associate-+r-N/A
sub-negN/A
associate-+l+N/A
+-lowering-+.f64N/A
+-commutativeN/A
unsub-negN/A
associate--l-N/A
+-commutativeN/A
--lowering--.f64N/A
+-commutativeN/A
+-lowering-+.f6499.9%
Simplified99.9%
Taylor expanded in d2 around inf
*-lowering-*.f6460.4%
Simplified60.4%
if -1.36000000000000004e76 < d2 Initial program 88.6%
distribute-lft-out--N/A
*-commutativeN/A
distribute-lft-outN/A
distribute-lft-out--N/A
*-lowering-*.f64N/A
associate-+r-N/A
sub-negN/A
associate-+l+N/A
+-lowering-+.f64N/A
+-commutativeN/A
unsub-negN/A
associate--l-N/A
+-commutativeN/A
--lowering--.f64N/A
+-commutativeN/A
+-lowering-+.f64100.0%
Simplified100.0%
Taylor expanded in d4 around inf
*-lowering-*.f6431.2%
Simplified31.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 89.0%
distribute-lft-out--N/A
*-commutativeN/A
distribute-lft-outN/A
distribute-lft-out--N/A
*-lowering-*.f64N/A
associate-+r-N/A
sub-negN/A
associate-+l+N/A
+-lowering-+.f64N/A
+-commutativeN/A
unsub-negN/A
associate--l-N/A
+-commutativeN/A
--lowering--.f64N/A
+-commutativeN/A
+-lowering-+.f64100.0%
Simplified100.0%
Taylor expanded in d2 around inf
*-lowering-*.f6426.3%
Simplified26.3%
(FPCore (d1 d2 d3 d4) :precision binary64 (* d1 (- (+ (- d2 d3) d4) d1)))
double code(double d1, double d2, double d3, double d4) {
return d1 * (((d2 - d3) + d4) - d1);
}
real(8) function code(d1, d2, d3, d4)
real(8), intent (in) :: d1
real(8), intent (in) :: d2
real(8), intent (in) :: d3
real(8), intent (in) :: d4
code = d1 * (((d2 - d3) + d4) - d1)
end function
public static double code(double d1, double d2, double d3, double d4) {
return d1 * (((d2 - d3) + d4) - d1);
}
def code(d1, d2, d3, d4): return d1 * (((d2 - d3) + d4) - d1)
function code(d1, d2, d3, d4) return Float64(d1 * Float64(Float64(Float64(d2 - d3) + d4) - d1)) end
function tmp = code(d1, d2, d3, d4) tmp = d1 * (((d2 - d3) + d4) - d1); end
code[d1_, d2_, d3_, d4_] := N[(d1 * N[(N[(N[(d2 - d3), $MachinePrecision] + d4), $MachinePrecision] - d1), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
d1 \cdot \left(\left(\left(d2 - d3\right) + d4\right) - d1\right)
\end{array}
herbie shell --seed 2024160
(FPCore (d1 d2 d3 d4)
:name "FastMath dist4"
:precision binary64
:alt
(! :herbie-platform default (* d1 (- (+ (- d2 d3) d4) d1)))
(- (+ (- (* d1 d2) (* d1 d3)) (* d4 d1)) (* d1 d1)))