
(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 (fma x y (fma z t (fma 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, fma(z, t, fma(a, b, (c * i))));
}
function code(x, y, z, t, a, b, c, i) return fma(x, y, fma(z, t, fma(a, b, Float64(c * i)))) end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(x * y + N[(z * t + N[(a * b + N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(x, y, \mathsf{fma}\left(z, t, \mathsf{fma}\left(a, b, c \cdot i\right)\right)\right)
\end{array}
Initial program 98.0%
associate-+l+98.0%
associate-+l+98.0%
fma-def98.0%
fma-def98.4%
fma-def99.2%
Simplified99.2%
Final simplification99.2%
(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 98.0%
+-commutative98.0%
fma-def98.0%
associate-+l+98.0%
fma-def98.4%
fma-def98.8%
Simplified98.8%
Final simplification98.8%
(FPCore (x y z t a b c i)
:precision binary64
(if (<= (* a b) -2.3e+165)
(+ (* a b) (* x y))
(if (or (<= (* a b) -1.28e+67)
(not
(or (<= (* a b) -1.15e+21)
(and (not (<= (* a b) -4.6e-109))
(or (<= (* a b) 1.3e-77)
(and (not (<= (* a b) 1.7e+29))
(<= (* a b) 2.8e+210)))))))
(+ (* a b) (* z t))
(+ (* c i) (* x y)))))
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+165) {
tmp = (a * b) + (x * y);
} else if (((a * b) <= -1.28e+67) || !(((a * b) <= -1.15e+21) || (!((a * b) <= -4.6e-109) && (((a * b) <= 1.3e-77) || (!((a * b) <= 1.7e+29) && ((a * b) <= 2.8e+210)))))) {
tmp = (a * b) + (z * t);
} else {
tmp = (c * i) + (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 ((a * b) <= (-2.3d+165)) then
tmp = (a * b) + (x * y)
else if (((a * b) <= (-1.28d+67)) .or. (.not. ((a * b) <= (-1.15d+21)) .or. (.not. ((a * b) <= (-4.6d-109))) .and. ((a * b) <= 1.3d-77) .or. (.not. ((a * b) <= 1.7d+29)) .and. ((a * b) <= 2.8d+210))) then
tmp = (a * b) + (z * t)
else
tmp = (c * i) + (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 ((a * b) <= -2.3e+165) {
tmp = (a * b) + (x * y);
} else if (((a * b) <= -1.28e+67) || !(((a * b) <= -1.15e+21) || (!((a * b) <= -4.6e-109) && (((a * b) <= 1.3e-77) || (!((a * b) <= 1.7e+29) && ((a * b) <= 2.8e+210)))))) {
tmp = (a * b) + (z * t);
} else {
tmp = (c * i) + (x * y);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (a * b) <= -2.3e+165: tmp = (a * b) + (x * y) elif ((a * b) <= -1.28e+67) or not (((a * b) <= -1.15e+21) or (not ((a * b) <= -4.6e-109) and (((a * b) <= 1.3e-77) or (not ((a * b) <= 1.7e+29) and ((a * b) <= 2.8e+210))))): tmp = (a * b) + (z * t) else: tmp = (c * i) + (x * y) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (Float64(a * b) <= -2.3e+165) tmp = Float64(Float64(a * b) + Float64(x * y)); elseif ((Float64(a * b) <= -1.28e+67) || !((Float64(a * b) <= -1.15e+21) || (!(Float64(a * b) <= -4.6e-109) && ((Float64(a * b) <= 1.3e-77) || (!(Float64(a * b) <= 1.7e+29) && (Float64(a * b) <= 2.8e+210)))))) tmp = Float64(Float64(a * b) + Float64(z * t)); else tmp = Float64(Float64(c * i) + Float64(x * y)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if ((a * b) <= -2.3e+165) tmp = (a * b) + (x * y); elseif (((a * b) <= -1.28e+67) || ~((((a * b) <= -1.15e+21) || (~(((a * b) <= -4.6e-109)) && (((a * b) <= 1.3e-77) || (~(((a * b) <= 1.7e+29)) && ((a * b) <= 2.8e+210))))))) tmp = (a * b) + (z * t); else tmp = (c * i) + (x * y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[N[(a * b), $MachinePrecision], -2.3e+165], N[(N[(a * b), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[N[(a * b), $MachinePrecision], -1.28e+67], N[Not[Or[LessEqual[N[(a * b), $MachinePrecision], -1.15e+21], And[N[Not[LessEqual[N[(a * b), $MachinePrecision], -4.6e-109]], $MachinePrecision], Or[LessEqual[N[(a * b), $MachinePrecision], 1.3e-77], And[N[Not[LessEqual[N[(a * b), $MachinePrecision], 1.7e+29]], $MachinePrecision], LessEqual[N[(a * b), $MachinePrecision], 2.8e+210]]]]]], $MachinePrecision]], N[(N[(a * b), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision], N[(N[(c * i), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \cdot b \leq -2.3 \cdot 10^{+165}:\\
\;\;\;\;a \cdot b + x \cdot y\\
\mathbf{elif}\;a \cdot b \leq -1.28 \cdot 10^{+67} \lor \neg \left(a \cdot b \leq -1.15 \cdot 10^{+21} \lor \neg \left(a \cdot b \leq -4.6 \cdot 10^{-109}\right) \land \left(a \cdot b \leq 1.3 \cdot 10^{-77} \lor \neg \left(a \cdot b \leq 1.7 \cdot 10^{+29}\right) \land a \cdot b \leq 2.8 \cdot 10^{+210}\right)\right):\\
\;\;\;\;a \cdot b + z \cdot t\\
\mathbf{else}:\\
\;\;\;\;c \cdot i + x \cdot y\\
\end{array}
\end{array}
if (*.f64 a b) < -2.30000000000000016e165Initial program 97.2%
Taylor expanded in z around 0 97.2%
Taylor expanded in c around 0 93.0%
if -2.30000000000000016e165 < (*.f64 a b) < -1.28e67 or -1.15e21 < (*.f64 a b) < -4.6000000000000003e-109 or 1.3000000000000001e-77 < (*.f64 a b) < 1.69999999999999991e29 or 2.8000000000000002e210 < (*.f64 a b) Initial program 95.1%
Taylor expanded in x around 0 87.3%
Taylor expanded in c around 0 71.4%
if -1.28e67 < (*.f64 a b) < -1.15e21 or -4.6000000000000003e-109 < (*.f64 a b) < 1.3000000000000001e-77 or 1.69999999999999991e29 < (*.f64 a b) < 2.8000000000000002e210Initial program 100.0%
Taylor expanded in z around 0 81.7%
Taylor expanded in a around 0 76.9%
Final simplification77.4%
(FPCore (x y z t a b c i)
:precision binary64
(if (<= (* a b) -1.25e+115)
(* a b)
(if (<= (* a b) -2.3e-116)
(* z t)
(if (<= (* a b) -2e-316)
(* c i)
(if (<= (* a b) 2.3e-290)
(* x y)
(if (<= (* a b) 1.72e-212)
(* c i)
(if (<= (* a b) 8.3e-106)
(* x y)
(if (<= (* a b) 4e+213) (* 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) <= -1.25e+115) {
tmp = a * b;
} else if ((a * b) <= -2.3e-116) {
tmp = z * t;
} else if ((a * b) <= -2e-316) {
tmp = c * i;
} else if ((a * b) <= 2.3e-290) {
tmp = x * y;
} else if ((a * b) <= 1.72e-212) {
tmp = c * i;
} else if ((a * b) <= 8.3e-106) {
tmp = x * y;
} else if ((a * b) <= 4e+213) {
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) <= (-1.25d+115)) then
tmp = a * b
else if ((a * b) <= (-2.3d-116)) then
tmp = z * t
else if ((a * b) <= (-2d-316)) then
tmp = c * i
else if ((a * b) <= 2.3d-290) then
tmp = x * y
else if ((a * b) <= 1.72d-212) then
tmp = c * i
else if ((a * b) <= 8.3d-106) then
tmp = x * y
else if ((a * b) <= 4d+213) 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) <= -1.25e+115) {
tmp = a * b;
} else if ((a * b) <= -2.3e-116) {
tmp = z * t;
} else if ((a * b) <= -2e-316) {
tmp = c * i;
} else if ((a * b) <= 2.3e-290) {
tmp = x * y;
} else if ((a * b) <= 1.72e-212) {
tmp = c * i;
} else if ((a * b) <= 8.3e-106) {
tmp = x * y;
} else if ((a * b) <= 4e+213) {
tmp = z * t;
} else {
tmp = a * b;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (a * b) <= -1.25e+115: tmp = a * b elif (a * b) <= -2.3e-116: tmp = z * t elif (a * b) <= -2e-316: tmp = c * i elif (a * b) <= 2.3e-290: tmp = x * y elif (a * b) <= 1.72e-212: tmp = c * i elif (a * b) <= 8.3e-106: tmp = x * y elif (a * b) <= 4e+213: 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) <= -1.25e+115) tmp = Float64(a * b); elseif (Float64(a * b) <= -2.3e-116) tmp = Float64(z * t); elseif (Float64(a * b) <= -2e-316) tmp = Float64(c * i); elseif (Float64(a * b) <= 2.3e-290) tmp = Float64(x * y); elseif (Float64(a * b) <= 1.72e-212) tmp = Float64(c * i); elseif (Float64(a * b) <= 8.3e-106) tmp = Float64(x * y); elseif (Float64(a * b) <= 4e+213) 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) <= -1.25e+115) tmp = a * b; elseif ((a * b) <= -2.3e-116) tmp = z * t; elseif ((a * b) <= -2e-316) tmp = c * i; elseif ((a * b) <= 2.3e-290) tmp = x * y; elseif ((a * b) <= 1.72e-212) tmp = c * i; elseif ((a * b) <= 8.3e-106) tmp = x * y; elseif ((a * b) <= 4e+213) 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], -1.25e+115], N[(a * b), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], -2.3e-116], N[(z * t), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], -2e-316], N[(c * i), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 2.3e-290], N[(x * y), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 1.72e-212], N[(c * i), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 8.3e-106], N[(x * y), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 4e+213], N[(z * t), $MachinePrecision], N[(a * b), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \cdot b \leq -1.25 \cdot 10^{+115}:\\
\;\;\;\;a \cdot b\\
\mathbf{elif}\;a \cdot b \leq -2.3 \cdot 10^{-116}:\\
\;\;\;\;z \cdot t\\
\mathbf{elif}\;a \cdot b \leq -2 \cdot 10^{-316}:\\
\;\;\;\;c \cdot i\\
\mathbf{elif}\;a \cdot b \leq 2.3 \cdot 10^{-290}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;a \cdot b \leq 1.72 \cdot 10^{-212}:\\
\;\;\;\;c \cdot i\\
\mathbf{elif}\;a \cdot b \leq 8.3 \cdot 10^{-106}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;a \cdot b \leq 4 \cdot 10^{+213}:\\
\;\;\;\;z \cdot t\\
\mathbf{else}:\\
\;\;\;\;a \cdot b\\
\end{array}
\end{array}
if (*.f64 a b) < -1.25000000000000002e115 or 3.99999999999999994e213 < (*.f64 a b) Initial program 93.5%
Taylor expanded in a around inf 73.5%
if -1.25000000000000002e115 < (*.f64 a b) < -2.30000000000000002e-116 or 8.30000000000000047e-106 < (*.f64 a b) < 3.99999999999999994e213Initial program 99.0%
Taylor expanded in z around inf 40.5%
if -2.30000000000000002e-116 < (*.f64 a b) < -2.000000017e-316 or 2.3000000000000001e-290 < (*.f64 a b) < 1.7200000000000001e-212Initial program 100.0%
Taylor expanded in c around inf 56.1%
if -2.000000017e-316 < (*.f64 a b) < 2.3000000000000001e-290 or 1.7200000000000001e-212 < (*.f64 a b) < 8.30000000000000047e-106Initial program 100.0%
Taylor expanded in x around inf 55.1%
Final simplification53.9%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ (* a b) (* z t))))
(if (<= (* c i) -1.06e+185)
(* c i)
(if (<= (* c i) 3.05e-146)
t_1
(if (<= (* c i) 6.6e-94)
(* x y)
(if (<= (* c i) 2.8e+219) t_1 (* 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);
double tmp;
if ((c * i) <= -1.06e+185) {
tmp = c * i;
} else if ((c * i) <= 3.05e-146) {
tmp = t_1;
} else if ((c * i) <= 6.6e-94) {
tmp = x * y;
} else if ((c * i) <= 2.8e+219) {
tmp = t_1;
} 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) :: t_1
real(8) :: tmp
t_1 = (a * b) + (z * t)
if ((c * i) <= (-1.06d+185)) then
tmp = c * i
else if ((c * i) <= 3.05d-146) then
tmp = t_1
else if ((c * i) <= 6.6d-94) then
tmp = x * y
else if ((c * i) <= 2.8d+219) then
tmp = t_1
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 t_1 = (a * b) + (z * t);
double tmp;
if ((c * i) <= -1.06e+185) {
tmp = c * i;
} else if ((c * i) <= 3.05e-146) {
tmp = t_1;
} else if ((c * i) <= 6.6e-94) {
tmp = x * y;
} else if ((c * i) <= 2.8e+219) {
tmp = t_1;
} else {
tmp = c * i;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = (a * b) + (z * t) tmp = 0 if (c * i) <= -1.06e+185: tmp = c * i elif (c * i) <= 3.05e-146: tmp = t_1 elif (c * i) <= 6.6e-94: tmp = x * y elif (c * i) <= 2.8e+219: tmp = t_1 else: tmp = c * i 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 (Float64(c * i) <= -1.06e+185) tmp = Float64(c * i); elseif (Float64(c * i) <= 3.05e-146) tmp = t_1; elseif (Float64(c * i) <= 6.6e-94) tmp = Float64(x * y); elseif (Float64(c * i) <= 2.8e+219) tmp = t_1; else tmp = 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); tmp = 0.0; if ((c * i) <= -1.06e+185) tmp = c * i; elseif ((c * i) <= 3.05e-146) tmp = t_1; elseif ((c * i) <= 6.6e-94) tmp = x * y; elseif ((c * i) <= 2.8e+219) tmp = t_1; else tmp = c * i; 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[N[(c * i), $MachinePrecision], -1.06e+185], N[(c * i), $MachinePrecision], If[LessEqual[N[(c * i), $MachinePrecision], 3.05e-146], t$95$1, If[LessEqual[N[(c * i), $MachinePrecision], 6.6e-94], N[(x * y), $MachinePrecision], If[LessEqual[N[(c * i), $MachinePrecision], 2.8e+219], t$95$1, N[(c * i), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot b + z \cdot t\\
\mathbf{if}\;c \cdot i \leq -1.06 \cdot 10^{+185}:\\
\;\;\;\;c \cdot i\\
\mathbf{elif}\;c \cdot i \leq 3.05 \cdot 10^{-146}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;c \cdot i \leq 6.6 \cdot 10^{-94}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;c \cdot i \leq 2.8 \cdot 10^{+219}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;c \cdot i\\
\end{array}
\end{array}
if (*.f64 c i) < -1.06000000000000004e185 or 2.80000000000000015e219 < (*.f64 c i) Initial program 95.1%
Taylor expanded in c around inf 76.3%
if -1.06000000000000004e185 < (*.f64 c i) < 3.0499999999999998e-146 or 6.6000000000000003e-94 < (*.f64 c i) < 2.80000000000000015e219Initial program 98.9%
Taylor expanded in x around 0 72.0%
Taylor expanded in c around 0 58.4%
if 3.0499999999999998e-146 < (*.f64 c i) < 6.6000000000000003e-94Initial program 100.0%
Taylor expanded in x around inf 89.3%
Final simplification63.8%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ (* c i) (* a b))) (t_2 (+ (* a b) (* z t))))
(if (<= x -1.4e+47)
(+ (* a b) (* x y))
(if (<= x -0.55)
t_1
(if (<= x -5e-62)
t_2
(if (<= x -3.05e-239)
t_1
(if (<= x -2.9e-300) t_2 (if (<= x 1.1e-18) 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 = (c * i) + (a * b);
double t_2 = (a * b) + (z * t);
double tmp;
if (x <= -1.4e+47) {
tmp = (a * b) + (x * y);
} else if (x <= -0.55) {
tmp = t_1;
} else if (x <= -5e-62) {
tmp = t_2;
} else if (x <= -3.05e-239) {
tmp = t_1;
} else if (x <= -2.9e-300) {
tmp = t_2;
} else if (x <= 1.1e-18) {
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) :: t_2
real(8) :: tmp
t_1 = (c * i) + (a * b)
t_2 = (a * b) + (z * t)
if (x <= (-1.4d+47)) then
tmp = (a * b) + (x * y)
else if (x <= (-0.55d0)) then
tmp = t_1
else if (x <= (-5d-62)) then
tmp = t_2
else if (x <= (-3.05d-239)) then
tmp = t_1
else if (x <= (-2.9d-300)) then
tmp = t_2
else if (x <= 1.1d-18) 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 = (c * i) + (a * b);
double t_2 = (a * b) + (z * t);
double tmp;
if (x <= -1.4e+47) {
tmp = (a * b) + (x * y);
} else if (x <= -0.55) {
tmp = t_1;
} else if (x <= -5e-62) {
tmp = t_2;
} else if (x <= -3.05e-239) {
tmp = t_1;
} else if (x <= -2.9e-300) {
tmp = t_2;
} else if (x <= 1.1e-18) {
tmp = t_1;
} else {
tmp = x * y;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = (c * i) + (a * b) t_2 = (a * b) + (z * t) tmp = 0 if x <= -1.4e+47: tmp = (a * b) + (x * y) elif x <= -0.55: tmp = t_1 elif x <= -5e-62: tmp = t_2 elif x <= -3.05e-239: tmp = t_1 elif x <= -2.9e-300: tmp = t_2 elif x <= 1.1e-18: tmp = t_1 else: tmp = x * y return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(c * i) + Float64(a * b)) t_2 = Float64(Float64(a * b) + Float64(z * t)) tmp = 0.0 if (x <= -1.4e+47) tmp = Float64(Float64(a * b) + Float64(x * y)); elseif (x <= -0.55) tmp = t_1; elseif (x <= -5e-62) tmp = t_2; elseif (x <= -3.05e-239) tmp = t_1; elseif (x <= -2.9e-300) tmp = t_2; elseif (x <= 1.1e-18) 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 = (c * i) + (a * b); t_2 = (a * b) + (z * t); tmp = 0.0; if (x <= -1.4e+47) tmp = (a * b) + (x * y); elseif (x <= -0.55) tmp = t_1; elseif (x <= -5e-62) tmp = t_2; elseif (x <= -3.05e-239) tmp = t_1; elseif (x <= -2.9e-300) tmp = t_2; elseif (x <= 1.1e-18) 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[(c * i), $MachinePrecision] + N[(a * b), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(a * b), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.4e+47], N[(N[(a * b), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -0.55], t$95$1, If[LessEqual[x, -5e-62], t$95$2, If[LessEqual[x, -3.05e-239], t$95$1, If[LessEqual[x, -2.9e-300], t$95$2, If[LessEqual[x, 1.1e-18], t$95$1, N[(x * y), $MachinePrecision]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := c \cdot i + a \cdot b\\
t_2 := a \cdot b + z \cdot t\\
\mathbf{if}\;x \leq -1.4 \cdot 10^{+47}:\\
\;\;\;\;a \cdot b + x \cdot y\\
\mathbf{elif}\;x \leq -0.55:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq -5 \cdot 10^{-62}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x \leq -3.05 \cdot 10^{-239}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq -2.9 \cdot 10^{-300}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x \leq 1.1 \cdot 10^{-18}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}
\end{array}
if x < -1.39999999999999994e47Initial program 97.8%
Taylor expanded in z around 0 82.9%
Taylor expanded in c around 0 68.7%
if -1.39999999999999994e47 < x < -0.55000000000000004 or -5.0000000000000002e-62 < x < -3.05e-239 or -2.89999999999999992e-300 < x < 1.0999999999999999e-18Initial program 98.2%
Taylor expanded in x around 0 87.9%
Taylor expanded in t around 0 65.0%
if -0.55000000000000004 < x < -5.0000000000000002e-62 or -3.05e-239 < x < -2.89999999999999992e-300Initial program 100.0%
Taylor expanded in x around 0 85.6%
Taylor expanded in c around 0 70.4%
if 1.0999999999999999e-18 < x Initial program 97.2%
Taylor expanded in x around inf 48.2%
Final simplification61.5%
(FPCore (x y z t a b c i)
:precision binary64
(if (<= (* a b) -1.8e+115)
(* a b)
(if (<= (* a b) -4.3e-116)
(* z t)
(if (<= (* a b) 1.25e-76)
(* c i)
(if (<= (* a b) 4.1e+213) (* 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) <= -1.8e+115) {
tmp = a * b;
} else if ((a * b) <= -4.3e-116) {
tmp = z * t;
} else if ((a * b) <= 1.25e-76) {
tmp = c * i;
} else if ((a * b) <= 4.1e+213) {
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) <= (-1.8d+115)) then
tmp = a * b
else if ((a * b) <= (-4.3d-116)) then
tmp = z * t
else if ((a * b) <= 1.25d-76) then
tmp = c * i
else if ((a * b) <= 4.1d+213) 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) <= -1.8e+115) {
tmp = a * b;
} else if ((a * b) <= -4.3e-116) {
tmp = z * t;
} else if ((a * b) <= 1.25e-76) {
tmp = c * i;
} else if ((a * b) <= 4.1e+213) {
tmp = z * t;
} else {
tmp = a * b;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (a * b) <= -1.8e+115: tmp = a * b elif (a * b) <= -4.3e-116: tmp = z * t elif (a * b) <= 1.25e-76: tmp = c * i elif (a * b) <= 4.1e+213: 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) <= -1.8e+115) tmp = Float64(a * b); elseif (Float64(a * b) <= -4.3e-116) tmp = Float64(z * t); elseif (Float64(a * b) <= 1.25e-76) tmp = Float64(c * i); elseif (Float64(a * b) <= 4.1e+213) 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) <= -1.8e+115) tmp = a * b; elseif ((a * b) <= -4.3e-116) tmp = z * t; elseif ((a * b) <= 1.25e-76) tmp = c * i; elseif ((a * b) <= 4.1e+213) 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], -1.8e+115], N[(a * b), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], -4.3e-116], N[(z * t), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 1.25e-76], N[(c * i), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 4.1e+213], N[(z * t), $MachinePrecision], N[(a * b), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \cdot b \leq -1.8 \cdot 10^{+115}:\\
\;\;\;\;a \cdot b\\
\mathbf{elif}\;a \cdot b \leq -4.3 \cdot 10^{-116}:\\
\;\;\;\;z \cdot t\\
\mathbf{elif}\;a \cdot b \leq 1.25 \cdot 10^{-76}:\\
\;\;\;\;c \cdot i\\
\mathbf{elif}\;a \cdot b \leq 4.1 \cdot 10^{+213}:\\
\;\;\;\;z \cdot t\\
\mathbf{else}:\\
\;\;\;\;a \cdot b\\
\end{array}
\end{array}
if (*.f64 a b) < -1.8e115 or 4.0999999999999997e213 < (*.f64 a b) Initial program 93.5%
Taylor expanded in a around inf 73.5%
if -1.8e115 < (*.f64 a b) < -4.2999999999999997e-116 or 1.2499999999999999e-76 < (*.f64 a b) < 4.0999999999999997e213Initial program 98.9%
Taylor expanded in z around inf 41.5%
if -4.2999999999999997e-116 < (*.f64 a b) < 1.2499999999999999e-76Initial program 100.0%
Taylor expanded in c around inf 40.9%
Final simplification49.0%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= x -3.1e+154) (not (<= x 1.1e-18))) (+ (* c i) (* x y)) (+ (* 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 <= -3.1e+154) || !(x <= 1.1e-18)) {
tmp = (c * i) + (x * y);
} 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 <= (-3.1d+154)) .or. (.not. (x <= 1.1d-18))) then
tmp = (c * i) + (x * y)
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 <= -3.1e+154) || !(x <= 1.1e-18)) {
tmp = (c * i) + (x * y);
} else {
tmp = (c * i) + ((a * b) + (z * t));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (x <= -3.1e+154) or not (x <= 1.1e-18): tmp = (c * i) + (x * y) else: tmp = (c * i) + ((a * b) + (z * t)) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((x <= -3.1e+154) || !(x <= 1.1e-18)) tmp = Float64(Float64(c * i) + Float64(x * y)); 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 <= -3.1e+154) || ~((x <= 1.1e-18))) tmp = (c * i) + (x * y); 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[x, -3.1e+154], N[Not[LessEqual[x, 1.1e-18]], $MachinePrecision]], N[(N[(c * i), $MachinePrecision] + N[(x * y), $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 \leq -3.1 \cdot 10^{+154} \lor \neg \left(x \leq 1.1 \cdot 10^{-18}\right):\\
\;\;\;\;c \cdot i + x \cdot y\\
\mathbf{else}:\\
\;\;\;\;c \cdot i + \left(a \cdot b + z \cdot t\right)\\
\end{array}
\end{array}
if x < -3.1000000000000001e154 or 1.0999999999999999e-18 < x Initial program 97.2%
Taylor expanded in z around 0 77.4%
Taylor expanded in a around 0 63.0%
if -3.1000000000000001e154 < x < 1.0999999999999999e-18Initial program 98.6%
Taylor expanded in x around 0 84.6%
Final simplification75.6%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= t -6.6e-147) (not (<= t 2.45e+135))) (+ (* 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 ((t <= -6.6e-147) || !(t <= 2.45e+135)) {
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 ((t <= (-6.6d-147)) .or. (.not. (t <= 2.45d+135))) 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 ((t <= -6.6e-147) || !(t <= 2.45e+135)) {
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 (t <= -6.6e-147) or not (t <= 2.45e+135): 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 ((t <= -6.6e-147) || !(t <= 2.45e+135)) 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 ((t <= -6.6e-147) || ~((t <= 2.45e+135))) 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[t, -6.6e-147], N[Not[LessEqual[t, 2.45e+135]], $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}\;t \leq -6.6 \cdot 10^{-147} \lor \neg \left(t \leq 2.45 \cdot 10^{+135}\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 t < -6.59999999999999975e-147 or 2.4500000000000001e135 < t Initial program 97.7%
Taylor expanded in x around 0 80.3%
if -6.59999999999999975e-147 < t < 2.4500000000000001e135Initial program 98.4%
Taylor expanded in z around 0 90.8%
Final simplification85.4%
(FPCore (x y z t a b c i) :precision binary64 (+ (* c i) (+ (* a b) (+ (* z t) (* x y)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return (c * i) + ((a * b) + ((z * t) + (x * y)));
}
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 = (c * i) + ((a * b) + ((z * t) + (x * y)))
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return (c * i) + ((a * b) + ((z * t) + (x * y)));
}
def code(x, y, z, t, a, b, c, i): return (c * i) + ((a * b) + ((z * t) + (x * y)))
function code(x, y, z, t, a, b, c, i) return Float64(Float64(c * i) + Float64(Float64(a * b) + Float64(Float64(z * t) + Float64(x * y)))) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = (c * i) + ((a * b) + ((z * t) + (x * y))); end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(N[(c * i), $MachinePrecision] + N[(N[(a * b), $MachinePrecision] + N[(N[(z * t), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
c \cdot i + \left(a \cdot b + \left(z \cdot t + x \cdot y\right)\right)
\end{array}
Initial program 98.0%
Final simplification98.0%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= y -1.08e-117) (not (<= y 4.7e+55))) (+ (* a b) (* x y)) (+ (* 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 ((y <= -1.08e-117) || !(y <= 4.7e+55)) {
tmp = (a * b) + (x * y);
} 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) :: tmp
if ((y <= (-1.08d-117)) .or. (.not. (y <= 4.7d+55))) then
tmp = (a * b) + (x * y)
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 tmp;
if ((y <= -1.08e-117) || !(y <= 4.7e+55)) {
tmp = (a * b) + (x * y);
} else {
tmp = (a * b) + (z * t);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (y <= -1.08e-117) or not (y <= 4.7e+55): tmp = (a * b) + (x * y) else: tmp = (a * b) + (z * t) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((y <= -1.08e-117) || !(y <= 4.7e+55)) tmp = Float64(Float64(a * b) + Float64(x * y)); 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) tmp = 0.0; if ((y <= -1.08e-117) || ~((y <= 4.7e+55))) tmp = (a * b) + (x * y); else tmp = (a * b) + (z * t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[y, -1.08e-117], N[Not[LessEqual[y, 4.7e+55]], $MachinePrecision]], N[(N[(a * b), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision], N[(N[(a * b), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.08 \cdot 10^{-117} \lor \neg \left(y \leq 4.7 \cdot 10^{+55}\right):\\
\;\;\;\;a \cdot b + x \cdot y\\
\mathbf{else}:\\
\;\;\;\;a \cdot b + z \cdot t\\
\end{array}
\end{array}
if y < -1.07999999999999998e-117 or 4.7000000000000001e55 < y Initial program 97.8%
Taylor expanded in z around 0 83.1%
Taylor expanded in c around 0 58.1%
if -1.07999999999999998e-117 < y < 4.7000000000000001e55Initial program 98.3%
Taylor expanded in x around 0 88.6%
Taylor expanded in c around 0 61.1%
Final simplification59.5%
(FPCore (x y z t a b c i) :precision binary64 (if (<= (* a b) -5.8e+66) (* a b) (if (<= (* a b) 5.4e+235) (* 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 ((a * b) <= -5.8e+66) {
tmp = a * b;
} else if ((a * b) <= 5.4e+235) {
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 ((a * b) <= (-5.8d+66)) then
tmp = a * b
else if ((a * b) <= 5.4d+235) 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 ((a * b) <= -5.8e+66) {
tmp = a * b;
} else if ((a * b) <= 5.4e+235) {
tmp = c * i;
} else {
tmp = a * b;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (a * b) <= -5.8e+66: tmp = a * b elif (a * b) <= 5.4e+235: tmp = c * i else: tmp = a * b return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (Float64(a * b) <= -5.8e+66) tmp = Float64(a * b); elseif (Float64(a * b) <= 5.4e+235) 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 ((a * b) <= -5.8e+66) tmp = a * b; elseif ((a * b) <= 5.4e+235) tmp = c * i; else tmp = a * b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[N[(a * b), $MachinePrecision], -5.8e+66], N[(a * b), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 5.4e+235], N[(c * i), $MachinePrecision], N[(a * b), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \cdot b \leq -5.8 \cdot 10^{+66}:\\
\;\;\;\;a \cdot b\\
\mathbf{elif}\;a \cdot b \leq 5.4 \cdot 10^{+235}:\\
\;\;\;\;c \cdot i\\
\mathbf{else}:\\
\;\;\;\;a \cdot b\\
\end{array}
\end{array}
if (*.f64 a b) < -5.79999999999999972e66 or 5.3999999999999995e235 < (*.f64 a b) Initial program 94.3%
Taylor expanded in a around inf 66.9%
if -5.79999999999999972e66 < (*.f64 a b) < 5.3999999999999995e235Initial program 99.4%
Taylor expanded in c around inf 34.5%
Final simplification43.3%
(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 98.0%
Taylor expanded in a around inf 24.1%
Final simplification24.1%
herbie shell --seed 2023257
(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)))