
(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 13 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 (+ (+ (* a b) (+ (* z t) (* x y))) (* c i)))) (if (<= t_1 INFINITY) t_1 (+ (* a b) (* c i)))))
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) + (x * y))) + (c * i);
double tmp;
if (t_1 <= ((double) INFINITY)) {
tmp = t_1;
} else {
tmp = (a * b) + (c * i);
}
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 = ((a * b) + ((z * t) + (x * y))) + (c * i);
double tmp;
if (t_1 <= Double.POSITIVE_INFINITY) {
tmp = t_1;
} else {
tmp = (a * b) + (c * i);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = ((a * b) + ((z * t) + (x * y))) + (c * i) tmp = 0 if t_1 <= math.inf: tmp = t_1 else: tmp = (a * b) + (c * i) return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(Float64(a * b) + Float64(Float64(z * t) + Float64(x * y))) + Float64(c * i)) tmp = 0.0 if (t_1 <= Inf) tmp = t_1; else tmp = Float64(Float64(a * b) + Float64(c * i)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = ((a * b) + ((z * t) + (x * y))) + (c * i); tmp = 0.0; if (t_1 <= Inf) tmp = t_1; else tmp = (a * b) + (c * i); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(N[(a * b), $MachinePrecision] + N[(N[(z * t), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, Infinity], t$95$1, N[(N[(a * b), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(a \cdot b + \left(z \cdot t + x \cdot y\right)\right) + c \cdot i\\
\mathbf{if}\;t\_1 \leq \infty:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;a \cdot b + c \cdot i\\
\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 a around inf 50.2%
Final simplification96.1%
(FPCore (x y z t a b c i) :precision binary64 (fma c i (fma x y (fma z t (* a b)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return fma(c, i, fma(x, y, fma(z, t, (a * b))));
}
function code(x, y, z, t, a, b, c, i) return fma(c, i, fma(x, y, fma(z, t, Float64(a * b)))) end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(c * i + N[(x * y + N[(z * t + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(c, i, \mathsf{fma}\left(x, y, \mathsf{fma}\left(z, t, a \cdot b\right)\right)\right)
\end{array}
Initial program 92.2%
+-commutative92.2%
fma-define93.3%
associate-+l+93.3%
fma-define94.1%
fma-define96.1%
Simplified96.1%
(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 92.2%
+-commutative92.2%
fma-define93.3%
+-commutative93.3%
fma-define94.9%
fma-define95.3%
Simplified95.3%
(FPCore (x y z t a b c i)
:precision binary64
(if (<= (* c i) -1.5e+193)
(* c i)
(if (<= (* c i) -1.4e-48)
(* x y)
(if (<= (* c i) -5e-315)
(* a b)
(if (<= (* c i) 1.1e-289)
(* x y)
(if (<= (* c i) 9e-179)
(* z t)
(if (<= (* c i) 2.1e-155)
(* x y)
(if (<= (* c i) 6.2e-61)
(* a b)
(if (<= (* c i) 5e+90) (* 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) <= -1.5e+193) {
tmp = c * i;
} else if ((c * i) <= -1.4e-48) {
tmp = x * y;
} else if ((c * i) <= -5e-315) {
tmp = a * b;
} else if ((c * i) <= 1.1e-289) {
tmp = x * y;
} else if ((c * i) <= 9e-179) {
tmp = z * t;
} else if ((c * i) <= 2.1e-155) {
tmp = x * y;
} else if ((c * i) <= 6.2e-61) {
tmp = a * b;
} else if ((c * i) <= 5e+90) {
tmp = x * y;
} 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 ((c * i) <= (-1.5d+193)) then
tmp = c * i
else if ((c * i) <= (-1.4d-48)) then
tmp = x * y
else if ((c * i) <= (-5d-315)) then
tmp = a * b
else if ((c * i) <= 1.1d-289) then
tmp = x * y
else if ((c * i) <= 9d-179) then
tmp = z * t
else if ((c * i) <= 2.1d-155) then
tmp = x * y
else if ((c * i) <= 6.2d-61) then
tmp = a * b
else if ((c * i) <= 5d+90) then
tmp = x * y
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 ((c * i) <= -1.5e+193) {
tmp = c * i;
} else if ((c * i) <= -1.4e-48) {
tmp = x * y;
} else if ((c * i) <= -5e-315) {
tmp = a * b;
} else if ((c * i) <= 1.1e-289) {
tmp = x * y;
} else if ((c * i) <= 9e-179) {
tmp = z * t;
} else if ((c * i) <= 2.1e-155) {
tmp = x * y;
} else if ((c * i) <= 6.2e-61) {
tmp = a * b;
} else if ((c * i) <= 5e+90) {
tmp = x * y;
} else {
tmp = c * i;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (c * i) <= -1.5e+193: tmp = c * i elif (c * i) <= -1.4e-48: tmp = x * y elif (c * i) <= -5e-315: tmp = a * b elif (c * i) <= 1.1e-289: tmp = x * y elif (c * i) <= 9e-179: tmp = z * t elif (c * i) <= 2.1e-155: tmp = x * y elif (c * i) <= 6.2e-61: tmp = a * b elif (c * i) <= 5e+90: tmp = x * y else: tmp = c * i return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (Float64(c * i) <= -1.5e+193) tmp = Float64(c * i); elseif (Float64(c * i) <= -1.4e-48) tmp = Float64(x * y); elseif (Float64(c * i) <= -5e-315) tmp = Float64(a * b); elseif (Float64(c * i) <= 1.1e-289) tmp = Float64(x * y); elseif (Float64(c * i) <= 9e-179) tmp = Float64(z * t); elseif (Float64(c * i) <= 2.1e-155) tmp = Float64(x * y); elseif (Float64(c * i) <= 6.2e-61) tmp = Float64(a * b); elseif (Float64(c * i) <= 5e+90) tmp = Float64(x * y); 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 ((c * i) <= -1.5e+193) tmp = c * i; elseif ((c * i) <= -1.4e-48) tmp = x * y; elseif ((c * i) <= -5e-315) tmp = a * b; elseif ((c * i) <= 1.1e-289) tmp = x * y; elseif ((c * i) <= 9e-179) tmp = z * t; elseif ((c * i) <= 2.1e-155) tmp = x * y; elseif ((c * i) <= 6.2e-61) tmp = a * b; elseif ((c * i) <= 5e+90) tmp = x * y; else tmp = c * i; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[N[(c * i), $MachinePrecision], -1.5e+193], N[(c * i), $MachinePrecision], If[LessEqual[N[(c * i), $MachinePrecision], -1.4e-48], N[(x * y), $MachinePrecision], If[LessEqual[N[(c * i), $MachinePrecision], -5e-315], N[(a * b), $MachinePrecision], If[LessEqual[N[(c * i), $MachinePrecision], 1.1e-289], N[(x * y), $MachinePrecision], If[LessEqual[N[(c * i), $MachinePrecision], 9e-179], N[(z * t), $MachinePrecision], If[LessEqual[N[(c * i), $MachinePrecision], 2.1e-155], N[(x * y), $MachinePrecision], If[LessEqual[N[(c * i), $MachinePrecision], 6.2e-61], N[(a * b), $MachinePrecision], If[LessEqual[N[(c * i), $MachinePrecision], 5e+90], N[(x * y), $MachinePrecision], N[(c * i), $MachinePrecision]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \cdot i \leq -1.5 \cdot 10^{+193}:\\
\;\;\;\;c \cdot i\\
\mathbf{elif}\;c \cdot i \leq -1.4 \cdot 10^{-48}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;c \cdot i \leq -5 \cdot 10^{-315}:\\
\;\;\;\;a \cdot b\\
\mathbf{elif}\;c \cdot i \leq 1.1 \cdot 10^{-289}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;c \cdot i \leq 9 \cdot 10^{-179}:\\
\;\;\;\;z \cdot t\\
\mathbf{elif}\;c \cdot i \leq 2.1 \cdot 10^{-155}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;c \cdot i \leq 6.2 \cdot 10^{-61}:\\
\;\;\;\;a \cdot b\\
\mathbf{elif}\;c \cdot i \leq 5 \cdot 10^{+90}:\\
\;\;\;\;x \cdot y\\
\mathbf{else}:\\
\;\;\;\;c \cdot i\\
\end{array}
\end{array}
if (*.f64 c i) < -1.5e193 or 5.0000000000000004e90 < (*.f64 c i) Initial program 89.2%
Taylor expanded in c around inf 75.0%
if -1.5e193 < (*.f64 c i) < -1.40000000000000002e-48 or -5.0000000023e-315 < (*.f64 c i) < 1.1e-289 or 8.99999999999999984e-179 < (*.f64 c i) < 2.1000000000000002e-155 or 6.1999999999999999e-61 < (*.f64 c i) < 5.0000000000000004e90Initial program 93.5%
Taylor expanded in z around 0 71.1%
Taylor expanded in x around inf 47.5%
if -1.40000000000000002e-48 < (*.f64 c i) < -5.0000000023e-315 or 2.1000000000000002e-155 < (*.f64 c i) < 6.1999999999999999e-61Initial program 95.1%
Taylor expanded in z around 0 69.9%
Taylor expanded in a around inf 48.8%
if 1.1e-289 < (*.f64 c i) < 8.99999999999999984e-179Initial program 92.3%
Taylor expanded in z around inf 54.9%
Taylor expanded in z around inf 54.9%
Taylor expanded in t around inf 54.9%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ (* a b) (* x y)))
(t_2 (+ (* a b) (* z t)))
(t_3 (+ (* a b) (* c i))))
(if (<= (* c i) -8.5e+184)
t_3
(if (<= (* c i) -3.2e-58)
t_1
(if (<= (* c i) 1.15e-180)
t_2
(if (<= (* c i) 9.5e-56)
t_1
(if (<= (* c i) 1.75e+19)
t_2
(if (<= (* c i) 6.5e+94) t_1 t_3))))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (a * b) + (x * y);
double t_2 = (a * b) + (z * t);
double t_3 = (a * b) + (c * i);
double tmp;
if ((c * i) <= -8.5e+184) {
tmp = t_3;
} else if ((c * i) <= -3.2e-58) {
tmp = t_1;
} else if ((c * i) <= 1.15e-180) {
tmp = t_2;
} else if ((c * i) <= 9.5e-56) {
tmp = t_1;
} else if ((c * i) <= 1.75e+19) {
tmp = t_2;
} else if ((c * i) <= 6.5e+94) {
tmp = t_1;
} else {
tmp = t_3;
}
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) :: t_3
real(8) :: tmp
t_1 = (a * b) + (x * y)
t_2 = (a * b) + (z * t)
t_3 = (a * b) + (c * i)
if ((c * i) <= (-8.5d+184)) then
tmp = t_3
else if ((c * i) <= (-3.2d-58)) then
tmp = t_1
else if ((c * i) <= 1.15d-180) then
tmp = t_2
else if ((c * i) <= 9.5d-56) then
tmp = t_1
else if ((c * i) <= 1.75d+19) then
tmp = t_2
else if ((c * i) <= 6.5d+94) then
tmp = t_1
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 i) {
double t_1 = (a * b) + (x * y);
double t_2 = (a * b) + (z * t);
double t_3 = (a * b) + (c * i);
double tmp;
if ((c * i) <= -8.5e+184) {
tmp = t_3;
} else if ((c * i) <= -3.2e-58) {
tmp = t_1;
} else if ((c * i) <= 1.15e-180) {
tmp = t_2;
} else if ((c * i) <= 9.5e-56) {
tmp = t_1;
} else if ((c * i) <= 1.75e+19) {
tmp = t_2;
} else if ((c * i) <= 6.5e+94) {
tmp = t_1;
} else {
tmp = t_3;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = (a * b) + (x * y) t_2 = (a * b) + (z * t) t_3 = (a * b) + (c * i) tmp = 0 if (c * i) <= -8.5e+184: tmp = t_3 elif (c * i) <= -3.2e-58: tmp = t_1 elif (c * i) <= 1.15e-180: tmp = t_2 elif (c * i) <= 9.5e-56: tmp = t_1 elif (c * i) <= 1.75e+19: tmp = t_2 elif (c * i) <= 6.5e+94: tmp = t_1 else: tmp = t_3 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(a * b) + Float64(x * y)) t_2 = Float64(Float64(a * b) + Float64(z * t)) t_3 = Float64(Float64(a * b) + Float64(c * i)) tmp = 0.0 if (Float64(c * i) <= -8.5e+184) tmp = t_3; elseif (Float64(c * i) <= -3.2e-58) tmp = t_1; elseif (Float64(c * i) <= 1.15e-180) tmp = t_2; elseif (Float64(c * i) <= 9.5e-56) tmp = t_1; elseif (Float64(c * i) <= 1.75e+19) tmp = t_2; elseif (Float64(c * i) <= 6.5e+94) tmp = t_1; else tmp = t_3; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = (a * b) + (x * y); t_2 = (a * b) + (z * t); t_3 = (a * b) + (c * i); tmp = 0.0; if ((c * i) <= -8.5e+184) tmp = t_3; elseif ((c * i) <= -3.2e-58) tmp = t_1; elseif ((c * i) <= 1.15e-180) tmp = t_2; elseif ((c * i) <= 9.5e-56) tmp = t_1; elseif ((c * i) <= 1.75e+19) tmp = t_2; elseif ((c * i) <= 6.5e+94) tmp = t_1; else tmp = t_3; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(a * b), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(a * b), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(a * b), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(c * i), $MachinePrecision], -8.5e+184], t$95$3, If[LessEqual[N[(c * i), $MachinePrecision], -3.2e-58], t$95$1, If[LessEqual[N[(c * i), $MachinePrecision], 1.15e-180], t$95$2, If[LessEqual[N[(c * i), $MachinePrecision], 9.5e-56], t$95$1, If[LessEqual[N[(c * i), $MachinePrecision], 1.75e+19], t$95$2, If[LessEqual[N[(c * i), $MachinePrecision], 6.5e+94], t$95$1, t$95$3]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot b + x \cdot y\\
t_2 := a \cdot b + z \cdot t\\
t_3 := a \cdot b + c \cdot i\\
\mathbf{if}\;c \cdot i \leq -8.5 \cdot 10^{+184}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;c \cdot i \leq -3.2 \cdot 10^{-58}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;c \cdot i \leq 1.15 \cdot 10^{-180}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;c \cdot i \leq 9.5 \cdot 10^{-56}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;c \cdot i \leq 1.75 \cdot 10^{+19}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;c \cdot i \leq 6.5 \cdot 10^{+94}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_3\\
\end{array}
\end{array}
if (*.f64 c i) < -8.50000000000000043e184 or 6.49999999999999976e94 < (*.f64 c i) Initial program 89.1%
Taylor expanded in a around inf 87.4%
if -8.50000000000000043e184 < (*.f64 c i) < -3.2000000000000001e-58 or 1.14999999999999998e-180 < (*.f64 c i) < 9.4999999999999991e-56 or 1.75e19 < (*.f64 c i) < 6.49999999999999976e94Initial program 95.2%
Taylor expanded in z around 0 81.7%
Taylor expanded in c around 0 71.2%
if -3.2000000000000001e-58 < (*.f64 c i) < 1.14999999999999998e-180 or 9.4999999999999991e-56 < (*.f64 c i) < 1.75e19Initial program 92.5%
Taylor expanded in x around 0 70.9%
Taylor expanded in c around 0 69.7%
Final simplification76.5%
(FPCore (x y z t a b c i)
:precision binary64
(if (or (<= (* x y) -2.7e+177)
(and (not (<= (* x y) 1.25e+149))
(or (<= (* x y) 5.3e+265) (not (<= (* x y) 1.9e+281)))))
(* x y)
(+ (* 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 (((x * y) <= -2.7e+177) || (!((x * y) <= 1.25e+149) && (((x * y) <= 5.3e+265) || !((x * y) <= 1.9e+281)))) {
tmp = x * y;
} else {
tmp = (a * b) + (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 (((x * y) <= (-2.7d+177)) .or. (.not. ((x * y) <= 1.25d+149)) .and. ((x * y) <= 5.3d+265) .or. (.not. ((x * y) <= 1.9d+281))) then
tmp = x * y
else
tmp = (a * b) + (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 (((x * y) <= -2.7e+177) || (!((x * y) <= 1.25e+149) && (((x * y) <= 5.3e+265) || !((x * y) <= 1.9e+281)))) {
tmp = x * y;
} else {
tmp = (a * b) + (c * i);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if ((x * y) <= -2.7e+177) or (not ((x * y) <= 1.25e+149) and (((x * y) <= 5.3e+265) or not ((x * y) <= 1.9e+281))): tmp = x * y else: tmp = (a * b) + (c * i) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((Float64(x * y) <= -2.7e+177) || (!(Float64(x * y) <= 1.25e+149) && ((Float64(x * y) <= 5.3e+265) || !(Float64(x * y) <= 1.9e+281)))) tmp = Float64(x * y); else tmp = Float64(Float64(a * b) + Float64(c * i)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if (((x * y) <= -2.7e+177) || (~(((x * y) <= 1.25e+149)) && (((x * y) <= 5.3e+265) || ~(((x * y) <= 1.9e+281))))) tmp = x * y; else tmp = (a * b) + (c * i); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[N[(x * y), $MachinePrecision], -2.7e+177], And[N[Not[LessEqual[N[(x * y), $MachinePrecision], 1.25e+149]], $MachinePrecision], Or[LessEqual[N[(x * y), $MachinePrecision], 5.3e+265], N[Not[LessEqual[N[(x * y), $MachinePrecision], 1.9e+281]], $MachinePrecision]]]], N[(x * y), $MachinePrecision], N[(N[(a * b), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -2.7 \cdot 10^{+177} \lor \neg \left(x \cdot y \leq 1.25 \cdot 10^{+149}\right) \land \left(x \cdot y \leq 5.3 \cdot 10^{+265} \lor \neg \left(x \cdot y \leq 1.9 \cdot 10^{+281}\right)\right):\\
\;\;\;\;x \cdot y\\
\mathbf{else}:\\
\;\;\;\;a \cdot b + c \cdot i\\
\end{array}
\end{array}
if (*.f64 x y) < -2.69999999999999991e177 or 1.24999999999999998e149 < (*.f64 x y) < 5.30000000000000033e265 or 1.90000000000000006e281 < (*.f64 x y) Initial program 84.7%
Taylor expanded in z around 0 83.5%
Taylor expanded in x around inf 74.1%
if -2.69999999999999991e177 < (*.f64 x y) < 1.24999999999999998e149 or 5.30000000000000033e265 < (*.f64 x y) < 1.90000000000000006e281Initial program 95.1%
Taylor expanded in a around inf 67.1%
Final simplification69.0%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ (* a b) (* c i))))
(if (<= (* c i) -1.9e+134)
t_1
(if (<= (* c i) -8.8e+77)
(* x y)
(if (or (<= (* c i) -1.3e+24) (not (<= (* c i) 17500000000.0)))
t_1
(+ (* a b) (* z t)))))))
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 ((c * i) <= -1.9e+134) {
tmp = t_1;
} else if ((c * i) <= -8.8e+77) {
tmp = x * y;
} else if (((c * i) <= -1.3e+24) || !((c * i) <= 17500000000.0)) {
tmp = t_1;
} else {
tmp = (a * b) + (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) :: t_1
real(8) :: tmp
t_1 = (a * b) + (c * i)
if ((c * i) <= (-1.9d+134)) then
tmp = t_1
else if ((c * i) <= (-8.8d+77)) then
tmp = x * y
else if (((c * i) <= (-1.3d+24)) .or. (.not. ((c * i) <= 17500000000.0d0))) then
tmp = t_1
else
tmp = (a * b) + (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 t_1 = (a * b) + (c * i);
double tmp;
if ((c * i) <= -1.9e+134) {
tmp = t_1;
} else if ((c * i) <= -8.8e+77) {
tmp = x * y;
} else if (((c * i) <= -1.3e+24) || !((c * i) <= 17500000000.0)) {
tmp = t_1;
} else {
tmp = (a * b) + (z * t);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = (a * b) + (c * i) tmp = 0 if (c * i) <= -1.9e+134: tmp = t_1 elif (c * i) <= -8.8e+77: tmp = x * y elif ((c * i) <= -1.3e+24) or not ((c * i) <= 17500000000.0): tmp = t_1 else: tmp = (a * b) + (z * t) 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(c * i) <= -1.9e+134) tmp = t_1; elseif (Float64(c * i) <= -8.8e+77) tmp = Float64(x * y); elseif ((Float64(c * i) <= -1.3e+24) || !(Float64(c * i) <= 17500000000.0)) tmp = t_1; else tmp = Float64(Float64(a * b) + Float64(z * t)); 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 ((c * i) <= -1.9e+134) tmp = t_1; elseif ((c * i) <= -8.8e+77) tmp = x * y; elseif (((c * i) <= -1.3e+24) || ~(((c * i) <= 17500000000.0))) tmp = t_1; else tmp = (a * b) + (z * t); 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[(c * i), $MachinePrecision], -1.9e+134], t$95$1, If[LessEqual[N[(c * i), $MachinePrecision], -8.8e+77], N[(x * y), $MachinePrecision], If[Or[LessEqual[N[(c * i), $MachinePrecision], -1.3e+24], N[Not[LessEqual[N[(c * i), $MachinePrecision], 17500000000.0]], $MachinePrecision]], t$95$1, N[(N[(a * b), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot b + c \cdot i\\
\mathbf{if}\;c \cdot i \leq -1.9 \cdot 10^{+134}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;c \cdot i \leq -8.8 \cdot 10^{+77}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;c \cdot i \leq -1.3 \cdot 10^{+24} \lor \neg \left(c \cdot i \leq 17500000000\right):\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;a \cdot b + z \cdot t\\
\end{array}
\end{array}
if (*.f64 c i) < -1.89999999999999999e134 or -8.8000000000000002e77 < (*.f64 c i) < -1.2999999999999999e24 or 1.75e10 < (*.f64 c i) Initial program 89.2%
Taylor expanded in a around inf 75.7%
if -1.89999999999999999e134 < (*.f64 c i) < -8.8000000000000002e77Initial program 100.0%
Taylor expanded in z around 0 88.9%
Taylor expanded in x around inf 78.1%
if -1.2999999999999999e24 < (*.f64 c i) < 1.75e10Initial program 94.9%
Taylor expanded in x around 0 69.3%
Taylor expanded in c around 0 66.9%
Final simplification71.7%
(FPCore (x y z t a b c i)
:precision binary64
(if (<= (* c i) -9e+184)
(* c i)
(if (<= (* c i) -4e-49)
(* x y)
(if (<= (* c i) 1.06e-60)
(* a b)
(if (<= (* c i) 4.5e+92) (* 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) <= -9e+184) {
tmp = c * i;
} else if ((c * i) <= -4e-49) {
tmp = x * y;
} else if ((c * i) <= 1.06e-60) {
tmp = a * b;
} else if ((c * i) <= 4.5e+92) {
tmp = x * y;
} 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 ((c * i) <= (-9d+184)) then
tmp = c * i
else if ((c * i) <= (-4d-49)) then
tmp = x * y
else if ((c * i) <= 1.06d-60) then
tmp = a * b
else if ((c * i) <= 4.5d+92) then
tmp = x * y
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 ((c * i) <= -9e+184) {
tmp = c * i;
} else if ((c * i) <= -4e-49) {
tmp = x * y;
} else if ((c * i) <= 1.06e-60) {
tmp = a * b;
} else if ((c * i) <= 4.5e+92) {
tmp = x * y;
} else {
tmp = c * i;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (c * i) <= -9e+184: tmp = c * i elif (c * i) <= -4e-49: tmp = x * y elif (c * i) <= 1.06e-60: tmp = a * b elif (c * i) <= 4.5e+92: tmp = x * y else: tmp = c * i return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (Float64(c * i) <= -9e+184) tmp = Float64(c * i); elseif (Float64(c * i) <= -4e-49) tmp = Float64(x * y); elseif (Float64(c * i) <= 1.06e-60) tmp = Float64(a * b); elseif (Float64(c * i) <= 4.5e+92) tmp = Float64(x * y); 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 ((c * i) <= -9e+184) tmp = c * i; elseif ((c * i) <= -4e-49) tmp = x * y; elseif ((c * i) <= 1.06e-60) tmp = a * b; elseif ((c * i) <= 4.5e+92) tmp = x * y; else tmp = c * i; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[N[(c * i), $MachinePrecision], -9e+184], N[(c * i), $MachinePrecision], If[LessEqual[N[(c * i), $MachinePrecision], -4e-49], N[(x * y), $MachinePrecision], If[LessEqual[N[(c * i), $MachinePrecision], 1.06e-60], N[(a * b), $MachinePrecision], If[LessEqual[N[(c * i), $MachinePrecision], 4.5e+92], N[(x * y), $MachinePrecision], N[(c * i), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \cdot i \leq -9 \cdot 10^{+184}:\\
\;\;\;\;c \cdot i\\
\mathbf{elif}\;c \cdot i \leq -4 \cdot 10^{-49}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;c \cdot i \leq 1.06 \cdot 10^{-60}:\\
\;\;\;\;a \cdot b\\
\mathbf{elif}\;c \cdot i \leq 4.5 \cdot 10^{+92}:\\
\;\;\;\;x \cdot y\\
\mathbf{else}:\\
\;\;\;\;c \cdot i\\
\end{array}
\end{array}
if (*.f64 c i) < -9.00000000000000072e184 or 4.4999999999999999e92 < (*.f64 c i) Initial program 89.2%
Taylor expanded in c around inf 75.0%
if -9.00000000000000072e184 < (*.f64 c i) < -3.99999999999999975e-49 or 1.06e-60 < (*.f64 c i) < 4.4999999999999999e92Initial program 93.3%
Taylor expanded in z around 0 71.8%
Taylor expanded in x around inf 46.7%
if -3.99999999999999975e-49 < (*.f64 c i) < 1.06e-60Initial program 94.3%
Taylor expanded in z around 0 65.3%
Taylor expanded in a around inf 38.0%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= (* z t) -4e+99) (not (<= (* z t) 1e+105))) (+ (* c i) (+ (* a b) (* z t))) (+ (* c i) (+ (* a b) (* x y)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (((z * t) <= -4e+99) || !((z * t) <= 1e+105)) {
tmp = (c * i) + ((a * b) + (z * t));
} else {
tmp = (c * i) + ((a * b) + (x * y));
}
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 (((z * t) <= (-4d+99)) .or. (.not. ((z * t) <= 1d+105))) then
tmp = (c * i) + ((a * b) + (z * t))
else
tmp = (c * i) + ((a * b) + (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 i) {
double tmp;
if (((z * t) <= -4e+99) || !((z * t) <= 1e+105)) {
tmp = (c * i) + ((a * b) + (z * t));
} else {
tmp = (c * i) + ((a * b) + (x * y));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if ((z * t) <= -4e+99) or not ((z * t) <= 1e+105): tmp = (c * i) + ((a * b) + (z * t)) else: tmp = (c * i) + ((a * b) + (x * y)) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((Float64(z * t) <= -4e+99) || !(Float64(z * t) <= 1e+105)) tmp = Float64(Float64(c * i) + Float64(Float64(a * b) + Float64(z * t))); else tmp = Float64(Float64(c * i) + Float64(Float64(a * b) + Float64(x * y))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if (((z * t) <= -4e+99) || ~(((z * t) <= 1e+105))) tmp = (c * i) + ((a * b) + (z * t)); else tmp = (c * i) + ((a * b) + (x * y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[N[(z * t), $MachinePrecision], -4e+99], N[Not[LessEqual[N[(z * t), $MachinePrecision], 1e+105]], $MachinePrecision]], N[(N[(c * i), $MachinePrecision] + N[(N[(a * b), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(c * i), $MachinePrecision] + N[(N[(a * b), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \cdot t \leq -4 \cdot 10^{+99} \lor \neg \left(z \cdot t \leq 10^{+105}\right):\\
\;\;\;\;c \cdot i + \left(a \cdot b + z \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;c \cdot i + \left(a \cdot b + x \cdot y\right)\\
\end{array}
\end{array}
if (*.f64 z t) < -3.9999999999999999e99 or 9.9999999999999994e104 < (*.f64 z t) Initial program 88.5%
Taylor expanded in x around 0 84.8%
if -3.9999999999999999e99 < (*.f64 z t) < 9.9999999999999994e104Initial program 94.1%
Taylor expanded in z around 0 91.8%
Final simplification89.4%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= (* x y) -8.2e+176) (not (<= (* x y) 4.2e+121))) (+ (* x y) (* c i)) (+ (* c i) (+ (* 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 (((x * y) <= -8.2e+176) || !((x * y) <= 4.2e+121)) {
tmp = (x * y) + (c * i);
} else {
tmp = (c * i) + ((a * b) + (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 (((x * y) <= (-8.2d+176)) .or. (.not. ((x * y) <= 4.2d+121))) then
tmp = (x * y) + (c * i)
else
tmp = (c * i) + ((a * b) + (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 (((x * y) <= -8.2e+176) || !((x * y) <= 4.2e+121)) {
tmp = (x * y) + (c * i);
} else {
tmp = (c * i) + ((a * b) + (z * t));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if ((x * y) <= -8.2e+176) or not ((x * y) <= 4.2e+121): tmp = (x * y) + (c * i) else: tmp = (c * i) + ((a * b) + (z * t)) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((Float64(x * y) <= -8.2e+176) || !(Float64(x * y) <= 4.2e+121)) tmp = Float64(Float64(x * y) + Float64(c * i)); else tmp = Float64(Float64(c * i) + Float64(Float64(a * b) + Float64(z * t))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if (((x * y) <= -8.2e+176) || ~(((x * y) <= 4.2e+121))) tmp = (x * y) + (c * i); else tmp = (c * i) + ((a * b) + (z * t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[N[(x * y), $MachinePrecision], -8.2e+176], N[Not[LessEqual[N[(x * y), $MachinePrecision], 4.2e+121]], $MachinePrecision]], N[(N[(x * y), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision], N[(N[(c * i), $MachinePrecision] + N[(N[(a * b), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -8.2 \cdot 10^{+176} \lor \neg \left(x \cdot y \leq 4.2 \cdot 10^{+121}\right):\\
\;\;\;\;x \cdot y + c \cdot i\\
\mathbf{else}:\\
\;\;\;\;c \cdot i + \left(a \cdot b + z \cdot t\right)\\
\end{array}
\end{array}
if (*.f64 x y) < -8.1999999999999998e176 or 4.2000000000000003e121 < (*.f64 x y) Initial program 85.5%
Taylor expanded in x around inf 82.5%
if -8.1999999999999998e176 < (*.f64 x y) < 4.2000000000000003e121Initial program 95.3%
Taylor expanded in x around 0 89.3%
Final simplification87.1%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ (* x y) (* c i))))
(if (<= y -8e-77)
t_1
(if (<= y 7e-84)
(+ (* a b) (* c i))
(if (<= y 9.8e+60) (+ (* a b) (* z t)) 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) + (c * i);
double tmp;
if (y <= -8e-77) {
tmp = t_1;
} else if (y <= 7e-84) {
tmp = (a * b) + (c * i);
} else if (y <= 9.8e+60) {
tmp = (a * b) + (z * t);
} 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 = (x * y) + (c * i)
if (y <= (-8d-77)) then
tmp = t_1
else if (y <= 7d-84) then
tmp = (a * b) + (c * i)
else if (y <= 9.8d+60) then
tmp = (a * b) + (z * t)
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 = (x * y) + (c * i);
double tmp;
if (y <= -8e-77) {
tmp = t_1;
} else if (y <= 7e-84) {
tmp = (a * b) + (c * i);
} else if (y <= 9.8e+60) {
tmp = (a * b) + (z * t);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = (x * y) + (c * i) tmp = 0 if y <= -8e-77: tmp = t_1 elif y <= 7e-84: tmp = (a * b) + (c * i) elif y <= 9.8e+60: tmp = (a * b) + (z * t) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(x * y) + Float64(c * i)) tmp = 0.0 if (y <= -8e-77) tmp = t_1; elseif (y <= 7e-84) tmp = Float64(Float64(a * b) + Float64(c * i)); elseif (y <= 9.8e+60) tmp = Float64(Float64(a * b) + Float64(z * t)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = (x * y) + (c * i); tmp = 0.0; if (y <= -8e-77) tmp = t_1; elseif (y <= 7e-84) tmp = (a * b) + (c * i); elseif (y <= 9.8e+60) tmp = (a * b) + (z * t); else tmp = 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[(c * i), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -8e-77], t$95$1, If[LessEqual[y, 7e-84], N[(N[(a * b), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 9.8e+60], N[(N[(a * b), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot y + c \cdot i\\
\mathbf{if}\;y \leq -8 \cdot 10^{-77}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 7 \cdot 10^{-84}:\\
\;\;\;\;a \cdot b + c \cdot i\\
\mathbf{elif}\;y \leq 9.8 \cdot 10^{+60}:\\
\;\;\;\;a \cdot b + z \cdot t\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -7.9999999999999994e-77 or 9.8000000000000005e60 < y Initial program 90.2%
Taylor expanded in x around inf 65.2%
if -7.9999999999999994e-77 < y < 7.0000000000000002e-84Initial program 96.5%
Taylor expanded in a around inf 70.1%
if 7.0000000000000002e-84 < y < 9.8000000000000005e60Initial program 88.9%
Taylor expanded in x around 0 70.7%
Taylor expanded in c around 0 56.3%
Final simplification65.9%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= (* a b) -2.25e+113) (not (<= (* a b) 4.9e+163))) (* 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.25e+113) || !((a * b) <= 4.9e+163)) {
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.25d+113)) .or. (.not. ((a * b) <= 4.9d+163))) 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.25e+113) || !((a * b) <= 4.9e+163)) {
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.25e+113) or not ((a * b) <= 4.9e+163): 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.25e+113) || !(Float64(a * b) <= 4.9e+163)) 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.25e+113) || ~(((a * b) <= 4.9e+163))) 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.25e+113], N[Not[LessEqual[N[(a * b), $MachinePrecision], 4.9e+163]], $MachinePrecision]], N[(a * b), $MachinePrecision], N[(c * i), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \cdot b \leq -2.25 \cdot 10^{+113} \lor \neg \left(a \cdot b \leq 4.9 \cdot 10^{+163}\right):\\
\;\;\;\;a \cdot b\\
\mathbf{else}:\\
\;\;\;\;c \cdot i\\
\end{array}
\end{array}
if (*.f64 a b) < -2.25e113 or 4.9e163 < (*.f64 a b) Initial program 81.9%
Taylor expanded in z around 0 83.7%
Taylor expanded in a around inf 72.9%
if -2.25e113 < (*.f64 a b) < 4.9e163Initial program 96.2%
Taylor expanded in c around inf 41.3%
Final simplification50.2%
(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 92.2%
Taylor expanded in z around 0 76.5%
Taylor expanded in a around inf 26.3%
herbie shell --seed 2024103
(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)))