
(FPCore (x y z t a b c) :precision binary64 (+ (- (+ (* x y) (/ (* z t) 16.0)) (/ (* a b) 4.0)) c))
double code(double x, double y, double z, double t, double a, double b, double c) {
return (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)) + c;
}
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
code = (((x * y) + ((z * t) / 16.0d0)) - ((a * b) / 4.0d0)) + c
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
return (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)) + c;
}
def code(x, y, z, t, a, b, c): return (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)) + c
function code(x, y, z, t, a, b, c) return Float64(Float64(Float64(Float64(x * y) + Float64(Float64(z * t) / 16.0)) - Float64(Float64(a * b) / 4.0)) + c) end
function tmp = code(x, y, z, t, a, b, c) tmp = (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)) + c; end
code[x_, y_, z_, t_, a_, b_, c_] := N[(N[(N[(N[(x * y), $MachinePrecision] + N[(N[(z * t), $MachinePrecision] / 16.0), $MachinePrecision]), $MachinePrecision] - N[(N[(a * b), $MachinePrecision] / 4.0), $MachinePrecision]), $MachinePrecision] + c), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\right) + c
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 15 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b c) :precision binary64 (+ (- (+ (* x y) (/ (* z t) 16.0)) (/ (* a b) 4.0)) c))
double code(double x, double y, double z, double t, double a, double b, double c) {
return (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)) + c;
}
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
code = (((x * y) + ((z * t) / 16.0d0)) - ((a * b) / 4.0d0)) + c
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
return (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)) + c;
}
def code(x, y, z, t, a, b, c): return (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)) + c
function code(x, y, z, t, a, b, c) return Float64(Float64(Float64(Float64(x * y) + Float64(Float64(z * t) / 16.0)) - Float64(Float64(a * b) / 4.0)) + c) end
function tmp = code(x, y, z, t, a, b, c) tmp = (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)) + c; end
code[x_, y_, z_, t_, a_, b_, c_] := N[(N[(N[(N[(x * y), $MachinePrecision] + N[(N[(z * t), $MachinePrecision] / 16.0), $MachinePrecision]), $MachinePrecision] - N[(N[(a * b), $MachinePrecision] / 4.0), $MachinePrecision]), $MachinePrecision] + c), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\right) + c
\end{array}
(FPCore (x y z t a b c) :precision binary64 (fma x y (fma (/ z 16.0) t (fma (/ a -4.0) b c))))
double code(double x, double y, double z, double t, double a, double b, double c) {
return fma(x, y, fma((z / 16.0), t, fma((a / -4.0), b, c)));
}
function code(x, y, z, t, a, b, c) return fma(x, y, fma(Float64(z / 16.0), t, fma(Float64(a / -4.0), b, c))) end
code[x_, y_, z_, t_, a_, b_, c_] := N[(x * y + N[(N[(z / 16.0), $MachinePrecision] * t + N[(N[(a / -4.0), $MachinePrecision] * b + c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, \mathsf{fma}\left(\frac{a}{-4}, b, c\right)\right)\right)
\end{array}
Initial program 97.3%
associate-+l-97.3%
associate--l+97.3%
fma-def98.1%
associate-*l/98.4%
fma-neg98.8%
sub-neg98.8%
distribute-neg-in98.8%
remove-double-neg98.8%
associate-/l*98.8%
distribute-frac-neg98.8%
associate-/r/98.8%
fma-def98.8%
neg-mul-198.8%
*-commutative98.8%
associate-/l*98.8%
metadata-eval98.8%
Simplified98.8%
Final simplification98.8%
(FPCore (x y z t a b c) :precision binary64 (+ c (+ (* x y) (fma t (* z 0.0625) (* b (* a -0.25))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
return c + ((x * y) + fma(t, (z * 0.0625), (b * (a * -0.25))));
}
function code(x, y, z, t, a, b, c) return Float64(c + Float64(Float64(x * y) + fma(t, Float64(z * 0.0625), Float64(b * Float64(a * -0.25))))) end
code[x_, y_, z_, t_, a_, b_, c_] := N[(c + N[(N[(x * y), $MachinePrecision] + N[(t * N[(z * 0.0625), $MachinePrecision] + N[(b * N[(a * -0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
c + \left(x \cdot y + \mathsf{fma}\left(t, z \cdot 0.0625, b \cdot \left(a \cdot -0.25\right)\right)\right)
\end{array}
Initial program 97.3%
associate--l+97.3%
associate-*l/97.6%
*-commutative97.6%
fma-neg98.0%
div-inv98.0%
metadata-eval98.0%
associate-/l*98.0%
distribute-frac-neg98.0%
metadata-eval98.0%
distribute-neg-frac98.0%
frac-2neg98.0%
associate-/r/98.0%
div-inv98.0%
metadata-eval98.0%
Applied egg-rr98.0%
Final simplification98.0%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (+ c (* z (* t 0.0625))))
(t_2 (+ c (* a (* b -0.25))))
(t_3 (+ (* x y) (* 0.0625 (* z t)))))
(if (<= (* x y) -1.3e+62)
t_3
(if (<= (* x y) -1.16e-157)
t_2
(if (<= (* x y) -8.4e-221)
t_1
(if (<= (* x y) -1.3e-278)
t_2
(if (<= (* x y) 9.5e-166)
t_1
(if (<= (* x y) 4.1e+74)
t_2
(if (<= (* x y) 3.3e+162)
t_3
(- (* x y) (* (* a b) 0.25)))))))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = c + (z * (t * 0.0625));
double t_2 = c + (a * (b * -0.25));
double t_3 = (x * y) + (0.0625 * (z * t));
double tmp;
if ((x * y) <= -1.3e+62) {
tmp = t_3;
} else if ((x * y) <= -1.16e-157) {
tmp = t_2;
} else if ((x * y) <= -8.4e-221) {
tmp = t_1;
} else if ((x * y) <= -1.3e-278) {
tmp = t_2;
} else if ((x * y) <= 9.5e-166) {
tmp = t_1;
} else if ((x * y) <= 4.1e+74) {
tmp = t_2;
} else if ((x * y) <= 3.3e+162) {
tmp = t_3;
} else {
tmp = (x * y) - ((a * b) * 0.25);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_1 = c + (z * (t * 0.0625d0))
t_2 = c + (a * (b * (-0.25d0)))
t_3 = (x * y) + (0.0625d0 * (z * t))
if ((x * y) <= (-1.3d+62)) then
tmp = t_3
else if ((x * y) <= (-1.16d-157)) then
tmp = t_2
else if ((x * y) <= (-8.4d-221)) then
tmp = t_1
else if ((x * y) <= (-1.3d-278)) then
tmp = t_2
else if ((x * y) <= 9.5d-166) then
tmp = t_1
else if ((x * y) <= 4.1d+74) then
tmp = t_2
else if ((x * y) <= 3.3d+162) then
tmp = t_3
else
tmp = (x * y) - ((a * b) * 0.25d0)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = c + (z * (t * 0.0625));
double t_2 = c + (a * (b * -0.25));
double t_3 = (x * y) + (0.0625 * (z * t));
double tmp;
if ((x * y) <= -1.3e+62) {
tmp = t_3;
} else if ((x * y) <= -1.16e-157) {
tmp = t_2;
} else if ((x * y) <= -8.4e-221) {
tmp = t_1;
} else if ((x * y) <= -1.3e-278) {
tmp = t_2;
} else if ((x * y) <= 9.5e-166) {
tmp = t_1;
} else if ((x * y) <= 4.1e+74) {
tmp = t_2;
} else if ((x * y) <= 3.3e+162) {
tmp = t_3;
} else {
tmp = (x * y) - ((a * b) * 0.25);
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = c + (z * (t * 0.0625)) t_2 = c + (a * (b * -0.25)) t_3 = (x * y) + (0.0625 * (z * t)) tmp = 0 if (x * y) <= -1.3e+62: tmp = t_3 elif (x * y) <= -1.16e-157: tmp = t_2 elif (x * y) <= -8.4e-221: tmp = t_1 elif (x * y) <= -1.3e-278: tmp = t_2 elif (x * y) <= 9.5e-166: tmp = t_1 elif (x * y) <= 4.1e+74: tmp = t_2 elif (x * y) <= 3.3e+162: tmp = t_3 else: tmp = (x * y) - ((a * b) * 0.25) return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(c + Float64(z * Float64(t * 0.0625))) t_2 = Float64(c + Float64(a * Float64(b * -0.25))) t_3 = Float64(Float64(x * y) + Float64(0.0625 * Float64(z * t))) tmp = 0.0 if (Float64(x * y) <= -1.3e+62) tmp = t_3; elseif (Float64(x * y) <= -1.16e-157) tmp = t_2; elseif (Float64(x * y) <= -8.4e-221) tmp = t_1; elseif (Float64(x * y) <= -1.3e-278) tmp = t_2; elseif (Float64(x * y) <= 9.5e-166) tmp = t_1; elseif (Float64(x * y) <= 4.1e+74) tmp = t_2; elseif (Float64(x * y) <= 3.3e+162) tmp = t_3; else tmp = Float64(Float64(x * y) - Float64(Float64(a * b) * 0.25)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) t_1 = c + (z * (t * 0.0625)); t_2 = c + (a * (b * -0.25)); t_3 = (x * y) + (0.0625 * (z * t)); tmp = 0.0; if ((x * y) <= -1.3e+62) tmp = t_3; elseif ((x * y) <= -1.16e-157) tmp = t_2; elseif ((x * y) <= -8.4e-221) tmp = t_1; elseif ((x * y) <= -1.3e-278) tmp = t_2; elseif ((x * y) <= 9.5e-166) tmp = t_1; elseif ((x * y) <= 4.1e+74) tmp = t_2; elseif ((x * y) <= 3.3e+162) tmp = t_3; else tmp = (x * y) - ((a * b) * 0.25); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(c + N[(z * N[(t * 0.0625), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(c + N[(a * N[(b * -0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(x * y), $MachinePrecision] + N[(0.0625 * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -1.3e+62], t$95$3, If[LessEqual[N[(x * y), $MachinePrecision], -1.16e-157], t$95$2, If[LessEqual[N[(x * y), $MachinePrecision], -8.4e-221], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], -1.3e-278], t$95$2, If[LessEqual[N[(x * y), $MachinePrecision], 9.5e-166], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 4.1e+74], t$95$2, If[LessEqual[N[(x * y), $MachinePrecision], 3.3e+162], t$95$3, N[(N[(x * y), $MachinePrecision] - N[(N[(a * b), $MachinePrecision] * 0.25), $MachinePrecision]), $MachinePrecision]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := c + z \cdot \left(t \cdot 0.0625\right)\\
t_2 := c + a \cdot \left(b \cdot -0.25\right)\\
t_3 := x \cdot y + 0.0625 \cdot \left(z \cdot t\right)\\
\mathbf{if}\;x \cdot y \leq -1.3 \cdot 10^{+62}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;x \cdot y \leq -1.16 \cdot 10^{-157}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x \cdot y \leq -8.4 \cdot 10^{-221}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \cdot y \leq -1.3 \cdot 10^{-278}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x \cdot y \leq 9.5 \cdot 10^{-166}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \cdot y \leq 4.1 \cdot 10^{+74}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x \cdot y \leq 3.3 \cdot 10^{+162}:\\
\;\;\;\;t_3\\
\mathbf{else}:\\
\;\;\;\;x \cdot y - \left(a \cdot b\right) \cdot 0.25\\
\end{array}
\end{array}
if (*.f64 x y) < -1.29999999999999992e62 or 4.1e74 < (*.f64 x y) < 3.29999999999999987e162Initial program 95.9%
Taylor expanded in a around 0 84.2%
Taylor expanded in c around 0 79.9%
if -1.29999999999999992e62 < (*.f64 x y) < -1.15999999999999992e-157 or -8.4000000000000001e-221 < (*.f64 x y) < -1.2999999999999999e-278 or 9.50000000000000046e-166 < (*.f64 x y) < 4.1e74Initial program 98.6%
Taylor expanded in a around inf 76.6%
*-commutative76.6%
associate-*r*76.6%
Simplified76.6%
if -1.15999999999999992e-157 < (*.f64 x y) < -8.4000000000000001e-221 or -1.2999999999999999e-278 < (*.f64 x y) < 9.50000000000000046e-166Initial program 98.9%
Taylor expanded in z around inf 79.0%
*-commutative79.0%
*-commutative79.0%
associate-*l*80.1%
Simplified80.1%
if 3.29999999999999987e162 < (*.f64 x y) Initial program 94.1%
Taylor expanded in z around 0 94.4%
Taylor expanded in c around 0 91.6%
Final simplification80.6%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (+ c (* z (* t 0.0625))))
(t_2 (+ c (* a (* b -0.25))))
(t_3 (+ (* x y) (* 0.0625 (* z t)))))
(if (<= (* x y) -8.2e+56)
t_3
(if (<= (* x y) -6.8e-161)
t_2
(if (<= (* x y) -1.7e-221)
t_1
(if (<= (* x y) -5.4e-280)
t_2
(if (<= (* x y) 2.1e-163)
t_1
(if (<= (* x y) 8.2e+73) t_2 t_3))))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = c + (z * (t * 0.0625));
double t_2 = c + (a * (b * -0.25));
double t_3 = (x * y) + (0.0625 * (z * t));
double tmp;
if ((x * y) <= -8.2e+56) {
tmp = t_3;
} else if ((x * y) <= -6.8e-161) {
tmp = t_2;
} else if ((x * y) <= -1.7e-221) {
tmp = t_1;
} else if ((x * y) <= -5.4e-280) {
tmp = t_2;
} else if ((x * y) <= 2.1e-163) {
tmp = t_1;
} else if ((x * y) <= 8.2e+73) {
tmp = t_2;
} else {
tmp = t_3;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_1 = c + (z * (t * 0.0625d0))
t_2 = c + (a * (b * (-0.25d0)))
t_3 = (x * y) + (0.0625d0 * (z * t))
if ((x * y) <= (-8.2d+56)) then
tmp = t_3
else if ((x * y) <= (-6.8d-161)) then
tmp = t_2
else if ((x * y) <= (-1.7d-221)) then
tmp = t_1
else if ((x * y) <= (-5.4d-280)) then
tmp = t_2
else if ((x * y) <= 2.1d-163) then
tmp = t_1
else if ((x * y) <= 8.2d+73) then
tmp = t_2
else
tmp = t_3
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = c + (z * (t * 0.0625));
double t_2 = c + (a * (b * -0.25));
double t_3 = (x * y) + (0.0625 * (z * t));
double tmp;
if ((x * y) <= -8.2e+56) {
tmp = t_3;
} else if ((x * y) <= -6.8e-161) {
tmp = t_2;
} else if ((x * y) <= -1.7e-221) {
tmp = t_1;
} else if ((x * y) <= -5.4e-280) {
tmp = t_2;
} else if ((x * y) <= 2.1e-163) {
tmp = t_1;
} else if ((x * y) <= 8.2e+73) {
tmp = t_2;
} else {
tmp = t_3;
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = c + (z * (t * 0.0625)) t_2 = c + (a * (b * -0.25)) t_3 = (x * y) + (0.0625 * (z * t)) tmp = 0 if (x * y) <= -8.2e+56: tmp = t_3 elif (x * y) <= -6.8e-161: tmp = t_2 elif (x * y) <= -1.7e-221: tmp = t_1 elif (x * y) <= -5.4e-280: tmp = t_2 elif (x * y) <= 2.1e-163: tmp = t_1 elif (x * y) <= 8.2e+73: tmp = t_2 else: tmp = t_3 return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(c + Float64(z * Float64(t * 0.0625))) t_2 = Float64(c + Float64(a * Float64(b * -0.25))) t_3 = Float64(Float64(x * y) + Float64(0.0625 * Float64(z * t))) tmp = 0.0 if (Float64(x * y) <= -8.2e+56) tmp = t_3; elseif (Float64(x * y) <= -6.8e-161) tmp = t_2; elseif (Float64(x * y) <= -1.7e-221) tmp = t_1; elseif (Float64(x * y) <= -5.4e-280) tmp = t_2; elseif (Float64(x * y) <= 2.1e-163) tmp = t_1; elseif (Float64(x * y) <= 8.2e+73) tmp = t_2; else tmp = t_3; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) t_1 = c + (z * (t * 0.0625)); t_2 = c + (a * (b * -0.25)); t_3 = (x * y) + (0.0625 * (z * t)); tmp = 0.0; if ((x * y) <= -8.2e+56) tmp = t_3; elseif ((x * y) <= -6.8e-161) tmp = t_2; elseif ((x * y) <= -1.7e-221) tmp = t_1; elseif ((x * y) <= -5.4e-280) tmp = t_2; elseif ((x * y) <= 2.1e-163) tmp = t_1; elseif ((x * y) <= 8.2e+73) tmp = t_2; else tmp = t_3; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(c + N[(z * N[(t * 0.0625), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(c + N[(a * N[(b * -0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(x * y), $MachinePrecision] + N[(0.0625 * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -8.2e+56], t$95$3, If[LessEqual[N[(x * y), $MachinePrecision], -6.8e-161], t$95$2, If[LessEqual[N[(x * y), $MachinePrecision], -1.7e-221], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], -5.4e-280], t$95$2, If[LessEqual[N[(x * y), $MachinePrecision], 2.1e-163], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 8.2e+73], t$95$2, t$95$3]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := c + z \cdot \left(t \cdot 0.0625\right)\\
t_2 := c + a \cdot \left(b \cdot -0.25\right)\\
t_3 := x \cdot y + 0.0625 \cdot \left(z \cdot t\right)\\
\mathbf{if}\;x \cdot y \leq -8.2 \cdot 10^{+56}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;x \cdot y \leq -6.8 \cdot 10^{-161}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x \cdot y \leq -1.7 \cdot 10^{-221}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \cdot y \leq -5.4 \cdot 10^{-280}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x \cdot y \leq 2.1 \cdot 10^{-163}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \cdot y \leq 8.2 \cdot 10^{+73}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;t_3\\
\end{array}
\end{array}
if (*.f64 x y) < -8.2000000000000007e56 or 8.1999999999999996e73 < (*.f64 x y) Initial program 95.3%
Taylor expanded in a around 0 86.1%
Taylor expanded in c around 0 82.3%
if -8.2000000000000007e56 < (*.f64 x y) < -6.79999999999999964e-161 or -1.7000000000000001e-221 < (*.f64 x y) < -5.39999999999999967e-280 or 2.09999999999999998e-163 < (*.f64 x y) < 8.1999999999999996e73Initial program 98.6%
Taylor expanded in a around inf 76.6%
*-commutative76.6%
associate-*r*76.6%
Simplified76.6%
if -6.79999999999999964e-161 < (*.f64 x y) < -1.7000000000000001e-221 or -5.39999999999999967e-280 < (*.f64 x y) < 2.09999999999999998e-163Initial program 98.9%
Taylor expanded in z around inf 79.0%
*-commutative79.0%
*-commutative79.0%
associate-*l*80.1%
Simplified80.1%
Final simplification80.0%
(FPCore (x y z t a b c)
:precision binary64
(if (<= (* x y) -9e+51)
(* x y)
(if (<= (* x y) 5.2e-218)
c
(if (<= (* x y) 7.5e-88)
(* -0.25 (* a b))
(if (<= (* x y) 1.24e+70) c (* x y))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if ((x * y) <= -9e+51) {
tmp = x * y;
} else if ((x * y) <= 5.2e-218) {
tmp = c;
} else if ((x * y) <= 7.5e-88) {
tmp = -0.25 * (a * b);
} else if ((x * y) <= 1.24e+70) {
tmp = c;
} else {
tmp = x * y;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: tmp
if ((x * y) <= (-9d+51)) then
tmp = x * y
else if ((x * y) <= 5.2d-218) then
tmp = c
else if ((x * y) <= 7.5d-88) then
tmp = (-0.25d0) * (a * b)
else if ((x * y) <= 1.24d+70) then
tmp = c
else
tmp = x * y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if ((x * y) <= -9e+51) {
tmp = x * y;
} else if ((x * y) <= 5.2e-218) {
tmp = c;
} else if ((x * y) <= 7.5e-88) {
tmp = -0.25 * (a * b);
} else if ((x * y) <= 1.24e+70) {
tmp = c;
} else {
tmp = x * y;
}
return tmp;
}
def code(x, y, z, t, a, b, c): tmp = 0 if (x * y) <= -9e+51: tmp = x * y elif (x * y) <= 5.2e-218: tmp = c elif (x * y) <= 7.5e-88: tmp = -0.25 * (a * b) elif (x * y) <= 1.24e+70: tmp = c else: tmp = x * y return tmp
function code(x, y, z, t, a, b, c) tmp = 0.0 if (Float64(x * y) <= -9e+51) tmp = Float64(x * y); elseif (Float64(x * y) <= 5.2e-218) tmp = c; elseif (Float64(x * y) <= 7.5e-88) tmp = Float64(-0.25 * Float64(a * b)); elseif (Float64(x * y) <= 1.24e+70) tmp = c; else tmp = Float64(x * y); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) tmp = 0.0; if ((x * y) <= -9e+51) tmp = x * y; elseif ((x * y) <= 5.2e-218) tmp = c; elseif ((x * y) <= 7.5e-88) tmp = -0.25 * (a * b); elseif ((x * y) <= 1.24e+70) tmp = c; else tmp = x * y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := If[LessEqual[N[(x * y), $MachinePrecision], -9e+51], N[(x * y), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 5.2e-218], c, If[LessEqual[N[(x * y), $MachinePrecision], 7.5e-88], N[(-0.25 * N[(a * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 1.24e+70], c, N[(x * y), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -9 \cdot 10^{+51}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;x \cdot y \leq 5.2 \cdot 10^{-218}:\\
\;\;\;\;c\\
\mathbf{elif}\;x \cdot y \leq 7.5 \cdot 10^{-88}:\\
\;\;\;\;-0.25 \cdot \left(a \cdot b\right)\\
\mathbf{elif}\;x \cdot y \leq 1.24 \cdot 10^{+70}:\\
\;\;\;\;c\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}
\end{array}
if (*.f64 x y) < -8.9999999999999999e51 or 1.2399999999999999e70 < (*.f64 x y) Initial program 95.4%
Taylor expanded in a around 0 85.3%
Taylor expanded in c around 0 81.6%
Taylor expanded in t around 0 68.1%
if -8.9999999999999999e51 < (*.f64 x y) < 5.19999999999999966e-218 or 7.50000000000000041e-88 < (*.f64 x y) < 1.2399999999999999e70Initial program 98.6%
Taylor expanded in c around inf 41.4%
if 5.19999999999999966e-218 < (*.f64 x y) < 7.50000000000000041e-88Initial program 100.0%
Taylor expanded in z around 0 65.9%
Taylor expanded in x around 0 65.9%
associate-*r*65.9%
*-commutative65.9%
*-commutative65.9%
Simplified65.9%
Taylor expanded in c around 0 48.1%
Final simplification53.1%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (+ c (* x y))))
(if (<= (* x y) -1.55e+81)
t_1
(if (<= (* x y) -3.6e-279)
(+ c (* a (* b -0.25)))
(if (<= (* x y) 1.25e-46) (+ c (* z (* t 0.0625))) t_1)))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = c + (x * y);
double tmp;
if ((x * y) <= -1.55e+81) {
tmp = t_1;
} else if ((x * y) <= -3.6e-279) {
tmp = c + (a * (b * -0.25));
} else if ((x * y) <= 1.25e-46) {
tmp = c + (z * (t * 0.0625));
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: t_1
real(8) :: tmp
t_1 = c + (x * y)
if ((x * y) <= (-1.55d+81)) then
tmp = t_1
else if ((x * y) <= (-3.6d-279)) then
tmp = c + (a * (b * (-0.25d0)))
else if ((x * y) <= 1.25d-46) then
tmp = c + (z * (t * 0.0625d0))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = c + (x * y);
double tmp;
if ((x * y) <= -1.55e+81) {
tmp = t_1;
} else if ((x * y) <= -3.6e-279) {
tmp = c + (a * (b * -0.25));
} else if ((x * y) <= 1.25e-46) {
tmp = c + (z * (t * 0.0625));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = c + (x * y) tmp = 0 if (x * y) <= -1.55e+81: tmp = t_1 elif (x * y) <= -3.6e-279: tmp = c + (a * (b * -0.25)) elif (x * y) <= 1.25e-46: tmp = c + (z * (t * 0.0625)) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(c + Float64(x * y)) tmp = 0.0 if (Float64(x * y) <= -1.55e+81) tmp = t_1; elseif (Float64(x * y) <= -3.6e-279) tmp = Float64(c + Float64(a * Float64(b * -0.25))); elseif (Float64(x * y) <= 1.25e-46) tmp = Float64(c + Float64(z * Float64(t * 0.0625))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) t_1 = c + (x * y); tmp = 0.0; if ((x * y) <= -1.55e+81) tmp = t_1; elseif ((x * y) <= -3.6e-279) tmp = c + (a * (b * -0.25)); elseif ((x * y) <= 1.25e-46) tmp = c + (z * (t * 0.0625)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -1.55e+81], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], -3.6e-279], N[(c + N[(a * N[(b * -0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 1.25e-46], N[(c + N[(z * N[(t * 0.0625), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := c + x \cdot y\\
\mathbf{if}\;x \cdot y \leq -1.55 \cdot 10^{+81}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \cdot y \leq -3.6 \cdot 10^{-279}:\\
\;\;\;\;c + a \cdot \left(b \cdot -0.25\right)\\
\mathbf{elif}\;x \cdot y \leq 1.25 \cdot 10^{-46}:\\
\;\;\;\;c + z \cdot \left(t \cdot 0.0625\right)\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if (*.f64 x y) < -1.55e81 or 1.24999999999999998e-46 < (*.f64 x y) Initial program 95.0%
Taylor expanded in x around inf 71.8%
if -1.55e81 < (*.f64 x y) < -3.5999999999999997e-279Initial program 100.0%
Taylor expanded in a around inf 73.7%
*-commutative73.7%
associate-*r*73.7%
Simplified73.7%
if -3.5999999999999997e-279 < (*.f64 x y) < 1.24999999999999998e-46Initial program 98.9%
Taylor expanded in z around inf 72.5%
*-commutative72.5%
*-commutative72.5%
associate-*l*73.5%
Simplified73.5%
Final simplification72.8%
(FPCore (x y z t a b c)
:precision binary64
(if (<= (* a b) -5e+230)
(+ c (* a (* b -0.25)))
(if (<= (* a b) 5e+221)
(+ c (+ (* x y) (* 0.0625 (* z t))))
(- (* x y) (* (* a b) 0.25)))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if ((a * b) <= -5e+230) {
tmp = c + (a * (b * -0.25));
} else if ((a * b) <= 5e+221) {
tmp = c + ((x * y) + (0.0625 * (z * t)));
} else {
tmp = (x * y) - ((a * b) * 0.25);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: tmp
if ((a * b) <= (-5d+230)) then
tmp = c + (a * (b * (-0.25d0)))
else if ((a * b) <= 5d+221) then
tmp = c + ((x * y) + (0.0625d0 * (z * t)))
else
tmp = (x * y) - ((a * b) * 0.25d0)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if ((a * b) <= -5e+230) {
tmp = c + (a * (b * -0.25));
} else if ((a * b) <= 5e+221) {
tmp = c + ((x * y) + (0.0625 * (z * t)));
} else {
tmp = (x * y) - ((a * b) * 0.25);
}
return tmp;
}
def code(x, y, z, t, a, b, c): tmp = 0 if (a * b) <= -5e+230: tmp = c + (a * (b * -0.25)) elif (a * b) <= 5e+221: tmp = c + ((x * y) + (0.0625 * (z * t))) else: tmp = (x * y) - ((a * b) * 0.25) return tmp
function code(x, y, z, t, a, b, c) tmp = 0.0 if (Float64(a * b) <= -5e+230) tmp = Float64(c + Float64(a * Float64(b * -0.25))); elseif (Float64(a * b) <= 5e+221) tmp = Float64(c + Float64(Float64(x * y) + Float64(0.0625 * Float64(z * t)))); else tmp = Float64(Float64(x * y) - Float64(Float64(a * b) * 0.25)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) tmp = 0.0; if ((a * b) <= -5e+230) tmp = c + (a * (b * -0.25)); elseif ((a * b) <= 5e+221) tmp = c + ((x * y) + (0.0625 * (z * t))); else tmp = (x * y) - ((a * b) * 0.25); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := If[LessEqual[N[(a * b), $MachinePrecision], -5e+230], N[(c + N[(a * N[(b * -0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 5e+221], N[(c + N[(N[(x * y), $MachinePrecision] + N[(0.0625 * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * y), $MachinePrecision] - N[(N[(a * b), $MachinePrecision] * 0.25), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \cdot b \leq -5 \cdot 10^{+230}:\\
\;\;\;\;c + a \cdot \left(b \cdot -0.25\right)\\
\mathbf{elif}\;a \cdot b \leq 5 \cdot 10^{+221}:\\
\;\;\;\;c + \left(x \cdot y + 0.0625 \cdot \left(z \cdot t\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot y - \left(a \cdot b\right) \cdot 0.25\\
\end{array}
\end{array}
if (*.f64 a b) < -5.0000000000000003e230Initial program 90.9%
Taylor expanded in a around inf 95.8%
*-commutative95.8%
associate-*r*95.8%
Simplified95.8%
if -5.0000000000000003e230 < (*.f64 a b) < 5.0000000000000002e221Initial program 98.6%
Taylor expanded in a around 0 89.9%
if 5.0000000000000002e221 < (*.f64 a b) Initial program 92.3%
Taylor expanded in z around 0 88.9%
Taylor expanded in c around 0 85.1%
Final simplification89.9%
(FPCore (x y z t a b c)
:precision binary64
(if (<= (* a b) -5e+230)
(+ c (* a (* b -0.25)))
(if (<= (* a b) 2e+46)
(+ c (+ (* x y) (* 0.0625 (* z t))))
(- (+ c (* x y)) (* (* a b) 0.25)))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if ((a * b) <= -5e+230) {
tmp = c + (a * (b * -0.25));
} else if ((a * b) <= 2e+46) {
tmp = c + ((x * y) + (0.0625 * (z * t)));
} else {
tmp = (c + (x * y)) - ((a * b) * 0.25);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: tmp
if ((a * b) <= (-5d+230)) then
tmp = c + (a * (b * (-0.25d0)))
else if ((a * b) <= 2d+46) then
tmp = c + ((x * y) + (0.0625d0 * (z * t)))
else
tmp = (c + (x * y)) - ((a * b) * 0.25d0)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if ((a * b) <= -5e+230) {
tmp = c + (a * (b * -0.25));
} else if ((a * b) <= 2e+46) {
tmp = c + ((x * y) + (0.0625 * (z * t)));
} else {
tmp = (c + (x * y)) - ((a * b) * 0.25);
}
return tmp;
}
def code(x, y, z, t, a, b, c): tmp = 0 if (a * b) <= -5e+230: tmp = c + (a * (b * -0.25)) elif (a * b) <= 2e+46: tmp = c + ((x * y) + (0.0625 * (z * t))) else: tmp = (c + (x * y)) - ((a * b) * 0.25) return tmp
function code(x, y, z, t, a, b, c) tmp = 0.0 if (Float64(a * b) <= -5e+230) tmp = Float64(c + Float64(a * Float64(b * -0.25))); elseif (Float64(a * b) <= 2e+46) tmp = Float64(c + Float64(Float64(x * y) + Float64(0.0625 * Float64(z * t)))); else tmp = Float64(Float64(c + Float64(x * y)) - Float64(Float64(a * b) * 0.25)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) tmp = 0.0; if ((a * b) <= -5e+230) tmp = c + (a * (b * -0.25)); elseif ((a * b) <= 2e+46) tmp = c + ((x * y) + (0.0625 * (z * t))); else tmp = (c + (x * y)) - ((a * b) * 0.25); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := If[LessEqual[N[(a * b), $MachinePrecision], -5e+230], N[(c + N[(a * N[(b * -0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 2e+46], N[(c + N[(N[(x * y), $MachinePrecision] + N[(0.0625 * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision] - N[(N[(a * b), $MachinePrecision] * 0.25), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \cdot b \leq -5 \cdot 10^{+230}:\\
\;\;\;\;c + a \cdot \left(b \cdot -0.25\right)\\
\mathbf{elif}\;a \cdot b \leq 2 \cdot 10^{+46}:\\
\;\;\;\;c + \left(x \cdot y + 0.0625 \cdot \left(z \cdot t\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(c + x \cdot y\right) - \left(a \cdot b\right) \cdot 0.25\\
\end{array}
\end{array}
if (*.f64 a b) < -5.0000000000000003e230Initial program 90.9%
Taylor expanded in a around inf 95.8%
*-commutative95.8%
associate-*r*95.8%
Simplified95.8%
if -5.0000000000000003e230 < (*.f64 a b) < 2e46Initial program 98.4%
Taylor expanded in a around 0 92.4%
if 2e46 < (*.f64 a b) Initial program 96.1%
Taylor expanded in z around 0 88.6%
Final simplification92.0%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* 0.0625 (* z t))) (t_2 (* (* a b) 0.25)))
(if (<= (* a b) -5e+107)
(- (+ c t_1) t_2)
(if (<= (* a b) 2e+46) (+ c (+ (* x y) t_1)) (- (+ c (* x y)) t_2)))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = 0.0625 * (z * t);
double t_2 = (a * b) * 0.25;
double tmp;
if ((a * b) <= -5e+107) {
tmp = (c + t_1) - t_2;
} else if ((a * b) <= 2e+46) {
tmp = c + ((x * y) + t_1);
} else {
tmp = (c + (x * y)) - t_2;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = 0.0625d0 * (z * t)
t_2 = (a * b) * 0.25d0
if ((a * b) <= (-5d+107)) then
tmp = (c + t_1) - t_2
else if ((a * b) <= 2d+46) then
tmp = c + ((x * y) + t_1)
else
tmp = (c + (x * y)) - t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = 0.0625 * (z * t);
double t_2 = (a * b) * 0.25;
double tmp;
if ((a * b) <= -5e+107) {
tmp = (c + t_1) - t_2;
} else if ((a * b) <= 2e+46) {
tmp = c + ((x * y) + t_1);
} else {
tmp = (c + (x * y)) - t_2;
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = 0.0625 * (z * t) t_2 = (a * b) * 0.25 tmp = 0 if (a * b) <= -5e+107: tmp = (c + t_1) - t_2 elif (a * b) <= 2e+46: tmp = c + ((x * y) + t_1) else: tmp = (c + (x * y)) - t_2 return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(0.0625 * Float64(z * t)) t_2 = Float64(Float64(a * b) * 0.25) tmp = 0.0 if (Float64(a * b) <= -5e+107) tmp = Float64(Float64(c + t_1) - t_2); elseif (Float64(a * b) <= 2e+46) tmp = Float64(c + Float64(Float64(x * y) + t_1)); else tmp = Float64(Float64(c + Float64(x * y)) - t_2); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) t_1 = 0.0625 * (z * t); t_2 = (a * b) * 0.25; tmp = 0.0; if ((a * b) <= -5e+107) tmp = (c + t_1) - t_2; elseif ((a * b) <= 2e+46) tmp = c + ((x * y) + t_1); else tmp = (c + (x * y)) - t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(0.0625 * N[(z * t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(a * b), $MachinePrecision] * 0.25), $MachinePrecision]}, If[LessEqual[N[(a * b), $MachinePrecision], -5e+107], N[(N[(c + t$95$1), $MachinePrecision] - t$95$2), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 2e+46], N[(c + N[(N[(x * y), $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision], N[(N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision] - t$95$2), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 0.0625 \cdot \left(z \cdot t\right)\\
t_2 := \left(a \cdot b\right) \cdot 0.25\\
\mathbf{if}\;a \cdot b \leq -5 \cdot 10^{+107}:\\
\;\;\;\;\left(c + t_1\right) - t_2\\
\mathbf{elif}\;a \cdot b \leq 2 \cdot 10^{+46}:\\
\;\;\;\;c + \left(x \cdot y + t_1\right)\\
\mathbf{else}:\\
\;\;\;\;\left(c + x \cdot y\right) - t_2\\
\end{array}
\end{array}
if (*.f64 a b) < -5.0000000000000002e107Initial program 95.0%
Taylor expanded in x around 0 87.0%
if -5.0000000000000002e107 < (*.f64 a b) < 2e46Initial program 98.3%
Taylor expanded in a around 0 94.7%
if 2e46 < (*.f64 a b) Initial program 96.1%
Taylor expanded in z around 0 88.6%
Final simplification92.3%
(FPCore (x y z t a b c) :precision binary64 (if (or (<= (* x y) -1.45e+79) (not (<= (* x y) 7.2e+66))) (+ c (* x y)) (+ c (* a (* b -0.25)))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (((x * y) <= -1.45e+79) || !((x * y) <= 7.2e+66)) {
tmp = c + (x * y);
} else {
tmp = c + (a * (b * -0.25));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: tmp
if (((x * y) <= (-1.45d+79)) .or. (.not. ((x * y) <= 7.2d+66))) then
tmp = c + (x * y)
else
tmp = c + (a * (b * (-0.25d0)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (((x * y) <= -1.45e+79) || !((x * y) <= 7.2e+66)) {
tmp = c + (x * y);
} else {
tmp = c + (a * (b * -0.25));
}
return tmp;
}
def code(x, y, z, t, a, b, c): tmp = 0 if ((x * y) <= -1.45e+79) or not ((x * y) <= 7.2e+66): tmp = c + (x * y) else: tmp = c + (a * (b * -0.25)) return tmp
function code(x, y, z, t, a, b, c) tmp = 0.0 if ((Float64(x * y) <= -1.45e+79) || !(Float64(x * y) <= 7.2e+66)) tmp = Float64(c + Float64(x * y)); else tmp = Float64(c + Float64(a * Float64(b * -0.25))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) tmp = 0.0; if (((x * y) <= -1.45e+79) || ~(((x * y) <= 7.2e+66))) tmp = c + (x * y); else tmp = c + (a * (b * -0.25)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := If[Or[LessEqual[N[(x * y), $MachinePrecision], -1.45e+79], N[Not[LessEqual[N[(x * y), $MachinePrecision], 7.2e+66]], $MachinePrecision]], N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision], N[(c + N[(a * N[(b * -0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -1.45 \cdot 10^{+79} \lor \neg \left(x \cdot y \leq 7.2 \cdot 10^{+66}\right):\\
\;\;\;\;c + x \cdot y\\
\mathbf{else}:\\
\;\;\;\;c + a \cdot \left(b \cdot -0.25\right)\\
\end{array}
\end{array}
if (*.f64 x y) < -1.44999999999999996e79 or 7.2e66 < (*.f64 x y) Initial program 95.2%
Taylor expanded in x around inf 74.0%
if -1.44999999999999996e79 < (*.f64 x y) < 7.2e66Initial program 98.8%
Taylor expanded in a around inf 67.0%
*-commutative67.0%
associate-*r*67.0%
Simplified67.0%
Final simplification69.9%
(FPCore (x y z t a b c) :precision binary64 (if (or (<= (* a b) -1.3e+221) (not (<= (* a b) 2.1e+183))) (* -0.25 (* a b)) (+ c (* x y))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (((a * b) <= -1.3e+221) || !((a * b) <= 2.1e+183)) {
tmp = -0.25 * (a * b);
} else {
tmp = c + (x * y);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: tmp
if (((a * b) <= (-1.3d+221)) .or. (.not. ((a * b) <= 2.1d+183))) then
tmp = (-0.25d0) * (a * b)
else
tmp = c + (x * y)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (((a * b) <= -1.3e+221) || !((a * b) <= 2.1e+183)) {
tmp = -0.25 * (a * b);
} else {
tmp = c + (x * y);
}
return tmp;
}
def code(x, y, z, t, a, b, c): tmp = 0 if ((a * b) <= -1.3e+221) or not ((a * b) <= 2.1e+183): tmp = -0.25 * (a * b) else: tmp = c + (x * y) return tmp
function code(x, y, z, t, a, b, c) tmp = 0.0 if ((Float64(a * b) <= -1.3e+221) || !(Float64(a * b) <= 2.1e+183)) tmp = Float64(-0.25 * Float64(a * b)); else tmp = Float64(c + Float64(x * y)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) tmp = 0.0; if (((a * b) <= -1.3e+221) || ~(((a * b) <= 2.1e+183))) tmp = -0.25 * (a * b); else tmp = c + (x * y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := If[Or[LessEqual[N[(a * b), $MachinePrecision], -1.3e+221], N[Not[LessEqual[N[(a * b), $MachinePrecision], 2.1e+183]], $MachinePrecision]], N[(-0.25 * N[(a * b), $MachinePrecision]), $MachinePrecision], N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \cdot b \leq -1.3 \cdot 10^{+221} \lor \neg \left(a \cdot b \leq 2.1 \cdot 10^{+183}\right):\\
\;\;\;\;-0.25 \cdot \left(a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;c + x \cdot y\\
\end{array}
\end{array}
if (*.f64 a b) < -1.30000000000000002e221 or 2.1e183 < (*.f64 a b) Initial program 92.5%
Taylor expanded in z around 0 90.8%
Taylor expanded in x around 0 87.2%
associate-*r*87.2%
*-commutative87.2%
*-commutative87.2%
Simplified87.2%
Taylor expanded in c around 0 78.7%
if -1.30000000000000002e221 < (*.f64 a b) < 2.1e183Initial program 98.6%
Taylor expanded in x around inf 65.1%
Final simplification67.9%
(FPCore (x y z t a b c) :precision binary64 (if (<= y -9.5e-27) (* x y) (if (<= y -8e-272) (* t (* z 0.0625)) (if (<= y 5.4e-27) c (* x y)))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (y <= -9.5e-27) {
tmp = x * y;
} else if (y <= -8e-272) {
tmp = t * (z * 0.0625);
} else if (y <= 5.4e-27) {
tmp = c;
} else {
tmp = x * y;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: tmp
if (y <= (-9.5d-27)) then
tmp = x * y
else if (y <= (-8d-272)) then
tmp = t * (z * 0.0625d0)
else if (y <= 5.4d-27) then
tmp = c
else
tmp = x * y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (y <= -9.5e-27) {
tmp = x * y;
} else if (y <= -8e-272) {
tmp = t * (z * 0.0625);
} else if (y <= 5.4e-27) {
tmp = c;
} else {
tmp = x * y;
}
return tmp;
}
def code(x, y, z, t, a, b, c): tmp = 0 if y <= -9.5e-27: tmp = x * y elif y <= -8e-272: tmp = t * (z * 0.0625) elif y <= 5.4e-27: tmp = c else: tmp = x * y return tmp
function code(x, y, z, t, a, b, c) tmp = 0.0 if (y <= -9.5e-27) tmp = Float64(x * y); elseif (y <= -8e-272) tmp = Float64(t * Float64(z * 0.0625)); elseif (y <= 5.4e-27) tmp = c; else tmp = Float64(x * y); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) tmp = 0.0; if (y <= -9.5e-27) tmp = x * y; elseif (y <= -8e-272) tmp = t * (z * 0.0625); elseif (y <= 5.4e-27) tmp = c; else tmp = x * y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := If[LessEqual[y, -9.5e-27], N[(x * y), $MachinePrecision], If[LessEqual[y, -8e-272], N[(t * N[(z * 0.0625), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 5.4e-27], c, N[(x * y), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -9.5 \cdot 10^{-27}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;y \leq -8 \cdot 10^{-272}:\\
\;\;\;\;t \cdot \left(z \cdot 0.0625\right)\\
\mathbf{elif}\;y \leq 5.4 \cdot 10^{-27}:\\
\;\;\;\;c\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}
\end{array}
if y < -9.50000000000000037e-27 or 5.39999999999999978e-27 < y Initial program 96.1%
Taylor expanded in a around 0 81.4%
Taylor expanded in c around 0 67.7%
Taylor expanded in t around 0 55.4%
if -9.50000000000000037e-27 < y < -7.99999999999999944e-272Initial program 98.5%
Taylor expanded in x around 0 89.6%
Taylor expanded in c around 0 57.9%
Taylor expanded in t around inf 31.0%
*-commutative31.0%
associate-*l*32.5%
*-commutative32.5%
Simplified32.5%
if -7.99999999999999944e-272 < y < 5.39999999999999978e-27Initial program 98.6%
Taylor expanded in c around inf 35.6%
Final simplification44.7%
(FPCore (x y z t a b c) :precision binary64 (if (or (<= (* x y) -7.2e+51) (not (<= (* x y) 1.1e+70))) (* x y) c))
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (((x * y) <= -7.2e+51) || !((x * y) <= 1.1e+70)) {
tmp = x * y;
} else {
tmp = c;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: tmp
if (((x * y) <= (-7.2d+51)) .or. (.not. ((x * y) <= 1.1d+70))) then
tmp = x * y
else
tmp = c
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (((x * y) <= -7.2e+51) || !((x * y) <= 1.1e+70)) {
tmp = x * y;
} else {
tmp = c;
}
return tmp;
}
def code(x, y, z, t, a, b, c): tmp = 0 if ((x * y) <= -7.2e+51) or not ((x * y) <= 1.1e+70): tmp = x * y else: tmp = c return tmp
function code(x, y, z, t, a, b, c) tmp = 0.0 if ((Float64(x * y) <= -7.2e+51) || !(Float64(x * y) <= 1.1e+70)) tmp = Float64(x * y); else tmp = c; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) tmp = 0.0; if (((x * y) <= -7.2e+51) || ~(((x * y) <= 1.1e+70))) tmp = x * y; else tmp = c; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := If[Or[LessEqual[N[(x * y), $MachinePrecision], -7.2e+51], N[Not[LessEqual[N[(x * y), $MachinePrecision], 1.1e+70]], $MachinePrecision]], N[(x * y), $MachinePrecision], c]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -7.2 \cdot 10^{+51} \lor \neg \left(x \cdot y \leq 1.1 \cdot 10^{+70}\right):\\
\;\;\;\;x \cdot y\\
\mathbf{else}:\\
\;\;\;\;c\\
\end{array}
\end{array}
if (*.f64 x y) < -7.20000000000000022e51 or 1.1e70 < (*.f64 x y) Initial program 95.4%
Taylor expanded in a around 0 85.3%
Taylor expanded in c around 0 81.6%
Taylor expanded in t around 0 68.1%
if -7.20000000000000022e51 < (*.f64 x y) < 1.1e70Initial program 98.7%
Taylor expanded in c around inf 39.0%
Final simplification51.3%
(FPCore (x y z t a b c) :precision binary64 (+ c (- (+ (* x y) (/ (* z t) 16.0)) (/ (* a b) 4.0))))
double code(double x, double y, double z, double t, double a, double b, double c) {
return c + (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0));
}
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
code = c + (((x * y) + ((z * t) / 16.0d0)) - ((a * b) / 4.0d0))
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
return c + (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0));
}
def code(x, y, z, t, a, b, c): return c + (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0))
function code(x, y, z, t, a, b, c) return Float64(c + Float64(Float64(Float64(x * y) + Float64(Float64(z * t) / 16.0)) - Float64(Float64(a * b) / 4.0))) end
function tmp = code(x, y, z, t, a, b, c) tmp = c + (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)); end
code[x_, y_, z_, t_, a_, b_, c_] := N[(c + N[(N[(N[(x * y), $MachinePrecision] + N[(N[(z * t), $MachinePrecision] / 16.0), $MachinePrecision]), $MachinePrecision] - N[(N[(a * b), $MachinePrecision] / 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
c + \left(\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\right)
\end{array}
Initial program 97.3%
Final simplification97.3%
(FPCore (x y z t a b c) :precision binary64 c)
double code(double x, double y, double z, double t, double a, double b, double c) {
return c;
}
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
code = c
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
return c;
}
def code(x, y, z, t, a, b, c): return c
function code(x, y, z, t, a, b, c) return c end
function tmp = code(x, y, z, t, a, b, c) tmp = c; end
code[x_, y_, z_, t_, a_, b_, c_] := c
\begin{array}{l}
\\
c
\end{array}
Initial program 97.3%
Taylor expanded in c around inf 25.3%
Final simplification25.3%
herbie shell --seed 2024020
(FPCore (x y z t a b c)
:name "Diagrams.Solve.Polynomial:quartForm from diagrams-solve-0.1, C"
:precision binary64
(+ (- (+ (* x y) (/ (* z t) 16.0)) (/ (* a b) 4.0)) c))