
(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 17 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))))
(if (<= (- (+ (* x y) (* z t)) (* (* c t_1) i)) INFINITY)
(* 2.0 (- (fma x y (* z t)) (* t_1 (* c i))))
(* 2.0 (fma t z (* x y))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = a + (b * c);
double tmp;
if ((((x * y) + (z * t)) - ((c * t_1) * i)) <= ((double) INFINITY)) {
tmp = 2.0 * (fma(x, y, (z * t)) - (t_1 * (c * i)));
} else {
tmp = 2.0 * fma(t, z, (x * y));
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) t_1 = Float64(a + Float64(b * c)) tmp = 0.0 if (Float64(Float64(Float64(x * y) + Float64(z * t)) - Float64(Float64(c * t_1) * i)) <= Inf) tmp = Float64(2.0 * Float64(fma(x, y, Float64(z * t)) - Float64(t_1 * Float64(c * i)))); else tmp = Float64(2.0 * fma(t, z, Float64(x * y))); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] - N[(N[(c * t$95$1), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision], Infinity], N[(2.0 * N[(N[(x * y + N[(z * t), $MachinePrecision]), $MachinePrecision] - N[(t$95$1 * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(t * z + N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a + b \cdot c\\
\mathbf{if}\;\left(x \cdot y + z \cdot t\right) - \left(c \cdot t_1\right) \cdot i \leq \infty:\\
\;\;\;\;2 \cdot \left(\mathsf{fma}\left(x, y, z \cdot t\right) - t_1 \cdot \left(c \cdot i\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \mathsf{fma}\left(t, z, x \cdot y\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 96.7%
associate-*l*97.9%
fma-def97.9%
Simplified97.9%
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 c around 0 41.2%
fma-def58.8%
Simplified58.8%
Final simplification95.3%
(FPCore (x y z t a b c i) :precision binary64 (let* ((t_1 (- (+ (* x y) (* z t)) (* (* c (+ a (* b c))) i)))) (if (<= t_1 INFINITY) (* t_1 2.0) (* 2.0 (fma t z (* x y))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = ((x * y) + (z * t)) - ((c * (a + (b * c))) * i);
double tmp;
if (t_1 <= ((double) INFINITY)) {
tmp = t_1 * 2.0;
} else {
tmp = 2.0 * fma(t, z, (x * y));
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(Float64(x * y) + Float64(z * t)) - Float64(Float64(c * Float64(a + Float64(b * c))) * i)) tmp = 0.0 if (t_1 <= Inf) tmp = Float64(t_1 * 2.0); else tmp = Float64(2.0 * fma(t, z, Float64(x * y))); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] - N[(N[(c * N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, Infinity], N[(t$95$1 * 2.0), $MachinePrecision], N[(2.0 * N[(t * z + N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(x \cdot y + z \cdot t\right) - \left(c \cdot \left(a + b \cdot c\right)\right) \cdot i\\
\mathbf{if}\;t_1 \leq \infty:\\
\;\;\;\;t_1 \cdot 2\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \mathsf{fma}\left(t, z, x \cdot y\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 96.7%
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 c around 0 41.2%
fma-def58.8%
Simplified58.8%
Final simplification94.2%
(FPCore (x y z t a b c i) :precision binary64 (let* ((t_1 (- (+ (* x y) (* z t)) (* (* c (+ a (* b c))) i)))) (if (<= t_1 INFINITY) (* t_1 2.0) (* (* x y) 2.0))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = ((x * y) + (z * t)) - ((c * (a + (b * c))) * i);
double tmp;
if (t_1 <= ((double) INFINITY)) {
tmp = t_1 * 2.0;
} else {
tmp = (x * y) * 2.0;
}
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 = ((x * y) + (z * t)) - ((c * (a + (b * c))) * i);
double tmp;
if (t_1 <= Double.POSITIVE_INFINITY) {
tmp = t_1 * 2.0;
} else {
tmp = (x * y) * 2.0;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = ((x * y) + (z * t)) - ((c * (a + (b * c))) * i) tmp = 0 if t_1 <= math.inf: tmp = t_1 * 2.0 else: tmp = (x * y) * 2.0 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(Float64(x * y) + Float64(z * t)) - Float64(Float64(c * Float64(a + Float64(b * c))) * i)) tmp = 0.0 if (t_1 <= Inf) tmp = Float64(t_1 * 2.0); else tmp = Float64(Float64(x * y) * 2.0); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = ((x * y) + (z * t)) - ((c * (a + (b * c))) * i); tmp = 0.0; if (t_1 <= Inf) tmp = t_1 * 2.0; else tmp = (x * y) * 2.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] - N[(N[(c * N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, Infinity], N[(t$95$1 * 2.0), $MachinePrecision], N[(N[(x * y), $MachinePrecision] * 2.0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(x \cdot y + z \cdot t\right) - \left(c \cdot \left(a + b \cdot c\right)\right) \cdot i\\
\mathbf{if}\;t_1 \leq \infty:\\
\;\;\;\;t_1 \cdot 2\\
\mathbf{else}:\\
\;\;\;\;\left(x \cdot y\right) \cdot 2\\
\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 96.7%
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 inf 53.7%
Final simplification93.9%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* 2.0 (- (* x y) (* c (* (* b c) i))))))
(if (<= (* x y) -2.2e+95)
t_1
(if (<= (* x y) -1e+59)
(* 2.0 (- (* z t) (* c (* a i))))
(if (or (<= (* x y) -7.5e-57) (not (<= (* x y) 1.12e+98)))
t_1
(* 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 t_1 = 2.0 * ((x * y) - (c * ((b * c) * i)));
double tmp;
if ((x * y) <= -2.2e+95) {
tmp = t_1;
} else if ((x * y) <= -1e+59) {
tmp = 2.0 * ((z * t) - (c * (a * i)));
} else if (((x * y) <= -7.5e-57) || !((x * y) <= 1.12e+98)) {
tmp = t_1;
} 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) :: t_1
real(8) :: tmp
t_1 = 2.0d0 * ((x * y) - (c * ((b * c) * i)))
if ((x * y) <= (-2.2d+95)) then
tmp = t_1
else if ((x * y) <= (-1d+59)) then
tmp = 2.0d0 * ((z * t) - (c * (a * i)))
else if (((x * y) <= (-7.5d-57)) .or. (.not. ((x * y) <= 1.12d+98))) then
tmp = t_1
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 t_1 = 2.0 * ((x * y) - (c * ((b * c) * i)));
double tmp;
if ((x * y) <= -2.2e+95) {
tmp = t_1;
} else if ((x * y) <= -1e+59) {
tmp = 2.0 * ((z * t) - (c * (a * i)));
} else if (((x * y) <= -7.5e-57) || !((x * y) <= 1.12e+98)) {
tmp = t_1;
} else {
tmp = 2.0 * ((z * t) - (c * ((a + (b * c)) * i)));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = 2.0 * ((x * y) - (c * ((b * c) * i))) tmp = 0 if (x * y) <= -2.2e+95: tmp = t_1 elif (x * y) <= -1e+59: tmp = 2.0 * ((z * t) - (c * (a * i))) elif ((x * y) <= -7.5e-57) or not ((x * y) <= 1.12e+98): tmp = t_1 else: tmp = 2.0 * ((z * t) - (c * ((a + (b * c)) * i))) return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(2.0 * Float64(Float64(x * y) - Float64(c * Float64(Float64(b * c) * i)))) tmp = 0.0 if (Float64(x * y) <= -2.2e+95) tmp = t_1; elseif (Float64(x * y) <= -1e+59) tmp = Float64(2.0 * Float64(Float64(z * t) - Float64(c * Float64(a * i)))); elseif ((Float64(x * y) <= -7.5e-57) || !(Float64(x * y) <= 1.12e+98)) tmp = t_1; 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) t_1 = 2.0 * ((x * y) - (c * ((b * c) * i))); tmp = 0.0; if ((x * y) <= -2.2e+95) tmp = t_1; elseif ((x * y) <= -1e+59) tmp = 2.0 * ((z * t) - (c * (a * i))); elseif (((x * y) <= -7.5e-57) || ~(((x * y) <= 1.12e+98))) tmp = t_1; 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_] := Block[{t$95$1 = N[(2.0 * N[(N[(x * y), $MachinePrecision] - N[(c * N[(N[(b * c), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -2.2e+95], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], -1e+59], N[(2.0 * N[(N[(z * t), $MachinePrecision] - N[(c * N[(a * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[N[(x * y), $MachinePrecision], -7.5e-57], N[Not[LessEqual[N[(x * y), $MachinePrecision], 1.12e+98]], $MachinePrecision]], t$95$1, 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}
t_1 := 2 \cdot \left(x \cdot y - c \cdot \left(\left(b \cdot c\right) \cdot i\right)\right)\\
\mathbf{if}\;x \cdot y \leq -2.2 \cdot 10^{+95}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \cdot y \leq -1 \cdot 10^{+59}:\\
\;\;\;\;2 \cdot \left(z \cdot t - c \cdot \left(a \cdot i\right)\right)\\
\mathbf{elif}\;x \cdot y \leq -7.5 \cdot 10^{-57} \lor \neg \left(x \cdot y \leq 1.12 \cdot 10^{+98}\right):\\
\;\;\;\;t_1\\
\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) < -2.1999999999999999e95 or -9.99999999999999972e58 < (*.f64 x y) < -7.49999999999999973e-57 or 1.12e98 < (*.f64 x y) Initial program 86.1%
Taylor expanded in z around 0 76.4%
Taylor expanded in a around 0 76.4%
if -2.1999999999999999e95 < (*.f64 x y) < -9.99999999999999972e58Initial program 87.0%
Taylor expanded in a around inf 87.0%
*-commutative87.0%
Simplified87.0%
Taylor expanded in x around 0 85.9%
*-commutative85.9%
associate-*l*85.5%
*-commutative85.5%
Simplified85.5%
if -7.49999999999999973e-57 < (*.f64 x y) < 1.12e98Initial program 93.7%
Taylor expanded in x around 0 85.4%
Final simplification81.6%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* 2.0 (* z t)))
(t_2 (* -2.0 (* a (* c i))))
(t_3 (* (* x y) 2.0)))
(if (<= (* x y) -7.5e-57)
t_3
(if (<= (* x y) -2e-309)
t_1
(if (<= (* x y) 1.5e-141)
t_2
(if (<= (* x y) 9e-82) t_1 (if (<= (* x y) 1e+83) t_2 t_3)))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = 2.0 * (z * t);
double t_2 = -2.0 * (a * (c * i));
double t_3 = (x * y) * 2.0;
double tmp;
if ((x * y) <= -7.5e-57) {
tmp = t_3;
} else if ((x * y) <= -2e-309) {
tmp = t_1;
} else if ((x * y) <= 1.5e-141) {
tmp = t_2;
} else if ((x * y) <= 9e-82) {
tmp = t_1;
} else if ((x * y) <= 1e+83) {
tmp = t_2;
} else {
tmp = t_3;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_1 = 2.0d0 * (z * t)
t_2 = (-2.0d0) * (a * (c * i))
t_3 = (x * y) * 2.0d0
if ((x * y) <= (-7.5d-57)) then
tmp = t_3
else if ((x * y) <= (-2d-309)) then
tmp = t_1
else if ((x * y) <= 1.5d-141) then
tmp = t_2
else if ((x * y) <= 9d-82) then
tmp = t_1
else if ((x * y) <= 1d+83) then
tmp = t_2
else
tmp = t_3
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = 2.0 * (z * t);
double t_2 = -2.0 * (a * (c * i));
double t_3 = (x * y) * 2.0;
double tmp;
if ((x * y) <= -7.5e-57) {
tmp = t_3;
} else if ((x * y) <= -2e-309) {
tmp = t_1;
} else if ((x * y) <= 1.5e-141) {
tmp = t_2;
} else if ((x * y) <= 9e-82) {
tmp = t_1;
} else if ((x * y) <= 1e+83) {
tmp = t_2;
} else {
tmp = t_3;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = 2.0 * (z * t) t_2 = -2.0 * (a * (c * i)) t_3 = (x * y) * 2.0 tmp = 0 if (x * y) <= -7.5e-57: tmp = t_3 elif (x * y) <= -2e-309: tmp = t_1 elif (x * y) <= 1.5e-141: tmp = t_2 elif (x * y) <= 9e-82: tmp = t_1 elif (x * y) <= 1e+83: tmp = t_2 else: tmp = t_3 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(2.0 * Float64(z * t)) t_2 = Float64(-2.0 * Float64(a * Float64(c * i))) t_3 = Float64(Float64(x * y) * 2.0) tmp = 0.0 if (Float64(x * y) <= -7.5e-57) tmp = t_3; elseif (Float64(x * y) <= -2e-309) tmp = t_1; elseif (Float64(x * y) <= 1.5e-141) tmp = t_2; elseif (Float64(x * y) <= 9e-82) tmp = t_1; elseif (Float64(x * y) <= 1e+83) tmp = t_2; else tmp = t_3; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = 2.0 * (z * t); t_2 = -2.0 * (a * (c * i)); t_3 = (x * y) * 2.0; tmp = 0.0; if ((x * y) <= -7.5e-57) tmp = t_3; elseif ((x * y) <= -2e-309) tmp = t_1; elseif ((x * y) <= 1.5e-141) tmp = t_2; elseif ((x * y) <= 9e-82) tmp = t_1; elseif ((x * y) <= 1e+83) tmp = t_2; else tmp = t_3; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(2.0 * N[(z * t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(-2.0 * N[(a * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(x * y), $MachinePrecision] * 2.0), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -7.5e-57], t$95$3, If[LessEqual[N[(x * y), $MachinePrecision], -2e-309], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 1.5e-141], t$95$2, If[LessEqual[N[(x * y), $MachinePrecision], 9e-82], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 1e+83], t$95$2, t$95$3]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 2 \cdot \left(z \cdot t\right)\\
t_2 := -2 \cdot \left(a \cdot \left(c \cdot i\right)\right)\\
t_3 := \left(x \cdot y\right) \cdot 2\\
\mathbf{if}\;x \cdot y \leq -7.5 \cdot 10^{-57}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;x \cdot y \leq -2 \cdot 10^{-309}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \cdot y \leq 1.5 \cdot 10^{-141}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x \cdot y \leq 9 \cdot 10^{-82}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \cdot y \leq 10^{+83}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;t_3\\
\end{array}
\end{array}
if (*.f64 x y) < -7.49999999999999973e-57 or 1.00000000000000003e83 < (*.f64 x y) Initial program 86.4%
Taylor expanded in x around inf 57.3%
if -7.49999999999999973e-57 < (*.f64 x y) < -1.9999999999999988e-309 or 1.49999999999999992e-141 < (*.f64 x y) < 8.9999999999999997e-82Initial program 92.2%
Taylor expanded in z around inf 53.3%
if -1.9999999999999988e-309 < (*.f64 x y) < 1.49999999999999992e-141 or 8.9999999999999997e-82 < (*.f64 x y) < 1.00000000000000003e83Initial program 94.3%
Taylor expanded in a around inf 43.6%
Taylor expanded in a around 0 43.6%
Final simplification51.7%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* c (* (+ a (* b c)) i))))
(if (<= (* x y) -6.5e+292)
(* (* x y) 2.0)
(if (or (<= (* x y) -1.8e-56) (not (<= (* x y) 8.6e+17)))
(* 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 ((x * y) <= -6.5e+292) {
tmp = (x * y) * 2.0;
} else if (((x * y) <= -1.8e-56) || !((x * y) <= 8.6e+17)) {
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 ((x * y) <= (-6.5d+292)) then
tmp = (x * y) * 2.0d0
else if (((x * y) <= (-1.8d-56)) .or. (.not. ((x * y) <= 8.6d+17))) 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 ((x * y) <= -6.5e+292) {
tmp = (x * y) * 2.0;
} else if (((x * y) <= -1.8e-56) || !((x * y) <= 8.6e+17)) {
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 (x * y) <= -6.5e+292: tmp = (x * y) * 2.0 elif ((x * y) <= -1.8e-56) or not ((x * y) <= 8.6e+17): 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 (Float64(x * y) <= -6.5e+292) tmp = Float64(Float64(x * y) * 2.0); elseif ((Float64(x * y) <= -1.8e-56) || !(Float64(x * y) <= 8.6e+17)) 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 ((x * y) <= -6.5e+292) tmp = (x * y) * 2.0; elseif (((x * y) <= -1.8e-56) || ~(((x * y) <= 8.6e+17))) 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[N[(x * y), $MachinePrecision], -6.5e+292], N[(N[(x * y), $MachinePrecision] * 2.0), $MachinePrecision], If[Or[LessEqual[N[(x * y), $MachinePrecision], -1.8e-56], N[Not[LessEqual[N[(x * y), $MachinePrecision], 8.6e+17]], $MachinePrecision]], 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}\;x \cdot y \leq -6.5 \cdot 10^{+292}:\\
\;\;\;\;\left(x \cdot y\right) \cdot 2\\
\mathbf{elif}\;x \cdot y \leq -1.8 \cdot 10^{-56} \lor \neg \left(x \cdot y \leq 8.6 \cdot 10^{+17}\right):\\
\;\;\;\;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 (*.f64 x y) < -6.4999999999999999e292Initial program 71.4%
Taylor expanded in x around inf 90.5%
if -6.4999999999999999e292 < (*.f64 x y) < -1.79999999999999989e-56 or 8.6e17 < (*.f64 x y) Initial program 89.8%
Taylor expanded in z around 0 79.1%
if -1.79999999999999989e-56 < (*.f64 x y) < 8.6e17Initial program 93.8%
Taylor expanded in x around 0 87.4%
Final simplification84.2%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* 2.0 (- (* x y) (* c (* (* b c) i))))))
(if (<= c -1.5e+60)
t_1
(if (<= c -9.5e+16)
(* 2.0 (- (* z t) (* i (* c (* b c)))))
(if (<= c -7.5e-107)
t_1
(if (or (<= c 4.3e-26) (and (not (<= c 1.5e+84)) (<= c 1.35e+119)))
(* (+ (* x y) (* z t)) 2.0)
(* 2.0 (* c (* (+ a (* b c)) (- i))))))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = 2.0 * ((x * y) - (c * ((b * c) * i)));
double tmp;
if (c <= -1.5e+60) {
tmp = t_1;
} else if (c <= -9.5e+16) {
tmp = 2.0 * ((z * t) - (i * (c * (b * c))));
} else if (c <= -7.5e-107) {
tmp = t_1;
} else if ((c <= 4.3e-26) || (!(c <= 1.5e+84) && (c <= 1.35e+119))) {
tmp = ((x * y) + (z * t)) * 2.0;
} else {
tmp = 2.0 * (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) :: t_1
real(8) :: tmp
t_1 = 2.0d0 * ((x * y) - (c * ((b * c) * i)))
if (c <= (-1.5d+60)) then
tmp = t_1
else if (c <= (-9.5d+16)) then
tmp = 2.0d0 * ((z * t) - (i * (c * (b * c))))
else if (c <= (-7.5d-107)) then
tmp = t_1
else if ((c <= 4.3d-26) .or. (.not. (c <= 1.5d+84)) .and. (c <= 1.35d+119)) then
tmp = ((x * y) + (z * t)) * 2.0d0
else
tmp = 2.0d0 * (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 t_1 = 2.0 * ((x * y) - (c * ((b * c) * i)));
double tmp;
if (c <= -1.5e+60) {
tmp = t_1;
} else if (c <= -9.5e+16) {
tmp = 2.0 * ((z * t) - (i * (c * (b * c))));
} else if (c <= -7.5e-107) {
tmp = t_1;
} else if ((c <= 4.3e-26) || (!(c <= 1.5e+84) && (c <= 1.35e+119))) {
tmp = ((x * y) + (z * t)) * 2.0;
} else {
tmp = 2.0 * (c * ((a + (b * c)) * -i));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = 2.0 * ((x * y) - (c * ((b * c) * i))) tmp = 0 if c <= -1.5e+60: tmp = t_1 elif c <= -9.5e+16: tmp = 2.0 * ((z * t) - (i * (c * (b * c)))) elif c <= -7.5e-107: tmp = t_1 elif (c <= 4.3e-26) or (not (c <= 1.5e+84) and (c <= 1.35e+119)): tmp = ((x * y) + (z * t)) * 2.0 else: tmp = 2.0 * (c * ((a + (b * c)) * -i)) return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(2.0 * Float64(Float64(x * y) - Float64(c * Float64(Float64(b * c) * i)))) tmp = 0.0 if (c <= -1.5e+60) tmp = t_1; elseif (c <= -9.5e+16) tmp = Float64(2.0 * Float64(Float64(z * t) - Float64(i * Float64(c * Float64(b * c))))); elseif (c <= -7.5e-107) tmp = t_1; elseif ((c <= 4.3e-26) || (!(c <= 1.5e+84) && (c <= 1.35e+119))) tmp = Float64(Float64(Float64(x * y) + Float64(z * t)) * 2.0); else tmp = Float64(2.0 * Float64(c * Float64(Float64(a + Float64(b * c)) * Float64(-i)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = 2.0 * ((x * y) - (c * ((b * c) * i))); tmp = 0.0; if (c <= -1.5e+60) tmp = t_1; elseif (c <= -9.5e+16) tmp = 2.0 * ((z * t) - (i * (c * (b * c)))); elseif (c <= -7.5e-107) tmp = t_1; elseif ((c <= 4.3e-26) || (~((c <= 1.5e+84)) && (c <= 1.35e+119))) tmp = ((x * y) + (z * t)) * 2.0; else tmp = 2.0 * (c * ((a + (b * c)) * -i)); 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[(c * N[(N[(b * c), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[c, -1.5e+60], t$95$1, If[LessEqual[c, -9.5e+16], N[(2.0 * N[(N[(z * t), $MachinePrecision] - N[(i * N[(c * N[(b * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, -7.5e-107], t$95$1, If[Or[LessEqual[c, 4.3e-26], And[N[Not[LessEqual[c, 1.5e+84]], $MachinePrecision], LessEqual[c, 1.35e+119]]], N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision], N[(2.0 * N[(c * N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * (-i)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 2 \cdot \left(x \cdot y - c \cdot \left(\left(b \cdot c\right) \cdot i\right)\right)\\
\mathbf{if}\;c \leq -1.5 \cdot 10^{+60}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;c \leq -9.5 \cdot 10^{+16}:\\
\;\;\;\;2 \cdot \left(z \cdot t - i \cdot \left(c \cdot \left(b \cdot c\right)\right)\right)\\
\mathbf{elif}\;c \leq -7.5 \cdot 10^{-107}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;c \leq 4.3 \cdot 10^{-26} \lor \neg \left(c \leq 1.5 \cdot 10^{+84}\right) \land c \leq 1.35 \cdot 10^{+119}:\\
\;\;\;\;\left(x \cdot y + z \cdot t\right) \cdot 2\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(c \cdot \left(\left(a + b \cdot c\right) \cdot \left(-i\right)\right)\right)\\
\end{array}
\end{array}
if c < -1.4999999999999999e60 or -9.5e16 < c < -7.50000000000000047e-107Initial program 88.2%
Taylor expanded in z around 0 87.1%
Taylor expanded in a around 0 77.0%
if -1.4999999999999999e60 < c < -9.5e16Initial program 100.0%
Taylor expanded in x around 0 99.9%
Taylor expanded in a around 0 82.8%
associate-*r*91.1%
*-commutative91.1%
unpow291.1%
associate-*r*91.3%
Simplified91.3%
if -7.50000000000000047e-107 < c < 4.29999999999999988e-26 or 1.49999999999999998e84 < c < 1.3499999999999999e119Initial program 94.4%
Taylor expanded in c around 0 78.3%
if 4.29999999999999988e-26 < c < 1.49999999999999998e84 or 1.3499999999999999e119 < c Initial program 84.3%
Taylor expanded in i around inf 76.9%
Final simplification78.1%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* c (- i))) (t_2 (* (+ (* x y) (* z t)) 2.0)))
(if (<= c -3.8e+37)
(* 2.0 (* c (* b t_1)))
(if (<= c 2.5e-27)
t_2
(if (<= c 8.5e+93)
(* 2.0 (- (* z t) (* c (* a i))))
(if (<= c 3.5e+121)
t_2
(if (<= c 5.8e+128)
(* -2.0 (* a (* c i)))
(* 2.0 (* b (* c t_1))))))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = c * -i;
double t_2 = ((x * y) + (z * t)) * 2.0;
double tmp;
if (c <= -3.8e+37) {
tmp = 2.0 * (c * (b * t_1));
} else if (c <= 2.5e-27) {
tmp = t_2;
} else if (c <= 8.5e+93) {
tmp = 2.0 * ((z * t) - (c * (a * i)));
} else if (c <= 3.5e+121) {
tmp = t_2;
} else if (c <= 5.8e+128) {
tmp = -2.0 * (a * (c * i));
} else {
tmp = 2.0 * (b * (c * 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) :: t_2
real(8) :: tmp
t_1 = c * -i
t_2 = ((x * y) + (z * t)) * 2.0d0
if (c <= (-3.8d+37)) then
tmp = 2.0d0 * (c * (b * t_1))
else if (c <= 2.5d-27) then
tmp = t_2
else if (c <= 8.5d+93) then
tmp = 2.0d0 * ((z * t) - (c * (a * i)))
else if (c <= 3.5d+121) then
tmp = t_2
else if (c <= 5.8d+128) then
tmp = (-2.0d0) * (a * (c * i))
else
tmp = 2.0d0 * (b * (c * 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 * -i;
double t_2 = ((x * y) + (z * t)) * 2.0;
double tmp;
if (c <= -3.8e+37) {
tmp = 2.0 * (c * (b * t_1));
} else if (c <= 2.5e-27) {
tmp = t_2;
} else if (c <= 8.5e+93) {
tmp = 2.0 * ((z * t) - (c * (a * i)));
} else if (c <= 3.5e+121) {
tmp = t_2;
} else if (c <= 5.8e+128) {
tmp = -2.0 * (a * (c * i));
} else {
tmp = 2.0 * (b * (c * t_1));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = c * -i t_2 = ((x * y) + (z * t)) * 2.0 tmp = 0 if c <= -3.8e+37: tmp = 2.0 * (c * (b * t_1)) elif c <= 2.5e-27: tmp = t_2 elif c <= 8.5e+93: tmp = 2.0 * ((z * t) - (c * (a * i))) elif c <= 3.5e+121: tmp = t_2 elif c <= 5.8e+128: tmp = -2.0 * (a * (c * i)) else: tmp = 2.0 * (b * (c * t_1)) return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(c * Float64(-i)) t_2 = Float64(Float64(Float64(x * y) + Float64(z * t)) * 2.0) tmp = 0.0 if (c <= -3.8e+37) tmp = Float64(2.0 * Float64(c * Float64(b * t_1))); elseif (c <= 2.5e-27) tmp = t_2; elseif (c <= 8.5e+93) tmp = Float64(2.0 * Float64(Float64(z * t) - Float64(c * Float64(a * i)))); elseif (c <= 3.5e+121) tmp = t_2; elseif (c <= 5.8e+128) tmp = Float64(-2.0 * Float64(a * Float64(c * i))); else tmp = Float64(2.0 * Float64(b * Float64(c * t_1))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = c * -i; t_2 = ((x * y) + (z * t)) * 2.0; tmp = 0.0; if (c <= -3.8e+37) tmp = 2.0 * (c * (b * t_1)); elseif (c <= 2.5e-27) tmp = t_2; elseif (c <= 8.5e+93) tmp = 2.0 * ((z * t) - (c * (a * i))); elseif (c <= 3.5e+121) tmp = t_2; elseif (c <= 5.8e+128) tmp = -2.0 * (a * (c * i)); else tmp = 2.0 * (b * (c * t_1)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(c * (-i)), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision]}, If[LessEqual[c, -3.8e+37], N[(2.0 * N[(c * N[(b * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, 2.5e-27], t$95$2, If[LessEqual[c, 8.5e+93], N[(2.0 * N[(N[(z * t), $MachinePrecision] - N[(c * N[(a * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, 3.5e+121], t$95$2, If[LessEqual[c, 5.8e+128], N[(-2.0 * N[(a * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(b * N[(c * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := c \cdot \left(-i\right)\\
t_2 := \left(x \cdot y + z \cdot t\right) \cdot 2\\
\mathbf{if}\;c \leq -3.8 \cdot 10^{+37}:\\
\;\;\;\;2 \cdot \left(c \cdot \left(b \cdot t_1\right)\right)\\
\mathbf{elif}\;c \leq 2.5 \cdot 10^{-27}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;c \leq 8.5 \cdot 10^{+93}:\\
\;\;\;\;2 \cdot \left(z \cdot t - c \cdot \left(a \cdot i\right)\right)\\
\mathbf{elif}\;c \leq 3.5 \cdot 10^{+121}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;c \leq 5.8 \cdot 10^{+128}:\\
\;\;\;\;-2 \cdot \left(a \cdot \left(c \cdot i\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(b \cdot \left(c \cdot t_1\right)\right)\\
\end{array}
\end{array}
if c < -3.7999999999999999e37Initial program 88.8%
Taylor expanded in z around 0 90.6%
Taylor expanded in c around inf 64.8%
mul-1-neg64.8%
*-commutative64.8%
*-commutative64.8%
associate-*r*64.7%
*-commutative64.7%
unpow264.7%
associate-*r*66.6%
*-commutative66.6%
associate-*l*68.5%
*-commutative68.5%
distribute-rgt-neg-in68.5%
associate-*r*68.5%
*-commutative68.5%
distribute-rgt-neg-in68.5%
Simplified68.5%
if -3.7999999999999999e37 < c < 2.5000000000000001e-27 or 8.5000000000000005e93 < c < 3.5e121Initial program 93.8%
Taylor expanded in c around 0 75.0%
if 2.5000000000000001e-27 < c < 8.5000000000000005e93Initial program 84.6%
Taylor expanded in a around inf 62.2%
*-commutative62.2%
Simplified62.2%
Taylor expanded in x around 0 54.1%
*-commutative54.1%
associate-*l*57.2%
*-commutative57.2%
Simplified57.2%
if 3.5e121 < c < 5.8000000000000001e128Initial program 68.0%
Taylor expanded in a around inf 100.0%
Taylor expanded in a around 0 100.0%
if 5.8000000000000001e128 < c Initial program 86.6%
Taylor expanded in b around inf 78.5%
mul-1-neg78.5%
*-commutative78.5%
distribute-rgt-neg-in78.5%
unpow278.5%
associate-*r*76.0%
Simplified76.0%
Final simplification71.9%
(FPCore (x y z t a b c i)
:precision binary64
(if (or (<= c -3.7e+29)
(not
(or (<= c 1.65e-29) (and (not (<= c 1.9e+84)) (<= c 1.35e+119)))))
(* 2.0 (* c (* (+ a (* b c)) (- i))))
(* (+ (* x y) (* z t)) 2.0)))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((c <= -3.7e+29) || !((c <= 1.65e-29) || (!(c <= 1.9e+84) && (c <= 1.35e+119)))) {
tmp = 2.0 * (c * ((a + (b * c)) * -i));
} else {
tmp = ((x * y) + (z * t)) * 2.0;
}
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 <= (-3.7d+29)) .or. (.not. (c <= 1.65d-29) .or. (.not. (c <= 1.9d+84)) .and. (c <= 1.35d+119))) then
tmp = 2.0d0 * (c * ((a + (b * c)) * -i))
else
tmp = ((x * y) + (z * t)) * 2.0d0
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 <= -3.7e+29) || !((c <= 1.65e-29) || (!(c <= 1.9e+84) && (c <= 1.35e+119)))) {
tmp = 2.0 * (c * ((a + (b * c)) * -i));
} else {
tmp = ((x * y) + (z * t)) * 2.0;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (c <= -3.7e+29) or not ((c <= 1.65e-29) or (not (c <= 1.9e+84) and (c <= 1.35e+119))): tmp = 2.0 * (c * ((a + (b * c)) * -i)) else: tmp = ((x * y) + (z * t)) * 2.0 return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((c <= -3.7e+29) || !((c <= 1.65e-29) || (!(c <= 1.9e+84) && (c <= 1.35e+119)))) tmp = Float64(2.0 * Float64(c * Float64(Float64(a + Float64(b * c)) * Float64(-i)))); else tmp = Float64(Float64(Float64(x * y) + Float64(z * t)) * 2.0); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if ((c <= -3.7e+29) || ~(((c <= 1.65e-29) || (~((c <= 1.9e+84)) && (c <= 1.35e+119))))) tmp = 2.0 * (c * ((a + (b * c)) * -i)); else tmp = ((x * y) + (z * t)) * 2.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[c, -3.7e+29], N[Not[Or[LessEqual[c, 1.65e-29], And[N[Not[LessEqual[c, 1.9e+84]], $MachinePrecision], LessEqual[c, 1.35e+119]]]], $MachinePrecision]], N[(2.0 * N[(c * N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * (-i)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \leq -3.7 \cdot 10^{+29} \lor \neg \left(c \leq 1.65 \cdot 10^{-29} \lor \neg \left(c \leq 1.9 \cdot 10^{+84}\right) \land c \leq 1.35 \cdot 10^{+119}\right):\\
\;\;\;\;2 \cdot \left(c \cdot \left(\left(a + b \cdot c\right) \cdot \left(-i\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x \cdot y + z \cdot t\right) \cdot 2\\
\end{array}
\end{array}
if c < -3.69999999999999974e29 or 1.65000000000000014e-29 < c < 1.9e84 or 1.3499999999999999e119 < c Initial program 86.5%
Taylor expanded in i around inf 77.5%
if -3.69999999999999974e29 < c < 1.65000000000000014e-29 or 1.9e84 < c < 1.3499999999999999e119Initial program 93.8%
Taylor expanded in c around 0 74.9%
Final simplification76.2%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= c -1.1e+38) (not (<= c 2.3e-21))) (* 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 <= -1.1e+38) || !(c <= 2.3e-21)) {
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 <= (-1.1d+38)) .or. (.not. (c <= 2.3d-21))) 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 <= -1.1e+38) || !(c <= 2.3e-21)) {
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 <= -1.1e+38) or not (c <= 2.3e-21): 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 <= -1.1e+38) || !(c <= 2.3e-21)) 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 <= -1.1e+38) || ~((c <= 2.3e-21))) 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, -1.1e+38], N[Not[LessEqual[c, 2.3e-21]], $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 -1.1 \cdot 10^{+38} \lor \neg \left(c \leq 2.3 \cdot 10^{-21}\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 < -1.10000000000000003e38 or 2.29999999999999999e-21 < c Initial program 84.6%
Taylor expanded in z around 0 87.0%
if -1.10000000000000003e38 < c < 2.29999999999999999e-21Initial program 95.9%
Taylor expanded in a around inf 89.2%
*-commutative89.2%
Simplified89.2%
Final simplification88.1%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* c (- i))) (t_2 (* (+ (* x y) (* z t)) 2.0)))
(if (<= c -6e+37)
(* 2.0 (* c (* b t_1)))
(if (<= c 9.2e-21)
t_2
(if (<= c 5e+44)
(* c (* (* b c) (* i -2.0)))
(if (<= c 6e+128) t_2 (* 2.0 (* b (* c t_1)))))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = c * -i;
double t_2 = ((x * y) + (z * t)) * 2.0;
double tmp;
if (c <= -6e+37) {
tmp = 2.0 * (c * (b * t_1));
} else if (c <= 9.2e-21) {
tmp = t_2;
} else if (c <= 5e+44) {
tmp = c * ((b * c) * (i * -2.0));
} else if (c <= 6e+128) {
tmp = t_2;
} else {
tmp = 2.0 * (b * (c * 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) :: t_2
real(8) :: tmp
t_1 = c * -i
t_2 = ((x * y) + (z * t)) * 2.0d0
if (c <= (-6d+37)) then
tmp = 2.0d0 * (c * (b * t_1))
else if (c <= 9.2d-21) then
tmp = t_2
else if (c <= 5d+44) then
tmp = c * ((b * c) * (i * (-2.0d0)))
else if (c <= 6d+128) then
tmp = t_2
else
tmp = 2.0d0 * (b * (c * 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 * -i;
double t_2 = ((x * y) + (z * t)) * 2.0;
double tmp;
if (c <= -6e+37) {
tmp = 2.0 * (c * (b * t_1));
} else if (c <= 9.2e-21) {
tmp = t_2;
} else if (c <= 5e+44) {
tmp = c * ((b * c) * (i * -2.0));
} else if (c <= 6e+128) {
tmp = t_2;
} else {
tmp = 2.0 * (b * (c * t_1));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = c * -i t_2 = ((x * y) + (z * t)) * 2.0 tmp = 0 if c <= -6e+37: tmp = 2.0 * (c * (b * t_1)) elif c <= 9.2e-21: tmp = t_2 elif c <= 5e+44: tmp = c * ((b * c) * (i * -2.0)) elif c <= 6e+128: tmp = t_2 else: tmp = 2.0 * (b * (c * t_1)) return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(c * Float64(-i)) t_2 = Float64(Float64(Float64(x * y) + Float64(z * t)) * 2.0) tmp = 0.0 if (c <= -6e+37) tmp = Float64(2.0 * Float64(c * Float64(b * t_1))); elseif (c <= 9.2e-21) tmp = t_2; elseif (c <= 5e+44) tmp = Float64(c * Float64(Float64(b * c) * Float64(i * -2.0))); elseif (c <= 6e+128) tmp = t_2; else tmp = Float64(2.0 * Float64(b * Float64(c * t_1))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = c * -i; t_2 = ((x * y) + (z * t)) * 2.0; tmp = 0.0; if (c <= -6e+37) tmp = 2.0 * (c * (b * t_1)); elseif (c <= 9.2e-21) tmp = t_2; elseif (c <= 5e+44) tmp = c * ((b * c) * (i * -2.0)); elseif (c <= 6e+128) tmp = t_2; else tmp = 2.0 * (b * (c * t_1)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(c * (-i)), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision]}, If[LessEqual[c, -6e+37], N[(2.0 * N[(c * N[(b * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, 9.2e-21], t$95$2, If[LessEqual[c, 5e+44], N[(c * N[(N[(b * c), $MachinePrecision] * N[(i * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, 6e+128], t$95$2, N[(2.0 * N[(b * N[(c * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := c \cdot \left(-i\right)\\
t_2 := \left(x \cdot y + z \cdot t\right) \cdot 2\\
\mathbf{if}\;c \leq -6 \cdot 10^{+37}:\\
\;\;\;\;2 \cdot \left(c \cdot \left(b \cdot t_1\right)\right)\\
\mathbf{elif}\;c \leq 9.2 \cdot 10^{-21}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;c \leq 5 \cdot 10^{+44}:\\
\;\;\;\;c \cdot \left(\left(b \cdot c\right) \cdot \left(i \cdot -2\right)\right)\\
\mathbf{elif}\;c \leq 6 \cdot 10^{+128}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(b \cdot \left(c \cdot t_1\right)\right)\\
\end{array}
\end{array}
if c < -6.00000000000000043e37Initial program 88.8%
Taylor expanded in z around 0 90.6%
Taylor expanded in c around inf 64.8%
mul-1-neg64.8%
*-commutative64.8%
*-commutative64.8%
associate-*r*64.7%
*-commutative64.7%
unpow264.7%
associate-*r*66.6%
*-commutative66.6%
associate-*l*68.5%
*-commutative68.5%
distribute-rgt-neg-in68.5%
associate-*r*68.5%
*-commutative68.5%
distribute-rgt-neg-in68.5%
Simplified68.5%
if -6.00000000000000043e37 < c < 9.19999999999999998e-21 or 4.9999999999999996e44 < c < 5.9999999999999997e128Initial program 91.7%
Taylor expanded in c around 0 68.8%
if 9.19999999999999998e-21 < c < 4.9999999999999996e44Initial program 90.2%
Taylor expanded in i around inf 90.9%
Taylor expanded in a around 0 62.5%
Taylor expanded in c around 0 53.1%
*-commutative53.1%
associate-*r*62.5%
associate-*l*62.5%
unpow262.5%
associate-*r*62.3%
*-commutative62.3%
Simplified62.3%
Taylor expanded in c around 0 53.1%
*-commutative53.1%
associate-*r*62.5%
*-commutative62.5%
unpow262.5%
associate-*r*62.3%
associate-*r*62.3%
associate-*l*62.5%
Simplified62.5%
if 5.9999999999999997e128 < c Initial program 86.6%
Taylor expanded in b around inf 78.5%
mul-1-neg78.5%
*-commutative78.5%
distribute-rgt-neg-in78.5%
unpow278.5%
associate-*r*76.0%
Simplified76.0%
Final simplification69.5%
(FPCore (x y z t a b c i)
:precision binary64
(if (or (<= c -2.8e+38)
(not (or (<= c 7e-21) (and (not (<= c 6.6e+44)) (<= c 5.8e+128)))))
(* c (* (* b c) (* i -2.0)))
(* (+ (* x y) (* z t)) 2.0)))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((c <= -2.8e+38) || !((c <= 7e-21) || (!(c <= 6.6e+44) && (c <= 5.8e+128)))) {
tmp = c * ((b * c) * (i * -2.0));
} else {
tmp = ((x * y) + (z * t)) * 2.0;
}
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 <= (-2.8d+38)) .or. (.not. (c <= 7d-21) .or. (.not. (c <= 6.6d+44)) .and. (c <= 5.8d+128))) then
tmp = c * ((b * c) * (i * (-2.0d0)))
else
tmp = ((x * y) + (z * t)) * 2.0d0
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 <= -2.8e+38) || !((c <= 7e-21) || (!(c <= 6.6e+44) && (c <= 5.8e+128)))) {
tmp = c * ((b * c) * (i * -2.0));
} else {
tmp = ((x * y) + (z * t)) * 2.0;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (c <= -2.8e+38) or not ((c <= 7e-21) or (not (c <= 6.6e+44) and (c <= 5.8e+128))): tmp = c * ((b * c) * (i * -2.0)) else: tmp = ((x * y) + (z * t)) * 2.0 return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((c <= -2.8e+38) || !((c <= 7e-21) || (!(c <= 6.6e+44) && (c <= 5.8e+128)))) tmp = Float64(c * Float64(Float64(b * c) * Float64(i * -2.0))); else tmp = Float64(Float64(Float64(x * y) + Float64(z * t)) * 2.0); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if ((c <= -2.8e+38) || ~(((c <= 7e-21) || (~((c <= 6.6e+44)) && (c <= 5.8e+128))))) tmp = c * ((b * c) * (i * -2.0)); else tmp = ((x * y) + (z * t)) * 2.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[c, -2.8e+38], N[Not[Or[LessEqual[c, 7e-21], And[N[Not[LessEqual[c, 6.6e+44]], $MachinePrecision], LessEqual[c, 5.8e+128]]]], $MachinePrecision]], N[(c * N[(N[(b * c), $MachinePrecision] * N[(i * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \leq -2.8 \cdot 10^{+38} \lor \neg \left(c \leq 7 \cdot 10^{-21} \lor \neg \left(c \leq 6.6 \cdot 10^{+44}\right) \land c \leq 5.8 \cdot 10^{+128}\right):\\
\;\;\;\;c \cdot \left(\left(b \cdot c\right) \cdot \left(i \cdot -2\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x \cdot y + z \cdot t\right) \cdot 2\\
\end{array}
\end{array}
if c < -2.8e38 or 7.0000000000000007e-21 < c < 6.60000000000000027e44 or 5.8000000000000001e128 < c Initial program 88.1%
Taylor expanded in i around inf 81.5%
Taylor expanded in a around 0 67.6%
Taylor expanded in c around 0 68.7%
*-commutative68.7%
associate-*r*67.7%
associate-*l*67.7%
unpow267.7%
associate-*r*68.5%
*-commutative68.5%
Simplified68.5%
Taylor expanded in c around 0 68.7%
*-commutative68.7%
associate-*r*67.7%
*-commutative67.7%
unpow267.7%
associate-*r*68.5%
associate-*r*68.5%
associate-*l*67.6%
Simplified67.6%
if -2.8e38 < c < 7.0000000000000007e-21 or 6.60000000000000027e44 < c < 5.8000000000000001e128Initial program 91.7%
Taylor expanded in c around 0 68.8%
Final simplification68.4%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* (+ (* x y) (* z t)) 2.0)) (t_2 (* c (* (* b c) (* i -2.0)))))
(if (<= c -3.2e+37)
t_2
(if (<= c 8.5e-21)
t_1
(if (<= c 7.6e+44)
t_2
(if (<= c 5.8e+128) t_1 (* -2.0 (* i (* b (* c c))))))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = ((x * y) + (z * t)) * 2.0;
double t_2 = c * ((b * c) * (i * -2.0));
double tmp;
if (c <= -3.2e+37) {
tmp = t_2;
} else if (c <= 8.5e-21) {
tmp = t_1;
} else if (c <= 7.6e+44) {
tmp = t_2;
} else if (c <= 5.8e+128) {
tmp = t_1;
} else {
tmp = -2.0 * (i * (b * (c * 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) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = ((x * y) + (z * t)) * 2.0d0
t_2 = c * ((b * c) * (i * (-2.0d0)))
if (c <= (-3.2d+37)) then
tmp = t_2
else if (c <= 8.5d-21) then
tmp = t_1
else if (c <= 7.6d+44) then
tmp = t_2
else if (c <= 5.8d+128) then
tmp = t_1
else
tmp = (-2.0d0) * (i * (b * (c * 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 t_1 = ((x * y) + (z * t)) * 2.0;
double t_2 = c * ((b * c) * (i * -2.0));
double tmp;
if (c <= -3.2e+37) {
tmp = t_2;
} else if (c <= 8.5e-21) {
tmp = t_1;
} else if (c <= 7.6e+44) {
tmp = t_2;
} else if (c <= 5.8e+128) {
tmp = t_1;
} else {
tmp = -2.0 * (i * (b * (c * c)));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = ((x * y) + (z * t)) * 2.0 t_2 = c * ((b * c) * (i * -2.0)) tmp = 0 if c <= -3.2e+37: tmp = t_2 elif c <= 8.5e-21: tmp = t_1 elif c <= 7.6e+44: tmp = t_2 elif c <= 5.8e+128: tmp = t_1 else: tmp = -2.0 * (i * (b * (c * c))) return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(Float64(x * y) + Float64(z * t)) * 2.0) t_2 = Float64(c * Float64(Float64(b * c) * Float64(i * -2.0))) tmp = 0.0 if (c <= -3.2e+37) tmp = t_2; elseif (c <= 8.5e-21) tmp = t_1; elseif (c <= 7.6e+44) tmp = t_2; elseif (c <= 5.8e+128) tmp = t_1; else tmp = Float64(-2.0 * Float64(i * Float64(b * Float64(c * c)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = ((x * y) + (z * t)) * 2.0; t_2 = c * ((b * c) * (i * -2.0)); tmp = 0.0; if (c <= -3.2e+37) tmp = t_2; elseif (c <= 8.5e-21) tmp = t_1; elseif (c <= 7.6e+44) tmp = t_2; elseif (c <= 5.8e+128) tmp = t_1; else tmp = -2.0 * (i * (b * (c * c))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision]}, Block[{t$95$2 = N[(c * N[(N[(b * c), $MachinePrecision] * N[(i * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[c, -3.2e+37], t$95$2, If[LessEqual[c, 8.5e-21], t$95$1, If[LessEqual[c, 7.6e+44], t$95$2, If[LessEqual[c, 5.8e+128], t$95$1, N[(-2.0 * N[(i * N[(b * N[(c * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(x \cdot y + z \cdot t\right) \cdot 2\\
t_2 := c \cdot \left(\left(b \cdot c\right) \cdot \left(i \cdot -2\right)\right)\\
\mathbf{if}\;c \leq -3.2 \cdot 10^{+37}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;c \leq 8.5 \cdot 10^{-21}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;c \leq 7.6 \cdot 10^{+44}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;c \leq 5.8 \cdot 10^{+128}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;-2 \cdot \left(i \cdot \left(b \cdot \left(c \cdot c\right)\right)\right)\\
\end{array}
\end{array}
if c < -3.20000000000000014e37 or 8.4999999999999993e-21 < c < 7.6000000000000004e44Initial program 89.0%
Taylor expanded in i around inf 81.2%
Taylor expanded in a around 0 67.5%
Taylor expanded in c around 0 62.9%
*-commutative62.9%
associate-*r*64.3%
associate-*l*64.3%
unpow264.3%
associate-*r*65.9%
*-commutative65.9%
Simplified65.9%
Taylor expanded in c around 0 62.9%
*-commutative62.9%
associate-*r*64.3%
*-commutative64.3%
unpow264.3%
associate-*r*65.9%
associate-*r*65.9%
associate-*l*67.5%
Simplified67.5%
if -3.20000000000000014e37 < c < 8.4999999999999993e-21 or 7.6000000000000004e44 < c < 5.8000000000000001e128Initial program 91.7%
Taylor expanded in c around 0 68.8%
if 5.8000000000000001e128 < c Initial program 86.6%
Taylor expanded in i around inf 81.9%
Taylor expanded in a around 0 67.7%
Taylor expanded in c around 0 78.5%
*-commutative78.5%
associate-*r*73.4%
unpow273.4%
Simplified73.4%
Final simplification69.2%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* (+ (* x y) (* z t)) 2.0)))
(if (<= c -1.15e+38)
(* 2.0 (* c (* b (* c (- i)))))
(if (<= c 9.2e-21)
t_1
(if (<= c 3.8e+44)
(* c (* (* b c) (* i -2.0)))
(if (<= c 1.05e+129) t_1 (* -2.0 (* i (* b (* c c))))))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = ((x * y) + (z * t)) * 2.0;
double tmp;
if (c <= -1.15e+38) {
tmp = 2.0 * (c * (b * (c * -i)));
} else if (c <= 9.2e-21) {
tmp = t_1;
} else if (c <= 3.8e+44) {
tmp = c * ((b * c) * (i * -2.0));
} else if (c <= 1.05e+129) {
tmp = t_1;
} else {
tmp = -2.0 * (i * (b * (c * 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) :: t_1
real(8) :: tmp
t_1 = ((x * y) + (z * t)) * 2.0d0
if (c <= (-1.15d+38)) then
tmp = 2.0d0 * (c * (b * (c * -i)))
else if (c <= 9.2d-21) then
tmp = t_1
else if (c <= 3.8d+44) then
tmp = c * ((b * c) * (i * (-2.0d0)))
else if (c <= 1.05d+129) then
tmp = t_1
else
tmp = (-2.0d0) * (i * (b * (c * 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 t_1 = ((x * y) + (z * t)) * 2.0;
double tmp;
if (c <= -1.15e+38) {
tmp = 2.0 * (c * (b * (c * -i)));
} else if (c <= 9.2e-21) {
tmp = t_1;
} else if (c <= 3.8e+44) {
tmp = c * ((b * c) * (i * -2.0));
} else if (c <= 1.05e+129) {
tmp = t_1;
} else {
tmp = -2.0 * (i * (b * (c * c)));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = ((x * y) + (z * t)) * 2.0 tmp = 0 if c <= -1.15e+38: tmp = 2.0 * (c * (b * (c * -i))) elif c <= 9.2e-21: tmp = t_1 elif c <= 3.8e+44: tmp = c * ((b * c) * (i * -2.0)) elif c <= 1.05e+129: tmp = t_1 else: tmp = -2.0 * (i * (b * (c * c))) return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(Float64(x * y) + Float64(z * t)) * 2.0) tmp = 0.0 if (c <= -1.15e+38) tmp = Float64(2.0 * Float64(c * Float64(b * Float64(c * Float64(-i))))); elseif (c <= 9.2e-21) tmp = t_1; elseif (c <= 3.8e+44) tmp = Float64(c * Float64(Float64(b * c) * Float64(i * -2.0))); elseif (c <= 1.05e+129) tmp = t_1; else tmp = Float64(-2.0 * Float64(i * Float64(b * Float64(c * c)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = ((x * y) + (z * t)) * 2.0; tmp = 0.0; if (c <= -1.15e+38) tmp = 2.0 * (c * (b * (c * -i))); elseif (c <= 9.2e-21) tmp = t_1; elseif (c <= 3.8e+44) tmp = c * ((b * c) * (i * -2.0)); elseif (c <= 1.05e+129) tmp = t_1; else tmp = -2.0 * (i * (b * (c * c))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision]}, If[LessEqual[c, -1.15e+38], N[(2.0 * N[(c * N[(b * N[(c * (-i)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, 9.2e-21], t$95$1, If[LessEqual[c, 3.8e+44], N[(c * N[(N[(b * c), $MachinePrecision] * N[(i * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, 1.05e+129], t$95$1, N[(-2.0 * N[(i * N[(b * N[(c * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(x \cdot y + z \cdot t\right) \cdot 2\\
\mathbf{if}\;c \leq -1.15 \cdot 10^{+38}:\\
\;\;\;\;2 \cdot \left(c \cdot \left(b \cdot \left(c \cdot \left(-i\right)\right)\right)\right)\\
\mathbf{elif}\;c \leq 9.2 \cdot 10^{-21}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;c \leq 3.8 \cdot 10^{+44}:\\
\;\;\;\;c \cdot \left(\left(b \cdot c\right) \cdot \left(i \cdot -2\right)\right)\\
\mathbf{elif}\;c \leq 1.05 \cdot 10^{+129}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;-2 \cdot \left(i \cdot \left(b \cdot \left(c \cdot c\right)\right)\right)\\
\end{array}
\end{array}
if c < -1.1500000000000001e38Initial program 88.8%
Taylor expanded in z around 0 90.6%
Taylor expanded in c around inf 64.8%
mul-1-neg64.8%
*-commutative64.8%
*-commutative64.8%
associate-*r*64.7%
*-commutative64.7%
unpow264.7%
associate-*r*66.6%
*-commutative66.6%
associate-*l*68.5%
*-commutative68.5%
distribute-rgt-neg-in68.5%
associate-*r*68.5%
*-commutative68.5%
distribute-rgt-neg-in68.5%
Simplified68.5%
if -1.1500000000000001e38 < c < 9.19999999999999998e-21 or 3.8000000000000002e44 < c < 1.04999999999999998e129Initial program 91.7%
Taylor expanded in c around 0 68.8%
if 9.19999999999999998e-21 < c < 3.8000000000000002e44Initial program 90.2%
Taylor expanded in i around inf 90.9%
Taylor expanded in a around 0 62.5%
Taylor expanded in c around 0 53.1%
*-commutative53.1%
associate-*r*62.5%
associate-*l*62.5%
unpow262.5%
associate-*r*62.3%
*-commutative62.3%
Simplified62.3%
Taylor expanded in c around 0 53.1%
*-commutative53.1%
associate-*r*62.5%
*-commutative62.5%
unpow262.5%
associate-*r*62.3%
associate-*r*62.3%
associate-*l*62.5%
Simplified62.5%
if 1.04999999999999998e129 < c Initial program 86.6%
Taylor expanded in i around inf 81.9%
Taylor expanded in a around 0 67.7%
Taylor expanded in c around 0 78.5%
*-commutative78.5%
associate-*r*73.4%
unpow273.4%
Simplified73.4%
Final simplification69.2%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= (* x y) -1.02e-59) (not (<= (* x y) 1.92e+99))) (* (* x y) 2.0) (* 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) <= -1.02e-59) || !((x * y) <= 1.92e+99)) {
tmp = (x * y) * 2.0;
} 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) <= (-1.02d-59)) .or. (.not. ((x * y) <= 1.92d+99))) then
tmp = (x * y) * 2.0d0
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) <= -1.02e-59) || !((x * y) <= 1.92e+99)) {
tmp = (x * y) * 2.0;
} else {
tmp = 2.0 * (z * t);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if ((x * y) <= -1.02e-59) or not ((x * y) <= 1.92e+99): tmp = (x * y) * 2.0 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) <= -1.02e-59) || !(Float64(x * y) <= 1.92e+99)) tmp = Float64(Float64(x * y) * 2.0); 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) <= -1.02e-59) || ~(((x * y) <= 1.92e+99))) tmp = (x * y) * 2.0; 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], -1.02e-59], N[Not[LessEqual[N[(x * y), $MachinePrecision], 1.92e+99]], $MachinePrecision]], N[(N[(x * y), $MachinePrecision] * 2.0), $MachinePrecision], N[(2.0 * N[(z * t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -1.02 \cdot 10^{-59} \lor \neg \left(x \cdot y \leq 1.92 \cdot 10^{+99}\right):\\
\;\;\;\;\left(x \cdot y\right) \cdot 2\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(z \cdot t\right)\\
\end{array}
\end{array}
if (*.f64 x y) < -1.01999999999999996e-59 or 1.9199999999999999e99 < (*.f64 x y) Initial program 86.2%
Taylor expanded in x around inf 58.3%
if -1.01999999999999996e-59 < (*.f64 x y) < 1.9199999999999999e99Initial program 93.7%
Taylor expanded in z around inf 35.9%
Final simplification45.9%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= i -1.4e+176) (not (<= i 5e+219))) (* -2.0 (* a (* c i))) (* (+ (* x y) (* z t)) 2.0)))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((i <= -1.4e+176) || !(i <= 5e+219)) {
tmp = -2.0 * (a * (c * i));
} else {
tmp = ((x * y) + (z * t)) * 2.0;
}
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 ((i <= (-1.4d+176)) .or. (.not. (i <= 5d+219))) then
tmp = (-2.0d0) * (a * (c * i))
else
tmp = ((x * y) + (z * t)) * 2.0d0
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 ((i <= -1.4e+176) || !(i <= 5e+219)) {
tmp = -2.0 * (a * (c * i));
} else {
tmp = ((x * y) + (z * t)) * 2.0;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (i <= -1.4e+176) or not (i <= 5e+219): tmp = -2.0 * (a * (c * i)) else: tmp = ((x * y) + (z * t)) * 2.0 return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((i <= -1.4e+176) || !(i <= 5e+219)) tmp = Float64(-2.0 * Float64(a * Float64(c * i))); else tmp = Float64(Float64(Float64(x * y) + Float64(z * t)) * 2.0); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if ((i <= -1.4e+176) || ~((i <= 5e+219))) tmp = -2.0 * (a * (c * i)); else tmp = ((x * y) + (z * t)) * 2.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[i, -1.4e+176], N[Not[LessEqual[i, 5e+219]], $MachinePrecision]], N[(-2.0 * N[(a * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;i \leq -1.4 \cdot 10^{+176} \lor \neg \left(i \leq 5 \cdot 10^{+219}\right):\\
\;\;\;\;-2 \cdot \left(a \cdot \left(c \cdot i\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x \cdot y + z \cdot t\right) \cdot 2\\
\end{array}
\end{array}
if i < -1.4000000000000001e176 or 5e219 < i Initial program 94.5%
Taylor expanded in a around inf 57.6%
Taylor expanded in a around 0 57.6%
if -1.4000000000000001e176 < i < 5e219Initial program 89.1%
Taylor expanded in c around 0 62.1%
Final simplification61.1%
(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 90.3%
Taylor expanded in z around inf 28.0%
Final simplification28.0%
(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 2023271
(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))))