
(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 (<= y -1.4e+131)
(-
(+ (* c b) (* 18.0 (* y (* t (* z x)))))
(+ (* x (* 4.0 i)) (* j (* 27.0 k))))
(if (<= y 9.5e+38)
(fma
x
(fma 18.0 (* t (* y z)) (* i -4.0))
(fma t (* -4.0 a) (fma b c (* k (* j -27.0)))))
(-
(+ (* c b) (* t (- (* 18.0 (* y (* z x))) (* 4.0 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 (y <= -1.4e+131) {
tmp = ((c * b) + (18.0 * (y * (t * (z * x))))) - ((x * (4.0 * i)) + (j * (27.0 * k)));
} else if (y <= 9.5e+38) {
tmp = fma(x, fma(18.0, (t * (y * z)), (i * -4.0)), fma(t, (-4.0 * a), fma(b, c, (k * (j * -27.0)))));
} else {
tmp = ((c * b) + (t * ((18.0 * (y * (z * x))) - (4.0 * 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 (y <= -1.4e+131) tmp = Float64(Float64(Float64(c * b) + Float64(18.0 * Float64(y * Float64(t * Float64(z * x))))) - Float64(Float64(x * Float64(4.0 * i)) + Float64(j * Float64(27.0 * k)))); elseif (y <= 9.5e+38) tmp = fma(x, fma(18.0, Float64(t * Float64(y * z)), Float64(i * -4.0)), fma(t, Float64(-4.0 * a), fma(b, c, Float64(k * Float64(j * -27.0))))); else tmp = Float64(Float64(Float64(c * b) + Float64(t * Float64(Float64(18.0 * Float64(y * Float64(z * x))) - Float64(4.0 * a)))) - Float64(27.0 * Float64(j * k))); 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[y, -1.4e+131], N[(N[(N[(c * b), $MachinePrecision] + N[(18.0 * N[(y * N[(t * N[(z * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(x * N[(4.0 * i), $MachinePrecision]), $MachinePrecision] + N[(j * N[(27.0 * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 9.5e+38], N[(x * N[(18.0 * N[(t * N[(y * z), $MachinePrecision]), $MachinePrecision] + N[(i * -4.0), $MachinePrecision]), $MachinePrecision] + N[(t * N[(-4.0 * a), $MachinePrecision] + N[(b * c + N[(k * N[(j * -27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(c * b), $MachinePrecision] + N[(t * N[(N[(18.0 * N[(y * N[(z * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(4.0 * a), $MachinePrecision]), $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}\;y \leq -1.4 \cdot 10^{+131}:\\
\;\;\;\;\left(c \cdot b + 18 \cdot \left(y \cdot \left(t \cdot \left(z \cdot x\right)\right)\right)\right) - \left(x \cdot \left(4 \cdot i\right) + j \cdot \left(27 \cdot k\right)\right)\\
\mathbf{elif}\;y \leq 9.5 \cdot 10^{+38}:\\
\;\;\;\;\mathsf{fma}\left(x, \mathsf{fma}\left(18, t \cdot \left(y \cdot z\right), i \cdot -4\right), \mathsf{fma}\left(t, -4 \cdot a, \mathsf{fma}\left(b, c, k \cdot \left(j \cdot -27\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(c \cdot b + t \cdot \left(18 \cdot \left(y \cdot \left(z \cdot x\right)\right) - 4 \cdot a\right)\right) - 27 \cdot \left(j \cdot k\right)\\
\end{array}
\end{array}
if y < -1.4e131Initial program 76.7%
sub-neg76.7%
associate-+l-76.7%
sub-neg76.7%
sub-neg76.7%
distribute-rgt-out--79.4%
associate-*l*76.2%
distribute-lft-neg-in76.2%
cancel-sign-sub76.2%
associate-*l*76.2%
associate-*l*76.2%
Simplified76.2%
Taylor expanded in a around 0 86.8%
if -1.4e131 < y < 9.4999999999999995e38Initial program 89.8%
Simplified94.1%
if 9.4999999999999995e38 < y Initial program 73.8%
sub-neg73.8%
associate-+l-73.8%
sub-neg73.8%
sub-neg73.8%
distribute-rgt-out--75.7%
associate-*l*59.7%
distribute-lft-neg-in59.7%
cancel-sign-sub59.7%
associate-*l*59.7%
associate-*l*59.7%
Simplified59.7%
Taylor expanded in i around 0 72.6%
Final simplification88.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 (<= z -8.2e+37) (not (<= z 1.65e+177)))
(-
(+ (* c b) (* 18.0 (* y (* t (* z x)))))
(+ (* x (* 4.0 i)) (* j (* 27.0 k))))
(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 ((z <= -8.2e+37) || !(z <= 1.65e+177)) {
tmp = ((c * b) + (18.0 * (y * (t * (z * x))))) - ((x * (4.0 * i)) + (j * (27.0 * k)));
} 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 ((z <= -8.2e+37) || !(z <= 1.65e+177)) tmp = Float64(Float64(Float64(c * b) + Float64(18.0 * Float64(y * Float64(t * Float64(z * x))))) - Float64(Float64(x * Float64(4.0 * i)) + Float64(j * Float64(27.0 * k)))); 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[Or[LessEqual[z, -8.2e+37], N[Not[LessEqual[z, 1.65e+177]], $MachinePrecision]], N[(N[(N[(c * b), $MachinePrecision] + N[(18.0 * N[(y * N[(t * N[(z * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(x * N[(4.0 * i), $MachinePrecision]), $MachinePrecision] + N[(j * N[(27.0 * k), $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}\;z \leq -8.2 \cdot 10^{+37} \lor \neg \left(z \leq 1.65 \cdot 10^{+177}\right):\\
\;\;\;\;\left(c \cdot b + 18 \cdot \left(y \cdot \left(t \cdot \left(z \cdot x\right)\right)\right)\right) - \left(x \cdot \left(4 \cdot i\right) + j \cdot \left(27 \cdot k\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 z < -8.1999999999999996e37 or 1.6500000000000001e177 < z Initial program 84.7%
sub-neg84.7%
associate-+l-84.7%
sub-neg84.7%
sub-neg84.7%
distribute-rgt-out--88.9%
associate-*l*75.8%
distribute-lft-neg-in75.8%
cancel-sign-sub75.8%
associate-*l*75.8%
associate-*l*76.8%
Simplified76.8%
Taylor expanded in a around 0 85.7%
if -8.1999999999999996e37 < z < 1.6500000000000001e177Initial program 84.6%
sub-neg84.6%
+-commutative84.6%
associate-*l*84.6%
distribute-rgt-neg-in84.6%
fma-def85.9%
*-commutative85.9%
distribute-rgt-neg-in85.9%
metadata-eval85.9%
sub-neg85.9%
+-commutative85.9%
associate-*l*85.9%
distribute-rgt-neg-in85.9%
Simplified91.4%
Final simplification89.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 (* 18.0 (* y (* t z))))
(t_2
(-
(+ (* c b) (- (* t (* z (* y (* 18.0 x)))) (* t (* 4.0 a))))
(* i (* x 4.0)))))
(if (<= t_2 4e+307)
(- t_2 (* k (* j 27.0)))
(if (<= t_2 INFINITY)
(+ (* c b) (+ (* -4.0 (* t a)) (* x (+ (* i -4.0) t_1))))
(* x (- t_1 (* 4.0 i)))))))assert(y < z);
assert(j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = 18.0 * (y * (t * z));
double t_2 = ((c * b) + ((t * (z * (y * (18.0 * x)))) - (t * (4.0 * a)))) - (i * (x * 4.0));
double tmp;
if (t_2 <= 4e+307) {
tmp = t_2 - (k * (j * 27.0));
} else if (t_2 <= ((double) INFINITY)) {
tmp = (c * b) + ((-4.0 * (t * a)) + (x * ((i * -4.0) + t_1)));
} else {
tmp = x * (t_1 - (4.0 * i));
}
return tmp;
}
assert y < z;
assert j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = 18.0 * (y * (t * z));
double t_2 = ((c * b) + ((t * (z * (y * (18.0 * x)))) - (t * (4.0 * a)))) - (i * (x * 4.0));
double tmp;
if (t_2 <= 4e+307) {
tmp = t_2 - (k * (j * 27.0));
} else if (t_2 <= Double.POSITIVE_INFINITY) {
tmp = (c * b) + ((-4.0 * (t * a)) + (x * ((i * -4.0) + t_1)));
} else {
tmp = x * (t_1 - (4.0 * i));
}
return tmp;
}
[y, z] = sort([y, z]) [j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): t_1 = 18.0 * (y * (t * z)) t_2 = ((c * b) + ((t * (z * (y * (18.0 * x)))) - (t * (4.0 * a)))) - (i * (x * 4.0)) tmp = 0 if t_2 <= 4e+307: tmp = t_2 - (k * (j * 27.0)) elif t_2 <= math.inf: tmp = (c * b) + ((-4.0 * (t * a)) + (x * ((i * -4.0) + t_1))) else: tmp = x * (t_1 - (4.0 * i)) return tmp
y, z = sort([y, z]) j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(18.0 * Float64(y * Float64(t * z))) t_2 = Float64(Float64(Float64(c * b) + Float64(Float64(t * Float64(z * Float64(y * Float64(18.0 * x)))) - Float64(t * Float64(4.0 * a)))) - Float64(i * Float64(x * 4.0))) tmp = 0.0 if (t_2 <= 4e+307) tmp = Float64(t_2 - Float64(k * Float64(j * 27.0))); elseif (t_2 <= Inf) tmp = Float64(Float64(c * b) + Float64(Float64(-4.0 * Float64(t * a)) + Float64(x * Float64(Float64(i * -4.0) + t_1)))); else tmp = Float64(x * Float64(t_1 - Float64(4.0 * i))); end return tmp end
y, z = num2cell(sort([y, z])){:}
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
t_1 = 18.0 * (y * (t * z));
t_2 = ((c * b) + ((t * (z * (y * (18.0 * x)))) - (t * (4.0 * a)))) - (i * (x * 4.0));
tmp = 0.0;
if (t_2 <= 4e+307)
tmp = t_2 - (k * (j * 27.0));
elseif (t_2 <= Inf)
tmp = (c * b) + ((-4.0 * (t * a)) + (x * ((i * -4.0) + t_1)));
else
tmp = x * (t_1 - (4.0 * i));
end
tmp_2 = tmp;
end
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(18.0 * N[(y * N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(c * b), $MachinePrecision] + N[(N[(t * N[(z * N[(y * N[(18.0 * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(t * N[(4.0 * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(i * N[(x * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, 4e+307], N[(t$95$2 - N[(k * N[(j * 27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, Infinity], N[(N[(c * b), $MachinePrecision] + N[(N[(-4.0 * N[(t * a), $MachinePrecision]), $MachinePrecision] + N[(x * N[(N[(i * -4.0), $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(t$95$1 - N[(4.0 * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
t_1 := 18 \cdot \left(y \cdot \left(t \cdot z\right)\right)\\
t_2 := \left(c \cdot b + \left(t \cdot \left(z \cdot \left(y \cdot \left(18 \cdot x\right)\right)\right) - t \cdot \left(4 \cdot a\right)\right)\right) - i \cdot \left(x \cdot 4\right)\\
\mathbf{if}\;t_2 \leq 4 \cdot 10^{+307}:\\
\;\;\;\;t_2 - k \cdot \left(j \cdot 27\right)\\
\mathbf{elif}\;t_2 \leq \infty:\\
\;\;\;\;c \cdot b + \left(-4 \cdot \left(t \cdot a\right) + x \cdot \left(i \cdot -4 + t_1\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(t_1 - 4 \cdot i\right)\\
\end{array}
\end{array}
if (-.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)) < 3.99999999999999994e307Initial program 95.1%
if 3.99999999999999994e307 < (-.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)) < +inf.0Initial program 77.2%
Simplified87.5%
Taylor expanded in k around 0 91.5%
if +inf.0 < (-.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)) Initial program 0.0%
sub-neg0.0%
associate-+l-0.0%
sub-neg0.0%
sub-neg0.0%
distribute-rgt-out--33.3%
associate-*l*44.4%
distribute-lft-neg-in44.4%
cancel-sign-sub44.4%
associate-*l*44.4%
associate-*l*44.4%
Simplified44.4%
Taylor expanded in x around inf 72.2%
Final simplification92.7%
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (- (+ (* c b) (* 18.0 (* y (* t (* z x))))) (* 27.0 (* j k))))
(t_2 (* y (* t z)))
(t_3
(+ (* c b) (+ (* -4.0 (* t a)) (* x (+ (* i -4.0) (* 18.0 t_2)))))))
(if (<= y -1.3e+139)
t_1
(if (<= y -6.5e+59)
t_3
(if (<= y -1.25e-25)
(- (* k (* j -27.0)) (* x (+ (* 4.0 i) (* t_2 -18.0))))
(if (<= y -1.46e-80)
t_3
(if (<= y 2.02e-143)
(- (- (* c b) (* 4.0 (+ (* t a) (* x i)))) (* k (* j 27.0)))
(if (<= y 3.3e+30) t_3 t_1))))))))assert(y < z);
assert(j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = ((c * b) + (18.0 * (y * (t * (z * x))))) - (27.0 * (j * k));
double t_2 = y * (t * z);
double t_3 = (c * b) + ((-4.0 * (t * a)) + (x * ((i * -4.0) + (18.0 * t_2))));
double tmp;
if (y <= -1.3e+139) {
tmp = t_1;
} else if (y <= -6.5e+59) {
tmp = t_3;
} else if (y <= -1.25e-25) {
tmp = (k * (j * -27.0)) - (x * ((4.0 * i) + (t_2 * -18.0)));
} else if (y <= -1.46e-80) {
tmp = t_3;
} else if (y <= 2.02e-143) {
tmp = ((c * b) - (4.0 * ((t * a) + (x * i)))) - (k * (j * 27.0));
} else if (y <= 3.3e+30) {
tmp = t_3;
} else {
tmp = t_1;
}
return tmp;
}
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_1 = ((c * b) + (18.0d0 * (y * (t * (z * x))))) - (27.0d0 * (j * k))
t_2 = y * (t * z)
t_3 = (c * b) + (((-4.0d0) * (t * a)) + (x * ((i * (-4.0d0)) + (18.0d0 * t_2))))
if (y <= (-1.3d+139)) then
tmp = t_1
else if (y <= (-6.5d+59)) then
tmp = t_3
else if (y <= (-1.25d-25)) then
tmp = (k * (j * (-27.0d0))) - (x * ((4.0d0 * i) + (t_2 * (-18.0d0))))
else if (y <= (-1.46d-80)) then
tmp = t_3
else if (y <= 2.02d-143) then
tmp = ((c * b) - (4.0d0 * ((t * a) + (x * i)))) - (k * (j * 27.0d0))
else if (y <= 3.3d+30) then
tmp = t_3
else
tmp = t_1
end if
code = tmp
end function
assert y < z;
assert j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = ((c * b) + (18.0 * (y * (t * (z * x))))) - (27.0 * (j * k));
double t_2 = y * (t * z);
double t_3 = (c * b) + ((-4.0 * (t * a)) + (x * ((i * -4.0) + (18.0 * t_2))));
double tmp;
if (y <= -1.3e+139) {
tmp = t_1;
} else if (y <= -6.5e+59) {
tmp = t_3;
} else if (y <= -1.25e-25) {
tmp = (k * (j * -27.0)) - (x * ((4.0 * i) + (t_2 * -18.0)));
} else if (y <= -1.46e-80) {
tmp = t_3;
} else if (y <= 2.02e-143) {
tmp = ((c * b) - (4.0 * ((t * a) + (x * i)))) - (k * (j * 27.0));
} else if (y <= 3.3e+30) {
tmp = t_3;
} else {
tmp = t_1;
}
return tmp;
}
[y, z] = sort([y, z]) [j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): t_1 = ((c * b) + (18.0 * (y * (t * (z * x))))) - (27.0 * (j * k)) t_2 = y * (t * z) t_3 = (c * b) + ((-4.0 * (t * a)) + (x * ((i * -4.0) + (18.0 * t_2)))) tmp = 0 if y <= -1.3e+139: tmp = t_1 elif y <= -6.5e+59: tmp = t_3 elif y <= -1.25e-25: tmp = (k * (j * -27.0)) - (x * ((4.0 * i) + (t_2 * -18.0))) elif y <= -1.46e-80: tmp = t_3 elif y <= 2.02e-143: tmp = ((c * b) - (4.0 * ((t * a) + (x * i)))) - (k * (j * 27.0)) elif y <= 3.3e+30: tmp = t_3 else: tmp = t_1 return tmp
y, z = sort([y, z]) j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(Float64(Float64(c * b) + Float64(18.0 * Float64(y * Float64(t * Float64(z * x))))) - Float64(27.0 * Float64(j * k))) t_2 = Float64(y * Float64(t * z)) t_3 = Float64(Float64(c * b) + Float64(Float64(-4.0 * Float64(t * a)) + Float64(x * Float64(Float64(i * -4.0) + Float64(18.0 * t_2))))) tmp = 0.0 if (y <= -1.3e+139) tmp = t_1; elseif (y <= -6.5e+59) tmp = t_3; elseif (y <= -1.25e-25) tmp = Float64(Float64(k * Float64(j * -27.0)) - Float64(x * Float64(Float64(4.0 * i) + Float64(t_2 * -18.0)))); elseif (y <= -1.46e-80) tmp = t_3; elseif (y <= 2.02e-143) tmp = Float64(Float64(Float64(c * b) - Float64(4.0 * Float64(Float64(t * a) + Float64(x * i)))) - Float64(k * Float64(j * 27.0))); elseif (y <= 3.3e+30) tmp = t_3; else tmp = t_1; end return tmp end
y, z = num2cell(sort([y, z])){:}
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
t_1 = ((c * b) + (18.0 * (y * (t * (z * x))))) - (27.0 * (j * k));
t_2 = y * (t * z);
t_3 = (c * b) + ((-4.0 * (t * a)) + (x * ((i * -4.0) + (18.0 * t_2))));
tmp = 0.0;
if (y <= -1.3e+139)
tmp = t_1;
elseif (y <= -6.5e+59)
tmp = t_3;
elseif (y <= -1.25e-25)
tmp = (k * (j * -27.0)) - (x * ((4.0 * i) + (t_2 * -18.0)));
elseif (y <= -1.46e-80)
tmp = t_3;
elseif (y <= 2.02e-143)
tmp = ((c * b) - (4.0 * ((t * a) + (x * i)))) - (k * (j * 27.0));
elseif (y <= 3.3e+30)
tmp = t_3;
else
tmp = t_1;
end
tmp_2 = tmp;
end
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(N[(N[(c * b), $MachinePrecision] + N[(18.0 * N[(y * N[(t * N[(z * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(y * N[(t * z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(c * b), $MachinePrecision] + N[(N[(-4.0 * N[(t * a), $MachinePrecision]), $MachinePrecision] + N[(x * N[(N[(i * -4.0), $MachinePrecision] + N[(18.0 * t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.3e+139], t$95$1, If[LessEqual[y, -6.5e+59], t$95$3, If[LessEqual[y, -1.25e-25], N[(N[(k * N[(j * -27.0), $MachinePrecision]), $MachinePrecision] - N[(x * N[(N[(4.0 * i), $MachinePrecision] + N[(t$95$2 * -18.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -1.46e-80], t$95$3, If[LessEqual[y, 2.02e-143], N[(N[(N[(c * b), $MachinePrecision] - N[(4.0 * N[(N[(t * a), $MachinePrecision] + N[(x * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(k * N[(j * 27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 3.3e+30], t$95$3, t$95$1]]]]]]]]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
t_1 := \left(c \cdot b + 18 \cdot \left(y \cdot \left(t \cdot \left(z \cdot x\right)\right)\right)\right) - 27 \cdot \left(j \cdot k\right)\\
t_2 := y \cdot \left(t \cdot z\right)\\
t_3 := c \cdot b + \left(-4 \cdot \left(t \cdot a\right) + x \cdot \left(i \cdot -4 + 18 \cdot t_2\right)\right)\\
\mathbf{if}\;y \leq -1.3 \cdot 10^{+139}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq -6.5 \cdot 10^{+59}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;y \leq -1.25 \cdot 10^{-25}:\\
\;\;\;\;k \cdot \left(j \cdot -27\right) - x \cdot \left(4 \cdot i + t_2 \cdot -18\right)\\
\mathbf{elif}\;y \leq -1.46 \cdot 10^{-80}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;y \leq 2.02 \cdot 10^{-143}:\\
\;\;\;\;\left(c \cdot b - 4 \cdot \left(t \cdot a + x \cdot i\right)\right) - k \cdot \left(j \cdot 27\right)\\
\mathbf{elif}\;y \leq 3.3 \cdot 10^{+30}:\\
\;\;\;\;t_3\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if y < -1.30000000000000011e139 or 3.30000000000000026e30 < y Initial program 73.1%
sub-neg73.1%
associate-+l-73.1%
sub-neg73.1%
sub-neg73.1%
distribute-rgt-out--76.4%
associate-*l*66.8%
distribute-lft-neg-in66.8%
cancel-sign-sub66.8%
associate-*l*66.8%
associate-*l*66.8%
Simplified66.8%
Taylor expanded in i around 0 78.7%
Taylor expanded in y around inf 81.7%
if -1.30000000000000011e139 < y < -6.50000000000000021e59 or -1.2499999999999999e-25 < y < -1.46e-80 or 2.0199999999999999e-143 < y < 3.30000000000000026e30Initial program 85.2%
Simplified92.0%
Taylor expanded in k around 0 82.7%
if -6.50000000000000021e59 < y < -1.2499999999999999e-25Initial program 84.4%
sub-neg84.4%
*-commutative84.4%
distribute-rgt-neg-in84.4%
Simplified94.8%
Taylor expanded in x around -inf 69.4%
if -1.46e-80 < y < 2.0199999999999999e-143Initial program 98.5%
Taylor expanded in y around 0 96.0%
distribute-lft-out96.0%
Simplified96.0%
Final simplification85.1%
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (* k (* j 27.0))))
(if (<= t_1 -5e-44)
(-
(+ (* c b) (* 18.0 (* y (* t (* z x)))))
(+ (* x (* 4.0 i)) (* j (* 27.0 k))))
(if (<= t_1 1e+194)
(+
(* c b)
(+ (* -4.0 (* t a)) (* x (+ (* i -4.0) (* 18.0 (* y (* t z)))))))
(- (- (* c b) (* 4.0 (+ (* t a) (* x i)))) t_1)))))assert(y < z);
assert(j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = k * (j * 27.0);
double tmp;
if (t_1 <= -5e-44) {
tmp = ((c * b) + (18.0 * (y * (t * (z * x))))) - ((x * (4.0 * i)) + (j * (27.0 * k)));
} else if (t_1 <= 1e+194) {
tmp = (c * b) + ((-4.0 * (t * a)) + (x * ((i * -4.0) + (18.0 * (y * (t * z))))));
} else {
tmp = ((c * b) - (4.0 * ((t * a) + (x * i)))) - t_1;
}
return tmp;
}
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: tmp
t_1 = k * (j * 27.0d0)
if (t_1 <= (-5d-44)) then
tmp = ((c * b) + (18.0d0 * (y * (t * (z * x))))) - ((x * (4.0d0 * i)) + (j * (27.0d0 * k)))
else if (t_1 <= 1d+194) then
tmp = (c * b) + (((-4.0d0) * (t * a)) + (x * ((i * (-4.0d0)) + (18.0d0 * (y * (t * z))))))
else
tmp = ((c * b) - (4.0d0 * ((t * a) + (x * i)))) - t_1
end if
code = tmp
end function
assert y < z;
assert j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = k * (j * 27.0);
double tmp;
if (t_1 <= -5e-44) {
tmp = ((c * b) + (18.0 * (y * (t * (z * x))))) - ((x * (4.0 * i)) + (j * (27.0 * k)));
} else if (t_1 <= 1e+194) {
tmp = (c * b) + ((-4.0 * (t * a)) + (x * ((i * -4.0) + (18.0 * (y * (t * z))))));
} else {
tmp = ((c * b) - (4.0 * ((t * a) + (x * i)))) - t_1;
}
return tmp;
}
[y, z] = sort([y, z]) [j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): t_1 = k * (j * 27.0) tmp = 0 if t_1 <= -5e-44: tmp = ((c * b) + (18.0 * (y * (t * (z * x))))) - ((x * (4.0 * i)) + (j * (27.0 * k))) elif t_1 <= 1e+194: tmp = (c * b) + ((-4.0 * (t * a)) + (x * ((i * -4.0) + (18.0 * (y * (t * z)))))) else: tmp = ((c * b) - (4.0 * ((t * a) + (x * i)))) - t_1 return tmp
y, z = sort([y, z]) j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(k * Float64(j * 27.0)) tmp = 0.0 if (t_1 <= -5e-44) tmp = Float64(Float64(Float64(c * b) + Float64(18.0 * Float64(y * Float64(t * Float64(z * x))))) - Float64(Float64(x * Float64(4.0 * i)) + Float64(j * Float64(27.0 * k)))); elseif (t_1 <= 1e+194) tmp = Float64(Float64(c * b) + Float64(Float64(-4.0 * Float64(t * a)) + Float64(x * Float64(Float64(i * -4.0) + Float64(18.0 * Float64(y * Float64(t * z))))))); else tmp = Float64(Float64(Float64(c * b) - Float64(4.0 * Float64(Float64(t * a) + Float64(x * i)))) - t_1); end return tmp end
y, z = num2cell(sort([y, z])){:}
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
t_1 = k * (j * 27.0);
tmp = 0.0;
if (t_1 <= -5e-44)
tmp = ((c * b) + (18.0 * (y * (t * (z * x))))) - ((x * (4.0 * i)) + (j * (27.0 * k)));
elseif (t_1 <= 1e+194)
tmp = (c * b) + ((-4.0 * (t * a)) + (x * ((i * -4.0) + (18.0 * (y * (t * z))))));
else
tmp = ((c * b) - (4.0 * ((t * a) + (x * i)))) - t_1;
end
tmp_2 = tmp;
end
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(k * N[(j * 27.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -5e-44], N[(N[(N[(c * b), $MachinePrecision] + N[(18.0 * N[(y * N[(t * N[(z * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(x * N[(4.0 * i), $MachinePrecision]), $MachinePrecision] + N[(j * N[(27.0 * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 1e+194], N[(N[(c * b), $MachinePrecision] + N[(N[(-4.0 * N[(t * a), $MachinePrecision]), $MachinePrecision] + N[(x * N[(N[(i * -4.0), $MachinePrecision] + N[(18.0 * N[(y * N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(c * b), $MachinePrecision] - N[(4.0 * N[(N[(t * a), $MachinePrecision] + N[(x * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision]]]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
t_1 := k \cdot \left(j \cdot 27\right)\\
\mathbf{if}\;t_1 \leq -5 \cdot 10^{-44}:\\
\;\;\;\;\left(c \cdot b + 18 \cdot \left(y \cdot \left(t \cdot \left(z \cdot x\right)\right)\right)\right) - \left(x \cdot \left(4 \cdot i\right) + j \cdot \left(27 \cdot k\right)\right)\\
\mathbf{elif}\;t_1 \leq 10^{+194}:\\
\;\;\;\;c \cdot b + \left(-4 \cdot \left(t \cdot a\right) + x \cdot \left(i \cdot -4 + 18 \cdot \left(y \cdot \left(t \cdot z\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(c \cdot b - 4 \cdot \left(t \cdot a + x \cdot i\right)\right) - t_1\\
\end{array}
\end{array}
if (*.f64 (*.f64 j 27) k) < -5.00000000000000039e-44Initial program 76.2%
sub-neg76.2%
associate-+l-76.2%
sub-neg76.2%
sub-neg76.2%
distribute-rgt-out--79.0%
associate-*l*69.4%
distribute-lft-neg-in69.4%
cancel-sign-sub69.4%
associate-*l*69.4%
associate-*l*70.8%
Simplified70.8%
Taylor expanded in a around 0 85.7%
if -5.00000000000000039e-44 < (*.f64 (*.f64 j 27) k) < 9.99999999999999945e193Initial program 89.6%
Simplified91.5%
Taylor expanded in k around 0 90.1%
if 9.99999999999999945e193 < (*.f64 (*.f64 j 27) k) Initial program 76.8%
Taylor expanded in y around 0 84.5%
distribute-lft-out84.5%
Simplified84.5%
Final simplification88.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 (* 27.0 (* j k)))
(t_2
(+
(* c b)
(+ (* -4.0 (* t a)) (* x (+ (* i -4.0) (* 18.0 (* y (* t z))))))))
(t_3 (- (+ (* c b) (* t (- (* 18.0 (* y (* z x))) (* 4.0 a)))) t_1)))
(if (<= y -2.2e+137)
(- (+ (* c b) (* 18.0 (* y (* t (* z x))))) t_1)
(if (<= y -2.65e+85)
t_2
(if (<= y -2.35e-38)
t_3
(if (<= y 3.4e-144)
(- (- (* c b) (* 4.0 (+ (* t a) (* x i)))) (* k (* j 27.0)))
(if (<= y 1.8e+27) t_2 t_3)))))))assert(y < z);
assert(j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = 27.0 * (j * k);
double t_2 = (c * b) + ((-4.0 * (t * a)) + (x * ((i * -4.0) + (18.0 * (y * (t * z))))));
double t_3 = ((c * b) + (t * ((18.0 * (y * (z * x))) - (4.0 * a)))) - t_1;
double tmp;
if (y <= -2.2e+137) {
tmp = ((c * b) + (18.0 * (y * (t * (z * x))))) - t_1;
} else if (y <= -2.65e+85) {
tmp = t_2;
} else if (y <= -2.35e-38) {
tmp = t_3;
} else if (y <= 3.4e-144) {
tmp = ((c * b) - (4.0 * ((t * a) + (x * i)))) - (k * (j * 27.0));
} else if (y <= 1.8e+27) {
tmp = t_2;
} else {
tmp = t_3;
}
return tmp;
}
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_1 = 27.0d0 * (j * k)
t_2 = (c * b) + (((-4.0d0) * (t * a)) + (x * ((i * (-4.0d0)) + (18.0d0 * (y * (t * z))))))
t_3 = ((c * b) + (t * ((18.0d0 * (y * (z * x))) - (4.0d0 * a)))) - t_1
if (y <= (-2.2d+137)) then
tmp = ((c * b) + (18.0d0 * (y * (t * (z * x))))) - t_1
else if (y <= (-2.65d+85)) then
tmp = t_2
else if (y <= (-2.35d-38)) then
tmp = t_3
else if (y <= 3.4d-144) then
tmp = ((c * b) - (4.0d0 * ((t * a) + (x * i)))) - (k * (j * 27.0d0))
else if (y <= 1.8d+27) then
tmp = t_2
else
tmp = t_3
end if
code = tmp
end function
assert y < z;
assert j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = 27.0 * (j * k);
double t_2 = (c * b) + ((-4.0 * (t * a)) + (x * ((i * -4.0) + (18.0 * (y * (t * z))))));
double t_3 = ((c * b) + (t * ((18.0 * (y * (z * x))) - (4.0 * a)))) - t_1;
double tmp;
if (y <= -2.2e+137) {
tmp = ((c * b) + (18.0 * (y * (t * (z * x))))) - t_1;
} else if (y <= -2.65e+85) {
tmp = t_2;
} else if (y <= -2.35e-38) {
tmp = t_3;
} else if (y <= 3.4e-144) {
tmp = ((c * b) - (4.0 * ((t * a) + (x * i)))) - (k * (j * 27.0));
} else if (y <= 1.8e+27) {
tmp = t_2;
} else {
tmp = t_3;
}
return tmp;
}
[y, z] = sort([y, z]) [j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): t_1 = 27.0 * (j * k) t_2 = (c * b) + ((-4.0 * (t * a)) + (x * ((i * -4.0) + (18.0 * (y * (t * z)))))) t_3 = ((c * b) + (t * ((18.0 * (y * (z * x))) - (4.0 * a)))) - t_1 tmp = 0 if y <= -2.2e+137: tmp = ((c * b) + (18.0 * (y * (t * (z * x))))) - t_1 elif y <= -2.65e+85: tmp = t_2 elif y <= -2.35e-38: tmp = t_3 elif y <= 3.4e-144: tmp = ((c * b) - (4.0 * ((t * a) + (x * i)))) - (k * (j * 27.0)) elif y <= 1.8e+27: tmp = t_2 else: tmp = t_3 return tmp
y, z = sort([y, z]) j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(27.0 * Float64(j * k)) t_2 = Float64(Float64(c * b) + Float64(Float64(-4.0 * Float64(t * a)) + Float64(x * Float64(Float64(i * -4.0) + Float64(18.0 * Float64(y * Float64(t * z))))))) t_3 = Float64(Float64(Float64(c * b) + Float64(t * Float64(Float64(18.0 * Float64(y * Float64(z * x))) - Float64(4.0 * a)))) - t_1) tmp = 0.0 if (y <= -2.2e+137) tmp = Float64(Float64(Float64(c * b) + Float64(18.0 * Float64(y * Float64(t * Float64(z * x))))) - t_1); elseif (y <= -2.65e+85) tmp = t_2; elseif (y <= -2.35e-38) tmp = t_3; elseif (y <= 3.4e-144) tmp = Float64(Float64(Float64(c * b) - Float64(4.0 * Float64(Float64(t * a) + Float64(x * i)))) - Float64(k * Float64(j * 27.0))); elseif (y <= 1.8e+27) tmp = t_2; else tmp = t_3; end return tmp end
y, z = num2cell(sort([y, z])){:}
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
t_1 = 27.0 * (j * k);
t_2 = (c * b) + ((-4.0 * (t * a)) + (x * ((i * -4.0) + (18.0 * (y * (t * z))))));
t_3 = ((c * b) + (t * ((18.0 * (y * (z * x))) - (4.0 * a)))) - t_1;
tmp = 0.0;
if (y <= -2.2e+137)
tmp = ((c * b) + (18.0 * (y * (t * (z * x))))) - t_1;
elseif (y <= -2.65e+85)
tmp = t_2;
elseif (y <= -2.35e-38)
tmp = t_3;
elseif (y <= 3.4e-144)
tmp = ((c * b) - (4.0 * ((t * a) + (x * i)))) - (k * (j * 27.0));
elseif (y <= 1.8e+27)
tmp = t_2;
else
tmp = t_3;
end
tmp_2 = tmp;
end
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(c * b), $MachinePrecision] + N[(N[(-4.0 * N[(t * a), $MachinePrecision]), $MachinePrecision] + N[(x * N[(N[(i * -4.0), $MachinePrecision] + N[(18.0 * N[(y * N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(N[(c * b), $MachinePrecision] + N[(t * N[(N[(18.0 * N[(y * N[(z * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(4.0 * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision]}, If[LessEqual[y, -2.2e+137], N[(N[(N[(c * b), $MachinePrecision] + N[(18.0 * N[(y * N[(t * N[(z * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], If[LessEqual[y, -2.65e+85], t$95$2, If[LessEqual[y, -2.35e-38], t$95$3, If[LessEqual[y, 3.4e-144], N[(N[(N[(c * b), $MachinePrecision] - N[(4.0 * N[(N[(t * a), $MachinePrecision] + N[(x * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(k * N[(j * 27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.8e+27], t$95$2, t$95$3]]]]]]]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
t_1 := 27 \cdot \left(j \cdot k\right)\\
t_2 := c \cdot b + \left(-4 \cdot \left(t \cdot a\right) + x \cdot \left(i \cdot -4 + 18 \cdot \left(y \cdot \left(t \cdot z\right)\right)\right)\right)\\
t_3 := \left(c \cdot b + t \cdot \left(18 \cdot \left(y \cdot \left(z \cdot x\right)\right) - 4 \cdot a\right)\right) - t_1\\
\mathbf{if}\;y \leq -2.2 \cdot 10^{+137}:\\
\;\;\;\;\left(c \cdot b + 18 \cdot \left(y \cdot \left(t \cdot \left(z \cdot x\right)\right)\right)\right) - t_1\\
\mathbf{elif}\;y \leq -2.65 \cdot 10^{+85}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;y \leq -2.35 \cdot 10^{-38}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;y \leq 3.4 \cdot 10^{-144}:\\
\;\;\;\;\left(c \cdot b - 4 \cdot \left(t \cdot a + x \cdot i\right)\right) - k \cdot \left(j \cdot 27\right)\\
\mathbf{elif}\;y \leq 1.8 \cdot 10^{+27}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;t_3\\
\end{array}
\end{array}
if y < -2.20000000000000015e137Initial program 76.1%
sub-neg76.1%
associate-+l-76.1%
sub-neg76.1%
sub-neg76.1%
distribute-rgt-out--78.9%
associate-*l*78.1%
distribute-lft-neg-in78.1%
cancel-sign-sub78.1%
associate-*l*78.1%
associate-*l*78.1%
Simplified78.1%
Taylor expanded in i around 0 89.2%
Taylor expanded in y around inf 89.1%
if -2.20000000000000015e137 < y < -2.65e85 or 3.40000000000000017e-144 < y < 1.79999999999999991e27Initial program 82.1%
Simplified93.5%
Taylor expanded in k around 0 80.5%
if -2.65e85 < y < -2.34999999999999999e-38 or 1.79999999999999991e27 < y Initial program 76.7%
sub-neg76.7%
associate-+l-76.7%
sub-neg76.7%
sub-neg76.7%
distribute-rgt-out--80.4%
associate-*l*68.7%
distribute-lft-neg-in68.7%
cancel-sign-sub68.7%
associate-*l*68.7%
associate-*l*69.9%
Simplified69.9%
Taylor expanded in i around 0 76.9%
if -2.34999999999999999e-38 < y < 3.40000000000000017e-144Initial program 98.5%
Taylor expanded in y around 0 93.9%
distribute-lft-out93.9%
Simplified93.9%
Final simplification84.7%
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (+ (* x (* 4.0 i)) (* j (* 27.0 k)))))
(if (<= y -7.7e+130)
(- (+ (* c b) (* 18.0 (* y (* t (* z x))))) t_1)
(if (<= y 1.3e+36)
(- (+ (* c b) (* t (- (* (* y z) (* 18.0 x)) (* 4.0 a)))) t_1)
(-
(+ (* c b) (* t (- (* 18.0 (* y (* z x))) (* 4.0 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 t_1 = (x * (4.0 * i)) + (j * (27.0 * k));
double tmp;
if (y <= -7.7e+130) {
tmp = ((c * b) + (18.0 * (y * (t * (z * x))))) - t_1;
} else if (y <= 1.3e+36) {
tmp = ((c * b) + (t * (((y * z) * (18.0 * x)) - (4.0 * a)))) - t_1;
} else {
tmp = ((c * b) + (t * ((18.0 * (y * (z * x))) - (4.0 * 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) :: t_1
real(8) :: tmp
t_1 = (x * (4.0d0 * i)) + (j * (27.0d0 * k))
if (y <= (-7.7d+130)) then
tmp = ((c * b) + (18.0d0 * (y * (t * (z * x))))) - t_1
else if (y <= 1.3d+36) then
tmp = ((c * b) + (t * (((y * z) * (18.0d0 * x)) - (4.0d0 * a)))) - t_1
else
tmp = ((c * b) + (t * ((18.0d0 * (y * (z * x))) - (4.0d0 * 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 t_1 = (x * (4.0 * i)) + (j * (27.0 * k));
double tmp;
if (y <= -7.7e+130) {
tmp = ((c * b) + (18.0 * (y * (t * (z * x))))) - t_1;
} else if (y <= 1.3e+36) {
tmp = ((c * b) + (t * (((y * z) * (18.0 * x)) - (4.0 * a)))) - t_1;
} else {
tmp = ((c * b) + (t * ((18.0 * (y * (z * x))) - (4.0 * 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): t_1 = (x * (4.0 * i)) + (j * (27.0 * k)) tmp = 0 if y <= -7.7e+130: tmp = ((c * b) + (18.0 * (y * (t * (z * x))))) - t_1 elif y <= 1.3e+36: tmp = ((c * b) + (t * (((y * z) * (18.0 * x)) - (4.0 * a)))) - t_1 else: tmp = ((c * b) + (t * ((18.0 * (y * (z * x))) - (4.0 * 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) t_1 = Float64(Float64(x * Float64(4.0 * i)) + Float64(j * Float64(27.0 * k))) tmp = 0.0 if (y <= -7.7e+130) tmp = Float64(Float64(Float64(c * b) + Float64(18.0 * Float64(y * Float64(t * Float64(z * x))))) - t_1); elseif (y <= 1.3e+36) tmp = Float64(Float64(Float64(c * b) + Float64(t * Float64(Float64(Float64(y * z) * Float64(18.0 * x)) - Float64(4.0 * a)))) - t_1); else tmp = Float64(Float64(Float64(c * b) + Float64(t * Float64(Float64(18.0 * Float64(y * Float64(z * x))) - Float64(4.0 * 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)
t_1 = (x * (4.0 * i)) + (j * (27.0 * k));
tmp = 0.0;
if (y <= -7.7e+130)
tmp = ((c * b) + (18.0 * (y * (t * (z * x))))) - t_1;
elseif (y <= 1.3e+36)
tmp = ((c * b) + (t * (((y * z) * (18.0 * x)) - (4.0 * a)))) - t_1;
else
tmp = ((c * b) + (t * ((18.0 * (y * (z * x))) - (4.0 * 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_] := Block[{t$95$1 = N[(N[(x * N[(4.0 * i), $MachinePrecision]), $MachinePrecision] + N[(j * N[(27.0 * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -7.7e+130], N[(N[(N[(c * b), $MachinePrecision] + N[(18.0 * N[(y * N[(t * N[(z * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], If[LessEqual[y, 1.3e+36], N[(N[(N[(c * b), $MachinePrecision] + N[(t * N[(N[(N[(y * z), $MachinePrecision] * N[(18.0 * x), $MachinePrecision]), $MachinePrecision] - N[(4.0 * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], N[(N[(N[(c * b), $MachinePrecision] + N[(t * N[(N[(18.0 * N[(y * N[(z * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(4.0 * a), $MachinePrecision]), $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}
t_1 := x \cdot \left(4 \cdot i\right) + j \cdot \left(27 \cdot k\right)\\
\mathbf{if}\;y \leq -7.7 \cdot 10^{+130}:\\
\;\;\;\;\left(c \cdot b + 18 \cdot \left(y \cdot \left(t \cdot \left(z \cdot x\right)\right)\right)\right) - t_1\\
\mathbf{elif}\;y \leq 1.3 \cdot 10^{+36}:\\
\;\;\;\;\left(c \cdot b + t \cdot \left(\left(y \cdot z\right) \cdot \left(18 \cdot x\right) - 4 \cdot a\right)\right) - t_1\\
\mathbf{else}:\\
\;\;\;\;\left(c \cdot b + t \cdot \left(18 \cdot \left(y \cdot \left(z \cdot x\right)\right) - 4 \cdot a\right)\right) - 27 \cdot \left(j \cdot k\right)\\
\end{array}
\end{array}
if y < -7.7000000000000004e130Initial program 76.7%
sub-neg76.7%
associate-+l-76.7%
sub-neg76.7%
sub-neg76.7%
distribute-rgt-out--79.4%
associate-*l*76.2%
distribute-lft-neg-in76.2%
cancel-sign-sub76.2%
associate-*l*76.2%
associate-*l*76.2%
Simplified76.2%
Taylor expanded in a around 0 86.8%
if -7.7000000000000004e130 < y < 1.3000000000000001e36Initial program 89.8%
sub-neg89.8%
associate-+l-89.8%
sub-neg89.8%
sub-neg89.8%
distribute-rgt-out--92.3%
associate-*l*92.8%
distribute-lft-neg-in92.8%
cancel-sign-sub92.8%
associate-*l*92.8%
associate-*l*93.4%
Simplified93.4%
if 1.3000000000000001e36 < y Initial program 73.8%
sub-neg73.8%
associate-+l-73.8%
sub-neg73.8%
sub-neg73.8%
distribute-rgt-out--75.7%
associate-*l*59.7%
distribute-lft-neg-in59.7%
cancel-sign-sub59.7%
associate-*l*59.7%
associate-*l*59.7%
Simplified59.7%
Taylor expanded in i around 0 72.6%
Final simplification88.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 (+ (* c b) (* t (- (* 18.0 (* y (* z x))) (* 4.0 a))))))
(if (<= t -8e-121)
t_1
(if (<= t 2.6e-100)
(- (* c b) (+ (* 27.0 (* j k)) (* 4.0 (* x i))))
(if (or (<= t 2.8e-41)
(and (not (<= t 8e-15))
(or (<= t 2e+102) (not (<= t 1.3e+199)))))
t_1
(+ (* k (* j -27.0)) (* -4.0 (+ (* t a) (* 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 = (c * b) + (t * ((18.0 * (y * (z * x))) - (4.0 * a)));
double tmp;
if (t <= -8e-121) {
tmp = t_1;
} else if (t <= 2.6e-100) {
tmp = (c * b) - ((27.0 * (j * k)) + (4.0 * (x * i)));
} else if ((t <= 2.8e-41) || (!(t <= 8e-15) && ((t <= 2e+102) || !(t <= 1.3e+199)))) {
tmp = t_1;
} else {
tmp = (k * (j * -27.0)) + (-4.0 * ((t * a) + (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 = (c * b) + (t * ((18.0d0 * (y * (z * x))) - (4.0d0 * a)))
if (t <= (-8d-121)) then
tmp = t_1
else if (t <= 2.6d-100) then
tmp = (c * b) - ((27.0d0 * (j * k)) + (4.0d0 * (x * i)))
else if ((t <= 2.8d-41) .or. (.not. (t <= 8d-15)) .and. (t <= 2d+102) .or. (.not. (t <= 1.3d+199))) then
tmp = t_1
else
tmp = (k * (j * (-27.0d0))) + ((-4.0d0) * ((t * a) + (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 = (c * b) + (t * ((18.0 * (y * (z * x))) - (4.0 * a)));
double tmp;
if (t <= -8e-121) {
tmp = t_1;
} else if (t <= 2.6e-100) {
tmp = (c * b) - ((27.0 * (j * k)) + (4.0 * (x * i)));
} else if ((t <= 2.8e-41) || (!(t <= 8e-15) && ((t <= 2e+102) || !(t <= 1.3e+199)))) {
tmp = t_1;
} else {
tmp = (k * (j * -27.0)) + (-4.0 * ((t * a) + (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 = (c * b) + (t * ((18.0 * (y * (z * x))) - (4.0 * a))) tmp = 0 if t <= -8e-121: tmp = t_1 elif t <= 2.6e-100: tmp = (c * b) - ((27.0 * (j * k)) + (4.0 * (x * i))) elif (t <= 2.8e-41) or (not (t <= 8e-15) and ((t <= 2e+102) or not (t <= 1.3e+199))): tmp = t_1 else: tmp = (k * (j * -27.0)) + (-4.0 * ((t * a) + (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(c * b) + Float64(t * Float64(Float64(18.0 * Float64(y * Float64(z * x))) - Float64(4.0 * a)))) tmp = 0.0 if (t <= -8e-121) tmp = t_1; elseif (t <= 2.6e-100) tmp = Float64(Float64(c * b) - Float64(Float64(27.0 * Float64(j * k)) + Float64(4.0 * Float64(x * i)))); elseif ((t <= 2.8e-41) || (!(t <= 8e-15) && ((t <= 2e+102) || !(t <= 1.3e+199)))) tmp = t_1; else tmp = Float64(Float64(k * Float64(j * -27.0)) + Float64(-4.0 * Float64(Float64(t * a) + 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 = (c * b) + (t * ((18.0 * (y * (z * x))) - (4.0 * a)));
tmp = 0.0;
if (t <= -8e-121)
tmp = t_1;
elseif (t <= 2.6e-100)
tmp = (c * b) - ((27.0 * (j * k)) + (4.0 * (x * i)));
elseif ((t <= 2.8e-41) || (~((t <= 8e-15)) && ((t <= 2e+102) || ~((t <= 1.3e+199)))))
tmp = t_1;
else
tmp = (k * (j * -27.0)) + (-4.0 * ((t * a) + (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[(c * b), $MachinePrecision] + N[(t * N[(N[(18.0 * N[(y * N[(z * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(4.0 * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -8e-121], t$95$1, If[LessEqual[t, 2.6e-100], N[(N[(c * b), $MachinePrecision] - N[(N[(27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision] + N[(4.0 * N[(x * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[t, 2.8e-41], And[N[Not[LessEqual[t, 8e-15]], $MachinePrecision], Or[LessEqual[t, 2e+102], N[Not[LessEqual[t, 1.3e+199]], $MachinePrecision]]]], t$95$1, N[(N[(k * N[(j * -27.0), $MachinePrecision]), $MachinePrecision] + N[(-4.0 * N[(N[(t * a), $MachinePrecision] + 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 := c \cdot b + t \cdot \left(18 \cdot \left(y \cdot \left(z \cdot x\right)\right) - 4 \cdot a\right)\\
\mathbf{if}\;t \leq -8 \cdot 10^{-121}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq 2.6 \cdot 10^{-100}:\\
\;\;\;\;c \cdot b - \left(27 \cdot \left(j \cdot k\right) + 4 \cdot \left(x \cdot i\right)\right)\\
\mathbf{elif}\;t \leq 2.8 \cdot 10^{-41} \lor \neg \left(t \leq 8 \cdot 10^{-15}\right) \land \left(t \leq 2 \cdot 10^{+102} \lor \neg \left(t \leq 1.3 \cdot 10^{+199}\right)\right):\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;k \cdot \left(j \cdot -27\right) + -4 \cdot \left(t \cdot a + x \cdot i\right)\\
\end{array}
\end{array}
if t < -7.9999999999999998e-121 or 2.5999999999999998e-100 < t < 2.8000000000000002e-41 or 8.0000000000000006e-15 < t < 1.99999999999999995e102 or 1.3000000000000001e199 < t Initial program 82.6%
sub-neg82.6%
associate-+l-82.6%
sub-neg82.6%
sub-neg82.6%
distribute-rgt-out--86.5%
associate-*l*84.7%
distribute-lft-neg-in84.7%
cancel-sign-sub84.7%
associate-*l*84.7%
associate-*l*84.7%
Simplified84.7%
Taylor expanded in i around 0 84.6%
Taylor expanded in k around 0 79.8%
if -7.9999999999999998e-121 < t < 2.5999999999999998e-100Initial program 88.4%
sub-neg88.4%
associate-+l-88.4%
sub-neg88.4%
sub-neg88.4%
distribute-rgt-out--88.4%
associate-*l*80.6%
distribute-lft-neg-in80.6%
cancel-sign-sub80.6%
associate-*l*80.6%
associate-*l*81.9%
Simplified81.9%
Taylor expanded in t around 0 88.7%
if 2.8000000000000002e-41 < t < 8.0000000000000006e-15 or 1.99999999999999995e102 < t < 1.3000000000000001e199Initial program 85.5%
sub-neg85.5%
*-commutative85.5%
distribute-rgt-neg-in85.5%
Simplified85.7%
Taylor expanded in x around 0 85.9%
Taylor expanded in b around 0 85.9%
distribute-lft-out85.9%
Simplified85.9%
Final simplification83.1%
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (* 27.0 (* j k)))
(t_2 (+ (* c b) (* t (- (* 18.0 (* y (* z x))) (* 4.0 a))))))
(if (<= t -7.5e-121)
t_2
(if (<= t 2e-136)
(- (* c b) (+ t_1 (* 4.0 (* x i))))
(if (<= t 3.4e-41)
(- (+ (* c b) (* 18.0 (* y (* t (* z x))))) t_1)
(if (or (<= t 1.9e-14) (and (not (<= t 1.46e+103)) (<= t 1.3e+199)))
(+ (* k (* j -27.0)) (* -4.0 (+ (* t a) (* x i))))
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 = (c * b) + (t * ((18.0 * (y * (z * x))) - (4.0 * a)));
double tmp;
if (t <= -7.5e-121) {
tmp = t_2;
} else if (t <= 2e-136) {
tmp = (c * b) - (t_1 + (4.0 * (x * i)));
} else if (t <= 3.4e-41) {
tmp = ((c * b) + (18.0 * (y * (t * (z * x))))) - t_1;
} else if ((t <= 1.9e-14) || (!(t <= 1.46e+103) && (t <= 1.3e+199))) {
tmp = (k * (j * -27.0)) + (-4.0 * ((t * a) + (x * i)));
} 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 = (c * b) + (t * ((18.0d0 * (y * (z * x))) - (4.0d0 * a)))
if (t <= (-7.5d-121)) then
tmp = t_2
else if (t <= 2d-136) then
tmp = (c * b) - (t_1 + (4.0d0 * (x * i)))
else if (t <= 3.4d-41) then
tmp = ((c * b) + (18.0d0 * (y * (t * (z * x))))) - t_1
else if ((t <= 1.9d-14) .or. (.not. (t <= 1.46d+103)) .and. (t <= 1.3d+199)) then
tmp = (k * (j * (-27.0d0))) + ((-4.0d0) * ((t * a) + (x * i)))
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 = (c * b) + (t * ((18.0 * (y * (z * x))) - (4.0 * a)));
double tmp;
if (t <= -7.5e-121) {
tmp = t_2;
} else if (t <= 2e-136) {
tmp = (c * b) - (t_1 + (4.0 * (x * i)));
} else if (t <= 3.4e-41) {
tmp = ((c * b) + (18.0 * (y * (t * (z * x))))) - t_1;
} else if ((t <= 1.9e-14) || (!(t <= 1.46e+103) && (t <= 1.3e+199))) {
tmp = (k * (j * -27.0)) + (-4.0 * ((t * a) + (x * i)));
} 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 = (c * b) + (t * ((18.0 * (y * (z * x))) - (4.0 * a))) tmp = 0 if t <= -7.5e-121: tmp = t_2 elif t <= 2e-136: tmp = (c * b) - (t_1 + (4.0 * (x * i))) elif t <= 3.4e-41: tmp = ((c * b) + (18.0 * (y * (t * (z * x))))) - t_1 elif (t <= 1.9e-14) or (not (t <= 1.46e+103) and (t <= 1.3e+199)): tmp = (k * (j * -27.0)) + (-4.0 * ((t * a) + (x * i))) 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(Float64(c * b) + Float64(t * Float64(Float64(18.0 * Float64(y * Float64(z * x))) - Float64(4.0 * a)))) tmp = 0.0 if (t <= -7.5e-121) tmp = t_2; elseif (t <= 2e-136) tmp = Float64(Float64(c * b) - Float64(t_1 + Float64(4.0 * Float64(x * i)))); elseif (t <= 3.4e-41) tmp = Float64(Float64(Float64(c * b) + Float64(18.0 * Float64(y * Float64(t * Float64(z * x))))) - t_1); elseif ((t <= 1.9e-14) || (!(t <= 1.46e+103) && (t <= 1.3e+199))) tmp = Float64(Float64(k * Float64(j * -27.0)) + Float64(-4.0 * Float64(Float64(t * a) + Float64(x * i)))); 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 = (c * b) + (t * ((18.0 * (y * (z * x))) - (4.0 * a)));
tmp = 0.0;
if (t <= -7.5e-121)
tmp = t_2;
elseif (t <= 2e-136)
tmp = (c * b) - (t_1 + (4.0 * (x * i)));
elseif (t <= 3.4e-41)
tmp = ((c * b) + (18.0 * (y * (t * (z * x))))) - t_1;
elseif ((t <= 1.9e-14) || (~((t <= 1.46e+103)) && (t <= 1.3e+199)))
tmp = (k * (j * -27.0)) + (-4.0 * ((t * a) + (x * i)));
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[(N[(c * b), $MachinePrecision] + N[(t * N[(N[(18.0 * N[(y * N[(z * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(4.0 * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -7.5e-121], t$95$2, If[LessEqual[t, 2e-136], N[(N[(c * b), $MachinePrecision] - N[(t$95$1 + N[(4.0 * N[(x * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 3.4e-41], N[(N[(N[(c * b), $MachinePrecision] + N[(18.0 * N[(y * N[(t * N[(z * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], If[Or[LessEqual[t, 1.9e-14], And[N[Not[LessEqual[t, 1.46e+103]], $MachinePrecision], LessEqual[t, 1.3e+199]]], N[(N[(k * N[(j * -27.0), $MachinePrecision]), $MachinePrecision] + N[(-4.0 * N[(N[(t * a), $MachinePrecision] + N[(x * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$2]]]]]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
t_1 := 27 \cdot \left(j \cdot k\right)\\
t_2 := c \cdot b + t \cdot \left(18 \cdot \left(y \cdot \left(z \cdot x\right)\right) - 4 \cdot a\right)\\
\mathbf{if}\;t \leq -7.5 \cdot 10^{-121}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t \leq 2 \cdot 10^{-136}:\\
\;\;\;\;c \cdot b - \left(t_1 + 4 \cdot \left(x \cdot i\right)\right)\\
\mathbf{elif}\;t \leq 3.4 \cdot 10^{-41}:\\
\;\;\;\;\left(c \cdot b + 18 \cdot \left(y \cdot \left(t \cdot \left(z \cdot x\right)\right)\right)\right) - t_1\\
\mathbf{elif}\;t \leq 1.9 \cdot 10^{-14} \lor \neg \left(t \leq 1.46 \cdot 10^{+103}\right) \land t \leq 1.3 \cdot 10^{+199}:\\
\;\;\;\;k \cdot \left(j \cdot -27\right) + -4 \cdot \left(t \cdot a + x \cdot i\right)\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if t < -7.50000000000000027e-121 or 1.9000000000000001e-14 < t < 1.45999999999999998e103 or 1.3000000000000001e199 < t Initial program 83.1%
sub-neg83.1%
associate-+l-83.1%
sub-neg83.1%
sub-neg83.1%
distribute-rgt-out--87.4%
associate-*l*86.7%
distribute-lft-neg-in86.7%
cancel-sign-sub86.7%
associate-*l*86.7%
associate-*l*86.7%
Simplified86.7%
Taylor expanded in i around 0 85.2%
Taylor expanded in k around 0 80.0%
if -7.50000000000000027e-121 < t < 2e-136Initial program 92.3%
sub-neg92.3%
associate-+l-92.3%
sub-neg92.3%
sub-neg92.3%
distribute-rgt-out--92.3%
associate-*l*84.7%
distribute-lft-neg-in84.7%
cancel-sign-sub84.7%
associate-*l*84.7%
associate-*l*86.2%
Simplified86.2%
Taylor expanded in t around 0 92.0%
if 2e-136 < t < 3.3999999999999998e-41Initial program 72.1%
sub-neg72.1%
associate-+l-72.1%
sub-neg72.1%
sub-neg72.1%
distribute-rgt-out--72.1%
associate-*l*60.1%
distribute-lft-neg-in60.1%
cancel-sign-sub60.1%
associate-*l*60.1%
associate-*l*60.2%
Simplified60.2%
Taylor expanded in i around 0 64.4%
Taylor expanded in y around inf 80.1%
if 3.3999999999999998e-41 < t < 1.9000000000000001e-14 or 1.45999999999999998e103 < t < 1.3000000000000001e199Initial program 85.5%
sub-neg85.5%
*-commutative85.5%
distribute-rgt-neg-in85.5%
Simplified85.7%
Taylor expanded in x around 0 85.9%
Taylor expanded in b around 0 85.9%
distribute-lft-out85.9%
Simplified85.9%
Final simplification83.7%
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (* -27.0 (* j k)))
(t_2 (- (* c b) (+ (* 27.0 (* j k)) (* 4.0 (* x i))))))
(if (<= t -7.5e+118)
(* x (- (* 18.0 (* y (* t z))) (* 4.0 i)))
(if (<= t 1e-108)
t_2
(if (<= t 1.25e-70)
(+ (* 18.0 (* y (* x (* t z)))) t_1)
(if (<= t 2.4e-15)
t_2
(if (or (<= t 2.4e+87) (not (<= t 2.8e+198)))
(+ (* 18.0 (* y (* t (* z x)))) t_1)
(+ (* k (* j -27.0)) (* -4.0 (+ (* t a) (* 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);
double t_2 = (c * b) - ((27.0 * (j * k)) + (4.0 * (x * i)));
double tmp;
if (t <= -7.5e+118) {
tmp = x * ((18.0 * (y * (t * z))) - (4.0 * i));
} else if (t <= 1e-108) {
tmp = t_2;
} else if (t <= 1.25e-70) {
tmp = (18.0 * (y * (x * (t * z)))) + t_1;
} else if (t <= 2.4e-15) {
tmp = t_2;
} else if ((t <= 2.4e+87) || !(t <= 2.8e+198)) {
tmp = (18.0 * (y * (t * (z * x)))) + t_1;
} else {
tmp = (k * (j * -27.0)) + (-4.0 * ((t * a) + (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) :: t_2
real(8) :: tmp
t_1 = (-27.0d0) * (j * k)
t_2 = (c * b) - ((27.0d0 * (j * k)) + (4.0d0 * (x * i)))
if (t <= (-7.5d+118)) then
tmp = x * ((18.0d0 * (y * (t * z))) - (4.0d0 * i))
else if (t <= 1d-108) then
tmp = t_2
else if (t <= 1.25d-70) then
tmp = (18.0d0 * (y * (x * (t * z)))) + t_1
else if (t <= 2.4d-15) then
tmp = t_2
else if ((t <= 2.4d+87) .or. (.not. (t <= 2.8d+198))) then
tmp = (18.0d0 * (y * (t * (z * x)))) + t_1
else
tmp = (k * (j * (-27.0d0))) + ((-4.0d0) * ((t * a) + (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);
double t_2 = (c * b) - ((27.0 * (j * k)) + (4.0 * (x * i)));
double tmp;
if (t <= -7.5e+118) {
tmp = x * ((18.0 * (y * (t * z))) - (4.0 * i));
} else if (t <= 1e-108) {
tmp = t_2;
} else if (t <= 1.25e-70) {
tmp = (18.0 * (y * (x * (t * z)))) + t_1;
} else if (t <= 2.4e-15) {
tmp = t_2;
} else if ((t <= 2.4e+87) || !(t <= 2.8e+198)) {
tmp = (18.0 * (y * (t * (z * x)))) + t_1;
} else {
tmp = (k * (j * -27.0)) + (-4.0 * ((t * a) + (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) t_2 = (c * b) - ((27.0 * (j * k)) + (4.0 * (x * i))) tmp = 0 if t <= -7.5e+118: tmp = x * ((18.0 * (y * (t * z))) - (4.0 * i)) elif t <= 1e-108: tmp = t_2 elif t <= 1.25e-70: tmp = (18.0 * (y * (x * (t * z)))) + t_1 elif t <= 2.4e-15: tmp = t_2 elif (t <= 2.4e+87) or not (t <= 2.8e+198): tmp = (18.0 * (y * (t * (z * x)))) + t_1 else: tmp = (k * (j * -27.0)) + (-4.0 * ((t * a) + (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(-27.0 * Float64(j * k)) t_2 = Float64(Float64(c * b) - Float64(Float64(27.0 * Float64(j * k)) + Float64(4.0 * Float64(x * i)))) tmp = 0.0 if (t <= -7.5e+118) tmp = Float64(x * Float64(Float64(18.0 * Float64(y * Float64(t * z))) - Float64(4.0 * i))); elseif (t <= 1e-108) tmp = t_2; elseif (t <= 1.25e-70) tmp = Float64(Float64(18.0 * Float64(y * Float64(x * Float64(t * z)))) + t_1); elseif (t <= 2.4e-15) tmp = t_2; elseif ((t <= 2.4e+87) || !(t <= 2.8e+198)) tmp = Float64(Float64(18.0 * Float64(y * Float64(t * Float64(z * x)))) + t_1); else tmp = Float64(Float64(k * Float64(j * -27.0)) + Float64(-4.0 * Float64(Float64(t * a) + 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);
t_2 = (c * b) - ((27.0 * (j * k)) + (4.0 * (x * i)));
tmp = 0.0;
if (t <= -7.5e+118)
tmp = x * ((18.0 * (y * (t * z))) - (4.0 * i));
elseif (t <= 1e-108)
tmp = t_2;
elseif (t <= 1.25e-70)
tmp = (18.0 * (y * (x * (t * z)))) + t_1;
elseif (t <= 2.4e-15)
tmp = t_2;
elseif ((t <= 2.4e+87) || ~((t <= 2.8e+198)))
tmp = (18.0 * (y * (t * (z * x)))) + t_1;
else
tmp = (k * (j * -27.0)) + (-4.0 * ((t * a) + (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[(-27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(c * b), $MachinePrecision] - N[(N[(27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision] + N[(4.0 * N[(x * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -7.5e+118], N[(x * N[(N[(18.0 * N[(y * N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(4.0 * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1e-108], t$95$2, If[LessEqual[t, 1.25e-70], N[(N[(18.0 * N[(y * N[(x * N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision], If[LessEqual[t, 2.4e-15], t$95$2, If[Or[LessEqual[t, 2.4e+87], N[Not[LessEqual[t, 2.8e+198]], $MachinePrecision]], N[(N[(18.0 * N[(y * N[(t * N[(z * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision], N[(N[(k * N[(j * -27.0), $MachinePrecision]), $MachinePrecision] + N[(-4.0 * N[(N[(t * a), $MachinePrecision] + 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)\\
t_2 := c \cdot b - \left(27 \cdot \left(j \cdot k\right) + 4 \cdot \left(x \cdot i\right)\right)\\
\mathbf{if}\;t \leq -7.5 \cdot 10^{+118}:\\
\;\;\;\;x \cdot \left(18 \cdot \left(y \cdot \left(t \cdot z\right)\right) - 4 \cdot i\right)\\
\mathbf{elif}\;t \leq 10^{-108}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t \leq 1.25 \cdot 10^{-70}:\\
\;\;\;\;18 \cdot \left(y \cdot \left(x \cdot \left(t \cdot z\right)\right)\right) + t_1\\
\mathbf{elif}\;t \leq 2.4 \cdot 10^{-15}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t \leq 2.4 \cdot 10^{+87} \lor \neg \left(t \leq 2.8 \cdot 10^{+198}\right):\\
\;\;\;\;18 \cdot \left(y \cdot \left(t \cdot \left(z \cdot x\right)\right)\right) + t_1\\
\mathbf{else}:\\
\;\;\;\;k \cdot \left(j \cdot -27\right) + -4 \cdot \left(t \cdot a + x \cdot i\right)\\
\end{array}
\end{array}
if t < -7.50000000000000003e118Initial program 85.1%
sub-neg85.1%
associate-+l-85.1%
sub-neg85.1%
sub-neg85.1%
distribute-rgt-out--95.1%
associate-*l*97.4%
distribute-lft-neg-in97.4%
cancel-sign-sub97.4%
associate-*l*97.4%
associate-*l*97.4%
Simplified97.4%
Taylor expanded in x around inf 58.6%
if -7.50000000000000003e118 < t < 1.00000000000000004e-108 or 1.25e-70 < t < 2.39999999999999995e-15Initial program 87.8%
sub-neg87.8%
associate-+l-87.8%
sub-neg87.8%
sub-neg87.8%
distribute-rgt-out--87.8%
associate-*l*83.2%
distribute-lft-neg-in83.2%
cancel-sign-sub83.2%
associate-*l*83.2%
associate-*l*83.9%
Simplified83.9%
Taylor expanded in t around 0 73.4%
if 1.00000000000000004e-108 < t < 1.25e-70Initial program 66.2%
sub-neg66.2%
*-commutative66.2%
distribute-rgt-neg-in66.2%
Simplified48.6%
Taylor expanded in x around -inf 80.2%
Taylor expanded in i around 0 62.9%
expm1-log1p-u53.2%
expm1-udef53.2%
*-commutative53.2%
Applied egg-rr53.2%
expm1-def53.2%
expm1-log1p62.9%
*-commutative62.9%
associate-*r*62.9%
Simplified62.9%
if 2.39999999999999995e-15 < t < 2.39999999999999981e87 or 2.8e198 < t Initial program 80.7%
sub-neg80.7%
*-commutative80.7%
distribute-rgt-neg-in80.7%
Simplified83.4%
Taylor expanded in x around -inf 76.3%
Taylor expanded in i around 0 76.3%
if 2.39999999999999981e87 < t < 2.8e198Initial program 79.0%
sub-neg79.0%
*-commutative79.0%
distribute-rgt-neg-in79.0%
Simplified79.2%
Taylor expanded in x around 0 79.5%
Taylor expanded in b around 0 71.2%
distribute-lft-out71.2%
Simplified71.2%
Final simplification70.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 (- (- (* c b) (* 4.0 (+ (* t a) (* x i)))) (* k (* j 27.0)))))
(if (<= y -7.2e+124)
(- (+ (* c b) (* 18.0 (* y (* t (* z x))))) (* 27.0 (* j k)))
(if (<= y -6.4e+59)
t_1
(if (<= y -1.9e-23)
(- (* k (* j -27.0)) (* x (+ (* 4.0 i) (* (* y (* t z)) -18.0))))
(if (<= y 1.96e-57)
t_1
(+ (* c b) (* t (- (* 18.0 (* y (* z x))) (* 4.0 a))))))))))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 * ((t * a) + (x * i)))) - (k * (j * 27.0));
double tmp;
if (y <= -7.2e+124) {
tmp = ((c * b) + (18.0 * (y * (t * (z * x))))) - (27.0 * (j * k));
} else if (y <= -6.4e+59) {
tmp = t_1;
} else if (y <= -1.9e-23) {
tmp = (k * (j * -27.0)) - (x * ((4.0 * i) + ((y * (t * z)) * -18.0)));
} else if (y <= 1.96e-57) {
tmp = t_1;
} else {
tmp = (c * b) + (t * ((18.0 * (y * (z * x))) - (4.0 * a)));
}
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 = ((c * b) - (4.0d0 * ((t * a) + (x * i)))) - (k * (j * 27.0d0))
if (y <= (-7.2d+124)) then
tmp = ((c * b) + (18.0d0 * (y * (t * (z * x))))) - (27.0d0 * (j * k))
else if (y <= (-6.4d+59)) then
tmp = t_1
else if (y <= (-1.9d-23)) then
tmp = (k * (j * (-27.0d0))) - (x * ((4.0d0 * i) + ((y * (t * z)) * (-18.0d0))))
else if (y <= 1.96d-57) then
tmp = t_1
else
tmp = (c * b) + (t * ((18.0d0 * (y * (z * x))) - (4.0d0 * a)))
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 * ((t * a) + (x * i)))) - (k * (j * 27.0));
double tmp;
if (y <= -7.2e+124) {
tmp = ((c * b) + (18.0 * (y * (t * (z * x))))) - (27.0 * (j * k));
} else if (y <= -6.4e+59) {
tmp = t_1;
} else if (y <= -1.9e-23) {
tmp = (k * (j * -27.0)) - (x * ((4.0 * i) + ((y * (t * z)) * -18.0)));
} else if (y <= 1.96e-57) {
tmp = t_1;
} else {
tmp = (c * b) + (t * ((18.0 * (y * (z * x))) - (4.0 * a)));
}
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 * ((t * a) + (x * i)))) - (k * (j * 27.0)) tmp = 0 if y <= -7.2e+124: tmp = ((c * b) + (18.0 * (y * (t * (z * x))))) - (27.0 * (j * k)) elif y <= -6.4e+59: tmp = t_1 elif y <= -1.9e-23: tmp = (k * (j * -27.0)) - (x * ((4.0 * i) + ((y * (t * z)) * -18.0))) elif y <= 1.96e-57: tmp = t_1 else: tmp = (c * b) + (t * ((18.0 * (y * (z * x))) - (4.0 * a))) 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(c * b) - Float64(4.0 * Float64(Float64(t * a) + Float64(x * i)))) - Float64(k * Float64(j * 27.0))) tmp = 0.0 if (y <= -7.2e+124) tmp = Float64(Float64(Float64(c * b) + Float64(18.0 * Float64(y * Float64(t * Float64(z * x))))) - Float64(27.0 * Float64(j * k))); elseif (y <= -6.4e+59) tmp = t_1; elseif (y <= -1.9e-23) tmp = Float64(Float64(k * Float64(j * -27.0)) - Float64(x * Float64(Float64(4.0 * i) + Float64(Float64(y * Float64(t * z)) * -18.0)))); elseif (y <= 1.96e-57) tmp = t_1; else tmp = Float64(Float64(c * b) + Float64(t * Float64(Float64(18.0 * Float64(y * Float64(z * x))) - Float64(4.0 * a)))); 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 * ((t * a) + (x * i)))) - (k * (j * 27.0));
tmp = 0.0;
if (y <= -7.2e+124)
tmp = ((c * b) + (18.0 * (y * (t * (z * x))))) - (27.0 * (j * k));
elseif (y <= -6.4e+59)
tmp = t_1;
elseif (y <= -1.9e-23)
tmp = (k * (j * -27.0)) - (x * ((4.0 * i) + ((y * (t * z)) * -18.0)));
elseif (y <= 1.96e-57)
tmp = t_1;
else
tmp = (c * b) + (t * ((18.0 * (y * (z * x))) - (4.0 * a)));
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[(c * b), $MachinePrecision] - N[(4.0 * N[(N[(t * a), $MachinePrecision] + N[(x * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(k * N[(j * 27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -7.2e+124], N[(N[(N[(c * b), $MachinePrecision] + N[(18.0 * N[(y * N[(t * N[(z * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -6.4e+59], t$95$1, If[LessEqual[y, -1.9e-23], N[(N[(k * N[(j * -27.0), $MachinePrecision]), $MachinePrecision] - N[(x * N[(N[(4.0 * i), $MachinePrecision] + N[(N[(y * N[(t * z), $MachinePrecision]), $MachinePrecision] * -18.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.96e-57], t$95$1, N[(N[(c * b), $MachinePrecision] + N[(t * N[(N[(18.0 * N[(y * N[(z * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(4.0 * a), $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(c \cdot b - 4 \cdot \left(t \cdot a + x \cdot i\right)\right) - k \cdot \left(j \cdot 27\right)\\
\mathbf{if}\;y \leq -7.2 \cdot 10^{+124}:\\
\;\;\;\;\left(c \cdot b + 18 \cdot \left(y \cdot \left(t \cdot \left(z \cdot x\right)\right)\right)\right) - 27 \cdot \left(j \cdot k\right)\\
\mathbf{elif}\;y \leq -6.4 \cdot 10^{+59}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq -1.9 \cdot 10^{-23}:\\
\;\;\;\;k \cdot \left(j \cdot -27\right) - x \cdot \left(4 \cdot i + \left(y \cdot \left(t \cdot z\right)\right) \cdot -18\right)\\
\mathbf{elif}\;y \leq 1.96 \cdot 10^{-57}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;c \cdot b + t \cdot \left(18 \cdot \left(y \cdot \left(z \cdot x\right)\right) - 4 \cdot a\right)\\
\end{array}
\end{array}
if y < -7.19999999999999972e124Initial program 77.3%
sub-neg77.3%
associate-+l-77.3%
sub-neg77.3%
sub-neg77.3%
distribute-rgt-out--80.0%
associate-*l*76.8%
distribute-lft-neg-in76.8%
cancel-sign-sub76.8%
associate-*l*76.8%
associate-*l*76.8%
Simplified76.8%
Taylor expanded in i around 0 89.8%
Taylor expanded in y around inf 89.7%
if -7.19999999999999972e124 < y < -6.39999999999999964e59 or -1.90000000000000006e-23 < y < 1.96000000000000012e-57Initial program 92.5%
Taylor expanded in y around 0 87.5%
distribute-lft-out87.5%
Simplified87.5%
if -6.39999999999999964e59 < y < -1.90000000000000006e-23Initial program 83.6%
sub-neg83.6%
*-commutative83.6%
distribute-rgt-neg-in83.6%
Simplified94.6%
Taylor expanded in x around -inf 67.8%
if 1.96000000000000012e-57 < y Initial program 76.7%
sub-neg76.7%
associate-+l-76.7%
sub-neg76.7%
sub-neg76.7%
distribute-rgt-out--80.4%
associate-*l*69.9%
distribute-lft-neg-in69.9%
cancel-sign-sub69.9%
associate-*l*69.9%
associate-*l*69.9%
Simplified69.9%
Taylor expanded in i around 0 75.9%
Taylor expanded in k around 0 70.1%
Final simplification80.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 (- (* c b) (* 27.0 (* j k))))
(t_2 (+ (* 18.0 (* y (* t (* z x)))) (* -27.0 (* j k))))
(t_3 (+ (* k (* j -27.0)) (* -4.0 (+ (* t a) (* x i))))))
(if (<= y -2.95e+125)
t_2
(if (<= y -4.2e-69)
t_3
(if (<= y -3.9e-128)
t_1
(if (<= y 8e-75) t_3 (if (<= y 5.8e+22) 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 = (c * b) - (27.0 * (j * k));
double t_2 = (18.0 * (y * (t * (z * x)))) + (-27.0 * (j * k));
double t_3 = (k * (j * -27.0)) + (-4.0 * ((t * a) + (x * i)));
double tmp;
if (y <= -2.95e+125) {
tmp = t_2;
} else if (y <= -4.2e-69) {
tmp = t_3;
} else if (y <= -3.9e-128) {
tmp = t_1;
} else if (y <= 8e-75) {
tmp = t_3;
} else if (y <= 5.8e+22) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_1 = (c * b) - (27.0d0 * (j * k))
t_2 = (18.0d0 * (y * (t * (z * x)))) + ((-27.0d0) * (j * k))
t_3 = (k * (j * (-27.0d0))) + ((-4.0d0) * ((t * a) + (x * i)))
if (y <= (-2.95d+125)) then
tmp = t_2
else if (y <= (-4.2d-69)) then
tmp = t_3
else if (y <= (-3.9d-128)) then
tmp = t_1
else if (y <= 8d-75) then
tmp = t_3
else if (y <= 5.8d+22) then
tmp = t_1
else
tmp = t_2
end if
code = tmp
end function
assert y < z;
assert j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = (c * b) - (27.0 * (j * k));
double t_2 = (18.0 * (y * (t * (z * x)))) + (-27.0 * (j * k));
double t_3 = (k * (j * -27.0)) + (-4.0 * ((t * a) + (x * i)));
double tmp;
if (y <= -2.95e+125) {
tmp = t_2;
} else if (y <= -4.2e-69) {
tmp = t_3;
} else if (y <= -3.9e-128) {
tmp = t_1;
} else if (y <= 8e-75) {
tmp = t_3;
} else if (y <= 5.8e+22) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
[y, z] = sort([y, z]) [j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): t_1 = (c * b) - (27.0 * (j * k)) t_2 = (18.0 * (y * (t * (z * x)))) + (-27.0 * (j * k)) t_3 = (k * (j * -27.0)) + (-4.0 * ((t * a) + (x * i))) tmp = 0 if y <= -2.95e+125: tmp = t_2 elif y <= -4.2e-69: tmp = t_3 elif y <= -3.9e-128: tmp = t_1 elif y <= 8e-75: tmp = t_3 elif y <= 5.8e+22: tmp = t_1 else: tmp = t_2 return tmp
y, z = sort([y, z]) j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(Float64(c * b) - Float64(27.0 * Float64(j * k))) t_2 = Float64(Float64(18.0 * Float64(y * Float64(t * Float64(z * x)))) + Float64(-27.0 * Float64(j * k))) t_3 = Float64(Float64(k * Float64(j * -27.0)) + Float64(-4.0 * Float64(Float64(t * a) + Float64(x * i)))) tmp = 0.0 if (y <= -2.95e+125) tmp = t_2; elseif (y <= -4.2e-69) tmp = t_3; elseif (y <= -3.9e-128) tmp = t_1; elseif (y <= 8e-75) tmp = t_3; elseif (y <= 5.8e+22) tmp = t_1; else tmp = t_2; end return tmp end
y, z = num2cell(sort([y, z])){:}
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
t_1 = (c * b) - (27.0 * (j * k));
t_2 = (18.0 * (y * (t * (z * x)))) + (-27.0 * (j * k));
t_3 = (k * (j * -27.0)) + (-4.0 * ((t * a) + (x * i)));
tmp = 0.0;
if (y <= -2.95e+125)
tmp = t_2;
elseif (y <= -4.2e-69)
tmp = t_3;
elseif (y <= -3.9e-128)
tmp = t_1;
elseif (y <= 8e-75)
tmp = t_3;
elseif (y <= 5.8e+22)
tmp = t_1;
else
tmp = t_2;
end
tmp_2 = tmp;
end
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(N[(c * b), $MachinePrecision] - N[(27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(18.0 * N[(y * N[(t * N[(z * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(-27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(k * N[(j * -27.0), $MachinePrecision]), $MachinePrecision] + N[(-4.0 * N[(N[(t * a), $MachinePrecision] + N[(x * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -2.95e+125], t$95$2, If[LessEqual[y, -4.2e-69], t$95$3, If[LessEqual[y, -3.9e-128], t$95$1, If[LessEqual[y, 8e-75], t$95$3, If[LessEqual[y, 5.8e+22], t$95$1, t$95$2]]]]]]]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
t_1 := c \cdot b - 27 \cdot \left(j \cdot k\right)\\
t_2 := 18 \cdot \left(y \cdot \left(t \cdot \left(z \cdot x\right)\right)\right) + -27 \cdot \left(j \cdot k\right)\\
t_3 := k \cdot \left(j \cdot -27\right) + -4 \cdot \left(t \cdot a + x \cdot i\right)\\
\mathbf{if}\;y \leq -2.95 \cdot 10^{+125}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;y \leq -4.2 \cdot 10^{-69}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;y \leq -3.9 \cdot 10^{-128}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 8 \cdot 10^{-75}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;y \leq 5.8 \cdot 10^{+22}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if y < -2.95e125 or 5.8e22 < y Initial program 74.2%
sub-neg74.2%
*-commutative74.2%
distribute-rgt-neg-in74.2%
Simplified68.2%
Taylor expanded in x around -inf 58.1%
Taylor expanded in i around 0 62.1%
if -2.95e125 < y < -4.1999999999999999e-69 or -3.89999999999999997e-128 < y < 7.9999999999999997e-75Initial program 90.3%
sub-neg90.3%
*-commutative90.3%
distribute-rgt-neg-in90.3%
Simplified93.6%
Taylor expanded in x around 0 83.9%
Taylor expanded in b around 0 64.0%
distribute-lft-out64.0%
Simplified64.0%
if -4.1999999999999999e-69 < y < -3.89999999999999997e-128 or 7.9999999999999997e-75 < y < 5.8e22Initial program 92.2%
sub-neg92.2%
associate-+l-92.2%
sub-neg92.2%
sub-neg92.2%
distribute-rgt-out--94.8%
associate-*l*94.8%
distribute-lft-neg-in94.8%
cancel-sign-sub94.8%
associate-*l*94.8%
associate-*l*94.9%
Simplified94.9%
Taylor expanded in i around 0 84.9%
Taylor expanded in t around 0 55.2%
Final simplification62.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 (+ (* k (* j -27.0)) (* -4.0 (+ (* t a) (* x i)))))
(t_2 (- (* c b) (* 27.0 (* j k)))))
(if (<= y -6.2e+125)
(* 18.0 (* y (* t (* z x))))
(if (<= y -1.35e-69)
t_1
(if (<= y -3.1e-128)
t_2
(if (<= y 1.2e-70)
t_1
(if (<= y 3.8e+76) t_2 (* (* x (* t z)) (* y 18.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)) + (-4.0 * ((t * a) + (x * i)));
double t_2 = (c * b) - (27.0 * (j * k));
double tmp;
if (y <= -6.2e+125) {
tmp = 18.0 * (y * (t * (z * x)));
} else if (y <= -1.35e-69) {
tmp = t_1;
} else if (y <= -3.1e-128) {
tmp = t_2;
} else if (y <= 1.2e-70) {
tmp = t_1;
} else if (y <= 3.8e+76) {
tmp = t_2;
} else {
tmp = (x * (t * z)) * (y * 18.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))) + ((-4.0d0) * ((t * a) + (x * i)))
t_2 = (c * b) - (27.0d0 * (j * k))
if (y <= (-6.2d+125)) then
tmp = 18.0d0 * (y * (t * (z * x)))
else if (y <= (-1.35d-69)) then
tmp = t_1
else if (y <= (-3.1d-128)) then
tmp = t_2
else if (y <= 1.2d-70) then
tmp = t_1
else if (y <= 3.8d+76) then
tmp = t_2
else
tmp = (x * (t * z)) * (y * 18.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)) + (-4.0 * ((t * a) + (x * i)));
double t_2 = (c * b) - (27.0 * (j * k));
double tmp;
if (y <= -6.2e+125) {
tmp = 18.0 * (y * (t * (z * x)));
} else if (y <= -1.35e-69) {
tmp = t_1;
} else if (y <= -3.1e-128) {
tmp = t_2;
} else if (y <= 1.2e-70) {
tmp = t_1;
} else if (y <= 3.8e+76) {
tmp = t_2;
} else {
tmp = (x * (t * z)) * (y * 18.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)) + (-4.0 * ((t * a) + (x * i))) t_2 = (c * b) - (27.0 * (j * k)) tmp = 0 if y <= -6.2e+125: tmp = 18.0 * (y * (t * (z * x))) elif y <= -1.35e-69: tmp = t_1 elif y <= -3.1e-128: tmp = t_2 elif y <= 1.2e-70: tmp = t_1 elif y <= 3.8e+76: tmp = t_2 else: tmp = (x * (t * z)) * (y * 18.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(k * Float64(j * -27.0)) + Float64(-4.0 * Float64(Float64(t * a) + Float64(x * i)))) t_2 = Float64(Float64(c * b) - Float64(27.0 * Float64(j * k))) tmp = 0.0 if (y <= -6.2e+125) tmp = Float64(18.0 * Float64(y * Float64(t * Float64(z * x)))); elseif (y <= -1.35e-69) tmp = t_1; elseif (y <= -3.1e-128) tmp = t_2; elseif (y <= 1.2e-70) tmp = t_1; elseif (y <= 3.8e+76) tmp = t_2; else tmp = Float64(Float64(x * Float64(t * z)) * Float64(y * 18.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)) + (-4.0 * ((t * a) + (x * i)));
t_2 = (c * b) - (27.0 * (j * k));
tmp = 0.0;
if (y <= -6.2e+125)
tmp = 18.0 * (y * (t * (z * x)));
elseif (y <= -1.35e-69)
tmp = t_1;
elseif (y <= -3.1e-128)
tmp = t_2;
elseif (y <= 1.2e-70)
tmp = t_1;
elseif (y <= 3.8e+76)
tmp = t_2;
else
tmp = (x * (t * z)) * (y * 18.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[(k * N[(j * -27.0), $MachinePrecision]), $MachinePrecision] + N[(-4.0 * N[(N[(t * a), $MachinePrecision] + N[(x * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(c * b), $MachinePrecision] - N[(27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -6.2e+125], N[(18.0 * N[(y * N[(t * N[(z * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -1.35e-69], t$95$1, If[LessEqual[y, -3.1e-128], t$95$2, If[LessEqual[y, 1.2e-70], t$95$1, If[LessEqual[y, 3.8e+76], t$95$2, N[(N[(x * N[(t * z), $MachinePrecision]), $MachinePrecision] * N[(y * 18.0), $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) + -4 \cdot \left(t \cdot a + x \cdot i\right)\\
t_2 := c \cdot b - 27 \cdot \left(j \cdot k\right)\\
\mathbf{if}\;y \leq -6.2 \cdot 10^{+125}:\\
\;\;\;\;18 \cdot \left(y \cdot \left(t \cdot \left(z \cdot x\right)\right)\right)\\
\mathbf{elif}\;y \leq -1.35 \cdot 10^{-69}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq -3.1 \cdot 10^{-128}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;y \leq 1.2 \cdot 10^{-70}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 3.8 \cdot 10^{+76}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;\left(x \cdot \left(t \cdot z\right)\right) \cdot \left(y \cdot 18\right)\\
\end{array}
\end{array}
if y < -6.2e125Initial program 77.3%
Simplified77.1%
Taylor expanded in y around inf 61.6%
if -6.2e125 < y < -1.3499999999999999e-69 or -3.10000000000000003e-128 < y < 1.2000000000000001e-70Initial program 90.3%
sub-neg90.3%
*-commutative90.3%
distribute-rgt-neg-in90.3%
Simplified93.6%
Taylor expanded in x around 0 83.9%
Taylor expanded in b around 0 64.0%
distribute-lft-out64.0%
Simplified64.0%
if -1.3499999999999999e-69 < y < -3.10000000000000003e-128 or 1.2000000000000001e-70 < y < 3.80000000000000024e76Initial program 89.5%
sub-neg89.5%
associate-+l-89.5%
sub-neg89.5%
sub-neg89.5%
distribute-rgt-out--93.7%
associate-*l*93.7%
distribute-lft-neg-in93.7%
cancel-sign-sub93.7%
associate-*l*93.7%
associate-*l*93.8%
Simplified93.8%
Taylor expanded in i around 0 85.7%
Taylor expanded in t around 0 53.5%
if 3.80000000000000024e76 < y Initial program 71.1%
Simplified69.8%
Taylor expanded in y around inf 53.6%
associate-*r*53.6%
associate-*r*53.5%
Simplified53.5%
Final simplification59.7%
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (* 27.0 (* j k))))
(if (<= i -1.4e+109)
(+ (* k (* j -27.0)) (* -4.0 (+ (* t a) (* x i))))
(if (<= i -7e-16)
(* x (- (* 18.0 (* y (* t z))) (* 4.0 i)))
(if (<= i 4.7e-22)
(- (+ (* c b) (* -4.0 (* t a))) t_1)
(if (<= i 4.8e+93)
(+ (* 18.0 (* y (* x (* t z)))) (* -27.0 (* j k)))
(- (* 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);
double tmp;
if (i <= -1.4e+109) {
tmp = (k * (j * -27.0)) + (-4.0 * ((t * a) + (x * i)));
} else if (i <= -7e-16) {
tmp = x * ((18.0 * (y * (t * z))) - (4.0 * i));
} else if (i <= 4.7e-22) {
tmp = ((c * b) + (-4.0 * (t * a))) - t_1;
} else if (i <= 4.8e+93) {
tmp = (18.0 * (y * (x * (t * z)))) + (-27.0 * (j * k));
} 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)
if (i <= (-1.4d+109)) then
tmp = (k * (j * (-27.0d0))) + ((-4.0d0) * ((t * a) + (x * i)))
else if (i <= (-7d-16)) then
tmp = x * ((18.0d0 * (y * (t * z))) - (4.0d0 * i))
else if (i <= 4.7d-22) then
tmp = ((c * b) + ((-4.0d0) * (t * a))) - t_1
else if (i <= 4.8d+93) then
tmp = (18.0d0 * (y * (x * (t * z)))) + ((-27.0d0) * (j * k))
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);
double tmp;
if (i <= -1.4e+109) {
tmp = (k * (j * -27.0)) + (-4.0 * ((t * a) + (x * i)));
} else if (i <= -7e-16) {
tmp = x * ((18.0 * (y * (t * z))) - (4.0 * i));
} else if (i <= 4.7e-22) {
tmp = ((c * b) + (-4.0 * (t * a))) - t_1;
} else if (i <= 4.8e+93) {
tmp = (18.0 * (y * (x * (t * z)))) + (-27.0 * (j * k));
} 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) tmp = 0 if i <= -1.4e+109: tmp = (k * (j * -27.0)) + (-4.0 * ((t * a) + (x * i))) elif i <= -7e-16: tmp = x * ((18.0 * (y * (t * z))) - (4.0 * i)) elif i <= 4.7e-22: tmp = ((c * b) + (-4.0 * (t * a))) - t_1 elif i <= 4.8e+93: tmp = (18.0 * (y * (x * (t * z)))) + (-27.0 * (j * k)) 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(27.0 * Float64(j * k)) tmp = 0.0 if (i <= -1.4e+109) tmp = Float64(Float64(k * Float64(j * -27.0)) + Float64(-4.0 * Float64(Float64(t * a) + Float64(x * i)))); elseif (i <= -7e-16) tmp = Float64(x * Float64(Float64(18.0 * Float64(y * Float64(t * z))) - Float64(4.0 * i))); elseif (i <= 4.7e-22) tmp = Float64(Float64(Float64(c * b) + Float64(-4.0 * Float64(t * a))) - t_1); elseif (i <= 4.8e+93) tmp = Float64(Float64(18.0 * Float64(y * Float64(x * Float64(t * z)))) + Float64(-27.0 * Float64(j * k))); 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);
tmp = 0.0;
if (i <= -1.4e+109)
tmp = (k * (j * -27.0)) + (-4.0 * ((t * a) + (x * i)));
elseif (i <= -7e-16)
tmp = x * ((18.0 * (y * (t * z))) - (4.0 * i));
elseif (i <= 4.7e-22)
tmp = ((c * b) + (-4.0 * (t * a))) - t_1;
elseif (i <= 4.8e+93)
tmp = (18.0 * (y * (x * (t * z)))) + (-27.0 * (j * k));
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[(27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[i, -1.4e+109], N[(N[(k * N[(j * -27.0), $MachinePrecision]), $MachinePrecision] + N[(-4.0 * N[(N[(t * a), $MachinePrecision] + N[(x * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[i, -7e-16], N[(x * N[(N[(18.0 * N[(y * N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(4.0 * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[i, 4.7e-22], N[(N[(N[(c * b), $MachinePrecision] + N[(-4.0 * N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], If[LessEqual[i, 4.8e+93], N[(N[(18.0 * N[(y * N[(x * N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(-27.0 * N[(j * k), $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)\\
\mathbf{if}\;i \leq -1.4 \cdot 10^{+109}:\\
\;\;\;\;k \cdot \left(j \cdot -27\right) + -4 \cdot \left(t \cdot a + x \cdot i\right)\\
\mathbf{elif}\;i \leq -7 \cdot 10^{-16}:\\
\;\;\;\;x \cdot \left(18 \cdot \left(y \cdot \left(t \cdot z\right)\right) - 4 \cdot i\right)\\
\mathbf{elif}\;i \leq 4.7 \cdot 10^{-22}:\\
\;\;\;\;\left(c \cdot b + -4 \cdot \left(t \cdot a\right)\right) - t_1\\
\mathbf{elif}\;i \leq 4.8 \cdot 10^{+93}:\\
\;\;\;\;18 \cdot \left(y \cdot \left(x \cdot \left(t \cdot z\right)\right)\right) + -27 \cdot \left(j \cdot k\right)\\
\mathbf{else}:\\
\;\;\;\;c \cdot b - \left(t_1 + 4 \cdot \left(x \cdot i\right)\right)\\
\end{array}
\end{array}
if i < -1.4000000000000001e109Initial program 86.0%
sub-neg86.0%
*-commutative86.0%
distribute-rgt-neg-in86.0%
Simplified81.1%
Taylor expanded in x around 0 76.0%
Taylor expanded in b around 0 65.9%
distribute-lft-out65.9%
Simplified65.9%
if -1.4000000000000001e109 < i < -7.00000000000000035e-16Initial program 77.2%
sub-neg77.2%
associate-+l-77.2%
sub-neg77.2%
sub-neg77.2%
distribute-rgt-out--81.2%
associate-*l*80.9%
distribute-lft-neg-in80.9%
cancel-sign-sub80.9%
associate-*l*80.9%
associate-*l*80.9%
Simplified80.9%
Taylor expanded in x around inf 65.2%
if -7.00000000000000035e-16 < i < 4.7000000000000003e-22Initial program 89.1%
sub-neg89.1%
associate-+l-89.1%
sub-neg89.1%
sub-neg89.1%
distribute-rgt-out--90.7%
associate-*l*88.3%
distribute-lft-neg-in88.3%
cancel-sign-sub88.3%
associate-*l*88.3%
associate-*l*88.3%
Simplified88.3%
Taylor expanded in x around 0 72.8%
if 4.7000000000000003e-22 < i < 4.80000000000000021e93Initial program 68.4%
sub-neg68.4%
*-commutative68.4%
distribute-rgt-neg-in68.4%
Simplified64.8%
Taylor expanded in x around -inf 61.4%
Taylor expanded in i around 0 57.2%
expm1-log1p-u40.1%
expm1-udef37.4%
*-commutative37.4%
Applied egg-rr37.4%
expm1-def40.1%
expm1-log1p57.2%
*-commutative57.2%
associate-*r*57.2%
Simplified57.2%
if 4.80000000000000021e93 < i Initial program 84.3%
sub-neg84.3%
associate-+l-84.3%
sub-neg84.3%
sub-neg84.3%
distribute-rgt-out--88.8%
associate-*l*86.6%
distribute-lft-neg-in86.6%
cancel-sign-sub86.6%
associate-*l*86.6%
associate-*l*88.8%
Simplified88.8%
Taylor expanded in t around 0 77.8%
Final simplification70.4%
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(if (<= y -9.5e+124)
(- (+ (* c b) (* 18.0 (* y (* t (* z x))))) (* 27.0 (* j k)))
(if (<= y 5.8e-60)
(- (- (* c b) (* 4.0 (+ (* t a) (* x i)))) (* k (* j 27.0)))
(+ (* c b) (* t (- (* 18.0 (* y (* z x))) (* 4.0 a)))))))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 <= -9.5e+124) {
tmp = ((c * b) + (18.0 * (y * (t * (z * x))))) - (27.0 * (j * k));
} else if (y <= 5.8e-60) {
tmp = ((c * b) - (4.0 * ((t * a) + (x * i)))) - (k * (j * 27.0));
} else {
tmp = (c * b) + (t * ((18.0 * (y * (z * x))) - (4.0 * a)));
}
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 <= (-9.5d+124)) then
tmp = ((c * b) + (18.0d0 * (y * (t * (z * x))))) - (27.0d0 * (j * k))
else if (y <= 5.8d-60) then
tmp = ((c * b) - (4.0d0 * ((t * a) + (x * i)))) - (k * (j * 27.0d0))
else
tmp = (c * b) + (t * ((18.0d0 * (y * (z * x))) - (4.0d0 * a)))
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 <= -9.5e+124) {
tmp = ((c * b) + (18.0 * (y * (t * (z * x))))) - (27.0 * (j * k));
} else if (y <= 5.8e-60) {
tmp = ((c * b) - (4.0 * ((t * a) + (x * i)))) - (k * (j * 27.0));
} else {
tmp = (c * b) + (t * ((18.0 * (y * (z * x))) - (4.0 * a)));
}
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 <= -9.5e+124: tmp = ((c * b) + (18.0 * (y * (t * (z * x))))) - (27.0 * (j * k)) elif y <= 5.8e-60: tmp = ((c * b) - (4.0 * ((t * a) + (x * i)))) - (k * (j * 27.0)) else: tmp = (c * b) + (t * ((18.0 * (y * (z * x))) - (4.0 * a))) 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 <= -9.5e+124) tmp = Float64(Float64(Float64(c * b) + Float64(18.0 * Float64(y * Float64(t * Float64(z * x))))) - Float64(27.0 * Float64(j * k))); elseif (y <= 5.8e-60) tmp = Float64(Float64(Float64(c * b) - Float64(4.0 * Float64(Float64(t * a) + Float64(x * i)))) - Float64(k * Float64(j * 27.0))); else tmp = Float64(Float64(c * b) + Float64(t * Float64(Float64(18.0 * Float64(y * Float64(z * x))) - Float64(4.0 * a)))); 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 <= -9.5e+124)
tmp = ((c * b) + (18.0 * (y * (t * (z * x))))) - (27.0 * (j * k));
elseif (y <= 5.8e-60)
tmp = ((c * b) - (4.0 * ((t * a) + (x * i)))) - (k * (j * 27.0));
else
tmp = (c * b) + (t * ((18.0 * (y * (z * x))) - (4.0 * a)));
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, -9.5e+124], N[(N[(N[(c * b), $MachinePrecision] + N[(18.0 * N[(y * N[(t * N[(z * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 5.8e-60], N[(N[(N[(c * b), $MachinePrecision] - N[(4.0 * N[(N[(t * a), $MachinePrecision] + N[(x * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(k * N[(j * 27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(c * b), $MachinePrecision] + N[(t * N[(N[(18.0 * N[(y * N[(z * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(4.0 * a), $MachinePrecision]), $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 -9.5 \cdot 10^{+124}:\\
\;\;\;\;\left(c \cdot b + 18 \cdot \left(y \cdot \left(t \cdot \left(z \cdot x\right)\right)\right)\right) - 27 \cdot \left(j \cdot k\right)\\
\mathbf{elif}\;y \leq 5.8 \cdot 10^{-60}:\\
\;\;\;\;\left(c \cdot b - 4 \cdot \left(t \cdot a + x \cdot i\right)\right) - k \cdot \left(j \cdot 27\right)\\
\mathbf{else}:\\
\;\;\;\;c \cdot b + t \cdot \left(18 \cdot \left(y \cdot \left(z \cdot x\right)\right) - 4 \cdot a\right)\\
\end{array}
\end{array}
if y < -9.50000000000000004e124Initial program 77.3%
sub-neg77.3%
associate-+l-77.3%
sub-neg77.3%
sub-neg77.3%
distribute-rgt-out--80.0%
associate-*l*76.8%
distribute-lft-neg-in76.8%
cancel-sign-sub76.8%
associate-*l*76.8%
associate-*l*76.8%
Simplified76.8%
Taylor expanded in i around 0 89.8%
Taylor expanded in y around inf 89.7%
if -9.50000000000000004e124 < y < 5.7999999999999999e-60Initial program 91.4%
Taylor expanded in y around 0 84.3%
distribute-lft-out84.3%
Simplified84.3%
if 5.7999999999999999e-60 < y Initial program 76.7%
sub-neg76.7%
associate-+l-76.7%
sub-neg76.7%
sub-neg76.7%
distribute-rgt-out--80.4%
associate-*l*69.9%
distribute-lft-neg-in69.9%
cancel-sign-sub69.9%
associate-*l*69.9%
associate-*l*69.9%
Simplified69.9%
Taylor expanded in i around 0 75.9%
Taylor expanded in k around 0 70.1%
Final simplification80.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 (* t z))) (* 4.0 i))))
(t_2 (- (* c b) (* 27.0 (* j k)))))
(if (<= b -1.2e+96)
t_2
(if (<= b -1.25e-128)
t_1
(if (<= b -2.6e-206)
(+ (* -27.0 (* j k)) (* -4.0 (* x i)))
(if (<= b 2.3e-105) 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 = x * ((18.0 * (y * (t * z))) - (4.0 * i));
double t_2 = (c * b) - (27.0 * (j * k));
double tmp;
if (b <= -1.2e+96) {
tmp = t_2;
} else if (b <= -1.25e-128) {
tmp = t_1;
} else if (b <= -2.6e-206) {
tmp = (-27.0 * (j * k)) + (-4.0 * (x * i));
} else if (b <= 2.3e-105) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = x * ((18.0d0 * (y * (t * z))) - (4.0d0 * i))
t_2 = (c * b) - (27.0d0 * (j * k))
if (b <= (-1.2d+96)) then
tmp = t_2
else if (b <= (-1.25d-128)) then
tmp = t_1
else if (b <= (-2.6d-206)) then
tmp = ((-27.0d0) * (j * k)) + ((-4.0d0) * (x * i))
else if (b <= 2.3d-105) then
tmp = t_1
else
tmp = t_2
end if
code = tmp
end function
assert y < z;
assert j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = x * ((18.0 * (y * (t * z))) - (4.0 * i));
double t_2 = (c * b) - (27.0 * (j * k));
double tmp;
if (b <= -1.2e+96) {
tmp = t_2;
} else if (b <= -1.25e-128) {
tmp = t_1;
} else if (b <= -2.6e-206) {
tmp = (-27.0 * (j * k)) + (-4.0 * (x * i));
} else if (b <= 2.3e-105) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
[y, z] = sort([y, z]) [j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): t_1 = x * ((18.0 * (y * (t * z))) - (4.0 * i)) t_2 = (c * b) - (27.0 * (j * k)) tmp = 0 if b <= -1.2e+96: tmp = t_2 elif b <= -1.25e-128: tmp = t_1 elif b <= -2.6e-206: tmp = (-27.0 * (j * k)) + (-4.0 * (x * i)) elif b <= 2.3e-105: tmp = t_1 else: tmp = t_2 return tmp
y, z = sort([y, z]) j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(x * Float64(Float64(18.0 * Float64(y * Float64(t * z))) - Float64(4.0 * i))) t_2 = Float64(Float64(c * b) - Float64(27.0 * Float64(j * k))) tmp = 0.0 if (b <= -1.2e+96) tmp = t_2; elseif (b <= -1.25e-128) tmp = t_1; elseif (b <= -2.6e-206) tmp = Float64(Float64(-27.0 * Float64(j * k)) + Float64(-4.0 * Float64(x * i))); elseif (b <= 2.3e-105) tmp = t_1; else tmp = t_2; end return tmp end
y, z = num2cell(sort([y, z])){:}
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
t_1 = x * ((18.0 * (y * (t * z))) - (4.0 * i));
t_2 = (c * b) - (27.0 * (j * k));
tmp = 0.0;
if (b <= -1.2e+96)
tmp = t_2;
elseif (b <= -1.25e-128)
tmp = t_1;
elseif (b <= -2.6e-206)
tmp = (-27.0 * (j * k)) + (-4.0 * (x * i));
elseif (b <= 2.3e-105)
tmp = t_1;
else
tmp = t_2;
end
tmp_2 = tmp;
end
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(x * N[(N[(18.0 * N[(y * N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(4.0 * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(c * b), $MachinePrecision] - N[(27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -1.2e+96], t$95$2, If[LessEqual[b, -1.25e-128], t$95$1, If[LessEqual[b, -2.6e-206], N[(N[(-27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision] + N[(-4.0 * N[(x * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 2.3e-105], t$95$1, t$95$2]]]]]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
t_1 := x \cdot \left(18 \cdot \left(y \cdot \left(t \cdot z\right)\right) - 4 \cdot i\right)\\
t_2 := c \cdot b - 27 \cdot \left(j \cdot k\right)\\
\mathbf{if}\;b \leq -1.2 \cdot 10^{+96}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;b \leq -1.25 \cdot 10^{-128}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;b \leq -2.6 \cdot 10^{-206}:\\
\;\;\;\;-27 \cdot \left(j \cdot k\right) + -4 \cdot \left(x \cdot i\right)\\
\mathbf{elif}\;b \leq 2.3 \cdot 10^{-105}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if b < -1.19999999999999996e96 or 2.3000000000000001e-105 < b Initial program 83.4%
sub-neg83.4%
associate-+l-83.4%
sub-neg83.4%
sub-neg83.4%
distribute-rgt-out--87.1%
associate-*l*82.6%
distribute-lft-neg-in82.6%
cancel-sign-sub82.6%
associate-*l*82.6%
associate-*l*83.3%
Simplified83.3%
Taylor expanded in i around 0 81.9%
Taylor expanded in t around 0 54.3%
if -1.19999999999999996e96 < b < -1.25e-128 or -2.6e-206 < b < 2.3000000000000001e-105Initial program 88.2%
sub-neg88.2%
associate-+l-88.2%
sub-neg88.2%
sub-neg88.2%
distribute-rgt-out--89.2%
associate-*l*84.7%
distribute-lft-neg-in84.7%
cancel-sign-sub84.7%
associate-*l*84.7%
associate-*l*84.7%
Simplified84.7%
Taylor expanded in x around inf 52.1%
if -1.25e-128 < b < -2.6e-206Initial program 75.0%
sub-neg75.0%
*-commutative75.0%
distribute-rgt-neg-in75.0%
Simplified84.7%
Taylor expanded in x around -inf 66.1%
Taylor expanded in y around 0 61.3%
Final simplification54.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) (* 27.0 (* j k)))))
(if (<= b -2.1e+94)
t_1
(if (<= b -1.2e-128)
(* x (- (* 18.0 (* z (* y t))) (* 4.0 i)))
(if (<= b -3.1e-207)
(+ (* -27.0 (* j k)) (* -4.0 (* x i)))
(if (<= b 1.45e-114)
(* x (- (* 18.0 (* y (* t z))) (* 4.0 i)))
t_1))))))assert(y < z);
assert(j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = (c * b) - (27.0 * (j * k));
double tmp;
if (b <= -2.1e+94) {
tmp = t_1;
} else if (b <= -1.2e-128) {
tmp = x * ((18.0 * (z * (y * t))) - (4.0 * i));
} else if (b <= -3.1e-207) {
tmp = (-27.0 * (j * k)) + (-4.0 * (x * i));
} else if (b <= 1.45e-114) {
tmp = x * ((18.0 * (y * (t * z))) - (4.0 * i));
} else {
tmp = t_1;
}
return tmp;
}
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: tmp
t_1 = (c * b) - (27.0d0 * (j * k))
if (b <= (-2.1d+94)) then
tmp = t_1
else if (b <= (-1.2d-128)) then
tmp = x * ((18.0d0 * (z * (y * t))) - (4.0d0 * i))
else if (b <= (-3.1d-207)) then
tmp = ((-27.0d0) * (j * k)) + ((-4.0d0) * (x * i))
else if (b <= 1.45d-114) then
tmp = x * ((18.0d0 * (y * (t * z))) - (4.0d0 * i))
else
tmp = t_1
end if
code = tmp
end function
assert y < z;
assert j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = (c * b) - (27.0 * (j * k));
double tmp;
if (b <= -2.1e+94) {
tmp = t_1;
} else if (b <= -1.2e-128) {
tmp = x * ((18.0 * (z * (y * t))) - (4.0 * i));
} else if (b <= -3.1e-207) {
tmp = (-27.0 * (j * k)) + (-4.0 * (x * i));
} else if (b <= 1.45e-114) {
tmp = x * ((18.0 * (y * (t * z))) - (4.0 * i));
} else {
tmp = t_1;
}
return tmp;
}
[y, z] = sort([y, z]) [j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): t_1 = (c * b) - (27.0 * (j * k)) tmp = 0 if b <= -2.1e+94: tmp = t_1 elif b <= -1.2e-128: tmp = x * ((18.0 * (z * (y * t))) - (4.0 * i)) elif b <= -3.1e-207: tmp = (-27.0 * (j * k)) + (-4.0 * (x * i)) elif b <= 1.45e-114: tmp = x * ((18.0 * (y * (t * z))) - (4.0 * i)) else: tmp = t_1 return tmp
y, z = sort([y, z]) j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(Float64(c * b) - Float64(27.0 * Float64(j * k))) tmp = 0.0 if (b <= -2.1e+94) tmp = t_1; elseif (b <= -1.2e-128) tmp = Float64(x * Float64(Float64(18.0 * Float64(z * Float64(y * t))) - Float64(4.0 * i))); elseif (b <= -3.1e-207) tmp = Float64(Float64(-27.0 * Float64(j * k)) + Float64(-4.0 * Float64(x * i))); elseif (b <= 1.45e-114) tmp = Float64(x * Float64(Float64(18.0 * Float64(y * Float64(t * z))) - Float64(4.0 * i))); else tmp = t_1; end return tmp end
y, z = num2cell(sort([y, z])){:}
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
t_1 = (c * b) - (27.0 * (j * k));
tmp = 0.0;
if (b <= -2.1e+94)
tmp = t_1;
elseif (b <= -1.2e-128)
tmp = x * ((18.0 * (z * (y * t))) - (4.0 * i));
elseif (b <= -3.1e-207)
tmp = (-27.0 * (j * k)) + (-4.0 * (x * i));
elseif (b <= 1.45e-114)
tmp = x * ((18.0 * (y * (t * z))) - (4.0 * i));
else
tmp = t_1;
end
tmp_2 = tmp;
end
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(N[(c * b), $MachinePrecision] - N[(27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -2.1e+94], t$95$1, If[LessEqual[b, -1.2e-128], N[(x * N[(N[(18.0 * N[(z * N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(4.0 * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, -3.1e-207], N[(N[(-27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision] + N[(-4.0 * N[(x * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 1.45e-114], N[(x * N[(N[(18.0 * N[(y * N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(4.0 * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
t_1 := c \cdot b - 27 \cdot \left(j \cdot k\right)\\
\mathbf{if}\;b \leq -2.1 \cdot 10^{+94}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;b \leq -1.2 \cdot 10^{-128}:\\
\;\;\;\;x \cdot \left(18 \cdot \left(z \cdot \left(y \cdot t\right)\right) - 4 \cdot i\right)\\
\mathbf{elif}\;b \leq -3.1 \cdot 10^{-207}:\\
\;\;\;\;-27 \cdot \left(j \cdot k\right) + -4 \cdot \left(x \cdot i\right)\\
\mathbf{elif}\;b \leq 1.45 \cdot 10^{-114}:\\
\;\;\;\;x \cdot \left(18 \cdot \left(y \cdot \left(t \cdot z\right)\right) - 4 \cdot i\right)\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if b < -2.09999999999999989e94 or 1.44999999999999998e-114 < b Initial program 83.6%
sub-neg83.6%
associate-+l-83.6%
sub-neg83.6%
sub-neg83.6%
distribute-rgt-out--87.3%
associate-*l*82.8%
distribute-lft-neg-in82.8%
cancel-sign-sub82.8%
associate-*l*82.8%
associate-*l*83.5%
Simplified83.5%
Taylor expanded in i around 0 82.1%
Taylor expanded in t around 0 54.2%
if -2.09999999999999989e94 < b < -1.1999999999999999e-128Initial program 85.0%
sub-neg85.0%
associate-+l-85.0%
sub-neg85.0%
sub-neg85.0%
distribute-rgt-out--87.5%
associate-*l*82.7%
distribute-lft-neg-in82.7%
cancel-sign-sub82.7%
associate-*l*82.7%
associate-*l*82.7%
Simplified82.7%
Taylor expanded in x around inf 43.5%
pow143.5%
*-commutative43.5%
Applied egg-rr43.5%
unpow143.5%
*-commutative43.5%
associate-*l*43.6%
Simplified43.6%
if -1.1999999999999999e-128 < b < -3.1000000000000001e-207Initial program 75.0%
sub-neg75.0%
*-commutative75.0%
distribute-rgt-neg-in75.0%
Simplified84.7%
Taylor expanded in x around -inf 66.1%
Taylor expanded in y around 0 61.3%
if -3.1000000000000001e-207 < b < 1.44999999999999998e-114Initial program 90.0%
sub-neg90.0%
associate-+l-90.0%
sub-neg90.0%
sub-neg90.0%
distribute-rgt-out--90.0%
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 x around inf 57.8%
Final simplification54.0%
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (* 18.0 (* y (* t (* z x))))))
(if (<= z -7.5e-74)
t_1
(if (<= z -2.35e-124)
(* -4.0 (* t a))
(if (<= z -5.6e-157)
(* (* x (* t z)) (* y 18.0))
(if (<= z 1e+221) (- (* c b) (* 27.0 (* j k))) t_1))))))assert(y < z);
assert(j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = 18.0 * (y * (t * (z * x)));
double tmp;
if (z <= -7.5e-74) {
tmp = t_1;
} else if (z <= -2.35e-124) {
tmp = -4.0 * (t * a);
} else if (z <= -5.6e-157) {
tmp = (x * (t * z)) * (y * 18.0);
} else if (z <= 1e+221) {
tmp = (c * b) - (27.0 * (j * k));
} else {
tmp = t_1;
}
return tmp;
}
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: tmp
t_1 = 18.0d0 * (y * (t * (z * x)))
if (z <= (-7.5d-74)) then
tmp = t_1
else if (z <= (-2.35d-124)) then
tmp = (-4.0d0) * (t * a)
else if (z <= (-5.6d-157)) then
tmp = (x * (t * z)) * (y * 18.0d0)
else if (z <= 1d+221) then
tmp = (c * b) - (27.0d0 * (j * k))
else
tmp = t_1
end if
code = tmp
end function
assert y < z;
assert j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = 18.0 * (y * (t * (z * x)));
double tmp;
if (z <= -7.5e-74) {
tmp = t_1;
} else if (z <= -2.35e-124) {
tmp = -4.0 * (t * a);
} else if (z <= -5.6e-157) {
tmp = (x * (t * z)) * (y * 18.0);
} else if (z <= 1e+221) {
tmp = (c * b) - (27.0 * (j * k));
} else {
tmp = t_1;
}
return tmp;
}
[y, z] = sort([y, z]) [j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): t_1 = 18.0 * (y * (t * (z * x))) tmp = 0 if z <= -7.5e-74: tmp = t_1 elif z <= -2.35e-124: tmp = -4.0 * (t * a) elif z <= -5.6e-157: tmp = (x * (t * z)) * (y * 18.0) elif z <= 1e+221: tmp = (c * b) - (27.0 * (j * k)) else: tmp = t_1 return tmp
y, z = sort([y, z]) j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(18.0 * Float64(y * Float64(t * Float64(z * x)))) tmp = 0.0 if (z <= -7.5e-74) tmp = t_1; elseif (z <= -2.35e-124) tmp = Float64(-4.0 * Float64(t * a)); elseif (z <= -5.6e-157) tmp = Float64(Float64(x * Float64(t * z)) * Float64(y * 18.0)); elseif (z <= 1e+221) tmp = Float64(Float64(c * b) - Float64(27.0 * Float64(j * k))); else tmp = t_1; end return tmp end
y, z = num2cell(sort([y, z])){:}
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
t_1 = 18.0 * (y * (t * (z * x)));
tmp = 0.0;
if (z <= -7.5e-74)
tmp = t_1;
elseif (z <= -2.35e-124)
tmp = -4.0 * (t * a);
elseif (z <= -5.6e-157)
tmp = (x * (t * z)) * (y * 18.0);
elseif (z <= 1e+221)
tmp = (c * b) - (27.0 * (j * k));
else
tmp = t_1;
end
tmp_2 = tmp;
end
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(18.0 * N[(y * N[(t * N[(z * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -7.5e-74], t$95$1, If[LessEqual[z, -2.35e-124], N[(-4.0 * N[(t * a), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -5.6e-157], N[(N[(x * N[(t * z), $MachinePrecision]), $MachinePrecision] * N[(y * 18.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1e+221], N[(N[(c * b), $MachinePrecision] - N[(27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
t_1 := 18 \cdot \left(y \cdot \left(t \cdot \left(z \cdot x\right)\right)\right)\\
\mathbf{if}\;z \leq -7.5 \cdot 10^{-74}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -2.35 \cdot 10^{-124}:\\
\;\;\;\;-4 \cdot \left(t \cdot a\right)\\
\mathbf{elif}\;z \leq -5.6 \cdot 10^{-157}:\\
\;\;\;\;\left(x \cdot \left(t \cdot z\right)\right) \cdot \left(y \cdot 18\right)\\
\mathbf{elif}\;z \leq 10^{+221}:\\
\;\;\;\;c \cdot b - 27 \cdot \left(j \cdot k\right)\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if z < -7.5e-74 or 1e221 < z Initial program 82.3%
Simplified81.3%
Taylor expanded in y around inf 54.2%
if -7.5e-74 < z < -2.35000000000000002e-124Initial program 80.0%
Simplified100.0%
Taylor expanded in a around inf 34.0%
if -2.35000000000000002e-124 < z < -5.6000000000000002e-157Initial program 89.5%
Simplified99.8%
Taylor expanded in y around inf 9.5%
associate-*r*9.5%
associate-*r*9.6%
Simplified9.6%
if -5.6000000000000002e-157 < z < 1e221Initial program 86.4%
sub-neg86.4%
associate-+l-86.4%
sub-neg86.4%
sub-neg86.4%
distribute-rgt-out--87.2%
associate-*l*85.7%
distribute-lft-neg-in85.7%
cancel-sign-sub85.7%
associate-*l*85.7%
associate-*l*85.8%
Simplified85.8%
Taylor expanded in i around 0 75.6%
Taylor expanded in t around 0 44.3%
Final simplification46.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 (* 18.0 (* y (* t (* z x))))))
(if (<= z -3e-72)
t_1
(if (<= z -5.2e-124)
(* -4.0 (* t a))
(if (<= z -8.2e-153)
(+ (* -27.0 (* j k)) (* -4.0 (* x i)))
(if (<= z 2.3e+223) (- (* c b) (* 27.0 (* j k))) t_1))))))assert(y < z);
assert(j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = 18.0 * (y * (t * (z * x)));
double tmp;
if (z <= -3e-72) {
tmp = t_1;
} else if (z <= -5.2e-124) {
tmp = -4.0 * (t * a);
} else if (z <= -8.2e-153) {
tmp = (-27.0 * (j * k)) + (-4.0 * (x * i));
} else if (z <= 2.3e+223) {
tmp = (c * b) - (27.0 * (j * k));
} else {
tmp = t_1;
}
return tmp;
}
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: tmp
t_1 = 18.0d0 * (y * (t * (z * x)))
if (z <= (-3d-72)) then
tmp = t_1
else if (z <= (-5.2d-124)) then
tmp = (-4.0d0) * (t * a)
else if (z <= (-8.2d-153)) then
tmp = ((-27.0d0) * (j * k)) + ((-4.0d0) * (x * i))
else if (z <= 2.3d+223) then
tmp = (c * b) - (27.0d0 * (j * k))
else
tmp = t_1
end if
code = tmp
end function
assert y < z;
assert j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = 18.0 * (y * (t * (z * x)));
double tmp;
if (z <= -3e-72) {
tmp = t_1;
} else if (z <= -5.2e-124) {
tmp = -4.0 * (t * a);
} else if (z <= -8.2e-153) {
tmp = (-27.0 * (j * k)) + (-4.0 * (x * i));
} else if (z <= 2.3e+223) {
tmp = (c * b) - (27.0 * (j * k));
} else {
tmp = t_1;
}
return tmp;
}
[y, z] = sort([y, z]) [j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): t_1 = 18.0 * (y * (t * (z * x))) tmp = 0 if z <= -3e-72: tmp = t_1 elif z <= -5.2e-124: tmp = -4.0 * (t * a) elif z <= -8.2e-153: tmp = (-27.0 * (j * k)) + (-4.0 * (x * i)) elif z <= 2.3e+223: tmp = (c * b) - (27.0 * (j * k)) else: tmp = t_1 return tmp
y, z = sort([y, z]) j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(18.0 * Float64(y * Float64(t * Float64(z * x)))) tmp = 0.0 if (z <= -3e-72) tmp = t_1; elseif (z <= -5.2e-124) tmp = Float64(-4.0 * Float64(t * a)); elseif (z <= -8.2e-153) tmp = Float64(Float64(-27.0 * Float64(j * k)) + Float64(-4.0 * Float64(x * i))); elseif (z <= 2.3e+223) tmp = Float64(Float64(c * b) - Float64(27.0 * Float64(j * k))); else tmp = t_1; end return tmp end
y, z = num2cell(sort([y, z])){:}
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
t_1 = 18.0 * (y * (t * (z * x)));
tmp = 0.0;
if (z <= -3e-72)
tmp = t_1;
elseif (z <= -5.2e-124)
tmp = -4.0 * (t * a);
elseif (z <= -8.2e-153)
tmp = (-27.0 * (j * k)) + (-4.0 * (x * i));
elseif (z <= 2.3e+223)
tmp = (c * b) - (27.0 * (j * k));
else
tmp = t_1;
end
tmp_2 = tmp;
end
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(18.0 * N[(y * N[(t * N[(z * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -3e-72], t$95$1, If[LessEqual[z, -5.2e-124], N[(-4.0 * N[(t * a), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -8.2e-153], N[(N[(-27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision] + N[(-4.0 * N[(x * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.3e+223], N[(N[(c * b), $MachinePrecision] - N[(27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
t_1 := 18 \cdot \left(y \cdot \left(t \cdot \left(z \cdot x\right)\right)\right)\\
\mathbf{if}\;z \leq -3 \cdot 10^{-72}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -5.2 \cdot 10^{-124}:\\
\;\;\;\;-4 \cdot \left(t \cdot a\right)\\
\mathbf{elif}\;z \leq -8.2 \cdot 10^{-153}:\\
\;\;\;\;-27 \cdot \left(j \cdot k\right) + -4 \cdot \left(x \cdot i\right)\\
\mathbf{elif}\;z \leq 2.3 \cdot 10^{+223}:\\
\;\;\;\;c \cdot b - 27 \cdot \left(j \cdot k\right)\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if z < -3e-72 or 2.30000000000000004e223 < z Initial program 82.3%
Simplified81.3%
Taylor expanded in y around inf 54.2%
if -3e-72 < z < -5.1999999999999999e-124Initial program 80.0%
Simplified100.0%
Taylor expanded in a around inf 34.0%
if -5.1999999999999999e-124 < z < -8.2e-153Initial program 88.5%
sub-neg88.5%
*-commutative88.5%
distribute-rgt-neg-in88.5%
Simplified99.8%
Taylor expanded in x around -inf 53.1%
Taylor expanded in y around 0 53.0%
if -8.2e-153 < z < 2.30000000000000004e223Initial program 86.5%
sub-neg86.5%
associate-+l-86.5%
sub-neg86.5%
sub-neg86.5%
distribute-rgt-out--87.3%
associate-*l*85.8%
distribute-lft-neg-in85.8%
cancel-sign-sub85.8%
associate-*l*85.8%
associate-*l*85.9%
Simplified85.9%
Taylor expanded in i around 0 75.8%
Taylor expanded in t around 0 44.1%
Final simplification48.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 (<= c -3.05e+16) (* c b) (if (<= c 2.2e+157) (* 18.0 (* y (* t (* z x)))) (* 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 <= -3.05e+16) {
tmp = c * b;
} else if (c <= 2.2e+157) {
tmp = 18.0 * (y * (t * (z * x)));
} 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 <= (-3.05d+16)) then
tmp = c * b
else if (c <= 2.2d+157) then
tmp = 18.0d0 * (y * (t * (z * x)))
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 <= -3.05e+16) {
tmp = c * b;
} else if (c <= 2.2e+157) {
tmp = 18.0 * (y * (t * (z * x)));
} 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 <= -3.05e+16: tmp = c * b elif c <= 2.2e+157: tmp = 18.0 * (y * (t * (z * x))) 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 <= -3.05e+16) tmp = Float64(c * b); elseif (c <= 2.2e+157) tmp = Float64(18.0 * Float64(y * Float64(t * Float64(z * x)))); 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 <= -3.05e+16)
tmp = c * b;
elseif (c <= 2.2e+157)
tmp = 18.0 * (y * (t * (z * x)));
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, -3.05e+16], N[(c * b), $MachinePrecision], If[LessEqual[c, 2.2e+157], N[(18.0 * N[(y * N[(t * N[(z * x), $MachinePrecision]), $MachinePrecision]), $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 -3.05 \cdot 10^{+16}:\\
\;\;\;\;c \cdot b\\
\mathbf{elif}\;c \leq 2.2 \cdot 10^{+157}:\\
\;\;\;\;18 \cdot \left(y \cdot \left(t \cdot \left(z \cdot x\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;c \cdot b\\
\end{array}
\end{array}
if c < -3.05e16 or 2.2000000000000001e157 < c Initial program 85.1%
Simplified87.5%
Taylor expanded in b around inf 50.3%
if -3.05e16 < c < 2.2000000000000001e157Initial program 84.4%
Simplified86.8%
Taylor expanded in y around inf 38.7%
Final simplification43.0%
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(if (<= c -9.2e-61)
(* c b)
(if (<= c 2.25e-151)
(* i (* x -4.0))
(if (<= c 3.6e+120) (* -4.0 (* t 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 <= -9.2e-61) {
tmp = c * b;
} else if (c <= 2.25e-151) {
tmp = i * (x * -4.0);
} else if (c <= 3.6e+120) {
tmp = -4.0 * (t * 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 <= (-9.2d-61)) then
tmp = c * b
else if (c <= 2.25d-151) then
tmp = i * (x * (-4.0d0))
else if (c <= 3.6d+120) then
tmp = (-4.0d0) * (t * 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 <= -9.2e-61) {
tmp = c * b;
} else if (c <= 2.25e-151) {
tmp = i * (x * -4.0);
} else if (c <= 3.6e+120) {
tmp = -4.0 * (t * 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 <= -9.2e-61: tmp = c * b elif c <= 2.25e-151: tmp = i * (x * -4.0) elif c <= 3.6e+120: tmp = -4.0 * (t * 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 <= -9.2e-61) tmp = Float64(c * b); elseif (c <= 2.25e-151) tmp = Float64(i * Float64(x * -4.0)); elseif (c <= 3.6e+120) tmp = Float64(-4.0 * Float64(t * 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 <= -9.2e-61)
tmp = c * b;
elseif (c <= 2.25e-151)
tmp = i * (x * -4.0);
elseif (c <= 3.6e+120)
tmp = -4.0 * (t * 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, -9.2e-61], N[(c * b), $MachinePrecision], If[LessEqual[c, 2.25e-151], N[(i * N[(x * -4.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, 3.6e+120], N[(-4.0 * N[(t * 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 -9.2 \cdot 10^{-61}:\\
\;\;\;\;c \cdot b\\
\mathbf{elif}\;c \leq 2.25 \cdot 10^{-151}:\\
\;\;\;\;i \cdot \left(x \cdot -4\right)\\
\mathbf{elif}\;c \leq 3.6 \cdot 10^{+120}:\\
\;\;\;\;-4 \cdot \left(t \cdot a\right)\\
\mathbf{else}:\\
\;\;\;\;c \cdot b\\
\end{array}
\end{array}
if c < -9.19999999999999967e-61 or 3.60000000000000016e120 < c Initial program 81.1%
Simplified87.1%
Taylor expanded in b around inf 44.3%
if -9.19999999999999967e-61 < c < 2.2500000000000001e-151Initial program 86.7%
Simplified82.7%
Taylor expanded in i around inf 26.6%
*-commutative26.6%
associate-*r*26.6%
*-commutative26.6%
Simplified26.6%
if 2.2500000000000001e-151 < c < 3.60000000000000016e120Initial program 89.0%
Simplified92.1%
Taylor expanded in a around inf 30.5%
Final simplification35.9%
NOTE: y and z should be sorted in increasing order before calling this function. NOTE: j and k should be sorted in increasing order before calling this function. (FPCore (x y z t a b c i j k) :precision binary64 (if (<= c -3.5e-59) (* c b) (if (<= c 0.0008) (* -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 (c <= -3.5e-59) {
tmp = c * b;
} else if (c <= 0.0008) {
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 (c <= (-3.5d-59)) then
tmp = c * b
else if (c <= 0.0008d0) 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 (c <= -3.5e-59) {
tmp = c * b;
} else if (c <= 0.0008) {
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 c <= -3.5e-59: tmp = c * b elif c <= 0.0008: 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 (c <= -3.5e-59) tmp = Float64(c * b); elseif (c <= 0.0008) 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 (c <= -3.5e-59)
tmp = c * b;
elseif (c <= 0.0008)
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[LessEqual[c, -3.5e-59], N[(c * b), $MachinePrecision], If[LessEqual[c, 0.0008], 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}\;c \leq -3.5 \cdot 10^{-59}:\\
\;\;\;\;c \cdot b\\
\mathbf{elif}\;c \leq 0.0008:\\
\;\;\;\;-27 \cdot \left(j \cdot k\right)\\
\mathbf{else}:\\
\;\;\;\;c \cdot b\\
\end{array}
\end{array}
if c < -3.5000000000000001e-59 or 8.00000000000000038e-4 < c Initial program 82.0%
Simplified87.7%
Taylor expanded in b around inf 41.9%
if -3.5000000000000001e-59 < c < 8.00000000000000038e-4Initial program 88.0%
Simplified86.3%
Taylor expanded in k around inf 18.9%
Final simplification31.7%
NOTE: y and z should be sorted in increasing order before calling this function. NOTE: j and k should be sorted in increasing order before calling this function. (FPCore (x y z t a b c i j k) :precision binary64 (if (<= c -6.1e-238) (* c b) (if (<= c 3.2e+120) (* -4.0 (* t 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 <= -6.1e-238) {
tmp = c * b;
} else if (c <= 3.2e+120) {
tmp = -4.0 * (t * 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 <= (-6.1d-238)) then
tmp = c * b
else if (c <= 3.2d+120) then
tmp = (-4.0d0) * (t * 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 <= -6.1e-238) {
tmp = c * b;
} else if (c <= 3.2e+120) {
tmp = -4.0 * (t * 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 <= -6.1e-238: tmp = c * b elif c <= 3.2e+120: tmp = -4.0 * (t * 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 <= -6.1e-238) tmp = Float64(c * b); elseif (c <= 3.2e+120) tmp = Float64(-4.0 * Float64(t * 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 <= -6.1e-238)
tmp = c * b;
elseif (c <= 3.2e+120)
tmp = -4.0 * (t * 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, -6.1e-238], N[(c * b), $MachinePrecision], If[LessEqual[c, 3.2e+120], N[(-4.0 * N[(t * 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 -6.1 \cdot 10^{-238}:\\
\;\;\;\;c \cdot b\\
\mathbf{elif}\;c \leq 3.2 \cdot 10^{+120}:\\
\;\;\;\;-4 \cdot \left(t \cdot a\right)\\
\mathbf{else}:\\
\;\;\;\;c \cdot b\\
\end{array}
\end{array}
if c < -6.1000000000000001e-238 or 3.19999999999999982e120 < c Initial program 82.4%
Simplified86.4%
Taylor expanded in b around inf 35.9%
if -6.1000000000000001e-238 < c < 3.19999999999999982e120Initial program 88.3%
Simplified88.2%
Taylor expanded in a around inf 29.0%
Final simplification33.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 (* 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 84.6%
Simplified87.1%
Taylor expanded in b around inf 26.3%
Final simplification26.3%
(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 2023221
(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)))