
(FPCore (x y z t a b c i j k) :precision binary64 (- (- (+ (- (* (* (* (* x 18.0) y) z) t) (* (* a 4.0) t)) (* b c)) (* (* x 4.0) i)) (* (* j 27.0) k)))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
return (((((((x * 18.0) * y) * z) * t) - ((a * 4.0) * t)) + (b * c)) - ((x * 4.0) * i)) - ((j * 27.0) * k);
}
real(8) function code(x, y, z, t, a, b, c, i, j, k)
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), intent (in) :: j
real(8), intent (in) :: k
code = (((((((x * 18.0d0) * y) * z) * t) - ((a * 4.0d0) * t)) + (b * c)) - ((x * 4.0d0) * i)) - ((j * 27.0d0) * k)
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
return (((((((x * 18.0) * y) * z) * t) - ((a * 4.0) * t)) + (b * c)) - ((x * 4.0) * i)) - ((j * 27.0) * k);
}
def code(x, y, z, t, a, b, c, i, j, k): return (((((((x * 18.0) * y) * z) * t) - ((a * 4.0) * t)) + (b * c)) - ((x * 4.0) * i)) - ((j * 27.0) * k)
function code(x, y, z, t, a, b, c, i, j, k) return Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(x * 18.0) * y) * z) * t) - Float64(Float64(a * 4.0) * t)) + Float64(b * c)) - Float64(Float64(x * 4.0) * i)) - Float64(Float64(j * 27.0) * k)) end
function tmp = code(x, y, z, t, a, b, c, i, j, k) tmp = (((((((x * 18.0) * y) * z) * t) - ((a * 4.0) * t)) + (b * c)) - ((x * 4.0) * i)) - ((j * 27.0) * k); end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := N[(N[(N[(N[(N[(N[(N[(N[(x * 18.0), $MachinePrecision] * y), $MachinePrecision] * z), $MachinePrecision] * t), $MachinePrecision] - N[(N[(a * 4.0), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] + N[(b * c), $MachinePrecision]), $MachinePrecision] - N[(N[(x * 4.0), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision] - N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 15 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b c i j k) :precision binary64 (- (- (+ (- (* (* (* (* x 18.0) y) z) t) (* (* a 4.0) t)) (* b c)) (* (* x 4.0) i)) (* (* j 27.0) k)))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
return (((((((x * 18.0) * y) * z) * t) - ((a * 4.0) * t)) + (b * c)) - ((x * 4.0) * i)) - ((j * 27.0) * k);
}
real(8) function code(x, y, z, t, a, b, c, i, j, k)
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), intent (in) :: j
real(8), intent (in) :: k
code = (((((((x * 18.0d0) * y) * z) * t) - ((a * 4.0d0) * t)) + (b * c)) - ((x * 4.0d0) * i)) - ((j * 27.0d0) * k)
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
return (((((((x * 18.0) * y) * z) * t) - ((a * 4.0) * t)) + (b * c)) - ((x * 4.0) * i)) - ((j * 27.0) * k);
}
def code(x, y, z, t, a, b, c, i, j, k): return (((((((x * 18.0) * y) * z) * t) - ((a * 4.0) * t)) + (b * c)) - ((x * 4.0) * i)) - ((j * 27.0) * k)
function code(x, y, z, t, a, b, c, i, j, k) return Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(x * 18.0) * y) * z) * t) - Float64(Float64(a * 4.0) * t)) + Float64(b * c)) - Float64(Float64(x * 4.0) * i)) - Float64(Float64(j * 27.0) * k)) end
function tmp = code(x, y, z, t, a, b, c, i, j, k) tmp = (((((((x * 18.0) * y) * z) * t) - ((a * 4.0) * t)) + (b * c)) - ((x * 4.0) * i)) - ((j * 27.0) * k); end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := N[(N[(N[(N[(N[(N[(N[(N[(x * 18.0), $MachinePrecision] * y), $MachinePrecision] * z), $MachinePrecision] * t), $MachinePrecision] - N[(N[(a * 4.0), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] + N[(b * c), $MachinePrecision]), $MachinePrecision] - N[(N[(x * 4.0), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision] - N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k
\end{array}
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1
(-
(-
(+ (- (* (* (* (* x 18.0) y) z) t) (* t (* a 4.0))) (* b c))
(* (* x 4.0) i))
(* (* j 27.0) k))))
(if (<= t_1 INFINITY)
t_1
(+ (* b c) (* t (- (* 18.0 (* x (* y z))) (* a 4.0)))))))assert(y < z);
assert(j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = (((((((x * 18.0) * y) * z) * t) - (t * (a * 4.0))) + (b * c)) - ((x * 4.0) * i)) - ((j * 27.0) * k);
double tmp;
if (t_1 <= ((double) INFINITY)) {
tmp = t_1;
} else {
tmp = (b * c) + (t * ((18.0 * (x * (y * z))) - (a * 4.0)));
}
return tmp;
}
assert y < z;
assert j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = (((((((x * 18.0) * y) * z) * t) - (t * (a * 4.0))) + (b * c)) - ((x * 4.0) * i)) - ((j * 27.0) * k);
double tmp;
if (t_1 <= Double.POSITIVE_INFINITY) {
tmp = t_1;
} else {
tmp = (b * c) + (t * ((18.0 * (x * (y * z))) - (a * 4.0)));
}
return tmp;
}
[y, z] = sort([y, z]) [j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): t_1 = (((((((x * 18.0) * y) * z) * t) - (t * (a * 4.0))) + (b * c)) - ((x * 4.0) * i)) - ((j * 27.0) * k) tmp = 0 if t_1 <= math.inf: tmp = t_1 else: tmp = (b * c) + (t * ((18.0 * (x * (y * z))) - (a * 4.0))) return tmp
y, z = sort([y, z]) j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(x * 18.0) * y) * z) * t) - Float64(t * Float64(a * 4.0))) + Float64(b * c)) - Float64(Float64(x * 4.0) * i)) - Float64(Float64(j * 27.0) * k)) tmp = 0.0 if (t_1 <= Inf) tmp = t_1; else tmp = Float64(Float64(b * c) + Float64(t * Float64(Float64(18.0 * Float64(x * Float64(y * z))) - Float64(a * 4.0)))); end return tmp end
y, z = num2cell(sort([y, z])){:}
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
t_1 = (((((((x * 18.0) * y) * z) * t) - (t * (a * 4.0))) + (b * c)) - ((x * 4.0) * i)) - ((j * 27.0) * k);
tmp = 0.0;
if (t_1 <= Inf)
tmp = t_1;
else
tmp = (b * c) + (t * ((18.0 * (x * (y * z))) - (a * 4.0)));
end
tmp_2 = tmp;
end
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(N[(N[(N[(N[(N[(N[(N[(x * 18.0), $MachinePrecision] * y), $MachinePrecision] * z), $MachinePrecision] * t), $MachinePrecision] - N[(t * N[(a * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(b * c), $MachinePrecision]), $MachinePrecision] - N[(N[(x * 4.0), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision] - N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, Infinity], t$95$1, N[(N[(b * c), $MachinePrecision] + N[(t * N[(N[(18.0 * N[(x * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(a * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
t_1 := \left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - t \cdot \left(a \cdot 4\right)\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k\\
\mathbf{if}\;t_1 \leq \infty:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;b \cdot c + t \cdot \left(18 \cdot \left(x \cdot \left(y \cdot z\right)\right) - a \cdot 4\right)\\
\end{array}
\end{array}
if (-.f64 (-.f64 (+.f64 (-.f64 (*.f64 (*.f64 (*.f64 (*.f64 x 18) y) z) t) (*.f64 (*.f64 a 4) t)) (*.f64 b c)) (*.f64 (*.f64 x 4) i)) (*.f64 (*.f64 j 27) k)) < +inf.0Initial program 93.8%
if +inf.0 < (-.f64 (-.f64 (+.f64 (-.f64 (*.f64 (*.f64 (*.f64 (*.f64 x 18) y) z) t) (*.f64 (*.f64 a 4) t)) (*.f64 b c)) (*.f64 (*.f64 x 4) i)) (*.f64 (*.f64 j 27) k)) Initial program 0.0%
Simplified21.1%
Taylor expanded in x around inf 44.7%
associate-*r*44.7%
*-commutative44.7%
Simplified44.7%
Taylor expanded in i around 0 58.3%
Final simplification88.5%
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (* 18.0 (* t (* z (* x y))))))
(if (<= (* b c) -1.18e+162)
(* b c)
(if (<= (* b c) -820.0)
t_1
(if (<= (* b c) -5e-66)
(* k (* j -27.0))
(if (<= (* b c) 8.2e-195)
t_1
(if (<= (* b c) 9.8e-101)
(* -27.0 (* j k))
(if (<= (* b c) 2.9e+131) t_1 (* b c)))))))))assert(y < z);
assert(j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = 18.0 * (t * (z * (x * y)));
double tmp;
if ((b * c) <= -1.18e+162) {
tmp = b * c;
} else if ((b * c) <= -820.0) {
tmp = t_1;
} else if ((b * c) <= -5e-66) {
tmp = k * (j * -27.0);
} else if ((b * c) <= 8.2e-195) {
tmp = t_1;
} else if ((b * c) <= 9.8e-101) {
tmp = -27.0 * (j * k);
} else if ((b * c) <= 2.9e+131) {
tmp = t_1;
} else {
tmp = b * c;
}
return tmp;
}
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
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), intent (in) :: j
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: tmp
t_1 = 18.0d0 * (t * (z * (x * y)))
if ((b * c) <= (-1.18d+162)) then
tmp = b * c
else if ((b * c) <= (-820.0d0)) then
tmp = t_1
else if ((b * c) <= (-5d-66)) then
tmp = k * (j * (-27.0d0))
else if ((b * c) <= 8.2d-195) then
tmp = t_1
else if ((b * c) <= 9.8d-101) then
tmp = (-27.0d0) * (j * k)
else if ((b * c) <= 2.9d+131) then
tmp = t_1
else
tmp = b * c
end if
code = tmp
end function
assert y < z;
assert j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = 18.0 * (t * (z * (x * y)));
double tmp;
if ((b * c) <= -1.18e+162) {
tmp = b * c;
} else if ((b * c) <= -820.0) {
tmp = t_1;
} else if ((b * c) <= -5e-66) {
tmp = k * (j * -27.0);
} else if ((b * c) <= 8.2e-195) {
tmp = t_1;
} else if ((b * c) <= 9.8e-101) {
tmp = -27.0 * (j * k);
} else if ((b * c) <= 2.9e+131) {
tmp = t_1;
} else {
tmp = b * c;
}
return tmp;
}
[y, z] = sort([y, z]) [j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): t_1 = 18.0 * (t * (z * (x * y))) tmp = 0 if (b * c) <= -1.18e+162: tmp = b * c elif (b * c) <= -820.0: tmp = t_1 elif (b * c) <= -5e-66: tmp = k * (j * -27.0) elif (b * c) <= 8.2e-195: tmp = t_1 elif (b * c) <= 9.8e-101: tmp = -27.0 * (j * k) elif (b * c) <= 2.9e+131: tmp = t_1 else: tmp = b * c return tmp
y, z = sort([y, z]) j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(18.0 * Float64(t * Float64(z * Float64(x * y)))) tmp = 0.0 if (Float64(b * c) <= -1.18e+162) tmp = Float64(b * c); elseif (Float64(b * c) <= -820.0) tmp = t_1; elseif (Float64(b * c) <= -5e-66) tmp = Float64(k * Float64(j * -27.0)); elseif (Float64(b * c) <= 8.2e-195) tmp = t_1; elseif (Float64(b * c) <= 9.8e-101) tmp = Float64(-27.0 * Float64(j * k)); elseif (Float64(b * c) <= 2.9e+131) tmp = t_1; else tmp = Float64(b * c); end return tmp end
y, z = num2cell(sort([y, z])){:}
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
t_1 = 18.0 * (t * (z * (x * y)));
tmp = 0.0;
if ((b * c) <= -1.18e+162)
tmp = b * c;
elseif ((b * c) <= -820.0)
tmp = t_1;
elseif ((b * c) <= -5e-66)
tmp = k * (j * -27.0);
elseif ((b * c) <= 8.2e-195)
tmp = t_1;
elseif ((b * c) <= 9.8e-101)
tmp = -27.0 * (j * k);
elseif ((b * c) <= 2.9e+131)
tmp = t_1;
else
tmp = b * c;
end
tmp_2 = tmp;
end
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(18.0 * N[(t * N[(z * N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(b * c), $MachinePrecision], -1.18e+162], N[(b * c), $MachinePrecision], If[LessEqual[N[(b * c), $MachinePrecision], -820.0], t$95$1, If[LessEqual[N[(b * c), $MachinePrecision], -5e-66], N[(k * N[(j * -27.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(b * c), $MachinePrecision], 8.2e-195], t$95$1, If[LessEqual[N[(b * c), $MachinePrecision], 9.8e-101], N[(-27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(b * c), $MachinePrecision], 2.9e+131], t$95$1, N[(b * c), $MachinePrecision]]]]]]]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
t_1 := 18 \cdot \left(t \cdot \left(z \cdot \left(x \cdot y\right)\right)\right)\\
\mathbf{if}\;b \cdot c \leq -1.18 \cdot 10^{+162}:\\
\;\;\;\;b \cdot c\\
\mathbf{elif}\;b \cdot c \leq -820:\\
\;\;\;\;t_1\\
\mathbf{elif}\;b \cdot c \leq -5 \cdot 10^{-66}:\\
\;\;\;\;k \cdot \left(j \cdot -27\right)\\
\mathbf{elif}\;b \cdot c \leq 8.2 \cdot 10^{-195}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;b \cdot c \leq 9.8 \cdot 10^{-101}:\\
\;\;\;\;-27 \cdot \left(j \cdot k\right)\\
\mathbf{elif}\;b \cdot c \leq 2.9 \cdot 10^{+131}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;b \cdot c\\
\end{array}
\end{array}
if (*.f64 b c) < -1.1800000000000001e162 or 2.9000000000000001e131 < (*.f64 b c) Initial program 79.9%
Simplified82.3%
Taylor expanded in b around inf 68.6%
if -1.1800000000000001e162 < (*.f64 b c) < -820 or -4.99999999999999962e-66 < (*.f64 b c) < 8.20000000000000024e-195 or 9.8000000000000001e-101 < (*.f64 b c) < 2.9000000000000001e131Initial program 79.6%
Simplified85.1%
Taylor expanded in y around inf 43.2%
*-commutative43.2%
associate-*l*43.2%
*-commutative43.2%
*-commutative43.2%
*-commutative43.2%
associate-*l*43.3%
Simplified43.3%
Taylor expanded in x around 0 43.2%
*-commutative43.2%
*-commutative43.2%
associate-*l*42.5%
Simplified42.5%
if -820 < (*.f64 b c) < -4.99999999999999962e-66Initial program 75.5%
Simplified69.4%
Taylor expanded in j around inf 57.5%
associate-*r*57.4%
Simplified57.4%
if 8.20000000000000024e-195 < (*.f64 b c) < 9.8000000000000001e-101Initial program 87.5%
Simplified93.6%
Taylor expanded in j around inf 51.2%
Final simplification52.0%
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (* 18.0 (* t (* z (* x y))))))
(if (<= (* b c) -3.1e+169)
(* b c)
(if (<= (* b c) -26.0)
t_1
(if (<= (* b c) -2.9e-70)
(* k (* j -27.0))
(if (<= (* b c) 1.15e-194)
t_1
(if (<= (* b c) 1.22e-98)
(* -27.0 (* j k))
(if (<= (* b c) 1.08e+129)
(* 18.0 (* x (* y (* z t))))
(* b c)))))))))assert(y < z);
assert(j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = 18.0 * (t * (z * (x * y)));
double tmp;
if ((b * c) <= -3.1e+169) {
tmp = b * c;
} else if ((b * c) <= -26.0) {
tmp = t_1;
} else if ((b * c) <= -2.9e-70) {
tmp = k * (j * -27.0);
} else if ((b * c) <= 1.15e-194) {
tmp = t_1;
} else if ((b * c) <= 1.22e-98) {
tmp = -27.0 * (j * k);
} else if ((b * c) <= 1.08e+129) {
tmp = 18.0 * (x * (y * (z * t)));
} else {
tmp = b * c;
}
return tmp;
}
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
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), intent (in) :: j
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: tmp
t_1 = 18.0d0 * (t * (z * (x * y)))
if ((b * c) <= (-3.1d+169)) then
tmp = b * c
else if ((b * c) <= (-26.0d0)) then
tmp = t_1
else if ((b * c) <= (-2.9d-70)) then
tmp = k * (j * (-27.0d0))
else if ((b * c) <= 1.15d-194) then
tmp = t_1
else if ((b * c) <= 1.22d-98) then
tmp = (-27.0d0) * (j * k)
else if ((b * c) <= 1.08d+129) then
tmp = 18.0d0 * (x * (y * (z * t)))
else
tmp = b * c
end if
code = tmp
end function
assert y < z;
assert j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = 18.0 * (t * (z * (x * y)));
double tmp;
if ((b * c) <= -3.1e+169) {
tmp = b * c;
} else if ((b * c) <= -26.0) {
tmp = t_1;
} else if ((b * c) <= -2.9e-70) {
tmp = k * (j * -27.0);
} else if ((b * c) <= 1.15e-194) {
tmp = t_1;
} else if ((b * c) <= 1.22e-98) {
tmp = -27.0 * (j * k);
} else if ((b * c) <= 1.08e+129) {
tmp = 18.0 * (x * (y * (z * t)));
} else {
tmp = b * c;
}
return tmp;
}
[y, z] = sort([y, z]) [j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): t_1 = 18.0 * (t * (z * (x * y))) tmp = 0 if (b * c) <= -3.1e+169: tmp = b * c elif (b * c) <= -26.0: tmp = t_1 elif (b * c) <= -2.9e-70: tmp = k * (j * -27.0) elif (b * c) <= 1.15e-194: tmp = t_1 elif (b * c) <= 1.22e-98: tmp = -27.0 * (j * k) elif (b * c) <= 1.08e+129: tmp = 18.0 * (x * (y * (z * t))) else: tmp = b * c return tmp
y, z = sort([y, z]) j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(18.0 * Float64(t * Float64(z * Float64(x * y)))) tmp = 0.0 if (Float64(b * c) <= -3.1e+169) tmp = Float64(b * c); elseif (Float64(b * c) <= -26.0) tmp = t_1; elseif (Float64(b * c) <= -2.9e-70) tmp = Float64(k * Float64(j * -27.0)); elseif (Float64(b * c) <= 1.15e-194) tmp = t_1; elseif (Float64(b * c) <= 1.22e-98) tmp = Float64(-27.0 * Float64(j * k)); elseif (Float64(b * c) <= 1.08e+129) tmp = Float64(18.0 * Float64(x * Float64(y * Float64(z * t)))); else tmp = Float64(b * c); end return tmp end
y, z = num2cell(sort([y, z])){:}
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
t_1 = 18.0 * (t * (z * (x * y)));
tmp = 0.0;
if ((b * c) <= -3.1e+169)
tmp = b * c;
elseif ((b * c) <= -26.0)
tmp = t_1;
elseif ((b * c) <= -2.9e-70)
tmp = k * (j * -27.0);
elseif ((b * c) <= 1.15e-194)
tmp = t_1;
elseif ((b * c) <= 1.22e-98)
tmp = -27.0 * (j * k);
elseif ((b * c) <= 1.08e+129)
tmp = 18.0 * (x * (y * (z * t)));
else
tmp = b * c;
end
tmp_2 = tmp;
end
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(18.0 * N[(t * N[(z * N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(b * c), $MachinePrecision], -3.1e+169], N[(b * c), $MachinePrecision], If[LessEqual[N[(b * c), $MachinePrecision], -26.0], t$95$1, If[LessEqual[N[(b * c), $MachinePrecision], -2.9e-70], N[(k * N[(j * -27.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(b * c), $MachinePrecision], 1.15e-194], t$95$1, If[LessEqual[N[(b * c), $MachinePrecision], 1.22e-98], N[(-27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(b * c), $MachinePrecision], 1.08e+129], N[(18.0 * N[(x * N[(y * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(b * c), $MachinePrecision]]]]]]]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
t_1 := 18 \cdot \left(t \cdot \left(z \cdot \left(x \cdot y\right)\right)\right)\\
\mathbf{if}\;b \cdot c \leq -3.1 \cdot 10^{+169}:\\
\;\;\;\;b \cdot c\\
\mathbf{elif}\;b \cdot c \leq -26:\\
\;\;\;\;t_1\\
\mathbf{elif}\;b \cdot c \leq -2.9 \cdot 10^{-70}:\\
\;\;\;\;k \cdot \left(j \cdot -27\right)\\
\mathbf{elif}\;b \cdot c \leq 1.15 \cdot 10^{-194}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;b \cdot c \leq 1.22 \cdot 10^{-98}:\\
\;\;\;\;-27 \cdot \left(j \cdot k\right)\\
\mathbf{elif}\;b \cdot c \leq 1.08 \cdot 10^{+129}:\\
\;\;\;\;18 \cdot \left(x \cdot \left(y \cdot \left(z \cdot t\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;b \cdot c\\
\end{array}
\end{array}
if (*.f64 b c) < -3.1e169 or 1.08e129 < (*.f64 b c) Initial program 79.9%
Simplified82.3%
Taylor expanded in b around inf 68.6%
if -3.1e169 < (*.f64 b c) < -26 or -2.89999999999999971e-70 < (*.f64 b c) < 1.15000000000000001e-194Initial program 78.5%
Simplified85.5%
Taylor expanded in y around inf 47.0%
*-commutative47.0%
associate-*l*47.0%
*-commutative47.0%
*-commutative47.0%
*-commutative47.0%
associate-*l*46.3%
Simplified46.3%
Taylor expanded in x around 0 47.0%
*-commutative47.0%
*-commutative47.0%
associate-*l*47.0%
Simplified47.0%
if -26 < (*.f64 b c) < -2.89999999999999971e-70Initial program 75.5%
Simplified69.4%
Taylor expanded in j around inf 57.5%
associate-*r*57.4%
Simplified57.4%
if 1.15000000000000001e-194 < (*.f64 b c) < 1.2200000000000001e-98Initial program 87.5%
Simplified93.6%
Taylor expanded in j around inf 51.2%
if 1.2200000000000001e-98 < (*.f64 b c) < 1.08e129Initial program 82.0%
Simplified84.2%
Taylor expanded in y around inf 34.2%
*-commutative34.2%
associate-*l*34.0%
*-commutative34.0%
*-commutative34.0%
associate-*l*38.5%
Simplified38.5%
Final simplification53.1%
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (* 18.0 (* x (* z (* y t))))) (t_2 (* -27.0 (* j k))))
(if (<= (* b c) -1.78e+162)
(* b c)
(if (<= (* b c) -8.2e-12)
t_1
(if (<= (* b c) -3.2e-67)
t_2
(if (<= (* b c) 3.9e-199)
(* 18.0 (* t (* z (* x y))))
(if (<= (* b c) 3.8e-97)
t_2
(if (<= (* b c) 1.02e+131) t_1 (* b c)))))))))assert(y < z);
assert(j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = 18.0 * (x * (z * (y * t)));
double t_2 = -27.0 * (j * k);
double tmp;
if ((b * c) <= -1.78e+162) {
tmp = b * c;
} else if ((b * c) <= -8.2e-12) {
tmp = t_1;
} else if ((b * c) <= -3.2e-67) {
tmp = t_2;
} else if ((b * c) <= 3.9e-199) {
tmp = 18.0 * (t * (z * (x * y)));
} else if ((b * c) <= 3.8e-97) {
tmp = t_2;
} else if ((b * c) <= 1.02e+131) {
tmp = t_1;
} else {
tmp = b * c;
}
return tmp;
}
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
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), intent (in) :: j
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = 18.0d0 * (x * (z * (y * t)))
t_2 = (-27.0d0) * (j * k)
if ((b * c) <= (-1.78d+162)) then
tmp = b * c
else if ((b * c) <= (-8.2d-12)) then
tmp = t_1
else if ((b * c) <= (-3.2d-67)) then
tmp = t_2
else if ((b * c) <= 3.9d-199) then
tmp = 18.0d0 * (t * (z * (x * y)))
else if ((b * c) <= 3.8d-97) then
tmp = t_2
else if ((b * c) <= 1.02d+131) then
tmp = t_1
else
tmp = b * c
end if
code = tmp
end function
assert y < z;
assert j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = 18.0 * (x * (z * (y * t)));
double t_2 = -27.0 * (j * k);
double tmp;
if ((b * c) <= -1.78e+162) {
tmp = b * c;
} else if ((b * c) <= -8.2e-12) {
tmp = t_1;
} else if ((b * c) <= -3.2e-67) {
tmp = t_2;
} else if ((b * c) <= 3.9e-199) {
tmp = 18.0 * (t * (z * (x * y)));
} else if ((b * c) <= 3.8e-97) {
tmp = t_2;
} else if ((b * c) <= 1.02e+131) {
tmp = t_1;
} else {
tmp = b * c;
}
return tmp;
}
[y, z] = sort([y, z]) [j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): t_1 = 18.0 * (x * (z * (y * t))) t_2 = -27.0 * (j * k) tmp = 0 if (b * c) <= -1.78e+162: tmp = b * c elif (b * c) <= -8.2e-12: tmp = t_1 elif (b * c) <= -3.2e-67: tmp = t_2 elif (b * c) <= 3.9e-199: tmp = 18.0 * (t * (z * (x * y))) elif (b * c) <= 3.8e-97: tmp = t_2 elif (b * c) <= 1.02e+131: tmp = t_1 else: tmp = b * c return tmp
y, z = sort([y, z]) j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(18.0 * Float64(x * Float64(z * Float64(y * t)))) t_2 = Float64(-27.0 * Float64(j * k)) tmp = 0.0 if (Float64(b * c) <= -1.78e+162) tmp = Float64(b * c); elseif (Float64(b * c) <= -8.2e-12) tmp = t_1; elseif (Float64(b * c) <= -3.2e-67) tmp = t_2; elseif (Float64(b * c) <= 3.9e-199) tmp = Float64(18.0 * Float64(t * Float64(z * Float64(x * y)))); elseif (Float64(b * c) <= 3.8e-97) tmp = t_2; elseif (Float64(b * c) <= 1.02e+131) tmp = t_1; else tmp = Float64(b * c); end return tmp end
y, z = num2cell(sort([y, z])){:}
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
t_1 = 18.0 * (x * (z * (y * t)));
t_2 = -27.0 * (j * k);
tmp = 0.0;
if ((b * c) <= -1.78e+162)
tmp = b * c;
elseif ((b * c) <= -8.2e-12)
tmp = t_1;
elseif ((b * c) <= -3.2e-67)
tmp = t_2;
elseif ((b * c) <= 3.9e-199)
tmp = 18.0 * (t * (z * (x * y)));
elseif ((b * c) <= 3.8e-97)
tmp = t_2;
elseif ((b * c) <= 1.02e+131)
tmp = t_1;
else
tmp = b * c;
end
tmp_2 = tmp;
end
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(18.0 * N[(x * N[(z * N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(-27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(b * c), $MachinePrecision], -1.78e+162], N[(b * c), $MachinePrecision], If[LessEqual[N[(b * c), $MachinePrecision], -8.2e-12], t$95$1, If[LessEqual[N[(b * c), $MachinePrecision], -3.2e-67], t$95$2, If[LessEqual[N[(b * c), $MachinePrecision], 3.9e-199], N[(18.0 * N[(t * N[(z * N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(b * c), $MachinePrecision], 3.8e-97], t$95$2, If[LessEqual[N[(b * c), $MachinePrecision], 1.02e+131], t$95$1, N[(b * c), $MachinePrecision]]]]]]]]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
t_1 := 18 \cdot \left(x \cdot \left(z \cdot \left(y \cdot t\right)\right)\right)\\
t_2 := -27 \cdot \left(j \cdot k\right)\\
\mathbf{if}\;b \cdot c \leq -1.78 \cdot 10^{+162}:\\
\;\;\;\;b \cdot c\\
\mathbf{elif}\;b \cdot c \leq -8.2 \cdot 10^{-12}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;b \cdot c \leq -3.2 \cdot 10^{-67}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;b \cdot c \leq 3.9 \cdot 10^{-199}:\\
\;\;\;\;18 \cdot \left(t \cdot \left(z \cdot \left(x \cdot y\right)\right)\right)\\
\mathbf{elif}\;b \cdot c \leq 3.8 \cdot 10^{-97}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;b \cdot c \leq 1.02 \cdot 10^{+131}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;b \cdot c\\
\end{array}
\end{array}
if (*.f64 b c) < -1.77999999999999998e162 or 1.0199999999999999e131 < (*.f64 b c) Initial program 79.9%
Simplified82.3%
Taylor expanded in b around inf 68.6%
if -1.77999999999999998e162 < (*.f64 b c) < -8.19999999999999979e-12 or 3.8000000000000001e-97 < (*.f64 b c) < 1.0199999999999999e131Initial program 76.5%
Simplified82.3%
Taylor expanded in y around inf 39.1%
*-commutative39.1%
associate-*l*39.0%
*-commutative39.0%
*-commutative39.0%
*-commutative39.0%
associate-*l*40.6%
Simplified40.6%
if -8.19999999999999979e-12 < (*.f64 b c) < -3.20000000000000021e-67 or 3.9000000000000001e-199 < (*.f64 b c) < 3.8000000000000001e-97Initial program 83.3%
Simplified83.2%
Taylor expanded in j around inf 54.6%
if -3.20000000000000021e-67 < (*.f64 b c) < 3.9000000000000001e-199Initial program 81.4%
Simplified86.6%
Taylor expanded in y around inf 45.7%
*-commutative45.7%
associate-*l*45.6%
*-commutative45.6%
*-commutative45.6%
*-commutative45.6%
associate-*l*45.6%
Simplified45.6%
Taylor expanded in x around 0 45.7%
*-commutative45.7%
*-commutative45.7%
associate-*l*46.6%
Simplified46.6%
Final simplification52.8%
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(if (<= x -2.5e+219)
(+ (* b c) (* t (- (* 18.0 (* x (* y z))) (* a 4.0))))
(if (<= x 4.5e+188)
(-
(+ (* b c) (* t (- (* (* x y) (* 18.0 z)) (* a 4.0))))
(+ (* x (* 4.0 i)) (* j (* 27.0 k))))
(+ (* b c) (* t (* (* x 18.0) (* y z)))))))assert(y < z);
assert(j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double tmp;
if (x <= -2.5e+219) {
tmp = (b * c) + (t * ((18.0 * (x * (y * z))) - (a * 4.0)));
} else if (x <= 4.5e+188) {
tmp = ((b * c) + (t * (((x * y) * (18.0 * z)) - (a * 4.0)))) - ((x * (4.0 * i)) + (j * (27.0 * k)));
} else {
tmp = (b * c) + (t * ((x * 18.0) * (y * z)));
}
return tmp;
}
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
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), intent (in) :: j
real(8), intent (in) :: k
real(8) :: tmp
if (x <= (-2.5d+219)) then
tmp = (b * c) + (t * ((18.0d0 * (x * (y * z))) - (a * 4.0d0)))
else if (x <= 4.5d+188) then
tmp = ((b * c) + (t * (((x * y) * (18.0d0 * z)) - (a * 4.0d0)))) - ((x * (4.0d0 * i)) + (j * (27.0d0 * k)))
else
tmp = (b * c) + (t * ((x * 18.0d0) * (y * z)))
end if
code = tmp
end function
assert y < z;
assert j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double tmp;
if (x <= -2.5e+219) {
tmp = (b * c) + (t * ((18.0 * (x * (y * z))) - (a * 4.0)));
} else if (x <= 4.5e+188) {
tmp = ((b * c) + (t * (((x * y) * (18.0 * z)) - (a * 4.0)))) - ((x * (4.0 * i)) + (j * (27.0 * k)));
} else {
tmp = (b * c) + (t * ((x * 18.0) * (y * z)));
}
return tmp;
}
[y, z] = sort([y, z]) [j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): tmp = 0 if x <= -2.5e+219: tmp = (b * c) + (t * ((18.0 * (x * (y * z))) - (a * 4.0))) elif x <= 4.5e+188: tmp = ((b * c) + (t * (((x * y) * (18.0 * z)) - (a * 4.0)))) - ((x * (4.0 * i)) + (j * (27.0 * k))) else: tmp = (b * c) + (t * ((x * 18.0) * (y * z))) return tmp
y, z = sort([y, z]) j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) tmp = 0.0 if (x <= -2.5e+219) tmp = Float64(Float64(b * c) + Float64(t * Float64(Float64(18.0 * Float64(x * Float64(y * z))) - Float64(a * 4.0)))); elseif (x <= 4.5e+188) tmp = Float64(Float64(Float64(b * c) + Float64(t * Float64(Float64(Float64(x * y) * Float64(18.0 * z)) - Float64(a * 4.0)))) - Float64(Float64(x * Float64(4.0 * i)) + Float64(j * Float64(27.0 * k)))); else tmp = Float64(Float64(b * c) + Float64(t * Float64(Float64(x * 18.0) * Float64(y * z)))); end return tmp end
y, z = num2cell(sort([y, z])){:}
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
tmp = 0.0;
if (x <= -2.5e+219)
tmp = (b * c) + (t * ((18.0 * (x * (y * z))) - (a * 4.0)));
elseif (x <= 4.5e+188)
tmp = ((b * c) + (t * (((x * y) * (18.0 * z)) - (a * 4.0)))) - ((x * (4.0 * i)) + (j * (27.0 * k)));
else
tmp = (b * c) + (t * ((x * 18.0) * (y * z)));
end
tmp_2 = tmp;
end
NOTE: y and z should be sorted in increasing order before calling this function. NOTE: j and k should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := If[LessEqual[x, -2.5e+219], N[(N[(b * c), $MachinePrecision] + N[(t * N[(N[(18.0 * N[(x * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(a * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 4.5e+188], N[(N[(N[(b * c), $MachinePrecision] + N[(t * N[(N[(N[(x * y), $MachinePrecision] * N[(18.0 * z), $MachinePrecision]), $MachinePrecision] - N[(a * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(x * N[(4.0 * i), $MachinePrecision]), $MachinePrecision] + N[(j * N[(27.0 * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(b * c), $MachinePrecision] + N[(t * N[(N[(x * 18.0), $MachinePrecision] * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.5 \cdot 10^{+219}:\\
\;\;\;\;b \cdot c + t \cdot \left(18 \cdot \left(x \cdot \left(y \cdot z\right)\right) - a \cdot 4\right)\\
\mathbf{elif}\;x \leq 4.5 \cdot 10^{+188}:\\
\;\;\;\;\left(b \cdot c + t \cdot \left(\left(x \cdot y\right) \cdot \left(18 \cdot z\right) - a \cdot 4\right)\right) - \left(x \cdot \left(4 \cdot i\right) + j \cdot \left(27 \cdot k\right)\right)\\
\mathbf{else}:\\
\;\;\;\;b \cdot c + t \cdot \left(\left(x \cdot 18\right) \cdot \left(y \cdot z\right)\right)\\
\end{array}
\end{array}
if x < -2.5e219Initial program 40.3%
Simplified52.4%
Taylor expanded in x around inf 61.1%
associate-*r*61.1%
*-commutative61.1%
Simplified61.1%
Taylor expanded in i around 0 78.7%
if -2.5e219 < x < 4.5000000000000001e188Initial program 87.6%
Simplified90.5%
Taylor expanded in x around 0 90.5%
*-commutative90.5%
associate-*r*90.5%
associate-*l*90.5%
Simplified90.5%
if 4.5000000000000001e188 < x Initial program 52.6%
Simplified56.6%
Taylor expanded in x around inf 64.6%
associate-*r*64.6%
*-commutative64.6%
Simplified64.6%
Taylor expanded in i around 0 68.6%
Taylor expanded in x around inf 68.6%
associate-*r*68.6%
*-commutative68.6%
Simplified68.6%
Final simplification87.3%
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(if (<= x -1.2e+231)
(+ (* b c) (* t (- (* 18.0 (* x (* y z))) (* a 4.0))))
(-
(+ (* b c) (* t (- (* (* x 18.0) (* y z)) (* a 4.0))))
(+ (* x (* 4.0 i)) (* j (* 27.0 k))))))assert(y < z);
assert(j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double tmp;
if (x <= -1.2e+231) {
tmp = (b * c) + (t * ((18.0 * (x * (y * z))) - (a * 4.0)));
} else {
tmp = ((b * c) + (t * (((x * 18.0) * (y * z)) - (a * 4.0)))) - ((x * (4.0 * i)) + (j * (27.0 * k)));
}
return tmp;
}
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
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), intent (in) :: j
real(8), intent (in) :: k
real(8) :: tmp
if (x <= (-1.2d+231)) then
tmp = (b * c) + (t * ((18.0d0 * (x * (y * z))) - (a * 4.0d0)))
else
tmp = ((b * c) + (t * (((x * 18.0d0) * (y * z)) - (a * 4.0d0)))) - ((x * (4.0d0 * i)) + (j * (27.0d0 * k)))
end if
code = tmp
end function
assert y < z;
assert j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double tmp;
if (x <= -1.2e+231) {
tmp = (b * c) + (t * ((18.0 * (x * (y * z))) - (a * 4.0)));
} else {
tmp = ((b * c) + (t * (((x * 18.0) * (y * z)) - (a * 4.0)))) - ((x * (4.0 * i)) + (j * (27.0 * k)));
}
return tmp;
}
[y, z] = sort([y, z]) [j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): tmp = 0 if x <= -1.2e+231: tmp = (b * c) + (t * ((18.0 * (x * (y * z))) - (a * 4.0))) else: tmp = ((b * c) + (t * (((x * 18.0) * (y * z)) - (a * 4.0)))) - ((x * (4.0 * i)) + (j * (27.0 * k))) return tmp
y, z = sort([y, z]) j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) tmp = 0.0 if (x <= -1.2e+231) tmp = Float64(Float64(b * c) + Float64(t * Float64(Float64(18.0 * Float64(x * Float64(y * z))) - Float64(a * 4.0)))); else tmp = Float64(Float64(Float64(b * c) + Float64(t * Float64(Float64(Float64(x * 18.0) * Float64(y * z)) - Float64(a * 4.0)))) - Float64(Float64(x * Float64(4.0 * i)) + Float64(j * Float64(27.0 * k)))); end return tmp end
y, z = num2cell(sort([y, z])){:}
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
tmp = 0.0;
if (x <= -1.2e+231)
tmp = (b * c) + (t * ((18.0 * (x * (y * z))) - (a * 4.0)));
else
tmp = ((b * c) + (t * (((x * 18.0) * (y * z)) - (a * 4.0)))) - ((x * (4.0 * i)) + (j * (27.0 * k)));
end
tmp_2 = tmp;
end
NOTE: y and z should be sorted in increasing order before calling this function. NOTE: j and k should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := If[LessEqual[x, -1.2e+231], N[(N[(b * c), $MachinePrecision] + N[(t * N[(N[(18.0 * N[(x * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(a * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(b * c), $MachinePrecision] + N[(t * N[(N[(N[(x * 18.0), $MachinePrecision] * N[(y * z), $MachinePrecision]), $MachinePrecision] - N[(a * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(x * N[(4.0 * i), $MachinePrecision]), $MachinePrecision] + N[(j * N[(27.0 * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.2 \cdot 10^{+231}:\\
\;\;\;\;b \cdot c + t \cdot \left(18 \cdot \left(x \cdot \left(y \cdot z\right)\right) - a \cdot 4\right)\\
\mathbf{else}:\\
\;\;\;\;\left(b \cdot c + t \cdot \left(\left(x \cdot 18\right) \cdot \left(y \cdot z\right) - a \cdot 4\right)\right) - \left(x \cdot \left(4 \cdot i\right) + j \cdot \left(27 \cdot k\right)\right)\\
\end{array}
\end{array}
if x < -1.20000000000000003e231Initial program 39.0%
Simplified52.3%
Taylor expanded in x around inf 61.8%
associate-*r*61.8%
*-commutative61.8%
Simplified61.8%
Taylor expanded in i around 0 81.1%
if -1.20000000000000003e231 < x Initial program 83.6%
Simplified86.6%
Final simplification86.1%
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (* -27.0 (* j k))) (t_2 (* t (* a -4.0))))
(if (<= (* b c) -1.75e+199)
(* b c)
(if (<= (* b c) -1.6e-231)
t_1
(if (<= (* b c) -1.1e-301)
t_2
(if (<= (* b c) 6.2e-101)
t_1
(if (<= (* b c) 1.6e+42)
t_2
(if (<= (* b c) 1e+92) t_1 (* b c)))))))))assert(y < z);
assert(j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = -27.0 * (j * k);
double t_2 = t * (a * -4.0);
double tmp;
if ((b * c) <= -1.75e+199) {
tmp = b * c;
} else if ((b * c) <= -1.6e-231) {
tmp = t_1;
} else if ((b * c) <= -1.1e-301) {
tmp = t_2;
} else if ((b * c) <= 6.2e-101) {
tmp = t_1;
} else if ((b * c) <= 1.6e+42) {
tmp = t_2;
} else if ((b * c) <= 1e+92) {
tmp = t_1;
} else {
tmp = b * c;
}
return tmp;
}
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
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), intent (in) :: j
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (-27.0d0) * (j * k)
t_2 = t * (a * (-4.0d0))
if ((b * c) <= (-1.75d+199)) then
tmp = b * c
else if ((b * c) <= (-1.6d-231)) then
tmp = t_1
else if ((b * c) <= (-1.1d-301)) then
tmp = t_2
else if ((b * c) <= 6.2d-101) then
tmp = t_1
else if ((b * c) <= 1.6d+42) then
tmp = t_2
else if ((b * c) <= 1d+92) then
tmp = t_1
else
tmp = b * c
end if
code = tmp
end function
assert y < z;
assert j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = -27.0 * (j * k);
double t_2 = t * (a * -4.0);
double tmp;
if ((b * c) <= -1.75e+199) {
tmp = b * c;
} else if ((b * c) <= -1.6e-231) {
tmp = t_1;
} else if ((b * c) <= -1.1e-301) {
tmp = t_2;
} else if ((b * c) <= 6.2e-101) {
tmp = t_1;
} else if ((b * c) <= 1.6e+42) {
tmp = t_2;
} else if ((b * c) <= 1e+92) {
tmp = t_1;
} else {
tmp = b * c;
}
return tmp;
}
[y, z] = sort([y, z]) [j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): t_1 = -27.0 * (j * k) t_2 = t * (a * -4.0) tmp = 0 if (b * c) <= -1.75e+199: tmp = b * c elif (b * c) <= -1.6e-231: tmp = t_1 elif (b * c) <= -1.1e-301: tmp = t_2 elif (b * c) <= 6.2e-101: tmp = t_1 elif (b * c) <= 1.6e+42: tmp = t_2 elif (b * c) <= 1e+92: tmp = t_1 else: tmp = b * c return tmp
y, z = sort([y, z]) j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(-27.0 * Float64(j * k)) t_2 = Float64(t * Float64(a * -4.0)) tmp = 0.0 if (Float64(b * c) <= -1.75e+199) tmp = Float64(b * c); elseif (Float64(b * c) <= -1.6e-231) tmp = t_1; elseif (Float64(b * c) <= -1.1e-301) tmp = t_2; elseif (Float64(b * c) <= 6.2e-101) tmp = t_1; elseif (Float64(b * c) <= 1.6e+42) tmp = t_2; elseif (Float64(b * c) <= 1e+92) tmp = t_1; else tmp = Float64(b * c); end return tmp end
y, z = num2cell(sort([y, z])){:}
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
t_1 = -27.0 * (j * k);
t_2 = t * (a * -4.0);
tmp = 0.0;
if ((b * c) <= -1.75e+199)
tmp = b * c;
elseif ((b * c) <= -1.6e-231)
tmp = t_1;
elseif ((b * c) <= -1.1e-301)
tmp = t_2;
elseif ((b * c) <= 6.2e-101)
tmp = t_1;
elseif ((b * c) <= 1.6e+42)
tmp = t_2;
elseif ((b * c) <= 1e+92)
tmp = t_1;
else
tmp = b * c;
end
tmp_2 = tmp;
end
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(-27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t * N[(a * -4.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(b * c), $MachinePrecision], -1.75e+199], N[(b * c), $MachinePrecision], If[LessEqual[N[(b * c), $MachinePrecision], -1.6e-231], t$95$1, If[LessEqual[N[(b * c), $MachinePrecision], -1.1e-301], t$95$2, If[LessEqual[N[(b * c), $MachinePrecision], 6.2e-101], t$95$1, If[LessEqual[N[(b * c), $MachinePrecision], 1.6e+42], t$95$2, If[LessEqual[N[(b * c), $MachinePrecision], 1e+92], t$95$1, N[(b * c), $MachinePrecision]]]]]]]]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
t_1 := -27 \cdot \left(j \cdot k\right)\\
t_2 := t \cdot \left(a \cdot -4\right)\\
\mathbf{if}\;b \cdot c \leq -1.75 \cdot 10^{+199}:\\
\;\;\;\;b \cdot c\\
\mathbf{elif}\;b \cdot c \leq -1.6 \cdot 10^{-231}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;b \cdot c \leq -1.1 \cdot 10^{-301}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;b \cdot c \leq 6.2 \cdot 10^{-101}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;b \cdot c \leq 1.6 \cdot 10^{+42}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;b \cdot c \leq 10^{+92}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;b \cdot c\\
\end{array}
\end{array}
if (*.f64 b c) < -1.7499999999999999e199 or 1e92 < (*.f64 b c) Initial program 79.1%
Simplified80.2%
Taylor expanded in b around inf 65.1%
if -1.7499999999999999e199 < (*.f64 b c) < -1.60000000000000004e-231 or -1.1e-301 < (*.f64 b c) < 6.19999999999999946e-101 or 1.60000000000000001e42 < (*.f64 b c) < 1e92Initial program 79.4%
Simplified84.7%
Taylor expanded in j around inf 35.6%
if -1.60000000000000004e-231 < (*.f64 b c) < -1.1e-301 or 6.19999999999999946e-101 < (*.f64 b c) < 1.60000000000000001e42Initial program 83.6%
Simplified89.0%
Taylor expanded in a around inf 40.4%
*-commutative40.4%
*-commutative40.4%
associate-*r*40.4%
Simplified40.4%
Final simplification46.1%
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (* t (+ (* x (* y (* 18.0 z))) (* a -4.0)))))
(if (<= (* b c) -6.2e+289)
(* b c)
(if (<= (* b c) -9.5e-6)
t_1
(if (<= (* b c) -5.3e-46)
(* k (* j -27.0))
(if (<= (* b c) 3.6e+125) t_1 (* b c)))))))assert(y < z);
assert(j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = t * ((x * (y * (18.0 * z))) + (a * -4.0));
double tmp;
if ((b * c) <= -6.2e+289) {
tmp = b * c;
} else if ((b * c) <= -9.5e-6) {
tmp = t_1;
} else if ((b * c) <= -5.3e-46) {
tmp = k * (j * -27.0);
} else if ((b * c) <= 3.6e+125) {
tmp = t_1;
} else {
tmp = b * c;
}
return tmp;
}
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
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), intent (in) :: j
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: tmp
t_1 = t * ((x * (y * (18.0d0 * z))) + (a * (-4.0d0)))
if ((b * c) <= (-6.2d+289)) then
tmp = b * c
else if ((b * c) <= (-9.5d-6)) then
tmp = t_1
else if ((b * c) <= (-5.3d-46)) then
tmp = k * (j * (-27.0d0))
else if ((b * c) <= 3.6d+125) then
tmp = t_1
else
tmp = b * c
end if
code = tmp
end function
assert y < z;
assert j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = t * ((x * (y * (18.0 * z))) + (a * -4.0));
double tmp;
if ((b * c) <= -6.2e+289) {
tmp = b * c;
} else if ((b * c) <= -9.5e-6) {
tmp = t_1;
} else if ((b * c) <= -5.3e-46) {
tmp = k * (j * -27.0);
} else if ((b * c) <= 3.6e+125) {
tmp = t_1;
} else {
tmp = b * c;
}
return tmp;
}
[y, z] = sort([y, z]) [j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): t_1 = t * ((x * (y * (18.0 * z))) + (a * -4.0)) tmp = 0 if (b * c) <= -6.2e+289: tmp = b * c elif (b * c) <= -9.5e-6: tmp = t_1 elif (b * c) <= -5.3e-46: tmp = k * (j * -27.0) elif (b * c) <= 3.6e+125: tmp = t_1 else: tmp = b * c return tmp
y, z = sort([y, z]) j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(t * Float64(Float64(x * Float64(y * Float64(18.0 * z))) + Float64(a * -4.0))) tmp = 0.0 if (Float64(b * c) <= -6.2e+289) tmp = Float64(b * c); elseif (Float64(b * c) <= -9.5e-6) tmp = t_1; elseif (Float64(b * c) <= -5.3e-46) tmp = Float64(k * Float64(j * -27.0)); elseif (Float64(b * c) <= 3.6e+125) tmp = t_1; else tmp = Float64(b * c); end return tmp end
y, z = num2cell(sort([y, z])){:}
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
t_1 = t * ((x * (y * (18.0 * z))) + (a * -4.0));
tmp = 0.0;
if ((b * c) <= -6.2e+289)
tmp = b * c;
elseif ((b * c) <= -9.5e-6)
tmp = t_1;
elseif ((b * c) <= -5.3e-46)
tmp = k * (j * -27.0);
elseif ((b * c) <= 3.6e+125)
tmp = t_1;
else
tmp = b * c;
end
tmp_2 = tmp;
end
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(t * N[(N[(x * N[(y * N[(18.0 * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(a * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(b * c), $MachinePrecision], -6.2e+289], N[(b * c), $MachinePrecision], If[LessEqual[N[(b * c), $MachinePrecision], -9.5e-6], t$95$1, If[LessEqual[N[(b * c), $MachinePrecision], -5.3e-46], N[(k * N[(j * -27.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(b * c), $MachinePrecision], 3.6e+125], t$95$1, N[(b * c), $MachinePrecision]]]]]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
t_1 := t \cdot \left(x \cdot \left(y \cdot \left(18 \cdot z\right)\right) + a \cdot -4\right)\\
\mathbf{if}\;b \cdot c \leq -6.2 \cdot 10^{+289}:\\
\;\;\;\;b \cdot c\\
\mathbf{elif}\;b \cdot c \leq -9.5 \cdot 10^{-6}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;b \cdot c \leq -5.3 \cdot 10^{-46}:\\
\;\;\;\;k \cdot \left(j \cdot -27\right)\\
\mathbf{elif}\;b \cdot c \leq 3.6 \cdot 10^{+125}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;b \cdot c\\
\end{array}
\end{array}
if (*.f64 b c) < -6.2000000000000002e289 or 3.6000000000000003e125 < (*.f64 b c) Initial program 82.6%
Simplified81.0%
Taylor expanded in b around inf 76.1%
if -6.2000000000000002e289 < (*.f64 b c) < -9.5000000000000005e-6 or -5.30000000000000018e-46 < (*.f64 b c) < 3.6000000000000003e125Initial program 79.8%
Simplified86.4%
Taylor expanded in t around inf 55.3%
cancel-sign-sub-inv55.3%
*-commutative55.3%
associate-*r*53.1%
associate-*r*53.1%
associate-*l*55.3%
metadata-eval55.3%
Applied egg-rr55.3%
if -9.5000000000000005e-6 < (*.f64 b c) < -5.30000000000000018e-46Initial program 67.4%
Simplified59.1%
Taylor expanded in j around inf 67.0%
associate-*r*67.0%
Simplified67.0%
Final simplification61.0%
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (* 4.0 (* x i)))
(t_2 (- (- (* b c) t_1) (* (* j 27.0) k)))
(t_3 (+ (* b c) (* t (- (* 18.0 (* x (* y z))) (* a 4.0))))))
(if (<= t -2.7e+87)
t_3
(if (<= t -2.55e-14)
t_2
(if (<= t -1.65e-51)
t_3
(if (<= t -2e-78)
(- (+ (* b c) (* (* t a) -4.0)) t_1)
(if (<= t 1.05e-9) t_2 t_3)))))))assert(y < z);
assert(j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = 4.0 * (x * i);
double t_2 = ((b * c) - t_1) - ((j * 27.0) * k);
double t_3 = (b * c) + (t * ((18.0 * (x * (y * z))) - (a * 4.0)));
double tmp;
if (t <= -2.7e+87) {
tmp = t_3;
} else if (t <= -2.55e-14) {
tmp = t_2;
} else if (t <= -1.65e-51) {
tmp = t_3;
} else if (t <= -2e-78) {
tmp = ((b * c) + ((t * a) * -4.0)) - t_1;
} else if (t <= 1.05e-9) {
tmp = t_2;
} else {
tmp = t_3;
}
return tmp;
}
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
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), intent (in) :: j
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_1 = 4.0d0 * (x * i)
t_2 = ((b * c) - t_1) - ((j * 27.0d0) * k)
t_3 = (b * c) + (t * ((18.0d0 * (x * (y * z))) - (a * 4.0d0)))
if (t <= (-2.7d+87)) then
tmp = t_3
else if (t <= (-2.55d-14)) then
tmp = t_2
else if (t <= (-1.65d-51)) then
tmp = t_3
else if (t <= (-2d-78)) then
tmp = ((b * c) + ((t * a) * (-4.0d0))) - t_1
else if (t <= 1.05d-9) then
tmp = t_2
else
tmp = t_3
end if
code = tmp
end function
assert y < z;
assert j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = 4.0 * (x * i);
double t_2 = ((b * c) - t_1) - ((j * 27.0) * k);
double t_3 = (b * c) + (t * ((18.0 * (x * (y * z))) - (a * 4.0)));
double tmp;
if (t <= -2.7e+87) {
tmp = t_3;
} else if (t <= -2.55e-14) {
tmp = t_2;
} else if (t <= -1.65e-51) {
tmp = t_3;
} else if (t <= -2e-78) {
tmp = ((b * c) + ((t * a) * -4.0)) - t_1;
} else if (t <= 1.05e-9) {
tmp = t_2;
} else {
tmp = t_3;
}
return tmp;
}
[y, z] = sort([y, z]) [j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): t_1 = 4.0 * (x * i) t_2 = ((b * c) - t_1) - ((j * 27.0) * k) t_3 = (b * c) + (t * ((18.0 * (x * (y * z))) - (a * 4.0))) tmp = 0 if t <= -2.7e+87: tmp = t_3 elif t <= -2.55e-14: tmp = t_2 elif t <= -1.65e-51: tmp = t_3 elif t <= -2e-78: tmp = ((b * c) + ((t * a) * -4.0)) - t_1 elif t <= 1.05e-9: tmp = t_2 else: tmp = t_3 return tmp
y, z = sort([y, z]) j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(4.0 * Float64(x * i)) t_2 = Float64(Float64(Float64(b * c) - t_1) - Float64(Float64(j * 27.0) * k)) t_3 = Float64(Float64(b * c) + Float64(t * Float64(Float64(18.0 * Float64(x * Float64(y * z))) - Float64(a * 4.0)))) tmp = 0.0 if (t <= -2.7e+87) tmp = t_3; elseif (t <= -2.55e-14) tmp = t_2; elseif (t <= -1.65e-51) tmp = t_3; elseif (t <= -2e-78) tmp = Float64(Float64(Float64(b * c) + Float64(Float64(t * a) * -4.0)) - t_1); elseif (t <= 1.05e-9) tmp = t_2; else tmp = t_3; end return tmp end
y, z = num2cell(sort([y, z])){:}
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
t_1 = 4.0 * (x * i);
t_2 = ((b * c) - t_1) - ((j * 27.0) * k);
t_3 = (b * c) + (t * ((18.0 * (x * (y * z))) - (a * 4.0)));
tmp = 0.0;
if (t <= -2.7e+87)
tmp = t_3;
elseif (t <= -2.55e-14)
tmp = t_2;
elseif (t <= -1.65e-51)
tmp = t_3;
elseif (t <= -2e-78)
tmp = ((b * c) + ((t * a) * -4.0)) - t_1;
elseif (t <= 1.05e-9)
tmp = t_2;
else
tmp = t_3;
end
tmp_2 = tmp;
end
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(4.0 * N[(x * i), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(b * c), $MachinePrecision] - t$95$1), $MachinePrecision] - N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(b * c), $MachinePrecision] + N[(t * N[(N[(18.0 * N[(x * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(a * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -2.7e+87], t$95$3, If[LessEqual[t, -2.55e-14], t$95$2, If[LessEqual[t, -1.65e-51], t$95$3, If[LessEqual[t, -2e-78], N[(N[(N[(b * c), $MachinePrecision] + N[(N[(t * a), $MachinePrecision] * -4.0), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], If[LessEqual[t, 1.05e-9], t$95$2, t$95$3]]]]]]]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
t_1 := 4 \cdot \left(x \cdot i\right)\\
t_2 := \left(b \cdot c - t_1\right) - \left(j \cdot 27\right) \cdot k\\
t_3 := b \cdot c + t \cdot \left(18 \cdot \left(x \cdot \left(y \cdot z\right)\right) - a \cdot 4\right)\\
\mathbf{if}\;t \leq -2.7 \cdot 10^{+87}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;t \leq -2.55 \cdot 10^{-14}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t \leq -1.65 \cdot 10^{-51}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;t \leq -2 \cdot 10^{-78}:\\
\;\;\;\;\left(b \cdot c + \left(t \cdot a\right) \cdot -4\right) - t_1\\
\mathbf{elif}\;t \leq 1.05 \cdot 10^{-9}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;t_3\\
\end{array}
\end{array}
if t < -2.70000000000000007e87 or -2.5499999999999999e-14 < t < -1.64999999999999986e-51 or 1.0500000000000001e-9 < t Initial program 77.6%
Simplified84.0%
Taylor expanded in x around inf 84.1%
associate-*r*84.1%
*-commutative84.1%
Simplified84.1%
Taylor expanded in i around 0 85.2%
if -2.70000000000000007e87 < t < -2.5499999999999999e-14 or -2e-78 < t < 1.0500000000000001e-9Initial program 82.3%
Taylor expanded in t around 0 80.0%
if -1.64999999999999986e-51 < t < -2e-78Initial program 78.3%
Simplified88.9%
Taylor expanded in x around inf 92.0%
associate-*r*92.0%
*-commutative92.0%
Simplified92.0%
Taylor expanded in y around 0 92.0%
Final simplification82.9%
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (+ (* b c) (* t (* (* x 18.0) (* y z))))))
(if (<= (* b c) -9.2e+14)
t_1
(if (<= (* b c) -5.5e-46)
(* k (* j -27.0))
(if (<= (* b c) 1.32e+73)
(* t (+ (* x (* y (* 18.0 z))) (* a -4.0)))
t_1)))))assert(y < z);
assert(j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = (b * c) + (t * ((x * 18.0) * (y * z)));
double tmp;
if ((b * c) <= -9.2e+14) {
tmp = t_1;
} else if ((b * c) <= -5.5e-46) {
tmp = k * (j * -27.0);
} else if ((b * c) <= 1.32e+73) {
tmp = t * ((x * (y * (18.0 * z))) + (a * -4.0));
} else {
tmp = t_1;
}
return tmp;
}
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
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), intent (in) :: j
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: tmp
t_1 = (b * c) + (t * ((x * 18.0d0) * (y * z)))
if ((b * c) <= (-9.2d+14)) then
tmp = t_1
else if ((b * c) <= (-5.5d-46)) then
tmp = k * (j * (-27.0d0))
else if ((b * c) <= 1.32d+73) then
tmp = t * ((x * (y * (18.0d0 * z))) + (a * (-4.0d0)))
else
tmp = t_1
end if
code = tmp
end function
assert y < z;
assert j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = (b * c) + (t * ((x * 18.0) * (y * z)));
double tmp;
if ((b * c) <= -9.2e+14) {
tmp = t_1;
} else if ((b * c) <= -5.5e-46) {
tmp = k * (j * -27.0);
} else if ((b * c) <= 1.32e+73) {
tmp = t * ((x * (y * (18.0 * z))) + (a * -4.0));
} else {
tmp = t_1;
}
return tmp;
}
[y, z] = sort([y, z]) [j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): t_1 = (b * c) + (t * ((x * 18.0) * (y * z))) tmp = 0 if (b * c) <= -9.2e+14: tmp = t_1 elif (b * c) <= -5.5e-46: tmp = k * (j * -27.0) elif (b * c) <= 1.32e+73: tmp = t * ((x * (y * (18.0 * z))) + (a * -4.0)) else: tmp = t_1 return tmp
y, z = sort([y, z]) j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(Float64(b * c) + Float64(t * Float64(Float64(x * 18.0) * Float64(y * z)))) tmp = 0.0 if (Float64(b * c) <= -9.2e+14) tmp = t_1; elseif (Float64(b * c) <= -5.5e-46) tmp = Float64(k * Float64(j * -27.0)); elseif (Float64(b * c) <= 1.32e+73) tmp = Float64(t * Float64(Float64(x * Float64(y * Float64(18.0 * z))) + Float64(a * -4.0))); else tmp = t_1; end return tmp end
y, z = num2cell(sort([y, z])){:}
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
t_1 = (b * c) + (t * ((x * 18.0) * (y * z)));
tmp = 0.0;
if ((b * c) <= -9.2e+14)
tmp = t_1;
elseif ((b * c) <= -5.5e-46)
tmp = k * (j * -27.0);
elseif ((b * c) <= 1.32e+73)
tmp = t * ((x * (y * (18.0 * z))) + (a * -4.0));
else
tmp = t_1;
end
tmp_2 = tmp;
end
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(N[(b * c), $MachinePrecision] + N[(t * N[(N[(x * 18.0), $MachinePrecision] * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(b * c), $MachinePrecision], -9.2e+14], t$95$1, If[LessEqual[N[(b * c), $MachinePrecision], -5.5e-46], N[(k * N[(j * -27.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(b * c), $MachinePrecision], 1.32e+73], N[(t * N[(N[(x * N[(y * N[(18.0 * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(a * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
t_1 := b \cdot c + t \cdot \left(\left(x \cdot 18\right) \cdot \left(y \cdot z\right)\right)\\
\mathbf{if}\;b \cdot c \leq -9.2 \cdot 10^{+14}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;b \cdot c \leq -5.5 \cdot 10^{-46}:\\
\;\;\;\;k \cdot \left(j \cdot -27\right)\\
\mathbf{elif}\;b \cdot c \leq 1.32 \cdot 10^{+73}:\\
\;\;\;\;t \cdot \left(x \cdot \left(y \cdot \left(18 \cdot z\right)\right) + a \cdot -4\right)\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if (*.f64 b c) < -9.2e14 or 1.32e73 < (*.f64 b c) Initial program 77.1%
Simplified80.7%
Taylor expanded in x around inf 75.1%
associate-*r*75.1%
*-commutative75.1%
Simplified75.1%
Taylor expanded in i around 0 72.6%
Taylor expanded in x around inf 69.9%
associate-*r*69.9%
*-commutative69.9%
Simplified69.9%
if -9.2e14 < (*.f64 b c) < -5.49999999999999983e-46Initial program 73.9%
Simplified67.3%
Taylor expanded in j around inf 60.4%
associate-*r*60.4%
Simplified60.4%
if -5.49999999999999983e-46 < (*.f64 b c) < 1.32e73Initial program 82.8%
Simplified88.2%
Taylor expanded in t around inf 58.4%
cancel-sign-sub-inv58.4%
*-commutative58.4%
associate-*r*56.8%
associate-*r*56.8%
associate-*l*58.4%
metadata-eval58.4%
Applied egg-rr58.4%
Final simplification63.4%
NOTE: y and z should be sorted in increasing order before calling this function. NOTE: j and k should be sorted in increasing order before calling this function. (FPCore (x y z t a b c i j k) :precision binary64 (if (or (<= t -1.55e+136) (not (<= t 1.35e-9))) (+ (* b c) (* t (- (* 18.0 (* x (* y z))) (* a 4.0)))) (- (- (* b c) (* 4.0 (+ (* t a) (* x i)))) (* (* j 27.0) k))))
assert(y < z);
assert(j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double tmp;
if ((t <= -1.55e+136) || !(t <= 1.35e-9)) {
tmp = (b * c) + (t * ((18.0 * (x * (y * z))) - (a * 4.0)));
} else {
tmp = ((b * c) - (4.0 * ((t * a) + (x * i)))) - ((j * 27.0) * k);
}
return tmp;
}
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
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), intent (in) :: j
real(8), intent (in) :: k
real(8) :: tmp
if ((t <= (-1.55d+136)) .or. (.not. (t <= 1.35d-9))) then
tmp = (b * c) + (t * ((18.0d0 * (x * (y * z))) - (a * 4.0d0)))
else
tmp = ((b * c) - (4.0d0 * ((t * a) + (x * i)))) - ((j * 27.0d0) * k)
end if
code = tmp
end function
assert y < z;
assert j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double tmp;
if ((t <= -1.55e+136) || !(t <= 1.35e-9)) {
tmp = (b * c) + (t * ((18.0 * (x * (y * z))) - (a * 4.0)));
} else {
tmp = ((b * c) - (4.0 * ((t * a) + (x * i)))) - ((j * 27.0) * k);
}
return tmp;
}
[y, z] = sort([y, z]) [j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): tmp = 0 if (t <= -1.55e+136) or not (t <= 1.35e-9): tmp = (b * c) + (t * ((18.0 * (x * (y * z))) - (a * 4.0))) else: tmp = ((b * c) - (4.0 * ((t * a) + (x * i)))) - ((j * 27.0) * k) return tmp
y, z = sort([y, z]) j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) tmp = 0.0 if ((t <= -1.55e+136) || !(t <= 1.35e-9)) tmp = Float64(Float64(b * c) + Float64(t * Float64(Float64(18.0 * Float64(x * Float64(y * z))) - Float64(a * 4.0)))); else tmp = Float64(Float64(Float64(b * c) - Float64(4.0 * Float64(Float64(t * a) + Float64(x * i)))) - Float64(Float64(j * 27.0) * k)); end return tmp end
y, z = num2cell(sort([y, z])){:}
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
tmp = 0.0;
if ((t <= -1.55e+136) || ~((t <= 1.35e-9)))
tmp = (b * c) + (t * ((18.0 * (x * (y * z))) - (a * 4.0)));
else
tmp = ((b * c) - (4.0 * ((t * a) + (x * i)))) - ((j * 27.0) * k);
end
tmp_2 = tmp;
end
NOTE: y and z should be sorted in increasing order before calling this function. NOTE: j and k should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := If[Or[LessEqual[t, -1.55e+136], N[Not[LessEqual[t, 1.35e-9]], $MachinePrecision]], N[(N[(b * c), $MachinePrecision] + N[(t * N[(N[(18.0 * N[(x * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(a * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(b * c), $MachinePrecision] - N[(4.0 * N[(N[(t * a), $MachinePrecision] + N[(x * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.55 \cdot 10^{+136} \lor \neg \left(t \leq 1.35 \cdot 10^{-9}\right):\\
\;\;\;\;b \cdot c + t \cdot \left(18 \cdot \left(x \cdot \left(y \cdot z\right)\right) - a \cdot 4\right)\\
\mathbf{else}:\\
\;\;\;\;\left(b \cdot c - 4 \cdot \left(t \cdot a + x \cdot i\right)\right) - \left(j \cdot 27\right) \cdot k\\
\end{array}
\end{array}
if t < -1.54999999999999992e136 or 1.3500000000000001e-9 < t Initial program 75.8%
Simplified82.4%
Taylor expanded in x around inf 84.3%
associate-*r*84.3%
*-commutative84.3%
Simplified84.3%
Taylor expanded in i around 0 86.3%
if -1.54999999999999992e136 < t < 1.3500000000000001e-9Initial program 82.9%
Taylor expanded in y around 0 81.5%
distribute-lft-out81.5%
*-commutative81.5%
*-commutative81.5%
Simplified81.5%
Final simplification83.5%
NOTE: y and z should be sorted in increasing order before calling this function. NOTE: j and k should be sorted in increasing order before calling this function. (FPCore (x y z t a b c i j k) :precision binary64 (if (or (<= y -1.32e+172) (not (<= y 3.4e-74))) (+ (* b c) (* t (* (* x 18.0) (* y z)))) (- (+ (* b c) (* (* t a) -4.0)) (* 4.0 (* x i)))))
assert(y < z);
assert(j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double tmp;
if ((y <= -1.32e+172) || !(y <= 3.4e-74)) {
tmp = (b * c) + (t * ((x * 18.0) * (y * z)));
} else {
tmp = ((b * c) + ((t * a) * -4.0)) - (4.0 * (x * i));
}
return tmp;
}
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
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), intent (in) :: j
real(8), intent (in) :: k
real(8) :: tmp
if ((y <= (-1.32d+172)) .or. (.not. (y <= 3.4d-74))) then
tmp = (b * c) + (t * ((x * 18.0d0) * (y * z)))
else
tmp = ((b * c) + ((t * a) * (-4.0d0))) - (4.0d0 * (x * i))
end if
code = tmp
end function
assert y < z;
assert j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double tmp;
if ((y <= -1.32e+172) || !(y <= 3.4e-74)) {
tmp = (b * c) + (t * ((x * 18.0) * (y * z)));
} else {
tmp = ((b * c) + ((t * a) * -4.0)) - (4.0 * (x * i));
}
return tmp;
}
[y, z] = sort([y, z]) [j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): tmp = 0 if (y <= -1.32e+172) or not (y <= 3.4e-74): tmp = (b * c) + (t * ((x * 18.0) * (y * z))) else: tmp = ((b * c) + ((t * a) * -4.0)) - (4.0 * (x * i)) return tmp
y, z = sort([y, z]) j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) tmp = 0.0 if ((y <= -1.32e+172) || !(y <= 3.4e-74)) tmp = Float64(Float64(b * c) + Float64(t * Float64(Float64(x * 18.0) * Float64(y * z)))); else tmp = Float64(Float64(Float64(b * c) + Float64(Float64(t * a) * -4.0)) - Float64(4.0 * Float64(x * i))); end return tmp end
y, z = num2cell(sort([y, z])){:}
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
tmp = 0.0;
if ((y <= -1.32e+172) || ~((y <= 3.4e-74)))
tmp = (b * c) + (t * ((x * 18.0) * (y * z)));
else
tmp = ((b * c) + ((t * a) * -4.0)) - (4.0 * (x * i));
end
tmp_2 = tmp;
end
NOTE: y and z should be sorted in increasing order before calling this function. NOTE: j and k should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := If[Or[LessEqual[y, -1.32e+172], N[Not[LessEqual[y, 3.4e-74]], $MachinePrecision]], N[(N[(b * c), $MachinePrecision] + N[(t * N[(N[(x * 18.0), $MachinePrecision] * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(b * c), $MachinePrecision] + N[(N[(t * a), $MachinePrecision] * -4.0), $MachinePrecision]), $MachinePrecision] - N[(4.0 * N[(x * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.32 \cdot 10^{+172} \lor \neg \left(y \leq 3.4 \cdot 10^{-74}\right):\\
\;\;\;\;b \cdot c + t \cdot \left(\left(x \cdot 18\right) \cdot \left(y \cdot z\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(b \cdot c + \left(t \cdot a\right) \cdot -4\right) - 4 \cdot \left(x \cdot i\right)\\
\end{array}
\end{array}
if y < -1.31999999999999996e172 or 3.4000000000000001e-74 < y Initial program 74.4%
Simplified78.6%
Taylor expanded in x around inf 71.3%
associate-*r*71.3%
*-commutative71.3%
Simplified71.3%
Taylor expanded in i around 0 72.3%
Taylor expanded in x around inf 64.8%
associate-*r*64.7%
*-commutative64.7%
Simplified64.7%
if -1.31999999999999996e172 < y < 3.4000000000000001e-74Initial program 84.4%
Simplified88.1%
Taylor expanded in x around inf 69.1%
associate-*r*69.1%
*-commutative69.1%
Simplified69.1%
Taylor expanded in y around 0 60.7%
Final simplification62.5%
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(if (<= t -6.5e+136)
(* t (- (* 18.0 (* x (* y z))) (* a 4.0)))
(if (<= t 2.25e-9)
(- (- (* b c) (* 4.0 (* x i))) (* (* j 27.0) k))
(* t (+ (* x (* y (* 18.0 z))) (* a -4.0))))))assert(y < z);
assert(j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double tmp;
if (t <= -6.5e+136) {
tmp = t * ((18.0 * (x * (y * z))) - (a * 4.0));
} else if (t <= 2.25e-9) {
tmp = ((b * c) - (4.0 * (x * i))) - ((j * 27.0) * k);
} else {
tmp = t * ((x * (y * (18.0 * z))) + (a * -4.0));
}
return tmp;
}
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
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), intent (in) :: j
real(8), intent (in) :: k
real(8) :: tmp
if (t <= (-6.5d+136)) then
tmp = t * ((18.0d0 * (x * (y * z))) - (a * 4.0d0))
else if (t <= 2.25d-9) then
tmp = ((b * c) - (4.0d0 * (x * i))) - ((j * 27.0d0) * k)
else
tmp = t * ((x * (y * (18.0d0 * z))) + (a * (-4.0d0)))
end if
code = tmp
end function
assert y < z;
assert j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double tmp;
if (t <= -6.5e+136) {
tmp = t * ((18.0 * (x * (y * z))) - (a * 4.0));
} else if (t <= 2.25e-9) {
tmp = ((b * c) - (4.0 * (x * i))) - ((j * 27.0) * k);
} else {
tmp = t * ((x * (y * (18.0 * z))) + (a * -4.0));
}
return tmp;
}
[y, z] = sort([y, z]) [j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): tmp = 0 if t <= -6.5e+136: tmp = t * ((18.0 * (x * (y * z))) - (a * 4.0)) elif t <= 2.25e-9: tmp = ((b * c) - (4.0 * (x * i))) - ((j * 27.0) * k) else: tmp = t * ((x * (y * (18.0 * z))) + (a * -4.0)) return tmp
y, z = sort([y, z]) j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) tmp = 0.0 if (t <= -6.5e+136) tmp = Float64(t * Float64(Float64(18.0 * Float64(x * Float64(y * z))) - Float64(a * 4.0))); elseif (t <= 2.25e-9) tmp = Float64(Float64(Float64(b * c) - Float64(4.0 * Float64(x * i))) - Float64(Float64(j * 27.0) * k)); else tmp = Float64(t * Float64(Float64(x * Float64(y * Float64(18.0 * z))) + Float64(a * -4.0))); end return tmp end
y, z = num2cell(sort([y, z])){:}
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
tmp = 0.0;
if (t <= -6.5e+136)
tmp = t * ((18.0 * (x * (y * z))) - (a * 4.0));
elseif (t <= 2.25e-9)
tmp = ((b * c) - (4.0 * (x * i))) - ((j * 27.0) * k);
else
tmp = t * ((x * (y * (18.0 * z))) + (a * -4.0));
end
tmp_2 = tmp;
end
NOTE: y and z should be sorted in increasing order before calling this function. NOTE: j and k should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := If[LessEqual[t, -6.5e+136], N[(t * N[(N[(18.0 * N[(x * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(a * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 2.25e-9], N[(N[(N[(b * c), $MachinePrecision] - N[(4.0 * N[(x * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision], N[(t * N[(N[(x * N[(y * N[(18.0 * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(a * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -6.5 \cdot 10^{+136}:\\
\;\;\;\;t \cdot \left(18 \cdot \left(x \cdot \left(y \cdot z\right)\right) - a \cdot 4\right)\\
\mathbf{elif}\;t \leq 2.25 \cdot 10^{-9}:\\
\;\;\;\;\left(b \cdot c - 4 \cdot \left(x \cdot i\right)\right) - \left(j \cdot 27\right) \cdot k\\
\mathbf{else}:\\
\;\;\;\;t \cdot \left(x \cdot \left(y \cdot \left(18 \cdot z\right)\right) + a \cdot -4\right)\\
\end{array}
\end{array}
if t < -6.4999999999999998e136Initial program 75.9%
Simplified85.3%
Taylor expanded in t around inf 83.2%
if -6.4999999999999998e136 < t < 2.24999999999999988e-9Initial program 82.9%
Taylor expanded in t around 0 76.3%
if 2.24999999999999988e-9 < t Initial program 75.7%
Simplified80.6%
Taylor expanded in t around inf 65.8%
cancel-sign-sub-inv65.8%
*-commutative65.8%
associate-*r*66.9%
associate-*r*66.9%
associate-*l*65.8%
metadata-eval65.8%
Applied egg-rr65.8%
Final simplification74.7%
NOTE: y and z should be sorted in increasing order before calling this function. NOTE: j and k should be sorted in increasing order before calling this function. (FPCore (x y z t a b c i j k) :precision binary64 (if (<= (* b c) -1.4e+200) (* b c) (if (<= (* b c) 9.5e+88) (* -27.0 (* j k)) (* b c))))
assert(y < z);
assert(j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double tmp;
if ((b * c) <= -1.4e+200) {
tmp = b * c;
} else if ((b * c) <= 9.5e+88) {
tmp = -27.0 * (j * k);
} else {
tmp = b * c;
}
return tmp;
}
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
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), intent (in) :: j
real(8), intent (in) :: k
real(8) :: tmp
if ((b * c) <= (-1.4d+200)) then
tmp = b * c
else if ((b * c) <= 9.5d+88) then
tmp = (-27.0d0) * (j * k)
else
tmp = b * c
end if
code = tmp
end function
assert y < z;
assert j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double tmp;
if ((b * c) <= -1.4e+200) {
tmp = b * c;
} else if ((b * c) <= 9.5e+88) {
tmp = -27.0 * (j * k);
} else {
tmp = b * c;
}
return tmp;
}
[y, z] = sort([y, z]) [j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): tmp = 0 if (b * c) <= -1.4e+200: tmp = b * c elif (b * c) <= 9.5e+88: tmp = -27.0 * (j * k) else: tmp = b * c return tmp
y, z = sort([y, z]) j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) tmp = 0.0 if (Float64(b * c) <= -1.4e+200) tmp = Float64(b * c); elseif (Float64(b * c) <= 9.5e+88) tmp = Float64(-27.0 * Float64(j * k)); else tmp = Float64(b * c); end return tmp end
y, z = num2cell(sort([y, z])){:}
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
tmp = 0.0;
if ((b * c) <= -1.4e+200)
tmp = b * c;
elseif ((b * c) <= 9.5e+88)
tmp = -27.0 * (j * k);
else
tmp = b * c;
end
tmp_2 = tmp;
end
NOTE: y and z should be sorted in increasing order before calling this function. NOTE: j and k should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := If[LessEqual[N[(b * c), $MachinePrecision], -1.4e+200], N[(b * c), $MachinePrecision], If[LessEqual[N[(b * c), $MachinePrecision], 9.5e+88], N[(-27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision], N[(b * c), $MachinePrecision]]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
\mathbf{if}\;b \cdot c \leq -1.4 \cdot 10^{+200}:\\
\;\;\;\;b \cdot c\\
\mathbf{elif}\;b \cdot c \leq 9.5 \cdot 10^{+88}:\\
\;\;\;\;-27 \cdot \left(j \cdot k\right)\\
\mathbf{else}:\\
\;\;\;\;b \cdot c\\
\end{array}
\end{array}
if (*.f64 b c) < -1.39999999999999992e200 or 9.50000000000000059e88 < (*.f64 b c) Initial program 79.1%
Simplified80.2%
Taylor expanded in b around inf 65.1%
if -1.39999999999999992e200 < (*.f64 b c) < 9.50000000000000059e88Initial program 80.3%
Simplified85.6%
Taylor expanded in j around inf 31.0%
Final simplification42.3%
NOTE: y and z should be sorted in increasing order before calling this function. NOTE: j and k should be sorted in increasing order before calling this function. (FPCore (x y z t a b c i j k) :precision binary64 (* b c))
assert(y < z);
assert(j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
return b * c;
}
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
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), intent (in) :: j
real(8), intent (in) :: k
code = b * c
end function
assert y < z;
assert j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
return b * c;
}
[y, z] = sort([y, z]) [j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): return b * c
y, z = sort([y, z]) j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) return Float64(b * c) end
y, z = num2cell(sort([y, z])){:}
j, k = num2cell(sort([j, k])){:}
function tmp = code(x, y, z, t, a, b, c, i, j, k)
tmp = b * c;
end
NOTE: y and z should be sorted in increasing order before calling this function. NOTE: j and k should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := N[(b * c), $MachinePrecision]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
[j, k] = \mathsf{sort}([j, k])\\
\\
b \cdot c
\end{array}
Initial program 79.9%
Simplified83.8%
Taylor expanded in b around inf 25.8%
Final simplification25.8%
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (* (+ (* a t) (* i x)) 4.0))
(t_2
(-
(- (* (* 18.0 t) (* (* x y) z)) t_1)
(- (* (* k j) 27.0) (* c b)))))
(if (< t -1.6210815397541398e-69)
t_2
(if (< t 165.68027943805222)
(+ (- (* (* 18.0 y) (* x (* z t))) t_1) (- (* c b) (* 27.0 (* k j))))
t_2))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = ((a * t) + (i * x)) * 4.0;
double t_2 = (((18.0 * t) * ((x * y) * z)) - t_1) - (((k * j) * 27.0) - (c * b));
double tmp;
if (t < -1.6210815397541398e-69) {
tmp = t_2;
} else if (t < 165.68027943805222) {
tmp = (((18.0 * y) * (x * (z * t))) - t_1) + ((c * b) - (27.0 * (k * j)));
} else {
tmp = t_2;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i, j, k)
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), intent (in) :: j
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = ((a * t) + (i * x)) * 4.0d0
t_2 = (((18.0d0 * t) * ((x * y) * z)) - t_1) - (((k * j) * 27.0d0) - (c * b))
if (t < (-1.6210815397541398d-69)) then
tmp = t_2
else if (t < 165.68027943805222d0) then
tmp = (((18.0d0 * y) * (x * (z * t))) - t_1) + ((c * b) - (27.0d0 * (k * j)))
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 j, double k) {
double t_1 = ((a * t) + (i * x)) * 4.0;
double t_2 = (((18.0 * t) * ((x * y) * z)) - t_1) - (((k * j) * 27.0) - (c * b));
double tmp;
if (t < -1.6210815397541398e-69) {
tmp = t_2;
} else if (t < 165.68027943805222) {
tmp = (((18.0 * y) * (x * (z * t))) - t_1) + ((c * b) - (27.0 * (k * j)));
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j, k): t_1 = ((a * t) + (i * x)) * 4.0 t_2 = (((18.0 * t) * ((x * y) * z)) - t_1) - (((k * j) * 27.0) - (c * b)) tmp = 0 if t < -1.6210815397541398e-69: tmp = t_2 elif t < 165.68027943805222: tmp = (((18.0 * y) * (x * (z * t))) - t_1) + ((c * b) - (27.0 * (k * j))) else: tmp = t_2 return tmp
function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(Float64(Float64(a * t) + Float64(i * x)) * 4.0) t_2 = Float64(Float64(Float64(Float64(18.0 * t) * Float64(Float64(x * y) * z)) - t_1) - Float64(Float64(Float64(k * j) * 27.0) - Float64(c * b))) tmp = 0.0 if (t < -1.6210815397541398e-69) tmp = t_2; elseif (t < 165.68027943805222) tmp = Float64(Float64(Float64(Float64(18.0 * y) * Float64(x * Float64(z * t))) - t_1) + Float64(Float64(c * b) - Float64(27.0 * Float64(k * j)))); else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k) t_1 = ((a * t) + (i * x)) * 4.0; t_2 = (((18.0 * t) * ((x * y) * z)) - t_1) - (((k * j) * 27.0) - (c * b)); tmp = 0.0; if (t < -1.6210815397541398e-69) tmp = t_2; elseif (t < 165.68027943805222) tmp = (((18.0 * y) * (x * (z * t))) - t_1) + ((c * b) - (27.0 * (k * j))); else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(N[(N[(a * t), $MachinePrecision] + N[(i * x), $MachinePrecision]), $MachinePrecision] * 4.0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(N[(18.0 * t), $MachinePrecision] * N[(N[(x * y), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision] - N[(N[(N[(k * j), $MachinePrecision] * 27.0), $MachinePrecision] - N[(c * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Less[t, -1.6210815397541398e-69], t$95$2, If[Less[t, 165.68027943805222], N[(N[(N[(N[(18.0 * y), $MachinePrecision] * N[(x * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision] + N[(N[(c * b), $MachinePrecision] - N[(27.0 * N[(k * j), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$2]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(a \cdot t + i \cdot x\right) \cdot 4\\
t_2 := \left(\left(18 \cdot t\right) \cdot \left(\left(x \cdot y\right) \cdot z\right) - t_1\right) - \left(\left(k \cdot j\right) \cdot 27 - c \cdot b\right)\\
\mathbf{if}\;t < -1.6210815397541398 \cdot 10^{-69}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t < 165.68027943805222:\\
\;\;\;\;\left(\left(18 \cdot y\right) \cdot \left(x \cdot \left(z \cdot t\right)\right) - t_1\right) + \left(c \cdot b - 27 \cdot \left(k \cdot j\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
herbie shell --seed 2023275
(FPCore (x y z t a b c i j k)
:name "Diagrams.Solve.Polynomial:cubForm from diagrams-solve-0.1, E"
:precision binary64
:herbie-target
(if (< t -1.6210815397541398e-69) (- (- (* (* 18.0 t) (* (* x y) z)) (* (+ (* a t) (* i x)) 4.0)) (- (* (* k j) 27.0) (* c b))) (if (< t 165.68027943805222) (+ (- (* (* 18.0 y) (* x (* z t))) (* (+ (* a t) (* i x)) 4.0)) (- (* c b) (* 27.0 (* k j)))) (- (- (* (* 18.0 t) (* (* x y) z)) (* (+ (* a t) (* i x)) 4.0)) (- (* (* k j) 27.0) (* c b)))))
(- (- (+ (- (* (* (* (* x 18.0) y) z) t) (* (* a 4.0) t)) (* b c)) (* (* x 4.0) i)) (* (* j 27.0) k)))