
(FPCore (d1 d2 d3 d4) :precision binary64 (- (+ (- (* d1 d2) (* d1 d3)) (* d4 d1)) (* d1 d1)))
double code(double d1, double d2, double d3, double d4) {
return (((d1 * d2) - (d1 * d3)) + (d4 * d1)) - (d1 * d1);
}
real(8) function code(d1, d2, d3, d4)
real(8), intent (in) :: d1
real(8), intent (in) :: d2
real(8), intent (in) :: d3
real(8), intent (in) :: d4
code = (((d1 * d2) - (d1 * d3)) + (d4 * d1)) - (d1 * d1)
end function
public static double code(double d1, double d2, double d3, double d4) {
return (((d1 * d2) - (d1 * d3)) + (d4 * d1)) - (d1 * d1);
}
def code(d1, d2, d3, d4): return (((d1 * d2) - (d1 * d3)) + (d4 * d1)) - (d1 * d1)
function code(d1, d2, d3, d4) return Float64(Float64(Float64(Float64(d1 * d2) - Float64(d1 * d3)) + Float64(d4 * d1)) - Float64(d1 * d1)) end
function tmp = code(d1, d2, d3, d4) tmp = (((d1 * d2) - (d1 * d3)) + (d4 * d1)) - (d1 * d1); end
code[d1_, d2_, d3_, d4_] := N[(N[(N[(N[(d1 * d2), $MachinePrecision] - N[(d1 * d3), $MachinePrecision]), $MachinePrecision] + N[(d4 * d1), $MachinePrecision]), $MachinePrecision] - N[(d1 * d1), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(d1 \cdot d2 - d1 \cdot d3\right) + d4 \cdot d1\right) - d1 \cdot d1
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 12 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (d1 d2 d3 d4) :precision binary64 (- (+ (- (* d1 d2) (* d1 d3)) (* d4 d1)) (* d1 d1)))
double code(double d1, double d2, double d3, double d4) {
return (((d1 * d2) - (d1 * d3)) + (d4 * d1)) - (d1 * d1);
}
real(8) function code(d1, d2, d3, d4)
real(8), intent (in) :: d1
real(8), intent (in) :: d2
real(8), intent (in) :: d3
real(8), intent (in) :: d4
code = (((d1 * d2) - (d1 * d3)) + (d4 * d1)) - (d1 * d1)
end function
public static double code(double d1, double d2, double d3, double d4) {
return (((d1 * d2) - (d1 * d3)) + (d4 * d1)) - (d1 * d1);
}
def code(d1, d2, d3, d4): return (((d1 * d2) - (d1 * d3)) + (d4 * d1)) - (d1 * d1)
function code(d1, d2, d3, d4) return Float64(Float64(Float64(Float64(d1 * d2) - Float64(d1 * d3)) + Float64(d4 * d1)) - Float64(d1 * d1)) end
function tmp = code(d1, d2, d3, d4) tmp = (((d1 * d2) - (d1 * d3)) + (d4 * d1)) - (d1 * d1); end
code[d1_, d2_, d3_, d4_] := N[(N[(N[(N[(d1 * d2), $MachinePrecision] - N[(d1 * d3), $MachinePrecision]), $MachinePrecision] + N[(d4 * d1), $MachinePrecision]), $MachinePrecision] - N[(d1 * d1), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(d1 \cdot d2 - d1 \cdot d3\right) + d4 \cdot d1\right) - d1 \cdot d1
\end{array}
(FPCore (d1 d2 d3 d4) :precision binary64 (* d1 (+ d2 (- 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 (- d4 d1))))
(if (<= d2 -3.8e+106)
(* d1 (- d2 d3))
(if (<= d2 -1.1e-47)
t_0
(if (<= d2 -4.8e-232)
(* d1 (- (- 0.0 d3) d1))
(if (<= d2 8.5e-138) t_0 (* d1 (- d4 d3))))))))
double code(double d1, double d2, double d3, double d4) {
double t_0 = d1 * (d4 - d1);
double tmp;
if (d2 <= -3.8e+106) {
tmp = d1 * (d2 - d3);
} else if (d2 <= -1.1e-47) {
tmp = t_0;
} else if (d2 <= -4.8e-232) {
tmp = d1 * ((0.0 - d3) - d1);
} else if (d2 <= 8.5e-138) {
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 * (d4 - d1)
if (d2 <= (-3.8d+106)) then
tmp = d1 * (d2 - d3)
else if (d2 <= (-1.1d-47)) then
tmp = t_0
else if (d2 <= (-4.8d-232)) then
tmp = d1 * ((0.0d0 - d3) - d1)
else if (d2 <= 8.5d-138) 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 * (d4 - d1);
double tmp;
if (d2 <= -3.8e+106) {
tmp = d1 * (d2 - d3);
} else if (d2 <= -1.1e-47) {
tmp = t_0;
} else if (d2 <= -4.8e-232) {
tmp = d1 * ((0.0 - d3) - d1);
} else if (d2 <= 8.5e-138) {
tmp = t_0;
} else {
tmp = d1 * (d4 - d3);
}
return tmp;
}
def code(d1, d2, d3, d4): t_0 = d1 * (d4 - d1) tmp = 0 if d2 <= -3.8e+106: tmp = d1 * (d2 - d3) elif d2 <= -1.1e-47: tmp = t_0 elif d2 <= -4.8e-232: tmp = d1 * ((0.0 - d3) - d1) elif d2 <= 8.5e-138: tmp = t_0 else: tmp = d1 * (d4 - d3) return tmp
function code(d1, d2, d3, d4) t_0 = Float64(d1 * Float64(d4 - d1)) tmp = 0.0 if (d2 <= -3.8e+106) tmp = Float64(d1 * Float64(d2 - d3)); elseif (d2 <= -1.1e-47) tmp = t_0; elseif (d2 <= -4.8e-232) tmp = Float64(d1 * Float64(Float64(0.0 - d3) - d1)); elseif (d2 <= 8.5e-138) 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 * (d4 - d1); tmp = 0.0; if (d2 <= -3.8e+106) tmp = d1 * (d2 - d3); elseif (d2 <= -1.1e-47) tmp = t_0; elseif (d2 <= -4.8e-232) tmp = d1 * ((0.0 - d3) - d1); elseif (d2 <= 8.5e-138) 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[(d4 - d1), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[d2, -3.8e+106], N[(d1 * N[(d2 - d3), $MachinePrecision]), $MachinePrecision], If[LessEqual[d2, -1.1e-47], t$95$0, If[LessEqual[d2, -4.8e-232], N[(d1 * N[(N[(0.0 - d3), $MachinePrecision] - d1), $MachinePrecision]), $MachinePrecision], If[LessEqual[d2, 8.5e-138], t$95$0, N[(d1 * N[(d4 - d3), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := d1 \cdot \left(d4 - d1\right)\\
\mathbf{if}\;d2 \leq -3.8 \cdot 10^{+106}:\\
\;\;\;\;d1 \cdot \left(d2 - d3\right)\\
\mathbf{elif}\;d2 \leq -1.1 \cdot 10^{-47}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;d2 \leq -4.8 \cdot 10^{-232}:\\
\;\;\;\;d1 \cdot \left(\left(0 - d3\right) - d1\right)\\
\mathbf{elif}\;d2 \leq 8.5 \cdot 10^{-138}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;d1 \cdot \left(d4 - d3\right)\\
\end{array}
\end{array}
if d2 < -3.7999999999999998e106Initial program 80.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 0
*-lowering-*.f64N/A
--lowering--.f64N/A
+-lowering-+.f6495.2%
Simplified95.2%
Taylor expanded in d1 around 0
*-lowering-*.f64N/A
--lowering--.f6487.7%
Simplified87.7%
if -3.7999999999999998e106 < d2 < -1.10000000000000009e-47 or -4.79999999999999998e-232 < d2 < 8.50000000000000035e-138Initial program 88.3%
Taylor expanded in d4 around inf
*-lowering-*.f6466.9%
Simplified66.9%
distribute-lft-out--N/A
*-commutativeN/A
*-lowering-*.f64N/A
--lowering--.f6473.4%
Applied egg-rr73.4%
if -1.10000000000000009e-47 < d2 < -4.79999999999999998e-232Initial program 97.3%
Taylor expanded in d3 around inf
mul-1-negN/A
neg-sub0N/A
--lowering--.f64N/A
*-lowering-*.f6479.9%
Simplified79.9%
associate--l-N/A
sub0-negN/A
distribute-lft-outN/A
distribute-rgt-neg-inN/A
*-lowering-*.f64N/A
neg-lowering-neg.f64N/A
+-lowering-+.f6482.5%
Applied egg-rr82.5%
if 8.50000000000000035e-138 < d2 Initial program 90.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 d1 around 0
*-lowering-*.f64N/A
+-commutativeN/A
associate--l+N/A
+-lowering-+.f64N/A
--lowering--.f6485.4%
Simplified85.4%
Taylor expanded in d2 around 0
*-lowering-*.f64N/A
--lowering--.f6447.7%
Simplified47.7%
Final simplification66.9%
(FPCore (d1 d2 d3 d4)
:precision binary64
(let* ((t_0 (* d1 (- d2 d1))))
(if (<= d1 -1.75e+120)
t_0
(if (<= d1 7e+139) (* d1 (+ d4 (- d2 d3))) t_0))))
double code(double d1, double d2, double d3, double d4) {
double t_0 = d1 * (d2 - d1);
double tmp;
if (d1 <= -1.75e+120) {
tmp = t_0;
} else if (d1 <= 7e+139) {
tmp = d1 * (d4 + (d2 - d3));
} 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 = d1 * (d2 - d1)
if (d1 <= (-1.75d+120)) then
tmp = t_0
else if (d1 <= 7d+139) then
tmp = d1 * (d4 + (d2 - d3))
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 - d1);
double tmp;
if (d1 <= -1.75e+120) {
tmp = t_0;
} else if (d1 <= 7e+139) {
tmp = d1 * (d4 + (d2 - d3));
} else {
tmp = t_0;
}
return tmp;
}
def code(d1, d2, d3, d4): t_0 = d1 * (d2 - d1) tmp = 0 if d1 <= -1.75e+120: tmp = t_0 elif d1 <= 7e+139: tmp = d1 * (d4 + (d2 - d3)) else: tmp = t_0 return tmp
function code(d1, d2, d3, d4) t_0 = Float64(d1 * Float64(d2 - d1)) tmp = 0.0 if (d1 <= -1.75e+120) tmp = t_0; elseif (d1 <= 7e+139) tmp = Float64(d1 * Float64(d4 + Float64(d2 - d3))); else tmp = t_0; end return tmp end
function tmp_2 = code(d1, d2, d3, d4) t_0 = d1 * (d2 - d1); tmp = 0.0; if (d1 <= -1.75e+120) tmp = t_0; elseif (d1 <= 7e+139) tmp = d1 * (d4 + (d2 - d3)); else tmp = t_0; end tmp_2 = tmp; end
code[d1_, d2_, d3_, d4_] := Block[{t$95$0 = N[(d1 * N[(d2 - d1), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[d1, -1.75e+120], t$95$0, If[LessEqual[d1, 7e+139], N[(d1 * N[(d4 + N[(d2 - d3), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := d1 \cdot \left(d2 - d1\right)\\
\mathbf{if}\;d1 \leq -1.75 \cdot 10^{+120}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;d1 \leq 7 \cdot 10^{+139}:\\
\;\;\;\;d1 \cdot \left(d4 + \left(d2 - d3\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if d1 < -1.75000000000000004e120 or 6.99999999999999957e139 < d1 Initial program 64.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 0
*-lowering-*.f64N/A
--lowering--.f64N/A
+-lowering-+.f6493.8%
Simplified93.8%
Taylor expanded in d3 around 0
*-lowering-*.f64N/A
--lowering--.f6487.3%
Simplified87.3%
if -1.75000000000000004e120 < d1 < 6.99999999999999957e139Initial program 99.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-+.f6499.9%
Simplified99.9%
Taylor expanded in d1 around 0
*-lowering-*.f64N/A
+-commutativeN/A
associate--l+N/A
+-lowering-+.f64N/A
--lowering--.f6493.8%
Simplified93.8%
(FPCore (d1 d2 d3 d4) :precision binary64 (if (<= d2 -4.4e+104) (* d1 (- d2 d3)) (if (<= d2 1.02e-138) (* d1 (- d4 d1)) (* d1 (- d4 d3)))))
double code(double d1, double d2, double d3, double d4) {
double tmp;
if (d2 <= -4.4e+104) {
tmp = d1 * (d2 - d3);
} else if (d2 <= 1.02e-138) {
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 <= (-4.4d+104)) then
tmp = d1 * (d2 - d3)
else if (d2 <= 1.02d-138) 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 <= -4.4e+104) {
tmp = d1 * (d2 - d3);
} else if (d2 <= 1.02e-138) {
tmp = d1 * (d4 - d1);
} else {
tmp = d1 * (d4 - d3);
}
return tmp;
}
def code(d1, d2, d3, d4): tmp = 0 if d2 <= -4.4e+104: tmp = d1 * (d2 - d3) elif d2 <= 1.02e-138: tmp = d1 * (d4 - d1) else: tmp = d1 * (d4 - d3) return tmp
function code(d1, d2, d3, d4) tmp = 0.0 if (d2 <= -4.4e+104) tmp = Float64(d1 * Float64(d2 - d3)); elseif (d2 <= 1.02e-138) 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 <= -4.4e+104) tmp = d1 * (d2 - d3); elseif (d2 <= 1.02e-138) tmp = d1 * (d4 - d1); else tmp = d1 * (d4 - d3); end tmp_2 = tmp; end
code[d1_, d2_, d3_, d4_] := If[LessEqual[d2, -4.4e+104], N[(d1 * N[(d2 - d3), $MachinePrecision]), $MachinePrecision], If[LessEqual[d2, 1.02e-138], N[(d1 * N[(d4 - d1), $MachinePrecision]), $MachinePrecision], N[(d1 * N[(d4 - d3), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;d2 \leq -4.4 \cdot 10^{+104}:\\
\;\;\;\;d1 \cdot \left(d2 - d3\right)\\
\mathbf{elif}\;d2 \leq 1.02 \cdot 10^{-138}:\\
\;\;\;\;d1 \cdot \left(d4 - d1\right)\\
\mathbf{else}:\\
\;\;\;\;d1 \cdot \left(d4 - d3\right)\\
\end{array}
\end{array}
if d2 < -4.40000000000000001e104Initial program 80.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 0
*-lowering-*.f64N/A
--lowering--.f64N/A
+-lowering-+.f6495.2%
Simplified95.2%
Taylor expanded in d1 around 0
*-lowering-*.f64N/A
--lowering--.f6487.7%
Simplified87.7%
if -4.40000000000000001e104 < d2 < 1.02000000000000007e-138Initial program 91.3%
Taylor expanded in d4 around inf
*-lowering-*.f6465.5%
Simplified65.5%
distribute-lft-out--N/A
*-commutativeN/A
*-lowering-*.f64N/A
--lowering--.f6469.8%
Applied egg-rr69.8%
if 1.02000000000000007e-138 < d2 Initial program 90.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 d1 around 0
*-lowering-*.f64N/A
+-commutativeN/A
associate--l+N/A
+-lowering-+.f64N/A
--lowering--.f6485.4%
Simplified85.4%
Taylor expanded in d2 around 0
*-lowering-*.f64N/A
--lowering--.f6447.7%
Simplified47.7%
Final simplification63.9%
(FPCore (d1 d2 d3 d4) :precision binary64 (if (<= d4 5e-299) (* d1 (- d2 d3)) (if (<= d4 1.5e+47) (* d1 (- d2 d1)) (* d1 (- d4 d3)))))
double code(double d1, double d2, double d3, double d4) {
double tmp;
if (d4 <= 5e-299) {
tmp = d1 * (d2 - d3);
} else if (d4 <= 1.5e+47) {
tmp = d1 * (d2 - 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 (d4 <= 5d-299) then
tmp = d1 * (d2 - d3)
else if (d4 <= 1.5d+47) then
tmp = d1 * (d2 - 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 (d4 <= 5e-299) {
tmp = d1 * (d2 - d3);
} else if (d4 <= 1.5e+47) {
tmp = d1 * (d2 - d1);
} else {
tmp = d1 * (d4 - d3);
}
return tmp;
}
def code(d1, d2, d3, d4): tmp = 0 if d4 <= 5e-299: tmp = d1 * (d2 - d3) elif d4 <= 1.5e+47: tmp = d1 * (d2 - d1) else: tmp = d1 * (d4 - d3) return tmp
function code(d1, d2, d3, d4) tmp = 0.0 if (d4 <= 5e-299) tmp = Float64(d1 * Float64(d2 - d3)); elseif (d4 <= 1.5e+47) tmp = Float64(d1 * Float64(d2 - d1)); else tmp = Float64(d1 * Float64(d4 - d3)); end return tmp end
function tmp_2 = code(d1, d2, d3, d4) tmp = 0.0; if (d4 <= 5e-299) tmp = d1 * (d2 - d3); elseif (d4 <= 1.5e+47) tmp = d1 * (d2 - d1); else tmp = d1 * (d4 - d3); end tmp_2 = tmp; end
code[d1_, d2_, d3_, d4_] := If[LessEqual[d4, 5e-299], N[(d1 * N[(d2 - d3), $MachinePrecision]), $MachinePrecision], If[LessEqual[d4, 1.5e+47], N[(d1 * N[(d2 - d1), $MachinePrecision]), $MachinePrecision], N[(d1 * N[(d4 - d3), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;d4 \leq 5 \cdot 10^{-299}:\\
\;\;\;\;d1 \cdot \left(d2 - d3\right)\\
\mathbf{elif}\;d4 \leq 1.5 \cdot 10^{+47}:\\
\;\;\;\;d1 \cdot \left(d2 - d1\right)\\
\mathbf{else}:\\
\;\;\;\;d1 \cdot \left(d4 - d3\right)\\
\end{array}
\end{array}
if d4 < 4.99999999999999956e-299Initial program 90.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 d4 around 0
*-lowering-*.f64N/A
--lowering--.f64N/A
+-lowering-+.f6478.6%
Simplified78.6%
Taylor expanded in d1 around 0
*-lowering-*.f64N/A
--lowering--.f6461.9%
Simplified61.9%
if 4.99999999999999956e-299 < d4 < 1.5000000000000001e47Initial program 87.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-+.f6497.5%
Simplified97.5%
Taylor expanded in d3 around 0
*-lowering-*.f64N/A
--lowering--.f6476.6%
Simplified76.6%
if 1.5000000000000001e47 < d4 Initial program 86.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-+.f6499.9%
Simplified99.9%
Taylor expanded in d1 around 0
*-lowering-*.f64N/A
+-commutativeN/A
associate--l+N/A
+-lowering-+.f64N/A
--lowering--.f6488.6%
Simplified88.6%
Taylor expanded in d2 around 0
*-lowering-*.f64N/A
--lowering--.f6474.4%
Simplified74.4%
(FPCore (d1 d2 d3 d4) :precision binary64 (let* ((t_0 (* d1 (- d2 d3)))) (if (<= d3 -9.8e+34) t_0 (if (<= d3 3.4e+55) (* d1 (+ d2 d4)) t_0))))
double code(double d1, double d2, double d3, double d4) {
double t_0 = d1 * (d2 - d3);
double tmp;
if (d3 <= -9.8e+34) {
tmp = t_0;
} else if (d3 <= 3.4e+55) {
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 = d1 * (d2 - d3)
if (d3 <= (-9.8d+34)) then
tmp = t_0
else if (d3 <= 3.4d+55) 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 = d1 * (d2 - d3);
double tmp;
if (d3 <= -9.8e+34) {
tmp = t_0;
} else if (d3 <= 3.4e+55) {
tmp = d1 * (d2 + d4);
} else {
tmp = t_0;
}
return tmp;
}
def code(d1, d2, d3, d4): t_0 = d1 * (d2 - d3) tmp = 0 if d3 <= -9.8e+34: tmp = t_0 elif d3 <= 3.4e+55: tmp = d1 * (d2 + d4) else: tmp = t_0 return tmp
function code(d1, d2, d3, d4) t_0 = Float64(d1 * Float64(d2 - d3)) tmp = 0.0 if (d3 <= -9.8e+34) tmp = t_0; elseif (d3 <= 3.4e+55) tmp = Float64(d1 * Float64(d2 + d4)); else tmp = t_0; end return tmp end
function tmp_2 = code(d1, d2, d3, d4) t_0 = d1 * (d2 - d3); tmp = 0.0; if (d3 <= -9.8e+34) tmp = t_0; elseif (d3 <= 3.4e+55) tmp = d1 * (d2 + d4); 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]}, If[LessEqual[d3, -9.8e+34], t$95$0, If[LessEqual[d3, 3.4e+55], N[(d1 * N[(d2 + d4), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := d1 \cdot \left(d2 - d3\right)\\
\mathbf{if}\;d3 \leq -9.8 \cdot 10^{+34}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;d3 \leq 3.4 \cdot 10^{+55}:\\
\;\;\;\;d1 \cdot \left(d2 + d4\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if d3 < -9.8000000000000005e34 or 3.3999999999999998e55 < d3 Initial program 81.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-+.f6499.9%
Simplified99.9%
Taylor expanded in d4 around 0
*-lowering-*.f64N/A
--lowering--.f64N/A
+-lowering-+.f6489.7%
Simplified89.7%
Taylor expanded in d1 around 0
*-lowering-*.f64N/A
--lowering--.f6474.9%
Simplified74.9%
if -9.8000000000000005e34 < d3 < 3.3999999999999998e55Initial program 93.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
Simplified73.3%
(FPCore (d1 d2 d3 d4) :precision binary64 (let* ((t_0 (- 0.0 (* d1 d1)))) (if (<= d1 -3.4e+120) t_0 (if (<= d1 2.25e+142) (* d1 (+ d2 d4)) t_0))))
double code(double d1, double d2, double d3, double d4) {
double t_0 = 0.0 - (d1 * d1);
double tmp;
if (d1 <= -3.4e+120) {
tmp = t_0;
} else if (d1 <= 2.25e+142) {
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 = 0.0d0 - (d1 * d1)
if (d1 <= (-3.4d+120)) then
tmp = t_0
else if (d1 <= 2.25d+142) 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 = 0.0 - (d1 * d1);
double tmp;
if (d1 <= -3.4e+120) {
tmp = t_0;
} else if (d1 <= 2.25e+142) {
tmp = d1 * (d2 + d4);
} else {
tmp = t_0;
}
return tmp;
}
def code(d1, d2, d3, d4): t_0 = 0.0 - (d1 * d1) tmp = 0 if d1 <= -3.4e+120: tmp = t_0 elif d1 <= 2.25e+142: tmp = d1 * (d2 + d4) else: tmp = t_0 return tmp
function code(d1, d2, d3, d4) t_0 = Float64(0.0 - Float64(d1 * d1)) tmp = 0.0 if (d1 <= -3.4e+120) tmp = t_0; elseif (d1 <= 2.25e+142) tmp = Float64(d1 * Float64(d2 + d4)); else tmp = t_0; end return tmp end
function tmp_2 = code(d1, d2, d3, d4) t_0 = 0.0 - (d1 * d1); tmp = 0.0; if (d1 <= -3.4e+120) tmp = t_0; elseif (d1 <= 2.25e+142) tmp = d1 * (d2 + d4); else tmp = t_0; end tmp_2 = tmp; end
code[d1_, d2_, d3_, d4_] := Block[{t$95$0 = N[(0.0 - N[(d1 * d1), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[d1, -3.4e+120], t$95$0, If[LessEqual[d1, 2.25e+142], N[(d1 * N[(d2 + d4), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 0 - d1 \cdot d1\\
\mathbf{if}\;d1 \leq -3.4 \cdot 10^{+120}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;d1 \leq 2.25 \cdot 10^{+142}:\\
\;\;\;\;d1 \cdot \left(d2 + d4\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if d1 < -3.39999999999999999e120 or 2.2499999999999999e142 < d1 Initial program 64.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 d1 around inf
mul-1-negN/A
neg-sub0N/A
--lowering--.f64N/A
unpow2N/A
*-lowering-*.f6482.0%
Simplified82.0%
sub0-negN/A
neg-lowering-neg.f64N/A
*-lowering-*.f6482.0%
Applied egg-rr82.0%
if -3.39999999999999999e120 < d1 < 2.2499999999999999e142Initial program 99.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-+.f6499.9%
Simplified99.9%
Taylor expanded in d4 around inf
Simplified65.5%
Final simplification70.4%
(FPCore (d1 d2 d3 d4) :precision binary64 (if (<= d4 -3.55e-246) (* d1 d2) (if (<= d4 4e+47) (- 0.0 (* d1 d1)) (* d1 d4))))
double code(double d1, double d2, double d3, double d4) {
double tmp;
if (d4 <= -3.55e-246) {
tmp = d1 * d2;
} else if (d4 <= 4e+47) {
tmp = 0.0 - (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 (d4 <= (-3.55d-246)) then
tmp = d1 * d2
else if (d4 <= 4d+47) then
tmp = 0.0d0 - (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 (d4 <= -3.55e-246) {
tmp = d1 * d2;
} else if (d4 <= 4e+47) {
tmp = 0.0 - (d1 * d1);
} else {
tmp = d1 * d4;
}
return tmp;
}
def code(d1, d2, d3, d4): tmp = 0 if d4 <= -3.55e-246: tmp = d1 * d2 elif d4 <= 4e+47: tmp = 0.0 - (d1 * d1) else: tmp = d1 * d4 return tmp
function code(d1, d2, d3, d4) tmp = 0.0 if (d4 <= -3.55e-246) tmp = Float64(d1 * d2); elseif (d4 <= 4e+47) tmp = Float64(0.0 - Float64(d1 * d1)); else tmp = Float64(d1 * d4); end return tmp end
function tmp_2 = code(d1, d2, d3, d4) tmp = 0.0; if (d4 <= -3.55e-246) tmp = d1 * d2; elseif (d4 <= 4e+47) tmp = 0.0 - (d1 * d1); else tmp = d1 * d4; end tmp_2 = tmp; end
code[d1_, d2_, d3_, d4_] := If[LessEqual[d4, -3.55e-246], N[(d1 * d2), $MachinePrecision], If[LessEqual[d4, 4e+47], N[(0.0 - N[(d1 * d1), $MachinePrecision]), $MachinePrecision], N[(d1 * d4), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;d4 \leq -3.55 \cdot 10^{-246}:\\
\;\;\;\;d1 \cdot d2\\
\mathbf{elif}\;d4 \leq 4 \cdot 10^{+47}:\\
\;\;\;\;0 - d1 \cdot d1\\
\mathbf{else}:\\
\;\;\;\;d1 \cdot d4\\
\end{array}
\end{array}
if d4 < -3.55000000000000018e-246Initial program 89.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 d2 around inf
*-lowering-*.f6433.1%
Simplified33.1%
if -3.55000000000000018e-246 < d4 < 4.0000000000000002e47Initial program 89.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 d1 around inf
mul-1-negN/A
neg-sub0N/A
--lowering--.f64N/A
unpow2N/A
*-lowering-*.f6439.3%
Simplified39.3%
sub0-negN/A
neg-lowering-neg.f64N/A
*-lowering-*.f6439.3%
Applied egg-rr39.3%
if 4.0000000000000002e47 < d4 Initial program 86.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-+.f6499.9%
Simplified99.9%
Taylor expanded in d4 around inf
*-lowering-*.f6453.5%
Simplified53.5%
Final simplification39.6%
(FPCore (d1 d2 d3 d4) :precision binary64 (if (<= d4 8e+44) (* d1 (- d2 (+ d1 d3))) (* d1 (+ d4 (- d2 d3)))))
double code(double d1, double d2, double d3, double d4) {
double tmp;
if (d4 <= 8e+44) {
tmp = d1 * (d2 - (d1 + d3));
} else {
tmp = d1 * (d4 + (d2 - d3));
}
return tmp;
}
real(8) function code(d1, d2, d3, d4)
real(8), intent (in) :: d1
real(8), intent (in) :: d2
real(8), intent (in) :: d3
real(8), intent (in) :: d4
real(8) :: tmp
if (d4 <= 8d+44) then
tmp = d1 * (d2 - (d1 + d3))
else
tmp = d1 * (d4 + (d2 - d3))
end if
code = tmp
end function
public static double code(double d1, double d2, double d3, double d4) {
double tmp;
if (d4 <= 8e+44) {
tmp = d1 * (d2 - (d1 + d3));
} else {
tmp = d1 * (d4 + (d2 - d3));
}
return tmp;
}
def code(d1, d2, d3, d4): tmp = 0 if d4 <= 8e+44: tmp = d1 * (d2 - (d1 + d3)) else: tmp = d1 * (d4 + (d2 - d3)) return tmp
function code(d1, d2, d3, d4) tmp = 0.0 if (d4 <= 8e+44) tmp = Float64(d1 * Float64(d2 - Float64(d1 + d3))); else tmp = Float64(d1 * Float64(d4 + Float64(d2 - d3))); end return tmp end
function tmp_2 = code(d1, d2, d3, d4) tmp = 0.0; if (d4 <= 8e+44) tmp = d1 * (d2 - (d1 + d3)); else tmp = d1 * (d4 + (d2 - d3)); end tmp_2 = tmp; end
code[d1_, d2_, d3_, d4_] := If[LessEqual[d4, 8e+44], N[(d1 * N[(d2 - N[(d1 + d3), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(d1 * N[(d4 + N[(d2 - d3), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;d4 \leq 8 \cdot 10^{+44}:\\
\;\;\;\;d1 \cdot \left(d2 - \left(d1 + d3\right)\right)\\
\mathbf{else}:\\
\;\;\;\;d1 \cdot \left(d4 + \left(d2 - d3\right)\right)\\
\end{array}
\end{array}
if d4 < 8.0000000000000007e44Initial program 89.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 0
*-lowering-*.f64N/A
--lowering--.f64N/A
+-lowering-+.f6485.4%
Simplified85.4%
if 8.0000000000000007e44 < d4 Initial program 87.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-+.f6499.9%
Simplified99.9%
Taylor expanded in d1 around 0
*-lowering-*.f64N/A
+-commutativeN/A
associate--l+N/A
+-lowering-+.f64N/A
--lowering--.f6488.8%
Simplified88.8%
(FPCore (d1 d2 d3 d4) :precision binary64 (if (<= d4 6.3e+47) (* d1 (- d2 d1)) (* d1 (+ d2 d4))))
double code(double d1, double d2, double d3, double d4) {
double tmp;
if (d4 <= 6.3e+47) {
tmp = d1 * (d2 - d1);
} else {
tmp = d1 * (d2 + d4);
}
return tmp;
}
real(8) function code(d1, d2, d3, d4)
real(8), intent (in) :: d1
real(8), intent (in) :: d2
real(8), intent (in) :: d3
real(8), intent (in) :: d4
real(8) :: tmp
if (d4 <= 6.3d+47) then
tmp = d1 * (d2 - d1)
else
tmp = d1 * (d2 + d4)
end if
code = tmp
end function
public static double code(double d1, double d2, double d3, double d4) {
double tmp;
if (d4 <= 6.3e+47) {
tmp = d1 * (d2 - d1);
} else {
tmp = d1 * (d2 + d4);
}
return tmp;
}
def code(d1, d2, d3, d4): tmp = 0 if d4 <= 6.3e+47: tmp = d1 * (d2 - d1) else: tmp = d1 * (d2 + d4) return tmp
function code(d1, d2, d3, d4) tmp = 0.0 if (d4 <= 6.3e+47) tmp = Float64(d1 * Float64(d2 - d1)); else tmp = Float64(d1 * Float64(d2 + d4)); end return tmp end
function tmp_2 = code(d1, d2, d3, d4) tmp = 0.0; if (d4 <= 6.3e+47) tmp = d1 * (d2 - d1); else tmp = d1 * (d2 + d4); end tmp_2 = tmp; end
code[d1_, d2_, d3_, d4_] := If[LessEqual[d4, 6.3e+47], N[(d1 * N[(d2 - d1), $MachinePrecision]), $MachinePrecision], N[(d1 * N[(d2 + d4), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;d4 \leq 6.3 \cdot 10^{+47}:\\
\;\;\;\;d1 \cdot \left(d2 - d1\right)\\
\mathbf{else}:\\
\;\;\;\;d1 \cdot \left(d2 + d4\right)\\
\end{array}
\end{array}
if d4 < 6.30000000000000003e47Initial program 89.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 0
*-lowering-*.f64N/A
--lowering--.f64N/A
+-lowering-+.f6485.5%
Simplified85.5%
Taylor expanded in d3 around 0
*-lowering-*.f64N/A
--lowering--.f6462.9%
Simplified62.9%
if 6.30000000000000003e47 < d4 Initial program 86.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-+.f6499.9%
Simplified99.9%
Taylor expanded in d4 around inf
Simplified69.4%
(FPCore (d1 d2 d3 d4) :precision binary64 (if (<= d2 -5.4e+82) (* d1 d2) (* d1 d4)))
double code(double d1, double d2, double d3, double d4) {
double tmp;
if (d2 <= -5.4e+82) {
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 <= (-5.4d+82)) 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 <= -5.4e+82) {
tmp = d1 * d2;
} else {
tmp = d1 * d4;
}
return tmp;
}
def code(d1, d2, d3, d4): tmp = 0 if d2 <= -5.4e+82: tmp = d1 * d2 else: tmp = d1 * d4 return tmp
function code(d1, d2, d3, d4) tmp = 0.0 if (d2 <= -5.4e+82) 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 <= -5.4e+82) tmp = d1 * d2; else tmp = d1 * d4; end tmp_2 = tmp; end
code[d1_, d2_, d3_, d4_] := If[LessEqual[d2, -5.4e+82], N[(d1 * d2), $MachinePrecision], N[(d1 * d4), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;d2 \leq -5.4 \cdot 10^{+82}:\\
\;\;\;\;d1 \cdot d2\\
\mathbf{else}:\\
\;\;\;\;d1 \cdot d4\\
\end{array}
\end{array}
if d2 < -5.3999999999999999e82Initial program 80.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 inf
*-lowering-*.f6474.6%
Simplified74.6%
if -5.3999999999999999e82 < d2 Initial 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
*-lowering-*.f6431.0%
Simplified31.0%
(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-*.f6434.1%
Simplified34.1%
(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 2024154
(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)))