
(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 15 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 (if (<= (+ (* c i) (+ (* a b) (+ (* z t) (* x y)))) INFINITY) (fma c i (+ (* z t) (+ (* a b) (* x y)))) (fma 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 (((c * i) + ((a * b) + ((z * t) + (x * y)))) <= ((double) INFINITY)) {
tmp = fma(c, i, ((z * t) + ((a * b) + (x * y))));
} else {
tmp = fma(c, i, (z * t));
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (Float64(Float64(c * i) + Float64(Float64(a * b) + Float64(Float64(z * t) + Float64(x * y)))) <= Inf) tmp = fma(c, i, Float64(Float64(z * t) + Float64(Float64(a * b) + Float64(x * y)))); else tmp = fma(c, i, Float64(z * t)); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[N[(N[(c * i), $MachinePrecision] + N[(N[(a * b), $MachinePrecision] + N[(N[(z * t), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], Infinity], N[(c * i + N[(N[(z * t), $MachinePrecision] + N[(N[(a * b), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c * i + N[(z * t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \cdot i + \left(a \cdot b + \left(z \cdot t + x \cdot y\right)\right) \leq \infty:\\
\;\;\;\;\mathsf{fma}\left(c, i, z \cdot t + \left(a \cdot b + x \cdot y\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(c, i, z \cdot t\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%
+-commutative100.0%
fma-def100.0%
associate-+l+100.0%
fma-def100.0%
fma-def100.0%
Simplified100.0%
fma-udef100.0%
fma-udef100.0%
associate-+l+100.0%
+-commutative100.0%
associate-+r+100.0%
Applied egg-rr100.0%
if +inf.0 < (+.f64 (+.f64 (+.f64 (*.f64 x y) (*.f64 z t)) (*.f64 a b)) (*.f64 c i)) Initial program 0.0%
+-commutative0.0%
fma-def20.0%
associate-+l+20.0%
fma-def20.0%
fma-def30.0%
Simplified30.0%
fma-udef30.0%
fma-udef20.0%
associate-+l+20.0%
+-commutative20.0%
associate-+r+20.0%
Applied egg-rr20.0%
Taylor expanded in z around inf 60.0%
Final simplification98.4%
(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 96.1%
associate-+l+96.1%
associate-+l+96.1%
fma-def96.5%
fma-def96.8%
fma-def97.6%
Simplified97.6%
Final simplification97.6%
(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 96.1%
+-commutative96.1%
fma-def96.9%
associate-+l+96.9%
fma-def96.9%
fma-def97.3%
Simplified97.3%
Final simplification97.3%
(FPCore (x y z t a b c i) :precision binary64 (let* ((t_1 (+ (* c i) (+ (* a b) (+ (* z t) (* x y)))))) (if (<= t_1 INFINITY) t_1 (fma c i (* z t)))))
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) + ((z * t) + (x * y)));
double tmp;
if (t_1 <= ((double) INFINITY)) {
tmp = t_1;
} else {
tmp = fma(c, i, (z * t));
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(c * i) + Float64(Float64(a * b) + Float64(Float64(z * t) + Float64(x * y)))) tmp = 0.0 if (t_1 <= Inf) tmp = t_1; else tmp = fma(c, i, Float64(z * t)); end return 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[(z * t), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, Infinity], t$95$1, N[(c * i + N[(z * t), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := c \cdot i + \left(a \cdot b + \left(z \cdot t + x \cdot y\right)\right)\\
\mathbf{if}\;t_1 \leq \infty:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(c, i, z \cdot t\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%
+-commutative0.0%
fma-def20.0%
associate-+l+20.0%
fma-def20.0%
fma-def30.0%
Simplified30.0%
fma-udef30.0%
fma-udef20.0%
associate-+l+20.0%
+-commutative20.0%
associate-+r+20.0%
Applied egg-rr20.0%
Taylor expanded in z around inf 60.0%
Final simplification98.4%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ (* a b) (* x y))))
(if (<= (* c i) -8.2e+262)
(* c i)
(if (<= (* c i) -1.3e+206)
t_1
(if (<= (* c i) -5.4e+124)
(* c i)
(if (<= (* c i) -3.15e-137)
t_1
(if (<= (* c i) -1.05e-242)
(* z t)
(if (or (<= (* c i) 2.4e+62)
(and (not (<= (* c i) 7.1e+115)) (<= (* c i) 8.5e+261)))
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) + (x * y);
double tmp;
if ((c * i) <= -8.2e+262) {
tmp = c * i;
} else if ((c * i) <= -1.3e+206) {
tmp = t_1;
} else if ((c * i) <= -5.4e+124) {
tmp = c * i;
} else if ((c * i) <= -3.15e-137) {
tmp = t_1;
} else if ((c * i) <= -1.05e-242) {
tmp = z * t;
} else if (((c * i) <= 2.4e+62) || (!((c * i) <= 7.1e+115) && ((c * i) <= 8.5e+261))) {
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) + (x * y)
if ((c * i) <= (-8.2d+262)) then
tmp = c * i
else if ((c * i) <= (-1.3d+206)) then
tmp = t_1
else if ((c * i) <= (-5.4d+124)) then
tmp = c * i
else if ((c * i) <= (-3.15d-137)) then
tmp = t_1
else if ((c * i) <= (-1.05d-242)) then
tmp = z * t
else if (((c * i) <= 2.4d+62) .or. (.not. ((c * i) <= 7.1d+115)) .and. ((c * i) <= 8.5d+261)) 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) + (x * y);
double tmp;
if ((c * i) <= -8.2e+262) {
tmp = c * i;
} else if ((c * i) <= -1.3e+206) {
tmp = t_1;
} else if ((c * i) <= -5.4e+124) {
tmp = c * i;
} else if ((c * i) <= -3.15e-137) {
tmp = t_1;
} else if ((c * i) <= -1.05e-242) {
tmp = z * t;
} else if (((c * i) <= 2.4e+62) || (!((c * i) <= 7.1e+115) && ((c * i) <= 8.5e+261))) {
tmp = t_1;
} else {
tmp = c * i;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = (a * b) + (x * y) tmp = 0 if (c * i) <= -8.2e+262: tmp = c * i elif (c * i) <= -1.3e+206: tmp = t_1 elif (c * i) <= -5.4e+124: tmp = c * i elif (c * i) <= -3.15e-137: tmp = t_1 elif (c * i) <= -1.05e-242: tmp = z * t elif ((c * i) <= 2.4e+62) or (not ((c * i) <= 7.1e+115) and ((c * i) <= 8.5e+261)): 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(x * y)) tmp = 0.0 if (Float64(c * i) <= -8.2e+262) tmp = Float64(c * i); elseif (Float64(c * i) <= -1.3e+206) tmp = t_1; elseif (Float64(c * i) <= -5.4e+124) tmp = Float64(c * i); elseif (Float64(c * i) <= -3.15e-137) tmp = t_1; elseif (Float64(c * i) <= -1.05e-242) tmp = Float64(z * t); elseif ((Float64(c * i) <= 2.4e+62) || (!(Float64(c * i) <= 7.1e+115) && (Float64(c * i) <= 8.5e+261))) 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) + (x * y); tmp = 0.0; if ((c * i) <= -8.2e+262) tmp = c * i; elseif ((c * i) <= -1.3e+206) tmp = t_1; elseif ((c * i) <= -5.4e+124) tmp = c * i; elseif ((c * i) <= -3.15e-137) tmp = t_1; elseif ((c * i) <= -1.05e-242) tmp = z * t; elseif (((c * i) <= 2.4e+62) || (~(((c * i) <= 7.1e+115)) && ((c * i) <= 8.5e+261))) 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[(x * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(c * i), $MachinePrecision], -8.2e+262], N[(c * i), $MachinePrecision], If[LessEqual[N[(c * i), $MachinePrecision], -1.3e+206], t$95$1, If[LessEqual[N[(c * i), $MachinePrecision], -5.4e+124], N[(c * i), $MachinePrecision], If[LessEqual[N[(c * i), $MachinePrecision], -3.15e-137], t$95$1, If[LessEqual[N[(c * i), $MachinePrecision], -1.05e-242], N[(z * t), $MachinePrecision], If[Or[LessEqual[N[(c * i), $MachinePrecision], 2.4e+62], And[N[Not[LessEqual[N[(c * i), $MachinePrecision], 7.1e+115]], $MachinePrecision], LessEqual[N[(c * i), $MachinePrecision], 8.5e+261]]], t$95$1, N[(c * i), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot b + x \cdot y\\
\mathbf{if}\;c \cdot i \leq -8.2 \cdot 10^{+262}:\\
\;\;\;\;c \cdot i\\
\mathbf{elif}\;c \cdot i \leq -1.3 \cdot 10^{+206}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;c \cdot i \leq -5.4 \cdot 10^{+124}:\\
\;\;\;\;c \cdot i\\
\mathbf{elif}\;c \cdot i \leq -3.15 \cdot 10^{-137}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;c \cdot i \leq -1.05 \cdot 10^{-242}:\\
\;\;\;\;z \cdot t\\
\mathbf{elif}\;c \cdot i \leq 2.4 \cdot 10^{+62} \lor \neg \left(c \cdot i \leq 7.1 \cdot 10^{+115}\right) \land c \cdot i \leq 8.5 \cdot 10^{+261}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;c \cdot i\\
\end{array}
\end{array}
if (*.f64 c i) < -8.20000000000000055e262 or -1.29999999999999994e206 < (*.f64 c i) < -5.39999999999999956e124 or 2.4e62 < (*.f64 c i) < 7.0999999999999997e115 or 8.5000000000000005e261 < (*.f64 c i) Initial program 92.8%
Taylor expanded in c around inf 82.5%
if -8.20000000000000055e262 < (*.f64 c i) < -1.29999999999999994e206 or -5.39999999999999956e124 < (*.f64 c i) < -3.15e-137 or -1.05000000000000009e-242 < (*.f64 c i) < 2.4e62 or 7.0999999999999997e115 < (*.f64 c i) < 8.5000000000000005e261Initial program 97.1%
associate-+l+97.1%
associate-+l+97.1%
fma-def97.1%
fma-def97.7%
fma-def97.7%
Simplified97.7%
Taylor expanded in z around 0 72.6%
Taylor expanded in c around 0 64.3%
if -3.15e-137 < (*.f64 c i) < -1.05000000000000009e-242Initial program 100.0%
Taylor expanded in z around inf 70.1%
Final simplification69.6%
(FPCore (x y z t a b c i) :precision binary64 (let* ((t_1 (+ (* c i) (+ (* a b) (+ (* z t) (* x y)))))) (if (<= t_1 INFINITY) t_1 (+ (* c i) (* z t)))))
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) + ((z * t) + (x * y)));
double tmp;
if (t_1 <= ((double) INFINITY)) {
tmp = t_1;
} else {
tmp = (c * i) + (z * t);
}
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) + ((z * t) + (x * y)));
double tmp;
if (t_1 <= Double.POSITIVE_INFINITY) {
tmp = t_1;
} else {
tmp = (c * i) + (z * t);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = (c * i) + ((a * b) + ((z * t) + (x * y))) tmp = 0 if t_1 <= math.inf: tmp = t_1 else: tmp = (c * i) + (z * t) return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(c * i) + Float64(Float64(a * b) + Float64(Float64(z * t) + Float64(x * y)))) tmp = 0.0 if (t_1 <= Inf) tmp = t_1; 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) t_1 = (c * i) + ((a * b) + ((z * t) + (x * y))); tmp = 0.0; if (t_1 <= Inf) tmp = t_1; else tmp = (c * i) + (z * t); 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[(z * t), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, Infinity], t$95$1, N[(N[(c * i), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := c \cdot i + \left(a \cdot b + \left(z \cdot t + x \cdot y\right)\right)\\
\mathbf{if}\;t_1 \leq \infty:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;c \cdot i + z \cdot t\\
\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 x around 0 10.0%
Taylor expanded in a around 0 50.0%
Final simplification98.0%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ (* c i) (* z t))) (t_2 (+ (* a b) (* x y))))
(if (<= (* a b) -5000000.0)
t_2
(if (<= (* a b) -1e-317)
t_1
(if (<= (* a b) 4.8e-307)
(+ (* c i) (* x y))
(if (<= (* a b) 1.05e+125) 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 = (c * i) + (z * t);
double t_2 = (a * b) + (x * y);
double tmp;
if ((a * b) <= -5000000.0) {
tmp = t_2;
} else if ((a * b) <= -1e-317) {
tmp = t_1;
} else if ((a * b) <= 4.8e-307) {
tmp = (c * i) + (x * y);
} else if ((a * b) <= 1.05e+125) {
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 = (c * i) + (z * t)
t_2 = (a * b) + (x * y)
if ((a * b) <= (-5000000.0d0)) then
tmp = t_2
else if ((a * b) <= (-1d-317)) then
tmp = t_1
else if ((a * b) <= 4.8d-307) then
tmp = (c * i) + (x * y)
else if ((a * b) <= 1.05d+125) 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 = (c * i) + (z * t);
double t_2 = (a * b) + (x * y);
double tmp;
if ((a * b) <= -5000000.0) {
tmp = t_2;
} else if ((a * b) <= -1e-317) {
tmp = t_1;
} else if ((a * b) <= 4.8e-307) {
tmp = (c * i) + (x * y);
} else if ((a * b) <= 1.05e+125) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = (c * i) + (z * t) t_2 = (a * b) + (x * y) tmp = 0 if (a * b) <= -5000000.0: tmp = t_2 elif (a * b) <= -1e-317: tmp = t_1 elif (a * b) <= 4.8e-307: tmp = (c * i) + (x * y) elif (a * b) <= 1.05e+125: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(c * i) + Float64(z * t)) t_2 = Float64(Float64(a * b) + Float64(x * y)) tmp = 0.0 if (Float64(a * b) <= -5000000.0) tmp = t_2; elseif (Float64(a * b) <= -1e-317) tmp = t_1; elseif (Float64(a * b) <= 4.8e-307) tmp = Float64(Float64(c * i) + Float64(x * y)); elseif (Float64(a * b) <= 1.05e+125) 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 = (c * i) + (z * t); t_2 = (a * b) + (x * y); tmp = 0.0; if ((a * b) <= -5000000.0) tmp = t_2; elseif ((a * b) <= -1e-317) tmp = t_1; elseif ((a * b) <= 4.8e-307) tmp = (c * i) + (x * y); elseif ((a * b) <= 1.05e+125) 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[(c * i), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(a * b), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(a * b), $MachinePrecision], -5000000.0], t$95$2, If[LessEqual[N[(a * b), $MachinePrecision], -1e-317], t$95$1, If[LessEqual[N[(a * b), $MachinePrecision], 4.8e-307], N[(N[(c * i), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 1.05e+125], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := c \cdot i + z \cdot t\\
t_2 := a \cdot b + x \cdot y\\
\mathbf{if}\;a \cdot b \leq -5000000:\\
\;\;\;\;t_2\\
\mathbf{elif}\;a \cdot b \leq -1 \cdot 10^{-317}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;a \cdot b \leq 4.8 \cdot 10^{-307}:\\
\;\;\;\;c \cdot i + x \cdot y\\
\mathbf{elif}\;a \cdot b \leq 1.05 \cdot 10^{+125}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if (*.f64 a b) < -5e6 or 1.05e125 < (*.f64 a b) Initial program 91.5%
associate-+l+91.5%
associate-+l+91.5%
fma-def92.4%
fma-def93.4%
fma-def95.3%
Simplified95.3%
Taylor expanded in z around 0 84.5%
Taylor expanded in c around 0 75.7%
if -5e6 < (*.f64 a b) < -1.00000023e-317 or 4.80000000000000036e-307 < (*.f64 a b) < 1.05e125Initial program 99.2%
Taylor expanded in x around 0 81.4%
Taylor expanded in a around 0 72.5%
if -1.00000023e-317 < (*.f64 a b) < 4.80000000000000036e-307Initial program 99.9%
Taylor expanded in a around 0 99.9%
Taylor expanded in t around 0 82.8%
Final simplification74.5%
(FPCore (x y z t a b c i)
:precision binary64
(if (<= x -2.1e+224)
(+ (* c i) (+ (* z t) (* x y)))
(if (or (<= x -8.2e+74) (not (<= x 1.25e-79)))
(+ (* c i) (+ (* a b) (* 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 <= -2.1e+224) {
tmp = (c * i) + ((z * t) + (x * y));
} else if ((x <= -8.2e+74) || !(x <= 1.25e-79)) {
tmp = (c * i) + ((a * b) + (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 <= (-2.1d+224)) then
tmp = (c * i) + ((z * t) + (x * y))
else if ((x <= (-8.2d+74)) .or. (.not. (x <= 1.25d-79))) then
tmp = (c * i) + ((a * b) + (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 <= -2.1e+224) {
tmp = (c * i) + ((z * t) + (x * y));
} else if ((x <= -8.2e+74) || !(x <= 1.25e-79)) {
tmp = (c * i) + ((a * b) + (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 <= -2.1e+224: tmp = (c * i) + ((z * t) + (x * y)) elif (x <= -8.2e+74) or not (x <= 1.25e-79): tmp = (c * i) + ((a * b) + (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 <= -2.1e+224) tmp = Float64(Float64(c * i) + Float64(Float64(z * t) + Float64(x * y))); elseif ((x <= -8.2e+74) || !(x <= 1.25e-79)) tmp = Float64(Float64(c * i) + Float64(Float64(a * b) + 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 <= -2.1e+224) tmp = (c * i) + ((z * t) + (x * y)); elseif ((x <= -8.2e+74) || ~((x <= 1.25e-79))) tmp = (c * i) + ((a * b) + (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[LessEqual[x, -2.1e+224], N[(N[(c * i), $MachinePrecision] + N[(N[(z * t), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[x, -8.2e+74], N[Not[LessEqual[x, 1.25e-79]], $MachinePrecision]], N[(N[(c * i), $MachinePrecision] + N[(N[(a * b), $MachinePrecision] + N[(x * y), $MachinePrecision]), $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 -2.1 \cdot 10^{+224}:\\
\;\;\;\;c \cdot i + \left(z \cdot t + x \cdot y\right)\\
\mathbf{elif}\;x \leq -8.2 \cdot 10^{+74} \lor \neg \left(x \leq 1.25 \cdot 10^{-79}\right):\\
\;\;\;\;c \cdot i + \left(a \cdot b + x \cdot y\right)\\
\mathbf{else}:\\
\;\;\;\;c \cdot i + \left(a \cdot b + z \cdot t\right)\\
\end{array}
\end{array}
if x < -2.1000000000000002e224Initial program 74.9%
Taylor expanded in a around 0 68.1%
if -2.1000000000000002e224 < x < -8.2000000000000001e74 or 1.25e-79 < x Initial program 98.0%
Taylor expanded in z around 0 81.3%
if -8.2000000000000001e74 < x < 1.25e-79Initial program 96.4%
Taylor expanded in x around 0 91.0%
Final simplification86.0%
(FPCore (x y z t a b c i)
:precision binary64
(if (<= c -1.95e+30)
(* c i)
(if (<= c -8.2e-40)
(* a b)
(if (<= c -2.1e-219)
(* z t)
(if (<= c 1.3e-230)
(* a b)
(if (<= c 4.2e-200) (* z t) (if (<= c 1.8e-112) (* 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 (c <= -1.95e+30) {
tmp = c * i;
} else if (c <= -8.2e-40) {
tmp = a * b;
} else if (c <= -2.1e-219) {
tmp = z * t;
} else if (c <= 1.3e-230) {
tmp = a * b;
} else if (c <= 4.2e-200) {
tmp = z * t;
} else if (c <= 1.8e-112) {
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 (c <= (-1.95d+30)) then
tmp = c * i
else if (c <= (-8.2d-40)) then
tmp = a * b
else if (c <= (-2.1d-219)) then
tmp = z * t
else if (c <= 1.3d-230) then
tmp = a * b
else if (c <= 4.2d-200) then
tmp = z * t
else if (c <= 1.8d-112) 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 (c <= -1.95e+30) {
tmp = c * i;
} else if (c <= -8.2e-40) {
tmp = a * b;
} else if (c <= -2.1e-219) {
tmp = z * t;
} else if (c <= 1.3e-230) {
tmp = a * b;
} else if (c <= 4.2e-200) {
tmp = z * t;
} else if (c <= 1.8e-112) {
tmp = a * b;
} else {
tmp = c * i;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if c <= -1.95e+30: tmp = c * i elif c <= -8.2e-40: tmp = a * b elif c <= -2.1e-219: tmp = z * t elif c <= 1.3e-230: tmp = a * b elif c <= 4.2e-200: tmp = z * t elif c <= 1.8e-112: tmp = a * b else: tmp = c * i return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (c <= -1.95e+30) tmp = Float64(c * i); elseif (c <= -8.2e-40) tmp = Float64(a * b); elseif (c <= -2.1e-219) tmp = Float64(z * t); elseif (c <= 1.3e-230) tmp = Float64(a * b); elseif (c <= 4.2e-200) tmp = Float64(z * t); elseif (c <= 1.8e-112) 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 (c <= -1.95e+30) tmp = c * i; elseif (c <= -8.2e-40) tmp = a * b; elseif (c <= -2.1e-219) tmp = z * t; elseif (c <= 1.3e-230) tmp = a * b; elseif (c <= 4.2e-200) tmp = z * t; elseif (c <= 1.8e-112) tmp = a * b; else tmp = c * i; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[c, -1.95e+30], N[(c * i), $MachinePrecision], If[LessEqual[c, -8.2e-40], N[(a * b), $MachinePrecision], If[LessEqual[c, -2.1e-219], N[(z * t), $MachinePrecision], If[LessEqual[c, 1.3e-230], N[(a * b), $MachinePrecision], If[LessEqual[c, 4.2e-200], N[(z * t), $MachinePrecision], If[LessEqual[c, 1.8e-112], N[(a * b), $MachinePrecision], N[(c * i), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \leq -1.95 \cdot 10^{+30}:\\
\;\;\;\;c \cdot i\\
\mathbf{elif}\;c \leq -8.2 \cdot 10^{-40}:\\
\;\;\;\;a \cdot b\\
\mathbf{elif}\;c \leq -2.1 \cdot 10^{-219}:\\
\;\;\;\;z \cdot t\\
\mathbf{elif}\;c \leq 1.3 \cdot 10^{-230}:\\
\;\;\;\;a \cdot b\\
\mathbf{elif}\;c \leq 4.2 \cdot 10^{-200}:\\
\;\;\;\;z \cdot t\\
\mathbf{elif}\;c \leq 1.8 \cdot 10^{-112}:\\
\;\;\;\;a \cdot b\\
\mathbf{else}:\\
\;\;\;\;c \cdot i\\
\end{array}
\end{array}
if c < -1.95000000000000005e30 or 1.8e-112 < c Initial program 95.8%
Taylor expanded in c around inf 44.7%
if -1.95000000000000005e30 < c < -8.19999999999999926e-40 or -2.1e-219 < c < 1.3000000000000001e-230 or 4.1999999999999998e-200 < c < 1.8e-112Initial program 95.8%
Taylor expanded in a around inf 45.8%
if -8.19999999999999926e-40 < c < -2.1e-219 or 1.3000000000000001e-230 < c < 4.1999999999999998e-200Initial program 97.6%
Taylor expanded in z around inf 44.4%
Final simplification44.9%
(FPCore (x y z t a b c i)
:precision binary64
(if (or (<= x -2.9e+197)
(and (not (<= x -3e+147))
(or (<= x -1.25e+119) (not (<= x 2.05e-64)))))
(+ (* a b) (* x y))
(+ (* 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 ((x <= -2.9e+197) || (!(x <= -3e+147) && ((x <= -1.25e+119) || !(x <= 2.05e-64)))) {
tmp = (a * b) + (x * y);
} else {
tmp = (c * i) + (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 ((x <= (-2.9d+197)) .or. (.not. (x <= (-3d+147))) .and. (x <= (-1.25d+119)) .or. (.not. (x <= 2.05d-64))) then
tmp = (a * b) + (x * y)
else
tmp = (c * i) + (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 ((x <= -2.9e+197) || (!(x <= -3e+147) && ((x <= -1.25e+119) || !(x <= 2.05e-64)))) {
tmp = (a * b) + (x * y);
} else {
tmp = (c * i) + (a * b);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (x <= -2.9e+197) or (not (x <= -3e+147) and ((x <= -1.25e+119) or not (x <= 2.05e-64))): tmp = (a * b) + (x * y) else: tmp = (c * i) + (a * b) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((x <= -2.9e+197) || (!(x <= -3e+147) && ((x <= -1.25e+119) || !(x <= 2.05e-64)))) tmp = Float64(Float64(a * b) + Float64(x * y)); else tmp = Float64(Float64(c * i) + Float64(a * b)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if ((x <= -2.9e+197) || (~((x <= -3e+147)) && ((x <= -1.25e+119) || ~((x <= 2.05e-64))))) tmp = (a * b) + (x * y); else tmp = (c * i) + (a * b); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[x, -2.9e+197], And[N[Not[LessEqual[x, -3e+147]], $MachinePrecision], Or[LessEqual[x, -1.25e+119], N[Not[LessEqual[x, 2.05e-64]], $MachinePrecision]]]], N[(N[(a * b), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision], N[(N[(c * i), $MachinePrecision] + N[(a * b), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.9 \cdot 10^{+197} \lor \neg \left(x \leq -3 \cdot 10^{+147}\right) \land \left(x \leq -1.25 \cdot 10^{+119} \lor \neg \left(x \leq 2.05 \cdot 10^{-64}\right)\right):\\
\;\;\;\;a \cdot b + x \cdot y\\
\mathbf{else}:\\
\;\;\;\;c \cdot i + a \cdot b\\
\end{array}
\end{array}
if x < -2.90000000000000002e197 or -2.99999999999999993e147 < x < -1.25e119 or 2.05e-64 < x Initial program 95.5%
associate-+l+95.5%
associate-+l+95.5%
fma-def96.6%
fma-def96.6%
fma-def96.6%
Simplified96.6%
Taylor expanded in z around 0 82.8%
Taylor expanded in c around 0 64.7%
if -2.90000000000000002e197 < x < -2.99999999999999993e147 or -1.25e119 < x < 2.05e-64Initial program 96.3%
Taylor expanded in x around 0 89.3%
Taylor expanded in t around 0 62.8%
Final simplification63.5%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= (* a b) -4700000.0) (not (<= (* a b) 3.7e+127))) (+ (* a b) (* x y)) (+ (* 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) <= -4700000.0) || !((a * b) <= 3.7e+127)) {
tmp = (a * b) + (x * y);
} 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) <= (-4700000.0d0)) .or. (.not. ((a * b) <= 3.7d+127))) then
tmp = (a * b) + (x * y)
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) <= -4700000.0) || !((a * b) <= 3.7e+127)) {
tmp = (a * b) + (x * y);
} else {
tmp = (c * i) + (z * t);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if ((a * b) <= -4700000.0) or not ((a * b) <= 3.7e+127): tmp = (a * b) + (x * y) 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) <= -4700000.0) || !(Float64(a * b) <= 3.7e+127)) tmp = Float64(Float64(a * b) + Float64(x * y)); 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) <= -4700000.0) || ~(((a * b) <= 3.7e+127))) tmp = (a * b) + (x * y); 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], -4700000.0], N[Not[LessEqual[N[(a * b), $MachinePrecision], 3.7e+127]], $MachinePrecision]], N[(N[(a * b), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision], N[(N[(c * i), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \cdot b \leq -4700000 \lor \neg \left(a \cdot b \leq 3.7 \cdot 10^{+127}\right):\\
\;\;\;\;a \cdot b + x \cdot y\\
\mathbf{else}:\\
\;\;\;\;c \cdot i + z \cdot t\\
\end{array}
\end{array}
if (*.f64 a b) < -4.7e6 or 3.6999999999999998e127 < (*.f64 a b) Initial program 91.5%
associate-+l+91.5%
associate-+l+91.5%
fma-def92.4%
fma-def93.4%
fma-def95.3%
Simplified95.3%
Taylor expanded in z around 0 84.5%
Taylor expanded in c around 0 75.7%
if -4.7e6 < (*.f64 a b) < 3.6999999999999998e127Initial program 99.3%
Taylor expanded in x around 0 78.9%
Taylor expanded in a around 0 71.0%
Final simplification72.9%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= x -4.2e+74) (not (<= x 2.4e-79))) (+ (* c i) (+ (* a b) (* 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 <= -4.2e+74) || !(x <= 2.4e-79)) {
tmp = (c * i) + ((a * b) + (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 <= (-4.2d+74)) .or. (.not. (x <= 2.4d-79))) then
tmp = (c * i) + ((a * b) + (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 <= -4.2e+74) || !(x <= 2.4e-79)) {
tmp = (c * i) + ((a * b) + (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 <= -4.2e+74) or not (x <= 2.4e-79): tmp = (c * i) + ((a * b) + (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 <= -4.2e+74) || !(x <= 2.4e-79)) tmp = Float64(Float64(c * i) + Float64(Float64(a * b) + 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 <= -4.2e+74) || ~((x <= 2.4e-79))) tmp = (c * i) + ((a * b) + (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, -4.2e+74], N[Not[LessEqual[x, 2.4e-79]], $MachinePrecision]], N[(N[(c * i), $MachinePrecision] + N[(N[(a * b), $MachinePrecision] + N[(x * y), $MachinePrecision]), $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 -4.2 \cdot 10^{+74} \lor \neg \left(x \leq 2.4 \cdot 10^{-79}\right):\\
\;\;\;\;c \cdot i + \left(a \cdot b + x \cdot y\right)\\
\mathbf{else}:\\
\;\;\;\;c \cdot i + \left(a \cdot b + z \cdot t\right)\\
\end{array}
\end{array}
if x < -4.1999999999999998e74 or 2.40000000000000006e-79 < x Initial program 95.6%
Taylor expanded in z around 0 80.7%
if -4.1999999999999998e74 < x < 2.40000000000000006e-79Initial program 96.4%
Taylor expanded in x around 0 91.0%
Final simplification86.3%
(FPCore (x y z t a b c i) :precision binary64 (if (<= x -5e+237) (+ (* c i) (* x y)) (if (<= x 2.05e-64) (+ (* c i) (+ (* a b) (* z t))) (+ (* 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 (x <= -5e+237) {
tmp = (c * i) + (x * y);
} else if (x <= 2.05e-64) {
tmp = (c * i) + ((a * b) + (z * t));
} else {
tmp = (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 (x <= (-5d+237)) then
tmp = (c * i) + (x * y)
else if (x <= 2.05d-64) then
tmp = (c * i) + ((a * b) + (z * t))
else
tmp = (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 (x <= -5e+237) {
tmp = (c * i) + (x * y);
} else if (x <= 2.05e-64) {
tmp = (c * i) + ((a * b) + (z * t));
} else {
tmp = (a * b) + (x * y);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if x <= -5e+237: tmp = (c * i) + (x * y) elif x <= 2.05e-64: tmp = (c * i) + ((a * b) + (z * t)) else: tmp = (a * b) + (x * y) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (x <= -5e+237) tmp = Float64(Float64(c * i) + Float64(x * y)); elseif (x <= 2.05e-64) tmp = Float64(Float64(c * i) + Float64(Float64(a * b) + Float64(z * t))); else tmp = 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 (x <= -5e+237) tmp = (c * i) + (x * y); elseif (x <= 2.05e-64) tmp = (c * i) + ((a * b) + (z * t)); else tmp = (a * b) + (x * y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[x, -5e+237], N[(N[(c * i), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 2.05e-64], N[(N[(c * i), $MachinePrecision] + N[(N[(a * b), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(a * b), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -5 \cdot 10^{+237}:\\
\;\;\;\;c \cdot i + x \cdot y\\
\mathbf{elif}\;x \leq 2.05 \cdot 10^{-64}:\\
\;\;\;\;c \cdot i + \left(a \cdot b + z \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;a \cdot b + x \cdot y\\
\end{array}
\end{array}
if x < -5.0000000000000002e237Initial program 89.8%
Taylor expanded in a around 0 81.7%
Taylor expanded in t around 0 72.2%
if -5.0000000000000002e237 < x < 2.05e-64Initial program 95.5%
Taylor expanded in x around 0 84.7%
if 2.05e-64 < x Initial program 98.5%
associate-+l+98.5%
associate-+l+98.5%
fma-def98.5%
fma-def98.5%
fma-def98.5%
Simplified98.5%
Taylor expanded in z around 0 80.8%
Taylor expanded in c around 0 59.3%
Final simplification77.6%
(FPCore (x y z t a b c i) :precision binary64 (if (<= c -1.7e+30) (* c i) (if (<= c 1.8e-112) (* 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 (c <= -1.7e+30) {
tmp = c * i;
} else if (c <= 1.8e-112) {
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 (c <= (-1.7d+30)) then
tmp = c * i
else if (c <= 1.8d-112) 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 (c <= -1.7e+30) {
tmp = c * i;
} else if (c <= 1.8e-112) {
tmp = a * b;
} else {
tmp = c * i;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if c <= -1.7e+30: tmp = c * i elif c <= 1.8e-112: tmp = a * b else: tmp = c * i return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (c <= -1.7e+30) tmp = Float64(c * i); elseif (c <= 1.8e-112) 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 (c <= -1.7e+30) tmp = c * i; elseif (c <= 1.8e-112) tmp = a * b; else tmp = c * i; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[c, -1.7e+30], N[(c * i), $MachinePrecision], If[LessEqual[c, 1.8e-112], N[(a * b), $MachinePrecision], N[(c * i), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \leq -1.7 \cdot 10^{+30}:\\
\;\;\;\;c \cdot i\\
\mathbf{elif}\;c \leq 1.8 \cdot 10^{-112}:\\
\;\;\;\;a \cdot b\\
\mathbf{else}:\\
\;\;\;\;c \cdot i\\
\end{array}
\end{array}
if c < -1.7000000000000001e30 or 1.8e-112 < c Initial program 95.8%
Taylor expanded in c around inf 44.7%
if -1.7000000000000001e30 < c < 1.8e-112Initial program 96.4%
Taylor expanded in a around inf 39.5%
Final simplification42.4%
(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.1%
Taylor expanded in a around inf 30.1%
Final simplification30.1%
herbie shell --seed 2023208
(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)))