
(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 22 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b c i j k) :precision binary64 (- (- (+ (- (* (* (* (* x 18.0) y) z) t) (* (* a 4.0) t)) (* b c)) (* (* x 4.0) i)) (* (* j 27.0) k)))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
return (((((((x * 18.0) * y) * z) * t) - ((a * 4.0) * t)) + (b * c)) - ((x * 4.0) * i)) - ((j * 27.0) * k);
}
real(8) function code(x, y, z, t, a, b, c, i, j, k)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
code = (((((((x * 18.0d0) * y) * z) * t) - ((a * 4.0d0) * t)) + (b * c)) - ((x * 4.0d0) * i)) - ((j * 27.0d0) * k)
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
return (((((((x * 18.0) * y) * z) * t) - ((a * 4.0) * t)) + (b * c)) - ((x * 4.0) * i)) - ((j * 27.0) * k);
}
def code(x, y, z, t, a, b, c, i, j, k): return (((((((x * 18.0) * y) * z) * t) - ((a * 4.0) * t)) + (b * c)) - ((x * 4.0) * i)) - ((j * 27.0) * k)
function code(x, y, z, t, a, b, c, i, j, k) return Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(x * 18.0) * y) * z) * t) - Float64(Float64(a * 4.0) * t)) + Float64(b * c)) - Float64(Float64(x * 4.0) * i)) - Float64(Float64(j * 27.0) * k)) end
function tmp = code(x, y, z, t, a, b, c, i, j, k) tmp = (((((((x * 18.0) * y) * z) * t) - ((a * 4.0) * t)) + (b * c)) - ((x * 4.0) * i)) - ((j * 27.0) * k); end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := N[(N[(N[(N[(N[(N[(N[(N[(x * 18.0), $MachinePrecision] * y), $MachinePrecision] * z), $MachinePrecision] * t), $MachinePrecision] - N[(N[(a * 4.0), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] + N[(b * c), $MachinePrecision]), $MachinePrecision] - N[(N[(x * 4.0), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision] - N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k
\end{array}
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (* (* y z) t))
(t_2 (cbrt (fma t (- (* z (* x (* 18.0 y))) (* a 4.0)) (* b c))))
(t_3 (* (* j 27.0) k)))
(if (<= x -3.6e+62)
(- (fma x (fma 18.0 t_1 (* i -4.0)) (* b c)) t_3)
(if (<= x 3.8e-97)
(- (* t_2 (* t_2 t_2)) (+ (* x (* i 4.0)) (* j (* 27.0 k))))
(-
(- (+ (* b c) (* x (- (* 18.0 t_1) (* i 4.0)))) (* 4.0 (* t a)))
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 = (y * z) * t;
double t_2 = cbrt(fma(t, ((z * (x * (18.0 * y))) - (a * 4.0)), (b * c)));
double t_3 = (j * 27.0) * k;
double tmp;
if (x <= -3.6e+62) {
tmp = fma(x, fma(18.0, t_1, (i * -4.0)), (b * c)) - t_3;
} else if (x <= 3.8e-97) {
tmp = (t_2 * (t_2 * t_2)) - ((x * (i * 4.0)) + (j * (27.0 * k)));
} else {
tmp = (((b * c) + (x * ((18.0 * t_1) - (i * 4.0)))) - (4.0 * (t * a))) - 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(Float64(y * z) * t) t_2 = cbrt(fma(t, Float64(Float64(z * Float64(x * Float64(18.0 * y))) - Float64(a * 4.0)), Float64(b * c))) t_3 = Float64(Float64(j * 27.0) * k) tmp = 0.0 if (x <= -3.6e+62) tmp = Float64(fma(x, fma(18.0, t_1, Float64(i * -4.0)), Float64(b * c)) - t_3); elseif (x <= 3.8e-97) tmp = Float64(Float64(t_2 * Float64(t_2 * t_2)) - Float64(Float64(x * Float64(i * 4.0)) + Float64(j * Float64(27.0 * k)))); else tmp = Float64(Float64(Float64(Float64(b * c) + Float64(x * Float64(Float64(18.0 * t_1) - Float64(i * 4.0)))) - Float64(4.0 * Float64(t * a))) - t_3); end return tmp end
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(N[(y * z), $MachinePrecision] * t), $MachinePrecision]}, Block[{t$95$2 = N[Power[N[(t * N[(N[(z * N[(x * N[(18.0 * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(a * 4.0), $MachinePrecision]), $MachinePrecision] + N[(b * c), $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision]}, Block[{t$95$3 = N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]}, If[LessEqual[x, -3.6e+62], N[(N[(x * N[(18.0 * t$95$1 + N[(i * -4.0), $MachinePrecision]), $MachinePrecision] + N[(b * c), $MachinePrecision]), $MachinePrecision] - t$95$3), $MachinePrecision], If[LessEqual[x, 3.8e-97], N[(N[(t$95$2 * N[(t$95$2 * t$95$2), $MachinePrecision]), $MachinePrecision] - N[(N[(x * N[(i * 4.0), $MachinePrecision]), $MachinePrecision] + N[(j * N[(27.0 * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(b * c), $MachinePrecision] + N[(x * N[(N[(18.0 * t$95$1), $MachinePrecision] - N[(i * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(4.0 * N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$3), $MachinePrecision]]]]]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
t_1 := \left(y \cdot z\right) \cdot t\\
t_2 := \sqrt[3]{\mathsf{fma}\left(t, z \cdot \left(x \cdot \left(18 \cdot y\right)\right) - a \cdot 4, b \cdot c\right)}\\
t_3 := \left(j \cdot 27\right) \cdot k\\
\mathbf{if}\;x \leq -3.6 \cdot 10^{+62}:\\
\;\;\;\;\mathsf{fma}\left(x, \mathsf{fma}\left(18, t_1, i \cdot -4\right), b \cdot c\right) - t_3\\
\mathbf{elif}\;x \leq 3.8 \cdot 10^{-97}:\\
\;\;\;\;t_2 \cdot \left(t_2 \cdot t_2\right) - \left(x \cdot \left(i \cdot 4\right) + j \cdot \left(27 \cdot k\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(b \cdot c + x \cdot \left(18 \cdot t_1 - i \cdot 4\right)\right) - 4 \cdot \left(t \cdot a\right)\right) - t_3\\
\end{array}
\end{array}
if x < -3.6e62Initial program 72.5%
Taylor expanded in a around 0 74.1%
sub-neg74.1%
+-commutative74.1%
associate-+l+74.1%
associate-*r*74.1%
*-commutative74.1%
associate-*r*81.1%
associate-*r*81.1%
distribute-lft-neg-in81.1%
metadata-eval81.1%
associate-*r*81.1%
distribute-rgt-in86.7%
metadata-eval86.7%
cancel-sign-sub-inv86.7%
+-commutative86.7%
fma-def88.5%
Simplified88.5%
if -3.6e62 < x < 3.8000000000000001e-97Initial program 90.6%
Simplified88.4%
Taylor expanded in x around 0 88.4%
associate-*r*88.4%
*-commutative88.4%
associate-*r*92.2%
*-commutative92.2%
associate-*l*92.1%
Simplified92.1%
add-cube-cbrt91.6%
fma-def91.6%
fma-def91.6%
fma-def92.4%
Applied egg-rr92.4%
if 3.8000000000000001e-97 < x Initial program 84.3%
Taylor expanded in x around 0 94.9%
Final simplification92.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 (* (* y z) t)) (t_2 (* (* j 27.0) k)))
(if (<= x -9e+61)
(- (fma x (fma 18.0 t_1 (* i -4.0)) (* b c)) t_2)
(if (<= x 3.5e-97)
(-
(+ (* b c) (* t (- (* z (* x (* 18.0 y))) (* a 4.0))))
(+ (* x (* i 4.0)) (* j (* 27.0 k))))
(-
(- (+ (* b c) (* x (- (* 18.0 t_1) (* i 4.0)))) (* 4.0 (* t a)))
t_2)))))assert(y < z);
assert(j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = (y * z) * t;
double t_2 = (j * 27.0) * k;
double tmp;
if (x <= -9e+61) {
tmp = fma(x, fma(18.0, t_1, (i * -4.0)), (b * c)) - t_2;
} else if (x <= 3.5e-97) {
tmp = ((b * c) + (t * ((z * (x * (18.0 * y))) - (a * 4.0)))) - ((x * (i * 4.0)) + (j * (27.0 * k)));
} else {
tmp = (((b * c) + (x * ((18.0 * t_1) - (i * 4.0)))) - (4.0 * (t * a))) - 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(y * z) * t) t_2 = Float64(Float64(j * 27.0) * k) tmp = 0.0 if (x <= -9e+61) tmp = Float64(fma(x, fma(18.0, t_1, Float64(i * -4.0)), Float64(b * c)) - t_2); elseif (x <= 3.5e-97) tmp = Float64(Float64(Float64(b * c) + Float64(t * Float64(Float64(z * Float64(x * Float64(18.0 * y))) - Float64(a * 4.0)))) - Float64(Float64(x * Float64(i * 4.0)) + Float64(j * Float64(27.0 * k)))); else tmp = Float64(Float64(Float64(Float64(b * c) + Float64(x * Float64(Float64(18.0 * t_1) - Float64(i * 4.0)))) - Float64(4.0 * Float64(t * a))) - t_2); end return tmp end
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(N[(y * z), $MachinePrecision] * t), $MachinePrecision]}, Block[{t$95$2 = N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]}, If[LessEqual[x, -9e+61], N[(N[(x * N[(18.0 * t$95$1 + N[(i * -4.0), $MachinePrecision]), $MachinePrecision] + N[(b * c), $MachinePrecision]), $MachinePrecision] - t$95$2), $MachinePrecision], If[LessEqual[x, 3.5e-97], N[(N[(N[(b * c), $MachinePrecision] + N[(t * N[(N[(z * N[(x * N[(18.0 * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(a * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(x * N[(i * 4.0), $MachinePrecision]), $MachinePrecision] + N[(j * N[(27.0 * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(b * c), $MachinePrecision] + N[(x * N[(N[(18.0 * t$95$1), $MachinePrecision] - N[(i * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(4.0 * N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$2), $MachinePrecision]]]]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
t_1 := \left(y \cdot z\right) \cdot t\\
t_2 := \left(j \cdot 27\right) \cdot k\\
\mathbf{if}\;x \leq -9 \cdot 10^{+61}:\\
\;\;\;\;\mathsf{fma}\left(x, \mathsf{fma}\left(18, t_1, i \cdot -4\right), b \cdot c\right) - t_2\\
\mathbf{elif}\;x \leq 3.5 \cdot 10^{-97}:\\
\;\;\;\;\left(b \cdot c + t \cdot \left(z \cdot \left(x \cdot \left(18 \cdot y\right)\right) - a \cdot 4\right)\right) - \left(x \cdot \left(i \cdot 4\right) + j \cdot \left(27 \cdot k\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(b \cdot c + x \cdot \left(18 \cdot t_1 - i \cdot 4\right)\right) - 4 \cdot \left(t \cdot a\right)\right) - t_2\\
\end{array}
\end{array}
if x < -9e61Initial program 72.5%
Taylor expanded in a around 0 74.1%
sub-neg74.1%
+-commutative74.1%
associate-+l+74.1%
associate-*r*74.1%
*-commutative74.1%
associate-*r*81.1%
associate-*r*81.1%
distribute-lft-neg-in81.1%
metadata-eval81.1%
associate-*r*81.1%
distribute-rgt-in86.7%
metadata-eval86.7%
cancel-sign-sub-inv86.7%
+-commutative86.7%
fma-def88.5%
Simplified88.5%
if -9e61 < x < 3.50000000000000019e-97Initial program 90.6%
Simplified88.4%
Taylor expanded in x around 0 88.4%
associate-*r*88.4%
*-commutative88.4%
associate-*r*92.2%
*-commutative92.2%
associate-*l*92.1%
Simplified92.1%
if 3.50000000000000019e-97 < x Initial program 84.3%
Taylor expanded in x around 0 94.9%
Final simplification92.2%
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (* (* j 27.0) k)))
(if (<= t_1 -2e+298)
(- (* 4.0 (* x (- i))) (* 27.0 (* j k)))
(if (<= t_1 -4e+16)
(- (* b c) t_1)
(if (<= t_1 2e-227)
(* x (- (* i (- 4.0)) (* -18.0 (* z (* y t)))))
(if (<= t_1 2e-120)
(* b c)
(if (<= t_1 5e+15)
(* x (- (* 18.0 (* (* y z) t)) (* i 4.0)))
(if (<= t_1 2e+80)
(- (* t (* -4.0 a)) t_1)
(if (<= t_1 1e+124)
(* t (- (* 18.0 (* x (* y z))) (* a 4.0)))
(- (* -4.0 (* 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 = (j * 27.0) * k;
double tmp;
if (t_1 <= -2e+298) {
tmp = (4.0 * (x * -i)) - (27.0 * (j * k));
} else if (t_1 <= -4e+16) {
tmp = (b * c) - t_1;
} else if (t_1 <= 2e-227) {
tmp = x * ((i * -4.0) - (-18.0 * (z * (y * t))));
} else if (t_1 <= 2e-120) {
tmp = b * c;
} else if (t_1 <= 5e+15) {
tmp = x * ((18.0 * ((y * z) * t)) - (i * 4.0));
} else if (t_1 <= 2e+80) {
tmp = (t * (-4.0 * a)) - t_1;
} else if (t_1 <= 1e+124) {
tmp = t * ((18.0 * (x * (y * z))) - (a * 4.0));
} else {
tmp = (-4.0 * (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 = (j * 27.0d0) * k
if (t_1 <= (-2d+298)) then
tmp = (4.0d0 * (x * -i)) - (27.0d0 * (j * k))
else if (t_1 <= (-4d+16)) then
tmp = (b * c) - t_1
else if (t_1 <= 2d-227) then
tmp = x * ((i * -4.0d0) - ((-18.0d0) * (z * (y * t))))
else if (t_1 <= 2d-120) then
tmp = b * c
else if (t_1 <= 5d+15) then
tmp = x * ((18.0d0 * ((y * z) * t)) - (i * 4.0d0))
else if (t_1 <= 2d+80) then
tmp = (t * ((-4.0d0) * a)) - t_1
else if (t_1 <= 1d+124) then
tmp = t * ((18.0d0 * (x * (y * z))) - (a * 4.0d0))
else
tmp = ((-4.0d0) * (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 = (j * 27.0) * k;
double tmp;
if (t_1 <= -2e+298) {
tmp = (4.0 * (x * -i)) - (27.0 * (j * k));
} else if (t_1 <= -4e+16) {
tmp = (b * c) - t_1;
} else if (t_1 <= 2e-227) {
tmp = x * ((i * -4.0) - (-18.0 * (z * (y * t))));
} else if (t_1 <= 2e-120) {
tmp = b * c;
} else if (t_1 <= 5e+15) {
tmp = x * ((18.0 * ((y * z) * t)) - (i * 4.0));
} else if (t_1 <= 2e+80) {
tmp = (t * (-4.0 * a)) - t_1;
} else if (t_1 <= 1e+124) {
tmp = t * ((18.0 * (x * (y * z))) - (a * 4.0));
} else {
tmp = (-4.0 * (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 = (j * 27.0) * k tmp = 0 if t_1 <= -2e+298: tmp = (4.0 * (x * -i)) - (27.0 * (j * k)) elif t_1 <= -4e+16: tmp = (b * c) - t_1 elif t_1 <= 2e-227: tmp = x * ((i * -4.0) - (-18.0 * (z * (y * t)))) elif t_1 <= 2e-120: tmp = b * c elif t_1 <= 5e+15: tmp = x * ((18.0 * ((y * z) * t)) - (i * 4.0)) elif t_1 <= 2e+80: tmp = (t * (-4.0 * a)) - t_1 elif t_1 <= 1e+124: tmp = t * ((18.0 * (x * (y * z))) - (a * 4.0)) else: tmp = (-4.0 * (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(Float64(j * 27.0) * k) tmp = 0.0 if (t_1 <= -2e+298) tmp = Float64(Float64(4.0 * Float64(x * Float64(-i))) - Float64(27.0 * Float64(j * k))); elseif (t_1 <= -4e+16) tmp = Float64(Float64(b * c) - t_1); elseif (t_1 <= 2e-227) tmp = Float64(x * Float64(Float64(i * Float64(-4.0)) - Float64(-18.0 * Float64(z * Float64(y * t))))); elseif (t_1 <= 2e-120) tmp = Float64(b * c); elseif (t_1 <= 5e+15) tmp = Float64(x * Float64(Float64(18.0 * Float64(Float64(y * z) * t)) - Float64(i * 4.0))); elseif (t_1 <= 2e+80) tmp = Float64(Float64(t * Float64(-4.0 * a)) - t_1); elseif (t_1 <= 1e+124) tmp = Float64(t * Float64(Float64(18.0 * Float64(x * Float64(y * z))) - Float64(a * 4.0))); else tmp = Float64(Float64(-4.0 * 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 = (j * 27.0) * k;
tmp = 0.0;
if (t_1 <= -2e+298)
tmp = (4.0 * (x * -i)) - (27.0 * (j * k));
elseif (t_1 <= -4e+16)
tmp = (b * c) - t_1;
elseif (t_1 <= 2e-227)
tmp = x * ((i * -4.0) - (-18.0 * (z * (y * t))));
elseif (t_1 <= 2e-120)
tmp = b * c;
elseif (t_1 <= 5e+15)
tmp = x * ((18.0 * ((y * z) * t)) - (i * 4.0));
elseif (t_1 <= 2e+80)
tmp = (t * (-4.0 * a)) - t_1;
elseif (t_1 <= 1e+124)
tmp = t * ((18.0 * (x * (y * z))) - (a * 4.0));
else
tmp = (-4.0 * (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[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]}, If[LessEqual[t$95$1, -2e+298], N[(N[(4.0 * N[(x * (-i)), $MachinePrecision]), $MachinePrecision] - N[(27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, -4e+16], N[(N[(b * c), $MachinePrecision] - t$95$1), $MachinePrecision], If[LessEqual[t$95$1, 2e-227], N[(x * N[(N[(i * (-4.0)), $MachinePrecision] - N[(-18.0 * N[(z * N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 2e-120], N[(b * c), $MachinePrecision], If[LessEqual[t$95$1, 5e+15], N[(x * N[(N[(18.0 * N[(N[(y * z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] - N[(i * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 2e+80], N[(N[(t * N[(-4.0 * a), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], If[LessEqual[t$95$1, 1e+124], N[(t * N[(N[(18.0 * N[(x * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(a * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(-4.0 * N[(x * i), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision]]]]]]]]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
t_1 := \left(j \cdot 27\right) \cdot k\\
\mathbf{if}\;t_1 \leq -2 \cdot 10^{+298}:\\
\;\;\;\;4 \cdot \left(x \cdot \left(-i\right)\right) - 27 \cdot \left(j \cdot k\right)\\
\mathbf{elif}\;t_1 \leq -4 \cdot 10^{+16}:\\
\;\;\;\;b \cdot c - t_1\\
\mathbf{elif}\;t_1 \leq 2 \cdot 10^{-227}:\\
\;\;\;\;x \cdot \left(i \cdot \left(-4\right) - -18 \cdot \left(z \cdot \left(y \cdot t\right)\right)\right)\\
\mathbf{elif}\;t_1 \leq 2 \cdot 10^{-120}:\\
\;\;\;\;b \cdot c\\
\mathbf{elif}\;t_1 \leq 5 \cdot 10^{+15}:\\
\;\;\;\;x \cdot \left(18 \cdot \left(\left(y \cdot z\right) \cdot t\right) - i \cdot 4\right)\\
\mathbf{elif}\;t_1 \leq 2 \cdot 10^{+80}:\\
\;\;\;\;t \cdot \left(-4 \cdot a\right) - t_1\\
\mathbf{elif}\;t_1 \leq 10^{+124}:\\
\;\;\;\;t \cdot \left(18 \cdot \left(x \cdot \left(y \cdot z\right)\right) - a \cdot 4\right)\\
\mathbf{else}:\\
\;\;\;\;-4 \cdot \left(x \cdot i\right) - t_1\\
\end{array}
\end{array}
if (*.f64 (*.f64 j 27) k) < -1.9999999999999999e298Initial program 70.0%
Taylor expanded in b around 0 70.0%
*-commutative70.0%
distribute-lft-out70.0%
*-commutative70.0%
*-commutative70.0%
Simplified70.0%
Taylor expanded in t around 0 85.0%
if -1.9999999999999999e298 < (*.f64 (*.f64 j 27) k) < -4e16Initial program 95.3%
Taylor expanded in x around 0 95.3%
Taylor expanded in b around inf 71.4%
if -4e16 < (*.f64 (*.f64 j 27) k) < 1.99999999999999989e-227Initial program 84.0%
Simplified87.2%
Taylor expanded in x around 0 87.2%
associate-*r*87.2%
*-commutative87.2%
associate-*r*86.0%
*-commutative86.0%
associate-*l*86.0%
Simplified86.0%
Taylor expanded in x around -inf 55.3%
mul-1-neg55.3%
cancel-sign-sub-inv55.3%
associate-*r*58.0%
metadata-eval58.0%
Simplified58.0%
if 1.99999999999999989e-227 < (*.f64 (*.f64 j 27) k) < 1.99999999999999996e-120Initial program 77.1%
Simplified71.5%
Taylor expanded in b around inf 56.6%
if 1.99999999999999996e-120 < (*.f64 (*.f64 j 27) k) < 5e15Initial program 91.0%
Simplified86.2%
Taylor expanded in x around inf 57.1%
if 5e15 < (*.f64 (*.f64 j 27) k) < 2e80Initial program 73.7%
Taylor expanded in x around 0 86.5%
Taylor expanded in a around inf 65.6%
associate-*r*65.6%
Simplified65.6%
if 2e80 < (*.f64 (*.f64 j 27) k) < 9.99999999999999948e123Initial program 85.8%
Simplified100.0%
Taylor expanded in t around inf 86.3%
if 9.99999999999999948e123 < (*.f64 (*.f64 j 27) k) Initial program 88.2%
Taylor expanded in x around 0 88.4%
Taylor expanded in x around inf 85.6%
Taylor expanded in t around 0 86.0%
Final simplification67.2%
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (* (* j 27.0) k))
(t_2 (- (* x (- (* 18.0 (* (* y z) t)) (* i 4.0))) t_1))
(t_3 (+ (* -4.0 (* t a)) (- (* b c) (* j (* 27.0 k))))))
(if (<= x -6.5e+148)
t_2
(if (<= x -8.4e+130)
(- (* b c) t_1)
(if (<= x -2.05e+105)
(- (* 18.0 (* t (* x (* y z)))) (* 4.0 (+ (* t a) (* x i))))
(if (<= x -5.6e+52)
(- (- (* b c) (* 4.0 (* x i))) t_1)
(if (<= x -4.9e-92)
t_2
(if (<= x 1.38e+82)
t_3
(if (<= x 3.8e+111)
(* x (- (* i (- 4.0)) (* -18.0 (* z (* y t)))))
(if (<= x 3.8e+151) t_3 t_2))))))))))assert(y < z);
assert(j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = (j * 27.0) * k;
double t_2 = (x * ((18.0 * ((y * z) * t)) - (i * 4.0))) - t_1;
double t_3 = (-4.0 * (t * a)) + ((b * c) - (j * (27.0 * k)));
double tmp;
if (x <= -6.5e+148) {
tmp = t_2;
} else if (x <= -8.4e+130) {
tmp = (b * c) - t_1;
} else if (x <= -2.05e+105) {
tmp = (18.0 * (t * (x * (y * z)))) - (4.0 * ((t * a) + (x * i)));
} else if (x <= -5.6e+52) {
tmp = ((b * c) - (4.0 * (x * i))) - t_1;
} else if (x <= -4.9e-92) {
tmp = t_2;
} else if (x <= 1.38e+82) {
tmp = t_3;
} else if (x <= 3.8e+111) {
tmp = x * ((i * -4.0) - (-18.0 * (z * (y * t))));
} else if (x <= 3.8e+151) {
tmp = t_3;
} else {
tmp = t_2;
}
return tmp;
}
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_1 = (j * 27.0d0) * k
t_2 = (x * ((18.0d0 * ((y * z) * t)) - (i * 4.0d0))) - t_1
t_3 = ((-4.0d0) * (t * a)) + ((b * c) - (j * (27.0d0 * k)))
if (x <= (-6.5d+148)) then
tmp = t_2
else if (x <= (-8.4d+130)) then
tmp = (b * c) - t_1
else if (x <= (-2.05d+105)) then
tmp = (18.0d0 * (t * (x * (y * z)))) - (4.0d0 * ((t * a) + (x * i)))
else if (x <= (-5.6d+52)) then
tmp = ((b * c) - (4.0d0 * (x * i))) - t_1
else if (x <= (-4.9d-92)) then
tmp = t_2
else if (x <= 1.38d+82) then
tmp = t_3
else if (x <= 3.8d+111) then
tmp = x * ((i * -4.0d0) - ((-18.0d0) * (z * (y * t))))
else if (x <= 3.8d+151) then
tmp = t_3
else
tmp = t_2
end if
code = tmp
end function
assert y < z;
assert j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = (j * 27.0) * k;
double t_2 = (x * ((18.0 * ((y * z) * t)) - (i * 4.0))) - t_1;
double t_3 = (-4.0 * (t * a)) + ((b * c) - (j * (27.0 * k)));
double tmp;
if (x <= -6.5e+148) {
tmp = t_2;
} else if (x <= -8.4e+130) {
tmp = (b * c) - t_1;
} else if (x <= -2.05e+105) {
tmp = (18.0 * (t * (x * (y * z)))) - (4.0 * ((t * a) + (x * i)));
} else if (x <= -5.6e+52) {
tmp = ((b * c) - (4.0 * (x * i))) - t_1;
} else if (x <= -4.9e-92) {
tmp = t_2;
} else if (x <= 1.38e+82) {
tmp = t_3;
} else if (x <= 3.8e+111) {
tmp = x * ((i * -4.0) - (-18.0 * (z * (y * t))));
} else if (x <= 3.8e+151) {
tmp = t_3;
} else {
tmp = t_2;
}
return tmp;
}
[y, z] = sort([y, z]) [j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): t_1 = (j * 27.0) * k t_2 = (x * ((18.0 * ((y * z) * t)) - (i * 4.0))) - t_1 t_3 = (-4.0 * (t * a)) + ((b * c) - (j * (27.0 * k))) tmp = 0 if x <= -6.5e+148: tmp = t_2 elif x <= -8.4e+130: tmp = (b * c) - t_1 elif x <= -2.05e+105: tmp = (18.0 * (t * (x * (y * z)))) - (4.0 * ((t * a) + (x * i))) elif x <= -5.6e+52: tmp = ((b * c) - (4.0 * (x * i))) - t_1 elif x <= -4.9e-92: tmp = t_2 elif x <= 1.38e+82: tmp = t_3 elif x <= 3.8e+111: tmp = x * ((i * -4.0) - (-18.0 * (z * (y * t)))) elif x <= 3.8e+151: tmp = t_3 else: tmp = t_2 return tmp
y, z = sort([y, z]) j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(Float64(j * 27.0) * k) t_2 = Float64(Float64(x * Float64(Float64(18.0 * Float64(Float64(y * z) * t)) - Float64(i * 4.0))) - t_1) t_3 = Float64(Float64(-4.0 * Float64(t * a)) + Float64(Float64(b * c) - Float64(j * Float64(27.0 * k)))) tmp = 0.0 if (x <= -6.5e+148) tmp = t_2; elseif (x <= -8.4e+130) tmp = Float64(Float64(b * c) - t_1); elseif (x <= -2.05e+105) tmp = Float64(Float64(18.0 * Float64(t * Float64(x * Float64(y * z)))) - Float64(4.0 * Float64(Float64(t * a) + Float64(x * i)))); elseif (x <= -5.6e+52) tmp = Float64(Float64(Float64(b * c) - Float64(4.0 * Float64(x * i))) - t_1); elseif (x <= -4.9e-92) tmp = t_2; elseif (x <= 1.38e+82) tmp = t_3; elseif (x <= 3.8e+111) tmp = Float64(x * Float64(Float64(i * Float64(-4.0)) - Float64(-18.0 * Float64(z * Float64(y * t))))); elseif (x <= 3.8e+151) tmp = t_3; else tmp = t_2; end return tmp end
y, z = num2cell(sort([y, z])){:}
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
t_1 = (j * 27.0) * k;
t_2 = (x * ((18.0 * ((y * z) * t)) - (i * 4.0))) - t_1;
t_3 = (-4.0 * (t * a)) + ((b * c) - (j * (27.0 * k)));
tmp = 0.0;
if (x <= -6.5e+148)
tmp = t_2;
elseif (x <= -8.4e+130)
tmp = (b * c) - t_1;
elseif (x <= -2.05e+105)
tmp = (18.0 * (t * (x * (y * z)))) - (4.0 * ((t * a) + (x * i)));
elseif (x <= -5.6e+52)
tmp = ((b * c) - (4.0 * (x * i))) - t_1;
elseif (x <= -4.9e-92)
tmp = t_2;
elseif (x <= 1.38e+82)
tmp = t_3;
elseif (x <= 3.8e+111)
tmp = x * ((i * -4.0) - (-18.0 * (z * (y * t))));
elseif (x <= 3.8e+151)
tmp = t_3;
else
tmp = t_2;
end
tmp_2 = tmp;
end
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x * N[(N[(18.0 * N[(N[(y * z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] - N[(i * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision]}, Block[{t$95$3 = N[(N[(-4.0 * N[(t * a), $MachinePrecision]), $MachinePrecision] + N[(N[(b * c), $MachinePrecision] - N[(j * N[(27.0 * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -6.5e+148], t$95$2, If[LessEqual[x, -8.4e+130], N[(N[(b * c), $MachinePrecision] - t$95$1), $MachinePrecision], If[LessEqual[x, -2.05e+105], N[(N[(18.0 * N[(t * N[(x * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(4.0 * N[(N[(t * a), $MachinePrecision] + N[(x * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -5.6e+52], N[(N[(N[(b * c), $MachinePrecision] - N[(4.0 * N[(x * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], If[LessEqual[x, -4.9e-92], t$95$2, If[LessEqual[x, 1.38e+82], t$95$3, If[LessEqual[x, 3.8e+111], N[(x * N[(N[(i * (-4.0)), $MachinePrecision] - N[(-18.0 * N[(z * N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 3.8e+151], t$95$3, t$95$2]]]]]]]]]]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
t_1 := \left(j \cdot 27\right) \cdot k\\
t_2 := x \cdot \left(18 \cdot \left(\left(y \cdot z\right) \cdot t\right) - i \cdot 4\right) - t_1\\
t_3 := -4 \cdot \left(t \cdot a\right) + \left(b \cdot c - j \cdot \left(27 \cdot k\right)\right)\\
\mathbf{if}\;x \leq -6.5 \cdot 10^{+148}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x \leq -8.4 \cdot 10^{+130}:\\
\;\;\;\;b \cdot c - t_1\\
\mathbf{elif}\;x \leq -2.05 \cdot 10^{+105}:\\
\;\;\;\;18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right) - 4 \cdot \left(t \cdot a + x \cdot i\right)\\
\mathbf{elif}\;x \leq -5.6 \cdot 10^{+52}:\\
\;\;\;\;\left(b \cdot c - 4 \cdot \left(x \cdot i\right)\right) - t_1\\
\mathbf{elif}\;x \leq -4.9 \cdot 10^{-92}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x \leq 1.38 \cdot 10^{+82}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;x \leq 3.8 \cdot 10^{+111}:\\
\;\;\;\;x \cdot \left(i \cdot \left(-4\right) - -18 \cdot \left(z \cdot \left(y \cdot t\right)\right)\right)\\
\mathbf{elif}\;x \leq 3.8 \cdot 10^{+151}:\\
\;\;\;\;t_3\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if x < -6.49999999999999947e148 or -5.6e52 < x < -4.9e-92 or 3.8e151 < x Initial program 80.1%
Taylor expanded in x around 0 90.6%
Taylor expanded in x around inf 83.2%
if -6.49999999999999947e148 < x < -8.39999999999999962e130Initial program 34.4%
Taylor expanded in x around 0 66.4%
Taylor expanded in b around inf 99.0%
if -8.39999999999999962e130 < x < -2.0500000000000001e105Initial program 83.3%
Taylor expanded in b around 0 83.3%
*-commutative83.3%
distribute-lft-out83.3%
*-commutative83.3%
*-commutative83.3%
Simplified83.3%
Taylor expanded in j around 0 100.0%
if -2.0500000000000001e105 < x < -5.6e52Initial program 87.4%
Taylor expanded in t around 0 93.7%
if -4.9e-92 < x < 1.3799999999999999e82 or 3.79999999999999976e111 < x < 3.8e151Initial program 92.2%
Simplified90.8%
Taylor expanded in x around 0 81.5%
associate--l+81.5%
*-commutative81.5%
associate-*r*81.5%
*-commutative81.5%
associate-*l*80.7%
Applied egg-rr80.7%
if 1.3799999999999999e82 < x < 3.79999999999999976e111Initial program 43.5%
Simplified62.6%
Taylor expanded in x around 0 62.6%
associate-*r*62.6%
*-commutative62.6%
associate-*r*43.5%
*-commutative43.5%
associate-*l*43.5%
Simplified43.5%
Taylor expanded in x around -inf 81.0%
mul-1-neg81.0%
cancel-sign-sub-inv81.0%
associate-*r*99.7%
metadata-eval99.7%
Simplified99.7%
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 (+ (* b c) (* x (- (* 18.0 (* (* y z) t)) (* i 4.0)))))
(t_2 (* (* j 27.0) k)))
(if (<= x -5.2e+132)
(- t_1 t_2)
(if (<= x 1e-97)
(-
(+ (* b c) (* t (- (* z (* x (* 18.0 y))) (* a 4.0))))
(+ (* x (* i 4.0)) (* j (* 27.0 k))))
(- (- t_1 (* 4.0 (* t a))) 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 = (b * c) + (x * ((18.0 * ((y * z) * t)) - (i * 4.0)));
double t_2 = (j * 27.0) * k;
double tmp;
if (x <= -5.2e+132) {
tmp = t_1 - t_2;
} else if (x <= 1e-97) {
tmp = ((b * c) + (t * ((z * (x * (18.0 * y))) - (a * 4.0)))) - ((x * (i * 4.0)) + (j * (27.0 * k)));
} else {
tmp = (t_1 - (4.0 * (t * a))) - 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 = (b * c) + (x * ((18.0d0 * ((y * z) * t)) - (i * 4.0d0)))
t_2 = (j * 27.0d0) * k
if (x <= (-5.2d+132)) then
tmp = t_1 - t_2
else if (x <= 1d-97) then
tmp = ((b * c) + (t * ((z * (x * (18.0d0 * y))) - (a * 4.0d0)))) - ((x * (i * 4.0d0)) + (j * (27.0d0 * k)))
else
tmp = (t_1 - (4.0d0 * (t * a))) - 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 = (b * c) + (x * ((18.0 * ((y * z) * t)) - (i * 4.0)));
double t_2 = (j * 27.0) * k;
double tmp;
if (x <= -5.2e+132) {
tmp = t_1 - t_2;
} else if (x <= 1e-97) {
tmp = ((b * c) + (t * ((z * (x * (18.0 * y))) - (a * 4.0)))) - ((x * (i * 4.0)) + (j * (27.0 * k)));
} else {
tmp = (t_1 - (4.0 * (t * a))) - 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 = (b * c) + (x * ((18.0 * ((y * z) * t)) - (i * 4.0))) t_2 = (j * 27.0) * k tmp = 0 if x <= -5.2e+132: tmp = t_1 - t_2 elif x <= 1e-97: tmp = ((b * c) + (t * ((z * (x * (18.0 * y))) - (a * 4.0)))) - ((x * (i * 4.0)) + (j * (27.0 * k))) else: tmp = (t_1 - (4.0 * (t * a))) - 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(b * c) + Float64(x * Float64(Float64(18.0 * Float64(Float64(y * z) * t)) - Float64(i * 4.0)))) t_2 = Float64(Float64(j * 27.0) * k) tmp = 0.0 if (x <= -5.2e+132) tmp = Float64(t_1 - t_2); elseif (x <= 1e-97) tmp = Float64(Float64(Float64(b * c) + Float64(t * Float64(Float64(z * Float64(x * Float64(18.0 * y))) - Float64(a * 4.0)))) - Float64(Float64(x * Float64(i * 4.0)) + Float64(j * Float64(27.0 * k)))); else tmp = Float64(Float64(t_1 - Float64(4.0 * Float64(t * a))) - 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 = (b * c) + (x * ((18.0 * ((y * z) * t)) - (i * 4.0)));
t_2 = (j * 27.0) * k;
tmp = 0.0;
if (x <= -5.2e+132)
tmp = t_1 - t_2;
elseif (x <= 1e-97)
tmp = ((b * c) + (t * ((z * (x * (18.0 * y))) - (a * 4.0)))) - ((x * (i * 4.0)) + (j * (27.0 * k)));
else
tmp = (t_1 - (4.0 * (t * a))) - 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[(b * c), $MachinePrecision] + N[(x * N[(N[(18.0 * N[(N[(y * z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] - N[(i * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]}, If[LessEqual[x, -5.2e+132], N[(t$95$1 - t$95$2), $MachinePrecision], If[LessEqual[x, 1e-97], N[(N[(N[(b * c), $MachinePrecision] + N[(t * N[(N[(z * N[(x * N[(18.0 * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(a * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(x * N[(i * 4.0), $MachinePrecision]), $MachinePrecision] + N[(j * N[(27.0 * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(t$95$1 - N[(4.0 * N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$2), $MachinePrecision]]]]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
t_1 := b \cdot c + x \cdot \left(18 \cdot \left(\left(y \cdot z\right) \cdot t\right) - i \cdot 4\right)\\
t_2 := \left(j \cdot 27\right) \cdot k\\
\mathbf{if}\;x \leq -5.2 \cdot 10^{+132}:\\
\;\;\;\;t_1 - t_2\\
\mathbf{elif}\;x \leq 10^{-97}:\\
\;\;\;\;\left(b \cdot c + t \cdot \left(z \cdot \left(x \cdot \left(18 \cdot y\right)\right) - a \cdot 4\right)\right) - \left(x \cdot \left(i \cdot 4\right) + j \cdot \left(27 \cdot k\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(t_1 - 4 \cdot \left(t \cdot a\right)\right) - t_2\\
\end{array}
\end{array}
if x < -5.2e132Initial program 62.3%
Taylor expanded in x around 0 82.3%
Taylor expanded in a around 0 87.7%
if -5.2e132 < x < 1.00000000000000004e-97Initial program 90.5%
Simplified88.6%
Taylor expanded in x around 0 88.6%
associate-*r*88.6%
*-commutative88.6%
associate-*r*91.9%
*-commutative91.9%
associate-*l*91.8%
Simplified91.8%
if 1.00000000000000004e-97 < x Initial program 84.3%
Taylor expanded in x around 0 94.9%
Final simplification92.2%
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(if (<= x -3.7e+131)
(- (+ (* b c) (* x (- (* 18.0 (* (* y z) t)) (* i 4.0)))) (* (* j 27.0) k))
(-
(+ (* b c) (* t (- (* z (* x (* 18.0 y))) (* a 4.0))))
(+ (* x (* i 4.0)) (* j (* 27.0 k))))))assert(y < z);
assert(j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double tmp;
if (x <= -3.7e+131) {
tmp = ((b * c) + (x * ((18.0 * ((y * z) * t)) - (i * 4.0)))) - ((j * 27.0) * k);
} else {
tmp = ((b * c) + (t * ((z * (x * (18.0 * y))) - (a * 4.0)))) - ((x * (i * 4.0)) + (j * (27.0 * k)));
}
return tmp;
}
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: tmp
if (x <= (-3.7d+131)) then
tmp = ((b * c) + (x * ((18.0d0 * ((y * z) * t)) - (i * 4.0d0)))) - ((j * 27.0d0) * k)
else
tmp = ((b * c) + (t * ((z * (x * (18.0d0 * y))) - (a * 4.0d0)))) - ((x * (i * 4.0d0)) + (j * (27.0d0 * k)))
end if
code = tmp
end function
assert y < z;
assert j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double tmp;
if (x <= -3.7e+131) {
tmp = ((b * c) + (x * ((18.0 * ((y * z) * t)) - (i * 4.0)))) - ((j * 27.0) * k);
} else {
tmp = ((b * c) + (t * ((z * (x * (18.0 * y))) - (a * 4.0)))) - ((x * (i * 4.0)) + (j * (27.0 * k)));
}
return tmp;
}
[y, z] = sort([y, z]) [j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): tmp = 0 if x <= -3.7e+131: tmp = ((b * c) + (x * ((18.0 * ((y * z) * t)) - (i * 4.0)))) - ((j * 27.0) * k) else: tmp = ((b * c) + (t * ((z * (x * (18.0 * y))) - (a * 4.0)))) - ((x * (i * 4.0)) + (j * (27.0 * k))) return tmp
y, z = sort([y, z]) j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) tmp = 0.0 if (x <= -3.7e+131) tmp = Float64(Float64(Float64(b * c) + Float64(x * Float64(Float64(18.0 * Float64(Float64(y * z) * t)) - Float64(i * 4.0)))) - Float64(Float64(j * 27.0) * k)); else tmp = Float64(Float64(Float64(b * c) + Float64(t * Float64(Float64(z * Float64(x * Float64(18.0 * y))) - Float64(a * 4.0)))) - Float64(Float64(x * Float64(i * 4.0)) + Float64(j * Float64(27.0 * k)))); end return tmp end
y, z = num2cell(sort([y, z])){:}
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
tmp = 0.0;
if (x <= -3.7e+131)
tmp = ((b * c) + (x * ((18.0 * ((y * z) * t)) - (i * 4.0)))) - ((j * 27.0) * k);
else
tmp = ((b * c) + (t * ((z * (x * (18.0 * y))) - (a * 4.0)))) - ((x * (i * 4.0)) + (j * (27.0 * k)));
end
tmp_2 = tmp;
end
NOTE: y and z should be sorted in increasing order before calling this function. NOTE: j and k should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := If[LessEqual[x, -3.7e+131], N[(N[(N[(b * c), $MachinePrecision] + N[(x * N[(N[(18.0 * N[(N[(y * z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] - N[(i * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision], N[(N[(N[(b * c), $MachinePrecision] + N[(t * N[(N[(z * N[(x * N[(18.0 * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(a * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(x * N[(i * 4.0), $MachinePrecision]), $MachinePrecision] + N[(j * N[(27.0 * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -3.7 \cdot 10^{+131}:\\
\;\;\;\;\left(b \cdot c + x \cdot \left(18 \cdot \left(\left(y \cdot z\right) \cdot t\right) - i \cdot 4\right)\right) - \left(j \cdot 27\right) \cdot k\\
\mathbf{else}:\\
\;\;\;\;\left(b \cdot c + t \cdot \left(z \cdot \left(x \cdot \left(18 \cdot y\right)\right) - a \cdot 4\right)\right) - \left(x \cdot \left(i \cdot 4\right) + j \cdot \left(27 \cdot k\right)\right)\\
\end{array}
\end{array}
if x < -3.69999999999999995e131Initial program 62.3%
Taylor expanded in x around 0 82.3%
Taylor expanded in a around 0 87.7%
if -3.69999999999999995e131 < x Initial program 88.4%
Simplified89.4%
Taylor expanded in x around 0 89.4%
associate-*r*89.4%
*-commutative89.4%
associate-*r*89.8%
*-commutative89.8%
associate-*l*89.8%
Simplified89.8%
Final simplification89.5%
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (+ (* -4.0 (* t a)) (- (* b c) (* j (* 27.0 k)))))
(t_2 (* x (- (* i (- 4.0)) (* -18.0 (* z (* y t))))))
(t_3 (* x (- (* 18.0 (* (* y z) t)) (* i 4.0)))))
(if (<= x -9.5e+187)
t_3
(if (<= x -1.9e+133)
(- (* b c) (* (* j 27.0) k))
(if (<= x -3.1e+91)
t_2
(if (<= x -5.9e+26)
t_1
(if (<= x -2.1e-80) t_3 (if (<= x 2.2e+82) t_1 t_2))))))))assert(y < z);
assert(j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = (-4.0 * (t * a)) + ((b * c) - (j * (27.0 * k)));
double t_2 = x * ((i * -4.0) - (-18.0 * (z * (y * t))));
double t_3 = x * ((18.0 * ((y * z) * t)) - (i * 4.0));
double tmp;
if (x <= -9.5e+187) {
tmp = t_3;
} else if (x <= -1.9e+133) {
tmp = (b * c) - ((j * 27.0) * k);
} else if (x <= -3.1e+91) {
tmp = t_2;
} else if (x <= -5.9e+26) {
tmp = t_1;
} else if (x <= -2.1e-80) {
tmp = t_3;
} else if (x <= 2.2e+82) {
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 = ((-4.0d0) * (t * a)) + ((b * c) - (j * (27.0d0 * k)))
t_2 = x * ((i * -4.0d0) - ((-18.0d0) * (z * (y * t))))
t_3 = x * ((18.0d0 * ((y * z) * t)) - (i * 4.0d0))
if (x <= (-9.5d+187)) then
tmp = t_3
else if (x <= (-1.9d+133)) then
tmp = (b * c) - ((j * 27.0d0) * k)
else if (x <= (-3.1d+91)) then
tmp = t_2
else if (x <= (-5.9d+26)) then
tmp = t_1
else if (x <= (-2.1d-80)) then
tmp = t_3
else if (x <= 2.2d+82) then
tmp = t_1
else
tmp = t_2
end if
code = tmp
end function
assert y < z;
assert j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = (-4.0 * (t * a)) + ((b * c) - (j * (27.0 * k)));
double t_2 = x * ((i * -4.0) - (-18.0 * (z * (y * t))));
double t_3 = x * ((18.0 * ((y * z) * t)) - (i * 4.0));
double tmp;
if (x <= -9.5e+187) {
tmp = t_3;
} else if (x <= -1.9e+133) {
tmp = (b * c) - ((j * 27.0) * k);
} else if (x <= -3.1e+91) {
tmp = t_2;
} else if (x <= -5.9e+26) {
tmp = t_1;
} else if (x <= -2.1e-80) {
tmp = t_3;
} else if (x <= 2.2e+82) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
[y, z] = sort([y, z]) [j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): t_1 = (-4.0 * (t * a)) + ((b * c) - (j * (27.0 * k))) t_2 = x * ((i * -4.0) - (-18.0 * (z * (y * t)))) t_3 = x * ((18.0 * ((y * z) * t)) - (i * 4.0)) tmp = 0 if x <= -9.5e+187: tmp = t_3 elif x <= -1.9e+133: tmp = (b * c) - ((j * 27.0) * k) elif x <= -3.1e+91: tmp = t_2 elif x <= -5.9e+26: tmp = t_1 elif x <= -2.1e-80: tmp = t_3 elif x <= 2.2e+82: 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(-4.0 * Float64(t * a)) + Float64(Float64(b * c) - Float64(j * Float64(27.0 * k)))) t_2 = Float64(x * Float64(Float64(i * Float64(-4.0)) - Float64(-18.0 * Float64(z * Float64(y * t))))) t_3 = Float64(x * Float64(Float64(18.0 * Float64(Float64(y * z) * t)) - Float64(i * 4.0))) tmp = 0.0 if (x <= -9.5e+187) tmp = t_3; elseif (x <= -1.9e+133) tmp = Float64(Float64(b * c) - Float64(Float64(j * 27.0) * k)); elseif (x <= -3.1e+91) tmp = t_2; elseif (x <= -5.9e+26) tmp = t_1; elseif (x <= -2.1e-80) tmp = t_3; elseif (x <= 2.2e+82) tmp = t_1; else tmp = t_2; end return tmp end
y, z = num2cell(sort([y, z])){:}
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
t_1 = (-4.0 * (t * a)) + ((b * c) - (j * (27.0 * k)));
t_2 = x * ((i * -4.0) - (-18.0 * (z * (y * t))));
t_3 = x * ((18.0 * ((y * z) * t)) - (i * 4.0));
tmp = 0.0;
if (x <= -9.5e+187)
tmp = t_3;
elseif (x <= -1.9e+133)
tmp = (b * c) - ((j * 27.0) * k);
elseif (x <= -3.1e+91)
tmp = t_2;
elseif (x <= -5.9e+26)
tmp = t_1;
elseif (x <= -2.1e-80)
tmp = t_3;
elseif (x <= 2.2e+82)
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[(-4.0 * N[(t * a), $MachinePrecision]), $MachinePrecision] + N[(N[(b * c), $MachinePrecision] - N[(j * N[(27.0 * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x * N[(N[(i * (-4.0)), $MachinePrecision] - N[(-18.0 * N[(z * N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(x * N[(N[(18.0 * N[(N[(y * z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] - N[(i * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -9.5e+187], t$95$3, If[LessEqual[x, -1.9e+133], N[(N[(b * c), $MachinePrecision] - N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -3.1e+91], t$95$2, If[LessEqual[x, -5.9e+26], t$95$1, If[LessEqual[x, -2.1e-80], t$95$3, If[LessEqual[x, 2.2e+82], t$95$1, t$95$2]]]]]]]]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
t_1 := -4 \cdot \left(t \cdot a\right) + \left(b \cdot c - j \cdot \left(27 \cdot k\right)\right)\\
t_2 := x \cdot \left(i \cdot \left(-4\right) - -18 \cdot \left(z \cdot \left(y \cdot t\right)\right)\right)\\
t_3 := x \cdot \left(18 \cdot \left(\left(y \cdot z\right) \cdot t\right) - i \cdot 4\right)\\
\mathbf{if}\;x \leq -9.5 \cdot 10^{+187}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;x \leq -1.9 \cdot 10^{+133}:\\
\;\;\;\;b \cdot c - \left(j \cdot 27\right) \cdot k\\
\mathbf{elif}\;x \leq -3.1 \cdot 10^{+91}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x \leq -5.9 \cdot 10^{+26}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq -2.1 \cdot 10^{-80}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;x \leq 2.2 \cdot 10^{+82}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if x < -9.4999999999999996e187 or -5.9000000000000003e26 < x < -2.10000000000000001e-80Initial program 74.9%
Simplified77.0%
Taylor expanded in x around inf 69.3%
if -9.4999999999999996e187 < x < -1.9000000000000001e133Initial program 64.2%
Taylor expanded in x around 0 81.7%
Taylor expanded in b around inf 73.1%
if -1.9000000000000001e133 < x < -3.09999999999999998e91 or 2.2000000000000001e82 < x Initial program 80.5%
Simplified86.7%
Taylor expanded in x around 0 86.7%
associate-*r*86.7%
*-commutative86.7%
associate-*r*80.5%
*-commutative80.5%
associate-*l*80.5%
Simplified80.5%
Taylor expanded in x around -inf 71.4%
mul-1-neg71.4%
cancel-sign-sub-inv71.4%
associate-*r*76.8%
metadata-eval76.8%
Simplified76.8%
if -3.09999999999999998e91 < x < -5.9000000000000003e26 or -2.10000000000000001e-80 < x < 2.2000000000000001e82Initial program 91.2%
Simplified90.6%
Taylor expanded in x around 0 79.0%
associate--l+79.0%
*-commutative79.0%
associate-*r*79.0%
*-commutative79.0%
associate-*l*78.4%
Applied egg-rr78.4%
Final simplification76.2%
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(if (or (<= i -6.8e-73) (not (<= i 2.45e+70)))
(- (- (* b c) (* 4.0 (+ (* t a) (* x i)))) (* (* j 27.0) k))
(-
(+ (* b c) (* t (- (* 18.0 (* x (* y z))) (* a 4.0))))
(* 27.0 (* j k)))))assert(y < z);
assert(j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double tmp;
if ((i <= -6.8e-73) || !(i <= 2.45e+70)) {
tmp = ((b * c) - (4.0 * ((t * a) + (x * i)))) - ((j * 27.0) * k);
} else {
tmp = ((b * c) + (t * ((18.0 * (x * (y * z))) - (a * 4.0)))) - (27.0 * (j * k));
}
return tmp;
}
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: tmp
if ((i <= (-6.8d-73)) .or. (.not. (i <= 2.45d+70))) then
tmp = ((b * c) - (4.0d0 * ((t * a) + (x * i)))) - ((j * 27.0d0) * k)
else
tmp = ((b * c) + (t * ((18.0d0 * (x * (y * z))) - (a * 4.0d0)))) - (27.0d0 * (j * k))
end if
code = tmp
end function
assert y < z;
assert j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double tmp;
if ((i <= -6.8e-73) || !(i <= 2.45e+70)) {
tmp = ((b * c) - (4.0 * ((t * a) + (x * i)))) - ((j * 27.0) * k);
} else {
tmp = ((b * c) + (t * ((18.0 * (x * (y * z))) - (a * 4.0)))) - (27.0 * (j * k));
}
return tmp;
}
[y, z] = sort([y, z]) [j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): tmp = 0 if (i <= -6.8e-73) or not (i <= 2.45e+70): tmp = ((b * c) - (4.0 * ((t * a) + (x * i)))) - ((j * 27.0) * k) else: tmp = ((b * c) + (t * ((18.0 * (x * (y * z))) - (a * 4.0)))) - (27.0 * (j * k)) return tmp
y, z = sort([y, z]) j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) tmp = 0.0 if ((i <= -6.8e-73) || !(i <= 2.45e+70)) tmp = Float64(Float64(Float64(b * c) - Float64(4.0 * Float64(Float64(t * a) + Float64(x * i)))) - Float64(Float64(j * 27.0) * k)); else tmp = Float64(Float64(Float64(b * c) + Float64(t * Float64(Float64(18.0 * Float64(x * Float64(y * z))) - Float64(a * 4.0)))) - Float64(27.0 * Float64(j * k))); end return tmp end
y, z = num2cell(sort([y, z])){:}
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
tmp = 0.0;
if ((i <= -6.8e-73) || ~((i <= 2.45e+70)))
tmp = ((b * c) - (4.0 * ((t * a) + (x * i)))) - ((j * 27.0) * k);
else
tmp = ((b * c) + (t * ((18.0 * (x * (y * z))) - (a * 4.0)))) - (27.0 * (j * k));
end
tmp_2 = tmp;
end
NOTE: y and z should be sorted in increasing order before calling this function. NOTE: j and k should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := If[Or[LessEqual[i, -6.8e-73], N[Not[LessEqual[i, 2.45e+70]], $MachinePrecision]], N[(N[(N[(b * c), $MachinePrecision] - N[(4.0 * N[(N[(t * a), $MachinePrecision] + N[(x * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision], N[(N[(N[(b * c), $MachinePrecision] + N[(t * N[(N[(18.0 * N[(x * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(a * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
\mathbf{if}\;i \leq -6.8 \cdot 10^{-73} \lor \neg \left(i \leq 2.45 \cdot 10^{+70}\right):\\
\;\;\;\;\left(b \cdot c - 4 \cdot \left(t \cdot a + x \cdot i\right)\right) - \left(j \cdot 27\right) \cdot k\\
\mathbf{else}:\\
\;\;\;\;\left(b \cdot c + t \cdot \left(18 \cdot \left(x \cdot \left(y \cdot z\right)\right) - a \cdot 4\right)\right) - 27 \cdot \left(j \cdot k\right)\\
\end{array}
\end{array}
if i < -6.80000000000000042e-73 or 2.45000000000000014e70 < i Initial program 85.6%
Taylor expanded in y around 0 85.3%
distribute-lft-out85.3%
*-commutative85.3%
*-commutative85.3%
Simplified85.3%
if -6.80000000000000042e-73 < i < 2.45000000000000014e70Initial program 84.2%
Simplified86.0%
Taylor expanded in i around 0 84.6%
Final simplification85.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 (<= (* b c) -5.2e+61)
(* b c)
(if (<= (* b c) -3.5e-223)
(* t (* -4.0 a))
(if (<= (* b c) 4.3e-137)
(* (* j k) -27.0)
(if (<= (* b c) 1.1e-7)
(* x (* i -4.0))
(if (<= (* b c) 2.4e+53) (* k (* j -27.0)) (* b c)))))))assert(y < z);
assert(j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double tmp;
if ((b * c) <= -5.2e+61) {
tmp = b * c;
} else if ((b * c) <= -3.5e-223) {
tmp = t * (-4.0 * a);
} else if ((b * c) <= 4.3e-137) {
tmp = (j * k) * -27.0;
} else if ((b * c) <= 1.1e-7) {
tmp = x * (i * -4.0);
} else if ((b * c) <= 2.4e+53) {
tmp = k * (j * -27.0);
} else {
tmp = b * c;
}
return tmp;
}
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: tmp
if ((b * c) <= (-5.2d+61)) then
tmp = b * c
else if ((b * c) <= (-3.5d-223)) then
tmp = t * ((-4.0d0) * a)
else if ((b * c) <= 4.3d-137) then
tmp = (j * k) * (-27.0d0)
else if ((b * c) <= 1.1d-7) then
tmp = x * (i * (-4.0d0))
else if ((b * c) <= 2.4d+53) then
tmp = k * (j * (-27.0d0))
else
tmp = b * c
end if
code = tmp
end function
assert y < z;
assert j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double tmp;
if ((b * c) <= -5.2e+61) {
tmp = b * c;
} else if ((b * c) <= -3.5e-223) {
tmp = t * (-4.0 * a);
} else if ((b * c) <= 4.3e-137) {
tmp = (j * k) * -27.0;
} else if ((b * c) <= 1.1e-7) {
tmp = x * (i * -4.0);
} else if ((b * c) <= 2.4e+53) {
tmp = k * (j * -27.0);
} else {
tmp = b * c;
}
return tmp;
}
[y, z] = sort([y, z]) [j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): tmp = 0 if (b * c) <= -5.2e+61: tmp = b * c elif (b * c) <= -3.5e-223: tmp = t * (-4.0 * a) elif (b * c) <= 4.3e-137: tmp = (j * k) * -27.0 elif (b * c) <= 1.1e-7: tmp = x * (i * -4.0) elif (b * c) <= 2.4e+53: tmp = k * (j * -27.0) else: tmp = b * c return tmp
y, z = sort([y, z]) j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) tmp = 0.0 if (Float64(b * c) <= -5.2e+61) tmp = Float64(b * c); elseif (Float64(b * c) <= -3.5e-223) tmp = Float64(t * Float64(-4.0 * a)); elseif (Float64(b * c) <= 4.3e-137) tmp = Float64(Float64(j * k) * -27.0); elseif (Float64(b * c) <= 1.1e-7) tmp = Float64(x * Float64(i * -4.0)); elseif (Float64(b * c) <= 2.4e+53) tmp = Float64(k * Float64(j * -27.0)); else tmp = Float64(b * c); end return tmp end
y, z = num2cell(sort([y, z])){:}
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
tmp = 0.0;
if ((b * c) <= -5.2e+61)
tmp = b * c;
elseif ((b * c) <= -3.5e-223)
tmp = t * (-4.0 * a);
elseif ((b * c) <= 4.3e-137)
tmp = (j * k) * -27.0;
elseif ((b * c) <= 1.1e-7)
tmp = x * (i * -4.0);
elseif ((b * c) <= 2.4e+53)
tmp = k * (j * -27.0);
else
tmp = b * c;
end
tmp_2 = tmp;
end
NOTE: y and z should be sorted in increasing order before calling this function. NOTE: j and k should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := If[LessEqual[N[(b * c), $MachinePrecision], -5.2e+61], N[(b * c), $MachinePrecision], If[LessEqual[N[(b * c), $MachinePrecision], -3.5e-223], N[(t * N[(-4.0 * a), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(b * c), $MachinePrecision], 4.3e-137], N[(N[(j * k), $MachinePrecision] * -27.0), $MachinePrecision], If[LessEqual[N[(b * c), $MachinePrecision], 1.1e-7], N[(x * N[(i * -4.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(b * c), $MachinePrecision], 2.4e+53], N[(k * N[(j * -27.0), $MachinePrecision]), $MachinePrecision], N[(b * c), $MachinePrecision]]]]]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
\mathbf{if}\;b \cdot c \leq -5.2 \cdot 10^{+61}:\\
\;\;\;\;b \cdot c\\
\mathbf{elif}\;b \cdot c \leq -3.5 \cdot 10^{-223}:\\
\;\;\;\;t \cdot \left(-4 \cdot a\right)\\
\mathbf{elif}\;b \cdot c \leq 4.3 \cdot 10^{-137}:\\
\;\;\;\;\left(j \cdot k\right) \cdot -27\\
\mathbf{elif}\;b \cdot c \leq 1.1 \cdot 10^{-7}:\\
\;\;\;\;x \cdot \left(i \cdot -4\right)\\
\mathbf{elif}\;b \cdot c \leq 2.4 \cdot 10^{+53}:\\
\;\;\;\;k \cdot \left(j \cdot -27\right)\\
\mathbf{else}:\\
\;\;\;\;b \cdot c\\
\end{array}
\end{array}
if (*.f64 b c) < -5.19999999999999945e61 or 2.4e53 < (*.f64 b c) Initial program 80.8%
Simplified81.8%
Taylor expanded in b around inf 51.0%
if -5.19999999999999945e61 < (*.f64 b c) < -3.50000000000000009e-223Initial program 90.6%
Simplified95.3%
Taylor expanded in a around inf 41.5%
*-commutative41.5%
*-commutative41.5%
associate-*r*41.5%
Simplified41.5%
if -3.50000000000000009e-223 < (*.f64 b c) < 4.2999999999999998e-137Initial program 89.4%
Simplified86.6%
Taylor expanded in j around inf 43.9%
if 4.2999999999999998e-137 < (*.f64 b c) < 1.1000000000000001e-7Initial program 83.0%
Simplified87.4%
Taylor expanded in i around inf 40.7%
associate-*r*40.7%
*-commutative40.7%
Simplified40.7%
if 1.1000000000000001e-7 < (*.f64 b c) < 2.4e53Initial program 82.6%
Simplified88.4%
Taylor expanded in j around inf 54.0%
associate-*r*54.1%
Simplified54.1%
Final simplification46.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 (<= (* b c) -1.3e+144)
(* b c)
(if (<= (* b c) -1.65e-189)
(* 18.0 (* x (* y (* z t))))
(if (<= (* b c) 6.8e-139)
(* (* j k) -27.0)
(if (<= (* b c) 1.8e-7)
(* x (* i -4.0))
(if (<= (* b c) 9.5e+52) (* k (* j -27.0)) (* b c)))))))assert(y < z);
assert(j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double tmp;
if ((b * c) <= -1.3e+144) {
tmp = b * c;
} else if ((b * c) <= -1.65e-189) {
tmp = 18.0 * (x * (y * (z * t)));
} else if ((b * c) <= 6.8e-139) {
tmp = (j * k) * -27.0;
} else if ((b * c) <= 1.8e-7) {
tmp = x * (i * -4.0);
} else if ((b * c) <= 9.5e+52) {
tmp = k * (j * -27.0);
} else {
tmp = b * c;
}
return tmp;
}
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: tmp
if ((b * c) <= (-1.3d+144)) then
tmp = b * c
else if ((b * c) <= (-1.65d-189)) then
tmp = 18.0d0 * (x * (y * (z * t)))
else if ((b * c) <= 6.8d-139) then
tmp = (j * k) * (-27.0d0)
else if ((b * c) <= 1.8d-7) then
tmp = x * (i * (-4.0d0))
else if ((b * c) <= 9.5d+52) then
tmp = k * (j * (-27.0d0))
else
tmp = b * c
end if
code = tmp
end function
assert y < z;
assert j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double tmp;
if ((b * c) <= -1.3e+144) {
tmp = b * c;
} else if ((b * c) <= -1.65e-189) {
tmp = 18.0 * (x * (y * (z * t)));
} else if ((b * c) <= 6.8e-139) {
tmp = (j * k) * -27.0;
} else if ((b * c) <= 1.8e-7) {
tmp = x * (i * -4.0);
} else if ((b * c) <= 9.5e+52) {
tmp = k * (j * -27.0);
} else {
tmp = b * c;
}
return tmp;
}
[y, z] = sort([y, z]) [j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): tmp = 0 if (b * c) <= -1.3e+144: tmp = b * c elif (b * c) <= -1.65e-189: tmp = 18.0 * (x * (y * (z * t))) elif (b * c) <= 6.8e-139: tmp = (j * k) * -27.0 elif (b * c) <= 1.8e-7: tmp = x * (i * -4.0) elif (b * c) <= 9.5e+52: tmp = k * (j * -27.0) else: tmp = b * c return tmp
y, z = sort([y, z]) j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) tmp = 0.0 if (Float64(b * c) <= -1.3e+144) tmp = Float64(b * c); elseif (Float64(b * c) <= -1.65e-189) tmp = Float64(18.0 * Float64(x * Float64(y * Float64(z * t)))); elseif (Float64(b * c) <= 6.8e-139) tmp = Float64(Float64(j * k) * -27.0); elseif (Float64(b * c) <= 1.8e-7) tmp = Float64(x * Float64(i * -4.0)); elseif (Float64(b * c) <= 9.5e+52) tmp = Float64(k * Float64(j * -27.0)); else tmp = Float64(b * c); end return tmp end
y, z = num2cell(sort([y, z])){:}
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
tmp = 0.0;
if ((b * c) <= -1.3e+144)
tmp = b * c;
elseif ((b * c) <= -1.65e-189)
tmp = 18.0 * (x * (y * (z * t)));
elseif ((b * c) <= 6.8e-139)
tmp = (j * k) * -27.0;
elseif ((b * c) <= 1.8e-7)
tmp = x * (i * -4.0);
elseif ((b * c) <= 9.5e+52)
tmp = k * (j * -27.0);
else
tmp = b * c;
end
tmp_2 = tmp;
end
NOTE: y and z should be sorted in increasing order before calling this function. NOTE: j and k should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := If[LessEqual[N[(b * c), $MachinePrecision], -1.3e+144], N[(b * c), $MachinePrecision], If[LessEqual[N[(b * c), $MachinePrecision], -1.65e-189], N[(18.0 * N[(x * N[(y * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(b * c), $MachinePrecision], 6.8e-139], N[(N[(j * k), $MachinePrecision] * -27.0), $MachinePrecision], If[LessEqual[N[(b * c), $MachinePrecision], 1.8e-7], N[(x * N[(i * -4.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(b * c), $MachinePrecision], 9.5e+52], N[(k * N[(j * -27.0), $MachinePrecision]), $MachinePrecision], N[(b * c), $MachinePrecision]]]]]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
\mathbf{if}\;b \cdot c \leq -1.3 \cdot 10^{+144}:\\
\;\;\;\;b \cdot c\\
\mathbf{elif}\;b \cdot c \leq -1.65 \cdot 10^{-189}:\\
\;\;\;\;18 \cdot \left(x \cdot \left(y \cdot \left(z \cdot t\right)\right)\right)\\
\mathbf{elif}\;b \cdot c \leq 6.8 \cdot 10^{-139}:\\
\;\;\;\;\left(j \cdot k\right) \cdot -27\\
\mathbf{elif}\;b \cdot c \leq 1.8 \cdot 10^{-7}:\\
\;\;\;\;x \cdot \left(i \cdot -4\right)\\
\mathbf{elif}\;b \cdot c \leq 9.5 \cdot 10^{+52}:\\
\;\;\;\;k \cdot \left(j \cdot -27\right)\\
\mathbf{else}:\\
\;\;\;\;b \cdot c\\
\end{array}
\end{array}
if (*.f64 b c) < -1.2999999999999999e144 or 9.49999999999999994e52 < (*.f64 b c) Initial program 81.7%
Simplified81.8%
Taylor expanded in b around inf 54.5%
if -1.2999999999999999e144 < (*.f64 b c) < -1.65e-189Initial program 85.6%
Simplified91.9%
Taylor expanded in y around inf 33.1%
*-commutative33.1%
associate-*l*35.1%
associate-*l*37.1%
Simplified37.1%
if -1.65e-189 < (*.f64 b c) < 6.79999999999999998e-139Initial program 90.2%
Simplified87.6%
Taylor expanded in j around inf 43.6%
if 6.79999999999999998e-139 < (*.f64 b c) < 1.79999999999999997e-7Initial program 83.0%
Simplified87.4%
Taylor expanded in i around inf 40.7%
associate-*r*40.7%
*-commutative40.7%
Simplified40.7%
if 1.79999999999999997e-7 < (*.f64 b c) < 9.49999999999999994e52Initial program 82.6%
Simplified88.4%
Taylor expanded in j around inf 54.0%
associate-*r*54.1%
Simplified54.1%
Final simplification47.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 (<= z -1.15e+100)
(* 18.0 (* t (* y (* x z))))
(if (<= z 1.5e+222)
(- (+ (* b c) (* -4.0 (* t a))) (+ (* x (* i 4.0)) (* j (* 27.0 k))))
(- (* x (- (* 18.0 (* (* y z) t)) (* i 4.0))) (* (* j 27.0) k)))))assert(y < z);
assert(j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double tmp;
if (z <= -1.15e+100) {
tmp = 18.0 * (t * (y * (x * z)));
} else if (z <= 1.5e+222) {
tmp = ((b * c) + (-4.0 * (t * a))) - ((x * (i * 4.0)) + (j * (27.0 * k)));
} else {
tmp = (x * ((18.0 * ((y * z) * t)) - (i * 4.0))) - ((j * 27.0) * k);
}
return tmp;
}
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: tmp
if (z <= (-1.15d+100)) then
tmp = 18.0d0 * (t * (y * (x * z)))
else if (z <= 1.5d+222) then
tmp = ((b * c) + ((-4.0d0) * (t * a))) - ((x * (i * 4.0d0)) + (j * (27.0d0 * k)))
else
tmp = (x * ((18.0d0 * ((y * z) * t)) - (i * 4.0d0))) - ((j * 27.0d0) * k)
end if
code = tmp
end function
assert y < z;
assert j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double tmp;
if (z <= -1.15e+100) {
tmp = 18.0 * (t * (y * (x * z)));
} else if (z <= 1.5e+222) {
tmp = ((b * c) + (-4.0 * (t * a))) - ((x * (i * 4.0)) + (j * (27.0 * k)));
} else {
tmp = (x * ((18.0 * ((y * z) * t)) - (i * 4.0))) - ((j * 27.0) * k);
}
return tmp;
}
[y, z] = sort([y, z]) [j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): tmp = 0 if z <= -1.15e+100: tmp = 18.0 * (t * (y * (x * z))) elif z <= 1.5e+222: tmp = ((b * c) + (-4.0 * (t * a))) - ((x * (i * 4.0)) + (j * (27.0 * k))) else: tmp = (x * ((18.0 * ((y * z) * t)) - (i * 4.0))) - ((j * 27.0) * k) return tmp
y, z = sort([y, z]) j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) tmp = 0.0 if (z <= -1.15e+100) tmp = Float64(18.0 * Float64(t * Float64(y * Float64(x * z)))); elseif (z <= 1.5e+222) tmp = Float64(Float64(Float64(b * c) + Float64(-4.0 * Float64(t * a))) - Float64(Float64(x * Float64(i * 4.0)) + Float64(j * Float64(27.0 * k)))); else tmp = Float64(Float64(x * Float64(Float64(18.0 * Float64(Float64(y * z) * t)) - Float64(i * 4.0))) - Float64(Float64(j * 27.0) * k)); end return tmp end
y, z = num2cell(sort([y, z])){:}
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
tmp = 0.0;
if (z <= -1.15e+100)
tmp = 18.0 * (t * (y * (x * z)));
elseif (z <= 1.5e+222)
tmp = ((b * c) + (-4.0 * (t * a))) - ((x * (i * 4.0)) + (j * (27.0 * k)));
else
tmp = (x * ((18.0 * ((y * z) * t)) - (i * 4.0))) - ((j * 27.0) * k);
end
tmp_2 = tmp;
end
NOTE: y and z should be sorted in increasing order before calling this function. NOTE: j and k should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := If[LessEqual[z, -1.15e+100], N[(18.0 * N[(t * N[(y * N[(x * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.5e+222], N[(N[(N[(b * c), $MachinePrecision] + N[(-4.0 * N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(x * N[(i * 4.0), $MachinePrecision]), $MachinePrecision] + N[(j * N[(27.0 * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * N[(N[(18.0 * N[(N[(y * z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] - N[(i * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.15 \cdot 10^{+100}:\\
\;\;\;\;18 \cdot \left(t \cdot \left(y \cdot \left(x \cdot z\right)\right)\right)\\
\mathbf{elif}\;z \leq 1.5 \cdot 10^{+222}:\\
\;\;\;\;\left(b \cdot c + -4 \cdot \left(t \cdot a\right)\right) - \left(x \cdot \left(i \cdot 4\right) + j \cdot \left(27 \cdot k\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(18 \cdot \left(\left(y \cdot z\right) \cdot t\right) - i \cdot 4\right) - \left(j \cdot 27\right) \cdot k\\
\end{array}
\end{array}
if z < -1.14999999999999995e100Initial program 86.4%
Simplified84.6%
Taylor expanded in x around 0 84.6%
associate-*r*84.6%
*-commutative84.6%
associate-*r*91.0%
*-commutative91.0%
associate-*l*91.0%
Simplified91.0%
Taylor expanded in z around inf 42.8%
*-commutative42.8%
*-commutative42.8%
associate-*r*47.1%
Simplified47.1%
if -1.14999999999999995e100 < z < 1.50000000000000007e222Initial program 84.8%
Simplified87.4%
Taylor expanded in x around 0 82.2%
if 1.50000000000000007e222 < z Initial program 83.2%
Taylor expanded in x around 0 78.0%
Taylor expanded in x around inf 72.5%
Final simplification75.4%
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (* (* j 27.0) k)))
(if (<= z -1.45e+53)
(* 18.0 (* t (* y (* x z))))
(if (<= z 2.3e+220)
(- (- (* b c) (* 4.0 (+ (* t a) (* x i)))) t_1)
(- (* x (- (* 18.0 (* (* y z) t)) (* i 4.0))) t_1)))))assert(y < z);
assert(j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = (j * 27.0) * k;
double tmp;
if (z <= -1.45e+53) {
tmp = 18.0 * (t * (y * (x * z)));
} else if (z <= 2.3e+220) {
tmp = ((b * c) - (4.0 * ((t * a) + (x * i)))) - t_1;
} else {
tmp = (x * ((18.0 * ((y * z) * t)) - (i * 4.0))) - t_1;
}
return tmp;
}
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: tmp
t_1 = (j * 27.0d0) * k
if (z <= (-1.45d+53)) then
tmp = 18.0d0 * (t * (y * (x * z)))
else if (z <= 2.3d+220) then
tmp = ((b * c) - (4.0d0 * ((t * a) + (x * i)))) - t_1
else
tmp = (x * ((18.0d0 * ((y * z) * t)) - (i * 4.0d0))) - t_1
end if
code = tmp
end function
assert y < z;
assert j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = (j * 27.0) * k;
double tmp;
if (z <= -1.45e+53) {
tmp = 18.0 * (t * (y * (x * z)));
} else if (z <= 2.3e+220) {
tmp = ((b * c) - (4.0 * ((t * a) + (x * i)))) - t_1;
} else {
tmp = (x * ((18.0 * ((y * z) * t)) - (i * 4.0))) - t_1;
}
return tmp;
}
[y, z] = sort([y, z]) [j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): t_1 = (j * 27.0) * k tmp = 0 if z <= -1.45e+53: tmp = 18.0 * (t * (y * (x * z))) elif z <= 2.3e+220: tmp = ((b * c) - (4.0 * ((t * a) + (x * i)))) - t_1 else: tmp = (x * ((18.0 * ((y * z) * t)) - (i * 4.0))) - t_1 return tmp
y, z = sort([y, z]) j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(Float64(j * 27.0) * k) tmp = 0.0 if (z <= -1.45e+53) tmp = Float64(18.0 * Float64(t * Float64(y * Float64(x * z)))); elseif (z <= 2.3e+220) tmp = Float64(Float64(Float64(b * c) - Float64(4.0 * Float64(Float64(t * a) + Float64(x * i)))) - t_1); else tmp = Float64(Float64(x * Float64(Float64(18.0 * Float64(Float64(y * z) * t)) - Float64(i * 4.0))) - t_1); end return tmp end
y, z = num2cell(sort([y, z])){:}
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
t_1 = (j * 27.0) * k;
tmp = 0.0;
if (z <= -1.45e+53)
tmp = 18.0 * (t * (y * (x * z)));
elseif (z <= 2.3e+220)
tmp = ((b * c) - (4.0 * ((t * a) + (x * i)))) - t_1;
else
tmp = (x * ((18.0 * ((y * z) * t)) - (i * 4.0))) - t_1;
end
tmp_2 = tmp;
end
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]}, If[LessEqual[z, -1.45e+53], N[(18.0 * N[(t * N[(y * N[(x * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.3e+220], N[(N[(N[(b * c), $MachinePrecision] - N[(4.0 * N[(N[(t * a), $MachinePrecision] + N[(x * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], N[(N[(x * N[(N[(18.0 * N[(N[(y * z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] - N[(i * 4.0), $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 := \left(j \cdot 27\right) \cdot k\\
\mathbf{if}\;z \leq -1.45 \cdot 10^{+53}:\\
\;\;\;\;18 \cdot \left(t \cdot \left(y \cdot \left(x \cdot z\right)\right)\right)\\
\mathbf{elif}\;z \leq 2.3 \cdot 10^{+220}:\\
\;\;\;\;\left(b \cdot c - 4 \cdot \left(t \cdot a + x \cdot i\right)\right) - t_1\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(18 \cdot \left(\left(y \cdot z\right) \cdot t\right) - i \cdot 4\right) - t_1\\
\end{array}
\end{array}
if z < -1.4500000000000001e53Initial program 87.6%
Simplified84.4%
Taylor expanded in x around 0 84.4%
associate-*r*84.4%
*-commutative84.4%
associate-*r*89.5%
*-commutative89.5%
associate-*l*89.5%
Simplified89.5%
Taylor expanded in z around inf 41.2%
*-commutative41.2%
*-commutative41.2%
associate-*r*44.5%
Simplified44.5%
if -1.4500000000000001e53 < z < 2.29999999999999997e220Initial program 84.3%
Taylor expanded in y around 0 83.7%
distribute-lft-out83.7%
*-commutative83.7%
*-commutative83.7%
Simplified83.7%
if 2.29999999999999997e220 < z Initial program 83.2%
Taylor expanded in x around 0 78.0%
Taylor expanded in x around inf 72.5%
Final simplification74.3%
NOTE: y and z should be sorted in increasing order before calling this function. NOTE: j and k should be sorted in increasing order before calling this function. (FPCore (x y z t a b c i j k) :precision binary64 (if (or (<= c -4400.0) (not (<= c 9.6e+65))) (+ (* -4.0 (* t a)) (- (* b c) (* j (* 27.0 k)))) (- (* -4.0 (+ (* t a) (* x i))) (* (* j 27.0) k))))
assert(y < z);
assert(j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double tmp;
if ((c <= -4400.0) || !(c <= 9.6e+65)) {
tmp = (-4.0 * (t * a)) + ((b * c) - (j * (27.0 * k)));
} else {
tmp = (-4.0 * ((t * a) + (x * i))) - ((j * 27.0) * k);
}
return tmp;
}
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: tmp
if ((c <= (-4400.0d0)) .or. (.not. (c <= 9.6d+65))) then
tmp = ((-4.0d0) * (t * a)) + ((b * c) - (j * (27.0d0 * k)))
else
tmp = ((-4.0d0) * ((t * a) + (x * i))) - ((j * 27.0d0) * k)
end if
code = tmp
end function
assert y < z;
assert j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double tmp;
if ((c <= -4400.0) || !(c <= 9.6e+65)) {
tmp = (-4.0 * (t * a)) + ((b * c) - (j * (27.0 * k)));
} else {
tmp = (-4.0 * ((t * a) + (x * i))) - ((j * 27.0) * k);
}
return tmp;
}
[y, z] = sort([y, z]) [j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): tmp = 0 if (c <= -4400.0) or not (c <= 9.6e+65): tmp = (-4.0 * (t * a)) + ((b * c) - (j * (27.0 * k))) else: tmp = (-4.0 * ((t * a) + (x * i))) - ((j * 27.0) * k) return tmp
y, z = sort([y, z]) j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) tmp = 0.0 if ((c <= -4400.0) || !(c <= 9.6e+65)) tmp = Float64(Float64(-4.0 * Float64(t * a)) + Float64(Float64(b * c) - Float64(j * Float64(27.0 * k)))); else tmp = Float64(Float64(-4.0 * Float64(Float64(t * a) + Float64(x * i))) - Float64(Float64(j * 27.0) * k)); end return tmp end
y, z = num2cell(sort([y, z])){:}
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
tmp = 0.0;
if ((c <= -4400.0) || ~((c <= 9.6e+65)))
tmp = (-4.0 * (t * a)) + ((b * c) - (j * (27.0 * k)));
else
tmp = (-4.0 * ((t * a) + (x * i))) - ((j * 27.0) * k);
end
tmp_2 = tmp;
end
NOTE: y and z should be sorted in increasing order before calling this function. NOTE: j and k should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := If[Or[LessEqual[c, -4400.0], N[Not[LessEqual[c, 9.6e+65]], $MachinePrecision]], N[(N[(-4.0 * N[(t * a), $MachinePrecision]), $MachinePrecision] + N[(N[(b * c), $MachinePrecision] - N[(j * N[(27.0 * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(-4.0 * N[(N[(t * a), $MachinePrecision] + N[(x * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
\mathbf{if}\;c \leq -4400 \lor \neg \left(c \leq 9.6 \cdot 10^{+65}\right):\\
\;\;\;\;-4 \cdot \left(t \cdot a\right) + \left(b \cdot c - j \cdot \left(27 \cdot k\right)\right)\\
\mathbf{else}:\\
\;\;\;\;-4 \cdot \left(t \cdot a + x \cdot i\right) - \left(j \cdot 27\right) \cdot k\\
\end{array}
\end{array}
if c < -4400 or 9.6000000000000007e65 < c Initial program 79.6%
Simplified82.3%
Taylor expanded in x around 0 64.9%
associate--l+64.9%
*-commutative64.9%
associate-*r*64.9%
*-commutative64.9%
associate-*l*64.9%
Applied egg-rr64.9%
if -4400 < c < 9.6000000000000007e65Initial program 89.4%
Taylor expanded in b around 0 82.6%
*-commutative82.6%
distribute-lft-out82.6%
*-commutative82.6%
*-commutative82.6%
Simplified82.6%
Taylor expanded in y around 0 74.5%
Final simplification70.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 (<= x -2.3e-95)
(- (- (* b c) (* 4.0 (* x i))) (* (* j 27.0) k))
(if (<= x 4e+83)
(+ (* -4.0 (* t a)) (- (* b c) (* j (* 27.0 k))))
(* x (- (* i (- 4.0)) (* -18.0 (* z (* y t))))))))assert(y < z);
assert(j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double tmp;
if (x <= -2.3e-95) {
tmp = ((b * c) - (4.0 * (x * i))) - ((j * 27.0) * k);
} else if (x <= 4e+83) {
tmp = (-4.0 * (t * a)) + ((b * c) - (j * (27.0 * k)));
} else {
tmp = x * ((i * -4.0) - (-18.0 * (z * (y * t))));
}
return tmp;
}
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: tmp
if (x <= (-2.3d-95)) then
tmp = ((b * c) - (4.0d0 * (x * i))) - ((j * 27.0d0) * k)
else if (x <= 4d+83) then
tmp = ((-4.0d0) * (t * a)) + ((b * c) - (j * (27.0d0 * k)))
else
tmp = x * ((i * -4.0d0) - ((-18.0d0) * (z * (y * t))))
end if
code = tmp
end function
assert y < z;
assert j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double tmp;
if (x <= -2.3e-95) {
tmp = ((b * c) - (4.0 * (x * i))) - ((j * 27.0) * k);
} else if (x <= 4e+83) {
tmp = (-4.0 * (t * a)) + ((b * c) - (j * (27.0 * k)));
} else {
tmp = x * ((i * -4.0) - (-18.0 * (z * (y * t))));
}
return tmp;
}
[y, z] = sort([y, z]) [j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): tmp = 0 if x <= -2.3e-95: tmp = ((b * c) - (4.0 * (x * i))) - ((j * 27.0) * k) elif x <= 4e+83: tmp = (-4.0 * (t * a)) + ((b * c) - (j * (27.0 * k))) else: tmp = x * ((i * -4.0) - (-18.0 * (z * (y * t)))) return tmp
y, z = sort([y, z]) j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) tmp = 0.0 if (x <= -2.3e-95) tmp = Float64(Float64(Float64(b * c) - Float64(4.0 * Float64(x * i))) - Float64(Float64(j * 27.0) * k)); elseif (x <= 4e+83) tmp = Float64(Float64(-4.0 * Float64(t * a)) + Float64(Float64(b * c) - Float64(j * Float64(27.0 * k)))); else tmp = Float64(x * Float64(Float64(i * Float64(-4.0)) - Float64(-18.0 * Float64(z * Float64(y * t))))); end return tmp end
y, z = num2cell(sort([y, z])){:}
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
tmp = 0.0;
if (x <= -2.3e-95)
tmp = ((b * c) - (4.0 * (x * i))) - ((j * 27.0) * k);
elseif (x <= 4e+83)
tmp = (-4.0 * (t * a)) + ((b * c) - (j * (27.0 * k)));
else
tmp = x * ((i * -4.0) - (-18.0 * (z * (y * t))));
end
tmp_2 = tmp;
end
NOTE: y and z should be sorted in increasing order before calling this function. NOTE: j and k should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := If[LessEqual[x, -2.3e-95], N[(N[(N[(b * c), $MachinePrecision] - N[(4.0 * N[(x * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 4e+83], N[(N[(-4.0 * N[(t * a), $MachinePrecision]), $MachinePrecision] + N[(N[(b * c), $MachinePrecision] - N[(j * N[(27.0 * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(N[(i * (-4.0)), $MachinePrecision] - N[(-18.0 * N[(z * N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.3 \cdot 10^{-95}:\\
\;\;\;\;\left(b \cdot c - 4 \cdot \left(x \cdot i\right)\right) - \left(j \cdot 27\right) \cdot k\\
\mathbf{elif}\;x \leq 4 \cdot 10^{+83}:\\
\;\;\;\;-4 \cdot \left(t \cdot a\right) + \left(b \cdot c - j \cdot \left(27 \cdot k\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(i \cdot \left(-4\right) - -18 \cdot \left(z \cdot \left(y \cdot t\right)\right)\right)\\
\end{array}
\end{array}
if x < -2.29999999999999999e-95Initial program 78.3%
Taylor expanded in t around 0 69.6%
if -2.29999999999999999e-95 < x < 4.00000000000000012e83Initial program 91.9%
Simplified90.5%
Taylor expanded in x around 0 81.2%
associate--l+81.2%
*-commutative81.2%
associate-*r*81.2%
*-commutative81.2%
associate-*l*80.4%
Applied egg-rr80.4%
if 4.00000000000000012e83 < x Initial program 78.6%
Simplified86.2%
Taylor expanded in x around 0 86.2%
associate-*r*86.2%
*-commutative86.2%
associate-*r*78.6%
*-commutative78.6%
associate-*l*78.6%
Simplified78.6%
Taylor expanded in x around -inf 69.9%
mul-1-neg69.9%
cancel-sign-sub-inv69.9%
associate-*r*76.4%
metadata-eval76.4%
Simplified76.4%
Final simplification75.9%
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (- (* b c) (* (* j 27.0) k))) (t_2 (* x (* z (* y (* 18.0 t))))))
(if (<= y -3.9e+212)
t_2
(if (<= y -4.2e+137)
t_1
(if (<= y -8.5e+108)
t_2
(if (<= y 9.8e+95) t_1 (* 18.0 (* t (* x (* y z))))))))))assert(y < z);
assert(j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = (b * c) - ((j * 27.0) * k);
double t_2 = x * (z * (y * (18.0 * t)));
double tmp;
if (y <= -3.9e+212) {
tmp = t_2;
} else if (y <= -4.2e+137) {
tmp = t_1;
} else if (y <= -8.5e+108) {
tmp = t_2;
} else if (y <= 9.8e+95) {
tmp = t_1;
} else {
tmp = 18.0 * (t * (x * (y * z)));
}
return tmp;
}
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (b * c) - ((j * 27.0d0) * k)
t_2 = x * (z * (y * (18.0d0 * t)))
if (y <= (-3.9d+212)) then
tmp = t_2
else if (y <= (-4.2d+137)) then
tmp = t_1
else if (y <= (-8.5d+108)) then
tmp = t_2
else if (y <= 9.8d+95) then
tmp = t_1
else
tmp = 18.0d0 * (t * (x * (y * z)))
end if
code = tmp
end function
assert y < z;
assert j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = (b * c) - ((j * 27.0) * k);
double t_2 = x * (z * (y * (18.0 * t)));
double tmp;
if (y <= -3.9e+212) {
tmp = t_2;
} else if (y <= -4.2e+137) {
tmp = t_1;
} else if (y <= -8.5e+108) {
tmp = t_2;
} else if (y <= 9.8e+95) {
tmp = t_1;
} else {
tmp = 18.0 * (t * (x * (y * z)));
}
return tmp;
}
[y, z] = sort([y, z]) [j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): t_1 = (b * c) - ((j * 27.0) * k) t_2 = x * (z * (y * (18.0 * t))) tmp = 0 if y <= -3.9e+212: tmp = t_2 elif y <= -4.2e+137: tmp = t_1 elif y <= -8.5e+108: tmp = t_2 elif y <= 9.8e+95: tmp = t_1 else: tmp = 18.0 * (t * (x * (y * z))) return tmp
y, z = sort([y, z]) j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(Float64(b * c) - Float64(Float64(j * 27.0) * k)) t_2 = Float64(x * Float64(z * Float64(y * Float64(18.0 * t)))) tmp = 0.0 if (y <= -3.9e+212) tmp = t_2; elseif (y <= -4.2e+137) tmp = t_1; elseif (y <= -8.5e+108) tmp = t_2; elseif (y <= 9.8e+95) tmp = t_1; else tmp = Float64(18.0 * Float64(t * Float64(x * Float64(y * z)))); end return tmp end
y, z = num2cell(sort([y, z])){:}
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
t_1 = (b * c) - ((j * 27.0) * k);
t_2 = x * (z * (y * (18.0 * t)));
tmp = 0.0;
if (y <= -3.9e+212)
tmp = t_2;
elseif (y <= -4.2e+137)
tmp = t_1;
elseif (y <= -8.5e+108)
tmp = t_2;
elseif (y <= 9.8e+95)
tmp = t_1;
else
tmp = 18.0 * (t * (x * (y * z)));
end
tmp_2 = tmp;
end
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(N[(b * c), $MachinePrecision] - N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x * N[(z * N[(y * N[(18.0 * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -3.9e+212], t$95$2, If[LessEqual[y, -4.2e+137], t$95$1, If[LessEqual[y, -8.5e+108], t$95$2, If[LessEqual[y, 9.8e+95], t$95$1, N[(18.0 * N[(t * N[(x * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
t_1 := b \cdot c - \left(j \cdot 27\right) \cdot k\\
t_2 := x \cdot \left(z \cdot \left(y \cdot \left(18 \cdot t\right)\right)\right)\\
\mathbf{if}\;y \leq -3.9 \cdot 10^{+212}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;y \leq -4.2 \cdot 10^{+137}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq -8.5 \cdot 10^{+108}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;y \leq 9.8 \cdot 10^{+95}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right)\\
\end{array}
\end{array}
if y < -3.9000000000000001e212 or -4.1999999999999998e137 < y < -8.50000000000000016e108Initial program 70.0%
Simplified70.4%
Taylor expanded in y around inf 48.8%
*-commutative48.8%
associate-*l*59.5%
*-commutative59.5%
associate-*l*59.5%
*-commutative59.5%
associate-*l*59.5%
associate-*r*59.6%
associate-*r*63.0%
Simplified63.0%
if -3.9000000000000001e212 < y < -4.1999999999999998e137 or -8.50000000000000016e108 < y < 9.7999999999999998e95Initial program 88.9%
Taylor expanded in x around 0 91.2%
Taylor expanded in b around inf 53.3%
if 9.7999999999999998e95 < y Initial program 78.3%
Simplified84.4%
Taylor expanded in y around inf 48.2%
*-commutative48.2%
Simplified48.2%
Final simplification53.3%
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(if (<= (* b c) -8.5e+62)
(* b c)
(if (<= (* b c) -3.6e-223)
(* t (* -4.0 a))
(if (<= (* b c) 5.7e+53) (* j (* k -27.0)) (* b c)))))assert(y < z);
assert(j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double tmp;
if ((b * c) <= -8.5e+62) {
tmp = b * c;
} else if ((b * c) <= -3.6e-223) {
tmp = t * (-4.0 * a);
} else if ((b * c) <= 5.7e+53) {
tmp = j * (k * -27.0);
} else {
tmp = b * c;
}
return tmp;
}
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: tmp
if ((b * c) <= (-8.5d+62)) then
tmp = b * c
else if ((b * c) <= (-3.6d-223)) then
tmp = t * ((-4.0d0) * a)
else if ((b * c) <= 5.7d+53) then
tmp = j * (k * (-27.0d0))
else
tmp = b * c
end if
code = tmp
end function
assert y < z;
assert j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double tmp;
if ((b * c) <= -8.5e+62) {
tmp = b * c;
} else if ((b * c) <= -3.6e-223) {
tmp = t * (-4.0 * a);
} else if ((b * c) <= 5.7e+53) {
tmp = j * (k * -27.0);
} else {
tmp = b * c;
}
return tmp;
}
[y, z] = sort([y, z]) [j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): tmp = 0 if (b * c) <= -8.5e+62: tmp = b * c elif (b * c) <= -3.6e-223: tmp = t * (-4.0 * a) elif (b * c) <= 5.7e+53: tmp = j * (k * -27.0) else: tmp = b * c return tmp
y, z = sort([y, z]) j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) tmp = 0.0 if (Float64(b * c) <= -8.5e+62) tmp = Float64(b * c); elseif (Float64(b * c) <= -3.6e-223) tmp = Float64(t * Float64(-4.0 * a)); elseif (Float64(b * c) <= 5.7e+53) tmp = Float64(j * Float64(k * -27.0)); else tmp = Float64(b * c); end return tmp end
y, z = num2cell(sort([y, z])){:}
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
tmp = 0.0;
if ((b * c) <= -8.5e+62)
tmp = b * c;
elseif ((b * c) <= -3.6e-223)
tmp = t * (-4.0 * a);
elseif ((b * c) <= 5.7e+53)
tmp = j * (k * -27.0);
else
tmp = b * c;
end
tmp_2 = tmp;
end
NOTE: y and z should be sorted in increasing order before calling this function. NOTE: j and k should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := If[LessEqual[N[(b * c), $MachinePrecision], -8.5e+62], N[(b * c), $MachinePrecision], If[LessEqual[N[(b * c), $MachinePrecision], -3.6e-223], N[(t * N[(-4.0 * a), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(b * c), $MachinePrecision], 5.7e+53], N[(j * N[(k * -27.0), $MachinePrecision]), $MachinePrecision], N[(b * c), $MachinePrecision]]]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
\mathbf{if}\;b \cdot c \leq -8.5 \cdot 10^{+62}:\\
\;\;\;\;b \cdot c\\
\mathbf{elif}\;b \cdot c \leq -3.6 \cdot 10^{-223}:\\
\;\;\;\;t \cdot \left(-4 \cdot a\right)\\
\mathbf{elif}\;b \cdot c \leq 5.7 \cdot 10^{+53}:\\
\;\;\;\;j \cdot \left(k \cdot -27\right)\\
\mathbf{else}:\\
\;\;\;\;b \cdot c\\
\end{array}
\end{array}
if (*.f64 b c) < -8.4999999999999997e62 or 5.70000000000000017e53 < (*.f64 b c) Initial program 80.8%
Simplified81.8%
Taylor expanded in b around inf 51.0%
if -8.4999999999999997e62 < (*.f64 b c) < -3.6000000000000004e-223Initial program 90.6%
Simplified95.3%
Taylor expanded in a around inf 41.5%
*-commutative41.5%
*-commutative41.5%
associate-*r*41.5%
Simplified41.5%
if -3.6000000000000004e-223 < (*.f64 b c) < 5.70000000000000017e53Initial program 86.9%
Taylor expanded in x around 0 90.8%
Taylor expanded in j around inf 39.2%
*-commutative39.2%
associate-*l*38.3%
Simplified38.3%
Final simplification44.2%
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (* (* j 27.0) k)) (t_2 (- (* b c) t_1)))
(if (<= c -4800.0)
t_2
(if (<= c -5.4e-216)
(+ (* -4.0 (* x i)) (* j (* k -27.0)))
(if (<= c 6e+71) (- (* t (* -4.0 a)) 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 = (j * 27.0) * k;
double t_2 = (b * c) - t_1;
double tmp;
if (c <= -4800.0) {
tmp = t_2;
} else if (c <= -5.4e-216) {
tmp = (-4.0 * (x * i)) + (j * (k * -27.0));
} else if (c <= 6e+71) {
tmp = (t * (-4.0 * a)) - 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 = (j * 27.0d0) * k
t_2 = (b * c) - t_1
if (c <= (-4800.0d0)) then
tmp = t_2
else if (c <= (-5.4d-216)) then
tmp = ((-4.0d0) * (x * i)) + (j * (k * (-27.0d0)))
else if (c <= 6d+71) then
tmp = (t * ((-4.0d0) * a)) - 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 = (j * 27.0) * k;
double t_2 = (b * c) - t_1;
double tmp;
if (c <= -4800.0) {
tmp = t_2;
} else if (c <= -5.4e-216) {
tmp = (-4.0 * (x * i)) + (j * (k * -27.0));
} else if (c <= 6e+71) {
tmp = (t * (-4.0 * a)) - 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 = (j * 27.0) * k t_2 = (b * c) - t_1 tmp = 0 if c <= -4800.0: tmp = t_2 elif c <= -5.4e-216: tmp = (-4.0 * (x * i)) + (j * (k * -27.0)) elif c <= 6e+71: tmp = (t * (-4.0 * a)) - 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(j * 27.0) * k) t_2 = Float64(Float64(b * c) - t_1) tmp = 0.0 if (c <= -4800.0) tmp = t_2; elseif (c <= -5.4e-216) tmp = Float64(Float64(-4.0 * Float64(x * i)) + Float64(j * Float64(k * -27.0))); elseif (c <= 6e+71) tmp = Float64(Float64(t * Float64(-4.0 * a)) - 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 = (j * 27.0) * k;
t_2 = (b * c) - t_1;
tmp = 0.0;
if (c <= -4800.0)
tmp = t_2;
elseif (c <= -5.4e-216)
tmp = (-4.0 * (x * i)) + (j * (k * -27.0));
elseif (c <= 6e+71)
tmp = (t * (-4.0 * a)) - 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[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]}, Block[{t$95$2 = N[(N[(b * c), $MachinePrecision] - t$95$1), $MachinePrecision]}, If[LessEqual[c, -4800.0], t$95$2, If[LessEqual[c, -5.4e-216], N[(N[(-4.0 * N[(x * i), $MachinePrecision]), $MachinePrecision] + N[(j * N[(k * -27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, 6e+71], N[(N[(t * N[(-4.0 * a), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], t$95$2]]]]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
t_1 := \left(j \cdot 27\right) \cdot k\\
t_2 := b \cdot c - t_1\\
\mathbf{if}\;c \leq -4800:\\
\;\;\;\;t_2\\
\mathbf{elif}\;c \leq -5.4 \cdot 10^{-216}:\\
\;\;\;\;-4 \cdot \left(x \cdot i\right) + j \cdot \left(k \cdot -27\right)\\
\mathbf{elif}\;c \leq 6 \cdot 10^{+71}:\\
\;\;\;\;t \cdot \left(-4 \cdot a\right) - t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if c < -4800 or 6.00000000000000025e71 < c Initial program 79.6%
Taylor expanded in x around 0 82.1%
Taylor expanded in b around inf 56.6%
if -4800 < c < -5.3999999999999998e-216Initial program 93.9%
Taylor expanded in b around 0 86.6%
*-commutative86.6%
distribute-lft-out86.6%
*-commutative86.6%
*-commutative86.6%
Simplified86.6%
Taylor expanded in t around 0 61.6%
mul-1-neg61.6%
associate-*r*61.6%
*-commutative61.6%
associate-*r*59.7%
distribute-neg-in59.7%
distribute-lft-neg-in59.7%
metadata-eval59.7%
distribute-rgt-neg-in59.7%
*-commutative59.7%
distribute-rgt-neg-in59.7%
metadata-eval59.7%
Simplified59.7%
if -5.3999999999999998e-216 < c < 6.00000000000000025e71Initial program 86.9%
Taylor expanded in x around 0 88.0%
Taylor expanded in a around inf 54.1%
associate-*r*54.1%
Simplified54.1%
Final simplification56.3%
NOTE: y and z should be sorted in increasing order before calling this function. NOTE: j and k should be sorted in increasing order before calling this function. (FPCore (x y z t a b c i j k) :precision binary64 (if (or (<= i -1.05e+105) (not (<= i 9.6e+108))) (+ (* -4.0 (* x i)) (* j (* k -27.0))) (- (* b c) (* (* j 27.0) k))))
assert(y < z);
assert(j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double tmp;
if ((i <= -1.05e+105) || !(i <= 9.6e+108)) {
tmp = (-4.0 * (x * i)) + (j * (k * -27.0));
} else {
tmp = (b * c) - ((j * 27.0) * k);
}
return tmp;
}
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: tmp
if ((i <= (-1.05d+105)) .or. (.not. (i <= 9.6d+108))) then
tmp = ((-4.0d0) * (x * i)) + (j * (k * (-27.0d0)))
else
tmp = (b * c) - ((j * 27.0d0) * k)
end if
code = tmp
end function
assert y < z;
assert j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double tmp;
if ((i <= -1.05e+105) || !(i <= 9.6e+108)) {
tmp = (-4.0 * (x * i)) + (j * (k * -27.0));
} else {
tmp = (b * c) - ((j * 27.0) * k);
}
return tmp;
}
[y, z] = sort([y, z]) [j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): tmp = 0 if (i <= -1.05e+105) or not (i <= 9.6e+108): tmp = (-4.0 * (x * i)) + (j * (k * -27.0)) else: tmp = (b * c) - ((j * 27.0) * k) return tmp
y, z = sort([y, z]) j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) tmp = 0.0 if ((i <= -1.05e+105) || !(i <= 9.6e+108)) tmp = Float64(Float64(-4.0 * Float64(x * i)) + Float64(j * Float64(k * -27.0))); else tmp = Float64(Float64(b * c) - Float64(Float64(j * 27.0) * k)); end return tmp end
y, z = num2cell(sort([y, z])){:}
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
tmp = 0.0;
if ((i <= -1.05e+105) || ~((i <= 9.6e+108)))
tmp = (-4.0 * (x * i)) + (j * (k * -27.0));
else
tmp = (b * c) - ((j * 27.0) * k);
end
tmp_2 = tmp;
end
NOTE: y and z should be sorted in increasing order before calling this function. NOTE: j and k should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := If[Or[LessEqual[i, -1.05e+105], N[Not[LessEqual[i, 9.6e+108]], $MachinePrecision]], N[(N[(-4.0 * N[(x * i), $MachinePrecision]), $MachinePrecision] + N[(j * N[(k * -27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(b * c), $MachinePrecision] - N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
\mathbf{if}\;i \leq -1.05 \cdot 10^{+105} \lor \neg \left(i \leq 9.6 \cdot 10^{+108}\right):\\
\;\;\;\;-4 \cdot \left(x \cdot i\right) + j \cdot \left(k \cdot -27\right)\\
\mathbf{else}:\\
\;\;\;\;b \cdot c - \left(j \cdot 27\right) \cdot k\\
\end{array}
\end{array}
if i < -1.05000000000000005e105 or 9.60000000000000074e108 < i Initial program 84.3%
Taylor expanded in b around 0 78.2%
*-commutative78.2%
distribute-lft-out78.2%
*-commutative78.2%
*-commutative78.2%
Simplified78.2%
Taylor expanded in t around 0 64.5%
mul-1-neg64.5%
associate-*r*64.5%
*-commutative64.5%
associate-*r*64.5%
distribute-neg-in64.5%
distribute-lft-neg-in64.5%
metadata-eval64.5%
distribute-rgt-neg-in64.5%
*-commutative64.5%
distribute-rgt-neg-in64.5%
metadata-eval64.5%
Simplified64.5%
if -1.05000000000000005e105 < i < 9.60000000000000074e108Initial program 85.3%
Taylor expanded in x around 0 86.5%
Taylor expanded in b around inf 54.5%
Final simplification57.7%
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (* -4.0 (* x i))) (t_2 (* (* j 27.0) k)))
(if (<= i -9.2e+101)
(+ t_1 (* j (* k -27.0)))
(if (<= i 2.02e+108) (- (* b c) t_2) (- t_1 t_2)))))assert(y < z);
assert(j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = -4.0 * (x * i);
double t_2 = (j * 27.0) * k;
double tmp;
if (i <= -9.2e+101) {
tmp = t_1 + (j * (k * -27.0));
} else if (i <= 2.02e+108) {
tmp = (b * c) - t_2;
} else {
tmp = t_1 - t_2;
}
return tmp;
}
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (-4.0d0) * (x * i)
t_2 = (j * 27.0d0) * k
if (i <= (-9.2d+101)) then
tmp = t_1 + (j * (k * (-27.0d0)))
else if (i <= 2.02d+108) then
tmp = (b * c) - t_2
else
tmp = t_1 - t_2
end if
code = tmp
end function
assert y < z;
assert j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = -4.0 * (x * i);
double t_2 = (j * 27.0) * k;
double tmp;
if (i <= -9.2e+101) {
tmp = t_1 + (j * (k * -27.0));
} else if (i <= 2.02e+108) {
tmp = (b * c) - t_2;
} else {
tmp = t_1 - t_2;
}
return tmp;
}
[y, z] = sort([y, z]) [j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): t_1 = -4.0 * (x * i) t_2 = (j * 27.0) * k tmp = 0 if i <= -9.2e+101: tmp = t_1 + (j * (k * -27.0)) elif i <= 2.02e+108: tmp = (b * c) - t_2 else: tmp = t_1 - t_2 return tmp
y, z = sort([y, z]) j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(-4.0 * Float64(x * i)) t_2 = Float64(Float64(j * 27.0) * k) tmp = 0.0 if (i <= -9.2e+101) tmp = Float64(t_1 + Float64(j * Float64(k * -27.0))); elseif (i <= 2.02e+108) tmp = Float64(Float64(b * c) - t_2); else tmp = Float64(t_1 - t_2); end return tmp end
y, z = num2cell(sort([y, z])){:}
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
t_1 = -4.0 * (x * i);
t_2 = (j * 27.0) * k;
tmp = 0.0;
if (i <= -9.2e+101)
tmp = t_1 + (j * (k * -27.0));
elseif (i <= 2.02e+108)
tmp = (b * c) - t_2;
else
tmp = t_1 - t_2;
end
tmp_2 = tmp;
end
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(-4.0 * N[(x * i), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]}, If[LessEqual[i, -9.2e+101], N[(t$95$1 + N[(j * N[(k * -27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[i, 2.02e+108], N[(N[(b * c), $MachinePrecision] - t$95$2), $MachinePrecision], N[(t$95$1 - t$95$2), $MachinePrecision]]]]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
t_1 := -4 \cdot \left(x \cdot i\right)\\
t_2 := \left(j \cdot 27\right) \cdot k\\
\mathbf{if}\;i \leq -9.2 \cdot 10^{+101}:\\
\;\;\;\;t_1 + j \cdot \left(k \cdot -27\right)\\
\mathbf{elif}\;i \leq 2.02 \cdot 10^{+108}:\\
\;\;\;\;b \cdot c - t_2\\
\mathbf{else}:\\
\;\;\;\;t_1 - t_2\\
\end{array}
\end{array}
if i < -9.2000000000000005e101Initial program 90.5%
Taylor expanded in b around 0 87.9%
*-commutative87.9%
distribute-lft-out87.9%
*-commutative87.9%
*-commutative87.9%
Simplified87.9%
Taylor expanded in t around 0 72.4%
mul-1-neg72.4%
associate-*r*72.4%
*-commutative72.4%
associate-*r*72.4%
distribute-neg-in72.4%
distribute-lft-neg-in72.4%
metadata-eval72.4%
distribute-rgt-neg-in72.4%
*-commutative72.4%
distribute-rgt-neg-in72.4%
metadata-eval72.4%
Simplified72.4%
if -9.2000000000000005e101 < i < 2.02000000000000007e108Initial program 85.3%
Taylor expanded in x around 0 86.5%
Taylor expanded in b around inf 54.5%
if 2.02000000000000007e108 < i Initial program 80.4%
Taylor expanded in x around 0 84.3%
Taylor expanded in x around inf 65.3%
Taylor expanded in t around 0 59.6%
Final simplification57.7%
NOTE: y and z should be sorted in increasing order before calling this function. NOTE: j and k should be sorted in increasing order before calling this function. (FPCore (x y z t a b c i j k) :precision binary64 (if (<= (* b c) -8.2e+33) (* b c) (if (<= (* b c) 3e+53) (* (* j k) -27.0) (* b c))))
assert(y < z);
assert(j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double tmp;
if ((b * c) <= -8.2e+33) {
tmp = b * c;
} else if ((b * c) <= 3e+53) {
tmp = (j * k) * -27.0;
} else {
tmp = b * c;
}
return tmp;
}
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: tmp
if ((b * c) <= (-8.2d+33)) then
tmp = b * c
else if ((b * c) <= 3d+53) then
tmp = (j * k) * (-27.0d0)
else
tmp = b * c
end if
code = tmp
end function
assert y < z;
assert j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double tmp;
if ((b * c) <= -8.2e+33) {
tmp = b * c;
} else if ((b * c) <= 3e+53) {
tmp = (j * k) * -27.0;
} else {
tmp = b * c;
}
return tmp;
}
[y, z] = sort([y, z]) [j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): tmp = 0 if (b * c) <= -8.2e+33: tmp = b * c elif (b * c) <= 3e+53: tmp = (j * k) * -27.0 else: tmp = b * c return tmp
y, z = sort([y, z]) j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) tmp = 0.0 if (Float64(b * c) <= -8.2e+33) tmp = Float64(b * c); elseif (Float64(b * c) <= 3e+53) tmp = Float64(Float64(j * k) * -27.0); else tmp = Float64(b * c); end return tmp end
y, z = num2cell(sort([y, z])){:}
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
tmp = 0.0;
if ((b * c) <= -8.2e+33)
tmp = b * c;
elseif ((b * c) <= 3e+53)
tmp = (j * k) * -27.0;
else
tmp = b * c;
end
tmp_2 = tmp;
end
NOTE: y and z should be sorted in increasing order before calling this function. NOTE: j and k should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := If[LessEqual[N[(b * c), $MachinePrecision], -8.2e+33], N[(b * c), $MachinePrecision], If[LessEqual[N[(b * c), $MachinePrecision], 3e+53], N[(N[(j * k), $MachinePrecision] * -27.0), $MachinePrecision], N[(b * c), $MachinePrecision]]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
\mathbf{if}\;b \cdot c \leq -8.2 \cdot 10^{+33}:\\
\;\;\;\;b \cdot c\\
\mathbf{elif}\;b \cdot c \leq 3 \cdot 10^{+53}:\\
\;\;\;\;\left(j \cdot k\right) \cdot -27\\
\mathbf{else}:\\
\;\;\;\;b \cdot c\\
\end{array}
\end{array}
if (*.f64 b c) < -8.1999999999999999e33 or 2.99999999999999998e53 < (*.f64 b c) Initial program 81.6%
Simplified82.6%
Taylor expanded in b around inf 49.7%
if -8.1999999999999999e33 < (*.f64 b c) < 2.99999999999999998e53Initial program 87.6%
Simplified89.0%
Taylor expanded in j around inf 35.6%
Final simplification41.8%
NOTE: y and z should be sorted in increasing order before calling this function. NOTE: j and k should be sorted in increasing order before calling this function. (FPCore (x y z t a b c i j k) :precision binary64 (if (<= (* b c) -8.2e+33) (* b c) (if (<= (* b c) 5.4e+51) (* j (* k -27.0)) (* b c))))
assert(y < z);
assert(j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double tmp;
if ((b * c) <= -8.2e+33) {
tmp = b * c;
} else if ((b * c) <= 5.4e+51) {
tmp = j * (k * -27.0);
} else {
tmp = b * c;
}
return tmp;
}
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: tmp
if ((b * c) <= (-8.2d+33)) then
tmp = b * c
else if ((b * c) <= 5.4d+51) then
tmp = j * (k * (-27.0d0))
else
tmp = b * c
end if
code = tmp
end function
assert y < z;
assert j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double tmp;
if ((b * c) <= -8.2e+33) {
tmp = b * c;
} else if ((b * c) <= 5.4e+51) {
tmp = j * (k * -27.0);
} else {
tmp = b * c;
}
return tmp;
}
[y, z] = sort([y, z]) [j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): tmp = 0 if (b * c) <= -8.2e+33: tmp = b * c elif (b * c) <= 5.4e+51: tmp = j * (k * -27.0) else: tmp = b * c return tmp
y, z = sort([y, z]) j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) tmp = 0.0 if (Float64(b * c) <= -8.2e+33) tmp = Float64(b * c); elseif (Float64(b * c) <= 5.4e+51) tmp = Float64(j * Float64(k * -27.0)); else tmp = Float64(b * c); end return tmp end
y, z = num2cell(sort([y, z])){:}
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
tmp = 0.0;
if ((b * c) <= -8.2e+33)
tmp = b * c;
elseif ((b * c) <= 5.4e+51)
tmp = j * (k * -27.0);
else
tmp = b * c;
end
tmp_2 = tmp;
end
NOTE: y and z should be sorted in increasing order before calling this function. NOTE: j and k should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := If[LessEqual[N[(b * c), $MachinePrecision], -8.2e+33], N[(b * c), $MachinePrecision], If[LessEqual[N[(b * c), $MachinePrecision], 5.4e+51], N[(j * N[(k * -27.0), $MachinePrecision]), $MachinePrecision], N[(b * c), $MachinePrecision]]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
\mathbf{if}\;b \cdot c \leq -8.2 \cdot 10^{+33}:\\
\;\;\;\;b \cdot c\\
\mathbf{elif}\;b \cdot c \leq 5.4 \cdot 10^{+51}:\\
\;\;\;\;j \cdot \left(k \cdot -27\right)\\
\mathbf{else}:\\
\;\;\;\;b \cdot c\\
\end{array}
\end{array}
if (*.f64 b c) < -8.1999999999999999e33 or 5.39999999999999983e51 < (*.f64 b c) Initial program 81.6%
Simplified82.6%
Taylor expanded in b around inf 49.7%
if -8.1999999999999999e33 < (*.f64 b c) < 5.39999999999999983e51Initial program 87.6%
Taylor expanded in x around 0 89.0%
Taylor expanded in j around inf 35.6%
*-commutative35.6%
associate-*l*34.9%
Simplified34.9%
Final simplification41.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 (* b c))
assert(y < z);
assert(j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
return b * c;
}
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
code = b * c
end function
assert y < z;
assert j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
return b * c;
}
[y, z] = sort([y, z]) [j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): return b * c
y, z = sort([y, z]) j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) return Float64(b * c) end
y, z = num2cell(sort([y, z])){:}
j, k = num2cell(sort([j, k])){:}
function tmp = code(x, y, z, t, a, b, c, i, j, k)
tmp = b * c;
end
NOTE: y and z should be sorted in increasing order before calling this function. NOTE: j and k should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := N[(b * c), $MachinePrecision]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
[j, k] = \mathsf{sort}([j, k])\\
\\
b \cdot c
\end{array}
Initial program 84.9%
Simplified86.2%
Taylor expanded in b around inf 24.3%
Final simplification24.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 2023279
(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)))