
(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 24 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
(if (<= x -8e+142)
(fma
j
(* k -27.0)
(fma x (* i -4.0) (fma c b (* 18.0 (* y (* (* x z) t))))))
(fma
j
(* k -27.0)
(fma x (* i -4.0) (fma t (fma x (* 18.0 (* y z)) (* -4.0 a)) (* c b))))))assert(y < z);
assert(j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double tmp;
if (x <= -8e+142) {
tmp = fma(j, (k * -27.0), fma(x, (i * -4.0), fma(c, b, (18.0 * (y * ((x * z) * t))))));
} else {
tmp = fma(j, (k * -27.0), fma(x, (i * -4.0), fma(t, fma(x, (18.0 * (y * z)), (-4.0 * a)), (c * b))));
}
return tmp;
}
y, z = sort([y, z]) j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) tmp = 0.0 if (x <= -8e+142) tmp = fma(j, Float64(k * -27.0), fma(x, Float64(i * -4.0), fma(c, b, Float64(18.0 * Float64(y * Float64(Float64(x * z) * t)))))); else tmp = fma(j, Float64(k * -27.0), fma(x, Float64(i * -4.0), fma(t, fma(x, Float64(18.0 * Float64(y * z)), Float64(-4.0 * a)), Float64(c * b)))); 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_] := If[LessEqual[x, -8e+142], N[(j * N[(k * -27.0), $MachinePrecision] + N[(x * N[(i * -4.0), $MachinePrecision] + N[(c * b + N[(18.0 * N[(y * N[(N[(x * z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(j * N[(k * -27.0), $MachinePrecision] + N[(x * N[(i * -4.0), $MachinePrecision] + N[(t * N[(x * N[(18.0 * N[(y * z), $MachinePrecision]), $MachinePrecision] + N[(-4.0 * a), $MachinePrecision]), $MachinePrecision] + N[(c * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -8 \cdot 10^{+142}:\\
\;\;\;\;\mathsf{fma}\left(j, k \cdot -27, \mathsf{fma}\left(x, i \cdot -4, \mathsf{fma}\left(c, b, 18 \cdot \left(y \cdot \left(\left(x \cdot z\right) \cdot t\right)\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(j, k \cdot -27, \mathsf{fma}\left(x, i \cdot -4, \mathsf{fma}\left(t, \mathsf{fma}\left(x, 18 \cdot \left(y \cdot z\right), -4 \cdot a\right), c \cdot b\right)\right)\right)\\
\end{array}
\end{array}
if x < -8.00000000000000041e142Initial program 69.6%
sub-neg69.6%
+-commutative69.6%
associate-*l*69.6%
distribute-rgt-neg-in69.6%
fma-def72.2%
*-commutative72.2%
distribute-rgt-neg-in72.2%
metadata-eval72.2%
sub-neg72.2%
+-commutative72.2%
associate-*l*72.2%
distribute-rgt-neg-in72.2%
Simplified79.7%
Taylor expanded in a around 0 79.7%
fma-def82.2%
*-commutative82.2%
Simplified82.2%
if -8.00000000000000041e142 < x Initial program 88.4%
sub-neg88.4%
+-commutative88.4%
associate-*l*88.5%
distribute-rgt-neg-in88.5%
fma-def89.8%
*-commutative89.8%
distribute-rgt-neg-in89.8%
metadata-eval89.8%
sub-neg89.8%
+-commutative89.8%
associate-*l*89.8%
distribute-rgt-neg-in89.8%
Simplified91.8%
Final simplification90.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
(-
(-
(+ (- (* t (* z (* y (* x 18.0)))) (* t (* a 4.0))) (* c b))
(* i (* x 4.0)))
(* k (* j 27.0)))))
(if (<= t_1 INFINITY)
t_1
(fma
j
(* k -27.0)
(fma x (* i -4.0) (fma c b (* 18.0 (* y (* (* 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 = ((((t * (z * (y * (x * 18.0)))) - (t * (a * 4.0))) + (c * b)) - (i * (x * 4.0))) - (k * (j * 27.0));
double tmp;
if (t_1 <= ((double) INFINITY)) {
tmp = t_1;
} else {
tmp = fma(j, (k * -27.0), fma(x, (i * -4.0), fma(c, b, (18.0 * (y * ((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(Float64(Float64(t * Float64(z * Float64(y * Float64(x * 18.0)))) - Float64(t * Float64(a * 4.0))) + Float64(c * b)) - Float64(i * Float64(x * 4.0))) - Float64(k * Float64(j * 27.0))) tmp = 0.0 if (t_1 <= Inf) tmp = t_1; else tmp = fma(j, Float64(k * -27.0), fma(x, Float64(i * -4.0), fma(c, b, Float64(18.0 * Float64(y * Float64(Float64(x * 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[(t * N[(z * N[(y * N[(x * 18.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(t * N[(a * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(c * b), $MachinePrecision]), $MachinePrecision] - N[(i * N[(x * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(k * N[(j * 27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, Infinity], t$95$1, N[(j * N[(k * -27.0), $MachinePrecision] + N[(x * N[(i * -4.0), $MachinePrecision] + N[(c * b + N[(18.0 * N[(y * N[(N[(x * z), $MachinePrecision] * 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(t \cdot \left(z \cdot \left(y \cdot \left(x \cdot 18\right)\right)\right) - t \cdot \left(a \cdot 4\right)\right) + c \cdot b\right) - i \cdot \left(x \cdot 4\right)\right) - k \cdot \left(j \cdot 27\right)\\
\mathbf{if}\;t_1 \leq \infty:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(j, k \cdot -27, \mathsf{fma}\left(x, i \cdot -4, \mathsf{fma}\left(c, b, 18 \cdot \left(y \cdot \left(\left(x \cdot z\right) \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.9%
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-def13.3%
*-commutative13.3%
distribute-rgt-neg-in13.3%
metadata-eval13.3%
sub-neg13.3%
+-commutative13.3%
associate-*l*13.3%
distribute-rgt-neg-in13.3%
Simplified46.7%
Taylor expanded in a around 0 46.7%
fma-def50.0%
*-commutative50.0%
Simplified50.0%
Final simplification91.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
(-
(-
(+ (- (* t (* z (* y (* x 18.0)))) (* t (* a 4.0))) (* c b))
(* i (* x 4.0)))
(* k (* j 27.0)))))
(if (<= t_1 INFINITY) t_1 (* t (- (* 18.0 (* y (* x z))) (* a 4.0))))))assert(y < z);
assert(j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = ((((t * (z * (y * (x * 18.0)))) - (t * (a * 4.0))) + (c * b)) - (i * (x * 4.0))) - (k * (j * 27.0));
double tmp;
if (t_1 <= ((double) INFINITY)) {
tmp = t_1;
} else {
tmp = t * ((18.0 * (y * (x * z))) - (a * 4.0));
}
return tmp;
}
assert y < z;
assert j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = ((((t * (z * (y * (x * 18.0)))) - (t * (a * 4.0))) + (c * b)) - (i * (x * 4.0))) - (k * (j * 27.0));
double tmp;
if (t_1 <= Double.POSITIVE_INFINITY) {
tmp = t_1;
} else {
tmp = t * ((18.0 * (y * (x * z))) - (a * 4.0));
}
return tmp;
}
[y, z] = sort([y, z]) [j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): t_1 = ((((t * (z * (y * (x * 18.0)))) - (t * (a * 4.0))) + (c * b)) - (i * (x * 4.0))) - (k * (j * 27.0)) tmp = 0 if t_1 <= math.inf: tmp = t_1 else: tmp = t * ((18.0 * (y * (x * z))) - (a * 4.0)) return tmp
y, z = sort([y, z]) j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(Float64(Float64(Float64(Float64(t * Float64(z * Float64(y * Float64(x * 18.0)))) - Float64(t * Float64(a * 4.0))) + Float64(c * b)) - Float64(i * Float64(x * 4.0))) - Float64(k * Float64(j * 27.0))) tmp = 0.0 if (t_1 <= Inf) tmp = t_1; else tmp = Float64(t * Float64(Float64(18.0 * Float64(y * Float64(x * z))) - Float64(a * 4.0))); end return tmp end
y, z = num2cell(sort([y, z])){:}
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
t_1 = ((((t * (z * (y * (x * 18.0)))) - (t * (a * 4.0))) + (c * b)) - (i * (x * 4.0))) - (k * (j * 27.0));
tmp = 0.0;
if (t_1 <= Inf)
tmp = t_1;
else
tmp = t * ((18.0 * (y * (x * z))) - (a * 4.0));
end
tmp_2 = tmp;
end
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(N[(N[(N[(N[(t * N[(z * N[(y * N[(x * 18.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(t * N[(a * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(c * b), $MachinePrecision]), $MachinePrecision] - N[(i * N[(x * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(k * N[(j * 27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, Infinity], t$95$1, N[(t * N[(N[(18.0 * N[(y * N[(x * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(a * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
t_1 := \left(\left(\left(t \cdot \left(z \cdot \left(y \cdot \left(x \cdot 18\right)\right)\right) - t \cdot \left(a \cdot 4\right)\right) + c \cdot b\right) - i \cdot \left(x \cdot 4\right)\right) - k \cdot \left(j \cdot 27\right)\\
\mathbf{if}\;t_1 \leq \infty:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t \cdot \left(18 \cdot \left(y \cdot \left(x \cdot z\right)\right) - a \cdot 4\right)\\
\end{array}
\end{array}
if (-.f64 (-.f64 (+.f64 (-.f64 (*.f64 (*.f64 (*.f64 (*.f64 x 18) y) z) t) (*.f64 (*.f64 a 4) t)) (*.f64 b c)) (*.f64 (*.f64 x 4) i)) (*.f64 (*.f64 j 27) k)) < +inf.0Initial program 96.9%
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--13.3%
associate-*l*10.0%
distribute-lft-neg-in10.0%
cancel-sign-sub10.0%
associate-*l*10.0%
associate-*l*10.0%
Simplified10.0%
Taylor expanded in t around inf 56.8%
Final simplification92.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 (* x i)))
(t_2 (* k (* j 27.0)))
(t_3 (- (- (* c b) t_1) t_2))
(t_4 (- (* c b) (+ t_1 (* 4.0 (* t a))))))
(if (<= t_2 -5e+149)
t_3
(if (<= t_2 -1e-162)
t_4
(if (<= t_2 -5e-290)
(* x (- (* 18.0 (* y (* z t))) (* i 4.0)))
(if (<= t_2 5e+103) t_4 t_3))))))assert(y < z);
assert(j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = 4.0 * (x * i);
double t_2 = k * (j * 27.0);
double t_3 = ((c * b) - t_1) - t_2;
double t_4 = (c * b) - (t_1 + (4.0 * (t * a)));
double tmp;
if (t_2 <= -5e+149) {
tmp = t_3;
} else if (t_2 <= -1e-162) {
tmp = t_4;
} else if (t_2 <= -5e-290) {
tmp = x * ((18.0 * (y * (z * t))) - (i * 4.0));
} else if (t_2 <= 5e+103) {
tmp = t_4;
} else {
tmp = t_3;
}
return tmp;
}
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: tmp
t_1 = 4.0d0 * (x * i)
t_2 = k * (j * 27.0d0)
t_3 = ((c * b) - t_1) - t_2
t_4 = (c * b) - (t_1 + (4.0d0 * (t * a)))
if (t_2 <= (-5d+149)) then
tmp = t_3
else if (t_2 <= (-1d-162)) then
tmp = t_4
else if (t_2 <= (-5d-290)) then
tmp = x * ((18.0d0 * (y * (z * t))) - (i * 4.0d0))
else if (t_2 <= 5d+103) then
tmp = t_4
else
tmp = t_3
end if
code = tmp
end function
assert y < z;
assert j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = 4.0 * (x * i);
double t_2 = k * (j * 27.0);
double t_3 = ((c * b) - t_1) - t_2;
double t_4 = (c * b) - (t_1 + (4.0 * (t * a)));
double tmp;
if (t_2 <= -5e+149) {
tmp = t_3;
} else if (t_2 <= -1e-162) {
tmp = t_4;
} else if (t_2 <= -5e-290) {
tmp = x * ((18.0 * (y * (z * t))) - (i * 4.0));
} else if (t_2 <= 5e+103) {
tmp = t_4;
} else {
tmp = t_3;
}
return tmp;
}
[y, z] = sort([y, z]) [j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): t_1 = 4.0 * (x * i) t_2 = k * (j * 27.0) t_3 = ((c * b) - t_1) - t_2 t_4 = (c * b) - (t_1 + (4.0 * (t * a))) tmp = 0 if t_2 <= -5e+149: tmp = t_3 elif t_2 <= -1e-162: tmp = t_4 elif t_2 <= -5e-290: tmp = x * ((18.0 * (y * (z * t))) - (i * 4.0)) elif t_2 <= 5e+103: tmp = t_4 else: tmp = t_3 return tmp
y, z = sort([y, z]) j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(4.0 * Float64(x * i)) t_2 = Float64(k * Float64(j * 27.0)) t_3 = Float64(Float64(Float64(c * b) - t_1) - t_2) t_4 = Float64(Float64(c * b) - Float64(t_1 + Float64(4.0 * Float64(t * a)))) tmp = 0.0 if (t_2 <= -5e+149) tmp = t_3; elseif (t_2 <= -1e-162) tmp = t_4; elseif (t_2 <= -5e-290) tmp = Float64(x * Float64(Float64(18.0 * Float64(y * Float64(z * t))) - Float64(i * 4.0))); elseif (t_2 <= 5e+103) tmp = t_4; else tmp = t_3; end return tmp end
y, z = num2cell(sort([y, z])){:}
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
t_1 = 4.0 * (x * i);
t_2 = k * (j * 27.0);
t_3 = ((c * b) - t_1) - t_2;
t_4 = (c * b) - (t_1 + (4.0 * (t * a)));
tmp = 0.0;
if (t_2 <= -5e+149)
tmp = t_3;
elseif (t_2 <= -1e-162)
tmp = t_4;
elseif (t_2 <= -5e-290)
tmp = x * ((18.0 * (y * (z * t))) - (i * 4.0));
elseif (t_2 <= 5e+103)
tmp = t_4;
else
tmp = t_3;
end
tmp_2 = tmp;
end
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(4.0 * N[(x * i), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(k * N[(j * 27.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(N[(c * b), $MachinePrecision] - t$95$1), $MachinePrecision] - t$95$2), $MachinePrecision]}, Block[{t$95$4 = N[(N[(c * b), $MachinePrecision] - N[(t$95$1 + N[(4.0 * N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -5e+149], t$95$3, If[LessEqual[t$95$2, -1e-162], t$95$4, If[LessEqual[t$95$2, -5e-290], N[(x * N[(N[(18.0 * N[(y * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(i * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 5e+103], t$95$4, t$95$3]]]]]]]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
t_1 := 4 \cdot \left(x \cdot i\right)\\
t_2 := k \cdot \left(j \cdot 27\right)\\
t_3 := \left(c \cdot b - t_1\right) - t_2\\
t_4 := c \cdot b - \left(t_1 + 4 \cdot \left(t \cdot a\right)\right)\\
\mathbf{if}\;t_2 \leq -5 \cdot 10^{+149}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;t_2 \leq -1 \cdot 10^{-162}:\\
\;\;\;\;t_4\\
\mathbf{elif}\;t_2 \leq -5 \cdot 10^{-290}:\\
\;\;\;\;x \cdot \left(18 \cdot \left(y \cdot \left(z \cdot t\right)\right) - i \cdot 4\right)\\
\mathbf{elif}\;t_2 \leq 5 \cdot 10^{+103}:\\
\;\;\;\;t_4\\
\mathbf{else}:\\
\;\;\;\;t_3\\
\end{array}
\end{array}
if (*.f64 (*.f64 j 27) k) < -4.9999999999999999e149 or 5e103 < (*.f64 (*.f64 j 27) k) Initial program 81.2%
Taylor expanded in t around 0 80.4%
if -4.9999999999999999e149 < (*.f64 (*.f64 j 27) k) < -9.99999999999999954e-163 or -5.0000000000000001e-290 < (*.f64 (*.f64 j 27) k) < 5e103Initial program 88.1%
Taylor expanded in y around 0 80.0%
Taylor expanded in j around 0 76.3%
if -9.99999999999999954e-163 < (*.f64 (*.f64 j 27) k) < -5.0000000000000001e-290Initial program 83.5%
sub-neg83.5%
associate-+l-83.5%
sub-neg83.5%
sub-neg83.5%
distribute-rgt-out--83.5%
associate-*l*75.6%
distribute-lft-neg-in75.6%
cancel-sign-sub75.6%
associate-*l*75.6%
associate-*l*75.6%
Simplified75.6%
Taylor expanded in x around inf 84.2%
Final simplification78.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
(if (<= (* k (* j 27.0)) (- INFINITY))
(* -27.0 (* j k))
(-
(+ (* t (- (* (* y z) (* x 18.0)) (* a 4.0))) (* c b))
(+ (* x (* i 4.0)) (* j (* k 27.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 ((k * (j * 27.0)) <= -((double) INFINITY)) {
tmp = -27.0 * (j * k);
} else {
tmp = ((t * (((y * z) * (x * 18.0)) - (a * 4.0))) + (c * b)) - ((x * (i * 4.0)) + (j * (k * 27.0)));
}
return tmp;
}
assert y < z;
assert j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double tmp;
if ((k * (j * 27.0)) <= -Double.POSITIVE_INFINITY) {
tmp = -27.0 * (j * k);
} else {
tmp = ((t * (((y * z) * (x * 18.0)) - (a * 4.0))) + (c * b)) - ((x * (i * 4.0)) + (j * (k * 27.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 (k * (j * 27.0)) <= -math.inf: tmp = -27.0 * (j * k) else: tmp = ((t * (((y * z) * (x * 18.0)) - (a * 4.0))) + (c * b)) - ((x * (i * 4.0)) + (j * (k * 27.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 (Float64(k * Float64(j * 27.0)) <= Float64(-Inf)) tmp = Float64(-27.0 * Float64(j * k)); else tmp = Float64(Float64(Float64(t * Float64(Float64(Float64(y * z) * Float64(x * 18.0)) - Float64(a * 4.0))) + Float64(c * b)) - Float64(Float64(x * Float64(i * 4.0)) + Float64(j * Float64(k * 27.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 ((k * (j * 27.0)) <= -Inf)
tmp = -27.0 * (j * k);
else
tmp = ((t * (((y * z) * (x * 18.0)) - (a * 4.0))) + (c * b)) - ((x * (i * 4.0)) + (j * (k * 27.0)));
end
tmp_2 = tmp;
end
NOTE: y and z should be sorted in increasing order before calling this function. NOTE: j and k should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := If[LessEqual[N[(k * N[(j * 27.0), $MachinePrecision]), $MachinePrecision], (-Infinity)], N[(-27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision], N[(N[(N[(t * N[(N[(N[(y * z), $MachinePrecision] * N[(x * 18.0), $MachinePrecision]), $MachinePrecision] - N[(a * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(c * b), $MachinePrecision]), $MachinePrecision] - N[(N[(x * N[(i * 4.0), $MachinePrecision]), $MachinePrecision] + N[(j * N[(k * 27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
\mathbf{if}\;k \cdot \left(j \cdot 27\right) \leq -\infty:\\
\;\;\;\;-27 \cdot \left(j \cdot k\right)\\
\mathbf{else}:\\
\;\;\;\;\left(t \cdot \left(\left(y \cdot z\right) \cdot \left(x \cdot 18\right) - a \cdot 4\right) + c \cdot b\right) - \left(x \cdot \left(i \cdot 4\right) + j \cdot \left(k \cdot 27\right)\right)\\
\end{array}
\end{array}
if (*.f64 (*.f64 j 27) k) < -inf.0Initial program 44.4%
sub-neg44.4%
+-commutative44.4%
associate-*l*44.4%
distribute-rgt-neg-in44.4%
fma-def61.1%
*-commutative61.1%
distribute-rgt-neg-in61.1%
metadata-eval61.1%
sub-neg61.1%
+-commutative61.1%
associate-*l*61.1%
distribute-rgt-neg-in61.1%
Simplified61.1%
Taylor expanded in j around inf 72.2%
if -inf.0 < (*.f64 (*.f64 j 27) k) Initial program 88.7%
sub-neg88.7%
associate-+l-88.7%
sub-neg88.7%
sub-neg88.7%
distribute-rgt-out--90.4%
associate-*l*88.7%
distribute-lft-neg-in88.7%
cancel-sign-sub88.7%
associate-*l*88.7%
associate-*l*88.7%
Simplified88.7%
Final simplification87.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 (* x (- (* 18.0 (* y (* z t))) (* i 4.0))))
(t_2 (* k (* j -27.0)))
(t_3 (+ t_2 (* a (* -4.0 t)))))
(if (<= x -1.2e+116)
t_1
(if (<= x -8e+48)
t_3
(if (<= x -2.7e+14)
t_1
(if (<= x 6e-292)
(+ (* c b) t_2)
(if (<= x 6e-270)
(+ (* c b) (* -4.0 (* t a)))
(if (<= x 7.5e-103)
(- (* c b) (* 27.0 (* j k)))
(if (or (<= x 2.2e-42) (not (<= x 8200000000000.0)))
t_1
t_3)))))))))assert(y < z);
assert(j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = x * ((18.0 * (y * (z * t))) - (i * 4.0));
double t_2 = k * (j * -27.0);
double t_3 = t_2 + (a * (-4.0 * t));
double tmp;
if (x <= -1.2e+116) {
tmp = t_1;
} else if (x <= -8e+48) {
tmp = t_3;
} else if (x <= -2.7e+14) {
tmp = t_1;
} else if (x <= 6e-292) {
tmp = (c * b) + t_2;
} else if (x <= 6e-270) {
tmp = (c * b) + (-4.0 * (t * a));
} else if (x <= 7.5e-103) {
tmp = (c * b) - (27.0 * (j * k));
} else if ((x <= 2.2e-42) || !(x <= 8200000000000.0)) {
tmp = t_1;
} else {
tmp = t_3;
}
return tmp;
}
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_1 = x * ((18.0d0 * (y * (z * t))) - (i * 4.0d0))
t_2 = k * (j * (-27.0d0))
t_3 = t_2 + (a * ((-4.0d0) * t))
if (x <= (-1.2d+116)) then
tmp = t_1
else if (x <= (-8d+48)) then
tmp = t_3
else if (x <= (-2.7d+14)) then
tmp = t_1
else if (x <= 6d-292) then
tmp = (c * b) + t_2
else if (x <= 6d-270) then
tmp = (c * b) + ((-4.0d0) * (t * a))
else if (x <= 7.5d-103) then
tmp = (c * b) - (27.0d0 * (j * k))
else if ((x <= 2.2d-42) .or. (.not. (x <= 8200000000000.0d0))) then
tmp = t_1
else
tmp = t_3
end if
code = tmp
end function
assert y < z;
assert j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = x * ((18.0 * (y * (z * t))) - (i * 4.0));
double t_2 = k * (j * -27.0);
double t_3 = t_2 + (a * (-4.0 * t));
double tmp;
if (x <= -1.2e+116) {
tmp = t_1;
} else if (x <= -8e+48) {
tmp = t_3;
} else if (x <= -2.7e+14) {
tmp = t_1;
} else if (x <= 6e-292) {
tmp = (c * b) + t_2;
} else if (x <= 6e-270) {
tmp = (c * b) + (-4.0 * (t * a));
} else if (x <= 7.5e-103) {
tmp = (c * b) - (27.0 * (j * k));
} else if ((x <= 2.2e-42) || !(x <= 8200000000000.0)) {
tmp = t_1;
} else {
tmp = t_3;
}
return tmp;
}
[y, z] = sort([y, z]) [j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): t_1 = x * ((18.0 * (y * (z * t))) - (i * 4.0)) t_2 = k * (j * -27.0) t_3 = t_2 + (a * (-4.0 * t)) tmp = 0 if x <= -1.2e+116: tmp = t_1 elif x <= -8e+48: tmp = t_3 elif x <= -2.7e+14: tmp = t_1 elif x <= 6e-292: tmp = (c * b) + t_2 elif x <= 6e-270: tmp = (c * b) + (-4.0 * (t * a)) elif x <= 7.5e-103: tmp = (c * b) - (27.0 * (j * k)) elif (x <= 2.2e-42) or not (x <= 8200000000000.0): tmp = t_1 else: tmp = t_3 return tmp
y, z = sort([y, z]) j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(x * Float64(Float64(18.0 * Float64(y * Float64(z * t))) - Float64(i * 4.0))) t_2 = Float64(k * Float64(j * -27.0)) t_3 = Float64(t_2 + Float64(a * Float64(-4.0 * t))) tmp = 0.0 if (x <= -1.2e+116) tmp = t_1; elseif (x <= -8e+48) tmp = t_3; elseif (x <= -2.7e+14) tmp = t_1; elseif (x <= 6e-292) tmp = Float64(Float64(c * b) + t_2); elseif (x <= 6e-270) tmp = Float64(Float64(c * b) + Float64(-4.0 * Float64(t * a))); elseif (x <= 7.5e-103) tmp = Float64(Float64(c * b) - Float64(27.0 * Float64(j * k))); elseif ((x <= 2.2e-42) || !(x <= 8200000000000.0)) tmp = t_1; else tmp = t_3; end return tmp end
y, z = num2cell(sort([y, z])){:}
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
t_1 = x * ((18.0 * (y * (z * t))) - (i * 4.0));
t_2 = k * (j * -27.0);
t_3 = t_2 + (a * (-4.0 * t));
tmp = 0.0;
if (x <= -1.2e+116)
tmp = t_1;
elseif (x <= -8e+48)
tmp = t_3;
elseif (x <= -2.7e+14)
tmp = t_1;
elseif (x <= 6e-292)
tmp = (c * b) + t_2;
elseif (x <= 6e-270)
tmp = (c * b) + (-4.0 * (t * a));
elseif (x <= 7.5e-103)
tmp = (c * b) - (27.0 * (j * k));
elseif ((x <= 2.2e-42) || ~((x <= 8200000000000.0)))
tmp = t_1;
else
tmp = t_3;
end
tmp_2 = tmp;
end
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(x * N[(N[(18.0 * N[(y * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(i * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(k * N[(j * -27.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(t$95$2 + N[(a * N[(-4.0 * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.2e+116], t$95$1, If[LessEqual[x, -8e+48], t$95$3, If[LessEqual[x, -2.7e+14], t$95$1, If[LessEqual[x, 6e-292], N[(N[(c * b), $MachinePrecision] + t$95$2), $MachinePrecision], If[LessEqual[x, 6e-270], N[(N[(c * b), $MachinePrecision] + N[(-4.0 * N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 7.5e-103], N[(N[(c * b), $MachinePrecision] - N[(27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[x, 2.2e-42], N[Not[LessEqual[x, 8200000000000.0]], $MachinePrecision]], t$95$1, t$95$3]]]]]]]]]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
t_1 := x \cdot \left(18 \cdot \left(y \cdot \left(z \cdot t\right)\right) - i \cdot 4\right)\\
t_2 := k \cdot \left(j \cdot -27\right)\\
t_3 := t_2 + a \cdot \left(-4 \cdot t\right)\\
\mathbf{if}\;x \leq -1.2 \cdot 10^{+116}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq -8 \cdot 10^{+48}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;x \leq -2.7 \cdot 10^{+14}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 6 \cdot 10^{-292}:\\
\;\;\;\;c \cdot b + t_2\\
\mathbf{elif}\;x \leq 6 \cdot 10^{-270}:\\
\;\;\;\;c \cdot b + -4 \cdot \left(t \cdot a\right)\\
\mathbf{elif}\;x \leq 7.5 \cdot 10^{-103}:\\
\;\;\;\;c \cdot b - 27 \cdot \left(j \cdot k\right)\\
\mathbf{elif}\;x \leq 2.2 \cdot 10^{-42} \lor \neg \left(x \leq 8200000000000\right):\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_3\\
\end{array}
\end{array}
if x < -1.2e116 or -8.00000000000000035e48 < x < -2.7e14 or 7.5e-103 < x < 2.20000000000000005e-42 or 8.2e12 < x Initial program 76.8%
sub-neg76.8%
associate-+l-76.8%
sub-neg76.8%
sub-neg76.8%
distribute-rgt-out--78.5%
associate-*l*81.0%
distribute-lft-neg-in81.0%
cancel-sign-sub81.0%
associate-*l*81.0%
associate-*l*81.0%
Simplified81.0%
Taylor expanded in x around inf 68.5%
if -1.2e116 < x < -8.00000000000000035e48 or 2.20000000000000005e-42 < x < 8.2e12Initial program 86.2%
sub-neg86.2%
*-commutative86.2%
distribute-rgt-neg-in86.2%
Simplified90.8%
fma-udef90.8%
Applied egg-rr90.8%
Taylor expanded in a around inf 64.4%
associate-*r*64.4%
*-commutative64.4%
associate-*l*64.4%
Simplified64.4%
if -2.7e14 < x < 6.00000000000000031e-292Initial program 92.4%
sub-neg92.4%
*-commutative92.4%
distribute-rgt-neg-in92.4%
Simplified89.5%
fma-udef89.5%
Applied egg-rr89.5%
Taylor expanded in b around inf 66.7%
if 6.00000000000000031e-292 < x < 6.00000000000000025e-270Initial program 100.0%
sub-neg100.0%
associate-+l-100.0%
sub-neg100.0%
sub-neg100.0%
distribute-rgt-out--100.0%
associate-*l*89.3%
distribute-lft-neg-in89.3%
cancel-sign-sub89.3%
associate-*l*89.3%
associate-*l*89.3%
Simplified89.3%
Taylor expanded in x around 0 89.1%
Taylor expanded in k around 0 89.1%
if 6.00000000000000025e-270 < x < 7.5e-103Initial program 95.4%
sub-neg95.4%
associate-+l-95.4%
sub-neg95.4%
sub-neg95.4%
distribute-rgt-out--95.4%
associate-*l*88.7%
distribute-lft-neg-in88.7%
cancel-sign-sub88.7%
associate-*l*88.7%
associate-*l*88.6%
Simplified88.6%
Taylor expanded in x around 0 83.8%
Taylor expanded in a around 0 72.1%
Final simplification69.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 (+ (* -27.0 (* j k)) (* 18.0 (* y (* (* x z) t))))))
(if (<= y -1.65e+221)
(+ (* c b) t_1)
(if (<= y 3e-113)
(- (- (* c b) (+ (* 4.0 (* x i)) (* 4.0 (* t a)))) (* k (* j 27.0)))
(+ (* c b) (+ t_1 (* -4.0 (* x i))))))))assert(y < z);
assert(j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = (-27.0 * (j * k)) + (18.0 * (y * ((x * z) * t)));
double tmp;
if (y <= -1.65e+221) {
tmp = (c * b) + t_1;
} else if (y <= 3e-113) {
tmp = ((c * b) - ((4.0 * (x * i)) + (4.0 * (t * a)))) - (k * (j * 27.0));
} else {
tmp = (c * b) + (t_1 + (-4.0 * (x * i)));
}
return tmp;
}
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: tmp
t_1 = ((-27.0d0) * (j * k)) + (18.0d0 * (y * ((x * z) * t)))
if (y <= (-1.65d+221)) then
tmp = (c * b) + t_1
else if (y <= 3d-113) then
tmp = ((c * b) - ((4.0d0 * (x * i)) + (4.0d0 * (t * a)))) - (k * (j * 27.0d0))
else
tmp = (c * b) + (t_1 + ((-4.0d0) * (x * i)))
end if
code = tmp
end function
assert y < z;
assert j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = (-27.0 * (j * k)) + (18.0 * (y * ((x * z) * t)));
double tmp;
if (y <= -1.65e+221) {
tmp = (c * b) + t_1;
} else if (y <= 3e-113) {
tmp = ((c * b) - ((4.0 * (x * i)) + (4.0 * (t * a)))) - (k * (j * 27.0));
} else {
tmp = (c * b) + (t_1 + (-4.0 * (x * i)));
}
return tmp;
}
[y, z] = sort([y, z]) [j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): t_1 = (-27.0 * (j * k)) + (18.0 * (y * ((x * z) * t))) tmp = 0 if y <= -1.65e+221: tmp = (c * b) + t_1 elif y <= 3e-113: tmp = ((c * b) - ((4.0 * (x * i)) + (4.0 * (t * a)))) - (k * (j * 27.0)) else: tmp = (c * b) + (t_1 + (-4.0 * (x * i))) return tmp
y, z = sort([y, z]) j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(Float64(-27.0 * Float64(j * k)) + Float64(18.0 * Float64(y * Float64(Float64(x * z) * t)))) tmp = 0.0 if (y <= -1.65e+221) tmp = Float64(Float64(c * b) + t_1); elseif (y <= 3e-113) tmp = Float64(Float64(Float64(c * b) - Float64(Float64(4.0 * Float64(x * i)) + Float64(4.0 * Float64(t * a)))) - Float64(k * Float64(j * 27.0))); else tmp = Float64(Float64(c * b) + Float64(t_1 + Float64(-4.0 * Float64(x * i)))); end return tmp end
y, z = num2cell(sort([y, z])){:}
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
t_1 = (-27.0 * (j * k)) + (18.0 * (y * ((x * z) * t)));
tmp = 0.0;
if (y <= -1.65e+221)
tmp = (c * b) + t_1;
elseif (y <= 3e-113)
tmp = ((c * b) - ((4.0 * (x * i)) + (4.0 * (t * a)))) - (k * (j * 27.0));
else
tmp = (c * b) + (t_1 + (-4.0 * (x * i)));
end
tmp_2 = tmp;
end
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(N[(-27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision] + N[(18.0 * N[(y * N[(N[(x * z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.65e+221], N[(N[(c * b), $MachinePrecision] + t$95$1), $MachinePrecision], If[LessEqual[y, 3e-113], N[(N[(N[(c * b), $MachinePrecision] - N[(N[(4.0 * N[(x * i), $MachinePrecision]), $MachinePrecision] + N[(4.0 * N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(k * N[(j * 27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(c * b), $MachinePrecision] + N[(t$95$1 + N[(-4.0 * N[(x * i), $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) + 18 \cdot \left(y \cdot \left(\left(x \cdot z\right) \cdot t\right)\right)\\
\mathbf{if}\;y \leq -1.65 \cdot 10^{+221}:\\
\;\;\;\;c \cdot b + t_1\\
\mathbf{elif}\;y \leq 3 \cdot 10^{-113}:\\
\;\;\;\;\left(c \cdot b - \left(4 \cdot \left(x \cdot i\right) + 4 \cdot \left(t \cdot a\right)\right)\right) - k \cdot \left(j \cdot 27\right)\\
\mathbf{else}:\\
\;\;\;\;c \cdot b + \left(t_1 + -4 \cdot \left(x \cdot i\right)\right)\\
\end{array}
\end{array}
if y < -1.64999999999999996e221Initial program 85.3%
sub-neg85.3%
*-commutative85.3%
distribute-rgt-neg-in85.3%
Simplified79.0%
fma-udef79.0%
Applied egg-rr79.0%
Taylor expanded in a around 0 64.8%
fma-def64.8%
fma-def64.8%
*-commutative64.8%
associate-*r*64.7%
*-commutative64.7%
Simplified64.7%
Taylor expanded in i around 0 65.2%
if -1.64999999999999996e221 < y < 3.0000000000000001e-113Initial program 87.4%
Taylor expanded in y around 0 85.2%
if 3.0000000000000001e-113 < y Initial program 82.5%
sub-neg82.5%
+-commutative82.5%
associate-*l*82.6%
distribute-rgt-neg-in82.6%
fma-def83.7%
*-commutative83.7%
distribute-rgt-neg-in83.7%
metadata-eval83.7%
sub-neg83.7%
+-commutative83.7%
associate-*l*83.7%
distribute-rgt-neg-in83.7%
Simplified88.0%
Taylor expanded in a around 0 77.0%
Final simplification81.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 (* k 27.0)))
(t_2 (- (* c b) (+ (* 4.0 (* x i)) (* 4.0 (* t a))))))
(if (<= i -5.8e+39)
(- t_2 t_1)
(if (<= i 1.9e+86)
(- (+ (* t (- (* (* y z) (* x 18.0)) (* a 4.0))) (* c b)) t_1)
(- t_2 (* k (* j 27.0)))))))assert(y < z);
assert(j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = j * (k * 27.0);
double t_2 = (c * b) - ((4.0 * (x * i)) + (4.0 * (t * a)));
double tmp;
if (i <= -5.8e+39) {
tmp = t_2 - t_1;
} else if (i <= 1.9e+86) {
tmp = ((t * (((y * z) * (x * 18.0)) - (a * 4.0))) + (c * b)) - t_1;
} else {
tmp = t_2 - (k * (j * 27.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) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = j * (k * 27.0d0)
t_2 = (c * b) - ((4.0d0 * (x * i)) + (4.0d0 * (t * a)))
if (i <= (-5.8d+39)) then
tmp = t_2 - t_1
else if (i <= 1.9d+86) then
tmp = ((t * (((y * z) * (x * 18.0d0)) - (a * 4.0d0))) + (c * b)) - t_1
else
tmp = t_2 - (k * (j * 27.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 t_1 = j * (k * 27.0);
double t_2 = (c * b) - ((4.0 * (x * i)) + (4.0 * (t * a)));
double tmp;
if (i <= -5.8e+39) {
tmp = t_2 - t_1;
} else if (i <= 1.9e+86) {
tmp = ((t * (((y * z) * (x * 18.0)) - (a * 4.0))) + (c * b)) - t_1;
} else {
tmp = t_2 - (k * (j * 27.0));
}
return tmp;
}
[y, z] = sort([y, z]) [j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): t_1 = j * (k * 27.0) t_2 = (c * b) - ((4.0 * (x * i)) + (4.0 * (t * a))) tmp = 0 if i <= -5.8e+39: tmp = t_2 - t_1 elif i <= 1.9e+86: tmp = ((t * (((y * z) * (x * 18.0)) - (a * 4.0))) + (c * b)) - t_1 else: tmp = t_2 - (k * (j * 27.0)) return tmp
y, z = sort([y, z]) j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(j * Float64(k * 27.0)) t_2 = Float64(Float64(c * b) - Float64(Float64(4.0 * Float64(x * i)) + Float64(4.0 * Float64(t * a)))) tmp = 0.0 if (i <= -5.8e+39) tmp = Float64(t_2 - t_1); elseif (i <= 1.9e+86) tmp = Float64(Float64(Float64(t * Float64(Float64(Float64(y * z) * Float64(x * 18.0)) - Float64(a * 4.0))) + Float64(c * b)) - t_1); else tmp = Float64(t_2 - Float64(k * Float64(j * 27.0))); end return tmp end
y, z = num2cell(sort([y, z])){:}
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
t_1 = j * (k * 27.0);
t_2 = (c * b) - ((4.0 * (x * i)) + (4.0 * (t * a)));
tmp = 0.0;
if (i <= -5.8e+39)
tmp = t_2 - t_1;
elseif (i <= 1.9e+86)
tmp = ((t * (((y * z) * (x * 18.0)) - (a * 4.0))) + (c * b)) - t_1;
else
tmp = t_2 - (k * (j * 27.0));
end
tmp_2 = tmp;
end
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(j * N[(k * 27.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(c * b), $MachinePrecision] - N[(N[(4.0 * N[(x * i), $MachinePrecision]), $MachinePrecision] + N[(4.0 * N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[i, -5.8e+39], N[(t$95$2 - t$95$1), $MachinePrecision], If[LessEqual[i, 1.9e+86], N[(N[(N[(t * N[(N[(N[(y * z), $MachinePrecision] * N[(x * 18.0), $MachinePrecision]), $MachinePrecision] - N[(a * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(c * b), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], N[(t$95$2 - N[(k * N[(j * 27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
t_1 := j \cdot \left(k \cdot 27\right)\\
t_2 := c \cdot b - \left(4 \cdot \left(x \cdot i\right) + 4 \cdot \left(t \cdot a\right)\right)\\
\mathbf{if}\;i \leq -5.8 \cdot 10^{+39}:\\
\;\;\;\;t_2 - t_1\\
\mathbf{elif}\;i \leq 1.9 \cdot 10^{+86}:\\
\;\;\;\;\left(t \cdot \left(\left(y \cdot z\right) \cdot \left(x \cdot 18\right) - a \cdot 4\right) + c \cdot b\right) - t_1\\
\mathbf{else}:\\
\;\;\;\;t_2 - k \cdot \left(j \cdot 27\right)\\
\end{array}
\end{array}
if i < -5.80000000000000059e39Initial program 92.5%
Taylor expanded in y around 0 87.9%
Taylor expanded in j around 0 87.9%
*-commutative87.9%
associate-*r*87.9%
*-commutative87.9%
associate-*l*87.9%
Simplified87.9%
if -5.80000000000000059e39 < i < 1.89999999999999989e86Initial program 86.6%
sub-neg86.6%
associate-+l-86.6%
sub-neg86.6%
sub-neg86.6%
distribute-rgt-out--88.5%
associate-*l*87.2%
distribute-lft-neg-in87.2%
cancel-sign-sub87.2%
associate-*l*87.2%
associate-*l*87.2%
Simplified87.2%
Taylor expanded in x around 0 86.0%
associate-*r*86.1%
Simplified86.1%
if 1.89999999999999989e86 < i Initial program 74.4%
Taylor expanded in y around 0 78.9%
Final simplification85.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 (* x i)))
(t_2 (+ (* c b) (+ (* -27.0 (* j k)) (* 18.0 (* y (* (* x z) t)))))))
(if (<= y -7.4e+220)
t_2
(if (<= y -1.26e-81)
(- (* c b) (+ t_1 (* 4.0 (* t a))))
(if (<= y 1.58e-133) (- (- (* c b) t_1) (* k (* j 27.0))) 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 * (x * i);
double t_2 = (c * b) + ((-27.0 * (j * k)) + (18.0 * (y * ((x * z) * t))));
double tmp;
if (y <= -7.4e+220) {
tmp = t_2;
} else if (y <= -1.26e-81) {
tmp = (c * b) - (t_1 + (4.0 * (t * a)));
} else if (y <= 1.58e-133) {
tmp = ((c * b) - t_1) - (k * (j * 27.0));
} 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 * (x * i)
t_2 = (c * b) + (((-27.0d0) * (j * k)) + (18.0d0 * (y * ((x * z) * t))))
if (y <= (-7.4d+220)) then
tmp = t_2
else if (y <= (-1.26d-81)) then
tmp = (c * b) - (t_1 + (4.0d0 * (t * a)))
else if (y <= 1.58d-133) then
tmp = ((c * b) - t_1) - (k * (j * 27.0d0))
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 * (x * i);
double t_2 = (c * b) + ((-27.0 * (j * k)) + (18.0 * (y * ((x * z) * t))));
double tmp;
if (y <= -7.4e+220) {
tmp = t_2;
} else if (y <= -1.26e-81) {
tmp = (c * b) - (t_1 + (4.0 * (t * a)));
} else if (y <= 1.58e-133) {
tmp = ((c * b) - t_1) - (k * (j * 27.0));
} 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 * (x * i) t_2 = (c * b) + ((-27.0 * (j * k)) + (18.0 * (y * ((x * z) * t)))) tmp = 0 if y <= -7.4e+220: tmp = t_2 elif y <= -1.26e-81: tmp = (c * b) - (t_1 + (4.0 * (t * a))) elif y <= 1.58e-133: tmp = ((c * b) - t_1) - (k * (j * 27.0)) 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(x * i)) t_2 = Float64(Float64(c * b) + Float64(Float64(-27.0 * Float64(j * k)) + Float64(18.0 * Float64(y * Float64(Float64(x * z) * t))))) tmp = 0.0 if (y <= -7.4e+220) tmp = t_2; elseif (y <= -1.26e-81) tmp = Float64(Float64(c * b) - Float64(t_1 + Float64(4.0 * Float64(t * a)))); elseif (y <= 1.58e-133) tmp = Float64(Float64(Float64(c * b) - t_1) - Float64(k * Float64(j * 27.0))); 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 * (x * i);
t_2 = (c * b) + ((-27.0 * (j * k)) + (18.0 * (y * ((x * z) * t))));
tmp = 0.0;
if (y <= -7.4e+220)
tmp = t_2;
elseif (y <= -1.26e-81)
tmp = (c * b) - (t_1 + (4.0 * (t * a)));
elseif (y <= 1.58e-133)
tmp = ((c * b) - t_1) - (k * (j * 27.0));
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[(x * i), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(c * b), $MachinePrecision] + N[(N[(-27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision] + N[(18.0 * N[(y * N[(N[(x * z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -7.4e+220], t$95$2, If[LessEqual[y, -1.26e-81], N[(N[(c * b), $MachinePrecision] - N[(t$95$1 + N[(4.0 * N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.58e-133], N[(N[(N[(c * b), $MachinePrecision] - t$95$1), $MachinePrecision] - N[(k * N[(j * 27.0), $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 := 4 \cdot \left(x \cdot i\right)\\
t_2 := c \cdot b + \left(-27 \cdot \left(j \cdot k\right) + 18 \cdot \left(y \cdot \left(\left(x \cdot z\right) \cdot t\right)\right)\right)\\
\mathbf{if}\;y \leq -7.4 \cdot 10^{+220}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;y \leq -1.26 \cdot 10^{-81}:\\
\;\;\;\;c \cdot b - \left(t_1 + 4 \cdot \left(t \cdot a\right)\right)\\
\mathbf{elif}\;y \leq 1.58 \cdot 10^{-133}:\\
\;\;\;\;\left(c \cdot b - t_1\right) - k \cdot \left(j \cdot 27\right)\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if y < -7.4e220 or 1.58e-133 < y Initial program 83.4%
sub-neg83.4%
*-commutative83.4%
distribute-rgt-neg-in83.4%
Simplified82.5%
fma-udef82.5%
Applied egg-rr82.5%
Taylor expanded in a around 0 75.7%
fma-def75.7%
fma-def75.7%
*-commutative75.7%
associate-*r*74.7%
*-commutative74.7%
Simplified74.7%
Taylor expanded in i around 0 67.7%
if -7.4e220 < y < -1.2599999999999999e-81Initial program 81.3%
Taylor expanded in y around 0 77.9%
Taylor expanded in j around 0 66.5%
if -1.2599999999999999e-81 < y < 1.58e-133Initial program 92.3%
Taylor expanded in t around 0 84.7%
Final simplification72.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
(if (<= y -3.3e+221)
(+ (* c b) (+ (* -27.0 (* j k)) (* 18.0 (* y (* (* x z) t)))))
(if (<= y 7e-84)
(- (- (* c b) (+ (* 4.0 (* x i)) (* 4.0 (* t a)))) (* j (* k 27.0)))
(+ (* x (+ (* 18.0 (* y (* z t))) (* i -4.0))) (* k (* j -27.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 (y <= -3.3e+221) {
tmp = (c * b) + ((-27.0 * (j * k)) + (18.0 * (y * ((x * z) * t))));
} else if (y <= 7e-84) {
tmp = ((c * b) - ((4.0 * (x * i)) + (4.0 * (t * a)))) - (j * (k * 27.0));
} else {
tmp = (x * ((18.0 * (y * (z * t))) + (i * -4.0))) + (k * (j * -27.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 (y <= (-3.3d+221)) then
tmp = (c * b) + (((-27.0d0) * (j * k)) + (18.0d0 * (y * ((x * z) * t))))
else if (y <= 7d-84) then
tmp = ((c * b) - ((4.0d0 * (x * i)) + (4.0d0 * (t * a)))) - (j * (k * 27.0d0))
else
tmp = (x * ((18.0d0 * (y * (z * t))) + (i * (-4.0d0)))) + (k * (j * (-27.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 (y <= -3.3e+221) {
tmp = (c * b) + ((-27.0 * (j * k)) + (18.0 * (y * ((x * z) * t))));
} else if (y <= 7e-84) {
tmp = ((c * b) - ((4.0 * (x * i)) + (4.0 * (t * a)))) - (j * (k * 27.0));
} else {
tmp = (x * ((18.0 * (y * (z * t))) + (i * -4.0))) + (k * (j * -27.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 y <= -3.3e+221: tmp = (c * b) + ((-27.0 * (j * k)) + (18.0 * (y * ((x * z) * t)))) elif y <= 7e-84: tmp = ((c * b) - ((4.0 * (x * i)) + (4.0 * (t * a)))) - (j * (k * 27.0)) else: tmp = (x * ((18.0 * (y * (z * t))) + (i * -4.0))) + (k * (j * -27.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 (y <= -3.3e+221) tmp = Float64(Float64(c * b) + Float64(Float64(-27.0 * Float64(j * k)) + Float64(18.0 * Float64(y * Float64(Float64(x * z) * t))))); elseif (y <= 7e-84) tmp = Float64(Float64(Float64(c * b) - Float64(Float64(4.0 * Float64(x * i)) + Float64(4.0 * Float64(t * a)))) - Float64(j * Float64(k * 27.0))); else tmp = Float64(Float64(x * Float64(Float64(18.0 * Float64(y * Float64(z * t))) + Float64(i * -4.0))) + Float64(k * Float64(j * -27.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 (y <= -3.3e+221)
tmp = (c * b) + ((-27.0 * (j * k)) + (18.0 * (y * ((x * z) * t))));
elseif (y <= 7e-84)
tmp = ((c * b) - ((4.0 * (x * i)) + (4.0 * (t * a)))) - (j * (k * 27.0));
else
tmp = (x * ((18.0 * (y * (z * t))) + (i * -4.0))) + (k * (j * -27.0));
end
tmp_2 = tmp;
end
NOTE: y and z should be sorted in increasing order before calling this function. NOTE: j and k should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := If[LessEqual[y, -3.3e+221], N[(N[(c * b), $MachinePrecision] + N[(N[(-27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision] + N[(18.0 * N[(y * N[(N[(x * z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 7e-84], N[(N[(N[(c * b), $MachinePrecision] - N[(N[(4.0 * N[(x * i), $MachinePrecision]), $MachinePrecision] + N[(4.0 * N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(j * N[(k * 27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * N[(N[(18.0 * N[(y * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(i * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(k * N[(j * -27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.3 \cdot 10^{+221}:\\
\;\;\;\;c \cdot b + \left(-27 \cdot \left(j \cdot k\right) + 18 \cdot \left(y \cdot \left(\left(x \cdot z\right) \cdot t\right)\right)\right)\\
\mathbf{elif}\;y \leq 7 \cdot 10^{-84}:\\
\;\;\;\;\left(c \cdot b - \left(4 \cdot \left(x \cdot i\right) + 4 \cdot \left(t \cdot a\right)\right)\right) - j \cdot \left(k \cdot 27\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(18 \cdot \left(y \cdot \left(z \cdot t\right)\right) + i \cdot -4\right) + k \cdot \left(j \cdot -27\right)\\
\end{array}
\end{array}
if y < -3.29999999999999991e221Initial program 85.3%
sub-neg85.3%
*-commutative85.3%
distribute-rgt-neg-in85.3%
Simplified79.0%
fma-udef79.0%
Applied egg-rr79.0%
Taylor expanded in a around 0 64.8%
fma-def64.8%
fma-def64.8%
*-commutative64.8%
associate-*r*64.7%
*-commutative64.7%
Simplified64.7%
Taylor expanded in i around 0 65.2%
if -3.29999999999999991e221 < y < 7.0000000000000002e-84Initial program 87.6%
Taylor expanded in y around 0 84.9%
Taylor expanded in j around 0 84.9%
*-commutative84.9%
associate-*r*84.9%
*-commutative84.9%
associate-*l*84.9%
Simplified84.9%
if 7.0000000000000002e-84 < y Initial program 81.7%
sub-neg81.7%
*-commutative81.7%
distribute-rgt-neg-in81.7%
Simplified81.6%
fma-udef81.6%
Applied egg-rr81.6%
Taylor expanded in x around inf 65.8%
Final simplification77.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 (* j (* k -27.0))) (t_2 (* -4.0 (* x i))))
(if (<= i -8e+36)
t_2
(if (<= i -1.7e-202)
t_1
(if (<= i 2.5e-223)
(* c b)
(if (<= i 3.3e-106)
(* x (* (* 18.0 y) (* z t)))
(if (<= i 3.2e+18)
(* c b)
(if (<= i 3.2e+71)
t_1
(if (<= i 1.1e+188) (* 18.0 (* y (* (* x z) 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 * (k * -27.0);
double t_2 = -4.0 * (x * i);
double tmp;
if (i <= -8e+36) {
tmp = t_2;
} else if (i <= -1.7e-202) {
tmp = t_1;
} else if (i <= 2.5e-223) {
tmp = c * b;
} else if (i <= 3.3e-106) {
tmp = x * ((18.0 * y) * (z * t));
} else if (i <= 3.2e+18) {
tmp = c * b;
} else if (i <= 3.2e+71) {
tmp = t_1;
} else if (i <= 1.1e+188) {
tmp = 18.0 * (y * ((x * z) * 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 * (k * (-27.0d0))
t_2 = (-4.0d0) * (x * i)
if (i <= (-8d+36)) then
tmp = t_2
else if (i <= (-1.7d-202)) then
tmp = t_1
else if (i <= 2.5d-223) then
tmp = c * b
else if (i <= 3.3d-106) then
tmp = x * ((18.0d0 * y) * (z * t))
else if (i <= 3.2d+18) then
tmp = c * b
else if (i <= 3.2d+71) then
tmp = t_1
else if (i <= 1.1d+188) then
tmp = 18.0d0 * (y * ((x * z) * 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 * (k * -27.0);
double t_2 = -4.0 * (x * i);
double tmp;
if (i <= -8e+36) {
tmp = t_2;
} else if (i <= -1.7e-202) {
tmp = t_1;
} else if (i <= 2.5e-223) {
tmp = c * b;
} else if (i <= 3.3e-106) {
tmp = x * ((18.0 * y) * (z * t));
} else if (i <= 3.2e+18) {
tmp = c * b;
} else if (i <= 3.2e+71) {
tmp = t_1;
} else if (i <= 1.1e+188) {
tmp = 18.0 * (y * ((x * z) * 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 * (k * -27.0) t_2 = -4.0 * (x * i) tmp = 0 if i <= -8e+36: tmp = t_2 elif i <= -1.7e-202: tmp = t_1 elif i <= 2.5e-223: tmp = c * b elif i <= 3.3e-106: tmp = x * ((18.0 * y) * (z * t)) elif i <= 3.2e+18: tmp = c * b elif i <= 3.2e+71: tmp = t_1 elif i <= 1.1e+188: tmp = 18.0 * (y * ((x * z) * 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(j * Float64(k * -27.0)) t_2 = Float64(-4.0 * Float64(x * i)) tmp = 0.0 if (i <= -8e+36) tmp = t_2; elseif (i <= -1.7e-202) tmp = t_1; elseif (i <= 2.5e-223) tmp = Float64(c * b); elseif (i <= 3.3e-106) tmp = Float64(x * Float64(Float64(18.0 * y) * Float64(z * t))); elseif (i <= 3.2e+18) tmp = Float64(c * b); elseif (i <= 3.2e+71) tmp = t_1; elseif (i <= 1.1e+188) tmp = Float64(18.0 * Float64(y * Float64(Float64(x * z) * 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 * (k * -27.0);
t_2 = -4.0 * (x * i);
tmp = 0.0;
if (i <= -8e+36)
tmp = t_2;
elseif (i <= -1.7e-202)
tmp = t_1;
elseif (i <= 2.5e-223)
tmp = c * b;
elseif (i <= 3.3e-106)
tmp = x * ((18.0 * y) * (z * t));
elseif (i <= 3.2e+18)
tmp = c * b;
elseif (i <= 3.2e+71)
tmp = t_1;
elseif (i <= 1.1e+188)
tmp = 18.0 * (y * ((x * z) * 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[(j * N[(k * -27.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(-4.0 * N[(x * i), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[i, -8e+36], t$95$2, If[LessEqual[i, -1.7e-202], t$95$1, If[LessEqual[i, 2.5e-223], N[(c * b), $MachinePrecision], If[LessEqual[i, 3.3e-106], N[(x * N[(N[(18.0 * y), $MachinePrecision] * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[i, 3.2e+18], N[(c * b), $MachinePrecision], If[LessEqual[i, 3.2e+71], t$95$1, If[LessEqual[i, 1.1e+188], N[(18.0 * N[(y * N[(N[(x * z), $MachinePrecision] * t), $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 := j \cdot \left(k \cdot -27\right)\\
t_2 := -4 \cdot \left(x \cdot i\right)\\
\mathbf{if}\;i \leq -8 \cdot 10^{+36}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;i \leq -1.7 \cdot 10^{-202}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;i \leq 2.5 \cdot 10^{-223}:\\
\;\;\;\;c \cdot b\\
\mathbf{elif}\;i \leq 3.3 \cdot 10^{-106}:\\
\;\;\;\;x \cdot \left(\left(18 \cdot y\right) \cdot \left(z \cdot t\right)\right)\\
\mathbf{elif}\;i \leq 3.2 \cdot 10^{+18}:\\
\;\;\;\;c \cdot b\\
\mathbf{elif}\;i \leq 3.2 \cdot 10^{+71}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;i \leq 1.1 \cdot 10^{+188}:\\
\;\;\;\;18 \cdot \left(y \cdot \left(\left(x \cdot z\right) \cdot t\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if i < -8.00000000000000034e36 or 1.09999999999999999e188 < i Initial program 87.8%
sub-neg87.8%
+-commutative87.8%
associate-*l*87.9%
distribute-rgt-neg-in87.9%
fma-def89.1%
*-commutative89.1%
distribute-rgt-neg-in89.1%
metadata-eval89.1%
sub-neg89.1%
+-commutative89.1%
associate-*l*89.1%
distribute-rgt-neg-in89.1%
Simplified90.4%
Taylor expanded in i around inf 56.0%
*-commutative56.0%
Simplified56.0%
if -8.00000000000000034e36 < i < -1.70000000000000006e-202 or 3.2e18 < i < 3.20000000000000023e71Initial program 83.7%
sub-neg83.7%
*-commutative83.7%
distribute-rgt-neg-in83.7%
Simplified86.8%
fma-udef86.8%
Applied egg-rr86.8%
Taylor expanded in a around 0 73.1%
fma-def73.1%
fma-def73.1%
*-commutative73.1%
associate-*r*73.1%
*-commutative73.1%
Simplified73.1%
Taylor expanded in k around inf 43.9%
associate-*r*43.9%
Simplified43.9%
if -1.70000000000000006e-202 < i < 2.50000000000000012e-223 or 3.30000000000000016e-106 < i < 3.2e18Initial program 90.4%
sub-neg90.4%
*-commutative90.4%
distribute-rgt-neg-in90.4%
Simplified88.7%
fma-udef88.7%
Applied egg-rr88.7%
Taylor expanded in a around 0 74.7%
fma-def74.7%
fma-def74.7%
*-commutative74.7%
associate-*r*73.1%
*-commutative73.1%
Simplified73.1%
Taylor expanded in c around inf 44.2%
if 2.50000000000000012e-223 < i < 3.30000000000000016e-106Initial program 85.2%
sub-neg85.2%
associate-+l-85.2%
sub-neg85.2%
sub-neg85.2%
distribute-rgt-out--85.2%
associate-*l*85.2%
distribute-lft-neg-in85.2%
cancel-sign-sub85.2%
associate-*l*85.2%
associate-*l*85.2%
Simplified85.2%
Taylor expanded in x around inf 56.2%
Taylor expanded in y around inf 51.4%
associate-*r*51.4%
*-commutative51.4%
Simplified51.4%
if 3.20000000000000023e71 < i < 1.09999999999999999e188Initial program 70.8%
sub-neg70.8%
*-commutative70.8%
distribute-rgt-neg-in70.8%
Simplified70.8%
fma-udef70.8%
Applied egg-rr70.8%
Taylor expanded in a around 0 66.7%
fma-def66.7%
fma-def66.7%
*-commutative66.7%
associate-*r*66.7%
*-commutative66.7%
Simplified66.7%
fma-udef66.7%
*-commutative66.7%
associate-*r*66.7%
*-commutative66.7%
associate-*r*66.7%
associate-*l*66.7%
*-commutative66.7%
associate-*r*66.7%
Applied egg-rr66.7%
Taylor expanded in y around inf 38.7%
Final simplification48.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 (- (* c b) (+ (* 4.0 (* x i)) (* 4.0 (* t a)))))
(t_2 (* k (* j -27.0))))
(if (<= j -1.5e+203)
(+ t_2 (* x (* i -4.0)))
(if (<= j -1.6e+52)
t_1
(if (<= j -1.7e+35)
(* t (- (* 18.0 (* y (* x z))) (* a 4.0)))
(if (<= j 1.6e-13) t_1 (+ (* c b) 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 = (c * b) - ((4.0 * (x * i)) + (4.0 * (t * a)));
double t_2 = k * (j * -27.0);
double tmp;
if (j <= -1.5e+203) {
tmp = t_2 + (x * (i * -4.0));
} else if (j <= -1.6e+52) {
tmp = t_1;
} else if (j <= -1.7e+35) {
tmp = t * ((18.0 * (y * (x * z))) - (a * 4.0));
} else if (j <= 1.6e-13) {
tmp = t_1;
} else {
tmp = (c * b) + 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 = (c * b) - ((4.0d0 * (x * i)) + (4.0d0 * (t * a)))
t_2 = k * (j * (-27.0d0))
if (j <= (-1.5d+203)) then
tmp = t_2 + (x * (i * (-4.0d0)))
else if (j <= (-1.6d+52)) then
tmp = t_1
else if (j <= (-1.7d+35)) then
tmp = t * ((18.0d0 * (y * (x * z))) - (a * 4.0d0))
else if (j <= 1.6d-13) then
tmp = t_1
else
tmp = (c * b) + 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 = (c * b) - ((4.0 * (x * i)) + (4.0 * (t * a)));
double t_2 = k * (j * -27.0);
double tmp;
if (j <= -1.5e+203) {
tmp = t_2 + (x * (i * -4.0));
} else if (j <= -1.6e+52) {
tmp = t_1;
} else if (j <= -1.7e+35) {
tmp = t * ((18.0 * (y * (x * z))) - (a * 4.0));
} else if (j <= 1.6e-13) {
tmp = t_1;
} else {
tmp = (c * b) + 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 = (c * b) - ((4.0 * (x * i)) + (4.0 * (t * a))) t_2 = k * (j * -27.0) tmp = 0 if j <= -1.5e+203: tmp = t_2 + (x * (i * -4.0)) elif j <= -1.6e+52: tmp = t_1 elif j <= -1.7e+35: tmp = t * ((18.0 * (y * (x * z))) - (a * 4.0)) elif j <= 1.6e-13: tmp = t_1 else: tmp = (c * b) + 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(c * b) - Float64(Float64(4.0 * Float64(x * i)) + Float64(4.0 * Float64(t * a)))) t_2 = Float64(k * Float64(j * -27.0)) tmp = 0.0 if (j <= -1.5e+203) tmp = Float64(t_2 + Float64(x * Float64(i * -4.0))); elseif (j <= -1.6e+52) tmp = t_1; elseif (j <= -1.7e+35) tmp = Float64(t * Float64(Float64(18.0 * Float64(y * Float64(x * z))) - Float64(a * 4.0))); elseif (j <= 1.6e-13) tmp = t_1; else tmp = Float64(Float64(c * b) + 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 = (c * b) - ((4.0 * (x * i)) + (4.0 * (t * a)));
t_2 = k * (j * -27.0);
tmp = 0.0;
if (j <= -1.5e+203)
tmp = t_2 + (x * (i * -4.0));
elseif (j <= -1.6e+52)
tmp = t_1;
elseif (j <= -1.7e+35)
tmp = t * ((18.0 * (y * (x * z))) - (a * 4.0));
elseif (j <= 1.6e-13)
tmp = t_1;
else
tmp = (c * b) + 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[(c * b), $MachinePrecision] - N[(N[(4.0 * N[(x * i), $MachinePrecision]), $MachinePrecision] + N[(4.0 * N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(k * N[(j * -27.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[j, -1.5e+203], N[(t$95$2 + N[(x * N[(i * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[j, -1.6e+52], t$95$1, If[LessEqual[j, -1.7e+35], N[(t * N[(N[(18.0 * N[(y * N[(x * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(a * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[j, 1.6e-13], t$95$1, N[(N[(c * b), $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 := c \cdot b - \left(4 \cdot \left(x \cdot i\right) + 4 \cdot \left(t \cdot a\right)\right)\\
t_2 := k \cdot \left(j \cdot -27\right)\\
\mathbf{if}\;j \leq -1.5 \cdot 10^{+203}:\\
\;\;\;\;t_2 + x \cdot \left(i \cdot -4\right)\\
\mathbf{elif}\;j \leq -1.6 \cdot 10^{+52}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;j \leq -1.7 \cdot 10^{+35}:\\
\;\;\;\;t \cdot \left(18 \cdot \left(y \cdot \left(x \cdot z\right)\right) - a \cdot 4\right)\\
\mathbf{elif}\;j \leq 1.6 \cdot 10^{-13}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;c \cdot b + t_2\\
\end{array}
\end{array}
if j < -1.5e203Initial program 71.8%
sub-neg71.8%
*-commutative71.8%
distribute-rgt-neg-in71.8%
Simplified71.8%
fma-udef71.8%
Applied egg-rr71.8%
Taylor expanded in i around inf 75.0%
*-commutative75.0%
*-commutative75.0%
associate-*l*75.0%
*-commutative75.0%
Simplified75.0%
if -1.5e203 < j < -1.6e52 or -1.7000000000000001e35 < j < 1.6e-13Initial program 87.9%
Taylor expanded in y around 0 76.3%
Taylor expanded in j around 0 66.1%
if -1.6e52 < j < -1.7000000000000001e35Initial program 85.5%
sub-neg85.5%
associate-+l-85.5%
sub-neg85.5%
sub-neg85.5%
distribute-rgt-out--85.5%
associate-*l*85.5%
distribute-lft-neg-in85.5%
cancel-sign-sub85.5%
associate-*l*85.5%
associate-*l*85.5%
Simplified85.5%
Taylor expanded in t around inf 57.9%
if 1.6e-13 < j Initial program 85.5%
sub-neg85.5%
*-commutative85.5%
distribute-rgt-neg-in85.5%
Simplified85.4%
fma-udef85.4%
Applied egg-rr85.4%
Taylor expanded in b around inf 54.4%
Final simplification63.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 (if (or (<= x -2.9e-27) (not (<= x 8.6e-87))) (+ (* x (+ (* 18.0 (* y (* z t))) (* i -4.0))) (* k (* j -27.0))) (- (+ (* c b) (* -4.0 (* t a))) (* 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 tmp;
if ((x <= -2.9e-27) || !(x <= 8.6e-87)) {
tmp = (x * ((18.0 * (y * (z * t))) + (i * -4.0))) + (k * (j * -27.0));
} else {
tmp = ((c * b) + (-4.0 * (t * a))) - (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) :: tmp
if ((x <= (-2.9d-27)) .or. (.not. (x <= 8.6d-87))) then
tmp = (x * ((18.0d0 * (y * (z * t))) + (i * (-4.0d0)))) + (k * (j * (-27.0d0)))
else
tmp = ((c * b) + ((-4.0d0) * (t * a))) - (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 tmp;
if ((x <= -2.9e-27) || !(x <= 8.6e-87)) {
tmp = (x * ((18.0 * (y * (z * t))) + (i * -4.0))) + (k * (j * -27.0));
} else {
tmp = ((c * b) + (-4.0 * (t * a))) - (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): tmp = 0 if (x <= -2.9e-27) or not (x <= 8.6e-87): tmp = (x * ((18.0 * (y * (z * t))) + (i * -4.0))) + (k * (j * -27.0)) else: tmp = ((c * b) + (-4.0 * (t * a))) - (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) tmp = 0.0 if ((x <= -2.9e-27) || !(x <= 8.6e-87)) tmp = Float64(Float64(x * Float64(Float64(18.0 * Float64(y * Float64(z * t))) + Float64(i * -4.0))) + Float64(k * Float64(j * -27.0))); else tmp = Float64(Float64(Float64(c * b) + Float64(-4.0 * Float64(t * a))) - 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)
tmp = 0.0;
if ((x <= -2.9e-27) || ~((x <= 8.6e-87)))
tmp = (x * ((18.0 * (y * (z * t))) + (i * -4.0))) + (k * (j * -27.0));
else
tmp = ((c * b) + (-4.0 * (t * a))) - (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_] := If[Or[LessEqual[x, -2.9e-27], N[Not[LessEqual[x, 8.6e-87]], $MachinePrecision]], N[(N[(x * N[(N[(18.0 * N[(y * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(i * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(k * N[(j * -27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(c * b), $MachinePrecision] + N[(-4.0 * N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.9 \cdot 10^{-27} \lor \neg \left(x \leq 8.6 \cdot 10^{-87}\right):\\
\;\;\;\;x \cdot \left(18 \cdot \left(y \cdot \left(z \cdot t\right)\right) + i \cdot -4\right) + k \cdot \left(j \cdot -27\right)\\
\mathbf{else}:\\
\;\;\;\;\left(c \cdot b + -4 \cdot \left(t \cdot a\right)\right) - 27 \cdot \left(j \cdot k\right)\\
\end{array}
\end{array}
if x < -2.90000000000000004e-27 or 8.59999999999999991e-87 < x Initial program 78.1%
sub-neg78.1%
*-commutative78.1%
distribute-rgt-neg-in78.1%
Simplified83.0%
fma-udef82.2%
Applied egg-rr82.2%
Taylor expanded in x around inf 72.9%
if -2.90000000000000004e-27 < x < 8.59999999999999991e-87Initial program 94.8%
sub-neg94.8%
associate-+l-94.8%
sub-neg94.8%
sub-neg94.8%
distribute-rgt-out--95.6%
associate-*l*89.8%
distribute-lft-neg-in89.8%
cancel-sign-sub89.8%
associate-*l*89.8%
associate-*l*89.8%
Simplified89.8%
Taylor expanded in x around 0 83.1%
Final simplification77.5%
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (* k (* j -27.0))))
(if (or (<= b -1.65e+161)
(and (not (<= b -1.5e+92))
(or (<= b -1.05e+40) (not (<= b 8e-153)))))
(+ (* c b) t_1)
(+ t_1 (* x (* 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 t_1 = k * (j * -27.0);
double tmp;
if ((b <= -1.65e+161) || (!(b <= -1.5e+92) && ((b <= -1.05e+40) || !(b <= 8e-153)))) {
tmp = (c * b) + t_1;
} else {
tmp = t_1 + (x * (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) :: t_1
real(8) :: tmp
t_1 = k * (j * (-27.0d0))
if ((b <= (-1.65d+161)) .or. (.not. (b <= (-1.5d+92))) .and. (b <= (-1.05d+40)) .or. (.not. (b <= 8d-153))) then
tmp = (c * b) + t_1
else
tmp = t_1 + (x * (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 t_1 = k * (j * -27.0);
double tmp;
if ((b <= -1.65e+161) || (!(b <= -1.5e+92) && ((b <= -1.05e+40) || !(b <= 8e-153)))) {
tmp = (c * b) + t_1;
} else {
tmp = t_1 + (x * (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): t_1 = k * (j * -27.0) tmp = 0 if (b <= -1.65e+161) or (not (b <= -1.5e+92) and ((b <= -1.05e+40) or not (b <= 8e-153))): tmp = (c * b) + t_1 else: tmp = t_1 + (x * (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) t_1 = Float64(k * Float64(j * -27.0)) tmp = 0.0 if ((b <= -1.65e+161) || (!(b <= -1.5e+92) && ((b <= -1.05e+40) || !(b <= 8e-153)))) tmp = Float64(Float64(c * b) + t_1); else tmp = Float64(t_1 + Float64(x * 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)
t_1 = k * (j * -27.0);
tmp = 0.0;
if ((b <= -1.65e+161) || (~((b <= -1.5e+92)) && ((b <= -1.05e+40) || ~((b <= 8e-153)))))
tmp = (c * b) + t_1;
else
tmp = t_1 + (x * (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_] := Block[{t$95$1 = N[(k * N[(j * -27.0), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[b, -1.65e+161], And[N[Not[LessEqual[b, -1.5e+92]], $MachinePrecision], Or[LessEqual[b, -1.05e+40], N[Not[LessEqual[b, 8e-153]], $MachinePrecision]]]], N[(N[(c * b), $MachinePrecision] + t$95$1), $MachinePrecision], N[(t$95$1 + N[(x * N[(i * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
t_1 := k \cdot \left(j \cdot -27\right)\\
\mathbf{if}\;b \leq -1.65 \cdot 10^{+161} \lor \neg \left(b \leq -1.5 \cdot 10^{+92}\right) \land \left(b \leq -1.05 \cdot 10^{+40} \lor \neg \left(b \leq 8 \cdot 10^{-153}\right)\right):\\
\;\;\;\;c \cdot b + t_1\\
\mathbf{else}:\\
\;\;\;\;t_1 + x \cdot \left(i \cdot -4\right)\\
\end{array}
\end{array}
if b < -1.64999999999999999e161 or -1.50000000000000007e92 < b < -1.05000000000000005e40 or 8.00000000000000031e-153 < b Initial program 84.0%
sub-neg84.0%
*-commutative84.0%
distribute-rgt-neg-in84.0%
Simplified84.8%
fma-udef84.1%
Applied egg-rr84.1%
Taylor expanded in b around inf 62.5%
if -1.64999999999999999e161 < b < -1.50000000000000007e92 or -1.05000000000000005e40 < b < 8.00000000000000031e-153Initial program 87.3%
sub-neg87.3%
*-commutative87.3%
distribute-rgt-neg-in87.3%
Simplified87.3%
fma-udef87.3%
Applied egg-rr87.3%
Taylor expanded in i around inf 52.5%
*-commutative52.5%
*-commutative52.5%
associate-*l*52.5%
*-commutative52.5%
Simplified52.5%
Final simplification57.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 (* k (* j -27.0))) (t_2 (+ t_1 (* x (* i -4.0)))))
(if (<= x -3.4e-27)
t_2
(if (<= x 2.4e-102)
(+ (* c b) t_1)
(if (<= x 2.2e+116) t_2 (* t (- (* 18.0 (* y (* x z))) (* a 4.0))))))))assert(y < z);
assert(j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = k * (j * -27.0);
double t_2 = t_1 + (x * (i * -4.0));
double tmp;
if (x <= -3.4e-27) {
tmp = t_2;
} else if (x <= 2.4e-102) {
tmp = (c * b) + t_1;
} else if (x <= 2.2e+116) {
tmp = t_2;
} else {
tmp = t * ((18.0 * (y * (x * z))) - (a * 4.0));
}
return tmp;
}
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = k * (j * (-27.0d0))
t_2 = t_1 + (x * (i * (-4.0d0)))
if (x <= (-3.4d-27)) then
tmp = t_2
else if (x <= 2.4d-102) then
tmp = (c * b) + t_1
else if (x <= 2.2d+116) then
tmp = t_2
else
tmp = t * ((18.0d0 * (y * (x * z))) - (a * 4.0d0))
end if
code = tmp
end function
assert y < z;
assert j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = k * (j * -27.0);
double t_2 = t_1 + (x * (i * -4.0));
double tmp;
if (x <= -3.4e-27) {
tmp = t_2;
} else if (x <= 2.4e-102) {
tmp = (c * b) + t_1;
} else if (x <= 2.2e+116) {
tmp = t_2;
} else {
tmp = t * ((18.0 * (y * (x * z))) - (a * 4.0));
}
return tmp;
}
[y, z] = sort([y, z]) [j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): t_1 = k * (j * -27.0) t_2 = t_1 + (x * (i * -4.0)) tmp = 0 if x <= -3.4e-27: tmp = t_2 elif x <= 2.4e-102: tmp = (c * b) + t_1 elif x <= 2.2e+116: tmp = t_2 else: tmp = t * ((18.0 * (y * (x * z))) - (a * 4.0)) return tmp
y, z = sort([y, z]) j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(k * Float64(j * -27.0)) t_2 = Float64(t_1 + Float64(x * Float64(i * -4.0))) tmp = 0.0 if (x <= -3.4e-27) tmp = t_2; elseif (x <= 2.4e-102) tmp = Float64(Float64(c * b) + t_1); elseif (x <= 2.2e+116) tmp = t_2; else tmp = Float64(t * Float64(Float64(18.0 * Float64(y * Float64(x * z))) - Float64(a * 4.0))); end return tmp end
y, z = num2cell(sort([y, z])){:}
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
t_1 = k * (j * -27.0);
t_2 = t_1 + (x * (i * -4.0));
tmp = 0.0;
if (x <= -3.4e-27)
tmp = t_2;
elseif (x <= 2.4e-102)
tmp = (c * b) + t_1;
elseif (x <= 2.2e+116)
tmp = t_2;
else
tmp = t * ((18.0 * (y * (x * z))) - (a * 4.0));
end
tmp_2 = tmp;
end
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(k * N[(j * -27.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t$95$1 + N[(x * N[(i * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -3.4e-27], t$95$2, If[LessEqual[x, 2.4e-102], N[(N[(c * b), $MachinePrecision] + t$95$1), $MachinePrecision], If[LessEqual[x, 2.2e+116], t$95$2, N[(t * N[(N[(18.0 * N[(y * N[(x * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(a * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
t_1 := k \cdot \left(j \cdot -27\right)\\
t_2 := t_1 + x \cdot \left(i \cdot -4\right)\\
\mathbf{if}\;x \leq -3.4 \cdot 10^{-27}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x \leq 2.4 \cdot 10^{-102}:\\
\;\;\;\;c \cdot b + t_1\\
\mathbf{elif}\;x \leq 2.2 \cdot 10^{+116}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;t \cdot \left(18 \cdot \left(y \cdot \left(x \cdot z\right)\right) - a \cdot 4\right)\\
\end{array}
\end{array}
if x < -3.3999999999999997e-27 or 2.4e-102 < x < 2.2e116Initial program 83.1%
sub-neg83.1%
*-commutative83.1%
distribute-rgt-neg-in83.1%
Simplified85.7%
fma-udef85.7%
Applied egg-rr85.7%
Taylor expanded in i around inf 53.9%
*-commutative53.9%
*-commutative53.9%
associate-*l*53.9%
*-commutative53.9%
Simplified53.9%
if -3.3999999999999997e-27 < x < 2.4e-102Initial program 94.6%
sub-neg94.6%
*-commutative94.6%
distribute-rgt-neg-in94.6%
Simplified89.5%
fma-udef89.5%
Applied egg-rr89.5%
Taylor expanded in b around inf 64.9%
if 2.2e116 < x Initial program 62.5%
sub-neg62.5%
associate-+l-62.5%
sub-neg62.5%
sub-neg62.5%
distribute-rgt-out--65.7%
associate-*l*71.8%
distribute-lft-neg-in71.8%
cancel-sign-sub71.8%
associate-*l*71.8%
associate-*l*71.8%
Simplified71.8%
Taylor expanded in t around inf 63.6%
Final simplification59.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 (or (<= i -1e+40) (not (<= i 5.8e+191))) (- (* c b) (+ (* 4.0 (* x i)) (* 4.0 (* t a)))) (- (+ (* c b) (* -4.0 (* t a))) (* 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 tmp;
if ((i <= -1e+40) || !(i <= 5.8e+191)) {
tmp = (c * b) - ((4.0 * (x * i)) + (4.0 * (t * a)));
} else {
tmp = ((c * b) + (-4.0 * (t * a))) - (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) :: tmp
if ((i <= (-1d+40)) .or. (.not. (i <= 5.8d+191))) then
tmp = (c * b) - ((4.0d0 * (x * i)) + (4.0d0 * (t * a)))
else
tmp = ((c * b) + ((-4.0d0) * (t * a))) - (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 tmp;
if ((i <= -1e+40) || !(i <= 5.8e+191)) {
tmp = (c * b) - ((4.0 * (x * i)) + (4.0 * (t * a)));
} else {
tmp = ((c * b) + (-4.0 * (t * a))) - (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): tmp = 0 if (i <= -1e+40) or not (i <= 5.8e+191): tmp = (c * b) - ((4.0 * (x * i)) + (4.0 * (t * a))) else: tmp = ((c * b) + (-4.0 * (t * a))) - (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) tmp = 0.0 if ((i <= -1e+40) || !(i <= 5.8e+191)) tmp = Float64(Float64(c * b) - Float64(Float64(4.0 * Float64(x * i)) + Float64(4.0 * Float64(t * a)))); else tmp = Float64(Float64(Float64(c * b) + Float64(-4.0 * Float64(t * a))) - 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)
tmp = 0.0;
if ((i <= -1e+40) || ~((i <= 5.8e+191)))
tmp = (c * b) - ((4.0 * (x * i)) + (4.0 * (t * a)));
else
tmp = ((c * b) + (-4.0 * (t * a))) - (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_] := If[Or[LessEqual[i, -1e+40], N[Not[LessEqual[i, 5.8e+191]], $MachinePrecision]], N[(N[(c * b), $MachinePrecision] - N[(N[(4.0 * N[(x * i), $MachinePrecision]), $MachinePrecision] + N[(4.0 * N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(c * b), $MachinePrecision] + N[(-4.0 * N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
\mathbf{if}\;i \leq -1 \cdot 10^{+40} \lor \neg \left(i \leq 5.8 \cdot 10^{+191}\right):\\
\;\;\;\;c \cdot b - \left(4 \cdot \left(x \cdot i\right) + 4 \cdot \left(t \cdot a\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(c \cdot b + -4 \cdot \left(t \cdot a\right)\right) - 27 \cdot \left(j \cdot k\right)\\
\end{array}
\end{array}
if i < -1.00000000000000003e40 or 5.8000000000000003e191 < i Initial program 87.7%
Taylor expanded in y around 0 87.1%
Taylor expanded in j around 0 73.7%
if -1.00000000000000003e40 < i < 5.8000000000000003e191Initial program 84.6%
sub-neg84.6%
associate-+l-84.6%
sub-neg84.6%
sub-neg84.6%
distribute-rgt-out--86.3%
associate-*l*85.1%
distribute-lft-neg-in85.1%
cancel-sign-sub85.1%
associate-*l*85.1%
associate-*l*85.1%
Simplified85.1%
Taylor expanded in x around 0 72.1%
Final simplification72.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
(if (<= c -1.4e-35)
(* c b)
(if (<= c 1.75e-196)
(* -4.0 (* x i))
(if (<= c 9.5e-114)
(* -27.0 (* j k))
(if (<= c 85000.0)
(* 18.0 (* y (* (* x z) t)))
(if (<= c 2.7e+39)
(* c b)
(if (<= c 2.6e+100) (* t (* -4.0 a)) (* c b))))))))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 <= -1.4e-35) {
tmp = c * b;
} else if (c <= 1.75e-196) {
tmp = -4.0 * (x * i);
} else if (c <= 9.5e-114) {
tmp = -27.0 * (j * k);
} else if (c <= 85000.0) {
tmp = 18.0 * (y * ((x * z) * t));
} else if (c <= 2.7e+39) {
tmp = c * b;
} else if (c <= 2.6e+100) {
tmp = t * (-4.0 * a);
} else {
tmp = c * b;
}
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 <= (-1.4d-35)) then
tmp = c * b
else if (c <= 1.75d-196) then
tmp = (-4.0d0) * (x * i)
else if (c <= 9.5d-114) then
tmp = (-27.0d0) * (j * k)
else if (c <= 85000.0d0) then
tmp = 18.0d0 * (y * ((x * z) * t))
else if (c <= 2.7d+39) then
tmp = c * b
else if (c <= 2.6d+100) then
tmp = t * ((-4.0d0) * a)
else
tmp = c * b
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 <= -1.4e-35) {
tmp = c * b;
} else if (c <= 1.75e-196) {
tmp = -4.0 * (x * i);
} else if (c <= 9.5e-114) {
tmp = -27.0 * (j * k);
} else if (c <= 85000.0) {
tmp = 18.0 * (y * ((x * z) * t));
} else if (c <= 2.7e+39) {
tmp = c * b;
} else if (c <= 2.6e+100) {
tmp = t * (-4.0 * a);
} else {
tmp = c * b;
}
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 <= -1.4e-35: tmp = c * b elif c <= 1.75e-196: tmp = -4.0 * (x * i) elif c <= 9.5e-114: tmp = -27.0 * (j * k) elif c <= 85000.0: tmp = 18.0 * (y * ((x * z) * t)) elif c <= 2.7e+39: tmp = c * b elif c <= 2.6e+100: tmp = t * (-4.0 * a) else: tmp = c * b 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 <= -1.4e-35) tmp = Float64(c * b); elseif (c <= 1.75e-196) tmp = Float64(-4.0 * Float64(x * i)); elseif (c <= 9.5e-114) tmp = Float64(-27.0 * Float64(j * k)); elseif (c <= 85000.0) tmp = Float64(18.0 * Float64(y * Float64(Float64(x * z) * t))); elseif (c <= 2.7e+39) tmp = Float64(c * b); elseif (c <= 2.6e+100) tmp = Float64(t * Float64(-4.0 * a)); else tmp = Float64(c * b); 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 <= -1.4e-35)
tmp = c * b;
elseif (c <= 1.75e-196)
tmp = -4.0 * (x * i);
elseif (c <= 9.5e-114)
tmp = -27.0 * (j * k);
elseif (c <= 85000.0)
tmp = 18.0 * (y * ((x * z) * t));
elseif (c <= 2.7e+39)
tmp = c * b;
elseif (c <= 2.6e+100)
tmp = t * (-4.0 * a);
else
tmp = c * b;
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, -1.4e-35], N[(c * b), $MachinePrecision], If[LessEqual[c, 1.75e-196], N[(-4.0 * N[(x * i), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, 9.5e-114], N[(-27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, 85000.0], N[(18.0 * N[(y * N[(N[(x * z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, 2.7e+39], N[(c * b), $MachinePrecision], If[LessEqual[c, 2.6e+100], N[(t * N[(-4.0 * a), $MachinePrecision]), $MachinePrecision], N[(c * b), $MachinePrecision]]]]]]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
\mathbf{if}\;c \leq -1.4 \cdot 10^{-35}:\\
\;\;\;\;c \cdot b\\
\mathbf{elif}\;c \leq 1.75 \cdot 10^{-196}:\\
\;\;\;\;-4 \cdot \left(x \cdot i\right)\\
\mathbf{elif}\;c \leq 9.5 \cdot 10^{-114}:\\
\;\;\;\;-27 \cdot \left(j \cdot k\right)\\
\mathbf{elif}\;c \leq 85000:\\
\;\;\;\;18 \cdot \left(y \cdot \left(\left(x \cdot z\right) \cdot t\right)\right)\\
\mathbf{elif}\;c \leq 2.7 \cdot 10^{+39}:\\
\;\;\;\;c \cdot b\\
\mathbf{elif}\;c \leq 2.6 \cdot 10^{+100}:\\
\;\;\;\;t \cdot \left(-4 \cdot a\right)\\
\mathbf{else}:\\
\;\;\;\;c \cdot b\\
\end{array}
\end{array}
if c < -1.4e-35 or 85000 < c < 2.70000000000000003e39 or 2.6000000000000002e100 < c Initial program 87.8%
sub-neg87.8%
*-commutative87.8%
distribute-rgt-neg-in87.8%
Simplified87.0%
fma-udef86.3%
Applied egg-rr86.3%
Taylor expanded in a around 0 82.8%
fma-def83.5%
fma-def83.5%
*-commutative83.5%
associate-*r*82.8%
*-commutative82.8%
Simplified82.8%
Taylor expanded in c around inf 42.3%
if -1.4e-35 < c < 1.75000000000000002e-196Initial program 77.4%
sub-neg77.4%
+-commutative77.4%
associate-*l*77.4%
distribute-rgt-neg-in77.4%
fma-def81.9%
*-commutative81.9%
distribute-rgt-neg-in81.9%
metadata-eval81.9%
sub-neg81.9%
+-commutative81.9%
associate-*l*81.9%
distribute-rgt-neg-in81.9%
Simplified89.4%
Taylor expanded in i around inf 32.4%
*-commutative32.4%
Simplified32.4%
if 1.75000000000000002e-196 < c < 9.49999999999999958e-114Initial program 99.7%
sub-neg99.7%
+-commutative99.7%
associate-*l*99.8%
distribute-rgt-neg-in99.8%
fma-def99.8%
*-commutative99.8%
distribute-rgt-neg-in99.8%
metadata-eval99.8%
sub-neg99.8%
+-commutative99.8%
associate-*l*99.8%
distribute-rgt-neg-in99.8%
Simplified94.5%
Taylor expanded in j around inf 42.9%
if 9.49999999999999958e-114 < c < 85000Initial program 79.8%
sub-neg79.8%
*-commutative79.8%
distribute-rgt-neg-in79.8%
Simplified80.2%
fma-udef80.2%
Applied egg-rr80.2%
Taylor expanded in a around 0 75.9%
fma-def75.9%
fma-def75.9%
*-commutative75.9%
associate-*r*75.8%
*-commutative75.8%
Simplified75.8%
fma-udef75.8%
*-commutative75.8%
associate-*r*75.8%
*-commutative75.8%
associate-*r*75.8%
associate-*l*75.9%
*-commutative75.9%
associate-*r*60.6%
Applied egg-rr60.6%
Taylor expanded in y around inf 37.1%
if 2.70000000000000003e39 < c < 2.6000000000000002e100Initial program 94.4%
sub-neg94.4%
associate-+l-94.4%
sub-neg94.4%
sub-neg94.4%
distribute-rgt-out--94.4%
associate-*l*94.4%
distribute-lft-neg-in94.4%
cancel-sign-sub94.4%
associate-*l*94.4%
associate-*l*94.4%
Simplified94.4%
Taylor expanded in x around 0 74.6%
Taylor expanded in a around inf 42.5%
associate-*r*42.5%
*-commutative42.5%
Simplified42.5%
Final simplification39.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 (* k (* j -27.0))) (t_2 (+ (* c b) (* -4.0 (* t a)))))
(if (<= a -4.8e+80)
t_2
(if (<= a -420000.0)
(+ t_1 (* a (* -4.0 t)))
(if (<= a -2.05e-44)
(* x (* (* 18.0 y) (* z t)))
(if (<= a 7.5e+155) (+ (* c b) 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 = k * (j * -27.0);
double t_2 = (c * b) + (-4.0 * (t * a));
double tmp;
if (a <= -4.8e+80) {
tmp = t_2;
} else if (a <= -420000.0) {
tmp = t_1 + (a * (-4.0 * t));
} else if (a <= -2.05e-44) {
tmp = x * ((18.0 * y) * (z * t));
} else if (a <= 7.5e+155) {
tmp = (c * b) + 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 = k * (j * (-27.0d0))
t_2 = (c * b) + ((-4.0d0) * (t * a))
if (a <= (-4.8d+80)) then
tmp = t_2
else if (a <= (-420000.0d0)) then
tmp = t_1 + (a * ((-4.0d0) * t))
else if (a <= (-2.05d-44)) then
tmp = x * ((18.0d0 * y) * (z * t))
else if (a <= 7.5d+155) then
tmp = (c * b) + 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 = k * (j * -27.0);
double t_2 = (c * b) + (-4.0 * (t * a));
double tmp;
if (a <= -4.8e+80) {
tmp = t_2;
} else if (a <= -420000.0) {
tmp = t_1 + (a * (-4.0 * t));
} else if (a <= -2.05e-44) {
tmp = x * ((18.0 * y) * (z * t));
} else if (a <= 7.5e+155) {
tmp = (c * b) + 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 = k * (j * -27.0) t_2 = (c * b) + (-4.0 * (t * a)) tmp = 0 if a <= -4.8e+80: tmp = t_2 elif a <= -420000.0: tmp = t_1 + (a * (-4.0 * t)) elif a <= -2.05e-44: tmp = x * ((18.0 * y) * (z * t)) elif a <= 7.5e+155: tmp = (c * b) + 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(k * Float64(j * -27.0)) t_2 = Float64(Float64(c * b) + Float64(-4.0 * Float64(t * a))) tmp = 0.0 if (a <= -4.8e+80) tmp = t_2; elseif (a <= -420000.0) tmp = Float64(t_1 + Float64(a * Float64(-4.0 * t))); elseif (a <= -2.05e-44) tmp = Float64(x * Float64(Float64(18.0 * y) * Float64(z * t))); elseif (a <= 7.5e+155) tmp = Float64(Float64(c * b) + 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 = k * (j * -27.0);
t_2 = (c * b) + (-4.0 * (t * a));
tmp = 0.0;
if (a <= -4.8e+80)
tmp = t_2;
elseif (a <= -420000.0)
tmp = t_1 + (a * (-4.0 * t));
elseif (a <= -2.05e-44)
tmp = x * ((18.0 * y) * (z * t));
elseif (a <= 7.5e+155)
tmp = (c * b) + 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[(k * N[(j * -27.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(c * b), $MachinePrecision] + N[(-4.0 * N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -4.8e+80], t$95$2, If[LessEqual[a, -420000.0], N[(t$95$1 + N[(a * N[(-4.0 * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, -2.05e-44], N[(x * N[(N[(18.0 * y), $MachinePrecision] * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 7.5e+155], N[(N[(c * b), $MachinePrecision] + t$95$1), $MachinePrecision], t$95$2]]]]]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
t_1 := k \cdot \left(j \cdot -27\right)\\
t_2 := c \cdot b + -4 \cdot \left(t \cdot a\right)\\
\mathbf{if}\;a \leq -4.8 \cdot 10^{+80}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;a \leq -420000:\\
\;\;\;\;t_1 + a \cdot \left(-4 \cdot t\right)\\
\mathbf{elif}\;a \leq -2.05 \cdot 10^{-44}:\\
\;\;\;\;x \cdot \left(\left(18 \cdot y\right) \cdot \left(z \cdot t\right)\right)\\
\mathbf{elif}\;a \leq 7.5 \cdot 10^{+155}:\\
\;\;\;\;c \cdot b + t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if a < -4.79999999999999958e80 or 7.4999999999999999e155 < a Initial program 78.8%
sub-neg78.8%
associate-+l-78.8%
sub-neg78.8%
sub-neg78.8%
distribute-rgt-out--83.8%
associate-*l*80.0%
distribute-lft-neg-in80.0%
cancel-sign-sub80.0%
associate-*l*80.0%
associate-*l*80.1%
Simplified80.1%
Taylor expanded in x around 0 74.1%
Taylor expanded in k around 0 66.9%
if -4.79999999999999958e80 < a < -4.2e5Initial program 73.3%
sub-neg73.3%
*-commutative73.3%
distribute-rgt-neg-in73.3%
Simplified81.5%
fma-udef81.5%
Applied egg-rr81.5%
Taylor expanded in a around inf 72.7%
associate-*r*72.7%
*-commutative72.7%
associate-*l*72.7%
Simplified72.7%
if -4.2e5 < a < -2.04999999999999996e-44Initial program 88.9%
sub-neg88.9%
associate-+l-88.9%
sub-neg88.9%
sub-neg88.9%
distribute-rgt-out--88.9%
associate-*l*88.9%
distribute-lft-neg-in88.9%
cancel-sign-sub88.9%
associate-*l*88.9%
associate-*l*88.9%
Simplified88.9%
Taylor expanded in x around inf 76.6%
Taylor expanded in y around inf 52.3%
associate-*r*52.3%
*-commutative52.3%
Simplified52.3%
if -2.04999999999999996e-44 < a < 7.4999999999999999e155Initial program 89.7%
sub-neg89.7%
*-commutative89.7%
distribute-rgt-neg-in89.7%
Simplified88.6%
fma-udef88.6%
Applied egg-rr88.6%
Taylor expanded in b around inf 54.2%
Final simplification58.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 (* -4.0 (* x i))))
(if (<= i -5.8e+39)
t_2
(if (<= i -3.7e-202)
t_1
(if (<= i 2.65e+20)
(* c b)
(if (<= i 2.1e+127) t_1 (if (<= i 3.8e+194) (* c b) 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 = -27.0 * (j * k);
double t_2 = -4.0 * (x * i);
double tmp;
if (i <= -5.8e+39) {
tmp = t_2;
} else if (i <= -3.7e-202) {
tmp = t_1;
} else if (i <= 2.65e+20) {
tmp = c * b;
} else if (i <= 2.1e+127) {
tmp = t_1;
} else if (i <= 3.8e+194) {
tmp = c * b;
} 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 = (-27.0d0) * (j * k)
t_2 = (-4.0d0) * (x * i)
if (i <= (-5.8d+39)) then
tmp = t_2
else if (i <= (-3.7d-202)) then
tmp = t_1
else if (i <= 2.65d+20) then
tmp = c * b
else if (i <= 2.1d+127) then
tmp = t_1
else if (i <= 3.8d+194) then
tmp = c * b
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 = -27.0 * (j * k);
double t_2 = -4.0 * (x * i);
double tmp;
if (i <= -5.8e+39) {
tmp = t_2;
} else if (i <= -3.7e-202) {
tmp = t_1;
} else if (i <= 2.65e+20) {
tmp = c * b;
} else if (i <= 2.1e+127) {
tmp = t_1;
} else if (i <= 3.8e+194) {
tmp = c * b;
} 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 = -27.0 * (j * k) t_2 = -4.0 * (x * i) tmp = 0 if i <= -5.8e+39: tmp = t_2 elif i <= -3.7e-202: tmp = t_1 elif i <= 2.65e+20: tmp = c * b elif i <= 2.1e+127: tmp = t_1 elif i <= 3.8e+194: tmp = c * b 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(-27.0 * Float64(j * k)) t_2 = Float64(-4.0 * Float64(x * i)) tmp = 0.0 if (i <= -5.8e+39) tmp = t_2; elseif (i <= -3.7e-202) tmp = t_1; elseif (i <= 2.65e+20) tmp = Float64(c * b); elseif (i <= 2.1e+127) tmp = t_1; elseif (i <= 3.8e+194) tmp = Float64(c * b); 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 = -27.0 * (j * k);
t_2 = -4.0 * (x * i);
tmp = 0.0;
if (i <= -5.8e+39)
tmp = t_2;
elseif (i <= -3.7e-202)
tmp = t_1;
elseif (i <= 2.65e+20)
tmp = c * b;
elseif (i <= 2.1e+127)
tmp = t_1;
elseif (i <= 3.8e+194)
tmp = c * b;
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[(-27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(-4.0 * N[(x * i), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[i, -5.8e+39], t$95$2, If[LessEqual[i, -3.7e-202], t$95$1, If[LessEqual[i, 2.65e+20], N[(c * b), $MachinePrecision], If[LessEqual[i, 2.1e+127], t$95$1, If[LessEqual[i, 3.8e+194], N[(c * b), $MachinePrecision], t$95$2]]]]]]]
\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 := -4 \cdot \left(x \cdot i\right)\\
\mathbf{if}\;i \leq -5.8 \cdot 10^{+39}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;i \leq -3.7 \cdot 10^{-202}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;i \leq 2.65 \cdot 10^{+20}:\\
\;\;\;\;c \cdot b\\
\mathbf{elif}\;i \leq 2.1 \cdot 10^{+127}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;i \leq 3.8 \cdot 10^{+194}:\\
\;\;\;\;c \cdot b\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if i < -5.80000000000000059e39 or 3.7999999999999999e194 < i Initial program 87.7%
sub-neg87.7%
+-commutative87.7%
associate-*l*87.7%
distribute-rgt-neg-in87.7%
fma-def88.9%
*-commutative88.9%
distribute-rgt-neg-in88.9%
metadata-eval88.9%
sub-neg88.9%
+-commutative88.9%
associate-*l*88.9%
distribute-rgt-neg-in88.9%
Simplified90.3%
Taylor expanded in i around inf 56.7%
*-commutative56.7%
Simplified56.7%
if -5.80000000000000059e39 < i < -3.69999999999999991e-202 or 2.65e20 < i < 2.09999999999999992e127Initial program 83.0%
sub-neg83.0%
+-commutative83.0%
associate-*l*83.0%
distribute-rgt-neg-in83.0%
fma-def85.5%
*-commutative85.5%
distribute-rgt-neg-in85.5%
metadata-eval85.5%
sub-neg85.5%
+-commutative85.5%
associate-*l*85.5%
distribute-rgt-neg-in85.5%
Simplified89.2%
Taylor expanded in j around inf 41.0%
if -3.69999999999999991e-202 < i < 2.65e20 or 2.09999999999999992e127 < i < 3.7999999999999999e194Initial program 85.9%
sub-neg85.9%
*-commutative85.9%
distribute-rgt-neg-in85.9%
Simplified84.8%
fma-udef84.8%
Applied egg-rr84.8%
Taylor expanded in a around 0 73.1%
fma-def74.2%
fma-def74.2%
*-commutative74.2%
associate-*r*73.1%
*-commutative73.1%
Simplified73.1%
Taylor expanded in c around inf 39.0%
Final simplification45.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 (* k -27.0))) (t_2 (* -4.0 (* x i))))
(if (<= i -1.25e+38)
t_2
(if (<= i -1.9e-202)
t_1
(if (<= i 7.8e+18)
(* c b)
(if (<= i 1.05e+90) t_1 (if (<= i 8.5e+191) (* c b) 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 * (k * -27.0);
double t_2 = -4.0 * (x * i);
double tmp;
if (i <= -1.25e+38) {
tmp = t_2;
} else if (i <= -1.9e-202) {
tmp = t_1;
} else if (i <= 7.8e+18) {
tmp = c * b;
} else if (i <= 1.05e+90) {
tmp = t_1;
} else if (i <= 8.5e+191) {
tmp = c * b;
} 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 * (k * (-27.0d0))
t_2 = (-4.0d0) * (x * i)
if (i <= (-1.25d+38)) then
tmp = t_2
else if (i <= (-1.9d-202)) then
tmp = t_1
else if (i <= 7.8d+18) then
tmp = c * b
else if (i <= 1.05d+90) then
tmp = t_1
else if (i <= 8.5d+191) then
tmp = c * b
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 * (k * -27.0);
double t_2 = -4.0 * (x * i);
double tmp;
if (i <= -1.25e+38) {
tmp = t_2;
} else if (i <= -1.9e-202) {
tmp = t_1;
} else if (i <= 7.8e+18) {
tmp = c * b;
} else if (i <= 1.05e+90) {
tmp = t_1;
} else if (i <= 8.5e+191) {
tmp = c * b;
} 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 * (k * -27.0) t_2 = -4.0 * (x * i) tmp = 0 if i <= -1.25e+38: tmp = t_2 elif i <= -1.9e-202: tmp = t_1 elif i <= 7.8e+18: tmp = c * b elif i <= 1.05e+90: tmp = t_1 elif i <= 8.5e+191: tmp = c * b 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(j * Float64(k * -27.0)) t_2 = Float64(-4.0 * Float64(x * i)) tmp = 0.0 if (i <= -1.25e+38) tmp = t_2; elseif (i <= -1.9e-202) tmp = t_1; elseif (i <= 7.8e+18) tmp = Float64(c * b); elseif (i <= 1.05e+90) tmp = t_1; elseif (i <= 8.5e+191) tmp = Float64(c * b); 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 * (k * -27.0);
t_2 = -4.0 * (x * i);
tmp = 0.0;
if (i <= -1.25e+38)
tmp = t_2;
elseif (i <= -1.9e-202)
tmp = t_1;
elseif (i <= 7.8e+18)
tmp = c * b;
elseif (i <= 1.05e+90)
tmp = t_1;
elseif (i <= 8.5e+191)
tmp = c * b;
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[(j * N[(k * -27.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(-4.0 * N[(x * i), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[i, -1.25e+38], t$95$2, If[LessEqual[i, -1.9e-202], t$95$1, If[LessEqual[i, 7.8e+18], N[(c * b), $MachinePrecision], If[LessEqual[i, 1.05e+90], t$95$1, If[LessEqual[i, 8.5e+191], N[(c * b), $MachinePrecision], t$95$2]]]]]]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
t_1 := j \cdot \left(k \cdot -27\right)\\
t_2 := -4 \cdot \left(x \cdot i\right)\\
\mathbf{if}\;i \leq -1.25 \cdot 10^{+38}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;i \leq -1.9 \cdot 10^{-202}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;i \leq 7.8 \cdot 10^{+18}:\\
\;\;\;\;c \cdot b\\
\mathbf{elif}\;i \leq 1.05 \cdot 10^{+90}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;i \leq 8.5 \cdot 10^{+191}:\\
\;\;\;\;c \cdot b\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if i < -1.24999999999999992e38 or 8.4999999999999999e191 < i Initial program 87.7%
sub-neg87.7%
+-commutative87.7%
associate-*l*87.7%
distribute-rgt-neg-in87.7%
fma-def88.9%
*-commutative88.9%
distribute-rgt-neg-in88.9%
metadata-eval88.9%
sub-neg88.9%
+-commutative88.9%
associate-*l*88.9%
distribute-rgt-neg-in88.9%
Simplified90.3%
Taylor expanded in i around inf 56.7%
*-commutative56.7%
Simplified56.7%
if -1.24999999999999992e38 < i < -1.90000000000000007e-202 or 7.8e18 < i < 1.0499999999999999e90Initial program 83.9%
sub-neg83.9%
*-commutative83.9%
distribute-rgt-neg-in83.9%
Simplified86.7%
fma-udef86.7%
Applied egg-rr86.7%
Taylor expanded in a around 0 73.0%
fma-def73.0%
fma-def73.0%
*-commutative73.0%
associate-*r*73.0%
*-commutative73.0%
Simplified73.0%
Taylor expanded in k around inf 41.2%
associate-*r*41.3%
Simplified41.3%
if -1.90000000000000007e-202 < i < 7.8e18 or 1.0499999999999999e90 < i < 8.4999999999999999e191Initial program 85.1%
sub-neg85.1%
*-commutative85.1%
distribute-rgt-neg-in85.1%
Simplified84.0%
fma-udef84.0%
Applied egg-rr84.0%
Taylor expanded in a around 0 73.3%
fma-def74.3%
fma-def74.3%
*-commutative74.3%
associate-*r*73.3%
*-commutative73.3%
Simplified73.3%
Taylor expanded in c around inf 39.0%
Final simplification45.3%
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(if (or (<= j -9.6e+193)
(and (not (<= j -1.15e+162))
(or (<= j -1.7e+44) (not (<= j 4.9e-36)))))
(* -27.0 (* j k))
(* c b)))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 ((j <= -9.6e+193) || (!(j <= -1.15e+162) && ((j <= -1.7e+44) || !(j <= 4.9e-36)))) {
tmp = -27.0 * (j * k);
} else {
tmp = c * b;
}
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 ((j <= (-9.6d+193)) .or. (.not. (j <= (-1.15d+162))) .and. (j <= (-1.7d+44)) .or. (.not. (j <= 4.9d-36))) then
tmp = (-27.0d0) * (j * k)
else
tmp = c * b
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 ((j <= -9.6e+193) || (!(j <= -1.15e+162) && ((j <= -1.7e+44) || !(j <= 4.9e-36)))) {
tmp = -27.0 * (j * k);
} else {
tmp = c * b;
}
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 (j <= -9.6e+193) or (not (j <= -1.15e+162) and ((j <= -1.7e+44) or not (j <= 4.9e-36))): tmp = -27.0 * (j * k) else: tmp = c * b 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 ((j <= -9.6e+193) || (!(j <= -1.15e+162) && ((j <= -1.7e+44) || !(j <= 4.9e-36)))) tmp = Float64(-27.0 * Float64(j * k)); else tmp = Float64(c * b); 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 ((j <= -9.6e+193) || (~((j <= -1.15e+162)) && ((j <= -1.7e+44) || ~((j <= 4.9e-36)))))
tmp = -27.0 * (j * k);
else
tmp = c * b;
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[j, -9.6e+193], And[N[Not[LessEqual[j, -1.15e+162]], $MachinePrecision], Or[LessEqual[j, -1.7e+44], N[Not[LessEqual[j, 4.9e-36]], $MachinePrecision]]]], N[(-27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision], N[(c * b), $MachinePrecision]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
\mathbf{if}\;j \leq -9.6 \cdot 10^{+193} \lor \neg \left(j \leq -1.15 \cdot 10^{+162}\right) \land \left(j \leq -1.7 \cdot 10^{+44} \lor \neg \left(j \leq 4.9 \cdot 10^{-36}\right)\right):\\
\;\;\;\;-27 \cdot \left(j \cdot k\right)\\
\mathbf{else}:\\
\;\;\;\;c \cdot b\\
\end{array}
\end{array}
if j < -9.6e193 or -1.14999999999999997e162 < j < -1.7e44 or 4.8999999999999997e-36 < j Initial program 81.2%
sub-neg81.2%
+-commutative81.2%
associate-*l*81.2%
distribute-rgt-neg-in81.2%
fma-def84.4%
*-commutative84.4%
distribute-rgt-neg-in84.4%
metadata-eval84.4%
sub-neg84.4%
+-commutative84.4%
associate-*l*84.4%
distribute-rgt-neg-in84.4%
Simplified87.7%
Taylor expanded in j around inf 42.0%
if -9.6e193 < j < -1.14999999999999997e162 or -1.7e44 < j < 4.8999999999999997e-36Initial program 89.6%
sub-neg89.6%
*-commutative89.6%
distribute-rgt-neg-in89.6%
Simplified91.1%
fma-udef90.4%
Applied egg-rr90.4%
Taylor expanded in a around 0 79.7%
fma-def80.5%
fma-def80.5%
*-commutative80.5%
associate-*r*80.5%
*-commutative80.5%
Simplified80.5%
Taylor expanded in c around inf 33.4%
Final simplification37.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 (if (or (<= a -6.7e+109) (not (<= a 2.05e+149))) (+ (* c b) (* -4.0 (* t a))) (+ (* c b) (* k (* j -27.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 ((a <= -6.7e+109) || !(a <= 2.05e+149)) {
tmp = (c * b) + (-4.0 * (t * a));
} else {
tmp = (c * b) + (k * (j * -27.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 ((a <= (-6.7d+109)) .or. (.not. (a <= 2.05d+149))) then
tmp = (c * b) + ((-4.0d0) * (t * a))
else
tmp = (c * b) + (k * (j * (-27.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 ((a <= -6.7e+109) || !(a <= 2.05e+149)) {
tmp = (c * b) + (-4.0 * (t * a));
} else {
tmp = (c * b) + (k * (j * -27.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 (a <= -6.7e+109) or not (a <= 2.05e+149): tmp = (c * b) + (-4.0 * (t * a)) else: tmp = (c * b) + (k * (j * -27.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 ((a <= -6.7e+109) || !(a <= 2.05e+149)) tmp = Float64(Float64(c * b) + Float64(-4.0 * Float64(t * a))); else tmp = Float64(Float64(c * b) + Float64(k * Float64(j * -27.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 ((a <= -6.7e+109) || ~((a <= 2.05e+149)))
tmp = (c * b) + (-4.0 * (t * a));
else
tmp = (c * b) + (k * (j * -27.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[a, -6.7e+109], N[Not[LessEqual[a, 2.05e+149]], $MachinePrecision]], N[(N[(c * b), $MachinePrecision] + N[(-4.0 * N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(c * b), $MachinePrecision] + N[(k * N[(j * -27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
\mathbf{if}\;a \leq -6.7 \cdot 10^{+109} \lor \neg \left(a \leq 2.05 \cdot 10^{+149}\right):\\
\;\;\;\;c \cdot b + -4 \cdot \left(t \cdot a\right)\\
\mathbf{else}:\\
\;\;\;\;c \cdot b + k \cdot \left(j \cdot -27\right)\\
\end{array}
\end{array}
if a < -6.70000000000000036e109 or 2.0499999999999998e149 < a Initial program 80.2%
sub-neg80.2%
associate-+l-80.2%
sub-neg80.2%
sub-neg80.2%
distribute-rgt-out--85.5%
associate-*l*82.8%
distribute-lft-neg-in82.8%
cancel-sign-sub82.8%
associate-*l*82.8%
associate-*l*82.9%
Simplified82.9%
Taylor expanded in x around 0 74.6%
Taylor expanded in k around 0 67.0%
if -6.70000000000000036e109 < a < 2.0499999999999998e149Initial program 87.8%
sub-neg87.8%
*-commutative87.8%
distribute-rgt-neg-in87.8%
Simplified86.8%
fma-udef86.8%
Applied egg-rr86.8%
Taylor expanded in b around inf 52.8%
Final simplification57.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 (if (<= j -2.85e+194) (* j (* k -27.0)) (if (<= j 4.8e-36) (+ (* c b) (* -4.0 (* t a))) (* -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 tmp;
if (j <= -2.85e+194) {
tmp = j * (k * -27.0);
} else if (j <= 4.8e-36) {
tmp = (c * b) + (-4.0 * (t * a));
} 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) :: tmp
if (j <= (-2.85d+194)) then
tmp = j * (k * (-27.0d0))
else if (j <= 4.8d-36) then
tmp = (c * b) + ((-4.0d0) * (t * a))
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 tmp;
if (j <= -2.85e+194) {
tmp = j * (k * -27.0);
} else if (j <= 4.8e-36) {
tmp = (c * b) + (-4.0 * (t * a));
} 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): tmp = 0 if j <= -2.85e+194: tmp = j * (k * -27.0) elif j <= 4.8e-36: tmp = (c * b) + (-4.0 * (t * a)) 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) tmp = 0.0 if (j <= -2.85e+194) tmp = Float64(j * Float64(k * -27.0)); elseif (j <= 4.8e-36) tmp = Float64(Float64(c * b) + Float64(-4.0 * Float64(t * a))); 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)
tmp = 0.0;
if (j <= -2.85e+194)
tmp = j * (k * -27.0);
elseif (j <= 4.8e-36)
tmp = (c * b) + (-4.0 * (t * a));
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_] := If[LessEqual[j, -2.85e+194], N[(j * N[(k * -27.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[j, 4.8e-36], N[(N[(c * b), $MachinePrecision] + N[(-4.0 * N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 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}
\mathbf{if}\;j \leq -2.85 \cdot 10^{+194}:\\
\;\;\;\;j \cdot \left(k \cdot -27\right)\\
\mathbf{elif}\;j \leq 4.8 \cdot 10^{-36}:\\
\;\;\;\;c \cdot b + -4 \cdot \left(t \cdot a\right)\\
\mathbf{else}:\\
\;\;\;\;-27 \cdot \left(j \cdot k\right)\\
\end{array}
\end{array}
if j < -2.84999999999999992e194Initial program 67.7%
sub-neg67.7%
*-commutative67.7%
distribute-rgt-neg-in67.7%
Simplified67.7%
fma-udef67.7%
Applied egg-rr67.7%
Taylor expanded in a around 0 68.0%
fma-def68.0%
fma-def68.0%
*-commutative68.0%
associate-*r*68.0%
*-commutative68.0%
Simplified68.0%
Taylor expanded in k around inf 56.6%
associate-*r*56.7%
Simplified56.7%
if -2.84999999999999992e194 < j < 4.8e-36Initial program 88.8%
sub-neg88.8%
associate-+l-88.8%
sub-neg88.8%
sub-neg88.8%
distribute-rgt-out--90.2%
associate-*l*88.9%
distribute-lft-neg-in88.9%
cancel-sign-sub88.9%
associate-*l*88.9%
associate-*l*88.9%
Simplified88.9%
Taylor expanded in x around 0 58.1%
Taylor expanded in k around 0 45.8%
if 4.8e-36 < j Initial program 85.7%
sub-neg85.7%
+-commutative85.7%
associate-*l*85.6%
distribute-rgt-neg-in85.6%
fma-def88.2%
*-commutative88.2%
distribute-rgt-neg-in88.2%
metadata-eval88.2%
sub-neg88.2%
+-commutative88.2%
associate-*l*88.2%
distribute-rgt-neg-in88.2%
Simplified93.4%
Taylor expanded in j around inf 34.5%
Final simplification43.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 (* c b))
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 c * b;
}
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 = c * b
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 c * b;
}
[y, z] = sort([y, z]) [j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): return c * b
y, z = sort([y, z]) j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) return Float64(c * b) 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 = c * b;
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[(c * b), $MachinePrecision]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
[j, k] = \mathsf{sort}([j, k])\\
\\
c \cdot b
\end{array}
Initial program 85.6%
sub-neg85.6%
*-commutative85.6%
distribute-rgt-neg-in85.6%
Simplified86.0%
fma-udef85.6%
Applied egg-rr85.6%
Taylor expanded in a around 0 75.1%
fma-def75.9%
fma-def75.9%
*-commutative75.9%
associate-*r*75.5%
*-commutative75.5%
Simplified75.5%
Taylor expanded in c around inf 26.0%
Final simplification26.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 2023278
(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)))