
(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 84.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%
(FPCore (d1 d2 d3 d4)
:precision binary64
(let* ((t_0 (* d1 (- d4 d3))))
(if (<= d2 -3.5e+49)
(* d1 (- d2 d1))
(if (<= d2 -4.6e-77) t_0 (if (<= d2 5.8e-214) (* d1 (- d4 d1)) t_0)))))
double code(double d1, double d2, double d3, double d4) {
double t_0 = d1 * (d4 - d3);
double tmp;
if (d2 <= -3.5e+49) {
tmp = d1 * (d2 - d1);
} else if (d2 <= -4.6e-77) {
tmp = t_0;
} else if (d2 <= 5.8e-214) {
tmp = d1 * (d4 - d1);
} 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 * (d4 - d3)
if (d2 <= (-3.5d+49)) then
tmp = d1 * (d2 - d1)
else if (d2 <= (-4.6d-77)) then
tmp = t_0
else if (d2 <= 5.8d-214) then
tmp = d1 * (d4 - d1)
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 * (d4 - d3);
double tmp;
if (d2 <= -3.5e+49) {
tmp = d1 * (d2 - d1);
} else if (d2 <= -4.6e-77) {
tmp = t_0;
} else if (d2 <= 5.8e-214) {
tmp = d1 * (d4 - d1);
} else {
tmp = t_0;
}
return tmp;
}
def code(d1, d2, d3, d4): t_0 = d1 * (d4 - d3) tmp = 0 if d2 <= -3.5e+49: tmp = d1 * (d2 - d1) elif d2 <= -4.6e-77: tmp = t_0 elif d2 <= 5.8e-214: tmp = d1 * (d4 - d1) else: tmp = t_0 return tmp
function code(d1, d2, d3, d4) t_0 = Float64(d1 * Float64(d4 - d3)) tmp = 0.0 if (d2 <= -3.5e+49) tmp = Float64(d1 * Float64(d2 - d1)); elseif (d2 <= -4.6e-77) tmp = t_0; elseif (d2 <= 5.8e-214) tmp = Float64(d1 * Float64(d4 - d1)); else tmp = t_0; end return tmp end
function tmp_2 = code(d1, d2, d3, d4) t_0 = d1 * (d4 - d3); tmp = 0.0; if (d2 <= -3.5e+49) tmp = d1 * (d2 - d1); elseif (d2 <= -4.6e-77) tmp = t_0; elseif (d2 <= 5.8e-214) tmp = d1 * (d4 - d1); else tmp = t_0; end tmp_2 = tmp; end
code[d1_, d2_, d3_, d4_] := Block[{t$95$0 = N[(d1 * N[(d4 - d3), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[d2, -3.5e+49], N[(d1 * N[(d2 - d1), $MachinePrecision]), $MachinePrecision], If[LessEqual[d2, -4.6e-77], t$95$0, If[LessEqual[d2, 5.8e-214], N[(d1 * N[(d4 - d1), $MachinePrecision]), $MachinePrecision], t$95$0]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := d1 \cdot \left(d4 - d3\right)\\
\mathbf{if}\;d2 \leq -3.5 \cdot 10^{+49}:\\
\;\;\;\;d1 \cdot \left(d2 - d1\right)\\
\mathbf{elif}\;d2 \leq -4.6 \cdot 10^{-77}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;d2 \leq 5.8 \cdot 10^{-214}:\\
\;\;\;\;d1 \cdot \left(d4 - d1\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if d2 < -3.49999999999999975e49Initial program 83.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-+.f6490.3%
Simplified90.3%
Taylor expanded in d1 around inf
Simplified78.8%
if -3.49999999999999975e49 < d2 < -4.59999999999999997e-77 or 5.7999999999999997e-214 < d2 Initial program 85.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%
+-commutativeN/A
distribute-lft-inN/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f6493.2%
Applied egg-rr93.2%
Taylor expanded in d2 around 0
*-lowering-*.f64N/A
--lowering--.f64N/A
+-lowering-+.f6479.5%
Simplified79.5%
Taylor expanded in d1 around 0
remove-double-negN/A
distribute-rgt-neg-outN/A
mul-1-negN/A
distribute-rgt-neg-inN/A
*-rgt-identityN/A
*-inversesN/A
associate-/l*N/A
associate-*l/N/A
associate-*r/N/A
*-lowering-*.f64N/A
neg-sub0N/A
associate-*r/N/A
associate-*l/N/A
associate-/l*N/A
*-inversesN/A
mul-1-negN/A
cancel-sign-subN/A
*-rgt-identityN/A
sub-negN/A
+-commutativeN/A
associate-+l+N/A
Simplified59.3%
if -4.59999999999999997e-77 < d2 < 5.7999999999999997e-214Initial program 82.8%
Taylor expanded in d4 around inf
*-lowering-*.f6465.3%
Simplified65.3%
distribute-lft-out--N/A
*-commutativeN/A
*-lowering-*.f64N/A
--lowering--.f6477.8%
Applied egg-rr77.8%
Final simplification68.4%
(FPCore (d1 d2 d3 d4)
:precision binary64
(let* ((t_0 (* d1 (- d2 d3))))
(if (<= d3 -1.02e+89)
t_0
(if (<= d3 -1.5e-141)
(* d1 (+ d2 d4))
(if (<= d3 4e+46) (* d1 (- d2 d1)) t_0)))))
double code(double d1, double d2, double d3, double d4) {
double t_0 = d1 * (d2 - d3);
double tmp;
if (d3 <= -1.02e+89) {
tmp = t_0;
} else if (d3 <= -1.5e-141) {
tmp = d1 * (d2 + d4);
} else if (d3 <= 4e+46) {
tmp = d1 * (d2 - d1);
} 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 <= (-1.02d+89)) then
tmp = t_0
else if (d3 <= (-1.5d-141)) then
tmp = d1 * (d2 + d4)
else if (d3 <= 4d+46) then
tmp = d1 * (d2 - d1)
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 <= -1.02e+89) {
tmp = t_0;
} else if (d3 <= -1.5e-141) {
tmp = d1 * (d2 + d4);
} else if (d3 <= 4e+46) {
tmp = d1 * (d2 - d1);
} else {
tmp = t_0;
}
return tmp;
}
def code(d1, d2, d3, d4): t_0 = d1 * (d2 - d3) tmp = 0 if d3 <= -1.02e+89: tmp = t_0 elif d3 <= -1.5e-141: tmp = d1 * (d2 + d4) elif d3 <= 4e+46: tmp = d1 * (d2 - d1) else: tmp = t_0 return tmp
function code(d1, d2, d3, d4) t_0 = Float64(d1 * Float64(d2 - d3)) tmp = 0.0 if (d3 <= -1.02e+89) tmp = t_0; elseif (d3 <= -1.5e-141) tmp = Float64(d1 * Float64(d2 + d4)); elseif (d3 <= 4e+46) tmp = Float64(d1 * Float64(d2 - d1)); 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 <= -1.02e+89) tmp = t_0; elseif (d3 <= -1.5e-141) tmp = d1 * (d2 + d4); elseif (d3 <= 4e+46) tmp = d1 * (d2 - d1); 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, -1.02e+89], t$95$0, If[LessEqual[d3, -1.5e-141], N[(d1 * N[(d2 + d4), $MachinePrecision]), $MachinePrecision], If[LessEqual[d3, 4e+46], N[(d1 * N[(d2 - d1), $MachinePrecision]), $MachinePrecision], t$95$0]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := d1 \cdot \left(d2 - d3\right)\\
\mathbf{if}\;d3 \leq -1.02 \cdot 10^{+89}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;d3 \leq -1.5 \cdot 10^{-141}:\\
\;\;\;\;d1 \cdot \left(d2 + d4\right)\\
\mathbf{elif}\;d3 \leq 4 \cdot 10^{+46}:\\
\;\;\;\;d1 \cdot \left(d2 - d1\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if d3 < -1.0199999999999999e89 or 4e46 < d3 Initial program 80.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-+.f6488.2%
Simplified88.2%
Taylor expanded in d1 around 0
Simplified82.5%
if -1.0199999999999999e89 < d3 < -1.49999999999999992e-141Initial program 91.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-+.f6499.9%
Simplified99.9%
Taylor expanded in d4 around inf
Simplified72.1%
if -1.49999999999999992e-141 < d3 < 4e46Initial program 83.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-+.f6469.8%
Simplified69.8%
Taylor expanded in d1 around inf
Simplified67.9%
(FPCore (d1 d2 d3 d4) :precision binary64 (if (<= d1 -1.55e+167) (* d1 (- d2 d1)) (if (<= d1 2.9e+44) (* d1 (+ d4 (- d2 d3))) (* d1 (- d4 d1)))))
double code(double d1, double d2, double d3, double d4) {
double tmp;
if (d1 <= -1.55e+167) {
tmp = d1 * (d2 - d1);
} else if (d1 <= 2.9e+44) {
tmp = d1 * (d4 + (d2 - d3));
} else {
tmp = d1 * (d4 - d1);
}
return tmp;
}
real(8) function code(d1, d2, d3, d4)
real(8), intent (in) :: d1
real(8), intent (in) :: d2
real(8), intent (in) :: d3
real(8), intent (in) :: d4
real(8) :: tmp
if (d1 <= (-1.55d+167)) then
tmp = d1 * (d2 - d1)
else if (d1 <= 2.9d+44) then
tmp = d1 * (d4 + (d2 - d3))
else
tmp = d1 * (d4 - d1)
end if
code = tmp
end function
public static double code(double d1, double d2, double d3, double d4) {
double tmp;
if (d1 <= -1.55e+167) {
tmp = d1 * (d2 - d1);
} else if (d1 <= 2.9e+44) {
tmp = d1 * (d4 + (d2 - d3));
} else {
tmp = d1 * (d4 - d1);
}
return tmp;
}
def code(d1, d2, d3, d4): tmp = 0 if d1 <= -1.55e+167: tmp = d1 * (d2 - d1) elif d1 <= 2.9e+44: tmp = d1 * (d4 + (d2 - d3)) else: tmp = d1 * (d4 - d1) return tmp
function code(d1, d2, d3, d4) tmp = 0.0 if (d1 <= -1.55e+167) tmp = Float64(d1 * Float64(d2 - d1)); elseif (d1 <= 2.9e+44) tmp = Float64(d1 * Float64(d4 + Float64(d2 - d3))); else tmp = Float64(d1 * Float64(d4 - d1)); end return tmp end
function tmp_2 = code(d1, d2, d3, d4) tmp = 0.0; if (d1 <= -1.55e+167) tmp = d1 * (d2 - d1); elseif (d1 <= 2.9e+44) tmp = d1 * (d4 + (d2 - d3)); else tmp = d1 * (d4 - d1); end tmp_2 = tmp; end
code[d1_, d2_, d3_, d4_] := If[LessEqual[d1, -1.55e+167], N[(d1 * N[(d2 - d1), $MachinePrecision]), $MachinePrecision], If[LessEqual[d1, 2.9e+44], N[(d1 * N[(d4 + N[(d2 - d3), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(d1 * N[(d4 - d1), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;d1 \leq -1.55 \cdot 10^{+167}:\\
\;\;\;\;d1 \cdot \left(d2 - d1\right)\\
\mathbf{elif}\;d1 \leq 2.9 \cdot 10^{+44}:\\
\;\;\;\;d1 \cdot \left(d4 + \left(d2 - d3\right)\right)\\
\mathbf{else}:\\
\;\;\;\;d1 \cdot \left(d4 - d1\right)\\
\end{array}
\end{array}
if d1 < -1.55e167Initial program 38.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 0
*-lowering-*.f64N/A
--lowering--.f64N/A
+-lowering-+.f6494.1%
Simplified94.1%
Taylor expanded in d1 around inf
Simplified91.2%
if -1.55e167 < d1 < 2.9000000000000002e44Initial program 98.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 d1 around 0
*-lowering-*.f64N/A
+-commutativeN/A
associate--l+N/A
+-lowering-+.f64N/A
--lowering--.f6491.7%
Simplified91.7%
if 2.9000000000000002e44 < d1 Initial program 71.9%
Taylor expanded in d4 around inf
*-lowering-*.f6465.3%
Simplified65.3%
distribute-lft-out--N/A
*-commutativeN/A
*-lowering-*.f64N/A
--lowering--.f6474.1%
Applied egg-rr74.1%
Final simplification87.7%
(FPCore (d1 d2 d3 d4) :precision binary64 (if (<= d4 -1.35e-250) (* d1 (- d2 d3)) (if (<= d4 1.6e+110) (* d1 (- d2 d1)) (* d1 (- d4 d3)))))
double code(double d1, double d2, double d3, double d4) {
double tmp;
if (d4 <= -1.35e-250) {
tmp = d1 * (d2 - d3);
} else if (d4 <= 1.6e+110) {
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 <= (-1.35d-250)) then
tmp = d1 * (d2 - d3)
else if (d4 <= 1.6d+110) 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 <= -1.35e-250) {
tmp = d1 * (d2 - d3);
} else if (d4 <= 1.6e+110) {
tmp = d1 * (d2 - d1);
} else {
tmp = d1 * (d4 - d3);
}
return tmp;
}
def code(d1, d2, d3, d4): tmp = 0 if d4 <= -1.35e-250: tmp = d1 * (d2 - d3) elif d4 <= 1.6e+110: tmp = d1 * (d2 - d1) else: tmp = d1 * (d4 - d3) return tmp
function code(d1, d2, d3, d4) tmp = 0.0 if (d4 <= -1.35e-250) tmp = Float64(d1 * Float64(d2 - d3)); elseif (d4 <= 1.6e+110) 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 <= -1.35e-250) tmp = d1 * (d2 - d3); elseif (d4 <= 1.6e+110) tmp = d1 * (d2 - d1); else tmp = d1 * (d4 - d3); end tmp_2 = tmp; end
code[d1_, d2_, d3_, d4_] := If[LessEqual[d4, -1.35e-250], N[(d1 * N[(d2 - d3), $MachinePrecision]), $MachinePrecision], If[LessEqual[d4, 1.6e+110], N[(d1 * N[(d2 - d1), $MachinePrecision]), $MachinePrecision], N[(d1 * N[(d4 - d3), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;d4 \leq -1.35 \cdot 10^{-250}:\\
\;\;\;\;d1 \cdot \left(d2 - d3\right)\\
\mathbf{elif}\;d4 \leq 1.6 \cdot 10^{+110}:\\
\;\;\;\;d1 \cdot \left(d2 - d1\right)\\
\mathbf{else}:\\
\;\;\;\;d1 \cdot \left(d4 - d3\right)\\
\end{array}
\end{array}
if d4 < -1.35000000000000001e-250Initial program 81.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-+.f6473.3%
Simplified73.3%
Taylor expanded in d1 around 0
Simplified58.3%
if -1.35000000000000001e-250 < d4 < 1.59999999999999997e110Initial program 87.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 0
*-lowering-*.f64N/A
--lowering--.f64N/A
+-lowering-+.f6495.0%
Simplified95.0%
Taylor expanded in d1 around inf
Simplified72.9%
if 1.59999999999999997e110 < 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-+.f64100.0%
Simplified100.0%
+-commutativeN/A
distribute-lft-inN/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f6495.6%
Applied egg-rr95.6%
Taylor expanded in d2 around 0
*-lowering-*.f64N/A
--lowering--.f64N/A
+-lowering-+.f6491.8%
Simplified91.8%
Taylor expanded in d1 around 0
remove-double-negN/A
distribute-rgt-neg-outN/A
mul-1-negN/A
distribute-rgt-neg-inN/A
*-rgt-identityN/A
*-inversesN/A
associate-/l*N/A
associate-*l/N/A
associate-*r/N/A
*-lowering-*.f64N/A
neg-sub0N/A
associate-*r/N/A
associate-*l/N/A
associate-/l*N/A
*-inversesN/A
mul-1-negN/A
cancel-sign-subN/A
*-rgt-identityN/A
sub-negN/A
+-commutativeN/A
associate-+l+N/A
Simplified80.6%
(FPCore (d1 d2 d3 d4) :precision binary64 (let* ((t_0 (- 0.0 (* d1 d3)))) (if (<= d3 -3.3e+89) t_0 (if (<= d3 4.4e+178) (* d1 (+ d2 d4)) t_0))))
double code(double d1, double d2, double d3, double d4) {
double t_0 = 0.0 - (d1 * d3);
double tmp;
if (d3 <= -3.3e+89) {
tmp = t_0;
} else if (d3 <= 4.4e+178) {
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 * d3)
if (d3 <= (-3.3d+89)) then
tmp = t_0
else if (d3 <= 4.4d+178) 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 * d3);
double tmp;
if (d3 <= -3.3e+89) {
tmp = t_0;
} else if (d3 <= 4.4e+178) {
tmp = d1 * (d2 + d4);
} else {
tmp = t_0;
}
return tmp;
}
def code(d1, d2, d3, d4): t_0 = 0.0 - (d1 * d3) tmp = 0 if d3 <= -3.3e+89: tmp = t_0 elif d3 <= 4.4e+178: tmp = d1 * (d2 + d4) else: tmp = t_0 return tmp
function code(d1, d2, d3, d4) t_0 = Float64(0.0 - Float64(d1 * d3)) tmp = 0.0 if (d3 <= -3.3e+89) tmp = t_0; elseif (d3 <= 4.4e+178) 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 * d3); tmp = 0.0; if (d3 <= -3.3e+89) tmp = t_0; elseif (d3 <= 4.4e+178) 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 * d3), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[d3, -3.3e+89], t$95$0, If[LessEqual[d3, 4.4e+178], N[(d1 * N[(d2 + d4), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 0 - d1 \cdot d3\\
\mathbf{if}\;d3 \leq -3.3 \cdot 10^{+89}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;d3 \leq 4.4 \cdot 10^{+178}:\\
\;\;\;\;d1 \cdot \left(d2 + d4\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if d3 < -3.29999999999999974e89 or 4.39999999999999994e178 < d3 Initial program 77.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 d3 around inf
mul-1-negN/A
neg-sub0N/A
--lowering--.f64N/A
*-lowering-*.f6483.8%
Simplified83.8%
sub0-negN/A
neg-lowering-neg.f64N/A
*-lowering-*.f6483.8%
Applied egg-rr83.8%
if -3.29999999999999974e89 < d3 < 4.39999999999999994e178Initial 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-+.f64100.0%
Simplified100.0%
Taylor expanded in d4 around inf
Simplified66.3%
Final simplification70.9%
(FPCore (d1 d2 d3 d4) :precision binary64 (if (<= d2 -8.2e+92) (* d1 d2) (if (<= d2 1.72e-252) (- 0.0 (* d1 d1)) (* d1 d4))))
double code(double d1, double d2, double d3, double d4) {
double tmp;
if (d2 <= -8.2e+92) {
tmp = d1 * d2;
} else if (d2 <= 1.72e-252) {
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 (d2 <= (-8.2d+92)) then
tmp = d1 * d2
else if (d2 <= 1.72d-252) 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 (d2 <= -8.2e+92) {
tmp = d1 * d2;
} else if (d2 <= 1.72e-252) {
tmp = 0.0 - (d1 * d1);
} else {
tmp = d1 * d4;
}
return tmp;
}
def code(d1, d2, d3, d4): tmp = 0 if d2 <= -8.2e+92: tmp = d1 * d2 elif d2 <= 1.72e-252: tmp = 0.0 - (d1 * d1) else: tmp = d1 * d4 return tmp
function code(d1, d2, d3, d4) tmp = 0.0 if (d2 <= -8.2e+92) tmp = Float64(d1 * d2); elseif (d2 <= 1.72e-252) 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 (d2 <= -8.2e+92) tmp = d1 * d2; elseif (d2 <= 1.72e-252) tmp = 0.0 - (d1 * d1); else tmp = d1 * d4; end tmp_2 = tmp; end
code[d1_, d2_, d3_, d4_] := If[LessEqual[d2, -8.2e+92], N[(d1 * d2), $MachinePrecision], If[LessEqual[d2, 1.72e-252], N[(0.0 - N[(d1 * d1), $MachinePrecision]), $MachinePrecision], N[(d1 * d4), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;d2 \leq -8.2 \cdot 10^{+92}:\\
\;\;\;\;d1 \cdot d2\\
\mathbf{elif}\;d2 \leq 1.72 \cdot 10^{-252}:\\
\;\;\;\;0 - d1 \cdot d1\\
\mathbf{else}:\\
\;\;\;\;d1 \cdot d4\\
\end{array}
\end{array}
if d2 < -8.20000000000000047e92Initial program 81.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 d2 around inf
*-lowering-*.f6472.6%
Simplified72.6%
if -8.20000000000000047e92 < d2 < 1.7200000000000001e-252Initial program 85.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 inf
mul-1-negN/A
neg-sub0N/A
--lowering--.f64N/A
unpow2N/A
*-lowering-*.f6443.2%
Simplified43.2%
sub0-negN/A
neg-lowering-neg.f64N/A
*-lowering-*.f6443.2%
Applied egg-rr43.2%
if 1.7200000000000001e-252 < d2 Initial program 85.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
*-lowering-*.f6430.9%
Simplified30.9%
Final simplification42.9%
(FPCore (d1 d2 d3 d4) :precision binary64 (if (<= d2 -1.35e-39) (* d1 (- d2 (+ d1 d3))) (* d1 (- d4 (+ d1 d3)))))
double code(double d1, double d2, double d3, double d4) {
double tmp;
if (d2 <= -1.35e-39) {
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 <= (-1.35d-39)) 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 <= -1.35e-39) {
tmp = d1 * (d2 - (d1 + d3));
} else {
tmp = d1 * (d4 - (d1 + d3));
}
return tmp;
}
def code(d1, d2, d3, d4): tmp = 0 if d2 <= -1.35e-39: tmp = d1 * (d2 - (d1 + d3)) else: tmp = d1 * (d4 - (d1 + d3)) return tmp
function code(d1, d2, d3, d4) tmp = 0.0 if (d2 <= -1.35e-39) 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 <= -1.35e-39) tmp = d1 * (d2 - (d1 + d3)); else tmp = d1 * (d4 - (d1 + d3)); end tmp_2 = tmp; end
code[d1_, d2_, d3_, d4_] := If[LessEqual[d2, -1.35e-39], 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 -1.35 \cdot 10^{-39}:\\
\;\;\;\;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 < -1.35e-39Initial program 85.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-+.f6488.5%
Simplified88.5%
if -1.35e-39 < d2 Initial program 84.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%
+-commutativeN/A
distribute-lft-inN/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f6495.6%
Applied egg-rr95.6%
Taylor expanded in d2 around 0
*-lowering-*.f64N/A
--lowering--.f64N/A
+-lowering-+.f6486.7%
Simplified86.7%
(FPCore (d1 d2 d3 d4) :precision binary64 (if (<= d4 4e+116) (* d1 (- d2 (+ d1 d3))) (* d1 (+ d4 (- d2 d3)))))
double code(double d1, double d2, double d3, double d4) {
double tmp;
if (d4 <= 4e+116) {
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 <= 4d+116) 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 <= 4e+116) {
tmp = d1 * (d2 - (d1 + d3));
} else {
tmp = d1 * (d4 + (d2 - d3));
}
return tmp;
}
def code(d1, d2, d3, d4): tmp = 0 if d4 <= 4e+116: tmp = d1 * (d2 - (d1 + d3)) else: tmp = d1 * (d4 + (d2 - d3)) return tmp
function code(d1, d2, d3, d4) tmp = 0.0 if (d4 <= 4e+116) 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 <= 4e+116) tmp = d1 * (d2 - (d1 + d3)); else tmp = d1 * (d4 + (d2 - d3)); end tmp_2 = tmp; end
code[d1_, d2_, d3_, d4_] := If[LessEqual[d4, 4e+116], 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 4 \cdot 10^{+116}:\\
\;\;\;\;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 < 4.00000000000000006e116Initial program 84.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-+.f6481.9%
Simplified81.9%
if 4.00000000000000006e116 < d4 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 d1 around 0
*-lowering-*.f64N/A
+-commutativeN/A
associate--l+N/A
+-lowering-+.f64N/A
--lowering--.f6490.7%
Simplified90.7%
(FPCore (d1 d2 d3 d4) :precision binary64 (if (<= d4 8.5e+116) (* d1 (- d2 d1)) (* d1 (+ d2 d4))))
double code(double d1, double d2, double d3, double d4) {
double tmp;
if (d4 <= 8.5e+116) {
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 <= 8.5d+116) 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 <= 8.5e+116) {
tmp = d1 * (d2 - d1);
} else {
tmp = d1 * (d2 + d4);
}
return tmp;
}
def code(d1, d2, d3, d4): tmp = 0 if d4 <= 8.5e+116: tmp = d1 * (d2 - d1) else: tmp = d1 * (d2 + d4) return tmp
function code(d1, d2, d3, d4) tmp = 0.0 if (d4 <= 8.5e+116) 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 <= 8.5e+116) tmp = d1 * (d2 - d1); else tmp = d1 * (d2 + d4); end tmp_2 = tmp; end
code[d1_, d2_, d3_, d4_] := If[LessEqual[d4, 8.5e+116], N[(d1 * N[(d2 - d1), $MachinePrecision]), $MachinePrecision], N[(d1 * N[(d2 + d4), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;d4 \leq 8.5 \cdot 10^{+116}:\\
\;\;\;\;d1 \cdot \left(d2 - d1\right)\\
\mathbf{else}:\\
\;\;\;\;d1 \cdot \left(d2 + d4\right)\\
\end{array}
\end{array}
if d4 < 8.5000000000000002e116Initial program 84.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-+.f6481.9%
Simplified81.9%
Taylor expanded in d1 around inf
Simplified60.2%
if 8.5000000000000002e116 < d4 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
Simplified75.1%
(FPCore (d1 d2 d3 d4) :precision binary64 (if (<= d4 1.1e-13) (* d1 d2) (* d1 d4)))
double code(double d1, double d2, double d3, double d4) {
double tmp;
if (d4 <= 1.1e-13) {
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 <= 1.1d-13) 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 <= 1.1e-13) {
tmp = d1 * d2;
} else {
tmp = d1 * d4;
}
return tmp;
}
def code(d1, d2, d3, d4): tmp = 0 if d4 <= 1.1e-13: tmp = d1 * d2 else: tmp = d1 * d4 return tmp
function code(d1, d2, d3, d4) tmp = 0.0 if (d4 <= 1.1e-13) 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 <= 1.1e-13) tmp = d1 * d2; else tmp = d1 * d4; end tmp_2 = tmp; end
code[d1_, d2_, d3_, d4_] := If[LessEqual[d4, 1.1e-13], N[(d1 * d2), $MachinePrecision], N[(d1 * d4), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;d4 \leq 1.1 \cdot 10^{-13}:\\
\;\;\;\;d1 \cdot d2\\
\mathbf{else}:\\
\;\;\;\;d1 \cdot d4\\
\end{array}
\end{array}
if d4 < 1.09999999999999998e-13Initial program 83.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 d2 around inf
*-lowering-*.f6433.4%
Simplified33.4%
if 1.09999999999999998e-13 < d4 Initial program 85.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-*.f6453.0%
Simplified53.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 84.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 d2 around inf
*-lowering-*.f6430.3%
Simplified30.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 2024156
(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)))