
(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 15 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 (* c (* i (- (- a) (* b c))))))))
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 * (c * (i * (-a - (b * c))));
}
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 * Float64(c * Float64(i * Float64(Float64(-a) - Float64(b * c))))); 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[(c * N[(i * N[((-a) - N[(b * c), $MachinePrecision]), $MachinePrecision]), $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 \left(c \cdot \left(i \cdot \left(\left(-a\right) - b \cdot c\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 95.3%
associate-*l*98.0%
fma-def98.0%
Simplified98.0%
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 i around inf 63.8%
Final simplification96.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) -2.1e+80)
t_3
(if (<= (* x y) -1.08e-69)
t_1
(if (<= (* x y) -3.9e-106)
t_2
(if (<= (* x y) 9.6e-234)
t_1
(if (<= (* x y) 8.2e+44)
t_2
(if (<= (* x y) 7.3e+109) t_1 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) <= -2.1e+80) {
tmp = t_3;
} else if ((x * y) <= -1.08e-69) {
tmp = t_1;
} else if ((x * y) <= -3.9e-106) {
tmp = t_2;
} else if ((x * y) <= 9.6e-234) {
tmp = t_1;
} else if ((x * y) <= 8.2e+44) {
tmp = t_2;
} else if ((x * y) <= 7.3e+109) {
tmp = t_1;
} 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) <= (-2.1d+80)) then
tmp = t_3
else if ((x * y) <= (-1.08d-69)) then
tmp = t_1
else if ((x * y) <= (-3.9d-106)) then
tmp = t_2
else if ((x * y) <= 9.6d-234) then
tmp = t_1
else if ((x * y) <= 8.2d+44) then
tmp = t_2
else if ((x * y) <= 7.3d+109) then
tmp = t_1
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) <= -2.1e+80) {
tmp = t_3;
} else if ((x * y) <= -1.08e-69) {
tmp = t_1;
} else if ((x * y) <= -3.9e-106) {
tmp = t_2;
} else if ((x * y) <= 9.6e-234) {
tmp = t_1;
} else if ((x * y) <= 8.2e+44) {
tmp = t_2;
} else if ((x * y) <= 7.3e+109) {
tmp = t_1;
} 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) <= -2.1e+80: tmp = t_3 elif (x * y) <= -1.08e-69: tmp = t_1 elif (x * y) <= -3.9e-106: tmp = t_2 elif (x * y) <= 9.6e-234: tmp = t_1 elif (x * y) <= 8.2e+44: tmp = t_2 elif (x * y) <= 7.3e+109: tmp = t_1 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) <= -2.1e+80) tmp = t_3; elseif (Float64(x * y) <= -1.08e-69) tmp = t_1; elseif (Float64(x * y) <= -3.9e-106) tmp = t_2; elseif (Float64(x * y) <= 9.6e-234) tmp = t_1; elseif (Float64(x * y) <= 8.2e+44) tmp = t_2; elseif (Float64(x * y) <= 7.3e+109) tmp = t_1; 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) <= -2.1e+80) tmp = t_3; elseif ((x * y) <= -1.08e-69) tmp = t_1; elseif ((x * y) <= -3.9e-106) tmp = t_2; elseif ((x * y) <= 9.6e-234) tmp = t_1; elseif ((x * y) <= 8.2e+44) tmp = t_2; elseif ((x * y) <= 7.3e+109) tmp = t_1; 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], -2.1e+80], t$95$3, If[LessEqual[N[(x * y), $MachinePrecision], -1.08e-69], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], -3.9e-106], t$95$2, If[LessEqual[N[(x * y), $MachinePrecision], 9.6e-234], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 8.2e+44], t$95$2, If[LessEqual[N[(x * y), $MachinePrecision], 7.3e+109], t$95$1, 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 -2.1 \cdot 10^{+80}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;x \cdot y \leq -1.08 \cdot 10^{-69}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \cdot y \leq -3.9 \cdot 10^{-106}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x \cdot y \leq 9.6 \cdot 10^{-234}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \cdot y \leq 8.2 \cdot 10^{+44}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x \cdot y \leq 7.3 \cdot 10^{+109}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_3\\
\end{array}
\end{array}
if (*.f64 x y) < -2.10000000000000001e80 or 7.2999999999999998e109 < (*.f64 x y) Initial program 90.0%
Taylor expanded in x around inf 62.3%
if -2.10000000000000001e80 < (*.f64 x y) < -1.0800000000000001e-69 or -3.9000000000000001e-106 < (*.f64 x y) < 9.5999999999999996e-234 or 8.1999999999999993e44 < (*.f64 x y) < 7.2999999999999998e109Initial program 91.7%
Taylor expanded in z around inf 47.8%
if -1.0800000000000001e-69 < (*.f64 x y) < -3.9000000000000001e-106 or 9.5999999999999996e-234 < (*.f64 x y) < 8.1999999999999993e44Initial program 92.3%
Taylor expanded in a around inf 48.4%
mul-1-neg48.4%
*-commutative48.4%
associate-*l*44.7%
*-commutative44.7%
distribute-rgt-neg-in44.7%
*-commutative44.7%
Simplified44.7%
Taylor expanded in c around 0 48.4%
Final simplification53.0%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* 2.0 (* z t))) (t_2 (* (* x y) 2.0)))
(if (<= (* x y) -8e+75)
t_2
(if (<= (* x y) -9.8e-79)
t_1
(if (<= (* x y) -1.35e-101)
(* c (* -2.0 (* a i)))
(if (<= (* x y) 8.8e-234)
t_1
(if (<= (* x y) 3.5e+54)
(* -2.0 (* a (* c i)))
(if (<= (* x y) 9.4e+107) t_1 t_2))))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = 2.0 * (z * t);
double t_2 = (x * y) * 2.0;
double tmp;
if ((x * y) <= -8e+75) {
tmp = t_2;
} else if ((x * y) <= -9.8e-79) {
tmp = t_1;
} else if ((x * y) <= -1.35e-101) {
tmp = c * (-2.0 * (a * i));
} else if ((x * y) <= 8.8e-234) {
tmp = t_1;
} else if ((x * y) <= 3.5e+54) {
tmp = -2.0 * (a * (c * i));
} else if ((x * y) <= 9.4e+107) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = 2.0d0 * (z * t)
t_2 = (x * y) * 2.0d0
if ((x * y) <= (-8d+75)) then
tmp = t_2
else if ((x * y) <= (-9.8d-79)) then
tmp = t_1
else if ((x * y) <= (-1.35d-101)) then
tmp = c * ((-2.0d0) * (a * i))
else if ((x * y) <= 8.8d-234) then
tmp = t_1
else if ((x * y) <= 3.5d+54) then
tmp = (-2.0d0) * (a * (c * i))
else if ((x * y) <= 9.4d+107) then
tmp = t_1
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = 2.0 * (z * t);
double t_2 = (x * y) * 2.0;
double tmp;
if ((x * y) <= -8e+75) {
tmp = t_2;
} else if ((x * y) <= -9.8e-79) {
tmp = t_1;
} else if ((x * y) <= -1.35e-101) {
tmp = c * (-2.0 * (a * i));
} else if ((x * y) <= 8.8e-234) {
tmp = t_1;
} else if ((x * y) <= 3.5e+54) {
tmp = -2.0 * (a * (c * i));
} else if ((x * y) <= 9.4e+107) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = 2.0 * (z * t) t_2 = (x * y) * 2.0 tmp = 0 if (x * y) <= -8e+75: tmp = t_2 elif (x * y) <= -9.8e-79: tmp = t_1 elif (x * y) <= -1.35e-101: tmp = c * (-2.0 * (a * i)) elif (x * y) <= 8.8e-234: tmp = t_1 elif (x * y) <= 3.5e+54: tmp = -2.0 * (a * (c * i)) elif (x * y) <= 9.4e+107: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(2.0 * Float64(z * t)) t_2 = Float64(Float64(x * y) * 2.0) tmp = 0.0 if (Float64(x * y) <= -8e+75) tmp = t_2; elseif (Float64(x * y) <= -9.8e-79) tmp = t_1; elseif (Float64(x * y) <= -1.35e-101) tmp = Float64(c * Float64(-2.0 * Float64(a * i))); elseif (Float64(x * y) <= 8.8e-234) tmp = t_1; elseif (Float64(x * y) <= 3.5e+54) tmp = Float64(-2.0 * Float64(a * Float64(c * i))); elseif (Float64(x * y) <= 9.4e+107) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = 2.0 * (z * t); t_2 = (x * y) * 2.0; tmp = 0.0; if ((x * y) <= -8e+75) tmp = t_2; elseif ((x * y) <= -9.8e-79) tmp = t_1; elseif ((x * y) <= -1.35e-101) tmp = c * (-2.0 * (a * i)); elseif ((x * y) <= 8.8e-234) tmp = t_1; elseif ((x * y) <= 3.5e+54) tmp = -2.0 * (a * (c * i)); elseif ((x * y) <= 9.4e+107) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(2.0 * N[(z * t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x * y), $MachinePrecision] * 2.0), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -8e+75], t$95$2, If[LessEqual[N[(x * y), $MachinePrecision], -9.8e-79], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], -1.35e-101], N[(c * N[(-2.0 * N[(a * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 8.8e-234], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 3.5e+54], N[(-2.0 * N[(a * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 9.4e+107], t$95$1, t$95$2]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 2 \cdot \left(z \cdot t\right)\\
t_2 := \left(x \cdot y\right) \cdot 2\\
\mathbf{if}\;x \cdot y \leq -8 \cdot 10^{+75}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x \cdot y \leq -9.8 \cdot 10^{-79}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \cdot y \leq -1.35 \cdot 10^{-101}:\\
\;\;\;\;c \cdot \left(-2 \cdot \left(a \cdot i\right)\right)\\
\mathbf{elif}\;x \cdot y \leq 8.8 \cdot 10^{-234}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \cdot y \leq 3.5 \cdot 10^{+54}:\\
\;\;\;\;-2 \cdot \left(a \cdot \left(c \cdot i\right)\right)\\
\mathbf{elif}\;x \cdot y \leq 9.4 \cdot 10^{+107}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if (*.f64 x y) < -7.99999999999999941e75 or 9.4000000000000002e107 < (*.f64 x y) Initial program 90.0%
Taylor expanded in x around inf 62.3%
if -7.99999999999999941e75 < (*.f64 x y) < -9.8000000000000001e-79 or -1.3500000000000001e-101 < (*.f64 x y) < 8.7999999999999996e-234 or 3.5000000000000001e54 < (*.f64 x y) < 9.4000000000000002e107Initial program 91.7%
Taylor expanded in z around inf 47.8%
if -9.8000000000000001e-79 < (*.f64 x y) < -1.3500000000000001e-101Initial program 100.0%
Taylor expanded in a around inf 62.9%
mul-1-neg62.9%
*-commutative62.9%
associate-*l*63.0%
*-commutative63.0%
distribute-rgt-neg-in63.0%
*-commutative63.0%
Simplified63.0%
Taylor expanded in c around 0 62.9%
*-commutative62.9%
*-commutative62.9%
associate-*r*63.0%
associate-*l*63.0%
Simplified63.0%
if 8.7999999999999996e-234 < (*.f64 x y) < 3.5000000000000001e54Initial program 90.1%
Taylor expanded in a around inf 44.3%
mul-1-neg44.3%
*-commutative44.3%
associate-*l*39.5%
*-commutative39.5%
distribute-rgt-neg-in39.5%
*-commutative39.5%
Simplified39.5%
Taylor expanded in c around 0 44.3%
Final simplification53.0%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* 2.0 (* z t)))
(t_2 (* (* b (* c (* c i))) -2.0))
(t_3 (* (* x y) 2.0)))
(if (<= c -5.2e+48)
t_2
(if (<= c -1e-149)
t_1
(if (<= c 2.3e-288)
t_3
(if (<= c 5.3e-263)
t_1
(if (<= c 4.6e-24)
t_3
(if (<= c 1.2e+40)
t_1
(if (or (<= c 1.85e+128) (not (<= c 3.4e+148)))
t_2
(* c (* -2.0 (* a i))))))))))))
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 = (b * (c * (c * i))) * -2.0;
double t_3 = (x * y) * 2.0;
double tmp;
if (c <= -5.2e+48) {
tmp = t_2;
} else if (c <= -1e-149) {
tmp = t_1;
} else if (c <= 2.3e-288) {
tmp = t_3;
} else if (c <= 5.3e-263) {
tmp = t_1;
} else if (c <= 4.6e-24) {
tmp = t_3;
} else if (c <= 1.2e+40) {
tmp = t_1;
} else if ((c <= 1.85e+128) || !(c <= 3.4e+148)) {
tmp = t_2;
} else {
tmp = c * (-2.0 * (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) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_1 = 2.0d0 * (z * t)
t_2 = (b * (c * (c * i))) * (-2.0d0)
t_3 = (x * y) * 2.0d0
if (c <= (-5.2d+48)) then
tmp = t_2
else if (c <= (-1d-149)) then
tmp = t_1
else if (c <= 2.3d-288) then
tmp = t_3
else if (c <= 5.3d-263) then
tmp = t_1
else if (c <= 4.6d-24) then
tmp = t_3
else if (c <= 1.2d+40) then
tmp = t_1
else if ((c <= 1.85d+128) .or. (.not. (c <= 3.4d+148))) then
tmp = t_2
else
tmp = c * ((-2.0d0) * (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 t_1 = 2.0 * (z * t);
double t_2 = (b * (c * (c * i))) * -2.0;
double t_3 = (x * y) * 2.0;
double tmp;
if (c <= -5.2e+48) {
tmp = t_2;
} else if (c <= -1e-149) {
tmp = t_1;
} else if (c <= 2.3e-288) {
tmp = t_3;
} else if (c <= 5.3e-263) {
tmp = t_1;
} else if (c <= 4.6e-24) {
tmp = t_3;
} else if (c <= 1.2e+40) {
tmp = t_1;
} else if ((c <= 1.85e+128) || !(c <= 3.4e+148)) {
tmp = t_2;
} else {
tmp = c * (-2.0 * (a * i));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = 2.0 * (z * t) t_2 = (b * (c * (c * i))) * -2.0 t_3 = (x * y) * 2.0 tmp = 0 if c <= -5.2e+48: tmp = t_2 elif c <= -1e-149: tmp = t_1 elif c <= 2.3e-288: tmp = t_3 elif c <= 5.3e-263: tmp = t_1 elif c <= 4.6e-24: tmp = t_3 elif c <= 1.2e+40: tmp = t_1 elif (c <= 1.85e+128) or not (c <= 3.4e+148): tmp = t_2 else: tmp = c * (-2.0 * (a * i)) return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(2.0 * Float64(z * t)) t_2 = Float64(Float64(b * Float64(c * Float64(c * i))) * -2.0) t_3 = Float64(Float64(x * y) * 2.0) tmp = 0.0 if (c <= -5.2e+48) tmp = t_2; elseif (c <= -1e-149) tmp = t_1; elseif (c <= 2.3e-288) tmp = t_3; elseif (c <= 5.3e-263) tmp = t_1; elseif (c <= 4.6e-24) tmp = t_3; elseif (c <= 1.2e+40) tmp = t_1; elseif ((c <= 1.85e+128) || !(c <= 3.4e+148)) tmp = t_2; else tmp = Float64(c * Float64(-2.0 * Float64(a * i))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = 2.0 * (z * t); t_2 = (b * (c * (c * i))) * -2.0; t_3 = (x * y) * 2.0; tmp = 0.0; if (c <= -5.2e+48) tmp = t_2; elseif (c <= -1e-149) tmp = t_1; elseif (c <= 2.3e-288) tmp = t_3; elseif (c <= 5.3e-263) tmp = t_1; elseif (c <= 4.6e-24) tmp = t_3; elseif (c <= 1.2e+40) tmp = t_1; elseif ((c <= 1.85e+128) || ~((c <= 3.4e+148))) tmp = t_2; else tmp = c * (-2.0 * (a * i)); 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[(N[(b * N[(c * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * -2.0), $MachinePrecision]}, Block[{t$95$3 = N[(N[(x * y), $MachinePrecision] * 2.0), $MachinePrecision]}, If[LessEqual[c, -5.2e+48], t$95$2, If[LessEqual[c, -1e-149], t$95$1, If[LessEqual[c, 2.3e-288], t$95$3, If[LessEqual[c, 5.3e-263], t$95$1, If[LessEqual[c, 4.6e-24], t$95$3, If[LessEqual[c, 1.2e+40], t$95$1, If[Or[LessEqual[c, 1.85e+128], N[Not[LessEqual[c, 3.4e+148]], $MachinePrecision]], t$95$2, N[(c * N[(-2.0 * N[(a * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 2 \cdot \left(z \cdot t\right)\\
t_2 := \left(b \cdot \left(c \cdot \left(c \cdot i\right)\right)\right) \cdot -2\\
t_3 := \left(x \cdot y\right) \cdot 2\\
\mathbf{if}\;c \leq -5.2 \cdot 10^{+48}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;c \leq -1 \cdot 10^{-149}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;c \leq 2.3 \cdot 10^{-288}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;c \leq 5.3 \cdot 10^{-263}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;c \leq 4.6 \cdot 10^{-24}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;c \leq 1.2 \cdot 10^{+40}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;c \leq 1.85 \cdot 10^{+128} \lor \neg \left(c \leq 3.4 \cdot 10^{+148}\right):\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;c \cdot \left(-2 \cdot \left(a \cdot i\right)\right)\\
\end{array}
\end{array}
if c < -5.1999999999999999e48 or 1.2e40 < c < 1.85e128 or 3.4000000000000003e148 < c Initial program 82.6%
Taylor expanded in b around inf 73.4%
mul-1-neg73.4%
associate-*r*69.5%
unpow269.5%
associate-*l*71.4%
*-commutative71.4%
associate-*r*73.5%
distribute-rgt-neg-in73.5%
associate-*r*76.4%
Simplified76.4%
Taylor expanded in c around 0 73.4%
unpow273.4%
associate-*r*77.4%
Simplified77.4%
if -5.1999999999999999e48 < c < -9.99999999999999979e-150 or 2.3e-288 < c < 5.2999999999999997e-263 or 4.6000000000000002e-24 < c < 1.2e40Initial program 97.1%
Taylor expanded in z around inf 52.2%
if -9.99999999999999979e-150 < c < 2.3e-288 or 5.2999999999999997e-263 < c < 4.6000000000000002e-24Initial program 97.7%
Taylor expanded in x around inf 51.4%
if 1.85e128 < c < 3.4000000000000003e148Initial program 67.2%
Taylor expanded in a around inf 83.7%
mul-1-neg83.7%
*-commutative83.7%
associate-*l*83.8%
*-commutative83.8%
distribute-rgt-neg-in83.8%
*-commutative83.8%
Simplified83.8%
Taylor expanded in c around 0 83.7%
*-commutative83.7%
*-commutative83.7%
associate-*r*83.8%
associate-*l*83.8%
Simplified83.8%
Final simplification62.0%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= (* z t) -1e-20) (not (<= (* z t) 5e-66))) (* 2.0 (- (+ (* x y) (* z t)) (* b (* c (* c i))))) (* 2.0 (- (* x y) (* 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 (((z * t) <= -1e-20) || !((z * t) <= 5e-66)) {
tmp = 2.0 * (((x * y) + (z * t)) - (b * (c * (c * i))));
} else {
tmp = 2.0 * ((x * y) - (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 (((z * t) <= (-1d-20)) .or. (.not. ((z * t) <= 5d-66))) then
tmp = 2.0d0 * (((x * y) + (z * t)) - (b * (c * (c * i))))
else
tmp = 2.0d0 * ((x * y) - (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 (((z * t) <= -1e-20) || !((z * t) <= 5e-66)) {
tmp = 2.0 * (((x * y) + (z * t)) - (b * (c * (c * i))));
} else {
tmp = 2.0 * ((x * y) - (c * ((a + (b * c)) * i)));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if ((z * t) <= -1e-20) or not ((z * t) <= 5e-66): tmp = 2.0 * (((x * y) + (z * t)) - (b * (c * (c * i)))) else: tmp = 2.0 * ((x * y) - (c * ((a + (b * c)) * i))) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((Float64(z * t) <= -1e-20) || !(Float64(z * t) <= 5e-66)) tmp = Float64(2.0 * Float64(Float64(Float64(x * y) + Float64(z * t)) - Float64(b * Float64(c * Float64(c * i))))); else tmp = Float64(2.0 * Float64(Float64(x * y) - 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 (((z * t) <= -1e-20) || ~(((z * t) <= 5e-66))) tmp = 2.0 * (((x * y) + (z * t)) - (b * (c * (c * i)))); else tmp = 2.0 * ((x * y) - (c * ((a + (b * c)) * i))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[N[(z * t), $MachinePrecision], -1e-20], N[Not[LessEqual[N[(z * t), $MachinePrecision], 5e-66]], $MachinePrecision]], N[(2.0 * N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] - N[(b * N[(c * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(x * y), $MachinePrecision] - N[(c * N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \cdot t \leq -1 \cdot 10^{-20} \lor \neg \left(z \cdot t \leq 5 \cdot 10^{-66}\right):\\
\;\;\;\;2 \cdot \left(\left(x \cdot y + z \cdot t\right) - b \cdot \left(c \cdot \left(c \cdot i\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(x \cdot y - c \cdot \left(\left(a + b \cdot c\right) \cdot i\right)\right)\\
\end{array}
\end{array}
if (*.f64 z t) < -9.99999999999999945e-21 or 4.99999999999999962e-66 < (*.f64 z t) Initial program 89.1%
Taylor expanded in a around 0 86.0%
unpow286.0%
associate-*r*88.5%
Simplified88.5%
if -9.99999999999999945e-21 < (*.f64 z t) < 4.99999999999999962e-66Initial program 94.4%
Taylor expanded in z around 0 94.6%
Final simplification91.0%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* (+ (* x y) (* z t)) 2.0)) (t_2 (* (* b (* c (* c i))) -2.0)))
(if (<= c -9.2e+61)
t_2
(if (<= c 1.95e+62)
t_1
(if (<= c 1.55e+76)
t_2
(if (<= c 8.4e+95)
t_1
(if (<= c 1.7e+153)
(* 2.0 (- (* z t) (* a (* c i))))
(* c (* (* c i) (* b -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)) * 2.0;
double t_2 = (b * (c * (c * i))) * -2.0;
double tmp;
if (c <= -9.2e+61) {
tmp = t_2;
} else if (c <= 1.95e+62) {
tmp = t_1;
} else if (c <= 1.55e+76) {
tmp = t_2;
} else if (c <= 8.4e+95) {
tmp = t_1;
} else if (c <= 1.7e+153) {
tmp = 2.0 * ((z * t) - (a * (c * i)));
} else {
tmp = c * ((c * i) * (b * -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) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = ((x * y) + (z * t)) * 2.0d0
t_2 = (b * (c * (c * i))) * (-2.0d0)
if (c <= (-9.2d+61)) then
tmp = t_2
else if (c <= 1.95d+62) then
tmp = t_1
else if (c <= 1.55d+76) then
tmp = t_2
else if (c <= 8.4d+95) then
tmp = t_1
else if (c <= 1.7d+153) then
tmp = 2.0d0 * ((z * t) - (a * (c * i)))
else
tmp = c * ((c * i) * (b * (-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 t_1 = ((x * y) + (z * t)) * 2.0;
double t_2 = (b * (c * (c * i))) * -2.0;
double tmp;
if (c <= -9.2e+61) {
tmp = t_2;
} else if (c <= 1.95e+62) {
tmp = t_1;
} else if (c <= 1.55e+76) {
tmp = t_2;
} else if (c <= 8.4e+95) {
tmp = t_1;
} else if (c <= 1.7e+153) {
tmp = 2.0 * ((z * t) - (a * (c * i)));
} else {
tmp = c * ((c * i) * (b * -2.0));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = ((x * y) + (z * t)) * 2.0 t_2 = (b * (c * (c * i))) * -2.0 tmp = 0 if c <= -9.2e+61: tmp = t_2 elif c <= 1.95e+62: tmp = t_1 elif c <= 1.55e+76: tmp = t_2 elif c <= 8.4e+95: tmp = t_1 elif c <= 1.7e+153: tmp = 2.0 * ((z * t) - (a * (c * i))) else: tmp = c * ((c * i) * (b * -2.0)) 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(Float64(b * Float64(c * Float64(c * i))) * -2.0) tmp = 0.0 if (c <= -9.2e+61) tmp = t_2; elseif (c <= 1.95e+62) tmp = t_1; elseif (c <= 1.55e+76) tmp = t_2; elseif (c <= 8.4e+95) tmp = t_1; elseif (c <= 1.7e+153) tmp = Float64(2.0 * Float64(Float64(z * t) - Float64(a * Float64(c * i)))); else tmp = Float64(c * Float64(Float64(c * i) * Float64(b * -2.0))); 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 = (b * (c * (c * i))) * -2.0; tmp = 0.0; if (c <= -9.2e+61) tmp = t_2; elseif (c <= 1.95e+62) tmp = t_1; elseif (c <= 1.55e+76) tmp = t_2; elseif (c <= 8.4e+95) tmp = t_1; elseif (c <= 1.7e+153) tmp = 2.0 * ((z * t) - (a * (c * i))); else tmp = c * ((c * i) * (b * -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] * 2.0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(b * N[(c * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * -2.0), $MachinePrecision]}, If[LessEqual[c, -9.2e+61], t$95$2, If[LessEqual[c, 1.95e+62], t$95$1, If[LessEqual[c, 1.55e+76], t$95$2, If[LessEqual[c, 8.4e+95], t$95$1, If[LessEqual[c, 1.7e+153], N[(2.0 * N[(N[(z * t), $MachinePrecision] - N[(a * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c * N[(N[(c * i), $MachinePrecision] * N[(b * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(x \cdot y + z \cdot t\right) \cdot 2\\
t_2 := \left(b \cdot \left(c \cdot \left(c \cdot i\right)\right)\right) \cdot -2\\
\mathbf{if}\;c \leq -9.2 \cdot 10^{+61}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;c \leq 1.95 \cdot 10^{+62}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;c \leq 1.55 \cdot 10^{+76}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;c \leq 8.4 \cdot 10^{+95}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;c \leq 1.7 \cdot 10^{+153}:\\
\;\;\;\;2 \cdot \left(z \cdot t - a \cdot \left(c \cdot i\right)\right)\\
\mathbf{else}:\\
\;\;\;\;c \cdot \left(\left(c \cdot i\right) \cdot \left(b \cdot -2\right)\right)\\
\end{array}
\end{array}
if c < -9.1999999999999998e61 or 1.95e62 < c < 1.55000000000000006e76Initial program 87.1%
Taylor expanded in b around inf 78.1%
mul-1-neg78.1%
associate-*r*74.5%
unpow274.5%
associate-*l*76.3%
*-commutative76.3%
associate-*r*78.1%
distribute-rgt-neg-in78.1%
associate-*r*81.6%
Simplified81.6%
Taylor expanded in c around 0 78.1%
unpow278.1%
associate-*r*83.5%
Simplified83.5%
if -9.1999999999999998e61 < c < 1.95e62 or 1.55000000000000006e76 < c < 8.4e95Initial program 97.0%
Taylor expanded in c around 0 79.4%
if 8.4e95 < c < 1.6999999999999999e153Initial program 48.1%
Taylor expanded in a around inf 32.5%
*-commutative32.5%
Simplified32.5%
Taylor expanded in x around 0 60.0%
if 1.6999999999999999e153 < c Initial program 83.7%
Taylor expanded in b around inf 88.2%
mul-1-neg88.2%
associate-*r*88.2%
unpow288.2%
associate-*l*92.0%
*-commutative92.0%
associate-*r*92.1%
distribute-rgt-neg-in92.1%
associate-*r*92.1%
Simplified92.1%
Taylor expanded in c around 0 88.2%
unpow288.2%
associate-*r*92.0%
Simplified92.0%
Taylor expanded in b around 0 88.2%
unpow288.2%
associate-*r*92.0%
associate-*r*92.0%
*-commutative92.0%
associate-*l*92.1%
Simplified92.1%
Final simplification80.5%
(FPCore (x y z t a b c i) :precision binary64 (if (<= c 2.4e+100) (* (- (+ (* x y) (* z t)) (* (* c (+ a (* b c))) i)) 2.0) (* 2.0 (* c (* i (- (- a) (* b c)))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (c <= 2.4e+100) {
tmp = (((x * y) + (z * t)) - ((c * (a + (b * c))) * i)) * 2.0;
} else {
tmp = 2.0 * (c * (i * (-a - (b * 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 <= 2.4d+100) then
tmp = (((x * y) + (z * t)) - ((c * (a + (b * c))) * i)) * 2.0d0
else
tmp = 2.0d0 * (c * (i * (-a - (b * 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 <= 2.4e+100) {
tmp = (((x * y) + (z * t)) - ((c * (a + (b * c))) * i)) * 2.0;
} else {
tmp = 2.0 * (c * (i * (-a - (b * c))));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if c <= 2.4e+100: tmp = (((x * y) + (z * t)) - ((c * (a + (b * c))) * i)) * 2.0 else: tmp = 2.0 * (c * (i * (-a - (b * c)))) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (c <= 2.4e+100) tmp = Float64(Float64(Float64(Float64(x * y) + Float64(z * t)) - Float64(Float64(c * Float64(a + Float64(b * c))) * i)) * 2.0); else tmp = Float64(2.0 * Float64(c * Float64(i * Float64(Float64(-a) - Float64(b * c))))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if (c <= 2.4e+100) tmp = (((x * y) + (z * t)) - ((c * (a + (b * c))) * i)) * 2.0; else tmp = 2.0 * (c * (i * (-a - (b * c)))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[c, 2.4e+100], N[(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] * 2.0), $MachinePrecision], N[(2.0 * N[(c * N[(i * N[((-a) - N[(b * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \leq 2.4 \cdot 10^{+100}:\\
\;\;\;\;\left(\left(x \cdot y + z \cdot t\right) - \left(c \cdot \left(a + b \cdot c\right)\right) \cdot i\right) \cdot 2\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(c \cdot \left(i \cdot \left(\left(-a\right) - b \cdot c\right)\right)\right)\\
\end{array}
\end{array}
if c < 2.40000000000000012e100Initial program 94.6%
if 2.40000000000000012e100 < c Initial program 71.2%
Taylor expanded in i around inf 92.2%
Final simplification94.3%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* (+ (* x y) (* z t)) 2.0)) (t_2 (* (* b (* c (* c i))) -2.0)))
(if (<= c -1.65e+60)
t_2
(if (<= c 6e+62)
t_1
(if (<= c 4.4e+77)
t_2
(if (<= c 2.4e+100)
t_1
(if (<= c 3.2e+148) (* c (* -2.0 (* a i))) t_2)))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = ((x * y) + (z * t)) * 2.0;
double t_2 = (b * (c * (c * i))) * -2.0;
double tmp;
if (c <= -1.65e+60) {
tmp = t_2;
} else if (c <= 6e+62) {
tmp = t_1;
} else if (c <= 4.4e+77) {
tmp = t_2;
} else if (c <= 2.4e+100) {
tmp = t_1;
} else if (c <= 3.2e+148) {
tmp = c * (-2.0 * (a * i));
} else {
tmp = t_2;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = ((x * y) + (z * t)) * 2.0d0
t_2 = (b * (c * (c * i))) * (-2.0d0)
if (c <= (-1.65d+60)) then
tmp = t_2
else if (c <= 6d+62) then
tmp = t_1
else if (c <= 4.4d+77) then
tmp = t_2
else if (c <= 2.4d+100) then
tmp = t_1
else if (c <= 3.2d+148) then
tmp = c * ((-2.0d0) * (a * i))
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = ((x * y) + (z * t)) * 2.0;
double t_2 = (b * (c * (c * i))) * -2.0;
double tmp;
if (c <= -1.65e+60) {
tmp = t_2;
} else if (c <= 6e+62) {
tmp = t_1;
} else if (c <= 4.4e+77) {
tmp = t_2;
} else if (c <= 2.4e+100) {
tmp = t_1;
} else if (c <= 3.2e+148) {
tmp = c * (-2.0 * (a * i));
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = ((x * y) + (z * t)) * 2.0 t_2 = (b * (c * (c * i))) * -2.0 tmp = 0 if c <= -1.65e+60: tmp = t_2 elif c <= 6e+62: tmp = t_1 elif c <= 4.4e+77: tmp = t_2 elif c <= 2.4e+100: tmp = t_1 elif c <= 3.2e+148: tmp = c * (-2.0 * (a * i)) else: tmp = t_2 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(Float64(b * Float64(c * Float64(c * i))) * -2.0) tmp = 0.0 if (c <= -1.65e+60) tmp = t_2; elseif (c <= 6e+62) tmp = t_1; elseif (c <= 4.4e+77) tmp = t_2; elseif (c <= 2.4e+100) tmp = t_1; elseif (c <= 3.2e+148) tmp = Float64(c * Float64(-2.0 * Float64(a * i))); else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = ((x * y) + (z * t)) * 2.0; t_2 = (b * (c * (c * i))) * -2.0; tmp = 0.0; if (c <= -1.65e+60) tmp = t_2; elseif (c <= 6e+62) tmp = t_1; elseif (c <= 4.4e+77) tmp = t_2; elseif (c <= 2.4e+100) tmp = t_1; elseif (c <= 3.2e+148) tmp = c * (-2.0 * (a * i)); else tmp = t_2; 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[(N[(b * N[(c * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * -2.0), $MachinePrecision]}, If[LessEqual[c, -1.65e+60], t$95$2, If[LessEqual[c, 6e+62], t$95$1, If[LessEqual[c, 4.4e+77], t$95$2, If[LessEqual[c, 2.4e+100], t$95$1, If[LessEqual[c, 3.2e+148], N[(c * N[(-2.0 * N[(a * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$2]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(x \cdot y + z \cdot t\right) \cdot 2\\
t_2 := \left(b \cdot \left(c \cdot \left(c \cdot i\right)\right)\right) \cdot -2\\
\mathbf{if}\;c \leq -1.65 \cdot 10^{+60}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;c \leq 6 \cdot 10^{+62}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;c \leq 4.4 \cdot 10^{+77}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;c \leq 2.4 \cdot 10^{+100}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;c \leq 3.2 \cdot 10^{+148}:\\
\;\;\;\;c \cdot \left(-2 \cdot \left(a \cdot i\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if c < -1.6499999999999999e60 or 6e62 < c < 4.4000000000000001e77 or 3.1999999999999999e148 < c Initial program 85.2%
Taylor expanded in b around inf 80.5%
mul-1-neg80.5%
associate-*r*76.9%
unpow276.9%
associate-*l*79.2%
*-commutative79.2%
associate-*r*80.5%
distribute-rgt-neg-in80.5%
associate-*r*84.0%
Simplified84.0%
Taylor expanded in c around 0 80.5%
unpow280.5%
associate-*r*85.3%
Simplified85.3%
if -1.6499999999999999e60 < c < 6e62 or 4.4000000000000001e77 < c < 2.40000000000000012e100Initial program 97.0%
Taylor expanded in c around 0 79.4%
if 2.40000000000000012e100 < c < 3.1999999999999999e148Initial program 47.1%
Taylor expanded in a around inf 61.9%
mul-1-neg61.9%
*-commutative61.9%
associate-*l*62.0%
*-commutative62.0%
distribute-rgt-neg-in62.0%
*-commutative62.0%
Simplified62.0%
Taylor expanded in c around 0 61.9%
*-commutative61.9%
*-commutative61.9%
associate-*r*62.0%
associate-*l*62.0%
Simplified62.0%
Final simplification80.5%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* (+ (* x y) (* z t)) 2.0)) (t_2 (* (* b (* c (* c i))) -2.0)))
(if (<= c -3.5e+61)
t_2
(if (<= c 3.9e+62)
t_1
(if (<= c 5.6e+76)
t_2
(if (<= c 4.25e+99)
t_1
(if (<= c 3.2e+148)
(* c (* -2.0 (* a i)))
(* c (* (* c i) (* b -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)) * 2.0;
double t_2 = (b * (c * (c * i))) * -2.0;
double tmp;
if (c <= -3.5e+61) {
tmp = t_2;
} else if (c <= 3.9e+62) {
tmp = t_1;
} else if (c <= 5.6e+76) {
tmp = t_2;
} else if (c <= 4.25e+99) {
tmp = t_1;
} else if (c <= 3.2e+148) {
tmp = c * (-2.0 * (a * i));
} else {
tmp = c * ((c * i) * (b * -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) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = ((x * y) + (z * t)) * 2.0d0
t_2 = (b * (c * (c * i))) * (-2.0d0)
if (c <= (-3.5d+61)) then
tmp = t_2
else if (c <= 3.9d+62) then
tmp = t_1
else if (c <= 5.6d+76) then
tmp = t_2
else if (c <= 4.25d+99) then
tmp = t_1
else if (c <= 3.2d+148) then
tmp = c * ((-2.0d0) * (a * i))
else
tmp = c * ((c * i) * (b * (-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 t_1 = ((x * y) + (z * t)) * 2.0;
double t_2 = (b * (c * (c * i))) * -2.0;
double tmp;
if (c <= -3.5e+61) {
tmp = t_2;
} else if (c <= 3.9e+62) {
tmp = t_1;
} else if (c <= 5.6e+76) {
tmp = t_2;
} else if (c <= 4.25e+99) {
tmp = t_1;
} else if (c <= 3.2e+148) {
tmp = c * (-2.0 * (a * i));
} else {
tmp = c * ((c * i) * (b * -2.0));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = ((x * y) + (z * t)) * 2.0 t_2 = (b * (c * (c * i))) * -2.0 tmp = 0 if c <= -3.5e+61: tmp = t_2 elif c <= 3.9e+62: tmp = t_1 elif c <= 5.6e+76: tmp = t_2 elif c <= 4.25e+99: tmp = t_1 elif c <= 3.2e+148: tmp = c * (-2.0 * (a * i)) else: tmp = c * ((c * i) * (b * -2.0)) 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(Float64(b * Float64(c * Float64(c * i))) * -2.0) tmp = 0.0 if (c <= -3.5e+61) tmp = t_2; elseif (c <= 3.9e+62) tmp = t_1; elseif (c <= 5.6e+76) tmp = t_2; elseif (c <= 4.25e+99) tmp = t_1; elseif (c <= 3.2e+148) tmp = Float64(c * Float64(-2.0 * Float64(a * i))); else tmp = Float64(c * Float64(Float64(c * i) * Float64(b * -2.0))); 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 = (b * (c * (c * i))) * -2.0; tmp = 0.0; if (c <= -3.5e+61) tmp = t_2; elseif (c <= 3.9e+62) tmp = t_1; elseif (c <= 5.6e+76) tmp = t_2; elseif (c <= 4.25e+99) tmp = t_1; elseif (c <= 3.2e+148) tmp = c * (-2.0 * (a * i)); else tmp = c * ((c * i) * (b * -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] * 2.0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(b * N[(c * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * -2.0), $MachinePrecision]}, If[LessEqual[c, -3.5e+61], t$95$2, If[LessEqual[c, 3.9e+62], t$95$1, If[LessEqual[c, 5.6e+76], t$95$2, If[LessEqual[c, 4.25e+99], t$95$1, If[LessEqual[c, 3.2e+148], N[(c * N[(-2.0 * N[(a * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c * N[(N[(c * i), $MachinePrecision] * N[(b * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(x \cdot y + z \cdot t\right) \cdot 2\\
t_2 := \left(b \cdot \left(c \cdot \left(c \cdot i\right)\right)\right) \cdot -2\\
\mathbf{if}\;c \leq -3.5 \cdot 10^{+61}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;c \leq 3.9 \cdot 10^{+62}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;c \leq 5.6 \cdot 10^{+76}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;c \leq 4.25 \cdot 10^{+99}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;c \leq 3.2 \cdot 10^{+148}:\\
\;\;\;\;c \cdot \left(-2 \cdot \left(a \cdot i\right)\right)\\
\mathbf{else}:\\
\;\;\;\;c \cdot \left(\left(c \cdot i\right) \cdot \left(b \cdot -2\right)\right)\\
\end{array}
\end{array}
if c < -3.50000000000000018e61 or 3.9e62 < c < 5.5999999999999997e76Initial program 87.1%
Taylor expanded in b around inf 78.1%
mul-1-neg78.1%
associate-*r*74.5%
unpow274.5%
associate-*l*76.3%
*-commutative76.3%
associate-*r*78.1%
distribute-rgt-neg-in78.1%
associate-*r*81.6%
Simplified81.6%
Taylor expanded in c around 0 78.1%
unpow278.1%
associate-*r*83.5%
Simplified83.5%
if -3.50000000000000018e61 < c < 3.9e62 or 5.5999999999999997e76 < c < 4.24999999999999992e99Initial program 97.0%
Taylor expanded in c around 0 79.4%
if 4.24999999999999992e99 < c < 3.1999999999999999e148Initial program 47.1%
Taylor expanded in a around inf 61.9%
mul-1-neg61.9%
*-commutative61.9%
associate-*l*62.0%
*-commutative62.0%
distribute-rgt-neg-in62.0%
*-commutative62.0%
Simplified62.0%
Taylor expanded in c around 0 61.9%
*-commutative61.9%
*-commutative61.9%
associate-*r*62.0%
associate-*l*62.0%
Simplified62.0%
if 3.1999999999999999e148 < c Initial program 81.4%
Taylor expanded in b around inf 85.2%
mul-1-neg85.2%
associate-*r*81.8%
unpow281.8%
associate-*l*85.3%
*-commutative85.3%
associate-*r*85.4%
distribute-rgt-neg-in85.4%
associate-*r*89.0%
Simplified89.0%
Taylor expanded in c around 0 85.2%
unpow285.2%
associate-*r*88.8%
Simplified88.8%
Taylor expanded in b around 0 85.2%
unpow285.2%
associate-*r*88.8%
associate-*r*88.8%
*-commutative88.8%
associate-*l*89.0%
Simplified89.0%
Final simplification80.5%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= c -2.15e+33) (not (<= c 7.5e+40))) (* 2.0 (- (* x y) (* 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 <= -2.15e+33) || !(c <= 7.5e+40)) {
tmp = 2.0 * ((x * y) - (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 <= (-2.15d+33)) .or. (.not. (c <= 7.5d+40))) then
tmp = 2.0d0 * ((x * y) - (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 <= -2.15e+33) || !(c <= 7.5e+40)) {
tmp = 2.0 * ((x * y) - (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 <= -2.15e+33) or not (c <= 7.5e+40): tmp = 2.0 * ((x * y) - (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 <= -2.15e+33) || !(c <= 7.5e+40)) tmp = Float64(2.0 * Float64(Float64(x * y) - Float64(c * Float64(Float64(a + Float64(b * 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 ((c <= -2.15e+33) || ~((c <= 7.5e+40))) tmp = 2.0 * ((x * y) - (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, -2.15e+33], N[Not[LessEqual[c, 7.5e+40]], $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[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \leq -2.15 \cdot 10^{+33} \lor \neg \left(c \leq 7.5 \cdot 10^{+40}\right):\\
\;\;\;\;2 \cdot \left(x \cdot y - c \cdot \left(\left(a + b \cdot c\right) \cdot i\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x \cdot y + z \cdot t\right) \cdot 2\\
\end{array}
\end{array}
if c < -2.15000000000000014e33 or 7.4999999999999996e40 < c Initial program 82.4%
Taylor expanded in z around 0 87.1%
if -2.15000000000000014e33 < c < 7.4999999999999996e40Initial program 97.4%
Taylor expanded in c around 0 81.2%
Final simplification83.6%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= c -1.7e+36) (not (<= c 6.2e+41))) (* 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.7e+36) || !(c <= 6.2e+41)) {
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.7d+36)) .or. (.not. (c <= 6.2d+41))) 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.7e+36) || !(c <= 6.2e+41)) {
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.7e+36) or not (c <= 6.2e+41): 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.7e+36) || !(c <= 6.2e+41)) 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.7e+36) || ~((c <= 6.2e+41))) 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.7e+36], N[Not[LessEqual[c, 6.2e+41]], $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.7 \cdot 10^{+36} \lor \neg \left(c \leq 6.2 \cdot 10^{+41}\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.6999999999999999e36 or 6.2e41 < c Initial program 82.4%
Taylor expanded in z around 0 87.1%
if -1.6999999999999999e36 < c < 6.2e41Initial program 97.4%
Taylor expanded in a around inf 92.1%
*-commutative92.1%
Simplified92.1%
Final simplification90.0%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= c -8.6e+103) (not (<= c 5.2e+42))) (* 2.0 (* c (* i (- (- a) (* b c))))) (* (+ (* 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 <= -8.6e+103) || !(c <= 5.2e+42)) {
tmp = 2.0 * (c * (i * (-a - (b * c))));
} 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 <= (-8.6d+103)) .or. (.not. (c <= 5.2d+42))) then
tmp = 2.0d0 * (c * (i * (-a - (b * c))))
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 <= -8.6e+103) || !(c <= 5.2e+42)) {
tmp = 2.0 * (c * (i * (-a - (b * c))));
} else {
tmp = ((x * y) + (z * t)) * 2.0;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (c <= -8.6e+103) or not (c <= 5.2e+42): tmp = 2.0 * (c * (i * (-a - (b * c)))) 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 <= -8.6e+103) || !(c <= 5.2e+42)) tmp = Float64(2.0 * Float64(c * Float64(i * Float64(Float64(-a) - Float64(b * c))))); 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 <= -8.6e+103) || ~((c <= 5.2e+42))) tmp = 2.0 * (c * (i * (-a - (b * c)))); 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, -8.6e+103], N[Not[LessEqual[c, 5.2e+42]], $MachinePrecision]], N[(2.0 * N[(c * N[(i * N[((-a) - N[(b * c), $MachinePrecision]), $MachinePrecision]), $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 -8.6 \cdot 10^{+103} \lor \neg \left(c \leq 5.2 \cdot 10^{+42}\right):\\
\;\;\;\;2 \cdot \left(c \cdot \left(i \cdot \left(\left(-a\right) - b \cdot c\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x \cdot y + z \cdot t\right) \cdot 2\\
\end{array}
\end{array}
if c < -8.59999999999999938e103 or 5.1999999999999998e42 < c Initial program 80.3%
Taylor expanded in i around inf 85.9%
if -8.59999999999999938e103 < c < 5.1999999999999998e42Initial program 97.0%
Taylor expanded in c around 0 78.9%
Final simplification81.4%
(FPCore (x y z t a b c i)
:precision binary64
(if (<= c -2.55e+48)
(* 2.0 (- (* x y) (* (* c c) (* b i))))
(if (<= c 1.7e+40)
(* (+ (* x y) (* z t)) 2.0)
(* 2.0 (* c (* i (- (- a) (* b c))))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (c <= -2.55e+48) {
tmp = 2.0 * ((x * y) - ((c * c) * (b * i)));
} else if (c <= 1.7e+40) {
tmp = ((x * y) + (z * t)) * 2.0;
} else {
tmp = 2.0 * (c * (i * (-a - (b * 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 <= (-2.55d+48)) then
tmp = 2.0d0 * ((x * y) - ((c * c) * (b * i)))
else if (c <= 1.7d+40) then
tmp = ((x * y) + (z * t)) * 2.0d0
else
tmp = 2.0d0 * (c * (i * (-a - (b * 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 <= -2.55e+48) {
tmp = 2.0 * ((x * y) - ((c * c) * (b * i)));
} else if (c <= 1.7e+40) {
tmp = ((x * y) + (z * t)) * 2.0;
} else {
tmp = 2.0 * (c * (i * (-a - (b * c))));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if c <= -2.55e+48: tmp = 2.0 * ((x * y) - ((c * c) * (b * i))) elif c <= 1.7e+40: tmp = ((x * y) + (z * t)) * 2.0 else: tmp = 2.0 * (c * (i * (-a - (b * c)))) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (c <= -2.55e+48) tmp = Float64(2.0 * Float64(Float64(x * y) - Float64(Float64(c * c) * Float64(b * i)))); elseif (c <= 1.7e+40) tmp = Float64(Float64(Float64(x * y) + Float64(z * t)) * 2.0); else tmp = Float64(2.0 * Float64(c * Float64(i * Float64(Float64(-a) - Float64(b * c))))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if (c <= -2.55e+48) tmp = 2.0 * ((x * y) - ((c * c) * (b * i))); elseif (c <= 1.7e+40) tmp = ((x * y) + (z * t)) * 2.0; else tmp = 2.0 * (c * (i * (-a - (b * c)))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[c, -2.55e+48], N[(2.0 * N[(N[(x * y), $MachinePrecision] - N[(N[(c * c), $MachinePrecision] * N[(b * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, 1.7e+40], N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision], N[(2.0 * N[(c * N[(i * N[((-a) - N[(b * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \leq -2.55 \cdot 10^{+48}:\\
\;\;\;\;2 \cdot \left(x \cdot y - \left(c \cdot c\right) \cdot \left(b \cdot i\right)\right)\\
\mathbf{elif}\;c \leq 1.7 \cdot 10^{+40}:\\
\;\;\;\;\left(x \cdot y + z \cdot t\right) \cdot 2\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(c \cdot \left(i \cdot \left(\left(-a\right) - b \cdot c\right)\right)\right)\\
\end{array}
\end{array}
if c < -2.5499999999999999e48Initial program 86.4%
Taylor expanded in a around 0 84.6%
unpow284.6%
associate-*r*90.3%
Simplified90.3%
Taylor expanded in z around 0 82.7%
unpow282.7%
associate-*r*88.5%
*-commutative88.5%
associate-*r*82.7%
unpow282.7%
associate-*l*84.4%
unpow284.4%
Simplified84.4%
if -2.5499999999999999e48 < c < 1.69999999999999994e40Initial program 97.4%
Taylor expanded in c around 0 80.5%
if 1.69999999999999994e40 < c Initial program 77.1%
Taylor expanded in i around inf 82.9%
Final simplification81.7%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= (* x y) -1.35e+81) (not (<= (* x y) 8.4e+111))) (* (* 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.35e+81) || !((x * y) <= 8.4e+111)) {
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.35d+81)) .or. (.not. ((x * y) <= 8.4d+111))) 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.35e+81) || !((x * y) <= 8.4e+111)) {
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.35e+81) or not ((x * y) <= 8.4e+111): 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.35e+81) || !(Float64(x * y) <= 8.4e+111)) 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.35e+81) || ~(((x * y) <= 8.4e+111))) 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.35e+81], N[Not[LessEqual[N[(x * y), $MachinePrecision], 8.4e+111]], $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.35 \cdot 10^{+81} \lor \neg \left(x \cdot y \leq 8.4 \cdot 10^{+111}\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.35e81 or 8.3999999999999998e111 < (*.f64 x y) Initial program 90.0%
Taylor expanded in x around inf 62.3%
if -1.35e81 < (*.f64 x y) < 8.3999999999999998e111Initial program 91.9%
Taylor expanded in z around inf 41.7%
Final simplification48.9%
(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 91.2%
Taylor expanded in z around inf 31.4%
Final simplification31.4%
(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 2023279
(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))))