
(FPCore (x y z t a b c i) :precision binary64 (+ (+ (+ (* x y) (* z t)) (* a b)) (* c i)))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return (((x * y) + (z * t)) + (a * b)) + (c * i);
}
real(8) function code(x, y, z, t, a, b, c, i)
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), intent (in) :: i
code = (((x * y) + (z * t)) + (a * b)) + (c * i)
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return (((x * y) + (z * t)) + (a * b)) + (c * i);
}
def code(x, y, z, t, a, b, c, i): return (((x * y) + (z * t)) + (a * b)) + (c * i)
function code(x, y, z, t, a, b, c, i) return Float64(Float64(Float64(Float64(x * y) + Float64(z * t)) + Float64(a * b)) + Float64(c * i)) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = (((x * y) + (z * t)) + (a * b)) + (c * i); end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] + N[(a * b), $MachinePrecision]), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(x \cdot y + z \cdot t\right) + a \cdot b\right) + c \cdot i
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 14 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b c i) :precision binary64 (+ (+ (+ (* x y) (* z t)) (* a b)) (* c i)))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return (((x * y) + (z * t)) + (a * b)) + (c * i);
}
real(8) function code(x, y, z, t, a, b, c, i)
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), intent (in) :: i
code = (((x * y) + (z * t)) + (a * b)) + (c * i)
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return (((x * y) + (z * t)) + (a * b)) + (c * i);
}
def code(x, y, z, t, a, b, c, i): return (((x * y) + (z * t)) + (a * b)) + (c * i)
function code(x, y, z, t, a, b, c, i) return Float64(Float64(Float64(Float64(x * y) + Float64(z * t)) + Float64(a * b)) + Float64(c * i)) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = (((x * y) + (z * t)) + (a * b)) + (c * i); end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] + N[(a * b), $MachinePrecision]), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(x \cdot y + z \cdot t\right) + a \cdot b\right) + c \cdot i
\end{array}
(FPCore (x y z t a b c i) :precision binary64 (let* ((t_1 (+ (* c i) (+ (* a b) (+ (* x y) (* z t)))))) (if (<= t_1 INFINITY) t_1 (* y (+ x (+ (* a (/ b y)) (* c (/ i y))))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (c * i) + ((a * b) + ((x * y) + (z * t)));
double tmp;
if (t_1 <= ((double) INFINITY)) {
tmp = t_1;
} else {
tmp = y * (x + ((a * (b / y)) + (c * (i / y))));
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (c * i) + ((a * b) + ((x * y) + (z * t)));
double tmp;
if (t_1 <= Double.POSITIVE_INFINITY) {
tmp = t_1;
} else {
tmp = y * (x + ((a * (b / y)) + (c * (i / y))));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = (c * i) + ((a * b) + ((x * y) + (z * t))) tmp = 0 if t_1 <= math.inf: tmp = t_1 else: tmp = y * (x + ((a * (b / y)) + (c * (i / y)))) return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(c * i) + Float64(Float64(a * b) + Float64(Float64(x * y) + Float64(z * t)))) tmp = 0.0 if (t_1 <= Inf) tmp = t_1; else tmp = Float64(y * Float64(x + Float64(Float64(a * Float64(b / y)) + Float64(c * Float64(i / y))))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = (c * i) + ((a * b) + ((x * y) + (z * t))); tmp = 0.0; if (t_1 <= Inf) tmp = t_1; else tmp = y * (x + ((a * (b / y)) + (c * (i / y)))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(c * i), $MachinePrecision] + N[(N[(a * b), $MachinePrecision] + N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, Infinity], t$95$1, N[(y * N[(x + N[(N[(a * N[(b / y), $MachinePrecision]), $MachinePrecision] + N[(c * N[(i / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := c \cdot i + \left(a \cdot b + \left(x \cdot y + z \cdot t\right)\right)\\
\mathbf{if}\;t\_1 \leq \infty:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;y \cdot \left(x + \left(a \cdot \frac{b}{y} + c \cdot \frac{i}{y}\right)\right)\\
\end{array}
\end{array}
if (+.f64 (+.f64 (+.f64 (*.f64 x y) (*.f64 z t)) (*.f64 a b)) (*.f64 c i)) < +inf.0Initial program 100.0%
if +inf.0 < (+.f64 (+.f64 (+.f64 (*.f64 x y) (*.f64 z t)) (*.f64 a b)) (*.f64 c i)) Initial program 0.0%
Taylor expanded in z around 0 8.3%
Taylor expanded in y around inf 25.0%
associate-/l*58.3%
associate-/l*75.0%
Simplified75.0%
Final simplification98.8%
(FPCore (x y z t a b c i) :precision binary64 (fma c i (fma a b (fma x y (* z t)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return fma(c, i, fma(a, b, fma(x, y, (z * t))));
}
function code(x, y, z, t, a, b, c, i) return fma(c, i, fma(a, b, fma(x, y, Float64(z * t)))) end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(c * i + N[(a * b + N[(x * y + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(c, i, \mathsf{fma}\left(a, b, \mathsf{fma}\left(x, y, z \cdot t\right)\right)\right)
\end{array}
Initial program 95.3%
+-commutative95.3%
fma-define96.1%
+-commutative96.1%
fma-define97.3%
fma-define98.4%
Simplified98.4%
Final simplification98.4%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ (* a b) (* c i))))
(if (<= (* x y) -1.35e+181)
(* x y)
(if (<= (* x y) 12500.0)
t_1
(if (<= (* x y) 2.1e+106)
(* z t)
(if (or (<= (* x y) 5.4e+124) (not (<= (* x y) 1e+145)))
(* x y)
t_1))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (a * b) + (c * i);
double tmp;
if ((x * y) <= -1.35e+181) {
tmp = x * y;
} else if ((x * y) <= 12500.0) {
tmp = t_1;
} else if ((x * y) <= 2.1e+106) {
tmp = z * t;
} else if (((x * y) <= 5.4e+124) || !((x * y) <= 1e+145)) {
tmp = x * y;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
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), intent (in) :: i
real(8) :: t_1
real(8) :: tmp
t_1 = (a * b) + (c * i)
if ((x * y) <= (-1.35d+181)) then
tmp = x * y
else if ((x * y) <= 12500.0d0) then
tmp = t_1
else if ((x * y) <= 2.1d+106) then
tmp = z * t
else if (((x * y) <= 5.4d+124) .or. (.not. ((x * y) <= 1d+145))) then
tmp = x * y
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 i) {
double t_1 = (a * b) + (c * i);
double tmp;
if ((x * y) <= -1.35e+181) {
tmp = x * y;
} else if ((x * y) <= 12500.0) {
tmp = t_1;
} else if ((x * y) <= 2.1e+106) {
tmp = z * t;
} else if (((x * y) <= 5.4e+124) || !((x * y) <= 1e+145)) {
tmp = x * y;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = (a * b) + (c * i) tmp = 0 if (x * y) <= -1.35e+181: tmp = x * y elif (x * y) <= 12500.0: tmp = t_1 elif (x * y) <= 2.1e+106: tmp = z * t elif ((x * y) <= 5.4e+124) or not ((x * y) <= 1e+145): tmp = x * y else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(a * b) + Float64(c * i)) tmp = 0.0 if (Float64(x * y) <= -1.35e+181) tmp = Float64(x * y); elseif (Float64(x * y) <= 12500.0) tmp = t_1; elseif (Float64(x * y) <= 2.1e+106) tmp = Float64(z * t); elseif ((Float64(x * y) <= 5.4e+124) || !(Float64(x * y) <= 1e+145)) tmp = Float64(x * y); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = (a * b) + (c * i); tmp = 0.0; if ((x * y) <= -1.35e+181) tmp = x * y; elseif ((x * y) <= 12500.0) tmp = t_1; elseif ((x * y) <= 2.1e+106) tmp = z * t; elseif (((x * y) <= 5.4e+124) || ~(((x * y) <= 1e+145))) tmp = x * y; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(a * b), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -1.35e+181], N[(x * y), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 12500.0], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 2.1e+106], N[(z * t), $MachinePrecision], If[Or[LessEqual[N[(x * y), $MachinePrecision], 5.4e+124], N[Not[LessEqual[N[(x * y), $MachinePrecision], 1e+145]], $MachinePrecision]], N[(x * y), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot b + c \cdot i\\
\mathbf{if}\;x \cdot y \leq -1.35 \cdot 10^{+181}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;x \cdot y \leq 12500:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \cdot y \leq 2.1 \cdot 10^{+106}:\\
\;\;\;\;z \cdot t\\
\mathbf{elif}\;x \cdot y \leq 5.4 \cdot 10^{+124} \lor \neg \left(x \cdot y \leq 10^{+145}\right):\\
\;\;\;\;x \cdot y\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (*.f64 x y) < -1.35000000000000004e181 or 2.10000000000000005e106 < (*.f64 x y) < 5.39999999999999956e124 or 9.9999999999999999e144 < (*.f64 x y) Initial program 87.3%
Taylor expanded in x around inf 74.6%
if -1.35000000000000004e181 < (*.f64 x y) < 12500 or 5.39999999999999956e124 < (*.f64 x y) < 9.9999999999999999e144Initial program 98.7%
Taylor expanded in a around inf 91.0%
associate-+r+91.0%
associate-/l*86.7%
associate-/l*83.6%
Simplified83.6%
Taylor expanded in a around inf 66.1%
if 12500 < (*.f64 x y) < 2.10000000000000005e106Initial program 100.0%
Taylor expanded in z around inf 62.4%
Final simplification68.4%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ (* a b) (* z t))) (t_2 (+ (* x y) (* a b))))
(if (<= (* x y) -3.8e+179)
t_2
(if (<= (* x y) 9e-301)
t_1
(if (<= (* x y) 1.1e-127)
(+ (* a b) (* c i))
(if (<= (* x y) 6.2e+97) t_1 t_2))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (a * b) + (z * t);
double t_2 = (x * y) + (a * b);
double tmp;
if ((x * y) <= -3.8e+179) {
tmp = t_2;
} else if ((x * y) <= 9e-301) {
tmp = t_1;
} else if ((x * y) <= 1.1e-127) {
tmp = (a * b) + (c * i);
} else if ((x * y) <= 6.2e+97) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
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), intent (in) :: i
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (a * b) + (z * t)
t_2 = (x * y) + (a * b)
if ((x * y) <= (-3.8d+179)) then
tmp = t_2
else if ((x * y) <= 9d-301) then
tmp = t_1
else if ((x * y) <= 1.1d-127) then
tmp = (a * b) + (c * i)
else if ((x * y) <= 6.2d+97) then
tmp = t_1
else
tmp = 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 i) {
double t_1 = (a * b) + (z * t);
double t_2 = (x * y) + (a * b);
double tmp;
if ((x * y) <= -3.8e+179) {
tmp = t_2;
} else if ((x * y) <= 9e-301) {
tmp = t_1;
} else if ((x * y) <= 1.1e-127) {
tmp = (a * b) + (c * i);
} else if ((x * y) <= 6.2e+97) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = (a * b) + (z * t) t_2 = (x * y) + (a * b) tmp = 0 if (x * y) <= -3.8e+179: tmp = t_2 elif (x * y) <= 9e-301: tmp = t_1 elif (x * y) <= 1.1e-127: tmp = (a * b) + (c * i) elif (x * y) <= 6.2e+97: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(a * b) + Float64(z * t)) t_2 = Float64(Float64(x * y) + Float64(a * b)) tmp = 0.0 if (Float64(x * y) <= -3.8e+179) tmp = t_2; elseif (Float64(x * y) <= 9e-301) tmp = t_1; elseif (Float64(x * y) <= 1.1e-127) tmp = Float64(Float64(a * b) + Float64(c * i)); elseif (Float64(x * y) <= 6.2e+97) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = (a * b) + (z * t); t_2 = (x * y) + (a * b); tmp = 0.0; if ((x * y) <= -3.8e+179) tmp = t_2; elseif ((x * y) <= 9e-301) tmp = t_1; elseif ((x * y) <= 1.1e-127) tmp = (a * b) + (c * i); elseif ((x * y) <= 6.2e+97) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(a * b), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x * y), $MachinePrecision] + N[(a * b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -3.8e+179], t$95$2, If[LessEqual[N[(x * y), $MachinePrecision], 9e-301], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 1.1e-127], N[(N[(a * b), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 6.2e+97], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot b + z \cdot t\\
t_2 := x \cdot y + a \cdot b\\
\mathbf{if}\;x \cdot y \leq -3.8 \cdot 10^{+179}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x \cdot y \leq 9 \cdot 10^{-301}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \cdot y \leq 1.1 \cdot 10^{-127}:\\
\;\;\;\;a \cdot b + c \cdot i\\
\mathbf{elif}\;x \cdot y \leq 6.2 \cdot 10^{+97}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if (*.f64 x y) < -3.8e179 or 6.19999999999999962e97 < (*.f64 x y) Initial program 88.1%
Taylor expanded in c around 0 83.3%
Taylor expanded in t around 0 77.6%
if -3.8e179 < (*.f64 x y) < 9.00000000000000039e-301 or 1.1000000000000001e-127 < (*.f64 x y) < 6.19999999999999962e97Initial program 98.6%
Taylor expanded in c around 0 73.9%
Taylor expanded in x around 0 67.9%
if 9.00000000000000039e-301 < (*.f64 x y) < 1.1000000000000001e-127Initial program 100.0%
Taylor expanded in a around inf 96.3%
associate-+r+96.3%
associate-/l*92.7%
associate-/l*89.0%
Simplified89.0%
Taylor expanded in a around inf 89.4%
Final simplification73.4%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ (* x y) (* z t))))
(if (or (<= (* a b) -2e+177) (not (<= (* a b) 500000000000.0)))
(+ (* a b) t_1)
(+ (* c i) t_1))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (x * y) + (z * t);
double tmp;
if (((a * b) <= -2e+177) || !((a * b) <= 500000000000.0)) {
tmp = (a * b) + t_1;
} else {
tmp = (c * i) + t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
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), intent (in) :: i
real(8) :: t_1
real(8) :: tmp
t_1 = (x * y) + (z * t)
if (((a * b) <= (-2d+177)) .or. (.not. ((a * b) <= 500000000000.0d0))) then
tmp = (a * b) + t_1
else
tmp = (c * i) + 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 i) {
double t_1 = (x * y) + (z * t);
double tmp;
if (((a * b) <= -2e+177) || !((a * b) <= 500000000000.0)) {
tmp = (a * b) + t_1;
} else {
tmp = (c * i) + t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = (x * y) + (z * t) tmp = 0 if ((a * b) <= -2e+177) or not ((a * b) <= 500000000000.0): tmp = (a * b) + t_1 else: tmp = (c * i) + t_1 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(x * y) + Float64(z * t)) tmp = 0.0 if ((Float64(a * b) <= -2e+177) || !(Float64(a * b) <= 500000000000.0)) tmp = Float64(Float64(a * b) + t_1); else tmp = Float64(Float64(c * i) + t_1); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = (x * y) + (z * t); tmp = 0.0; if (((a * b) <= -2e+177) || ~(((a * b) <= 500000000000.0))) tmp = (a * b) + t_1; else tmp = (c * i) + t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[N[(a * b), $MachinePrecision], -2e+177], N[Not[LessEqual[N[(a * b), $MachinePrecision], 500000000000.0]], $MachinePrecision]], N[(N[(a * b), $MachinePrecision] + t$95$1), $MachinePrecision], N[(N[(c * i), $MachinePrecision] + t$95$1), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot y + z \cdot t\\
\mathbf{if}\;a \cdot b \leq -2 \cdot 10^{+177} \lor \neg \left(a \cdot b \leq 500000000000\right):\\
\;\;\;\;a \cdot b + t\_1\\
\mathbf{else}:\\
\;\;\;\;c \cdot i + t\_1\\
\end{array}
\end{array}
if (*.f64 a b) < -2e177 or 5e11 < (*.f64 a b) Initial program 92.6%
Taylor expanded in c around 0 86.6%
if -2e177 < (*.f64 a b) < 5e11Initial program 96.9%
Taylor expanded in a around 0 92.4%
Final simplification90.3%
(FPCore (x y z t a b c i)
:precision binary64
(if (<= (* c i) -1e+250)
(* a (+ b (* c (/ i a))))
(if (<= (* c i) 1e+238)
(+ (* a b) (+ (* x y) (* z t)))
(+ (* x y) (* c i)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((c * i) <= -1e+250) {
tmp = a * (b + (c * (i / a)));
} else if ((c * i) <= 1e+238) {
tmp = (a * b) + ((x * y) + (z * t));
} else {
tmp = (x * y) + (c * i);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
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), intent (in) :: i
real(8) :: tmp
if ((c * i) <= (-1d+250)) then
tmp = a * (b + (c * (i / a)))
else if ((c * i) <= 1d+238) then
tmp = (a * b) + ((x * y) + (z * t))
else
tmp = (x * y) + (c * i)
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 i) {
double tmp;
if ((c * i) <= -1e+250) {
tmp = a * (b + (c * (i / a)));
} else if ((c * i) <= 1e+238) {
tmp = (a * b) + ((x * y) + (z * t));
} else {
tmp = (x * y) + (c * i);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (c * i) <= -1e+250: tmp = a * (b + (c * (i / a))) elif (c * i) <= 1e+238: tmp = (a * b) + ((x * y) + (z * t)) else: tmp = (x * y) + (c * i) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (Float64(c * i) <= -1e+250) tmp = Float64(a * Float64(b + Float64(c * Float64(i / a)))); elseif (Float64(c * i) <= 1e+238) tmp = Float64(Float64(a * b) + Float64(Float64(x * y) + Float64(z * t))); else tmp = Float64(Float64(x * y) + Float64(c * i)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if ((c * i) <= -1e+250) tmp = a * (b + (c * (i / a))); elseif ((c * i) <= 1e+238) tmp = (a * b) + ((x * y) + (z * t)); else tmp = (x * y) + (c * i); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[N[(c * i), $MachinePrecision], -1e+250], N[(a * N[(b + N[(c * N[(i / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(c * i), $MachinePrecision], 1e+238], N[(N[(a * b), $MachinePrecision] + N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * y), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \cdot i \leq -1 \cdot 10^{+250}:\\
\;\;\;\;a \cdot \left(b + c \cdot \frac{i}{a}\right)\\
\mathbf{elif}\;c \cdot i \leq 10^{+238}:\\
\;\;\;\;a \cdot b + \left(x \cdot y + z \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot y + c \cdot i\\
\end{array}
\end{array}
if (*.f64 c i) < -9.9999999999999992e249Initial program 69.6%
Taylor expanded in a around inf 73.9%
associate-+r+73.9%
associate-/l*73.9%
associate-/l*73.9%
Simplified73.9%
Taylor expanded in a around inf 78.3%
Taylor expanded in a around inf 82.9%
associate-/l*87.2%
Simplified87.2%
if -9.9999999999999992e249 < (*.f64 c i) < 1e238Initial program 97.6%
Taylor expanded in c around 0 84.9%
if 1e238 < (*.f64 c i) Initial program 100.0%
Taylor expanded in a around inf 84.7%
associate-+r+84.7%
associate-/l*84.7%
associate-/l*79.4%
Simplified79.4%
Taylor expanded in x around inf 90.3%
Final simplification85.5%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ (* x y) (* z t))))
(if (<= (* a b) -2e+177)
(+ (* c i) (+ (* x y) (* a b)))
(if (<= (* a b) 500000000000.0) (+ (* c i) t_1) (+ (* a b) t_1)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (x * y) + (z * t);
double tmp;
if ((a * b) <= -2e+177) {
tmp = (c * i) + ((x * y) + (a * b));
} else if ((a * b) <= 500000000000.0) {
tmp = (c * i) + t_1;
} else {
tmp = (a * b) + t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
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), intent (in) :: i
real(8) :: t_1
real(8) :: tmp
t_1 = (x * y) + (z * t)
if ((a * b) <= (-2d+177)) then
tmp = (c * i) + ((x * y) + (a * b))
else if ((a * b) <= 500000000000.0d0) then
tmp = (c * i) + t_1
else
tmp = (a * b) + 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 i) {
double t_1 = (x * y) + (z * t);
double tmp;
if ((a * b) <= -2e+177) {
tmp = (c * i) + ((x * y) + (a * b));
} else if ((a * b) <= 500000000000.0) {
tmp = (c * i) + t_1;
} else {
tmp = (a * b) + t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = (x * y) + (z * t) tmp = 0 if (a * b) <= -2e+177: tmp = (c * i) + ((x * y) + (a * b)) elif (a * b) <= 500000000000.0: tmp = (c * i) + t_1 else: tmp = (a * b) + t_1 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(x * y) + Float64(z * t)) tmp = 0.0 if (Float64(a * b) <= -2e+177) tmp = Float64(Float64(c * i) + Float64(Float64(x * y) + Float64(a * b))); elseif (Float64(a * b) <= 500000000000.0) tmp = Float64(Float64(c * i) + t_1); else tmp = Float64(Float64(a * b) + t_1); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = (x * y) + (z * t); tmp = 0.0; if ((a * b) <= -2e+177) tmp = (c * i) + ((x * y) + (a * b)); elseif ((a * b) <= 500000000000.0) tmp = (c * i) + t_1; else tmp = (a * b) + t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(a * b), $MachinePrecision], -2e+177], N[(N[(c * i), $MachinePrecision] + N[(N[(x * y), $MachinePrecision] + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 500000000000.0], N[(N[(c * i), $MachinePrecision] + t$95$1), $MachinePrecision], N[(N[(a * b), $MachinePrecision] + t$95$1), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot y + z \cdot t\\
\mathbf{if}\;a \cdot b \leq -2 \cdot 10^{+177}:\\
\;\;\;\;c \cdot i + \left(x \cdot y + a \cdot b\right)\\
\mathbf{elif}\;a \cdot b \leq 500000000000:\\
\;\;\;\;c \cdot i + t\_1\\
\mathbf{else}:\\
\;\;\;\;a \cdot b + t\_1\\
\end{array}
\end{array}
if (*.f64 a b) < -2e177Initial program 91.2%
Taylor expanded in z around 0 88.2%
if -2e177 < (*.f64 a b) < 5e11Initial program 96.9%
Taylor expanded in a around 0 92.4%
if 5e11 < (*.f64 a b) Initial program 93.4%
Taylor expanded in c around 0 88.9%
Final simplification91.0%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ (* x y) (* z t))))
(if (<= (* a b) -2e+177)
(+ (* c i) (* a (+ b (* x (/ y a)))))
(if (<= (* a b) 500000000000.0) (+ (* c i) t_1) (+ (* a b) t_1)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (x * y) + (z * t);
double tmp;
if ((a * b) <= -2e+177) {
tmp = (c * i) + (a * (b + (x * (y / a))));
} else if ((a * b) <= 500000000000.0) {
tmp = (c * i) + t_1;
} else {
tmp = (a * b) + t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
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), intent (in) :: i
real(8) :: t_1
real(8) :: tmp
t_1 = (x * y) + (z * t)
if ((a * b) <= (-2d+177)) then
tmp = (c * i) + (a * (b + (x * (y / a))))
else if ((a * b) <= 500000000000.0d0) then
tmp = (c * i) + t_1
else
tmp = (a * b) + 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 i) {
double t_1 = (x * y) + (z * t);
double tmp;
if ((a * b) <= -2e+177) {
tmp = (c * i) + (a * (b + (x * (y / a))));
} else if ((a * b) <= 500000000000.0) {
tmp = (c * i) + t_1;
} else {
tmp = (a * b) + t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = (x * y) + (z * t) tmp = 0 if (a * b) <= -2e+177: tmp = (c * i) + (a * (b + (x * (y / a)))) elif (a * b) <= 500000000000.0: tmp = (c * i) + t_1 else: tmp = (a * b) + t_1 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(x * y) + Float64(z * t)) tmp = 0.0 if (Float64(a * b) <= -2e+177) tmp = Float64(Float64(c * i) + Float64(a * Float64(b + Float64(x * Float64(y / a))))); elseif (Float64(a * b) <= 500000000000.0) tmp = Float64(Float64(c * i) + t_1); else tmp = Float64(Float64(a * b) + t_1); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = (x * y) + (z * t); tmp = 0.0; if ((a * b) <= -2e+177) tmp = (c * i) + (a * (b + (x * (y / a)))); elseif ((a * b) <= 500000000000.0) tmp = (c * i) + t_1; else tmp = (a * b) + t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(a * b), $MachinePrecision], -2e+177], N[(N[(c * i), $MachinePrecision] + N[(a * N[(b + N[(x * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 500000000000.0], N[(N[(c * i), $MachinePrecision] + t$95$1), $MachinePrecision], N[(N[(a * b), $MachinePrecision] + t$95$1), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot y + z \cdot t\\
\mathbf{if}\;a \cdot b \leq -2 \cdot 10^{+177}:\\
\;\;\;\;c \cdot i + a \cdot \left(b + x \cdot \frac{y}{a}\right)\\
\mathbf{elif}\;a \cdot b \leq 500000000000:\\
\;\;\;\;c \cdot i + t\_1\\
\mathbf{else}:\\
\;\;\;\;a \cdot b + t\_1\\
\end{array}
\end{array}
if (*.f64 a b) < -2e177Initial program 91.2%
Taylor expanded in a around inf 100.0%
associate-+r+100.0%
associate-/l*100.0%
associate-/l*100.0%
Simplified100.0%
Taylor expanded in t around 0 97.1%
associate-*r/97.1%
Simplified97.1%
if -2e177 < (*.f64 a b) < 5e11Initial program 96.9%
Taylor expanded in a around 0 92.4%
if 5e11 < (*.f64 a b) Initial program 93.4%
Taylor expanded in c around 0 88.9%
Final simplification92.2%
(FPCore (x y z t a b c i)
:precision binary64
(if (<= t -4.5e-41)
(* z t)
(if (<= t 5.5e-251)
(* c i)
(if (<= t 1.5e-127) (* a b) (if (<= t 2.6e+109) (* x y) (* z t))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (t <= -4.5e-41) {
tmp = z * t;
} else if (t <= 5.5e-251) {
tmp = c * i;
} else if (t <= 1.5e-127) {
tmp = a * b;
} else if (t <= 2.6e+109) {
tmp = x * y;
} else {
tmp = z * t;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
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), intent (in) :: i
real(8) :: tmp
if (t <= (-4.5d-41)) then
tmp = z * t
else if (t <= 5.5d-251) then
tmp = c * i
else if (t <= 1.5d-127) then
tmp = a * b
else if (t <= 2.6d+109) then
tmp = x * y
else
tmp = z * t
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 i) {
double tmp;
if (t <= -4.5e-41) {
tmp = z * t;
} else if (t <= 5.5e-251) {
tmp = c * i;
} else if (t <= 1.5e-127) {
tmp = a * b;
} else if (t <= 2.6e+109) {
tmp = x * y;
} else {
tmp = z * t;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if t <= -4.5e-41: tmp = z * t elif t <= 5.5e-251: tmp = c * i elif t <= 1.5e-127: tmp = a * b elif t <= 2.6e+109: tmp = x * y else: tmp = z * t return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (t <= -4.5e-41) tmp = Float64(z * t); elseif (t <= 5.5e-251) tmp = Float64(c * i); elseif (t <= 1.5e-127) tmp = Float64(a * b); elseif (t <= 2.6e+109) tmp = Float64(x * y); else tmp = Float64(z * t); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if (t <= -4.5e-41) tmp = z * t; elseif (t <= 5.5e-251) tmp = c * i; elseif (t <= 1.5e-127) tmp = a * b; elseif (t <= 2.6e+109) tmp = x * y; else tmp = z * t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[t, -4.5e-41], N[(z * t), $MachinePrecision], If[LessEqual[t, 5.5e-251], N[(c * i), $MachinePrecision], If[LessEqual[t, 1.5e-127], N[(a * b), $MachinePrecision], If[LessEqual[t, 2.6e+109], N[(x * y), $MachinePrecision], N[(z * t), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -4.5 \cdot 10^{-41}:\\
\;\;\;\;z \cdot t\\
\mathbf{elif}\;t \leq 5.5 \cdot 10^{-251}:\\
\;\;\;\;c \cdot i\\
\mathbf{elif}\;t \leq 1.5 \cdot 10^{-127}:\\
\;\;\;\;a \cdot b\\
\mathbf{elif}\;t \leq 2.6 \cdot 10^{+109}:\\
\;\;\;\;x \cdot y\\
\mathbf{else}:\\
\;\;\;\;z \cdot t\\
\end{array}
\end{array}
if t < -4.5e-41 or 2.5999999999999998e109 < t Initial program 95.8%
Taylor expanded in z around inf 50.4%
if -4.5e-41 < t < 5.5e-251Initial program 96.0%
Taylor expanded in c around inf 40.7%
if 5.5e-251 < t < 1.50000000000000004e-127Initial program 95.6%
Taylor expanded in a around inf 53.9%
if 1.50000000000000004e-127 < t < 2.5999999999999998e109Initial program 92.3%
Taylor expanded in x around inf 52.6%
Final simplification48.2%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ (* a b) (* z t))))
(if (<= t -1.02e-26)
t_1
(if (<= t 3300000.0)
(+ (* a b) (* c i))
(if (<= t 4.2e+67) (* x y) t_1)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (a * b) + (z * t);
double tmp;
if (t <= -1.02e-26) {
tmp = t_1;
} else if (t <= 3300000.0) {
tmp = (a * b) + (c * i);
} else if (t <= 4.2e+67) {
tmp = x * y;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
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), intent (in) :: i
real(8) :: t_1
real(8) :: tmp
t_1 = (a * b) + (z * t)
if (t <= (-1.02d-26)) then
tmp = t_1
else if (t <= 3300000.0d0) then
tmp = (a * b) + (c * i)
else if (t <= 4.2d+67) then
tmp = x * y
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 i) {
double t_1 = (a * b) + (z * t);
double tmp;
if (t <= -1.02e-26) {
tmp = t_1;
} else if (t <= 3300000.0) {
tmp = (a * b) + (c * i);
} else if (t <= 4.2e+67) {
tmp = x * y;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = (a * b) + (z * t) tmp = 0 if t <= -1.02e-26: tmp = t_1 elif t <= 3300000.0: tmp = (a * b) + (c * i) elif t <= 4.2e+67: tmp = x * y else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(a * b) + Float64(z * t)) tmp = 0.0 if (t <= -1.02e-26) tmp = t_1; elseif (t <= 3300000.0) tmp = Float64(Float64(a * b) + Float64(c * i)); elseif (t <= 4.2e+67) tmp = Float64(x * y); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = (a * b) + (z * t); tmp = 0.0; if (t <= -1.02e-26) tmp = t_1; elseif (t <= 3300000.0) tmp = (a * b) + (c * i); elseif (t <= 4.2e+67) tmp = x * y; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(a * b), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -1.02e-26], t$95$1, If[LessEqual[t, 3300000.0], N[(N[(a * b), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 4.2e+67], N[(x * y), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot b + z \cdot t\\
\mathbf{if}\;t \leq -1.02 \cdot 10^{-26}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 3300000:\\
\;\;\;\;a \cdot b + c \cdot i\\
\mathbf{elif}\;t \leq 4.2 \cdot 10^{+67}:\\
\;\;\;\;x \cdot y\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -1.02e-26 or 4.2000000000000003e67 < t Initial program 95.0%
Taylor expanded in c around 0 80.5%
Taylor expanded in x around 0 65.8%
if -1.02e-26 < t < 3.3e6Initial program 95.9%
Taylor expanded in a around inf 90.7%
associate-+r+90.7%
associate-/l*86.0%
associate-/l*85.1%
Simplified85.1%
Taylor expanded in a around inf 64.3%
if 3.3e6 < t < 4.2000000000000003e67Initial program 90.9%
Taylor expanded in x around inf 73.3%
Final simplification65.4%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ (* c i) (* z t))))
(if (<= t -7.4e-100)
t_1
(if (<= t 1.95e-246)
(+ (* a b) (* c i))
(if (<= t 3.4e+109) (+ (* x y) (* a b)) t_1)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (c * i) + (z * t);
double tmp;
if (t <= -7.4e-100) {
tmp = t_1;
} else if (t <= 1.95e-246) {
tmp = (a * b) + (c * i);
} else if (t <= 3.4e+109) {
tmp = (x * y) + (a * b);
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
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), intent (in) :: i
real(8) :: t_1
real(8) :: tmp
t_1 = (c * i) + (z * t)
if (t <= (-7.4d-100)) then
tmp = t_1
else if (t <= 1.95d-246) then
tmp = (a * b) + (c * i)
else if (t <= 3.4d+109) then
tmp = (x * y) + (a * b)
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 i) {
double t_1 = (c * i) + (z * t);
double tmp;
if (t <= -7.4e-100) {
tmp = t_1;
} else if (t <= 1.95e-246) {
tmp = (a * b) + (c * i);
} else if (t <= 3.4e+109) {
tmp = (x * y) + (a * b);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = (c * i) + (z * t) tmp = 0 if t <= -7.4e-100: tmp = t_1 elif t <= 1.95e-246: tmp = (a * b) + (c * i) elif t <= 3.4e+109: tmp = (x * y) + (a * b) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(c * i) + Float64(z * t)) tmp = 0.0 if (t <= -7.4e-100) tmp = t_1; elseif (t <= 1.95e-246) tmp = Float64(Float64(a * b) + Float64(c * i)); elseif (t <= 3.4e+109) tmp = Float64(Float64(x * y) + Float64(a * b)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = (c * i) + (z * t); tmp = 0.0; if (t <= -7.4e-100) tmp = t_1; elseif (t <= 1.95e-246) tmp = (a * b) + (c * i); elseif (t <= 3.4e+109) tmp = (x * y) + (a * b); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(c * i), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -7.4e-100], t$95$1, If[LessEqual[t, 1.95e-246], N[(N[(a * b), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 3.4e+109], N[(N[(x * y), $MachinePrecision] + N[(a * b), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := c \cdot i + z \cdot t\\
\mathbf{if}\;t \leq -7.4 \cdot 10^{-100}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 1.95 \cdot 10^{-246}:\\
\;\;\;\;a \cdot b + c \cdot i\\
\mathbf{elif}\;t \leq 3.4 \cdot 10^{+109}:\\
\;\;\;\;x \cdot y + a \cdot b\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -7.40000000000000035e-100 or 3.40000000000000006e109 < t Initial program 96.2%
Taylor expanded in a around inf 79.1%
associate-+r+79.1%
associate-/l*78.3%
associate-/l*76.1%
Simplified76.1%
Taylor expanded in t around inf 63.6%
if -7.40000000000000035e-100 < t < 1.94999999999999989e-246Initial program 95.4%
Taylor expanded in a around inf 91.3%
associate-+r+91.3%
associate-/l*86.9%
associate-/l*86.8%
Simplified86.8%
Taylor expanded in a around inf 72.0%
if 1.94999999999999989e-246 < t < 3.40000000000000006e109Initial program 93.0%
Taylor expanded in c around 0 76.2%
Taylor expanded in t around 0 66.3%
Final simplification66.3%
(FPCore (x y z t a b c i) :precision binary64 (if (<= t -2.1e-35) (* z t) (if (<= t 5e-251) (* c i) (if (<= t 4.1e+108) (* a b) (* z t)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (t <= -2.1e-35) {
tmp = z * t;
} else if (t <= 5e-251) {
tmp = c * i;
} else if (t <= 4.1e+108) {
tmp = a * b;
} else {
tmp = z * t;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
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), intent (in) :: i
real(8) :: tmp
if (t <= (-2.1d-35)) then
tmp = z * t
else if (t <= 5d-251) then
tmp = c * i
else if (t <= 4.1d+108) then
tmp = a * b
else
tmp = z * t
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 i) {
double tmp;
if (t <= -2.1e-35) {
tmp = z * t;
} else if (t <= 5e-251) {
tmp = c * i;
} else if (t <= 4.1e+108) {
tmp = a * b;
} else {
tmp = z * t;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if t <= -2.1e-35: tmp = z * t elif t <= 5e-251: tmp = c * i elif t <= 4.1e+108: tmp = a * b else: tmp = z * t return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (t <= -2.1e-35) tmp = Float64(z * t); elseif (t <= 5e-251) tmp = Float64(c * i); elseif (t <= 4.1e+108) tmp = Float64(a * b); else tmp = Float64(z * t); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if (t <= -2.1e-35) tmp = z * t; elseif (t <= 5e-251) tmp = c * i; elseif (t <= 4.1e+108) tmp = a * b; else tmp = z * t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[t, -2.1e-35], N[(z * t), $MachinePrecision], If[LessEqual[t, 5e-251], N[(c * i), $MachinePrecision], If[LessEqual[t, 4.1e+108], N[(a * b), $MachinePrecision], N[(z * t), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.1 \cdot 10^{-35}:\\
\;\;\;\;z \cdot t\\
\mathbf{elif}\;t \leq 5 \cdot 10^{-251}:\\
\;\;\;\;c \cdot i\\
\mathbf{elif}\;t \leq 4.1 \cdot 10^{+108}:\\
\;\;\;\;a \cdot b\\
\mathbf{else}:\\
\;\;\;\;z \cdot t\\
\end{array}
\end{array}
if t < -2.1e-35 or 4.0999999999999999e108 < t Initial program 95.7%
Taylor expanded in z around inf 51.2%
if -2.1e-35 < t < 5.0000000000000003e-251Initial program 96.1%
Taylor expanded in c around inf 39.7%
if 5.0000000000000003e-251 < t < 4.0999999999999999e108Initial program 93.5%
Taylor expanded in a around inf 31.5%
Final simplification43.0%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= (* a b) -2.3e+150) (not (<= (* a b) 2.8e+18))) (* a b) (* c i)))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (((a * b) <= -2.3e+150) || !((a * b) <= 2.8e+18)) {
tmp = a * b;
} else {
tmp = c * i;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
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), intent (in) :: i
real(8) :: tmp
if (((a * b) <= (-2.3d+150)) .or. (.not. ((a * b) <= 2.8d+18))) then
tmp = a * b
else
tmp = c * i
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 i) {
double tmp;
if (((a * b) <= -2.3e+150) || !((a * b) <= 2.8e+18)) {
tmp = a * b;
} else {
tmp = c * i;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if ((a * b) <= -2.3e+150) or not ((a * b) <= 2.8e+18): tmp = a * b else: tmp = c * i return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((Float64(a * b) <= -2.3e+150) || !(Float64(a * b) <= 2.8e+18)) tmp = Float64(a * b); else tmp = Float64(c * i); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if (((a * b) <= -2.3e+150) || ~(((a * b) <= 2.8e+18))) tmp = a * b; else tmp = c * i; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[N[(a * b), $MachinePrecision], -2.3e+150], N[Not[LessEqual[N[(a * b), $MachinePrecision], 2.8e+18]], $MachinePrecision]], N[(a * b), $MachinePrecision], N[(c * i), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \cdot b \leq -2.3 \cdot 10^{+150} \lor \neg \left(a \cdot b \leq 2.8 \cdot 10^{+18}\right):\\
\;\;\;\;a \cdot b\\
\mathbf{else}:\\
\;\;\;\;c \cdot i\\
\end{array}
\end{array}
if (*.f64 a b) < -2.30000000000000001e150 or 2.8e18 < (*.f64 a b) Initial program 92.9%
Taylor expanded in a around inf 60.5%
if -2.30000000000000001e150 < (*.f64 a b) < 2.8e18Initial program 96.8%
Taylor expanded in c around inf 33.1%
Final simplification43.6%
(FPCore (x y z t a b c i) :precision binary64 (* a b))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return a * b;
}
real(8) function code(x, y, z, t, a, b, c, i)
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), intent (in) :: i
code = a * b
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return a * b;
}
def code(x, y, z, t, a, b, c, i): return a * b
function code(x, y, z, t, a, b, c, i) return Float64(a * b) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = a * b; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(a * b), $MachinePrecision]
\begin{array}{l}
\\
a \cdot b
\end{array}
Initial program 95.3%
Taylor expanded in a around inf 26.6%
Final simplification26.6%
herbie shell --seed 2024055
(FPCore (x y z t a b c i)
:name "Linear.V4:$cdot from linear-1.19.1.3, C"
:precision binary64
(+ (+ (+ (* x y) (* z t)) (* a b)) (* c i)))