
(FPCore (x y z t a b c i) :precision binary64 (* 2.0 (- (+ (* x y) (* z t)) (* (* (+ a (* b c)) c) i))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * 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 = 2.0d0 * (((x * y) + (z * t)) - (((a + (b * c)) * 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 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i));
}
def code(x, y, z, t, a, b, c, i): return 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i))
function code(x, y, z, t, a, b, c, i) return Float64(2.0 * Float64(Float64(Float64(x * y) + Float64(z * t)) - Float64(Float64(Float64(a + Float64(b * c)) * c) * i))) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i)); end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(2.0 * N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] - N[(N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right)
\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 (* 2.0 (- (+ (* x y) (* z t)) (* (* (+ a (* b c)) c) i))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * 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 = 2.0d0 * (((x * y) + (z * t)) - (((a + (b * c)) * 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 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i));
}
def code(x, y, z, t, a, b, c, i): return 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i))
function code(x, y, z, t, a, b, c, i) return Float64(2.0 * Float64(Float64(Float64(x * y) + Float64(z * t)) - Float64(Float64(Float64(a + Float64(b * c)) * c) * i))) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i)); end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(2.0 * N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] - N[(N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right)
\end{array}
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ a (* b c))) (t_2 (+ (* x y) (* z t))))
(if (<= (- t_2 (* i (* c t_1))) INFINITY)
(* 2.0 (- t_2 (* t_1 (* c i))))
(* 2.0 (- (* z t) (* c (* b (* c i))))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = a + (b * c);
double t_2 = (x * y) + (z * t);
double tmp;
if ((t_2 - (i * (c * t_1))) <= ((double) INFINITY)) {
tmp = 2.0 * (t_2 - (t_1 * (c * i)));
} else {
tmp = 2.0 * ((z * t) - (c * (b * (c * i))));
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = a + (b * c);
double t_2 = (x * y) + (z * t);
double tmp;
if ((t_2 - (i * (c * t_1))) <= Double.POSITIVE_INFINITY) {
tmp = 2.0 * (t_2 - (t_1 * (c * i)));
} else {
tmp = 2.0 * ((z * t) - (c * (b * (c * i))));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = a + (b * c) t_2 = (x * y) + (z * t) tmp = 0 if (t_2 - (i * (c * t_1))) <= math.inf: tmp = 2.0 * (t_2 - (t_1 * (c * i))) else: tmp = 2.0 * ((z * t) - (c * (b * (c * i)))) return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(a + Float64(b * c)) t_2 = Float64(Float64(x * y) + Float64(z * t)) tmp = 0.0 if (Float64(t_2 - Float64(i * Float64(c * t_1))) <= Inf) tmp = Float64(2.0 * Float64(t_2 - Float64(t_1 * Float64(c * i)))); else tmp = Float64(2.0 * Float64(Float64(z * t) - Float64(c * Float64(b * Float64(c * i))))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = a + (b * c); t_2 = (x * y) + (z * t); tmp = 0.0; if ((t_2 - (i * (c * t_1))) <= Inf) tmp = 2.0 * (t_2 - (t_1 * (c * i))); else tmp = 2.0 * ((z * t) - (c * (b * (c * i)))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(t$95$2 - N[(i * N[(c * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], Infinity], N[(2.0 * N[(t$95$2 - N[(t$95$1 * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(z * t), $MachinePrecision] - N[(c * N[(b * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a + b \cdot c\\
t_2 := x \cdot y + z \cdot t\\
\mathbf{if}\;t_2 - i \cdot \left(c \cdot t_1\right) \leq \infty:\\
\;\;\;\;2 \cdot \left(t_2 - t_1 \cdot \left(c \cdot i\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(z \cdot t - c \cdot \left(b \cdot \left(c \cdot i\right)\right)\right)\\
\end{array}
\end{array}
if (-.f64 (+.f64 (*.f64 x y) (*.f64 z t)) (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i)) < +inf.0Initial program 94.5%
associate--l+94.5%
*-commutative94.5%
associate--l+94.5%
associate--l+94.5%
*-commutative94.5%
associate--l+94.5%
fma-def94.5%
associate-*l*97.6%
Simplified97.6%
fma-def97.6%
+-commutative97.6%
Applied egg-rr97.6%
if +inf.0 < (-.f64 (+.f64 (*.f64 x y) (*.f64 z t)) (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i)) Initial program 0.0%
Taylor expanded in x around 0 52.9%
Taylor expanded in a around 0 53.0%
Final simplification94.6%
(FPCore (x y z t a b c i) :precision binary64 (* 2.0 (- (fma x y (* z t)) (* (+ a (* b c)) (* c i)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return 2.0 * (fma(x, y, (z * t)) - ((a + (b * c)) * (c * i)));
}
function code(x, y, z, t, a, b, c, i) return Float64(2.0 * Float64(fma(x, y, Float64(z * t)) - Float64(Float64(a + Float64(b * c)) * Float64(c * i)))) end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(2.0 * N[(N[(x * y + N[(z * t), $MachinePrecision]), $MachinePrecision] - N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
2 \cdot \left(\mathsf{fma}\left(x, y, z \cdot t\right) - \left(a + b \cdot c\right) \cdot \left(c \cdot i\right)\right)
\end{array}
Initial program 88.2%
associate--l+88.2%
*-commutative88.2%
associate--l+88.2%
associate--l+88.2%
*-commutative88.2%
associate--l+88.2%
fma-def90.2%
associate-*l*94.2%
Simplified94.2%
Final simplification94.2%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ a (* b c))) (t_2 (* i (* c t_1))))
(if (<= t_2 (- INFINITY))
(* 2.0 (* c (* t_1 (- i))))
(if (<= t_2 4e+285)
(* 2.0 (- (+ (* x y) (* z t)) t_2))
(* 2.0 (- (* x y) (* c (* t_1 i))))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = a + (b * c);
double t_2 = i * (c * t_1);
double tmp;
if (t_2 <= -((double) INFINITY)) {
tmp = 2.0 * (c * (t_1 * -i));
} else if (t_2 <= 4e+285) {
tmp = 2.0 * (((x * y) + (z * t)) - t_2);
} else {
tmp = 2.0 * ((x * y) - (c * (t_1 * i)));
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = a + (b * c);
double t_2 = i * (c * t_1);
double tmp;
if (t_2 <= -Double.POSITIVE_INFINITY) {
tmp = 2.0 * (c * (t_1 * -i));
} else if (t_2 <= 4e+285) {
tmp = 2.0 * (((x * y) + (z * t)) - t_2);
} else {
tmp = 2.0 * ((x * y) - (c * (t_1 * i)));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = a + (b * c) t_2 = i * (c * t_1) tmp = 0 if t_2 <= -math.inf: tmp = 2.0 * (c * (t_1 * -i)) elif t_2 <= 4e+285: tmp = 2.0 * (((x * y) + (z * t)) - t_2) else: tmp = 2.0 * ((x * y) - (c * (t_1 * i))) return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(a + Float64(b * c)) t_2 = Float64(i * Float64(c * t_1)) tmp = 0.0 if (t_2 <= Float64(-Inf)) tmp = Float64(2.0 * Float64(c * Float64(t_1 * Float64(-i)))); elseif (t_2 <= 4e+285) tmp = Float64(2.0 * Float64(Float64(Float64(x * y) + Float64(z * t)) - t_2)); else tmp = Float64(2.0 * Float64(Float64(x * y) - Float64(c * Float64(t_1 * i)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = a + (b * c); t_2 = i * (c * t_1); tmp = 0.0; if (t_2 <= -Inf) tmp = 2.0 * (c * (t_1 * -i)); elseif (t_2 <= 4e+285) tmp = 2.0 * (((x * y) + (z * t)) - t_2); else tmp = 2.0 * ((x * y) - (c * (t_1 * i))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(i * N[(c * t$95$1), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, (-Infinity)], N[(2.0 * N[(c * N[(t$95$1 * (-i)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 4e+285], N[(2.0 * N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] - t$95$2), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(x * y), $MachinePrecision] - N[(c * N[(t$95$1 * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a + b \cdot c\\
t_2 := i \cdot \left(c \cdot t_1\right)\\
\mathbf{if}\;t_2 \leq -\infty:\\
\;\;\;\;2 \cdot \left(c \cdot \left(t_1 \cdot \left(-i\right)\right)\right)\\
\mathbf{elif}\;t_2 \leq 4 \cdot 10^{+285}:\\
\;\;\;\;2 \cdot \left(\left(x \cdot y + z \cdot t\right) - t_2\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(x \cdot y - c \cdot \left(t_1 \cdot i\right)\right)\\
\end{array}
\end{array}
if (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < -inf.0Initial program 73.8%
Taylor expanded in i around inf 89.7%
if -inf.0 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 3.9999999999999999e285Initial program 96.2%
if 3.9999999999999999e285 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) Initial program 76.3%
Taylor expanded in z around 0 89.1%
Final simplification93.6%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* 2.0 (- (* x y) (* a (* c i))))))
(if (<= (* x y) -1e+79)
t_1
(if (<= (* x y) -0.2)
(* 2.0 (+ (* x y) (* z t)))
(if (<= (* x y) -2e-37)
(* 2.0 (* c (* (+ a (* b c)) (- i))))
(if (<= (* x y) 1e+300)
(* 2.0 (- (* z t) (* c (* b (* c i)))))
t_1))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = 2.0 * ((x * y) - (a * (c * i)));
double tmp;
if ((x * y) <= -1e+79) {
tmp = t_1;
} else if ((x * y) <= -0.2) {
tmp = 2.0 * ((x * y) + (z * t));
} else if ((x * y) <= -2e-37) {
tmp = 2.0 * (c * ((a + (b * c)) * -i));
} else if ((x * y) <= 1e+300) {
tmp = 2.0 * ((z * t) - (c * (b * (c * i))));
} 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 = 2.0d0 * ((x * y) - (a * (c * i)))
if ((x * y) <= (-1d+79)) then
tmp = t_1
else if ((x * y) <= (-0.2d0)) then
tmp = 2.0d0 * ((x * y) + (z * t))
else if ((x * y) <= (-2d-37)) then
tmp = 2.0d0 * (c * ((a + (b * c)) * -i))
else if ((x * y) <= 1d+300) then
tmp = 2.0d0 * ((z * t) - (c * (b * (c * i))))
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 = 2.0 * ((x * y) - (a * (c * i)));
double tmp;
if ((x * y) <= -1e+79) {
tmp = t_1;
} else if ((x * y) <= -0.2) {
tmp = 2.0 * ((x * y) + (z * t));
} else if ((x * y) <= -2e-37) {
tmp = 2.0 * (c * ((a + (b * c)) * -i));
} else if ((x * y) <= 1e+300) {
tmp = 2.0 * ((z * t) - (c * (b * (c * i))));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = 2.0 * ((x * y) - (a * (c * i))) tmp = 0 if (x * y) <= -1e+79: tmp = t_1 elif (x * y) <= -0.2: tmp = 2.0 * ((x * y) + (z * t)) elif (x * y) <= -2e-37: tmp = 2.0 * (c * ((a + (b * c)) * -i)) elif (x * y) <= 1e+300: tmp = 2.0 * ((z * t) - (c * (b * (c * i)))) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(2.0 * Float64(Float64(x * y) - Float64(a * Float64(c * i)))) tmp = 0.0 if (Float64(x * y) <= -1e+79) tmp = t_1; elseif (Float64(x * y) <= -0.2) tmp = Float64(2.0 * Float64(Float64(x * y) + Float64(z * t))); elseif (Float64(x * y) <= -2e-37) tmp = Float64(2.0 * Float64(c * Float64(Float64(a + Float64(b * c)) * Float64(-i)))); elseif (Float64(x * y) <= 1e+300) tmp = Float64(2.0 * Float64(Float64(z * t) - Float64(c * Float64(b * Float64(c * i))))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = 2.0 * ((x * y) - (a * (c * i))); tmp = 0.0; if ((x * y) <= -1e+79) tmp = t_1; elseif ((x * y) <= -0.2) tmp = 2.0 * ((x * y) + (z * t)); elseif ((x * y) <= -2e-37) tmp = 2.0 * (c * ((a + (b * c)) * -i)); elseif ((x * y) <= 1e+300) tmp = 2.0 * ((z * t) - (c * (b * (c * i)))); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(2.0 * N[(N[(x * y), $MachinePrecision] - N[(a * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -1e+79], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], -0.2], N[(2.0 * N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], -2e-37], N[(2.0 * N[(c * N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * (-i)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 1e+300], N[(2.0 * N[(N[(z * t), $MachinePrecision] - N[(c * N[(b * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 2 \cdot \left(x \cdot y - a \cdot \left(c \cdot i\right)\right)\\
\mathbf{if}\;x \cdot y \leq -1 \cdot 10^{+79}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \cdot y \leq -0.2:\\
\;\;\;\;2 \cdot \left(x \cdot y + z \cdot t\right)\\
\mathbf{elif}\;x \cdot y \leq -2 \cdot 10^{-37}:\\
\;\;\;\;2 \cdot \left(c \cdot \left(\left(a + b \cdot c\right) \cdot \left(-i\right)\right)\right)\\
\mathbf{elif}\;x \cdot y \leq 10^{+300}:\\
\;\;\;\;2 \cdot \left(z \cdot t - c \cdot \left(b \cdot \left(c \cdot i\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if (*.f64 x y) < -9.99999999999999967e78 or 1.0000000000000001e300 < (*.f64 x y) Initial program 79.7%
Taylor expanded in a around inf 77.1%
*-commutative77.1%
Simplified77.1%
Taylor expanded in z around 0 83.3%
if -9.99999999999999967e78 < (*.f64 x y) < -0.20000000000000001Initial program 94.8%
Taylor expanded in c around 0 75.1%
if -0.20000000000000001 < (*.f64 x y) < -2.00000000000000013e-37Initial program 72.1%
Taylor expanded in i around inf 95.0%
if -2.00000000000000013e-37 < (*.f64 x y) < 1.0000000000000001e300Initial program 91.4%
Taylor expanded in x around 0 82.7%
Taylor expanded in a around 0 73.1%
Final simplification76.4%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= (* x y) -5e+101) (not (<= (* x y) 1e+300))) (* 2.0 (- (* x y) (* a (* c i)))) (* 2.0 (- (* z t) (* c (* (+ a (* b c)) i))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (((x * y) <= -5e+101) || !((x * y) <= 1e+300)) {
tmp = 2.0 * ((x * y) - (a * (c * i)));
} else {
tmp = 2.0 * ((z * t) - (c * ((a + (b * c)) * i)));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if (((x * y) <= (-5d+101)) .or. (.not. ((x * y) <= 1d+300))) then
tmp = 2.0d0 * ((x * y) - (a * (c * i)))
else
tmp = 2.0d0 * ((z * t) - (c * ((a + (b * c)) * i)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (((x * y) <= -5e+101) || !((x * y) <= 1e+300)) {
tmp = 2.0 * ((x * y) - (a * (c * i)));
} else {
tmp = 2.0 * ((z * t) - (c * ((a + (b * c)) * i)));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if ((x * y) <= -5e+101) or not ((x * y) <= 1e+300): tmp = 2.0 * ((x * y) - (a * (c * i))) else: tmp = 2.0 * ((z * t) - (c * ((a + (b * c)) * i))) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((Float64(x * y) <= -5e+101) || !(Float64(x * y) <= 1e+300)) tmp = Float64(2.0 * Float64(Float64(x * y) - Float64(a * Float64(c * i)))); else tmp = Float64(2.0 * Float64(Float64(z * t) - Float64(c * Float64(Float64(a + Float64(b * c)) * i)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if (((x * y) <= -5e+101) || ~(((x * y) <= 1e+300))) tmp = 2.0 * ((x * y) - (a * (c * i))); else tmp = 2.0 * ((z * t) - (c * ((a + (b * c)) * i))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[N[(x * y), $MachinePrecision], -5e+101], N[Not[LessEqual[N[(x * y), $MachinePrecision], 1e+300]], $MachinePrecision]], N[(2.0 * N[(N[(x * y), $MachinePrecision] - N[(a * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(z * t), $MachinePrecision] - N[(c * N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -5 \cdot 10^{+101} \lor \neg \left(x \cdot y \leq 10^{+300}\right):\\
\;\;\;\;2 \cdot \left(x \cdot y - a \cdot \left(c \cdot i\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(z \cdot t - c \cdot \left(\left(a + b \cdot c\right) \cdot i\right)\right)\\
\end{array}
\end{array}
if (*.f64 x y) < -4.99999999999999989e101 or 1.0000000000000001e300 < (*.f64 x y) Initial program 80.1%
Taylor expanded in a around inf 79.3%
*-commutative79.3%
Simplified79.3%
Taylor expanded in z around 0 85.8%
if -4.99999999999999989e101 < (*.f64 x y) < 1.0000000000000001e300Initial program 90.7%
Taylor expanded in x around 0 80.8%
Final simplification81.9%
(FPCore (x y z t a b c i)
:precision binary64
(if (or (<= (* x y) -1e+74)
(not
(or (<= (* x y) -2e+30)
(and (not (<= (* x y) -0.2)) (<= (* x y) 5e+154)))))
(* 2.0 (* x y))
(* 2.0 (* z t))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (((x * y) <= -1e+74) || !(((x * y) <= -2e+30) || (!((x * y) <= -0.2) && ((x * y) <= 5e+154)))) {
tmp = 2.0 * (x * y);
} else {
tmp = 2.0 * (z * t);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if (((x * y) <= (-1d+74)) .or. (.not. ((x * y) <= (-2d+30)) .or. (.not. ((x * y) <= (-0.2d0))) .and. ((x * y) <= 5d+154))) then
tmp = 2.0d0 * (x * y)
else
tmp = 2.0d0 * (z * t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (((x * y) <= -1e+74) || !(((x * y) <= -2e+30) || (!((x * y) <= -0.2) && ((x * y) <= 5e+154)))) {
tmp = 2.0 * (x * y);
} else {
tmp = 2.0 * (z * t);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if ((x * y) <= -1e+74) or not (((x * y) <= -2e+30) or (not ((x * y) <= -0.2) and ((x * y) <= 5e+154))): tmp = 2.0 * (x * y) else: tmp = 2.0 * (z * t) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((Float64(x * y) <= -1e+74) || !((Float64(x * y) <= -2e+30) || (!(Float64(x * y) <= -0.2) && (Float64(x * y) <= 5e+154)))) tmp = Float64(2.0 * Float64(x * y)); else tmp = Float64(2.0 * Float64(z * t)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if (((x * y) <= -1e+74) || ~((((x * y) <= -2e+30) || (~(((x * y) <= -0.2)) && ((x * y) <= 5e+154))))) tmp = 2.0 * (x * y); else tmp = 2.0 * (z * t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[N[(x * y), $MachinePrecision], -1e+74], N[Not[Or[LessEqual[N[(x * y), $MachinePrecision], -2e+30], And[N[Not[LessEqual[N[(x * y), $MachinePrecision], -0.2]], $MachinePrecision], LessEqual[N[(x * y), $MachinePrecision], 5e+154]]]], $MachinePrecision]], N[(2.0 * N[(x * y), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(z * t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -1 \cdot 10^{+74} \lor \neg \left(x \cdot y \leq -2 \cdot 10^{+30} \lor \neg \left(x \cdot y \leq -0.2\right) \land x \cdot y \leq 5 \cdot 10^{+154}\right):\\
\;\;\;\;2 \cdot \left(x \cdot y\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(z \cdot t\right)\\
\end{array}
\end{array}
if (*.f64 x y) < -9.99999999999999952e73 or -2e30 < (*.f64 x y) < -0.20000000000000001 or 5.00000000000000004e154 < (*.f64 x y) Initial program 84.6%
Taylor expanded in x around inf 64.5%
if -9.99999999999999952e73 < (*.f64 x y) < -2e30 or -0.20000000000000001 < (*.f64 x y) < 5.00000000000000004e154Initial program 90.2%
Taylor expanded in z around inf 38.1%
Final simplification47.3%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= c -5.8e-10) (not (<= c 3.65e+50))) (* 2.0 (- (* x y) (* c (* (+ a (* b c)) i)))) (* 2.0 (- (+ (* x y) (* z t)) (* i (* a c))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((c <= -5.8e-10) || !(c <= 3.65e+50)) {
tmp = 2.0 * ((x * y) - (c * ((a + (b * c)) * i)));
} else {
tmp = 2.0 * (((x * y) + (z * t)) - (i * (a * c)));
}
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 <= (-5.8d-10)) .or. (.not. (c <= 3.65d+50))) then
tmp = 2.0d0 * ((x * y) - (c * ((a + (b * c)) * i)))
else
tmp = 2.0d0 * (((x * y) + (z * t)) - (i * (a * c)))
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 <= -5.8e-10) || !(c <= 3.65e+50)) {
tmp = 2.0 * ((x * y) - (c * ((a + (b * c)) * i)));
} else {
tmp = 2.0 * (((x * y) + (z * t)) - (i * (a * c)));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (c <= -5.8e-10) or not (c <= 3.65e+50): tmp = 2.0 * ((x * y) - (c * ((a + (b * c)) * i))) else: tmp = 2.0 * (((x * y) + (z * t)) - (i * (a * c))) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((c <= -5.8e-10) || !(c <= 3.65e+50)) tmp = Float64(2.0 * Float64(Float64(x * y) - Float64(c * Float64(Float64(a + Float64(b * c)) * i)))); else tmp = Float64(2.0 * Float64(Float64(Float64(x * y) + Float64(z * t)) - Float64(i * Float64(a * c)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if ((c <= -5.8e-10) || ~((c <= 3.65e+50))) tmp = 2.0 * ((x * y) - (c * ((a + (b * c)) * i))); else tmp = 2.0 * (((x * y) + (z * t)) - (i * (a * c))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[c, -5.8e-10], N[Not[LessEqual[c, 3.65e+50]], $MachinePrecision]], N[(2.0 * N[(N[(x * y), $MachinePrecision] - N[(c * N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] - N[(i * N[(a * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \leq -5.8 \cdot 10^{-10} \lor \neg \left(c \leq 3.65 \cdot 10^{+50}\right):\\
\;\;\;\;2 \cdot \left(x \cdot y - c \cdot \left(\left(a + b \cdot c\right) \cdot i\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(\left(x \cdot y + z \cdot t\right) - i \cdot \left(a \cdot c\right)\right)\\
\end{array}
\end{array}
if c < -5.79999999999999962e-10 or 3.6500000000000002e50 < c Initial program 79.3%
Taylor expanded in z around 0 84.2%
if -5.79999999999999962e-10 < c < 3.6500000000000002e50Initial program 96.3%
Taylor expanded in a around inf 86.6%
*-commutative86.6%
Simplified86.6%
Final simplification85.4%
(FPCore (x y z t a b c i) :precision binary64 (let* ((t_1 (* c (* (+ a (* b c)) i)))) (if (<= t 6.5e+62) (* 2.0 (- (* x y) t_1)) (* 2.0 (- (* 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 = c * ((a + (b * c)) * i);
double tmp;
if (t <= 6.5e+62) {
tmp = 2.0 * ((x * y) - t_1);
} else {
tmp = 2.0 * ((z * t) - t_1);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: t_1
real(8) :: tmp
t_1 = c * ((a + (b * c)) * i)
if (t <= 6.5d+62) then
tmp = 2.0d0 * ((x * y) - t_1)
else
tmp = 2.0d0 * ((z * t) - t_1)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = c * ((a + (b * c)) * i);
double tmp;
if (t <= 6.5e+62) {
tmp = 2.0 * ((x * y) - t_1);
} else {
tmp = 2.0 * ((z * t) - t_1);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = c * ((a + (b * c)) * i) tmp = 0 if t <= 6.5e+62: tmp = 2.0 * ((x * y) - t_1) else: tmp = 2.0 * ((z * t) - t_1) return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(c * Float64(Float64(a + Float64(b * c)) * i)) tmp = 0.0 if (t <= 6.5e+62) tmp = Float64(2.0 * Float64(Float64(x * y) - t_1)); else tmp = Float64(2.0 * Float64(Float64(z * t) - t_1)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = c * ((a + (b * c)) * i); tmp = 0.0; if (t <= 6.5e+62) tmp = 2.0 * ((x * y) - t_1); else tmp = 2.0 * ((z * t) - t_1); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(c * N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, 6.5e+62], N[(2.0 * N[(N[(x * y), $MachinePrecision] - t$95$1), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(z * t), $MachinePrecision] - t$95$1), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := c \cdot \left(\left(a + b \cdot c\right) \cdot i\right)\\
\mathbf{if}\;t \leq 6.5 \cdot 10^{+62}:\\
\;\;\;\;2 \cdot \left(x \cdot y - t_1\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(z \cdot t - t_1\right)\\
\end{array}
\end{array}
if t < 6.5000000000000003e62Initial program 90.6%
Taylor expanded in z around 0 76.8%
if 6.5000000000000003e62 < t Initial program 80.5%
Taylor expanded in x around 0 82.3%
Final simplification78.1%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= c -6.8e+72) (not (<= c 1.5e+51))) (* 2.0 (* c (* (+ a (* b c)) (- i)))) (* 2.0 (+ (* 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 <= -6.8e+72) || !(c <= 1.5e+51)) {
tmp = 2.0 * (c * ((a + (b * c)) * -i));
} else {
tmp = 2.0 * ((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 <= (-6.8d+72)) .or. (.not. (c <= 1.5d+51))) then
tmp = 2.0d0 * (c * ((a + (b * c)) * -i))
else
tmp = 2.0d0 * ((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 <= -6.8e+72) || !(c <= 1.5e+51)) {
tmp = 2.0 * (c * ((a + (b * c)) * -i));
} else {
tmp = 2.0 * ((x * y) + (z * t));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (c <= -6.8e+72) or not (c <= 1.5e+51): tmp = 2.0 * (c * ((a + (b * c)) * -i)) else: tmp = 2.0 * ((x * y) + (z * t)) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((c <= -6.8e+72) || !(c <= 1.5e+51)) tmp = Float64(2.0 * Float64(c * Float64(Float64(a + Float64(b * c)) * Float64(-i)))); else tmp = Float64(2.0 * 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 <= -6.8e+72) || ~((c <= 1.5e+51))) tmp = 2.0 * (c * ((a + (b * c)) * -i)); else tmp = 2.0 * ((x * y) + (z * t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[c, -6.8e+72], N[Not[LessEqual[c, 1.5e+51]], $MachinePrecision]], N[(2.0 * N[(c * N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * (-i)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \leq -6.8 \cdot 10^{+72} \lor \neg \left(c \leq 1.5 \cdot 10^{+51}\right):\\
\;\;\;\;2 \cdot \left(c \cdot \left(\left(a + b \cdot c\right) \cdot \left(-i\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(x \cdot y + z \cdot t\right)\\
\end{array}
\end{array}
if c < -6.7999999999999997e72 or 1.5e51 < c Initial program 77.2%
Taylor expanded in i around inf 75.8%
if -6.7999999999999997e72 < c < 1.5e51Initial program 95.5%
Taylor expanded in c around 0 69.4%
Final simplification72.0%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= a -3.7e+155) (not (<= a 3.6e+36))) (* 2.0 (- (* x y) (* a (* c i)))) (* 2.0 (+ (* 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 ((a <= -3.7e+155) || !(a <= 3.6e+36)) {
tmp = 2.0 * ((x * y) - (a * (c * i)));
} else {
tmp = 2.0 * ((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 ((a <= (-3.7d+155)) .or. (.not. (a <= 3.6d+36))) then
tmp = 2.0d0 * ((x * y) - (a * (c * i)))
else
tmp = 2.0d0 * ((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 ((a <= -3.7e+155) || !(a <= 3.6e+36)) {
tmp = 2.0 * ((x * y) - (a * (c * i)));
} else {
tmp = 2.0 * ((x * y) + (z * t));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (a <= -3.7e+155) or not (a <= 3.6e+36): tmp = 2.0 * ((x * y) - (a * (c * i))) else: tmp = 2.0 * ((x * y) + (z * t)) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((a <= -3.7e+155) || !(a <= 3.6e+36)) tmp = Float64(2.0 * Float64(Float64(x * y) - Float64(a * Float64(c * i)))); else tmp = Float64(2.0 * 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 ((a <= -3.7e+155) || ~((a <= 3.6e+36))) tmp = 2.0 * ((x * y) - (a * (c * i))); else tmp = 2.0 * ((x * y) + (z * t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[a, -3.7e+155], N[Not[LessEqual[a, 3.6e+36]], $MachinePrecision]], N[(2.0 * N[(N[(x * y), $MachinePrecision] - N[(a * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -3.7 \cdot 10^{+155} \lor \neg \left(a \leq 3.6 \cdot 10^{+36}\right):\\
\;\;\;\;2 \cdot \left(x \cdot y - a \cdot \left(c \cdot i\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(x \cdot y + z \cdot t\right)\\
\end{array}
\end{array}
if a < -3.6999999999999998e155 or 3.5999999999999997e36 < a Initial program 81.4%
Taylor expanded in a around inf 74.5%
*-commutative74.5%
Simplified74.5%
Taylor expanded in z around 0 73.7%
if -3.6999999999999998e155 < a < 3.5999999999999997e36Initial program 91.3%
Taylor expanded in c around 0 61.9%
Final simplification65.6%
(FPCore (x y z t a b c i)
:precision binary64
(if (<= a -2.65e+206)
(* (* c i) (* a -2.0))
(if (<= a 1.02e+114)
(* 2.0 (+ (* x y) (* z t)))
(* 2.0 (- (* z t) (* c (* a i)))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (a <= -2.65e+206) {
tmp = (c * i) * (a * -2.0);
} else if (a <= 1.02e+114) {
tmp = 2.0 * ((x * y) + (z * t));
} else {
tmp = 2.0 * ((z * t) - (c * (a * i)));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if (a <= (-2.65d+206)) then
tmp = (c * i) * (a * (-2.0d0))
else if (a <= 1.02d+114) then
tmp = 2.0d0 * ((x * y) + (z * t))
else
tmp = 2.0d0 * ((z * t) - (c * (a * i)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (a <= -2.65e+206) {
tmp = (c * i) * (a * -2.0);
} else if (a <= 1.02e+114) {
tmp = 2.0 * ((x * y) + (z * t));
} else {
tmp = 2.0 * ((z * t) - (c * (a * i)));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if a <= -2.65e+206: tmp = (c * i) * (a * -2.0) elif a <= 1.02e+114: tmp = 2.0 * ((x * y) + (z * t)) else: tmp = 2.0 * ((z * t) - (c * (a * i))) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (a <= -2.65e+206) tmp = Float64(Float64(c * i) * Float64(a * -2.0)); elseif (a <= 1.02e+114) tmp = Float64(2.0 * Float64(Float64(x * y) + Float64(z * t))); else tmp = Float64(2.0 * Float64(Float64(z * t) - Float64(c * Float64(a * i)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if (a <= -2.65e+206) tmp = (c * i) * (a * -2.0); elseif (a <= 1.02e+114) tmp = 2.0 * ((x * y) + (z * t)); else tmp = 2.0 * ((z * t) - (c * (a * i))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[a, -2.65e+206], N[(N[(c * i), $MachinePrecision] * N[(a * -2.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 1.02e+114], N[(2.0 * N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(z * t), $MachinePrecision] - N[(c * N[(a * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -2.65 \cdot 10^{+206}:\\
\;\;\;\;\left(c \cdot i\right) \cdot \left(a \cdot -2\right)\\
\mathbf{elif}\;a \leq 1.02 \cdot 10^{+114}:\\
\;\;\;\;2 \cdot \left(x \cdot y + z \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(z \cdot t - c \cdot \left(a \cdot i\right)\right)\\
\end{array}
\end{array}
if a < -2.64999999999999996e206Initial program 77.7%
Taylor expanded in a around inf 82.5%
mul-1-neg82.5%
*-commutative82.5%
distribute-rgt-neg-in82.5%
Simplified82.5%
Taylor expanded in c around 0 82.5%
*-commutative82.5%
*-commutative82.5%
associate-*l*82.5%
Simplified82.5%
if -2.64999999999999996e206 < a < 1.01999999999999999e114Initial program 90.9%
Taylor expanded in c around 0 59.9%
if 1.01999999999999999e114 < a Initial program 78.7%
Taylor expanded in x around 0 78.8%
Taylor expanded in a around inf 71.8%
*-commutative71.8%
Simplified71.8%
Final simplification63.2%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= a -6.4e+206) (not (<= a 4.2e+113))) (* (* c i) (* a -2.0)) (* 2.0 (+ (* 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 ((a <= -6.4e+206) || !(a <= 4.2e+113)) {
tmp = (c * i) * (a * -2.0);
} else {
tmp = 2.0 * ((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 ((a <= (-6.4d+206)) .or. (.not. (a <= 4.2d+113))) then
tmp = (c * i) * (a * (-2.0d0))
else
tmp = 2.0d0 * ((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 ((a <= -6.4e+206) || !(a <= 4.2e+113)) {
tmp = (c * i) * (a * -2.0);
} else {
tmp = 2.0 * ((x * y) + (z * t));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (a <= -6.4e+206) or not (a <= 4.2e+113): tmp = (c * i) * (a * -2.0) else: tmp = 2.0 * ((x * y) + (z * t)) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((a <= -6.4e+206) || !(a <= 4.2e+113)) tmp = Float64(Float64(c * i) * Float64(a * -2.0)); else tmp = Float64(2.0 * 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 ((a <= -6.4e+206) || ~((a <= 4.2e+113))) tmp = (c * i) * (a * -2.0); else tmp = 2.0 * ((x * y) + (z * t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[a, -6.4e+206], N[Not[LessEqual[a, 4.2e+113]], $MachinePrecision]], N[(N[(c * i), $MachinePrecision] * N[(a * -2.0), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -6.4 \cdot 10^{+206} \lor \neg \left(a \leq 4.2 \cdot 10^{+113}\right):\\
\;\;\;\;\left(c \cdot i\right) \cdot \left(a \cdot -2\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(x \cdot y + z \cdot t\right)\\
\end{array}
\end{array}
if a < -6.40000000000000011e206 or 4.1999999999999998e113 < a Initial program 78.3%
Taylor expanded in a around inf 66.2%
mul-1-neg66.2%
*-commutative66.2%
distribute-rgt-neg-in66.2%
Simplified66.2%
Taylor expanded in c around 0 66.2%
*-commutative66.2%
*-commutative66.2%
associate-*l*66.2%
Simplified66.2%
if -6.40000000000000011e206 < a < 4.1999999999999998e113Initial program 90.9%
Taylor expanded in c around 0 59.9%
Final simplification61.2%
(FPCore (x y z t a b c i) :precision binary64 (* 2.0 (* z t)))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return 2.0 * (z * t);
}
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 = 2.0d0 * (z * t)
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return 2.0 * (z * t);
}
def code(x, y, z, t, a, b, c, i): return 2.0 * (z * t)
function code(x, y, z, t, a, b, c, i) return Float64(2.0 * Float64(z * t)) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = 2.0 * (z * t); end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(2.0 * N[(z * t), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
2 \cdot \left(z \cdot t\right)
\end{array}
Initial program 88.2%
Taylor expanded in z around inf 29.7%
Final simplification29.7%
(FPCore (x y z t a b c i) :precision binary64 (* 2.0 (- (+ (* x y) (* z t)) (* (+ a (* b c)) (* c i)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return 2.0 * (((x * y) + (z * t)) - ((a + (b * c)) * (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 = 2.0d0 * (((x * y) + (z * t)) - ((a + (b * c)) * (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 2.0 * (((x * y) + (z * t)) - ((a + (b * c)) * (c * i)));
}
def code(x, y, z, t, a, b, c, i): return 2.0 * (((x * y) + (z * t)) - ((a + (b * c)) * (c * i)))
function code(x, y, z, t, a, b, c, i) return Float64(2.0 * Float64(Float64(Float64(x * y) + Float64(z * t)) - Float64(Float64(a + Float64(b * c)) * Float64(c * i)))) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = 2.0 * (((x * y) + (z * t)) - ((a + (b * c)) * (c * i))); end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(2.0 * N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] - N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(a + b \cdot c\right) \cdot \left(c \cdot i\right)\right)
\end{array}
herbie shell --seed 2023334
(FPCore (x y z t a b c i)
:name "Diagrams.ThreeD.Shapes:frustum from diagrams-lib-1.3.0.3, A"
:precision binary64
:herbie-target
(* 2.0 (- (+ (* x y) (* z t)) (* (+ a (* b c)) (* c i))))
(* 2.0 (- (+ (* x y) (* z t)) (* (* (+ a (* b c)) c) i))))