
(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 (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 96.9%
+-commutative96.9%
fma-define98.0%
+-commutative98.0%
fma-define98.8%
fma-define99.6%
Simplified99.6%
(FPCore (x y z t a b c i) :precision binary64 (+ (fma 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 fma(x, y, (z * t)) + ((a * b) + (c * i));
}
function code(x, y, z, t, a, b, c, i) return Float64(fma(x, y, Float64(z * t)) + Float64(Float64(a * b) + Float64(c * i))) end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(N[(x * y + N[(z * t), $MachinePrecision]), $MachinePrecision] + N[(N[(a * b), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(x, y, z \cdot t\right) + \left(a \cdot b + c \cdot i\right)
\end{array}
Initial program 96.9%
associate-+l+96.9%
fma-define97.6%
Simplified97.6%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ (* x y) (* z t))) (t_2 (+ (* a b) (* c i))))
(if (<= (* a b) -7.8e+61)
t_2
(if (<= (* a b) -1.07e-215)
(+ (* c i) (* x y))
(if (<= (* a b) 3.5e-307)
t_1
(if (<= (* a b) 1.4e-60)
(+ (* c i) (* z t))
(if (<= (* a b) 3.4e+78) 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 = (x * y) + (z * t);
double t_2 = (a * b) + (c * i);
double tmp;
if ((a * b) <= -7.8e+61) {
tmp = t_2;
} else if ((a * b) <= -1.07e-215) {
tmp = (c * i) + (x * y);
} else if ((a * b) <= 3.5e-307) {
tmp = t_1;
} else if ((a * b) <= 1.4e-60) {
tmp = (c * i) + (z * t);
} else if ((a * b) <= 3.4e+78) {
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 = (x * y) + (z * t)
t_2 = (a * b) + (c * i)
if ((a * b) <= (-7.8d+61)) then
tmp = t_2
else if ((a * b) <= (-1.07d-215)) then
tmp = (c * i) + (x * y)
else if ((a * b) <= 3.5d-307) then
tmp = t_1
else if ((a * b) <= 1.4d-60) then
tmp = (c * i) + (z * t)
else if ((a * b) <= 3.4d+78) 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 = (x * y) + (z * t);
double t_2 = (a * b) + (c * i);
double tmp;
if ((a * b) <= -7.8e+61) {
tmp = t_2;
} else if ((a * b) <= -1.07e-215) {
tmp = (c * i) + (x * y);
} else if ((a * b) <= 3.5e-307) {
tmp = t_1;
} else if ((a * b) <= 1.4e-60) {
tmp = (c * i) + (z * t);
} else if ((a * b) <= 3.4e+78) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = (x * y) + (z * t) t_2 = (a * b) + (c * i) tmp = 0 if (a * b) <= -7.8e+61: tmp = t_2 elif (a * b) <= -1.07e-215: tmp = (c * i) + (x * y) elif (a * b) <= 3.5e-307: tmp = t_1 elif (a * b) <= 1.4e-60: tmp = (c * i) + (z * t) elif (a * b) <= 3.4e+78: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(x * y) + Float64(z * t)) t_2 = Float64(Float64(a * b) + Float64(c * i)) tmp = 0.0 if (Float64(a * b) <= -7.8e+61) tmp = t_2; elseif (Float64(a * b) <= -1.07e-215) tmp = Float64(Float64(c * i) + Float64(x * y)); elseif (Float64(a * b) <= 3.5e-307) tmp = t_1; elseif (Float64(a * b) <= 1.4e-60) tmp = Float64(Float64(c * i) + Float64(z * t)); elseif (Float64(a * b) <= 3.4e+78) 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 = (x * y) + (z * t); t_2 = (a * b) + (c * i); tmp = 0.0; if ((a * b) <= -7.8e+61) tmp = t_2; elseif ((a * b) <= -1.07e-215) tmp = (c * i) + (x * y); elseif ((a * b) <= 3.5e-307) tmp = t_1; elseif ((a * b) <= 1.4e-60) tmp = (c * i) + (z * t); elseif ((a * b) <= 3.4e+78) 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[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(a * b), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(a * b), $MachinePrecision], -7.8e+61], t$95$2, If[LessEqual[N[(a * b), $MachinePrecision], -1.07e-215], N[(N[(c * i), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 3.5e-307], t$95$1, If[LessEqual[N[(a * b), $MachinePrecision], 1.4e-60], N[(N[(c * i), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 3.4e+78], t$95$1, t$95$2]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot y + z \cdot t\\
t_2 := a \cdot b + c \cdot i\\
\mathbf{if}\;a \cdot b \leq -7.8 \cdot 10^{+61}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;a \cdot b \leq -1.07 \cdot 10^{-215}:\\
\;\;\;\;c \cdot i + x \cdot y\\
\mathbf{elif}\;a \cdot b \leq 3.5 \cdot 10^{-307}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \cdot b \leq 1.4 \cdot 10^{-60}:\\
\;\;\;\;c \cdot i + z \cdot t\\
\mathbf{elif}\;a \cdot b \leq 3.4 \cdot 10^{+78}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if (*.f64 a b) < -7.79999999999999975e61 or 3.40000000000000007e78 < (*.f64 a b) Initial program 95.0%
Taylor expanded in x around 0 84.8%
Taylor expanded in t around 0 72.6%
if -7.79999999999999975e61 < (*.f64 a b) < -1.07000000000000003e-215Initial program 100.0%
Taylor expanded in a around 0 94.9%
Taylor expanded in t around 0 72.3%
if -1.07000000000000003e-215 < (*.f64 a b) < 3.5000000000000002e-307 or 1.4000000000000001e-60 < (*.f64 a b) < 3.40000000000000007e78Initial program 95.3%
Taylor expanded in a around 0 86.5%
Taylor expanded in c around 0 79.0%
if 3.5000000000000002e-307 < (*.f64 a b) < 1.4000000000000001e-60Initial program 100.0%
Taylor expanded in x around 0 92.0%
Taylor expanded in a around 0 89.4%
Final simplification76.5%
(FPCore (x y z t a b c i)
:precision binary64
(if (<= (* a b) -1e+64)
(+ (* a b) (* c i))
(if (<= (* a b) -5e-215)
(+ (* c i) (* x y))
(if (<= (* a b) 0.0)
(+ (* x y) (* z t))
(if (<= (* a b) 1e-45)
(+ (* c i) (* z t))
(* a (+ b (/ (* x y) a))))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((a * b) <= -1e+64) {
tmp = (a * b) + (c * i);
} else if ((a * b) <= -5e-215) {
tmp = (c * i) + (x * y);
} else if ((a * b) <= 0.0) {
tmp = (x * y) + (z * t);
} else if ((a * b) <= 1e-45) {
tmp = (c * i) + (z * t);
} else {
tmp = a * (b + ((x * y) / a));
}
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) <= (-1d+64)) then
tmp = (a * b) + (c * i)
else if ((a * b) <= (-5d-215)) then
tmp = (c * i) + (x * y)
else if ((a * b) <= 0.0d0) then
tmp = (x * y) + (z * t)
else if ((a * b) <= 1d-45) then
tmp = (c * i) + (z * t)
else
tmp = a * (b + ((x * y) / a))
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) <= -1e+64) {
tmp = (a * b) + (c * i);
} else if ((a * b) <= -5e-215) {
tmp = (c * i) + (x * y);
} else if ((a * b) <= 0.0) {
tmp = (x * y) + (z * t);
} else if ((a * b) <= 1e-45) {
tmp = (c * i) + (z * t);
} else {
tmp = a * (b + ((x * y) / a));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (a * b) <= -1e+64: tmp = (a * b) + (c * i) elif (a * b) <= -5e-215: tmp = (c * i) + (x * y) elif (a * b) <= 0.0: tmp = (x * y) + (z * t) elif (a * b) <= 1e-45: tmp = (c * i) + (z * t) else: tmp = a * (b + ((x * y) / a)) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (Float64(a * b) <= -1e+64) tmp = Float64(Float64(a * b) + Float64(c * i)); elseif (Float64(a * b) <= -5e-215) tmp = Float64(Float64(c * i) + Float64(x * y)); elseif (Float64(a * b) <= 0.0) tmp = Float64(Float64(x * y) + Float64(z * t)); elseif (Float64(a * b) <= 1e-45) tmp = Float64(Float64(c * i) + Float64(z * t)); else tmp = Float64(a * Float64(b + Float64(Float64(x * y) / a))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if ((a * b) <= -1e+64) tmp = (a * b) + (c * i); elseif ((a * b) <= -5e-215) tmp = (c * i) + (x * y); elseif ((a * b) <= 0.0) tmp = (x * y) + (z * t); elseif ((a * b) <= 1e-45) tmp = (c * i) + (z * t); else tmp = a * (b + ((x * y) / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[N[(a * b), $MachinePrecision], -1e+64], N[(N[(a * b), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], -5e-215], N[(N[(c * i), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 0.0], N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 1e-45], N[(N[(c * i), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision], N[(a * N[(b + N[(N[(x * y), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \cdot b \leq -1 \cdot 10^{+64}:\\
\;\;\;\;a \cdot b + c \cdot i\\
\mathbf{elif}\;a \cdot b \leq -5 \cdot 10^{-215}:\\
\;\;\;\;c \cdot i + x \cdot y\\
\mathbf{elif}\;a \cdot b \leq 0:\\
\;\;\;\;x \cdot y + z \cdot t\\
\mathbf{elif}\;a \cdot b \leq 10^{-45}:\\
\;\;\;\;c \cdot i + z \cdot t\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(b + \frac{x \cdot y}{a}\right)\\
\end{array}
\end{array}
if (*.f64 a b) < -1.00000000000000002e64Initial program 93.6%
Taylor expanded in x around 0 86.5%
Taylor expanded in t around 0 72.4%
if -1.00000000000000002e64 < (*.f64 a b) < -4.99999999999999956e-215Initial program 100.0%
Taylor expanded in a around 0 94.9%
Taylor expanded in t around 0 72.3%
if -4.99999999999999956e-215 < (*.f64 a b) < 0.0Initial program 93.2%
Taylor expanded in a around 0 93.2%
Taylor expanded in c around 0 82.2%
if 0.0 < (*.f64 a b) < 9.99999999999999984e-46Initial program 100.0%
Taylor expanded in x around 0 90.3%
Taylor expanded in a around 0 87.9%
if 9.99999999999999984e-46 < (*.f64 a b) Initial program 97.1%
Taylor expanded in c around 0 90.1%
Taylor expanded in a around inf 86.3%
Taylor expanded in t around 0 75.2%
Final simplification77.2%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ (* a b) (* c i))))
(if (<= (* x y) -1.12e+138)
(* x y)
(if (<= (* x y) 8.5e-182)
t_1
(if (<= (* x y) 3.1e-52)
(* z t)
(if (<= (* x y) 5.8e+100) t_1 (* x y)))))))
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.12e+138) {
tmp = x * y;
} else if ((x * y) <= 8.5e-182) {
tmp = t_1;
} else if ((x * y) <= 3.1e-52) {
tmp = z * t;
} else if ((x * y) <= 5.8e+100) {
tmp = t_1;
} else {
tmp = 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) :: t_1
real(8) :: tmp
t_1 = (a * b) + (c * i)
if ((x * y) <= (-1.12d+138)) then
tmp = x * y
else if ((x * y) <= 8.5d-182) then
tmp = t_1
else if ((x * y) <= 3.1d-52) then
tmp = z * t
else if ((x * y) <= 5.8d+100) then
tmp = t_1
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 i) {
double t_1 = (a * b) + (c * i);
double tmp;
if ((x * y) <= -1.12e+138) {
tmp = x * y;
} else if ((x * y) <= 8.5e-182) {
tmp = t_1;
} else if ((x * y) <= 3.1e-52) {
tmp = z * t;
} else if ((x * y) <= 5.8e+100) {
tmp = t_1;
} else {
tmp = x * y;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = (a * b) + (c * i) tmp = 0 if (x * y) <= -1.12e+138: tmp = x * y elif (x * y) <= 8.5e-182: tmp = t_1 elif (x * y) <= 3.1e-52: tmp = z * t elif (x * y) <= 5.8e+100: tmp = t_1 else: tmp = x * y 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.12e+138) tmp = Float64(x * y); elseif (Float64(x * y) <= 8.5e-182) tmp = t_1; elseif (Float64(x * y) <= 3.1e-52) tmp = Float64(z * t); elseif (Float64(x * y) <= 5.8e+100) tmp = t_1; else tmp = Float64(x * y); 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.12e+138) tmp = x * y; elseif ((x * y) <= 8.5e-182) tmp = t_1; elseif ((x * y) <= 3.1e-52) tmp = z * t; elseif ((x * y) <= 5.8e+100) tmp = t_1; else tmp = x * y; 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.12e+138], N[(x * y), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 8.5e-182], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 3.1e-52], N[(z * t), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 5.8e+100], t$95$1, N[(x * y), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot b + c \cdot i\\
\mathbf{if}\;x \cdot y \leq -1.12 \cdot 10^{+138}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;x \cdot y \leq 8.5 \cdot 10^{-182}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \cdot y \leq 3.1 \cdot 10^{-52}:\\
\;\;\;\;z \cdot t\\
\mathbf{elif}\;x \cdot y \leq 5.8 \cdot 10^{+100}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}
\end{array}
if (*.f64 x y) < -1.12e138 or 5.8000000000000001e100 < (*.f64 x y) Initial program 93.3%
Taylor expanded in a around 0 80.6%
Taylor expanded in x around inf 62.5%
if -1.12e138 < (*.f64 x y) < 8.5000000000000001e-182 or 3.0999999999999999e-52 < (*.f64 x y) < 5.8000000000000001e100Initial program 98.8%
Taylor expanded in x around 0 91.5%
Taylor expanded in t around 0 64.9%
if 8.5000000000000001e-182 < (*.f64 x y) < 3.0999999999999999e-52Initial program 94.4%
Taylor expanded in a around 0 59.5%
Taylor expanded in t around inf 60.0%
Final simplification63.9%
(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 (* a (+ b (+ (/ (* z t) a) (/ (* x y) a)))))))
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 = a * (b + (((z * t) / a) + ((x * y) / a)));
}
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 = a * (b + (((z * t) / a) + ((x * y) / a)));
}
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 = a * (b + (((z * t) / a) + ((x * y) / a))) 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(a * Float64(b + Float64(Float64(Float64(z * t) / a) + Float64(Float64(x * y) / a)))); 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 = a * (b + (((z * t) / a) + ((x * y) / a))); 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[(a * N[(b + N[(N[(N[(z * t), $MachinePrecision] / a), $MachinePrecision] + N[(N[(x * y), $MachinePrecision] / a), $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}:\\
\;\;\;\;a \cdot \left(b + \left(\frac{z \cdot t}{a} + \frac{x \cdot y}{a}\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 c around 0 37.5%
Taylor expanded in a around inf 62.5%
Final simplification98.8%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ (* a b) (* c i))))
(if (<= (* a b) -3.7e+61)
t_1
(if (<= (* a b) -5e-300)
(+ (* c i) (* x y))
(if (<= (* a b) 3.8e+64) (+ (* c i) (* 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 = (a * b) + (c * i);
double tmp;
if ((a * b) <= -3.7e+61) {
tmp = t_1;
} else if ((a * b) <= -5e-300) {
tmp = (c * i) + (x * y);
} else if ((a * b) <= 3.8e+64) {
tmp = (c * i) + (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 = (a * b) + (c * i)
if ((a * b) <= (-3.7d+61)) then
tmp = t_1
else if ((a * b) <= (-5d-300)) then
tmp = (c * i) + (x * y)
else if ((a * b) <= 3.8d+64) then
tmp = (c * i) + (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 = (a * b) + (c * i);
double tmp;
if ((a * b) <= -3.7e+61) {
tmp = t_1;
} else if ((a * b) <= -5e-300) {
tmp = (c * i) + (x * y);
} else if ((a * b) <= 3.8e+64) {
tmp = (c * i) + (z * t);
} 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 (a * b) <= -3.7e+61: tmp = t_1 elif (a * b) <= -5e-300: tmp = (c * i) + (x * y) elif (a * b) <= 3.8e+64: tmp = (c * i) + (z * t) 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(a * b) <= -3.7e+61) tmp = t_1; elseif (Float64(a * b) <= -5e-300) tmp = Float64(Float64(c * i) + Float64(x * y)); elseif (Float64(a * b) <= 3.8e+64) tmp = Float64(Float64(c * i) + 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 = (a * b) + (c * i); tmp = 0.0; if ((a * b) <= -3.7e+61) tmp = t_1; elseif ((a * b) <= -5e-300) tmp = (c * i) + (x * y); elseif ((a * b) <= 3.8e+64) tmp = (c * i) + (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[(a * b), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(a * b), $MachinePrecision], -3.7e+61], t$95$1, If[LessEqual[N[(a * b), $MachinePrecision], -5e-300], N[(N[(c * i), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 3.8e+64], N[(N[(c * i), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot b + c \cdot i\\
\mathbf{if}\;a \cdot b \leq -3.7 \cdot 10^{+61}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \cdot b \leq -5 \cdot 10^{-300}:\\
\;\;\;\;c \cdot i + x \cdot y\\
\mathbf{elif}\;a \cdot b \leq 3.8 \cdot 10^{+64}:\\
\;\;\;\;c \cdot i + z \cdot t\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (*.f64 a b) < -3.70000000000000003e61 or 3.8000000000000001e64 < (*.f64 a b) Initial program 95.1%
Taylor expanded in x around 0 84.2%
Taylor expanded in t around 0 72.2%
if -3.70000000000000003e61 < (*.f64 a b) < -4.99999999999999996e-300Initial program 100.0%
Taylor expanded in a around 0 95.5%
Taylor expanded in t around 0 72.6%
if -4.99999999999999996e-300 < (*.f64 a b) < 3.8000000000000001e64Initial program 96.7%
Taylor expanded in x around 0 77.4%
Taylor expanded in a around 0 71.4%
Final simplification72.0%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= (* c i) -1.55e+113) (not (<= (* c i) 5.5e+34))) (+ (* c i) (+ (* a b) (* z t))) (+ (* a b) (+ (* 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 (((c * i) <= -1.55e+113) || !((c * i) <= 5.5e+34)) {
tmp = (c * i) + ((a * b) + (z * t));
} else {
tmp = (a * b) + ((x * y) + (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 (((c * i) <= (-1.55d+113)) .or. (.not. ((c * i) <= 5.5d+34))) then
tmp = (c * i) + ((a * b) + (z * t))
else
tmp = (a * b) + ((x * y) + (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 (((c * i) <= -1.55e+113) || !((c * i) <= 5.5e+34)) {
tmp = (c * i) + ((a * b) + (z * t));
} else {
tmp = (a * b) + ((x * y) + (z * t));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if ((c * i) <= -1.55e+113) or not ((c * i) <= 5.5e+34): tmp = (c * i) + ((a * b) + (z * t)) else: tmp = (a * b) + ((x * y) + (z * t)) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((Float64(c * i) <= -1.55e+113) || !(Float64(c * i) <= 5.5e+34)) tmp = Float64(Float64(c * i) + Float64(Float64(a * b) + Float64(z * t))); else tmp = Float64(Float64(a * b) + Float64(Float64(x * y) + Float64(z * t))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if (((c * i) <= -1.55e+113) || ~(((c * i) <= 5.5e+34))) tmp = (c * i) + ((a * b) + (z * t)); else tmp = (a * b) + ((x * y) + (z * t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[N[(c * i), $MachinePrecision], -1.55e+113], N[Not[LessEqual[N[(c * i), $MachinePrecision], 5.5e+34]], $MachinePrecision]], N[(N[(c * i), $MachinePrecision] + N[(N[(a * b), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(a * b), $MachinePrecision] + N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \cdot i \leq -1.55 \cdot 10^{+113} \lor \neg \left(c \cdot i \leq 5.5 \cdot 10^{+34}\right):\\
\;\;\;\;c \cdot i + \left(a \cdot b + z \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;a \cdot b + \left(x \cdot y + z \cdot t\right)\\
\end{array}
\end{array}
if (*.f64 c i) < -1.54999999999999996e113 or 5.4999999999999996e34 < (*.f64 c i) Initial program 94.5%
Taylor expanded in x around 0 88.5%
if -1.54999999999999996e113 < (*.f64 c i) < 5.4999999999999996e34Initial program 98.2%
Taylor expanded in c around 0 95.2%
Final simplification92.8%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ (* x y) (* z t))))
(if (or (<= (* c i) -1.55e+113) (not (<= (* c i) 8e+53)))
(+ (* 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 (((c * i) <= -1.55e+113) || !((c * i) <= 8e+53)) {
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 (((c * i) <= (-1.55d+113)) .or. (.not. ((c * i) <= 8d+53))) 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 (((c * i) <= -1.55e+113) || !((c * i) <= 8e+53)) {
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 ((c * i) <= -1.55e+113) or not ((c * i) <= 8e+53): 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(c * i) <= -1.55e+113) || !(Float64(c * i) <= 8e+53)) 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 (((c * i) <= -1.55e+113) || ~(((c * i) <= 8e+53))) 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[Or[LessEqual[N[(c * i), $MachinePrecision], -1.55e+113], N[Not[LessEqual[N[(c * i), $MachinePrecision], 8e+53]], $MachinePrecision]], 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}\;c \cdot i \leq -1.55 \cdot 10^{+113} \lor \neg \left(c \cdot i \leq 8 \cdot 10^{+53}\right):\\
\;\;\;\;c \cdot i + t\_1\\
\mathbf{else}:\\
\;\;\;\;a \cdot b + t\_1\\
\end{array}
\end{array}
if (*.f64 c i) < -1.54999999999999996e113 or 7.9999999999999999e53 < (*.f64 c i) Initial program 94.4%
Taylor expanded in a around 0 85.5%
if -1.54999999999999996e113 < (*.f64 c i) < 7.9999999999999999e53Initial program 98.2%
Taylor expanded in c around 0 95.2%
Final simplification91.8%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= (* c i) -3.95e+114) (not (<= (* c i) 1.26e+54))) (+ (* c i) (* z t)) (+ (* a b) (+ (* 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 (((c * i) <= -3.95e+114) || !((c * i) <= 1.26e+54)) {
tmp = (c * i) + (z * t);
} else {
tmp = (a * b) + ((x * y) + (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 (((c * i) <= (-3.95d+114)) .or. (.not. ((c * i) <= 1.26d+54))) then
tmp = (c * i) + (z * t)
else
tmp = (a * b) + ((x * y) + (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 (((c * i) <= -3.95e+114) || !((c * i) <= 1.26e+54)) {
tmp = (c * i) + (z * t);
} else {
tmp = (a * b) + ((x * y) + (z * t));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if ((c * i) <= -3.95e+114) or not ((c * i) <= 1.26e+54): tmp = (c * i) + (z * t) else: tmp = (a * b) + ((x * y) + (z * t)) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((Float64(c * i) <= -3.95e+114) || !(Float64(c * i) <= 1.26e+54)) tmp = Float64(Float64(c * i) + Float64(z * t)); else tmp = Float64(Float64(a * b) + Float64(Float64(x * y) + Float64(z * t))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if (((c * i) <= -3.95e+114) || ~(((c * i) <= 1.26e+54))) tmp = (c * i) + (z * t); else tmp = (a * b) + ((x * y) + (z * t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[N[(c * i), $MachinePrecision], -3.95e+114], N[Not[LessEqual[N[(c * i), $MachinePrecision], 1.26e+54]], $MachinePrecision]], N[(N[(c * i), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision], N[(N[(a * b), $MachinePrecision] + N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \cdot i \leq -3.95 \cdot 10^{+114} \lor \neg \left(c \cdot i \leq 1.26 \cdot 10^{+54}\right):\\
\;\;\;\;c \cdot i + z \cdot t\\
\mathbf{else}:\\
\;\;\;\;a \cdot b + \left(x \cdot y + z \cdot t\right)\\
\end{array}
\end{array}
if (*.f64 c i) < -3.9500000000000001e114 or 1.25999999999999995e54 < (*.f64 c i) Initial program 94.4%
Taylor expanded in x around 0 88.2%
Taylor expanded in a around 0 78.2%
if -3.9500000000000001e114 < (*.f64 c i) < 1.25999999999999995e54Initial program 98.2%
Taylor expanded in c around 0 95.2%
Final simplification89.3%
(FPCore (x y z t a b c i)
:precision binary64
(if (<= (* a b) -2.6e+109)
(* a b)
(if (<= (* a b) -3e-254)
(* c i)
(if (<= (* a b) 2.5e+69) (* z t) (* a b)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((a * b) <= -2.6e+109) {
tmp = a * b;
} else if ((a * b) <= -3e-254) {
tmp = c * i;
} else if ((a * b) <= 2.5e+69) {
tmp = z * t;
} else {
tmp = a * b;
}
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.6d+109)) then
tmp = a * b
else if ((a * b) <= (-3d-254)) then
tmp = c * i
else if ((a * b) <= 2.5d+69) then
tmp = z * t
else
tmp = a * b
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.6e+109) {
tmp = a * b;
} else if ((a * b) <= -3e-254) {
tmp = c * i;
} else if ((a * b) <= 2.5e+69) {
tmp = z * t;
} else {
tmp = a * b;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (a * b) <= -2.6e+109: tmp = a * b elif (a * b) <= -3e-254: tmp = c * i elif (a * b) <= 2.5e+69: tmp = z * t else: tmp = a * b return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (Float64(a * b) <= -2.6e+109) tmp = Float64(a * b); elseif (Float64(a * b) <= -3e-254) tmp = Float64(c * i); elseif (Float64(a * b) <= 2.5e+69) tmp = Float64(z * t); else tmp = Float64(a * b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if ((a * b) <= -2.6e+109) tmp = a * b; elseif ((a * b) <= -3e-254) tmp = c * i; elseif ((a * b) <= 2.5e+69) tmp = z * t; else tmp = a * b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[N[(a * b), $MachinePrecision], -2.6e+109], N[(a * b), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], -3e-254], N[(c * i), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 2.5e+69], N[(z * t), $MachinePrecision], N[(a * b), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \cdot b \leq -2.6 \cdot 10^{+109}:\\
\;\;\;\;a \cdot b\\
\mathbf{elif}\;a \cdot b \leq -3 \cdot 10^{-254}:\\
\;\;\;\;c \cdot i\\
\mathbf{elif}\;a \cdot b \leq 2.5 \cdot 10^{+69}:\\
\;\;\;\;z \cdot t\\
\mathbf{else}:\\
\;\;\;\;a \cdot b\\
\end{array}
\end{array}
if (*.f64 a b) < -2.5999999999999998e109 or 2.50000000000000018e69 < (*.f64 a b) Initial program 95.7%
Taylor expanded in a around inf 62.5%
if -2.5999999999999998e109 < (*.f64 a b) < -3.00000000000000012e-254Initial program 98.4%
Taylor expanded in c around inf 41.7%
if -3.00000000000000012e-254 < (*.f64 a b) < 2.50000000000000018e69Initial program 96.9%
Taylor expanded in a around 0 91.1%
Taylor expanded in t around inf 47.2%
Final simplification51.4%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= (* a b) -1.4e+68) (not (<= (* a b) 1.5e+69))) (+ (* a b) (* c i)) (+ (* c i) (* z t))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (((a * b) <= -1.4e+68) || !((a * b) <= 1.5e+69)) {
tmp = (a * b) + (c * i);
} else {
tmp = (c * i) + (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 (((a * b) <= (-1.4d+68)) .or. (.not. ((a * b) <= 1.5d+69))) then
tmp = (a * b) + (c * i)
else
tmp = (c * i) + (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 (((a * b) <= -1.4e+68) || !((a * b) <= 1.5e+69)) {
tmp = (a * b) + (c * i);
} else {
tmp = (c * i) + (z * t);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if ((a * b) <= -1.4e+68) or not ((a * b) <= 1.5e+69): tmp = (a * b) + (c * i) else: tmp = (c * i) + (z * t) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((Float64(a * b) <= -1.4e+68) || !(Float64(a * b) <= 1.5e+69)) tmp = Float64(Float64(a * b) + Float64(c * i)); else tmp = Float64(Float64(c * i) + Float64(z * t)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if (((a * b) <= -1.4e+68) || ~(((a * b) <= 1.5e+69))) tmp = (a * b) + (c * i); else tmp = (c * i) + (z * t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[N[(a * b), $MachinePrecision], -1.4e+68], N[Not[LessEqual[N[(a * b), $MachinePrecision], 1.5e+69]], $MachinePrecision]], N[(N[(a * b), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision], N[(N[(c * i), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \cdot b \leq -1.4 \cdot 10^{+68} \lor \neg \left(a \cdot b \leq 1.5 \cdot 10^{+69}\right):\\
\;\;\;\;a \cdot b + c \cdot i\\
\mathbf{else}:\\
\;\;\;\;c \cdot i + z \cdot t\\
\end{array}
\end{array}
if (*.f64 a b) < -1.4e68 or 1.49999999999999992e69 < (*.f64 a b) Initial program 95.0%
Taylor expanded in x around 0 84.0%
Taylor expanded in t around 0 72.9%
if -1.4e68 < (*.f64 a b) < 1.49999999999999992e69Initial program 98.1%
Taylor expanded in x around 0 71.7%
Taylor expanded in a around 0 66.3%
Final simplification68.9%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= (* c i) -1.9e+112) (not (<= (* c i) 1.02e+49))) (* c i) (* a b)))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (((c * i) <= -1.9e+112) || !((c * i) <= 1.02e+49)) {
tmp = c * i;
} else {
tmp = a * b;
}
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.9d+112)) .or. (.not. ((c * i) <= 1.02d+49))) then
tmp = c * i
else
tmp = a * b
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.9e+112) || !((c * i) <= 1.02e+49)) {
tmp = c * i;
} else {
tmp = a * b;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if ((c * i) <= -1.9e+112) or not ((c * i) <= 1.02e+49): tmp = c * i else: tmp = a * b return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((Float64(c * i) <= -1.9e+112) || !(Float64(c * i) <= 1.02e+49)) tmp = Float64(c * i); else tmp = Float64(a * b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if (((c * i) <= -1.9e+112) || ~(((c * i) <= 1.02e+49))) tmp = c * i; else tmp = a * b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[N[(c * i), $MachinePrecision], -1.9e+112], N[Not[LessEqual[N[(c * i), $MachinePrecision], 1.02e+49]], $MachinePrecision]], N[(c * i), $MachinePrecision], N[(a * b), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \cdot i \leq -1.9 \cdot 10^{+112} \lor \neg \left(c \cdot i \leq 1.02 \cdot 10^{+49}\right):\\
\;\;\;\;c \cdot i\\
\mathbf{else}:\\
\;\;\;\;a \cdot b\\
\end{array}
\end{array}
if (*.f64 c i) < -1.90000000000000004e112 or 1.02e49 < (*.f64 c i) Initial program 94.5%
Taylor expanded in c around inf 60.2%
if -1.90000000000000004e112 < (*.f64 c i) < 1.02e49Initial program 98.2%
Taylor expanded in a around inf 36.2%
Final simplification44.8%
(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 96.9%
Taylor expanded in a around inf 28.3%
herbie shell --seed 2024110
(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)))