
(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 27 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
(fma j (* k -27.0) (* x (- (fma i 4.0 (* y (* -18.0 (* z t))))))))))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 = fma(j, (k * -27.0), (x * -fma(i, 4.0, (y * (-18.0 * (z * t))))));
}
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 = fma(j, Float64(k * -27.0), Float64(x * Float64(-fma(i, 4.0, Float64(y * Float64(-18.0 * Float64(z * t))))))); end return 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[(j * N[(k * -27.0), $MachinePrecision] + N[(x * (-N[(i * 4.0 + N[(y * N[(-18.0 * N[(z * t), $MachinePrecision]), $MachinePrecision]), $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}:\\
\;\;\;\;\mathsf{fma}\left(j, k \cdot -27, x \cdot \left(-\mathsf{fma}\left(i, 4, y \cdot \left(-18 \cdot \left(z \cdot t\right)\right)\right)\right)\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 96.2%
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%
sub-neg0.0%
+-commutative0.0%
associate-*l*0.0%
distribute-rgt-neg-in0.0%
fma-def6.7%
*-commutative6.7%
distribute-rgt-neg-in6.7%
metadata-eval6.7%
sub-neg6.7%
+-commutative6.7%
associate-*l*6.7%
distribute-rgt-neg-in6.7%
Simplified50.0%
Taylor expanded in x around -inf 76.7%
+-commutative76.7%
metadata-eval76.7%
cancel-sign-sub-inv76.7%
mul-1-neg76.7%
cancel-sign-sub-inv76.7%
metadata-eval76.7%
+-commutative76.7%
distribute-rgt-neg-in76.7%
*-commutative76.7%
fma-def76.7%
*-commutative76.7%
associate-*l*76.7%
*-commutative76.7%
Simplified76.7%
Final simplification93.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
(-
(-
(+ (- (* (* (* (* 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 (* x (- (* 18.0 (* y (* z t))) (* 4.0 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 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 = x * ((18.0 * (y * (z * t))) - (4.0 * i));
}
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 = x * ((18.0 * (y * (z * t))) - (4.0 * 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): 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 = x * ((18.0 * (y * (z * t))) - (4.0 * 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) 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(x * Float64(Float64(18.0 * Float64(y * Float64(z * t))) - Float64(4.0 * 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)
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 = x * ((18.0 * (y * (z * t))) - (4.0 * 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_] := 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[(x * N[(N[(18.0 * N[(y * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(4.0 * i), $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}:\\
\;\;\;\;x \cdot \left(18 \cdot \left(y \cdot \left(z \cdot t\right)\right) - 4 \cdot i\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 96.2%
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%
sub-neg0.0%
associate-+l-0.0%
sub-neg0.0%
sub-neg0.0%
distribute-rgt-out--16.7%
associate-*l*13.3%
distribute-lft-neg-in13.3%
cancel-sign-sub13.3%
associate-*l*13.3%
associate-*l*13.3%
Simplified13.3%
Taylor expanded in x around inf 66.8%
Final simplification92.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
(let* ((t_1 (* 27.0 (* j k))) (t_2 (- (* b c) t_1)) (t_3 (* (* j 27.0) k)))
(if (<= t_3 -5e+273)
t_2
(if (<= t_3 -2e+146)
(- (* k (* j -27.0)) (* y (* -18.0 (* x (* z t)))))
(if (<= t_3 -1e+77)
t_2
(if (<= t_3 5e+29)
(- (* b c) (+ (* 4.0 (* t a)) (* 4.0 (* x i))))
(- (* 18.0 (* y (* t (* x z)))) 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 = 27.0 * (j * k);
double t_2 = (b * c) - t_1;
double t_3 = (j * 27.0) * k;
double tmp;
if (t_3 <= -5e+273) {
tmp = t_2;
} else if (t_3 <= -2e+146) {
tmp = (k * (j * -27.0)) - (y * (-18.0 * (x * (z * t))));
} else if (t_3 <= -1e+77) {
tmp = t_2;
} else if (t_3 <= 5e+29) {
tmp = (b * c) - ((4.0 * (t * a)) + (4.0 * (x * i)));
} else {
tmp = (18.0 * (y * (t * (x * z)))) - 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) :: t_2
real(8) :: t_3
real(8) :: tmp
t_1 = 27.0d0 * (j * k)
t_2 = (b * c) - t_1
t_3 = (j * 27.0d0) * k
if (t_3 <= (-5d+273)) then
tmp = t_2
else if (t_3 <= (-2d+146)) then
tmp = (k * (j * (-27.0d0))) - (y * ((-18.0d0) * (x * (z * t))))
else if (t_3 <= (-1d+77)) then
tmp = t_2
else if (t_3 <= 5d+29) then
tmp = (b * c) - ((4.0d0 * (t * a)) + (4.0d0 * (x * i)))
else
tmp = (18.0d0 * (y * (t * (x * z)))) - 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 = 27.0 * (j * k);
double t_2 = (b * c) - t_1;
double t_3 = (j * 27.0) * k;
double tmp;
if (t_3 <= -5e+273) {
tmp = t_2;
} else if (t_3 <= -2e+146) {
tmp = (k * (j * -27.0)) - (y * (-18.0 * (x * (z * t))));
} else if (t_3 <= -1e+77) {
tmp = t_2;
} else if (t_3 <= 5e+29) {
tmp = (b * c) - ((4.0 * (t * a)) + (4.0 * (x * i)));
} else {
tmp = (18.0 * (y * (t * (x * z)))) - 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 = 27.0 * (j * k) t_2 = (b * c) - t_1 t_3 = (j * 27.0) * k tmp = 0 if t_3 <= -5e+273: tmp = t_2 elif t_3 <= -2e+146: tmp = (k * (j * -27.0)) - (y * (-18.0 * (x * (z * t)))) elif t_3 <= -1e+77: tmp = t_2 elif t_3 <= 5e+29: tmp = (b * c) - ((4.0 * (t * a)) + (4.0 * (x * i))) else: tmp = (18.0 * (y * (t * (x * z)))) - 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(27.0 * Float64(j * k)) t_2 = Float64(Float64(b * c) - t_1) t_3 = Float64(Float64(j * 27.0) * k) tmp = 0.0 if (t_3 <= -5e+273) tmp = t_2; elseif (t_3 <= -2e+146) tmp = Float64(Float64(k * Float64(j * -27.0)) - Float64(y * Float64(-18.0 * Float64(x * Float64(z * t))))); elseif (t_3 <= -1e+77) tmp = t_2; elseif (t_3 <= 5e+29) tmp = Float64(Float64(b * c) - Float64(Float64(4.0 * Float64(t * a)) + Float64(4.0 * Float64(x * i)))); else tmp = Float64(Float64(18.0 * Float64(y * Float64(t * Float64(x * z)))) - 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 = 27.0 * (j * k);
t_2 = (b * c) - t_1;
t_3 = (j * 27.0) * k;
tmp = 0.0;
if (t_3 <= -5e+273)
tmp = t_2;
elseif (t_3 <= -2e+146)
tmp = (k * (j * -27.0)) - (y * (-18.0 * (x * (z * t))));
elseif (t_3 <= -1e+77)
tmp = t_2;
elseif (t_3 <= 5e+29)
tmp = (b * c) - ((4.0 * (t * a)) + (4.0 * (x * i)));
else
tmp = (18.0 * (y * (t * (x * z)))) - 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[(27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(b * c), $MachinePrecision] - t$95$1), $MachinePrecision]}, Block[{t$95$3 = N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]}, If[LessEqual[t$95$3, -5e+273], t$95$2, If[LessEqual[t$95$3, -2e+146], N[(N[(k * N[(j * -27.0), $MachinePrecision]), $MachinePrecision] - N[(y * N[(-18.0 * N[(x * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$3, -1e+77], t$95$2, If[LessEqual[t$95$3, 5e+29], N[(N[(b * c), $MachinePrecision] - N[(N[(4.0 * N[(t * a), $MachinePrecision]), $MachinePrecision] + N[(4.0 * N[(x * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(18.0 * N[(y * N[(t * N[(x * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$1), $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 := b \cdot c - t_1\\
t_3 := \left(j \cdot 27\right) \cdot k\\
\mathbf{if}\;t_3 \leq -5 \cdot 10^{+273}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t_3 \leq -2 \cdot 10^{+146}:\\
\;\;\;\;k \cdot \left(j \cdot -27\right) - y \cdot \left(-18 \cdot \left(x \cdot \left(z \cdot t\right)\right)\right)\\
\mathbf{elif}\;t_3 \leq -1 \cdot 10^{+77}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t_3 \leq 5 \cdot 10^{+29}:\\
\;\;\;\;b \cdot c - \left(4 \cdot \left(t \cdot a\right) + 4 \cdot \left(x \cdot i\right)\right)\\
\mathbf{else}:\\
\;\;\;\;18 \cdot \left(y \cdot \left(t \cdot \left(x \cdot z\right)\right)\right) - t_1\\
\end{array}
\end{array}
if (*.f64 (*.f64 j 27) k) < -4.99999999999999961e273 or -1.99999999999999987e146 < (*.f64 (*.f64 j 27) k) < -9.99999999999999983e76Initial program 73.5%
sub-neg73.5%
associate-+l-73.5%
sub-neg73.5%
sub-neg73.5%
distribute-rgt-out--77.9%
associate-*l*75.7%
distribute-lft-neg-in75.7%
cancel-sign-sub75.7%
associate-*l*75.7%
associate-*l*75.8%
Simplified75.8%
Taylor expanded in i around 0 75.7%
Taylor expanded in c around inf 82.8%
if -4.99999999999999961e273 < (*.f64 (*.f64 j 27) k) < -1.99999999999999987e146Initial program 87.3%
Taylor expanded in t around -inf 71.0%
Taylor expanded in y around inf 57.8%
associate-*r*57.8%
*-commutative57.8%
associate-*r*53.8%
*-commutative53.8%
*-commutative53.8%
Simplified53.8%
sub-neg53.8%
mul-1-neg53.8%
*-commutative53.8%
associate-*l*57.9%
associate-*l*53.4%
Applied egg-rr53.4%
+-commutative53.4%
unsub-neg53.4%
associate-*r*57.9%
distribute-lft-neg-out57.9%
*-commutative57.9%
distribute-rgt-neg-in57.9%
metadata-eval57.9%
associate-*r*53.8%
associate-*r*57.8%
associate-*l*57.8%
*-commutative57.8%
associate-*l*57.8%
associate-*r*61.9%
*-commutative61.9%
Simplified61.9%
if -9.99999999999999983e76 < (*.f64 (*.f64 j 27) k) < 5.0000000000000001e29Initial program 88.5%
Taylor expanded in y around 0 72.8%
Taylor expanded in j around 0 68.8%
if 5.0000000000000001e29 < (*.f64 (*.f64 j 27) k) Initial program 84.9%
Taylor expanded in t around -inf 78.6%
Taylor expanded in a around 0 76.6%
Final simplification72.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 (<= y -1.1e+222)
(- (* t (- (* 18.0 (* y (* x z))) (* a 4.0))) (* 27.0 (* j k)))
(if (<= y -9.5e+138)
(+
(* b c)
(+ (* -27.0 (* j k)) (* x (+ (* 18.0 (* y (* z t))) (* i -4.0)))))
(if (<= y 7.6e-8)
(-
(+ (* b c) (* t (- (* (* x 18.0) (* y z)) (* a 4.0))))
(+ (* x (* 4.0 i)) (* j (* 27.0 k))))
(-
(- (+ (* b c) (* 18.0 (* y (* t (* x z))))) (* 4.0 (* t a)))
(* (* 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 (y <= -1.1e+222) {
tmp = (t * ((18.0 * (y * (x * z))) - (a * 4.0))) - (27.0 * (j * k));
} else if (y <= -9.5e+138) {
tmp = (b * c) + ((-27.0 * (j * k)) + (x * ((18.0 * (y * (z * t))) + (i * -4.0))));
} else if (y <= 7.6e-8) {
tmp = ((b * c) + (t * (((x * 18.0) * (y * z)) - (a * 4.0)))) - ((x * (4.0 * i)) + (j * (27.0 * k)));
} else {
tmp = (((b * c) + (18.0 * (y * (t * (x * z))))) - (4.0 * (t * a))) - ((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 (y <= (-1.1d+222)) then
tmp = (t * ((18.0d0 * (y * (x * z))) - (a * 4.0d0))) - (27.0d0 * (j * k))
else if (y <= (-9.5d+138)) then
tmp = (b * c) + (((-27.0d0) * (j * k)) + (x * ((18.0d0 * (y * (z * t))) + (i * (-4.0d0)))))
else if (y <= 7.6d-8) then
tmp = ((b * c) + (t * (((x * 18.0d0) * (y * z)) - (a * 4.0d0)))) - ((x * (4.0d0 * i)) + (j * (27.0d0 * k)))
else
tmp = (((b * c) + (18.0d0 * (y * (t * (x * z))))) - (4.0d0 * (t * a))) - ((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 (y <= -1.1e+222) {
tmp = (t * ((18.0 * (y * (x * z))) - (a * 4.0))) - (27.0 * (j * k));
} else if (y <= -9.5e+138) {
tmp = (b * c) + ((-27.0 * (j * k)) + (x * ((18.0 * (y * (z * t))) + (i * -4.0))));
} else if (y <= 7.6e-8) {
tmp = ((b * c) + (t * (((x * 18.0) * (y * z)) - (a * 4.0)))) - ((x * (4.0 * i)) + (j * (27.0 * k)));
} else {
tmp = (((b * c) + (18.0 * (y * (t * (x * z))))) - (4.0 * (t * a))) - ((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 y <= -1.1e+222: tmp = (t * ((18.0 * (y * (x * z))) - (a * 4.0))) - (27.0 * (j * k)) elif y <= -9.5e+138: tmp = (b * c) + ((-27.0 * (j * k)) + (x * ((18.0 * (y * (z * t))) + (i * -4.0)))) elif y <= 7.6e-8: tmp = ((b * c) + (t * (((x * 18.0) * (y * z)) - (a * 4.0)))) - ((x * (4.0 * i)) + (j * (27.0 * k))) else: tmp = (((b * c) + (18.0 * (y * (t * (x * z))))) - (4.0 * (t * a))) - ((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 (y <= -1.1e+222) tmp = Float64(Float64(t * Float64(Float64(18.0 * Float64(y * Float64(x * z))) - Float64(a * 4.0))) - Float64(27.0 * Float64(j * k))); elseif (y <= -9.5e+138) tmp = Float64(Float64(b * c) + Float64(Float64(-27.0 * Float64(j * k)) + Float64(x * Float64(Float64(18.0 * Float64(y * Float64(z * t))) + Float64(i * -4.0))))); elseif (y <= 7.6e-8) 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)))); else tmp = Float64(Float64(Float64(Float64(b * c) + Float64(18.0 * Float64(y * Float64(t * Float64(x * z))))) - Float64(4.0 * Float64(t * a))) - 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 (y <= -1.1e+222)
tmp = (t * ((18.0 * (y * (x * z))) - (a * 4.0))) - (27.0 * (j * k));
elseif (y <= -9.5e+138)
tmp = (b * c) + ((-27.0 * (j * k)) + (x * ((18.0 * (y * (z * t))) + (i * -4.0))));
elseif (y <= 7.6e-8)
tmp = ((b * c) + (t * (((x * 18.0) * (y * z)) - (a * 4.0)))) - ((x * (4.0 * i)) + (j * (27.0 * k)));
else
tmp = (((b * c) + (18.0 * (y * (t * (x * z))))) - (4.0 * (t * a))) - ((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[y, -1.1e+222], N[(N[(t * N[(N[(18.0 * N[(y * N[(x * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(a * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -9.5e+138], N[(N[(b * c), $MachinePrecision] + N[(N[(-27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision] + N[(x * N[(N[(18.0 * N[(y * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(i * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 7.6e-8], 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], N[(N[(N[(N[(b * c), $MachinePrecision] + N[(18.0 * N[(y * N[(t * N[(x * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(4.0 * N[(t * a), $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}\;y \leq -1.1 \cdot 10^{+222}:\\
\;\;\;\;t \cdot \left(18 \cdot \left(y \cdot \left(x \cdot z\right)\right) - a \cdot 4\right) - 27 \cdot \left(j \cdot k\right)\\
\mathbf{elif}\;y \leq -9.5 \cdot 10^{+138}:\\
\;\;\;\;b \cdot c + \left(-27 \cdot \left(j \cdot k\right) + x \cdot \left(18 \cdot \left(y \cdot \left(z \cdot t\right)\right) + i \cdot -4\right)\right)\\
\mathbf{elif}\;y \leq 7.6 \cdot 10^{-8}:\\
\;\;\;\;\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)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(b \cdot c + 18 \cdot \left(y \cdot \left(t \cdot \left(x \cdot z\right)\right)\right)\right) - 4 \cdot \left(t \cdot a\right)\right) - \left(j \cdot 27\right) \cdot k\\
\end{array}
\end{array}
if y < -1.1000000000000001e222Initial program 50.4%
sub-neg50.4%
associate-+l-50.4%
sub-neg50.4%
sub-neg50.4%
distribute-rgt-out--60.4%
associate-*l*70.0%
distribute-lft-neg-in70.0%
cancel-sign-sub70.0%
associate-*l*70.0%
associate-*l*69.9%
Simplified69.9%
Taylor expanded in i around 0 79.5%
Taylor expanded in c around 0 89.5%
if -1.1000000000000001e222 < y < -9.49999999999999998e138Initial program 75.3%
Simplified80.9%
Taylor expanded in a around 0 95.0%
if -9.49999999999999998e138 < y < 7.60000000000000056e-8Initial program 91.3%
sub-neg91.3%
associate-+l-91.3%
sub-neg91.3%
sub-neg91.3%
distribute-rgt-out--92.6%
associate-*l*93.1%
distribute-lft-neg-in93.1%
cancel-sign-sub93.1%
associate-*l*93.1%
associate-*l*92.4%
Simplified92.4%
if 7.60000000000000056e-8 < y Initial program 79.8%
Taylor expanded in i around 0 84.7%
Final simplification90.2%
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 (* (* j 27.0) k))
(t_2 (* t (- (* 18.0 (* y (* x z))) (* a 4.0)))))
(if (<= t -4.5e+233)
t_2
(if (<= t -5.9e-65)
(- (- (* b c) (* 4.0 (* t a))) t_1)
(if (<= t 3.7e-231)
(- (- (* b c) (* 4.0 (* x i))) t_1)
(if (<= t 3.7e-59)
(+ (* b c) (+ (* -27.0 (* j k)) (* (* x 18.0) (* z (* y t)))))
t_2))))))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 = (j * 27.0) * k;
double t_2 = t * ((18.0 * (y * (x * z))) - (a * 4.0));
double tmp;
if (t <= -4.5e+233) {
tmp = t_2;
} else if (t <= -5.9e-65) {
tmp = ((b * c) - (4.0 * (t * a))) - t_1;
} else if (t <= 3.7e-231) {
tmp = ((b * c) - (4.0 * (x * i))) - t_1;
} else if (t <= 3.7e-59) {
tmp = (b * c) + ((-27.0 * (j * k)) + ((x * 18.0) * (z * (y * t))));
} else {
tmp = t_2;
}
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 = (j * 27.0d0) * k
t_2 = t * ((18.0d0 * (y * (x * z))) - (a * 4.0d0))
if (t <= (-4.5d+233)) then
tmp = t_2
else if (t <= (-5.9d-65)) then
tmp = ((b * c) - (4.0d0 * (t * a))) - t_1
else if (t <= 3.7d-231) then
tmp = ((b * c) - (4.0d0 * (x * i))) - t_1
else if (t <= 3.7d-59) then
tmp = (b * c) + (((-27.0d0) * (j * k)) + ((x * 18.0d0) * (z * (y * t))))
else
tmp = t_2
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 = (j * 27.0) * k;
double t_2 = t * ((18.0 * (y * (x * z))) - (a * 4.0));
double tmp;
if (t <= -4.5e+233) {
tmp = t_2;
} else if (t <= -5.9e-65) {
tmp = ((b * c) - (4.0 * (t * a))) - t_1;
} else if (t <= 3.7e-231) {
tmp = ((b * c) - (4.0 * (x * i))) - t_1;
} else if (t <= 3.7e-59) {
tmp = (b * c) + ((-27.0 * (j * k)) + ((x * 18.0) * (z * (y * t))));
} else {
tmp = t_2;
}
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 = (j * 27.0) * k t_2 = t * ((18.0 * (y * (x * z))) - (a * 4.0)) tmp = 0 if t <= -4.5e+233: tmp = t_2 elif t <= -5.9e-65: tmp = ((b * c) - (4.0 * (t * a))) - t_1 elif t <= 3.7e-231: tmp = ((b * c) - (4.0 * (x * i))) - t_1 elif t <= 3.7e-59: tmp = (b * c) + ((-27.0 * (j * k)) + ((x * 18.0) * (z * (y * t)))) else: tmp = t_2 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(j * 27.0) * k) t_2 = Float64(t * Float64(Float64(18.0 * Float64(y * Float64(x * z))) - Float64(a * 4.0))) tmp = 0.0 if (t <= -4.5e+233) tmp = t_2; elseif (t <= -5.9e-65) tmp = Float64(Float64(Float64(b * c) - Float64(4.0 * Float64(t * a))) - t_1); elseif (t <= 3.7e-231) tmp = Float64(Float64(Float64(b * c) - Float64(4.0 * Float64(x * i))) - t_1); elseif (t <= 3.7e-59) tmp = Float64(Float64(b * c) + Float64(Float64(-27.0 * Float64(j * k)) + Float64(Float64(x * 18.0) * Float64(z * Float64(y * t))))); else tmp = t_2; 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 = (j * 27.0) * k;
t_2 = t * ((18.0 * (y * (x * z))) - (a * 4.0));
tmp = 0.0;
if (t <= -4.5e+233)
tmp = t_2;
elseif (t <= -5.9e-65)
tmp = ((b * c) - (4.0 * (t * a))) - t_1;
elseif (t <= 3.7e-231)
tmp = ((b * c) - (4.0 * (x * i))) - t_1;
elseif (t <= 3.7e-59)
tmp = (b * c) + ((-27.0 * (j * k)) + ((x * 18.0) * (z * (y * t))));
else
tmp = t_2;
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[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]}, Block[{t$95$2 = N[(t * N[(N[(18.0 * N[(y * N[(x * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(a * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -4.5e+233], t$95$2, If[LessEqual[t, -5.9e-65], N[(N[(N[(b * c), $MachinePrecision] - N[(4.0 * N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], If[LessEqual[t, 3.7e-231], N[(N[(N[(b * c), $MachinePrecision] - N[(4.0 * N[(x * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], If[LessEqual[t, 3.7e-59], N[(N[(b * c), $MachinePrecision] + N[(N[(-27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision] + N[(N[(x * 18.0), $MachinePrecision] * N[(z * N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$2]]]]]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
t_1 := \left(j \cdot 27\right) \cdot k\\
t_2 := t \cdot \left(18 \cdot \left(y \cdot \left(x \cdot z\right)\right) - a \cdot 4\right)\\
\mathbf{if}\;t \leq -4.5 \cdot 10^{+233}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t \leq -5.9 \cdot 10^{-65}:\\
\;\;\;\;\left(b \cdot c - 4 \cdot \left(t \cdot a\right)\right) - t_1\\
\mathbf{elif}\;t \leq 3.7 \cdot 10^{-231}:\\
\;\;\;\;\left(b \cdot c - 4 \cdot \left(x \cdot i\right)\right) - t_1\\
\mathbf{elif}\;t \leq 3.7 \cdot 10^{-59}:\\
\;\;\;\;b \cdot c + \left(-27 \cdot \left(j \cdot k\right) + \left(x \cdot 18\right) \cdot \left(z \cdot \left(y \cdot t\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if t < -4.49999999999999999e233 or 3.6999999999999999e-59 < t Initial program 81.2%
sub-neg81.2%
associate-+l-81.2%
sub-neg81.2%
sub-neg81.2%
distribute-rgt-out--85.9%
associate-*l*84.7%
distribute-lft-neg-in84.7%
cancel-sign-sub84.7%
associate-*l*84.7%
associate-*l*83.5%
Simplified83.5%
Taylor expanded in t around inf 74.6%
if -4.49999999999999999e233 < t < -5.89999999999999978e-65Initial program 89.6%
Taylor expanded in x around 0 74.2%
if -5.89999999999999978e-65 < t < 3.69999999999999993e-231Initial program 87.5%
Taylor expanded in t around 0 93.1%
if 3.69999999999999993e-231 < t < 3.6999999999999999e-59Initial program 78.8%
Simplified85.1%
Taylor expanded in a around 0 84.9%
Taylor expanded in y around inf 81.3%
associate-*r*85.7%
associate-*r*79.9%
associate-*l*79.9%
*-commutative79.9%
associate-*l*79.9%
associate-*r*79.9%
*-commutative79.9%
Simplified79.9%
Final simplification79.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
(let* ((t_1 (* 4.0 (* t a))))
(if (<= y -1.42e+222)
(- (* t (- (* 18.0 (* y (* x z))) (* a 4.0))) (* 27.0 (* j k)))
(if (<= y -1.55e-30)
(+
(* b c)
(+ (* -27.0 (* j k)) (* x (+ (* 18.0 (* y (* z t))) (* i -4.0)))))
(if (<= y 5e-6)
(- (- (* b c) (+ t_1 (* 4.0 (* x i)))) (* (* j 27.0) k))
(- (+ (* b c) (* 18.0 (* y (* t (* x z))))) 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 = 4.0 * (t * a);
double tmp;
if (y <= -1.42e+222) {
tmp = (t * ((18.0 * (y * (x * z))) - (a * 4.0))) - (27.0 * (j * k));
} else if (y <= -1.55e-30) {
tmp = (b * c) + ((-27.0 * (j * k)) + (x * ((18.0 * (y * (z * t))) + (i * -4.0))));
} else if (y <= 5e-6) {
tmp = ((b * c) - (t_1 + (4.0 * (x * i)))) - ((j * 27.0) * k);
} else {
tmp = ((b * c) + (18.0 * (y * (t * (x * z))))) - 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 = 4.0d0 * (t * a)
if (y <= (-1.42d+222)) then
tmp = (t * ((18.0d0 * (y * (x * z))) - (a * 4.0d0))) - (27.0d0 * (j * k))
else if (y <= (-1.55d-30)) then
tmp = (b * c) + (((-27.0d0) * (j * k)) + (x * ((18.0d0 * (y * (z * t))) + (i * (-4.0d0)))))
else if (y <= 5d-6) then
tmp = ((b * c) - (t_1 + (4.0d0 * (x * i)))) - ((j * 27.0d0) * k)
else
tmp = ((b * c) + (18.0d0 * (y * (t * (x * z))))) - 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 = 4.0 * (t * a);
double tmp;
if (y <= -1.42e+222) {
tmp = (t * ((18.0 * (y * (x * z))) - (a * 4.0))) - (27.0 * (j * k));
} else if (y <= -1.55e-30) {
tmp = (b * c) + ((-27.0 * (j * k)) + (x * ((18.0 * (y * (z * t))) + (i * -4.0))));
} else if (y <= 5e-6) {
tmp = ((b * c) - (t_1 + (4.0 * (x * i)))) - ((j * 27.0) * k);
} else {
tmp = ((b * c) + (18.0 * (y * (t * (x * z))))) - 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 = 4.0 * (t * a) tmp = 0 if y <= -1.42e+222: tmp = (t * ((18.0 * (y * (x * z))) - (a * 4.0))) - (27.0 * (j * k)) elif y <= -1.55e-30: tmp = (b * c) + ((-27.0 * (j * k)) + (x * ((18.0 * (y * (z * t))) + (i * -4.0)))) elif y <= 5e-6: tmp = ((b * c) - (t_1 + (4.0 * (x * i)))) - ((j * 27.0) * k) else: tmp = ((b * c) + (18.0 * (y * (t * (x * z))))) - 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(4.0 * Float64(t * a)) tmp = 0.0 if (y <= -1.42e+222) tmp = Float64(Float64(t * Float64(Float64(18.0 * Float64(y * Float64(x * z))) - Float64(a * 4.0))) - Float64(27.0 * Float64(j * k))); elseif (y <= -1.55e-30) tmp = Float64(Float64(b * c) + Float64(Float64(-27.0 * Float64(j * k)) + Float64(x * Float64(Float64(18.0 * Float64(y * Float64(z * t))) + Float64(i * -4.0))))); elseif (y <= 5e-6) tmp = Float64(Float64(Float64(b * c) - Float64(t_1 + Float64(4.0 * Float64(x * i)))) - Float64(Float64(j * 27.0) * k)); else tmp = Float64(Float64(Float64(b * c) + Float64(18.0 * Float64(y * Float64(t * Float64(x * z))))) - 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 = 4.0 * (t * a);
tmp = 0.0;
if (y <= -1.42e+222)
tmp = (t * ((18.0 * (y * (x * z))) - (a * 4.0))) - (27.0 * (j * k));
elseif (y <= -1.55e-30)
tmp = (b * c) + ((-27.0 * (j * k)) + (x * ((18.0 * (y * (z * t))) + (i * -4.0))));
elseif (y <= 5e-6)
tmp = ((b * c) - (t_1 + (4.0 * (x * i)))) - ((j * 27.0) * k);
else
tmp = ((b * c) + (18.0 * (y * (t * (x * z))))) - 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[(4.0 * N[(t * a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.42e+222], N[(N[(t * N[(N[(18.0 * N[(y * N[(x * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(a * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -1.55e-30], N[(N[(b * c), $MachinePrecision] + N[(N[(-27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision] + N[(x * N[(N[(18.0 * N[(y * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(i * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 5e-6], N[(N[(N[(b * c), $MachinePrecision] - N[(t$95$1 + N[(4.0 * N[(x * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision], N[(N[(N[(b * c), $MachinePrecision] + N[(18.0 * N[(y * N[(t * N[(x * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision]]]]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
t_1 := 4 \cdot \left(t \cdot a\right)\\
\mathbf{if}\;y \leq -1.42 \cdot 10^{+222}:\\
\;\;\;\;t \cdot \left(18 \cdot \left(y \cdot \left(x \cdot z\right)\right) - a \cdot 4\right) - 27 \cdot \left(j \cdot k\right)\\
\mathbf{elif}\;y \leq -1.55 \cdot 10^{-30}:\\
\;\;\;\;b \cdot c + \left(-27 \cdot \left(j \cdot k\right) + x \cdot \left(18 \cdot \left(y \cdot \left(z \cdot t\right)\right) + i \cdot -4\right)\right)\\
\mathbf{elif}\;y \leq 5 \cdot 10^{-6}:\\
\;\;\;\;\left(b \cdot c - \left(t_1 + 4 \cdot \left(x \cdot i\right)\right)\right) - \left(j \cdot 27\right) \cdot k\\
\mathbf{else}:\\
\;\;\;\;\left(b \cdot c + 18 \cdot \left(y \cdot \left(t \cdot \left(x \cdot z\right)\right)\right)\right) - t_1\\
\end{array}
\end{array}
if y < -1.41999999999999997e222Initial program 50.4%
sub-neg50.4%
associate-+l-50.4%
sub-neg50.4%
sub-neg50.4%
distribute-rgt-out--60.4%
associate-*l*70.0%
distribute-lft-neg-in70.0%
cancel-sign-sub70.0%
associate-*l*70.0%
associate-*l*69.9%
Simplified69.9%
Taylor expanded in i around 0 79.5%
Taylor expanded in c around 0 89.5%
if -1.41999999999999997e222 < y < -1.54999999999999995e-30Initial program 82.5%
Simplified84.7%
Taylor expanded in a around 0 91.9%
if -1.54999999999999995e-30 < y < 5.00000000000000041e-6Initial program 92.4%
Taylor expanded in y around 0 93.1%
if 5.00000000000000041e-6 < y Initial program 79.2%
Taylor expanded in i around 0 84.3%
Taylor expanded in j around 0 74.4%
Final simplification87.2%
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 -2.25e+92) (not (<= t 6.5e-72)))
(- (+ (* t (- (* 18.0 (* y (* x z))) (* a 4.0))) (* b c)) (* 27.0 (* j k)))
(+
(* b c)
(+ (* -27.0 (* j k)) (* x (+ (* 18.0 (* y (* z t))) (* i -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 <= -2.25e+92) || !(t <= 6.5e-72)) {
tmp = ((t * ((18.0 * (y * (x * z))) - (a * 4.0))) + (b * c)) - (27.0 * (j * k));
} else {
tmp = (b * c) + ((-27.0 * (j * k)) + (x * ((18.0 * (y * (z * t))) + (i * -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 <= (-2.25d+92)) .or. (.not. (t <= 6.5d-72))) then
tmp = ((t * ((18.0d0 * (y * (x * z))) - (a * 4.0d0))) + (b * c)) - (27.0d0 * (j * k))
else
tmp = (b * c) + (((-27.0d0) * (j * k)) + (x * ((18.0d0 * (y * (z * t))) + (i * (-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 <= -2.25e+92) || !(t <= 6.5e-72)) {
tmp = ((t * ((18.0 * (y * (x * z))) - (a * 4.0))) + (b * c)) - (27.0 * (j * k));
} else {
tmp = (b * c) + ((-27.0 * (j * k)) + (x * ((18.0 * (y * (z * t))) + (i * -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 <= -2.25e+92) or not (t <= 6.5e-72): tmp = ((t * ((18.0 * (y * (x * z))) - (a * 4.0))) + (b * c)) - (27.0 * (j * k)) else: tmp = (b * c) + ((-27.0 * (j * k)) + (x * ((18.0 * (y * (z * t))) + (i * -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 <= -2.25e+92) || !(t <= 6.5e-72)) tmp = Float64(Float64(Float64(t * Float64(Float64(18.0 * Float64(y * Float64(x * z))) - Float64(a * 4.0))) + Float64(b * c)) - Float64(27.0 * Float64(j * k))); else tmp = Float64(Float64(b * c) + Float64(Float64(-27.0 * Float64(j * k)) + Float64(x * Float64(Float64(18.0 * Float64(y * Float64(z * t))) + Float64(i * -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 <= -2.25e+92) || ~((t <= 6.5e-72)))
tmp = ((t * ((18.0 * (y * (x * z))) - (a * 4.0))) + (b * c)) - (27.0 * (j * k));
else
tmp = (b * c) + ((-27.0 * (j * k)) + (x * ((18.0 * (y * (z * t))) + (i * -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[Or[LessEqual[t, -2.25e+92], N[Not[LessEqual[t, 6.5e-72]], $MachinePrecision]], N[(N[(N[(t * N[(N[(18.0 * N[(y * N[(x * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(a * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(b * c), $MachinePrecision]), $MachinePrecision] - N[(27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(b * c), $MachinePrecision] + N[(N[(-27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision] + N[(x * N[(N[(18.0 * N[(y * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(i * -4.0), $MachinePrecision]), $MachinePrecision]), $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 -2.25 \cdot 10^{+92} \lor \neg \left(t \leq 6.5 \cdot 10^{-72}\right):\\
\;\;\;\;\left(t \cdot \left(18 \cdot \left(y \cdot \left(x \cdot z\right)\right) - a \cdot 4\right) + b \cdot c\right) - 27 \cdot \left(j \cdot k\right)\\
\mathbf{else}:\\
\;\;\;\;b \cdot c + \left(-27 \cdot \left(j \cdot k\right) + x \cdot \left(18 \cdot \left(y \cdot \left(z \cdot t\right)\right) + i \cdot -4\right)\right)\\
\end{array}
\end{array}
if t < -2.25e92 or 6.4999999999999997e-72 < t Initial program 83.2%
sub-neg83.2%
associate-+l-83.2%
sub-neg83.2%
sub-neg83.2%
distribute-rgt-out--87.2%
associate-*l*86.1%
distribute-lft-neg-in86.1%
cancel-sign-sub86.1%
associate-*l*86.1%
associate-*l*85.4%
Simplified85.4%
Taylor expanded in i around 0 88.8%
if -2.25e92 < t < 6.4999999999999997e-72Initial program 86.6%
Simplified90.4%
Taylor expanded in a around 0 89.5%
Final simplification89.2%
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 (* (* j 27.0) k)))
(if (<= t_2 -1e+68)
(- (* b c) t_1)
(if (<= t_2 5e+94)
(* t (- (* 18.0 (* y (* x z))) (* a 4.0)))
(- (* 18.0 (* y (* t (* x z)))) 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 = 27.0 * (j * k);
double t_2 = (j * 27.0) * k;
double tmp;
if (t_2 <= -1e+68) {
tmp = (b * c) - t_1;
} else if (t_2 <= 5e+94) {
tmp = t * ((18.0 * (y * (x * z))) - (a * 4.0));
} else {
tmp = (18.0 * (y * (t * (x * z)))) - 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) :: t_2
real(8) :: tmp
t_1 = 27.0d0 * (j * k)
t_2 = (j * 27.0d0) * k
if (t_2 <= (-1d+68)) then
tmp = (b * c) - t_1
else if (t_2 <= 5d+94) then
tmp = t * ((18.0d0 * (y * (x * z))) - (a * 4.0d0))
else
tmp = (18.0d0 * (y * (t * (x * z)))) - 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 = 27.0 * (j * k);
double t_2 = (j * 27.0) * k;
double tmp;
if (t_2 <= -1e+68) {
tmp = (b * c) - t_1;
} else if (t_2 <= 5e+94) {
tmp = t * ((18.0 * (y * (x * z))) - (a * 4.0));
} else {
tmp = (18.0 * (y * (t * (x * z)))) - 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 = 27.0 * (j * k) t_2 = (j * 27.0) * k tmp = 0 if t_2 <= -1e+68: tmp = (b * c) - t_1 elif t_2 <= 5e+94: tmp = t * ((18.0 * (y * (x * z))) - (a * 4.0)) else: tmp = (18.0 * (y * (t * (x * z)))) - 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(27.0 * Float64(j * k)) t_2 = Float64(Float64(j * 27.0) * k) tmp = 0.0 if (t_2 <= -1e+68) tmp = Float64(Float64(b * c) - t_1); elseif (t_2 <= 5e+94) tmp = Float64(t * Float64(Float64(18.0 * Float64(y * Float64(x * z))) - Float64(a * 4.0))); else tmp = Float64(Float64(18.0 * Float64(y * Float64(t * Float64(x * z)))) - 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 = 27.0 * (j * k);
t_2 = (j * 27.0) * k;
tmp = 0.0;
if (t_2 <= -1e+68)
tmp = (b * c) - t_1;
elseif (t_2 <= 5e+94)
tmp = t * ((18.0 * (y * (x * z))) - (a * 4.0));
else
tmp = (18.0 * (y * (t * (x * z)))) - 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[(27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]}, If[LessEqual[t$95$2, -1e+68], N[(N[(b * c), $MachinePrecision] - t$95$1), $MachinePrecision], If[LessEqual[t$95$2, 5e+94], N[(t * N[(N[(18.0 * N[(y * N[(x * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(a * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(18.0 * N[(y * N[(t * N[(x * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$1), $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 := \left(j \cdot 27\right) \cdot k\\
\mathbf{if}\;t_2 \leq -1 \cdot 10^{+68}:\\
\;\;\;\;b \cdot c - t_1\\
\mathbf{elif}\;t_2 \leq 5 \cdot 10^{+94}:\\
\;\;\;\;t \cdot \left(18 \cdot \left(y \cdot \left(x \cdot z\right)\right) - a \cdot 4\right)\\
\mathbf{else}:\\
\;\;\;\;18 \cdot \left(y \cdot \left(t \cdot \left(x \cdot z\right)\right)\right) - t_1\\
\end{array}
\end{array}
if (*.f64 (*.f64 j 27) k) < -9.99999999999999953e67Initial program 79.1%
sub-neg79.1%
associate-+l-79.1%
sub-neg79.1%
sub-neg79.1%
distribute-rgt-out--81.9%
associate-*l*80.5%
distribute-lft-neg-in80.5%
cancel-sign-sub80.5%
associate-*l*80.5%
associate-*l*79.1%
Simplified79.1%
Taylor expanded in i around 0 77.8%
Taylor expanded in c around inf 71.0%
if -9.99999999999999953e67 < (*.f64 (*.f64 j 27) k) < 5.0000000000000001e94Initial program 89.0%
sub-neg89.0%
associate-+l-89.0%
sub-neg89.0%
sub-neg89.0%
distribute-rgt-out--91.2%
associate-*l*89.6%
distribute-lft-neg-in89.6%
cancel-sign-sub89.6%
associate-*l*89.6%
associate-*l*89.6%
Simplified89.6%
Taylor expanded in t around inf 63.6%
if 5.0000000000000001e94 < (*.f64 (*.f64 j 27) k) Initial program 82.2%
Taylor expanded in t around -inf 76.6%
Taylor expanded in a around 0 80.4%
Final simplification68.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 (* 27.0 (* j k))) (t_2 (* (* j 27.0) k)))
(if (<= t_2 -1e+77)
(- (* b c) t_1)
(if (<= t_2 5e+29)
(- (* b c) (+ (* 4.0 (* t a)) (* 4.0 (* x i))))
(- (* 18.0 (* y (* t (* x z)))) 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 = 27.0 * (j * k);
double t_2 = (j * 27.0) * k;
double tmp;
if (t_2 <= -1e+77) {
tmp = (b * c) - t_1;
} else if (t_2 <= 5e+29) {
tmp = (b * c) - ((4.0 * (t * a)) + (4.0 * (x * i)));
} else {
tmp = (18.0 * (y * (t * (x * z)))) - 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) :: t_2
real(8) :: tmp
t_1 = 27.0d0 * (j * k)
t_2 = (j * 27.0d0) * k
if (t_2 <= (-1d+77)) then
tmp = (b * c) - t_1
else if (t_2 <= 5d+29) then
tmp = (b * c) - ((4.0d0 * (t * a)) + (4.0d0 * (x * i)))
else
tmp = (18.0d0 * (y * (t * (x * z)))) - 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 = 27.0 * (j * k);
double t_2 = (j * 27.0) * k;
double tmp;
if (t_2 <= -1e+77) {
tmp = (b * c) - t_1;
} else if (t_2 <= 5e+29) {
tmp = (b * c) - ((4.0 * (t * a)) + (4.0 * (x * i)));
} else {
tmp = (18.0 * (y * (t * (x * z)))) - 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 = 27.0 * (j * k) t_2 = (j * 27.0) * k tmp = 0 if t_2 <= -1e+77: tmp = (b * c) - t_1 elif t_2 <= 5e+29: tmp = (b * c) - ((4.0 * (t * a)) + (4.0 * (x * i))) else: tmp = (18.0 * (y * (t * (x * z)))) - 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(27.0 * Float64(j * k)) t_2 = Float64(Float64(j * 27.0) * k) tmp = 0.0 if (t_2 <= -1e+77) tmp = Float64(Float64(b * c) - t_1); elseif (t_2 <= 5e+29) tmp = Float64(Float64(b * c) - Float64(Float64(4.0 * Float64(t * a)) + Float64(4.0 * Float64(x * i)))); else tmp = Float64(Float64(18.0 * Float64(y * Float64(t * Float64(x * z)))) - 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 = 27.0 * (j * k);
t_2 = (j * 27.0) * k;
tmp = 0.0;
if (t_2 <= -1e+77)
tmp = (b * c) - t_1;
elseif (t_2 <= 5e+29)
tmp = (b * c) - ((4.0 * (t * a)) + (4.0 * (x * i)));
else
tmp = (18.0 * (y * (t * (x * z)))) - 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[(27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]}, If[LessEqual[t$95$2, -1e+77], N[(N[(b * c), $MachinePrecision] - t$95$1), $MachinePrecision], If[LessEqual[t$95$2, 5e+29], N[(N[(b * c), $MachinePrecision] - N[(N[(4.0 * N[(t * a), $MachinePrecision]), $MachinePrecision] + N[(4.0 * N[(x * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(18.0 * N[(y * N[(t * N[(x * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$1), $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 := \left(j \cdot 27\right) \cdot k\\
\mathbf{if}\;t_2 \leq -1 \cdot 10^{+77}:\\
\;\;\;\;b \cdot c - t_1\\
\mathbf{elif}\;t_2 \leq 5 \cdot 10^{+29}:\\
\;\;\;\;b \cdot c - \left(4 \cdot \left(t \cdot a\right) + 4 \cdot \left(x \cdot i\right)\right)\\
\mathbf{else}:\\
\;\;\;\;18 \cdot \left(y \cdot \left(t \cdot \left(x \cdot z\right)\right)\right) - t_1\\
\end{array}
\end{array}
if (*.f64 (*.f64 j 27) k) < -9.99999999999999983e76Initial program 78.2%
sub-neg78.2%
associate-+l-78.2%
sub-neg78.2%
sub-neg78.2%
distribute-rgt-out--81.1%
associate-*l*79.6%
distribute-lft-neg-in79.6%
cancel-sign-sub79.6%
associate-*l*79.6%
associate-*l*78.2%
Simplified78.2%
Taylor expanded in i around 0 76.8%
Taylor expanded in c around inf 71.2%
if -9.99999999999999983e76 < (*.f64 (*.f64 j 27) k) < 5.0000000000000001e29Initial program 88.5%
Taylor expanded in y around 0 72.8%
Taylor expanded in j around 0 68.8%
if 5.0000000000000001e29 < (*.f64 (*.f64 j 27) k) Initial program 84.9%
Taylor expanded in t around -inf 78.6%
Taylor expanded in a around 0 76.6%
Final simplification71.2%
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 (* (* j 27.0) k))
(t_2 (- (- (* b c) (* 4.0 (* t a))) t_1))
(t_3 (* t (- (* 18.0 (* y (* x z))) (* a 4.0)))))
(if (<= t -8.8e+232)
t_3
(if (<= t -1.85e-65)
t_2
(if (<= t 1.12e-142)
(- (- (* b c) (* 4.0 (* x i))) t_1)
(if (or (<= t 1.34e+101) (not (<= t 2.3e+216))) t_3 t_2))))))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 = (j * 27.0) * k;
double t_2 = ((b * c) - (4.0 * (t * a))) - t_1;
double t_3 = t * ((18.0 * (y * (x * z))) - (a * 4.0));
double tmp;
if (t <= -8.8e+232) {
tmp = t_3;
} else if (t <= -1.85e-65) {
tmp = t_2;
} else if (t <= 1.12e-142) {
tmp = ((b * c) - (4.0 * (x * i))) - t_1;
} else if ((t <= 1.34e+101) || !(t <= 2.3e+216)) {
tmp = t_3;
} else {
tmp = t_2;
}
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 = (j * 27.0d0) * k
t_2 = ((b * c) - (4.0d0 * (t * a))) - t_1
t_3 = t * ((18.0d0 * (y * (x * z))) - (a * 4.0d0))
if (t <= (-8.8d+232)) then
tmp = t_3
else if (t <= (-1.85d-65)) then
tmp = t_2
else if (t <= 1.12d-142) then
tmp = ((b * c) - (4.0d0 * (x * i))) - t_1
else if ((t <= 1.34d+101) .or. (.not. (t <= 2.3d+216))) then
tmp = t_3
else
tmp = t_2
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 = (j * 27.0) * k;
double t_2 = ((b * c) - (4.0 * (t * a))) - t_1;
double t_3 = t * ((18.0 * (y * (x * z))) - (a * 4.0));
double tmp;
if (t <= -8.8e+232) {
tmp = t_3;
} else if (t <= -1.85e-65) {
tmp = t_2;
} else if (t <= 1.12e-142) {
tmp = ((b * c) - (4.0 * (x * i))) - t_1;
} else if ((t <= 1.34e+101) || !(t <= 2.3e+216)) {
tmp = t_3;
} else {
tmp = t_2;
}
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 = (j * 27.0) * k t_2 = ((b * c) - (4.0 * (t * a))) - t_1 t_3 = t * ((18.0 * (y * (x * z))) - (a * 4.0)) tmp = 0 if t <= -8.8e+232: tmp = t_3 elif t <= -1.85e-65: tmp = t_2 elif t <= 1.12e-142: tmp = ((b * c) - (4.0 * (x * i))) - t_1 elif (t <= 1.34e+101) or not (t <= 2.3e+216): tmp = t_3 else: tmp = t_2 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(j * 27.0) * k) t_2 = Float64(Float64(Float64(b * c) - Float64(4.0 * Float64(t * a))) - t_1) t_3 = Float64(t * Float64(Float64(18.0 * Float64(y * Float64(x * z))) - Float64(a * 4.0))) tmp = 0.0 if (t <= -8.8e+232) tmp = t_3; elseif (t <= -1.85e-65) tmp = t_2; elseif (t <= 1.12e-142) tmp = Float64(Float64(Float64(b * c) - Float64(4.0 * Float64(x * i))) - t_1); elseif ((t <= 1.34e+101) || !(t <= 2.3e+216)) tmp = t_3; else tmp = t_2; 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 = (j * 27.0) * k;
t_2 = ((b * c) - (4.0 * (t * a))) - t_1;
t_3 = t * ((18.0 * (y * (x * z))) - (a * 4.0));
tmp = 0.0;
if (t <= -8.8e+232)
tmp = t_3;
elseif (t <= -1.85e-65)
tmp = t_2;
elseif (t <= 1.12e-142)
tmp = ((b * c) - (4.0 * (x * i))) - t_1;
elseif ((t <= 1.34e+101) || ~((t <= 2.3e+216)))
tmp = t_3;
else
tmp = t_2;
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[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(b * c), $MachinePrecision] - N[(4.0 * N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision]}, Block[{t$95$3 = N[(t * N[(N[(18.0 * N[(y * N[(x * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(a * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -8.8e+232], t$95$3, If[LessEqual[t, -1.85e-65], t$95$2, If[LessEqual[t, 1.12e-142], N[(N[(N[(b * c), $MachinePrecision] - N[(4.0 * N[(x * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], If[Or[LessEqual[t, 1.34e+101], N[Not[LessEqual[t, 2.3e+216]], $MachinePrecision]], t$95$3, t$95$2]]]]]]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
t_1 := \left(j \cdot 27\right) \cdot k\\
t_2 := \left(b \cdot c - 4 \cdot \left(t \cdot a\right)\right) - t_1\\
t_3 := t \cdot \left(18 \cdot \left(y \cdot \left(x \cdot z\right)\right) - a \cdot 4\right)\\
\mathbf{if}\;t \leq -8.8 \cdot 10^{+232}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;t \leq -1.85 \cdot 10^{-65}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t \leq 1.12 \cdot 10^{-142}:\\
\;\;\;\;\left(b \cdot c - 4 \cdot \left(x \cdot i\right)\right) - t_1\\
\mathbf{elif}\;t \leq 1.34 \cdot 10^{+101} \lor \neg \left(t \leq 2.3 \cdot 10^{+216}\right):\\
\;\;\;\;t_3\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if t < -8.7999999999999999e232 or 1.1199999999999999e-142 < t < 1.3399999999999999e101 or 2.29999999999999996e216 < t Initial program 80.5%
sub-neg80.5%
associate-+l-80.5%
sub-neg80.5%
sub-neg80.5%
distribute-rgt-out--84.5%
associate-*l*83.1%
distribute-lft-neg-in83.1%
cancel-sign-sub83.1%
associate-*l*83.1%
associate-*l*81.8%
Simplified81.8%
Taylor expanded in t around inf 77.1%
if -8.7999999999999999e232 < t < -1.85e-65 or 1.3399999999999999e101 < t < 2.29999999999999996e216Initial program 86.4%
Taylor expanded in x around 0 72.1%
if -1.85e-65 < t < 1.1199999999999999e-142Initial program 87.4%
Taylor expanded in t around 0 90.7%
Final simplification79.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
(let* ((t_1 (* (* j 27.0) k)))
(if (<= t_1 -1e+68)
(- (* b c) (* 27.0 (* j k)))
(if (<= t_1 1e+236)
(* t (- (* 18.0 (* y (* x z))) (* a 4.0)))
(- (* -4.0 (* t a)) 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 = (j * 27.0) * k;
double tmp;
if (t_1 <= -1e+68) {
tmp = (b * c) - (27.0 * (j * k));
} else if (t_1 <= 1e+236) {
tmp = t * ((18.0 * (y * (x * z))) - (a * 4.0));
} else {
tmp = (-4.0 * (t * a)) - 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 = (j * 27.0d0) * k
if (t_1 <= (-1d+68)) then
tmp = (b * c) - (27.0d0 * (j * k))
else if (t_1 <= 1d+236) then
tmp = t * ((18.0d0 * (y * (x * z))) - (a * 4.0d0))
else
tmp = ((-4.0d0) * (t * a)) - 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 = (j * 27.0) * k;
double tmp;
if (t_1 <= -1e+68) {
tmp = (b * c) - (27.0 * (j * k));
} else if (t_1 <= 1e+236) {
tmp = t * ((18.0 * (y * (x * z))) - (a * 4.0));
} else {
tmp = (-4.0 * (t * a)) - 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 = (j * 27.0) * k tmp = 0 if t_1 <= -1e+68: tmp = (b * c) - (27.0 * (j * k)) elif t_1 <= 1e+236: tmp = t * ((18.0 * (y * (x * z))) - (a * 4.0)) else: tmp = (-4.0 * (t * a)) - 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(j * 27.0) * k) tmp = 0.0 if (t_1 <= -1e+68) tmp = Float64(Float64(b * c) - Float64(27.0 * Float64(j * k))); elseif (t_1 <= 1e+236) tmp = Float64(t * Float64(Float64(18.0 * Float64(y * Float64(x * z))) - Float64(a * 4.0))); else tmp = Float64(Float64(-4.0 * Float64(t * a)) - 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 = (j * 27.0) * k;
tmp = 0.0;
if (t_1 <= -1e+68)
tmp = (b * c) - (27.0 * (j * k));
elseif (t_1 <= 1e+236)
tmp = t * ((18.0 * (y * (x * z))) - (a * 4.0));
else
tmp = (-4.0 * (t * a)) - 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[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]}, If[LessEqual[t$95$1, -1e+68], N[(N[(b * c), $MachinePrecision] - N[(27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 1e+236], N[(t * N[(N[(18.0 * N[(y * N[(x * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(a * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(-4.0 * N[(t * a), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision]]]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
t_1 := \left(j \cdot 27\right) \cdot k\\
\mathbf{if}\;t_1 \leq -1 \cdot 10^{+68}:\\
\;\;\;\;b \cdot c - 27 \cdot \left(j \cdot k\right)\\
\mathbf{elif}\;t_1 \leq 10^{+236}:\\
\;\;\;\;t \cdot \left(18 \cdot \left(y \cdot \left(x \cdot z\right)\right) - a \cdot 4\right)\\
\mathbf{else}:\\
\;\;\;\;-4 \cdot \left(t \cdot a\right) - t_1\\
\end{array}
\end{array}
if (*.f64 (*.f64 j 27) k) < -9.99999999999999953e67Initial program 79.1%
sub-neg79.1%
associate-+l-79.1%
sub-neg79.1%
sub-neg79.1%
distribute-rgt-out--81.9%
associate-*l*80.5%
distribute-lft-neg-in80.5%
cancel-sign-sub80.5%
associate-*l*80.5%
associate-*l*79.1%
Simplified79.1%
Taylor expanded in i around 0 77.8%
Taylor expanded in c around inf 71.0%
if -9.99999999999999953e67 < (*.f64 (*.f64 j 27) k) < 1.00000000000000005e236Initial program 88.0%
sub-neg88.0%
associate-+l-88.0%
sub-neg88.0%
sub-neg88.0%
distribute-rgt-out--89.9%
associate-*l*88.5%
distribute-lft-neg-in88.5%
cancel-sign-sub88.5%
associate-*l*88.5%
associate-*l*88.5%
Simplified88.5%
Taylor expanded in t around inf 61.7%
if 1.00000000000000005e236 < (*.f64 (*.f64 j 27) k) Initial program 82.5%
Taylor expanded in t around -inf 86.3%
Taylor expanded in y around 0 88.4%
*-commutative88.4%
*-commutative88.4%
*-commutative88.4%
associate-*l*88.4%
Simplified88.4%
sub-neg88.4%
mul-1-neg88.4%
associate-*r*88.4%
*-commutative88.4%
associate-*l*88.4%
Applied egg-rr88.4%
unsub-neg88.4%
distribute-lft-neg-in88.4%
metadata-eval88.4%
*-commutative88.4%
associate-*r*88.4%
*-commutative88.4%
Applied egg-rr88.4%
Final simplification67.2%
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 (* y (* x z))) (t_2 (* (* j 27.0) k)))
(if (<= t -3e+102)
(- (* t (- (* 18.0 t_1) (* a 4.0))) (* 27.0 (* j k)))
(if (<= t 7.2e-134)
(- (- (* b c) (+ (* 4.0 (* t a)) (* 4.0 (* x i)))) t_2)
(- (* t (- (* a -4.0) (* -18.0 t_1))) t_2)))))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 = y * (x * z);
double t_2 = (j * 27.0) * k;
double tmp;
if (t <= -3e+102) {
tmp = (t * ((18.0 * t_1) - (a * 4.0))) - (27.0 * (j * k));
} else if (t <= 7.2e-134) {
tmp = ((b * c) - ((4.0 * (t * a)) + (4.0 * (x * i)))) - t_2;
} else {
tmp = (t * ((a * -4.0) - (-18.0 * t_1))) - t_2;
}
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 = y * (x * z)
t_2 = (j * 27.0d0) * k
if (t <= (-3d+102)) then
tmp = (t * ((18.0d0 * t_1) - (a * 4.0d0))) - (27.0d0 * (j * k))
else if (t <= 7.2d-134) then
tmp = ((b * c) - ((4.0d0 * (t * a)) + (4.0d0 * (x * i)))) - t_2
else
tmp = (t * ((a * (-4.0d0)) - ((-18.0d0) * t_1))) - t_2
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 = y * (x * z);
double t_2 = (j * 27.0) * k;
double tmp;
if (t <= -3e+102) {
tmp = (t * ((18.0 * t_1) - (a * 4.0))) - (27.0 * (j * k));
} else if (t <= 7.2e-134) {
tmp = ((b * c) - ((4.0 * (t * a)) + (4.0 * (x * i)))) - t_2;
} else {
tmp = (t * ((a * -4.0) - (-18.0 * t_1))) - t_2;
}
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 = y * (x * z) t_2 = (j * 27.0) * k tmp = 0 if t <= -3e+102: tmp = (t * ((18.0 * t_1) - (a * 4.0))) - (27.0 * (j * k)) elif t <= 7.2e-134: tmp = ((b * c) - ((4.0 * (t * a)) + (4.0 * (x * i)))) - t_2 else: tmp = (t * ((a * -4.0) - (-18.0 * t_1))) - t_2 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(y * Float64(x * z)) t_2 = Float64(Float64(j * 27.0) * k) tmp = 0.0 if (t <= -3e+102) tmp = Float64(Float64(t * Float64(Float64(18.0 * t_1) - Float64(a * 4.0))) - Float64(27.0 * Float64(j * k))); elseif (t <= 7.2e-134) tmp = Float64(Float64(Float64(b * c) - Float64(Float64(4.0 * Float64(t * a)) + Float64(4.0 * Float64(x * i)))) - t_2); else tmp = Float64(Float64(t * Float64(Float64(a * -4.0) - Float64(-18.0 * t_1))) - t_2); 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 = y * (x * z);
t_2 = (j * 27.0) * k;
tmp = 0.0;
if (t <= -3e+102)
tmp = (t * ((18.0 * t_1) - (a * 4.0))) - (27.0 * (j * k));
elseif (t <= 7.2e-134)
tmp = ((b * c) - ((4.0 * (t * a)) + (4.0 * (x * i)))) - t_2;
else
tmp = (t * ((a * -4.0) - (-18.0 * t_1))) - t_2;
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[(y * N[(x * z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]}, If[LessEqual[t, -3e+102], N[(N[(t * N[(N[(18.0 * t$95$1), $MachinePrecision] - N[(a * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 7.2e-134], N[(N[(N[(b * c), $MachinePrecision] - N[(N[(4.0 * N[(t * a), $MachinePrecision]), $MachinePrecision] + N[(4.0 * N[(x * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$2), $MachinePrecision], N[(N[(t * N[(N[(a * -4.0), $MachinePrecision] - N[(-18.0 * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$2), $MachinePrecision]]]]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
t_1 := y \cdot \left(x \cdot z\right)\\
t_2 := \left(j \cdot 27\right) \cdot k\\
\mathbf{if}\;t \leq -3 \cdot 10^{+102}:\\
\;\;\;\;t \cdot \left(18 \cdot t_1 - a \cdot 4\right) - 27 \cdot \left(j \cdot k\right)\\
\mathbf{elif}\;t \leq 7.2 \cdot 10^{-134}:\\
\;\;\;\;\left(b \cdot c - \left(4 \cdot \left(t \cdot a\right) + 4 \cdot \left(x \cdot i\right)\right)\right) - t_2\\
\mathbf{else}:\\
\;\;\;\;t \cdot \left(a \cdot -4 - -18 \cdot t_1\right) - t_2\\
\end{array}
\end{array}
if t < -2.9999999999999998e102Initial program 86.9%
sub-neg86.9%
associate-+l-86.9%
sub-neg86.9%
sub-neg86.9%
distribute-rgt-out--93.4%
associate-*l*90.7%
distribute-lft-neg-in90.7%
cancel-sign-sub90.7%
associate-*l*90.7%
associate-*l*90.7%
Simplified90.7%
Taylor expanded in i around 0 89.1%
Taylor expanded in c around 0 87.2%
if -2.9999999999999998e102 < t < 7.1999999999999998e-134Initial program 88.1%
Taylor expanded in y around 0 87.2%
if 7.1999999999999998e-134 < t Initial program 79.3%
Taylor expanded in t around -inf 82.0%
Final simplification85.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
(let* ((t_1 (- (* b c) (* 27.0 (* j k)))) (t_2 (* 18.0 (* y (* t (* x z))))))
(if (<= t -2.5e+246)
(* x (* 18.0 (* t (* y z))))
(if (<= t -1.75e+109)
(* -4.0 (* t a))
(if (<= t 1.12e-142)
t_1
(if (<= t 5.8e-89)
t_2
(if (<= t 215000000.0)
t_1
(if (<= t 4.2e+109)
t_2
(if (<= t 5.1e+188)
(- (* b c) (* 4.0 (* x i)))
(* x (* 18.0 (* y (* z t)))))))))))))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) - (27.0 * (j * k));
double t_2 = 18.0 * (y * (t * (x * z)));
double tmp;
if (t <= -2.5e+246) {
tmp = x * (18.0 * (t * (y * z)));
} else if (t <= -1.75e+109) {
tmp = -4.0 * (t * a);
} else if (t <= 1.12e-142) {
tmp = t_1;
} else if (t <= 5.8e-89) {
tmp = t_2;
} else if (t <= 215000000.0) {
tmp = t_1;
} else if (t <= 4.2e+109) {
tmp = t_2;
} else if (t <= 5.1e+188) {
tmp = (b * c) - (4.0 * (x * i));
} else {
tmp = x * (18.0 * (y * (z * t)));
}
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 = (b * c) - (27.0d0 * (j * k))
t_2 = 18.0d0 * (y * (t * (x * z)))
if (t <= (-2.5d+246)) then
tmp = x * (18.0d0 * (t * (y * z)))
else if (t <= (-1.75d+109)) then
tmp = (-4.0d0) * (t * a)
else if (t <= 1.12d-142) then
tmp = t_1
else if (t <= 5.8d-89) then
tmp = t_2
else if (t <= 215000000.0d0) then
tmp = t_1
else if (t <= 4.2d+109) then
tmp = t_2
else if (t <= 5.1d+188) then
tmp = (b * c) - (4.0d0 * (x * i))
else
tmp = x * (18.0d0 * (y * (z * t)))
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) - (27.0 * (j * k));
double t_2 = 18.0 * (y * (t * (x * z)));
double tmp;
if (t <= -2.5e+246) {
tmp = x * (18.0 * (t * (y * z)));
} else if (t <= -1.75e+109) {
tmp = -4.0 * (t * a);
} else if (t <= 1.12e-142) {
tmp = t_1;
} else if (t <= 5.8e-89) {
tmp = t_2;
} else if (t <= 215000000.0) {
tmp = t_1;
} else if (t <= 4.2e+109) {
tmp = t_2;
} else if (t <= 5.1e+188) {
tmp = (b * c) - (4.0 * (x * i));
} else {
tmp = x * (18.0 * (y * (z * t)));
}
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) - (27.0 * (j * k)) t_2 = 18.0 * (y * (t * (x * z))) tmp = 0 if t <= -2.5e+246: tmp = x * (18.0 * (t * (y * z))) elif t <= -1.75e+109: tmp = -4.0 * (t * a) elif t <= 1.12e-142: tmp = t_1 elif t <= 5.8e-89: tmp = t_2 elif t <= 215000000.0: tmp = t_1 elif t <= 4.2e+109: tmp = t_2 elif t <= 5.1e+188: tmp = (b * c) - (4.0 * (x * i)) else: tmp = x * (18.0 * (y * (z * t))) 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(27.0 * Float64(j * k))) t_2 = Float64(18.0 * Float64(y * Float64(t * Float64(x * z)))) tmp = 0.0 if (t <= -2.5e+246) tmp = Float64(x * Float64(18.0 * Float64(t * Float64(y * z)))); elseif (t <= -1.75e+109) tmp = Float64(-4.0 * Float64(t * a)); elseif (t <= 1.12e-142) tmp = t_1; elseif (t <= 5.8e-89) tmp = t_2; elseif (t <= 215000000.0) tmp = t_1; elseif (t <= 4.2e+109) tmp = t_2; elseif (t <= 5.1e+188) tmp = Float64(Float64(b * c) - Float64(4.0 * Float64(x * i))); else tmp = Float64(x * Float64(18.0 * Float64(y * Float64(z * t)))); 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) - (27.0 * (j * k));
t_2 = 18.0 * (y * (t * (x * z)));
tmp = 0.0;
if (t <= -2.5e+246)
tmp = x * (18.0 * (t * (y * z)));
elseif (t <= -1.75e+109)
tmp = -4.0 * (t * a);
elseif (t <= 1.12e-142)
tmp = t_1;
elseif (t <= 5.8e-89)
tmp = t_2;
elseif (t <= 215000000.0)
tmp = t_1;
elseif (t <= 4.2e+109)
tmp = t_2;
elseif (t <= 5.1e+188)
tmp = (b * c) - (4.0 * (x * i));
else
tmp = x * (18.0 * (y * (z * t)));
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[(27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(18.0 * N[(y * N[(t * N[(x * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -2.5e+246], N[(x * N[(18.0 * N[(t * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, -1.75e+109], N[(-4.0 * N[(t * a), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.12e-142], t$95$1, If[LessEqual[t, 5.8e-89], t$95$2, If[LessEqual[t, 215000000.0], t$95$1, If[LessEqual[t, 4.2e+109], t$95$2, If[LessEqual[t, 5.1e+188], N[(N[(b * c), $MachinePrecision] - N[(4.0 * N[(x * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(18.0 * N[(y * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
t_1 := b \cdot c - 27 \cdot \left(j \cdot k\right)\\
t_2 := 18 \cdot \left(y \cdot \left(t \cdot \left(x \cdot z\right)\right)\right)\\
\mathbf{if}\;t \leq -2.5 \cdot 10^{+246}:\\
\;\;\;\;x \cdot \left(18 \cdot \left(t \cdot \left(y \cdot z\right)\right)\right)\\
\mathbf{elif}\;t \leq -1.75 \cdot 10^{+109}:\\
\;\;\;\;-4 \cdot \left(t \cdot a\right)\\
\mathbf{elif}\;t \leq 1.12 \cdot 10^{-142}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq 5.8 \cdot 10^{-89}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t \leq 215000000:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq 4.2 \cdot 10^{+109}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t \leq 5.1 \cdot 10^{+188}:\\
\;\;\;\;b \cdot c - 4 \cdot \left(x \cdot i\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(18 \cdot \left(y \cdot \left(z \cdot t\right)\right)\right)\\
\end{array}
\end{array}
if t < -2.49999999999999988e246Initial program 70.0%
sub-neg70.0%
associate-+l-70.0%
sub-neg70.0%
sub-neg70.0%
distribute-rgt-out--90.0%
associate-*l*80.0%
distribute-lft-neg-in80.0%
cancel-sign-sub80.0%
associate-*l*80.0%
associate-*l*80.0%
Simplified80.0%
Taylor expanded in x around inf 80.4%
Taylor expanded in y around inf 80.4%
*-commutative80.4%
associate-*r*80.4%
*-commutative80.4%
Simplified80.4%
if -2.49999999999999988e246 < t < -1.74999999999999992e109Initial program 94.1%
Taylor expanded in y around 0 85.1%
Taylor expanded in a around inf 60.2%
*-commutative60.2%
Simplified60.2%
if -1.74999999999999992e109 < t < 1.1199999999999999e-142 or 5.79999999999999984e-89 < t < 2.15e8Initial program 85.1%
sub-neg85.1%
associate-+l-85.1%
sub-neg85.1%
sub-neg85.1%
distribute-rgt-out--85.1%
associate-*l*84.4%
distribute-lft-neg-in84.4%
cancel-sign-sub84.4%
associate-*l*84.4%
associate-*l*84.4%
Simplified84.4%
Taylor expanded in i around 0 74.3%
Taylor expanded in c around inf 62.4%
if 1.1199999999999999e-142 < t < 5.79999999999999984e-89 or 2.15e8 < t < 4.2000000000000003e109Initial program 84.2%
sub-neg84.2%
associate-+l-84.2%
sub-neg84.2%
sub-neg84.2%
distribute-rgt-out--84.2%
associate-*l*81.1%
distribute-lft-neg-in81.1%
cancel-sign-sub81.1%
associate-*l*81.1%
associate-*l*81.1%
Simplified81.1%
Taylor expanded in x around inf 56.2%
Taylor expanded in y around inf 53.2%
associate-*r*53.2%
Simplified53.2%
Taylor expanded in y around 0 59.2%
if 4.2000000000000003e109 < t < 5.1000000000000002e188Initial program 76.5%
Taylor expanded in t around 0 60.1%
Taylor expanded in j around 0 49.1%
if 5.1000000000000002e188 < t Initial program 84.0%
sub-neg84.0%
associate-+l-84.0%
sub-neg84.0%
sub-neg84.0%
distribute-rgt-out--88.0%
associate-*l*87.9%
distribute-lft-neg-in87.9%
cancel-sign-sub87.9%
associate-*l*87.9%
associate-*l*83.9%
Simplified83.9%
Taylor expanded in x around inf 76.9%
Taylor expanded in y around inf 73.0%
Final simplification62.6%
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) (* 4.0 (* t a))) (* (* j 27.0) k))))
(if (<= z -3e+56)
(- (* 18.0 (* y (* t (* x z)))) (* 27.0 (* j k)))
(if (<= z 1.95e+49)
t_1
(if (<= z 9e+129)
(* t (- (* 18.0 (* y (* x z))) (* a 4.0)))
(if (<= z 6e+197)
t_1
(- (* k (* j -27.0)) (* y (* -18.0 (* x (* z t)))))))))))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) - (4.0 * (t * a))) - ((j * 27.0) * k);
double tmp;
if (z <= -3e+56) {
tmp = (18.0 * (y * (t * (x * z)))) - (27.0 * (j * k));
} else if (z <= 1.95e+49) {
tmp = t_1;
} else if (z <= 9e+129) {
tmp = t * ((18.0 * (y * (x * z))) - (a * 4.0));
} else if (z <= 6e+197) {
tmp = t_1;
} else {
tmp = (k * (j * -27.0)) - (y * (-18.0 * (x * (z * t))));
}
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) - (4.0d0 * (t * a))) - ((j * 27.0d0) * k)
if (z <= (-3d+56)) then
tmp = (18.0d0 * (y * (t * (x * z)))) - (27.0d0 * (j * k))
else if (z <= 1.95d+49) then
tmp = t_1
else if (z <= 9d+129) then
tmp = t * ((18.0d0 * (y * (x * z))) - (a * 4.0d0))
else if (z <= 6d+197) then
tmp = t_1
else
tmp = (k * (j * (-27.0d0))) - (y * ((-18.0d0) * (x * (z * t))))
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) - (4.0 * (t * a))) - ((j * 27.0) * k);
double tmp;
if (z <= -3e+56) {
tmp = (18.0 * (y * (t * (x * z)))) - (27.0 * (j * k));
} else if (z <= 1.95e+49) {
tmp = t_1;
} else if (z <= 9e+129) {
tmp = t * ((18.0 * (y * (x * z))) - (a * 4.0));
} else if (z <= 6e+197) {
tmp = t_1;
} else {
tmp = (k * (j * -27.0)) - (y * (-18.0 * (x * (z * t))));
}
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) - (4.0 * (t * a))) - ((j * 27.0) * k) tmp = 0 if z <= -3e+56: tmp = (18.0 * (y * (t * (x * z)))) - (27.0 * (j * k)) elif z <= 1.95e+49: tmp = t_1 elif z <= 9e+129: tmp = t * ((18.0 * (y * (x * z))) - (a * 4.0)) elif z <= 6e+197: tmp = t_1 else: tmp = (k * (j * -27.0)) - (y * (-18.0 * (x * (z * t)))) 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(b * c) - Float64(4.0 * Float64(t * a))) - Float64(Float64(j * 27.0) * k)) tmp = 0.0 if (z <= -3e+56) tmp = Float64(Float64(18.0 * Float64(y * Float64(t * Float64(x * z)))) - Float64(27.0 * Float64(j * k))); elseif (z <= 1.95e+49) tmp = t_1; elseif (z <= 9e+129) tmp = Float64(t * Float64(Float64(18.0 * Float64(y * Float64(x * z))) - Float64(a * 4.0))); elseif (z <= 6e+197) tmp = t_1; else tmp = Float64(Float64(k * Float64(j * -27.0)) - Float64(y * Float64(-18.0 * Float64(x * Float64(z * t))))); 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) - (4.0 * (t * a))) - ((j * 27.0) * k);
tmp = 0.0;
if (z <= -3e+56)
tmp = (18.0 * (y * (t * (x * z)))) - (27.0 * (j * k));
elseif (z <= 1.95e+49)
tmp = t_1;
elseif (z <= 9e+129)
tmp = t * ((18.0 * (y * (x * z))) - (a * 4.0));
elseif (z <= 6e+197)
tmp = t_1;
else
tmp = (k * (j * -27.0)) - (y * (-18.0 * (x * (z * t))));
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[(b * c), $MachinePrecision] - N[(4.0 * N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -3e+56], N[(N[(18.0 * N[(y * N[(t * N[(x * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.95e+49], t$95$1, If[LessEqual[z, 9e+129], N[(t * N[(N[(18.0 * N[(y * N[(x * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(a * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 6e+197], t$95$1, N[(N[(k * N[(j * -27.0), $MachinePrecision]), $MachinePrecision] - N[(y * N[(-18.0 * N[(x * N[(z * t), $MachinePrecision]), $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(b \cdot c - 4 \cdot \left(t \cdot a\right)\right) - \left(j \cdot 27\right) \cdot k\\
\mathbf{if}\;z \leq -3 \cdot 10^{+56}:\\
\;\;\;\;18 \cdot \left(y \cdot \left(t \cdot \left(x \cdot z\right)\right)\right) - 27 \cdot \left(j \cdot k\right)\\
\mathbf{elif}\;z \leq 1.95 \cdot 10^{+49}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 9 \cdot 10^{+129}:\\
\;\;\;\;t \cdot \left(18 \cdot \left(y \cdot \left(x \cdot z\right)\right) - a \cdot 4\right)\\
\mathbf{elif}\;z \leq 6 \cdot 10^{+197}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;k \cdot \left(j \cdot -27\right) - y \cdot \left(-18 \cdot \left(x \cdot \left(z \cdot t\right)\right)\right)\\
\end{array}
\end{array}
if z < -3.00000000000000006e56Initial program 76.3%
Taylor expanded in t around -inf 70.8%
Taylor expanded in a around 0 68.6%
if -3.00000000000000006e56 < z < 1.95e49 or 9.0000000000000003e129 < z < 6.0000000000000004e197Initial program 89.4%
Taylor expanded in x around 0 73.6%
if 1.95e49 < z < 9.0000000000000003e129Initial program 77.8%
sub-neg77.8%
associate-+l-77.8%
sub-neg77.8%
sub-neg77.8%
distribute-rgt-out--83.3%
associate-*l*83.3%
distribute-lft-neg-in83.3%
cancel-sign-sub83.3%
associate-*l*83.3%
associate-*l*77.8%
Simplified77.8%
Taylor expanded in t around inf 67.2%
if 6.0000000000000004e197 < z Initial program 79.7%
Taylor expanded in t around -inf 73.1%
Taylor expanded in y around inf 76.5%
associate-*r*76.4%
*-commutative76.4%
associate-*r*73.1%
*-commutative73.1%
*-commutative73.1%
Simplified73.1%
sub-neg73.1%
mul-1-neg73.1%
*-commutative73.1%
associate-*l*73.2%
associate-*l*73.2%
Applied egg-rr73.2%
+-commutative73.2%
unsub-neg73.2%
associate-*r*73.2%
distribute-lft-neg-out73.2%
*-commutative73.2%
distribute-rgt-neg-in73.2%
metadata-eval73.2%
associate-*r*73.1%
associate-*r*76.4%
associate-*l*76.5%
*-commutative76.5%
associate-*l*76.5%
associate-*r*76.5%
*-commutative76.5%
Simplified76.5%
Final simplification72.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 (<= t -4.5e-69) (not (<= t 6.2e-164))) (- (* t (- (* 18.0 (* y (* x z))) (* a 4.0))) (* 27.0 (* j k))) (- (- (* b c) (* 4.0 (* 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 <= -4.5e-69) || !(t <= 6.2e-164)) {
tmp = (t * ((18.0 * (y * (x * z))) - (a * 4.0))) - (27.0 * (j * k));
} else {
tmp = ((b * c) - (4.0 * (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 <= (-4.5d-69)) .or. (.not. (t <= 6.2d-164))) then
tmp = (t * ((18.0d0 * (y * (x * z))) - (a * 4.0d0))) - (27.0d0 * (j * k))
else
tmp = ((b * c) - (4.0d0 * (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 <= -4.5e-69) || !(t <= 6.2e-164)) {
tmp = (t * ((18.0 * (y * (x * z))) - (a * 4.0))) - (27.0 * (j * k));
} else {
tmp = ((b * c) - (4.0 * (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 <= -4.5e-69) or not (t <= 6.2e-164): tmp = (t * ((18.0 * (y * (x * z))) - (a * 4.0))) - (27.0 * (j * k)) else: tmp = ((b * c) - (4.0 * (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 <= -4.5e-69) || !(t <= 6.2e-164)) tmp = Float64(Float64(t * Float64(Float64(18.0 * Float64(y * Float64(x * z))) - Float64(a * 4.0))) - Float64(27.0 * Float64(j * k))); else tmp = Float64(Float64(Float64(b * c) - Float64(4.0 * 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 <= -4.5e-69) || ~((t <= 6.2e-164)))
tmp = (t * ((18.0 * (y * (x * z))) - (a * 4.0))) - (27.0 * (j * k));
else
tmp = ((b * c) - (4.0 * (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, -4.5e-69], N[Not[LessEqual[t, 6.2e-164]], $MachinePrecision]], N[(N[(t * N[(N[(18.0 * N[(y * N[(x * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(a * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(b * c), $MachinePrecision] - N[(4.0 * N[(x * i), $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 -4.5 \cdot 10^{-69} \lor \neg \left(t \leq 6.2 \cdot 10^{-164}\right):\\
\;\;\;\;t \cdot \left(18 \cdot \left(y \cdot \left(x \cdot z\right)\right) - a \cdot 4\right) - 27 \cdot \left(j \cdot k\right)\\
\mathbf{else}:\\
\;\;\;\;\left(b \cdot c - 4 \cdot \left(x \cdot i\right)\right) - \left(j \cdot 27\right) \cdot k\\
\end{array}
\end{array}
if t < -4.50000000000000009e-69 or 6.2000000000000001e-164 < t Initial program 83.6%
sub-neg83.6%
associate-+l-83.6%
sub-neg83.6%
sub-neg83.6%
distribute-rgt-out--86.4%
associate-*l*85.7%
distribute-lft-neg-in85.7%
cancel-sign-sub85.7%
associate-*l*85.7%
associate-*l*85.1%
Simplified85.1%
Taylor expanded in i around 0 85.9%
Taylor expanded in c around 0 79.7%
if -4.50000000000000009e-69 < t < 6.2000000000000001e-164Initial program 88.1%
Taylor expanded in t around 0 91.6%
Final simplification83.2%
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 (* y (* x z))) (t_2 (* (* j 27.0) k)))
(if (<= t -1.72e-69)
(- (* t (- (* 18.0 t_1) (* a 4.0))) (* 27.0 (* j k)))
(if (<= t 6.2e-164)
(- (- (* b c) (* 4.0 (* x i))) t_2)
(- (* t (- (* a -4.0) (* -18.0 t_1))) t_2)))))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 = y * (x * z);
double t_2 = (j * 27.0) * k;
double tmp;
if (t <= -1.72e-69) {
tmp = (t * ((18.0 * t_1) - (a * 4.0))) - (27.0 * (j * k));
} else if (t <= 6.2e-164) {
tmp = ((b * c) - (4.0 * (x * i))) - t_2;
} else {
tmp = (t * ((a * -4.0) - (-18.0 * t_1))) - t_2;
}
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 = y * (x * z)
t_2 = (j * 27.0d0) * k
if (t <= (-1.72d-69)) then
tmp = (t * ((18.0d0 * t_1) - (a * 4.0d0))) - (27.0d0 * (j * k))
else if (t <= 6.2d-164) then
tmp = ((b * c) - (4.0d0 * (x * i))) - t_2
else
tmp = (t * ((a * (-4.0d0)) - ((-18.0d0) * t_1))) - t_2
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 = y * (x * z);
double t_2 = (j * 27.0) * k;
double tmp;
if (t <= -1.72e-69) {
tmp = (t * ((18.0 * t_1) - (a * 4.0))) - (27.0 * (j * k));
} else if (t <= 6.2e-164) {
tmp = ((b * c) - (4.0 * (x * i))) - t_2;
} else {
tmp = (t * ((a * -4.0) - (-18.0 * t_1))) - t_2;
}
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 = y * (x * z) t_2 = (j * 27.0) * k tmp = 0 if t <= -1.72e-69: tmp = (t * ((18.0 * t_1) - (a * 4.0))) - (27.0 * (j * k)) elif t <= 6.2e-164: tmp = ((b * c) - (4.0 * (x * i))) - t_2 else: tmp = (t * ((a * -4.0) - (-18.0 * t_1))) - t_2 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(y * Float64(x * z)) t_2 = Float64(Float64(j * 27.0) * k) tmp = 0.0 if (t <= -1.72e-69) tmp = Float64(Float64(t * Float64(Float64(18.0 * t_1) - Float64(a * 4.0))) - Float64(27.0 * Float64(j * k))); elseif (t <= 6.2e-164) tmp = Float64(Float64(Float64(b * c) - Float64(4.0 * Float64(x * i))) - t_2); else tmp = Float64(Float64(t * Float64(Float64(a * -4.0) - Float64(-18.0 * t_1))) - t_2); 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 = y * (x * z);
t_2 = (j * 27.0) * k;
tmp = 0.0;
if (t <= -1.72e-69)
tmp = (t * ((18.0 * t_1) - (a * 4.0))) - (27.0 * (j * k));
elseif (t <= 6.2e-164)
tmp = ((b * c) - (4.0 * (x * i))) - t_2;
else
tmp = (t * ((a * -4.0) - (-18.0 * t_1))) - t_2;
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[(y * N[(x * z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]}, If[LessEqual[t, -1.72e-69], N[(N[(t * N[(N[(18.0 * t$95$1), $MachinePrecision] - N[(a * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 6.2e-164], N[(N[(N[(b * c), $MachinePrecision] - N[(4.0 * N[(x * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$2), $MachinePrecision], N[(N[(t * N[(N[(a * -4.0), $MachinePrecision] - N[(-18.0 * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$2), $MachinePrecision]]]]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
t_1 := y \cdot \left(x \cdot z\right)\\
t_2 := \left(j \cdot 27\right) \cdot k\\
\mathbf{if}\;t \leq -1.72 \cdot 10^{-69}:\\
\;\;\;\;t \cdot \left(18 \cdot t_1 - a \cdot 4\right) - 27 \cdot \left(j \cdot k\right)\\
\mathbf{elif}\;t \leq 6.2 \cdot 10^{-164}:\\
\;\;\;\;\left(b \cdot c - 4 \cdot \left(x \cdot i\right)\right) - t_2\\
\mathbf{else}:\\
\;\;\;\;t \cdot \left(a \cdot -4 - -18 \cdot t_1\right) - t_2\\
\end{array}
\end{array}
if t < -1.72e-69Initial program 87.6%
sub-neg87.6%
associate-+l-87.6%
sub-neg87.6%
sub-neg87.6%
distribute-rgt-out--91.0%
associate-*l*90.7%
distribute-lft-neg-in90.7%
cancel-sign-sub90.7%
associate-*l*90.7%
associate-*l*90.7%
Simplified90.7%
Taylor expanded in i around 0 85.5%
Taylor expanded in c around 0 79.1%
if -1.72e-69 < t < 6.2000000000000001e-164Initial program 88.1%
Taylor expanded in t around 0 91.6%
if 6.2000000000000001e-164 < t Initial program 79.8%
Taylor expanded in t around -inf 80.2%
Final simplification83.2%
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 (- (* b c) t_1))
(t_3 (- (* -4.0 (* t a)) t_1)))
(if (<= t -3.7e-75)
t_3
(if (<= t 7.5e-143)
t_2
(if (<= t 5.5e-89)
(* 18.0 (* y (* t (* x z))))
(if (<= t 3.5e-59)
t_2
(if (<= t 8.4e+217) t_3 (* x (* 18.0 (* t (* 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 t_1 = 27.0 * (j * k);
double t_2 = (b * c) - t_1;
double t_3 = (-4.0 * (t * a)) - t_1;
double tmp;
if (t <= -3.7e-75) {
tmp = t_3;
} else if (t <= 7.5e-143) {
tmp = t_2;
} else if (t <= 5.5e-89) {
tmp = 18.0 * (y * (t * (x * z)));
} else if (t <= 3.5e-59) {
tmp = t_2;
} else if (t <= 8.4e+217) {
tmp = t_3;
} else {
tmp = x * (18.0 * (t * (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) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_1 = 27.0d0 * (j * k)
t_2 = (b * c) - t_1
t_3 = ((-4.0d0) * (t * a)) - t_1
if (t <= (-3.7d-75)) then
tmp = t_3
else if (t <= 7.5d-143) then
tmp = t_2
else if (t <= 5.5d-89) then
tmp = 18.0d0 * (y * (t * (x * z)))
else if (t <= 3.5d-59) then
tmp = t_2
else if (t <= 8.4d+217) then
tmp = t_3
else
tmp = x * (18.0d0 * (t * (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 t_1 = 27.0 * (j * k);
double t_2 = (b * c) - t_1;
double t_3 = (-4.0 * (t * a)) - t_1;
double tmp;
if (t <= -3.7e-75) {
tmp = t_3;
} else if (t <= 7.5e-143) {
tmp = t_2;
} else if (t <= 5.5e-89) {
tmp = 18.0 * (y * (t * (x * z)));
} else if (t <= 3.5e-59) {
tmp = t_2;
} else if (t <= 8.4e+217) {
tmp = t_3;
} else {
tmp = x * (18.0 * (t * (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): t_1 = 27.0 * (j * k) t_2 = (b * c) - t_1 t_3 = (-4.0 * (t * a)) - t_1 tmp = 0 if t <= -3.7e-75: tmp = t_3 elif t <= 7.5e-143: tmp = t_2 elif t <= 5.5e-89: tmp = 18.0 * (y * (t * (x * z))) elif t <= 3.5e-59: tmp = t_2 elif t <= 8.4e+217: tmp = t_3 else: tmp = x * (18.0 * (t * (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) t_1 = Float64(27.0 * Float64(j * k)) t_2 = Float64(Float64(b * c) - t_1) t_3 = Float64(Float64(-4.0 * Float64(t * a)) - t_1) tmp = 0.0 if (t <= -3.7e-75) tmp = t_3; elseif (t <= 7.5e-143) tmp = t_2; elseif (t <= 5.5e-89) tmp = Float64(18.0 * Float64(y * Float64(t * Float64(x * z)))); elseif (t <= 3.5e-59) tmp = t_2; elseif (t <= 8.4e+217) tmp = t_3; else tmp = Float64(x * Float64(18.0 * Float64(t * 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)
t_1 = 27.0 * (j * k);
t_2 = (b * c) - t_1;
t_3 = (-4.0 * (t * a)) - t_1;
tmp = 0.0;
if (t <= -3.7e-75)
tmp = t_3;
elseif (t <= 7.5e-143)
tmp = t_2;
elseif (t <= 5.5e-89)
tmp = 18.0 * (y * (t * (x * z)));
elseif (t <= 3.5e-59)
tmp = t_2;
elseif (t <= 8.4e+217)
tmp = t_3;
else
tmp = x * (18.0 * (t * (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_] := Block[{t$95$1 = N[(27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(b * c), $MachinePrecision] - t$95$1), $MachinePrecision]}, Block[{t$95$3 = N[(N[(-4.0 * N[(t * a), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision]}, If[LessEqual[t, -3.7e-75], t$95$3, If[LessEqual[t, 7.5e-143], t$95$2, If[LessEqual[t, 5.5e-89], N[(18.0 * N[(y * N[(t * N[(x * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 3.5e-59], t$95$2, If[LessEqual[t, 8.4e+217], t$95$3, N[(x * N[(18.0 * N[(t * 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}
t_1 := 27 \cdot \left(j \cdot k\right)\\
t_2 := b \cdot c - t_1\\
t_3 := -4 \cdot \left(t \cdot a\right) - t_1\\
\mathbf{if}\;t \leq -3.7 \cdot 10^{-75}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;t \leq 7.5 \cdot 10^{-143}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t \leq 5.5 \cdot 10^{-89}:\\
\;\;\;\;18 \cdot \left(y \cdot \left(t \cdot \left(x \cdot z\right)\right)\right)\\
\mathbf{elif}\;t \leq 3.5 \cdot 10^{-59}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t \leq 8.4 \cdot 10^{+217}:\\
\;\;\;\;t_3\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(18 \cdot \left(t \cdot \left(y \cdot z\right)\right)\right)\\
\end{array}
\end{array}
if t < -3.70000000000000024e-75 or 3.5000000000000001e-59 < t < 8.4000000000000003e217Initial program 84.7%
Taylor expanded in t around -inf 79.6%
Taylor expanded in y around 0 57.1%
if -3.70000000000000024e-75 < t < 7.5000000000000003e-143 or 5.50000000000000012e-89 < t < 3.5000000000000001e-59Initial program 84.9%
sub-neg84.9%
associate-+l-84.9%
sub-neg84.9%
sub-neg84.9%
distribute-rgt-out--84.9%
associate-*l*82.5%
distribute-lft-neg-in82.5%
cancel-sign-sub82.5%
associate-*l*82.5%
associate-*l*82.5%
Simplified82.5%
Taylor expanded in i around 0 70.3%
Taylor expanded in c around inf 71.4%
if 7.5000000000000003e-143 < t < 5.50000000000000012e-89Initial program 80.6%
sub-neg80.6%
associate-+l-80.6%
sub-neg80.6%
sub-neg80.6%
distribute-rgt-out--80.6%
associate-*l*71.2%
distribute-lft-neg-in71.2%
cancel-sign-sub71.2%
associate-*l*71.2%
associate-*l*71.2%
Simplified71.2%
Taylor expanded in x around inf 71.2%
Taylor expanded in y around inf 61.6%
associate-*r*61.6%
Simplified61.6%
Taylor expanded in y around 0 70.8%
if 8.4000000000000003e217 < t Initial program 89.5%
sub-neg89.5%
associate-+l-89.5%
sub-neg89.5%
sub-neg89.5%
distribute-rgt-out--94.7%
associate-*l*94.7%
distribute-lft-neg-in94.7%
cancel-sign-sub94.7%
associate-*l*94.7%
associate-*l*89.4%
Simplified89.4%
Taylor expanded in x around inf 74.6%
Taylor expanded in y around inf 69.6%
*-commutative69.6%
associate-*r*69.6%
*-commutative69.6%
Simplified69.6%
Final simplification63.2%
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) (* 27.0 (* j k))))
(t_2 (- (* -4.0 (* t a)) (* (* j 27.0) k))))
(if (<= t -1.55e-83)
t_2
(if (<= t 1.12e-142)
t_1
(if (<= t 5.5e-89)
(* 18.0 (* y (* t (* x z))))
(if (<= t 4e-59)
t_1
(if (<= t 7.8e+217) t_2 (* x (* 18.0 (* t (* 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 t_1 = (b * c) - (27.0 * (j * k));
double t_2 = (-4.0 * (t * a)) - ((j * 27.0) * k);
double tmp;
if (t <= -1.55e-83) {
tmp = t_2;
} else if (t <= 1.12e-142) {
tmp = t_1;
} else if (t <= 5.5e-89) {
tmp = 18.0 * (y * (t * (x * z)));
} else if (t <= 4e-59) {
tmp = t_1;
} else if (t <= 7.8e+217) {
tmp = t_2;
} else {
tmp = x * (18.0 * (t * (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) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (b * c) - (27.0d0 * (j * k))
t_2 = ((-4.0d0) * (t * a)) - ((j * 27.0d0) * k)
if (t <= (-1.55d-83)) then
tmp = t_2
else if (t <= 1.12d-142) then
tmp = t_1
else if (t <= 5.5d-89) then
tmp = 18.0d0 * (y * (t * (x * z)))
else if (t <= 4d-59) then
tmp = t_1
else if (t <= 7.8d+217) then
tmp = t_2
else
tmp = x * (18.0d0 * (t * (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 t_1 = (b * c) - (27.0 * (j * k));
double t_2 = (-4.0 * (t * a)) - ((j * 27.0) * k);
double tmp;
if (t <= -1.55e-83) {
tmp = t_2;
} else if (t <= 1.12e-142) {
tmp = t_1;
} else if (t <= 5.5e-89) {
tmp = 18.0 * (y * (t * (x * z)));
} else if (t <= 4e-59) {
tmp = t_1;
} else if (t <= 7.8e+217) {
tmp = t_2;
} else {
tmp = x * (18.0 * (t * (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): t_1 = (b * c) - (27.0 * (j * k)) t_2 = (-4.0 * (t * a)) - ((j * 27.0) * k) tmp = 0 if t <= -1.55e-83: tmp = t_2 elif t <= 1.12e-142: tmp = t_1 elif t <= 5.5e-89: tmp = 18.0 * (y * (t * (x * z))) elif t <= 4e-59: tmp = t_1 elif t <= 7.8e+217: tmp = t_2 else: tmp = x * (18.0 * (t * (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) t_1 = Float64(Float64(b * c) - Float64(27.0 * Float64(j * k))) t_2 = Float64(Float64(-4.0 * Float64(t * a)) - Float64(Float64(j * 27.0) * k)) tmp = 0.0 if (t <= -1.55e-83) tmp = t_2; elseif (t <= 1.12e-142) tmp = t_1; elseif (t <= 5.5e-89) tmp = Float64(18.0 * Float64(y * Float64(t * Float64(x * z)))); elseif (t <= 4e-59) tmp = t_1; elseif (t <= 7.8e+217) tmp = t_2; else tmp = Float64(x * Float64(18.0 * Float64(t * 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)
t_1 = (b * c) - (27.0 * (j * k));
t_2 = (-4.0 * (t * a)) - ((j * 27.0) * k);
tmp = 0.0;
if (t <= -1.55e-83)
tmp = t_2;
elseif (t <= 1.12e-142)
tmp = t_1;
elseif (t <= 5.5e-89)
tmp = 18.0 * (y * (t * (x * z)));
elseif (t <= 4e-59)
tmp = t_1;
elseif (t <= 7.8e+217)
tmp = t_2;
else
tmp = x * (18.0 * (t * (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_] := Block[{t$95$1 = N[(N[(b * c), $MachinePrecision] - N[(27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(-4.0 * N[(t * a), $MachinePrecision]), $MachinePrecision] - N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -1.55e-83], t$95$2, If[LessEqual[t, 1.12e-142], t$95$1, If[LessEqual[t, 5.5e-89], N[(18.0 * N[(y * N[(t * N[(x * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 4e-59], t$95$1, If[LessEqual[t, 7.8e+217], t$95$2, N[(x * N[(18.0 * N[(t * 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}
t_1 := b \cdot c - 27 \cdot \left(j \cdot k\right)\\
t_2 := -4 \cdot \left(t \cdot a\right) - \left(j \cdot 27\right) \cdot k\\
\mathbf{if}\;t \leq -1.55 \cdot 10^{-83}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t \leq 1.12 \cdot 10^{-142}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq 5.5 \cdot 10^{-89}:\\
\;\;\;\;18 \cdot \left(y \cdot \left(t \cdot \left(x \cdot z\right)\right)\right)\\
\mathbf{elif}\;t \leq 4 \cdot 10^{-59}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq 7.8 \cdot 10^{+217}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(18 \cdot \left(t \cdot \left(y \cdot z\right)\right)\right)\\
\end{array}
\end{array}
if t < -1.54999999999999996e-83 or 4.0000000000000001e-59 < t < 7.79999999999999986e217Initial program 84.7%
Taylor expanded in t around -inf 79.6%
Taylor expanded in y around 0 57.1%
*-commutative57.1%
*-commutative57.1%
*-commutative57.1%
associate-*l*57.1%
Simplified57.1%
sub-neg57.1%
mul-1-neg57.1%
associate-*r*57.1%
*-commutative57.1%
associate-*l*57.1%
Applied egg-rr57.1%
unsub-neg57.1%
distribute-lft-neg-in57.1%
metadata-eval57.1%
*-commutative57.1%
associate-*r*57.1%
*-commutative57.1%
Applied egg-rr57.1%
if -1.54999999999999996e-83 < t < 1.1199999999999999e-142 or 5.50000000000000012e-89 < t < 4.0000000000000001e-59Initial program 84.9%
sub-neg84.9%
associate-+l-84.9%
sub-neg84.9%
sub-neg84.9%
distribute-rgt-out--84.9%
associate-*l*82.5%
distribute-lft-neg-in82.5%
cancel-sign-sub82.5%
associate-*l*82.5%
associate-*l*82.5%
Simplified82.5%
Taylor expanded in i around 0 70.3%
Taylor expanded in c around inf 71.4%
if 1.1199999999999999e-142 < t < 5.50000000000000012e-89Initial program 80.6%
sub-neg80.6%
associate-+l-80.6%
sub-neg80.6%
sub-neg80.6%
distribute-rgt-out--80.6%
associate-*l*71.2%
distribute-lft-neg-in71.2%
cancel-sign-sub71.2%
associate-*l*71.2%
associate-*l*71.2%
Simplified71.2%
Taylor expanded in x around inf 71.2%
Taylor expanded in y around inf 61.6%
associate-*r*61.6%
Simplified61.6%
Taylor expanded in y around 0 70.8%
if 7.79999999999999986e217 < t Initial program 89.5%
sub-neg89.5%
associate-+l-89.5%
sub-neg89.5%
sub-neg89.5%
distribute-rgt-out--94.7%
associate-*l*94.7%
distribute-lft-neg-in94.7%
cancel-sign-sub94.7%
associate-*l*94.7%
associate-*l*89.4%
Simplified89.4%
Taylor expanded in x around inf 74.6%
Taylor expanded in y around inf 69.6%
*-commutative69.6%
associate-*r*69.6%
*-commutative69.6%
Simplified69.6%
Final simplification63.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
(let* ((t_1 (* -4.0 (* t a))) (t_2 (* 27.0 (* j k))))
(if (<= y -7e+171)
(* x (* 18.0 (* y (* z t))))
(if (<= y -7.2e-28)
(- (* b c) t_2)
(if (<= y -1.2e-290)
(- t_1 (* (* j 27.0) k))
(if (<= y 2.1e-44)
(- (* 27.0 (- (* j k))) (* 4.0 (* x i)))
(if (<= y 3e-6) (- t_1 t_2) (* 18.0 (* y (* t (* x 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 t_1 = -4.0 * (t * a);
double t_2 = 27.0 * (j * k);
double tmp;
if (y <= -7e+171) {
tmp = x * (18.0 * (y * (z * t)));
} else if (y <= -7.2e-28) {
tmp = (b * c) - t_2;
} else if (y <= -1.2e-290) {
tmp = t_1 - ((j * 27.0) * k);
} else if (y <= 2.1e-44) {
tmp = (27.0 * -(j * k)) - (4.0 * (x * i));
} else if (y <= 3e-6) {
tmp = t_1 - t_2;
} else {
tmp = 18.0 * (y * (t * (x * 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) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (-4.0d0) * (t * a)
t_2 = 27.0d0 * (j * k)
if (y <= (-7d+171)) then
tmp = x * (18.0d0 * (y * (z * t)))
else if (y <= (-7.2d-28)) then
tmp = (b * c) - t_2
else if (y <= (-1.2d-290)) then
tmp = t_1 - ((j * 27.0d0) * k)
else if (y <= 2.1d-44) then
tmp = (27.0d0 * -(j * k)) - (4.0d0 * (x * i))
else if (y <= 3d-6) then
tmp = t_1 - t_2
else
tmp = 18.0d0 * (y * (t * (x * 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 t_1 = -4.0 * (t * a);
double t_2 = 27.0 * (j * k);
double tmp;
if (y <= -7e+171) {
tmp = x * (18.0 * (y * (z * t)));
} else if (y <= -7.2e-28) {
tmp = (b * c) - t_2;
} else if (y <= -1.2e-290) {
tmp = t_1 - ((j * 27.0) * k);
} else if (y <= 2.1e-44) {
tmp = (27.0 * -(j * k)) - (4.0 * (x * i));
} else if (y <= 3e-6) {
tmp = t_1 - t_2;
} else {
tmp = 18.0 * (y * (t * (x * 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): t_1 = -4.0 * (t * a) t_2 = 27.0 * (j * k) tmp = 0 if y <= -7e+171: tmp = x * (18.0 * (y * (z * t))) elif y <= -7.2e-28: tmp = (b * c) - t_2 elif y <= -1.2e-290: tmp = t_1 - ((j * 27.0) * k) elif y <= 2.1e-44: tmp = (27.0 * -(j * k)) - (4.0 * (x * i)) elif y <= 3e-6: tmp = t_1 - t_2 else: tmp = 18.0 * (y * (t * (x * 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) t_1 = Float64(-4.0 * Float64(t * a)) t_2 = Float64(27.0 * Float64(j * k)) tmp = 0.0 if (y <= -7e+171) tmp = Float64(x * Float64(18.0 * Float64(y * Float64(z * t)))); elseif (y <= -7.2e-28) tmp = Float64(Float64(b * c) - t_2); elseif (y <= -1.2e-290) tmp = Float64(t_1 - Float64(Float64(j * 27.0) * k)); elseif (y <= 2.1e-44) tmp = Float64(Float64(27.0 * Float64(-Float64(j * k))) - Float64(4.0 * Float64(x * i))); elseif (y <= 3e-6) tmp = Float64(t_1 - t_2); else tmp = Float64(18.0 * Float64(y * Float64(t * Float64(x * 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)
t_1 = -4.0 * (t * a);
t_2 = 27.0 * (j * k);
tmp = 0.0;
if (y <= -7e+171)
tmp = x * (18.0 * (y * (z * t)));
elseif (y <= -7.2e-28)
tmp = (b * c) - t_2;
elseif (y <= -1.2e-290)
tmp = t_1 - ((j * 27.0) * k);
elseif (y <= 2.1e-44)
tmp = (27.0 * -(j * k)) - (4.0 * (x * i));
elseif (y <= 3e-6)
tmp = t_1 - t_2;
else
tmp = 18.0 * (y * (t * (x * 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_] := Block[{t$95$1 = N[(-4.0 * N[(t * a), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -7e+171], N[(x * N[(18.0 * N[(y * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -7.2e-28], N[(N[(b * c), $MachinePrecision] - t$95$2), $MachinePrecision], If[LessEqual[y, -1.2e-290], N[(t$95$1 - N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.1e-44], N[(N[(27.0 * (-N[(j * k), $MachinePrecision])), $MachinePrecision] - N[(4.0 * N[(x * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 3e-6], N[(t$95$1 - t$95$2), $MachinePrecision], N[(18.0 * N[(y * N[(t * N[(x * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
t_1 := -4 \cdot \left(t \cdot a\right)\\
t_2 := 27 \cdot \left(j \cdot k\right)\\
\mathbf{if}\;y \leq -7 \cdot 10^{+171}:\\
\;\;\;\;x \cdot \left(18 \cdot \left(y \cdot \left(z \cdot t\right)\right)\right)\\
\mathbf{elif}\;y \leq -7.2 \cdot 10^{-28}:\\
\;\;\;\;b \cdot c - t_2\\
\mathbf{elif}\;y \leq -1.2 \cdot 10^{-290}:\\
\;\;\;\;t_1 - \left(j \cdot 27\right) \cdot k\\
\mathbf{elif}\;y \leq 2.1 \cdot 10^{-44}:\\
\;\;\;\;27 \cdot \left(-j \cdot k\right) - 4 \cdot \left(x \cdot i\right)\\
\mathbf{elif}\;y \leq 3 \cdot 10^{-6}:\\
\;\;\;\;t_1 - t_2\\
\mathbf{else}:\\
\;\;\;\;18 \cdot \left(y \cdot \left(t \cdot \left(x \cdot z\right)\right)\right)\\
\end{array}
\end{array}
if y < -6.9999999999999999e171Initial program 64.1%
sub-neg64.1%
associate-+l-64.1%
sub-neg64.1%
sub-neg64.1%
distribute-rgt-out--73.2%
associate-*l*68.8%
distribute-lft-neg-in68.8%
cancel-sign-sub68.8%
associate-*l*68.8%
associate-*l*68.7%
Simplified68.7%
Taylor expanded in x around inf 64.6%
Taylor expanded in y around inf 64.8%
if -6.9999999999999999e171 < y < -7.1999999999999997e-28Initial program 86.6%
sub-neg86.6%
associate-+l-86.6%
sub-neg86.6%
sub-neg86.6%
distribute-rgt-out--86.6%
associate-*l*86.5%
distribute-lft-neg-in86.5%
cancel-sign-sub86.5%
associate-*l*86.5%
associate-*l*83.7%
Simplified83.7%
Taylor expanded in i around 0 89.3%
Taylor expanded in c around inf 67.1%
if -7.1999999999999997e-28 < y < -1.2e-290Initial program 92.8%
Taylor expanded in t around -inf 70.8%
Taylor expanded in y around 0 64.2%
*-commutative64.2%
*-commutative64.2%
*-commutative64.2%
associate-*l*64.2%
Simplified64.2%
sub-neg64.2%
mul-1-neg64.2%
associate-*r*64.2%
*-commutative64.2%
associate-*l*64.2%
Applied egg-rr64.2%
unsub-neg64.2%
distribute-lft-neg-in64.2%
metadata-eval64.2%
*-commutative64.2%
associate-*r*64.2%
*-commutative64.2%
Applied egg-rr64.2%
if -1.2e-290 < y < 2.10000000000000001e-44Initial program 92.9%
Taylor expanded in t around 0 74.5%
Taylor expanded in c around 0 64.3%
if 2.10000000000000001e-44 < y < 3.0000000000000001e-6Initial program 77.8%
Taylor expanded in t around -inf 67.9%
Taylor expanded in y around 0 68.0%
if 3.0000000000000001e-6 < y Initial program 79.2%
sub-neg79.2%
associate-+l-79.2%
sub-neg79.2%
sub-neg79.2%
distribute-rgt-out--80.5%
associate-*l*78.0%
distribute-lft-neg-in78.0%
cancel-sign-sub78.0%
associate-*l*78.0%
associate-*l*78.0%
Simplified78.0%
Taylor expanded in x around inf 55.0%
Taylor expanded in y around inf 47.4%
associate-*r*47.4%
Simplified47.4%
Taylor expanded in y around 0 47.3%
Final simplification59.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
(let* ((t_1 (* -4.0 (* t a))) (t_2 (- (* b c) (* 4.0 (* x i)))))
(if (<= j -1.18e+170)
(* k (* j -27.0))
(if (<= j -1.26e+33)
t_2
(if (<= j -4e-26)
t_1
(if (<= j -8.5e-241)
t_2
(if (<= j -3e-295)
t_1
(if (<= j 2.8e-276)
(* -4.0 (* x i))
(if (<= j 3.1e-37) t_1 (* -27.0 (* j 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 t_1 = -4.0 * (t * a);
double t_2 = (b * c) - (4.0 * (x * i));
double tmp;
if (j <= -1.18e+170) {
tmp = k * (j * -27.0);
} else if (j <= -1.26e+33) {
tmp = t_2;
} else if (j <= -4e-26) {
tmp = t_1;
} else if (j <= -8.5e-241) {
tmp = t_2;
} else if (j <= -3e-295) {
tmp = t_1;
} else if (j <= 2.8e-276) {
tmp = -4.0 * (x * i);
} else if (j <= 3.1e-37) {
tmp = t_1;
} else {
tmp = -27.0 * (j * 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) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (-4.0d0) * (t * a)
t_2 = (b * c) - (4.0d0 * (x * i))
if (j <= (-1.18d+170)) then
tmp = k * (j * (-27.0d0))
else if (j <= (-1.26d+33)) then
tmp = t_2
else if (j <= (-4d-26)) then
tmp = t_1
else if (j <= (-8.5d-241)) then
tmp = t_2
else if (j <= (-3d-295)) then
tmp = t_1
else if (j <= 2.8d-276) then
tmp = (-4.0d0) * (x * i)
else if (j <= 3.1d-37) then
tmp = t_1
else
tmp = (-27.0d0) * (j * 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 t_1 = -4.0 * (t * a);
double t_2 = (b * c) - (4.0 * (x * i));
double tmp;
if (j <= -1.18e+170) {
tmp = k * (j * -27.0);
} else if (j <= -1.26e+33) {
tmp = t_2;
} else if (j <= -4e-26) {
tmp = t_1;
} else if (j <= -8.5e-241) {
tmp = t_2;
} else if (j <= -3e-295) {
tmp = t_1;
} else if (j <= 2.8e-276) {
tmp = -4.0 * (x * i);
} else if (j <= 3.1e-37) {
tmp = t_1;
} else {
tmp = -27.0 * (j * 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): t_1 = -4.0 * (t * a) t_2 = (b * c) - (4.0 * (x * i)) tmp = 0 if j <= -1.18e+170: tmp = k * (j * -27.0) elif j <= -1.26e+33: tmp = t_2 elif j <= -4e-26: tmp = t_1 elif j <= -8.5e-241: tmp = t_2 elif j <= -3e-295: tmp = t_1 elif j <= 2.8e-276: tmp = -4.0 * (x * i) elif j <= 3.1e-37: tmp = t_1 else: tmp = -27.0 * (j * 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) t_1 = Float64(-4.0 * Float64(t * a)) t_2 = Float64(Float64(b * c) - Float64(4.0 * Float64(x * i))) tmp = 0.0 if (j <= -1.18e+170) tmp = Float64(k * Float64(j * -27.0)); elseif (j <= -1.26e+33) tmp = t_2; elseif (j <= -4e-26) tmp = t_1; elseif (j <= -8.5e-241) tmp = t_2; elseif (j <= -3e-295) tmp = t_1; elseif (j <= 2.8e-276) tmp = Float64(-4.0 * Float64(x * i)); elseif (j <= 3.1e-37) tmp = t_1; else tmp = Float64(-27.0 * Float64(j * 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)
t_1 = -4.0 * (t * a);
t_2 = (b * c) - (4.0 * (x * i));
tmp = 0.0;
if (j <= -1.18e+170)
tmp = k * (j * -27.0);
elseif (j <= -1.26e+33)
tmp = t_2;
elseif (j <= -4e-26)
tmp = t_1;
elseif (j <= -8.5e-241)
tmp = t_2;
elseif (j <= -3e-295)
tmp = t_1;
elseif (j <= 2.8e-276)
tmp = -4.0 * (x * i);
elseif (j <= 3.1e-37)
tmp = t_1;
else
tmp = -27.0 * (j * 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_] := Block[{t$95$1 = N[(-4.0 * N[(t * a), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(b * c), $MachinePrecision] - N[(4.0 * N[(x * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[j, -1.18e+170], N[(k * N[(j * -27.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[j, -1.26e+33], t$95$2, If[LessEqual[j, -4e-26], t$95$1, If[LessEqual[j, -8.5e-241], t$95$2, If[LessEqual[j, -3e-295], t$95$1, If[LessEqual[j, 2.8e-276], N[(-4.0 * N[(x * i), $MachinePrecision]), $MachinePrecision], If[LessEqual[j, 3.1e-37], t$95$1, N[(-27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision]]]]]]]]]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
t_1 := -4 \cdot \left(t \cdot a\right)\\
t_2 := b \cdot c - 4 \cdot \left(x \cdot i\right)\\
\mathbf{if}\;j \leq -1.18 \cdot 10^{+170}:\\
\;\;\;\;k \cdot \left(j \cdot -27\right)\\
\mathbf{elif}\;j \leq -1.26 \cdot 10^{+33}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;j \leq -4 \cdot 10^{-26}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;j \leq -8.5 \cdot 10^{-241}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;j \leq -3 \cdot 10^{-295}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;j \leq 2.8 \cdot 10^{-276}:\\
\;\;\;\;-4 \cdot \left(x \cdot i\right)\\
\mathbf{elif}\;j \leq 3.1 \cdot 10^{-37}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;-27 \cdot \left(j \cdot k\right)\\
\end{array}
\end{array}
if j < -1.18e170Initial program 85.6%
sub-neg85.6%
+-commutative85.6%
associate-*l*85.7%
distribute-rgt-neg-in85.7%
fma-def85.7%
*-commutative85.7%
distribute-rgt-neg-in85.7%
metadata-eval85.7%
sub-neg85.7%
+-commutative85.7%
associate-*l*85.7%
distribute-rgt-neg-in85.7%
Simplified87.7%
Taylor expanded in j around inf 67.5%
*-commutative67.5%
associate-*r*67.5%
*-commutative67.5%
Simplified67.5%
if -1.18e170 < j < -1.26e33 or -4.0000000000000002e-26 < j < -8.49999999999999974e-241Initial program 89.1%
Taylor expanded in t around 0 62.7%
Taylor expanded in j around 0 52.1%
if -1.26e33 < j < -4.0000000000000002e-26 or -8.49999999999999974e-241 < j < -2.99999999999999996e-295 or 2.79999999999999986e-276 < j < 3.09999999999999993e-37Initial program 87.8%
Taylor expanded in y around 0 73.9%
Taylor expanded in a around inf 56.0%
*-commutative56.0%
Simplified56.0%
if -2.99999999999999996e-295 < j < 2.79999999999999986e-276Initial program 69.6%
sub-neg69.6%
associate-+l-69.6%
sub-neg69.6%
sub-neg69.6%
distribute-rgt-out--69.6%
associate-*l*76.9%
distribute-lft-neg-in76.9%
cancel-sign-sub76.9%
associate-*l*76.9%
associate-*l*76.9%
Simplified76.9%
Taylor expanded in x around inf 77.7%
Taylor expanded in y around 0 31.3%
if 3.09999999999999993e-37 < j Initial program 81.9%
sub-neg81.9%
+-commutative81.9%
associate-*l*81.9%
distribute-rgt-neg-in81.9%
fma-def83.0%
*-commutative83.0%
distribute-rgt-neg-in83.0%
metadata-eval83.0%
sub-neg83.0%
+-commutative83.0%
associate-*l*83.0%
distribute-rgt-neg-in83.0%
Simplified84.1%
Taylor expanded in j around inf 46.9%
Final simplification52.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 (* -4.0 (* t a))) (t_2 (* x (* 18.0 (* t (* y z))))))
(if (<= t -4.8e+236)
t_2
(if (<= t -4e+92)
t_1
(if (<= t 7.5e-143)
(* k (* j -27.0))
(if (<= t 3.2e+122)
(* 18.0 (* y (* t (* x z))))
(if (<= t 1.75e+182) t_1 t_2)))))))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 * (t * a);
double t_2 = x * (18.0 * (t * (y * z)));
double tmp;
if (t <= -4.8e+236) {
tmp = t_2;
} else if (t <= -4e+92) {
tmp = t_1;
} else if (t <= 7.5e-143) {
tmp = k * (j * -27.0);
} else if (t <= 3.2e+122) {
tmp = 18.0 * (y * (t * (x * z)));
} else if (t <= 1.75e+182) {
tmp = t_1;
} else {
tmp = t_2;
}
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 = (-4.0d0) * (t * a)
t_2 = x * (18.0d0 * (t * (y * z)))
if (t <= (-4.8d+236)) then
tmp = t_2
else if (t <= (-4d+92)) then
tmp = t_1
else if (t <= 7.5d-143) then
tmp = k * (j * (-27.0d0))
else if (t <= 3.2d+122) then
tmp = 18.0d0 * (y * (t * (x * z)))
else if (t <= 1.75d+182) then
tmp = t_1
else
tmp = t_2
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 * (t * a);
double t_2 = x * (18.0 * (t * (y * z)));
double tmp;
if (t <= -4.8e+236) {
tmp = t_2;
} else if (t <= -4e+92) {
tmp = t_1;
} else if (t <= 7.5e-143) {
tmp = k * (j * -27.0);
} else if (t <= 3.2e+122) {
tmp = 18.0 * (y * (t * (x * z)));
} else if (t <= 1.75e+182) {
tmp = t_1;
} else {
tmp = t_2;
}
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 * (t * a) t_2 = x * (18.0 * (t * (y * z))) tmp = 0 if t <= -4.8e+236: tmp = t_2 elif t <= -4e+92: tmp = t_1 elif t <= 7.5e-143: tmp = k * (j * -27.0) elif t <= 3.2e+122: tmp = 18.0 * (y * (t * (x * z))) elif t <= 1.75e+182: tmp = t_1 else: tmp = t_2 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(t * a)) t_2 = Float64(x * Float64(18.0 * Float64(t * Float64(y * z)))) tmp = 0.0 if (t <= -4.8e+236) tmp = t_2; elseif (t <= -4e+92) tmp = t_1; elseif (t <= 7.5e-143) tmp = Float64(k * Float64(j * -27.0)); elseif (t <= 3.2e+122) tmp = Float64(18.0 * Float64(y * Float64(t * Float64(x * z)))); elseif (t <= 1.75e+182) tmp = t_1; else tmp = t_2; 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 * (t * a);
t_2 = x * (18.0 * (t * (y * z)));
tmp = 0.0;
if (t <= -4.8e+236)
tmp = t_2;
elseif (t <= -4e+92)
tmp = t_1;
elseif (t <= 7.5e-143)
tmp = k * (j * -27.0);
elseif (t <= 3.2e+122)
tmp = 18.0 * (y * (t * (x * z)));
elseif (t <= 1.75e+182)
tmp = t_1;
else
tmp = t_2;
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[(t * a), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x * N[(18.0 * N[(t * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -4.8e+236], t$95$2, If[LessEqual[t, -4e+92], t$95$1, If[LessEqual[t, 7.5e-143], N[(k * N[(j * -27.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 3.2e+122], N[(18.0 * N[(y * N[(t * N[(x * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.75e+182], t$95$1, t$95$2]]]]]]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
t_1 := -4 \cdot \left(t \cdot a\right)\\
t_2 := x \cdot \left(18 \cdot \left(t \cdot \left(y \cdot z\right)\right)\right)\\
\mathbf{if}\;t \leq -4.8 \cdot 10^{+236}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t \leq -4 \cdot 10^{+92}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq 7.5 \cdot 10^{-143}:\\
\;\;\;\;k \cdot \left(j \cdot -27\right)\\
\mathbf{elif}\;t \leq 3.2 \cdot 10^{+122}:\\
\;\;\;\;18 \cdot \left(y \cdot \left(t \cdot \left(x \cdot z\right)\right)\right)\\
\mathbf{elif}\;t \leq 1.75 \cdot 10^{+182}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if t < -4.80000000000000026e236 or 1.75000000000000011e182 < t Initial program 75.7%
sub-neg75.7%
associate-+l-75.7%
sub-neg75.7%
sub-neg75.7%
distribute-rgt-out--86.5%
associate-*l*83.7%
distribute-lft-neg-in83.7%
cancel-sign-sub83.7%
associate-*l*83.7%
associate-*l*81.0%
Simplified81.0%
Taylor expanded in x around inf 76.4%
Taylor expanded in y around inf 73.8%
*-commutative73.8%
associate-*r*68.6%
*-commutative68.6%
Simplified68.6%
if -4.80000000000000026e236 < t < -4.0000000000000002e92 or 3.20000000000000012e122 < t < 1.75000000000000011e182Initial program 89.8%
Taylor expanded in y around 0 83.5%
Taylor expanded in a around inf 56.2%
*-commutative56.2%
Simplified56.2%
if -4.0000000000000002e92 < t < 7.5000000000000003e-143Initial program 87.5%
sub-neg87.5%
+-commutative87.5%
associate-*l*87.5%
distribute-rgt-neg-in87.5%
fma-def88.4%
*-commutative88.4%
distribute-rgt-neg-in88.4%
metadata-eval88.4%
sub-neg88.4%
+-commutative88.4%
associate-*l*88.4%
distribute-rgt-neg-in88.4%
Simplified88.4%
Taylor expanded in j around inf 43.3%
*-commutative43.3%
associate-*r*43.3%
*-commutative43.3%
Simplified43.3%
if 7.5000000000000003e-143 < t < 3.20000000000000012e122Initial program 81.1%
sub-neg81.1%
associate-+l-81.1%
sub-neg81.1%
sub-neg81.1%
distribute-rgt-out--81.1%
associate-*l*79.3%
distribute-lft-neg-in79.3%
cancel-sign-sub79.3%
associate-*l*79.3%
associate-*l*79.3%
Simplified79.3%
Taylor expanded in x around inf 49.2%
Taylor expanded in y around inf 41.9%
associate-*r*41.8%
Simplified41.8%
Taylor expanded in y around 0 47.1%
Final simplification50.2%
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 (* t a))))
(if (<= t -3.6e+250)
(* x (* 18.0 (* t (* y z))))
(if (<= t -3.8e+93)
t_1
(if (<= t 5.2e-144)
(* k (* j -27.0))
(if (<= t 2.55e+123)
(* 18.0 (* y (* t (* x z))))
(if (<= t 1.85e+183) t_1 (* x (* 18.0 (* y (* z t)))))))))))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 * (t * a);
double tmp;
if (t <= -3.6e+250) {
tmp = x * (18.0 * (t * (y * z)));
} else if (t <= -3.8e+93) {
tmp = t_1;
} else if (t <= 5.2e-144) {
tmp = k * (j * -27.0);
} else if (t <= 2.55e+123) {
tmp = 18.0 * (y * (t * (x * z)));
} else if (t <= 1.85e+183) {
tmp = t_1;
} else {
tmp = x * (18.0 * (y * (z * t)));
}
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 = (-4.0d0) * (t * a)
if (t <= (-3.6d+250)) then
tmp = x * (18.0d0 * (t * (y * z)))
else if (t <= (-3.8d+93)) then
tmp = t_1
else if (t <= 5.2d-144) then
tmp = k * (j * (-27.0d0))
else if (t <= 2.55d+123) then
tmp = 18.0d0 * (y * (t * (x * z)))
else if (t <= 1.85d+183) then
tmp = t_1
else
tmp = x * (18.0d0 * (y * (z * t)))
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 * (t * a);
double tmp;
if (t <= -3.6e+250) {
tmp = x * (18.0 * (t * (y * z)));
} else if (t <= -3.8e+93) {
tmp = t_1;
} else if (t <= 5.2e-144) {
tmp = k * (j * -27.0);
} else if (t <= 2.55e+123) {
tmp = 18.0 * (y * (t * (x * z)));
} else if (t <= 1.85e+183) {
tmp = t_1;
} else {
tmp = x * (18.0 * (y * (z * t)));
}
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 * (t * a) tmp = 0 if t <= -3.6e+250: tmp = x * (18.0 * (t * (y * z))) elif t <= -3.8e+93: tmp = t_1 elif t <= 5.2e-144: tmp = k * (j * -27.0) elif t <= 2.55e+123: tmp = 18.0 * (y * (t * (x * z))) elif t <= 1.85e+183: tmp = t_1 else: tmp = x * (18.0 * (y * (z * t))) 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(t * a)) tmp = 0.0 if (t <= -3.6e+250) tmp = Float64(x * Float64(18.0 * Float64(t * Float64(y * z)))); elseif (t <= -3.8e+93) tmp = t_1; elseif (t <= 5.2e-144) tmp = Float64(k * Float64(j * -27.0)); elseif (t <= 2.55e+123) tmp = Float64(18.0 * Float64(y * Float64(t * Float64(x * z)))); elseif (t <= 1.85e+183) tmp = t_1; else tmp = Float64(x * Float64(18.0 * Float64(y * Float64(z * t)))); 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 * (t * a);
tmp = 0.0;
if (t <= -3.6e+250)
tmp = x * (18.0 * (t * (y * z)));
elseif (t <= -3.8e+93)
tmp = t_1;
elseif (t <= 5.2e-144)
tmp = k * (j * -27.0);
elseif (t <= 2.55e+123)
tmp = 18.0 * (y * (t * (x * z)));
elseif (t <= 1.85e+183)
tmp = t_1;
else
tmp = x * (18.0 * (y * (z * t)));
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[(t * a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -3.6e+250], N[(x * N[(18.0 * N[(t * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, -3.8e+93], t$95$1, If[LessEqual[t, 5.2e-144], N[(k * N[(j * -27.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 2.55e+123], N[(18.0 * N[(y * N[(t * N[(x * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.85e+183], t$95$1, N[(x * N[(18.0 * N[(y * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
t_1 := -4 \cdot \left(t \cdot a\right)\\
\mathbf{if}\;t \leq -3.6 \cdot 10^{+250}:\\
\;\;\;\;x \cdot \left(18 \cdot \left(t \cdot \left(y \cdot z\right)\right)\right)\\
\mathbf{elif}\;t \leq -3.8 \cdot 10^{+93}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq 5.2 \cdot 10^{-144}:\\
\;\;\;\;k \cdot \left(j \cdot -27\right)\\
\mathbf{elif}\;t \leq 2.55 \cdot 10^{+123}:\\
\;\;\;\;18 \cdot \left(y \cdot \left(t \cdot \left(x \cdot z\right)\right)\right)\\
\mathbf{elif}\;t \leq 1.85 \cdot 10^{+183}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(18 \cdot \left(y \cdot \left(z \cdot t\right)\right)\right)\\
\end{array}
\end{array}
if t < -3.5999999999999997e250Initial program 70.0%
sub-neg70.0%
associate-+l-70.0%
sub-neg70.0%
sub-neg70.0%
distribute-rgt-out--90.0%
associate-*l*80.0%
distribute-lft-neg-in80.0%
cancel-sign-sub80.0%
associate-*l*80.0%
associate-*l*80.0%
Simplified80.0%
Taylor expanded in x around inf 80.4%
Taylor expanded in y around inf 80.4%
*-commutative80.4%
associate-*r*80.4%
*-commutative80.4%
Simplified80.4%
if -3.5999999999999997e250 < t < -3.7999999999999998e93 or 2.54999999999999986e123 < t < 1.8500000000000001e183Initial program 89.8%
Taylor expanded in y around 0 83.5%
Taylor expanded in a around inf 56.2%
*-commutative56.2%
Simplified56.2%
if -3.7999999999999998e93 < t < 5.2000000000000002e-144Initial program 87.5%
sub-neg87.5%
+-commutative87.5%
associate-*l*87.5%
distribute-rgt-neg-in87.5%
fma-def88.4%
*-commutative88.4%
distribute-rgt-neg-in88.4%
metadata-eval88.4%
sub-neg88.4%
+-commutative88.4%
associate-*l*88.4%
distribute-rgt-neg-in88.4%
Simplified88.4%
Taylor expanded in j around inf 43.3%
*-commutative43.3%
associate-*r*43.3%
*-commutative43.3%
Simplified43.3%
if 5.2000000000000002e-144 < t < 2.54999999999999986e123Initial program 81.1%
sub-neg81.1%
associate-+l-81.1%
sub-neg81.1%
sub-neg81.1%
distribute-rgt-out--81.1%
associate-*l*79.3%
distribute-lft-neg-in79.3%
cancel-sign-sub79.3%
associate-*l*79.3%
associate-*l*79.3%
Simplified79.3%
Taylor expanded in x around inf 49.2%
Taylor expanded in y around inf 41.9%
associate-*r*41.8%
Simplified41.8%
Taylor expanded in y around 0 47.1%
if 1.8500000000000001e183 < t Initial program 77.8%
sub-neg77.8%
associate-+l-77.8%
sub-neg77.8%
sub-neg77.8%
distribute-rgt-out--85.2%
associate-*l*85.1%
distribute-lft-neg-in85.1%
cancel-sign-sub85.1%
associate-*l*85.1%
associate-*l*81.4%
Simplified81.4%
Taylor expanded in x around inf 74.9%
Taylor expanded in y around inf 71.3%
Final simplification51.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 (* t a))) (t_2 (* -27.0 (* j k))))
(if (<= j -1.75e+127)
(* k (* j -27.0))
(if (<= j -6.2e+73)
(* b c)
(if (<= j -3.1e+33)
t_2
(if (<= j -1e-297)
t_1
(if (<= j 6.2e-277)
(* -4.0 (* x i))
(if (<= j 2e-37) t_1 t_2))))))))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 * (t * a);
double t_2 = -27.0 * (j * k);
double tmp;
if (j <= -1.75e+127) {
tmp = k * (j * -27.0);
} else if (j <= -6.2e+73) {
tmp = b * c;
} else if (j <= -3.1e+33) {
tmp = t_2;
} else if (j <= -1e-297) {
tmp = t_1;
} else if (j <= 6.2e-277) {
tmp = -4.0 * (x * i);
} else if (j <= 2e-37) {
tmp = t_1;
} else {
tmp = t_2;
}
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 = (-4.0d0) * (t * a)
t_2 = (-27.0d0) * (j * k)
if (j <= (-1.75d+127)) then
tmp = k * (j * (-27.0d0))
else if (j <= (-6.2d+73)) then
tmp = b * c
else if (j <= (-3.1d+33)) then
tmp = t_2
else if (j <= (-1d-297)) then
tmp = t_1
else if (j <= 6.2d-277) then
tmp = (-4.0d0) * (x * i)
else if (j <= 2d-37) then
tmp = t_1
else
tmp = t_2
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 * (t * a);
double t_2 = -27.0 * (j * k);
double tmp;
if (j <= -1.75e+127) {
tmp = k * (j * -27.0);
} else if (j <= -6.2e+73) {
tmp = b * c;
} else if (j <= -3.1e+33) {
tmp = t_2;
} else if (j <= -1e-297) {
tmp = t_1;
} else if (j <= 6.2e-277) {
tmp = -4.0 * (x * i);
} else if (j <= 2e-37) {
tmp = t_1;
} else {
tmp = t_2;
}
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 * (t * a) t_2 = -27.0 * (j * k) tmp = 0 if j <= -1.75e+127: tmp = k * (j * -27.0) elif j <= -6.2e+73: tmp = b * c elif j <= -3.1e+33: tmp = t_2 elif j <= -1e-297: tmp = t_1 elif j <= 6.2e-277: tmp = -4.0 * (x * i) elif j <= 2e-37: tmp = t_1 else: tmp = t_2 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(t * a)) t_2 = Float64(-27.0 * Float64(j * k)) tmp = 0.0 if (j <= -1.75e+127) tmp = Float64(k * Float64(j * -27.0)); elseif (j <= -6.2e+73) tmp = Float64(b * c); elseif (j <= -3.1e+33) tmp = t_2; elseif (j <= -1e-297) tmp = t_1; elseif (j <= 6.2e-277) tmp = Float64(-4.0 * Float64(x * i)); elseif (j <= 2e-37) tmp = t_1; else tmp = t_2; 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 * (t * a);
t_2 = -27.0 * (j * k);
tmp = 0.0;
if (j <= -1.75e+127)
tmp = k * (j * -27.0);
elseif (j <= -6.2e+73)
tmp = b * c;
elseif (j <= -3.1e+33)
tmp = t_2;
elseif (j <= -1e-297)
tmp = t_1;
elseif (j <= 6.2e-277)
tmp = -4.0 * (x * i);
elseif (j <= 2e-37)
tmp = t_1;
else
tmp = t_2;
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[(t * a), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(-27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[j, -1.75e+127], N[(k * N[(j * -27.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[j, -6.2e+73], N[(b * c), $MachinePrecision], If[LessEqual[j, -3.1e+33], t$95$2, If[LessEqual[j, -1e-297], t$95$1, If[LessEqual[j, 6.2e-277], N[(-4.0 * N[(x * i), $MachinePrecision]), $MachinePrecision], If[LessEqual[j, 2e-37], t$95$1, t$95$2]]]]]]]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
t_1 := -4 \cdot \left(t \cdot a\right)\\
t_2 := -27 \cdot \left(j \cdot k\right)\\
\mathbf{if}\;j \leq -1.75 \cdot 10^{+127}:\\
\;\;\;\;k \cdot \left(j \cdot -27\right)\\
\mathbf{elif}\;j \leq -6.2 \cdot 10^{+73}:\\
\;\;\;\;b \cdot c\\
\mathbf{elif}\;j \leq -3.1 \cdot 10^{+33}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;j \leq -1 \cdot 10^{-297}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;j \leq 6.2 \cdot 10^{-277}:\\
\;\;\;\;-4 \cdot \left(x \cdot i\right)\\
\mathbf{elif}\;j \leq 2 \cdot 10^{-37}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if j < -1.74999999999999989e127Initial program 82.9%
sub-neg82.9%
+-commutative82.9%
associate-*l*83.0%
distribute-rgt-neg-in83.0%
fma-def85.1%
*-commutative85.1%
distribute-rgt-neg-in85.1%
metadata-eval85.1%
sub-neg85.1%
+-commutative85.1%
associate-*l*85.1%
distribute-rgt-neg-in85.1%
Simplified90.9%
Taylor expanded in j around inf 53.6%
*-commutative53.6%
associate-*r*53.6%
*-commutative53.6%
Simplified53.6%
if -1.74999999999999989e127 < j < -6.1999999999999999e73Initial program 100.0%
Taylor expanded in y around 0 84.3%
Taylor expanded in c around inf 34.6%
if -6.1999999999999999e73 < j < -3.1e33 or 2.00000000000000013e-37 < j Initial program 83.0%
sub-neg83.0%
+-commutative83.0%
associate-*l*83.0%
distribute-rgt-neg-in83.0%
fma-def84.1%
*-commutative84.1%
distribute-rgt-neg-in84.1%
metadata-eval84.1%
sub-neg84.1%
+-commutative84.1%
associate-*l*84.1%
distribute-rgt-neg-in84.1%
Simplified85.2%
Taylor expanded in j around inf 46.2%
if -3.1e33 < j < -1.00000000000000004e-297 or 6.19999999999999958e-277 < j < 2.00000000000000013e-37Initial program 88.1%
Taylor expanded in y around 0 74.5%
Taylor expanded in a around inf 37.1%
*-commutative37.1%
Simplified37.1%
if -1.00000000000000004e-297 < j < 6.19999999999999958e-277Initial program 69.6%
sub-neg69.6%
associate-+l-69.6%
sub-neg69.6%
sub-neg69.6%
distribute-rgt-out--69.6%
associate-*l*76.9%
distribute-lft-neg-in76.9%
cancel-sign-sub76.9%
associate-*l*76.9%
associate-*l*76.9%
Simplified76.9%
Taylor expanded in x around inf 77.7%
Taylor expanded in y around 0 31.3%
Final simplification43.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 (* t a))))
(if (<= t -5.6e+96)
t_1
(if (<= t 6.5e-143)
(* k (* j -27.0))
(if (or (<= t 3.6e+123) (not (<= t 5e+183)))
(* 18.0 (* y (* t (* x z))))
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 = -4.0 * (t * a);
double tmp;
if (t <= -5.6e+96) {
tmp = t_1;
} else if (t <= 6.5e-143) {
tmp = k * (j * -27.0);
} else if ((t <= 3.6e+123) || !(t <= 5e+183)) {
tmp = 18.0 * (y * (t * (x * z)));
} 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 = (-4.0d0) * (t * a)
if (t <= (-5.6d+96)) then
tmp = t_1
else if (t <= 6.5d-143) then
tmp = k * (j * (-27.0d0))
else if ((t <= 3.6d+123) .or. (.not. (t <= 5d+183))) then
tmp = 18.0d0 * (y * (t * (x * z)))
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 = -4.0 * (t * a);
double tmp;
if (t <= -5.6e+96) {
tmp = t_1;
} else if (t <= 6.5e-143) {
tmp = k * (j * -27.0);
} else if ((t <= 3.6e+123) || !(t <= 5e+183)) {
tmp = 18.0 * (y * (t * (x * z)));
} 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 = -4.0 * (t * a) tmp = 0 if t <= -5.6e+96: tmp = t_1 elif t <= 6.5e-143: tmp = k * (j * -27.0) elif (t <= 3.6e+123) or not (t <= 5e+183): tmp = 18.0 * (y * (t * (x * z))) 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(-4.0 * Float64(t * a)) tmp = 0.0 if (t <= -5.6e+96) tmp = t_1; elseif (t <= 6.5e-143) tmp = Float64(k * Float64(j * -27.0)); elseif ((t <= 3.6e+123) || !(t <= 5e+183)) tmp = Float64(18.0 * Float64(y * Float64(t * Float64(x * z)))); 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 = -4.0 * (t * a);
tmp = 0.0;
if (t <= -5.6e+96)
tmp = t_1;
elseif (t <= 6.5e-143)
tmp = k * (j * -27.0);
elseif ((t <= 3.6e+123) || ~((t <= 5e+183)))
tmp = 18.0 * (y * (t * (x * z)));
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[(-4.0 * N[(t * a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -5.6e+96], t$95$1, If[LessEqual[t, 6.5e-143], N[(k * N[(j * -27.0), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[t, 3.6e+123], N[Not[LessEqual[t, 5e+183]], $MachinePrecision]], N[(18.0 * N[(y * N[(t * N[(x * z), $MachinePrecision]), $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 := -4 \cdot \left(t \cdot a\right)\\
\mathbf{if}\;t \leq -5.6 \cdot 10^{+96}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq 6.5 \cdot 10^{-143}:\\
\;\;\;\;k \cdot \left(j \cdot -27\right)\\
\mathbf{elif}\;t \leq 3.6 \cdot 10^{+123} \lor \neg \left(t \leq 5 \cdot 10^{+183}\right):\\
\;\;\;\;18 \cdot \left(y \cdot \left(t \cdot \left(x \cdot z\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if t < -5.59999999999999999e96 or 3.59999999999999998e123 < t < 5.00000000000000009e183Initial program 86.4%
Taylor expanded in y around 0 78.1%
Taylor expanded in a around inf 52.0%
*-commutative52.0%
Simplified52.0%
if -5.59999999999999999e96 < t < 6.4999999999999999e-143Initial program 87.5%
sub-neg87.5%
+-commutative87.5%
associate-*l*87.5%
distribute-rgt-neg-in87.5%
fma-def88.4%
*-commutative88.4%
distribute-rgt-neg-in88.4%
metadata-eval88.4%
sub-neg88.4%
+-commutative88.4%
associate-*l*88.4%
distribute-rgt-neg-in88.4%
Simplified88.4%
Taylor expanded in j around inf 43.3%
*-commutative43.3%
associate-*r*43.3%
*-commutative43.3%
Simplified43.3%
if 6.4999999999999999e-143 < t < 3.59999999999999998e123 or 5.00000000000000009e183 < t Initial program 80.0%
sub-neg80.0%
associate-+l-80.0%
sub-neg80.0%
sub-neg80.0%
distribute-rgt-out--82.5%
associate-*l*81.3%
distribute-lft-neg-in81.3%
cancel-sign-sub81.3%
associate-*l*81.3%
associate-*l*80.0%
Simplified80.0%
Taylor expanded in x around inf 58.0%
Taylor expanded in y around inf 51.9%
associate-*r*51.9%
Simplified51.9%
Taylor expanded in y around 0 52.8%
Final simplification48.2%
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 (<= c -3.5e+24) (* b c) (if (<= c 3.5e+71) (* -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 (c <= -3.5e+24) {
tmp = b * c;
} else if (c <= 3.5e+71) {
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 (c <= (-3.5d+24)) then
tmp = b * c
else if (c <= 3.5d+71) 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 (c <= -3.5e+24) {
tmp = b * c;
} else if (c <= 3.5e+71) {
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 c <= -3.5e+24: tmp = b * c elif c <= 3.5e+71: 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 (c <= -3.5e+24) tmp = Float64(b * c); elseif (c <= 3.5e+71) 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 (c <= -3.5e+24)
tmp = b * c;
elseif (c <= 3.5e+71)
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[c, -3.5e+24], N[(b * c), $MachinePrecision], If[LessEqual[c, 3.5e+71], 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}\;c \leq -3.5 \cdot 10^{+24}:\\
\;\;\;\;b \cdot c\\
\mathbf{elif}\;c \leq 3.5 \cdot 10^{+71}:\\
\;\;\;\;-27 \cdot \left(j \cdot k\right)\\
\mathbf{else}:\\
\;\;\;\;b \cdot c\\
\end{array}
\end{array}
if c < -3.5000000000000002e24 or 3.4999999999999999e71 < c Initial program 77.8%
Taylor expanded in y around 0 75.5%
Taylor expanded in c around inf 38.8%
if -3.5000000000000002e24 < c < 3.4999999999999999e71Initial program 89.7%
sub-neg89.7%
+-commutative89.7%
associate-*l*89.7%
distribute-rgt-neg-in89.7%
fma-def90.4%
*-commutative90.4%
distribute-rgt-neg-in90.4%
metadata-eval90.4%
sub-neg90.4%
+-commutative90.4%
associate-*l*90.4%
distribute-rgt-neg-in90.4%
Simplified93.0%
Taylor expanded in j around inf 35.5%
Final simplification36.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 (if (<= c -3.5e+26) (* b c) (if (<= c 1.65e+71) (* k (* j -27.0)) (* 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 (c <= -3.5e+26) {
tmp = b * c;
} else if (c <= 1.65e+71) {
tmp = k * (j * -27.0);
} 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 (c <= (-3.5d+26)) then
tmp = b * c
else if (c <= 1.65d+71) then
tmp = k * (j * (-27.0d0))
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 (c <= -3.5e+26) {
tmp = b * c;
} else if (c <= 1.65e+71) {
tmp = k * (j * -27.0);
} 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 c <= -3.5e+26: tmp = b * c elif c <= 1.65e+71: tmp = k * (j * -27.0) 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 (c <= -3.5e+26) tmp = Float64(b * c); elseif (c <= 1.65e+71) tmp = Float64(k * Float64(j * -27.0)); 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 (c <= -3.5e+26)
tmp = b * c;
elseif (c <= 1.65e+71)
tmp = k * (j * -27.0);
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[c, -3.5e+26], N[(b * c), $MachinePrecision], If[LessEqual[c, 1.65e+71], N[(k * N[(j * -27.0), $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}\;c \leq -3.5 \cdot 10^{+26}:\\
\;\;\;\;b \cdot c\\
\mathbf{elif}\;c \leq 1.65 \cdot 10^{+71}:\\
\;\;\;\;k \cdot \left(j \cdot -27\right)\\
\mathbf{else}:\\
\;\;\;\;b \cdot c\\
\end{array}
\end{array}
if c < -3.4999999999999999e26 or 1.6499999999999999e71 < c Initial program 77.8%
Taylor expanded in y around 0 75.5%
Taylor expanded in c around inf 38.8%
if -3.4999999999999999e26 < c < 1.6499999999999999e71Initial program 89.7%
sub-neg89.7%
+-commutative89.7%
associate-*l*89.7%
distribute-rgt-neg-in89.7%
fma-def90.4%
*-commutative90.4%
distribute-rgt-neg-in90.4%
metadata-eval90.4%
sub-neg90.4%
+-commutative90.4%
associate-*l*90.4%
distribute-rgt-neg-in90.4%
Simplified93.0%
Taylor expanded in j around inf 35.5%
*-commutative35.5%
associate-*r*35.5%
*-commutative35.5%
Simplified35.5%
Final simplification36.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 (* 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 84.9%
Taylor expanded in y around 0 76.1%
Taylor expanded in c around inf 20.0%
Final simplification20.0%
(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 2023214
(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)))