
(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 25 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 (* (* j 27.0) k))
(t_2 (* x (- (* 18.0 (* z (* y t))) (* 4.0 i)))))
(if (<=
(-
(-
(+ (- (* (* (* (* x 18.0) y) z) t) (* t (* a 4.0))) (* b c))
(* (* x 4.0) i))
t_1)
INFINITY)
(- (- (+ (* b c) t_2) (* 4.0 (* t 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 = x * ((18.0 * (z * (y * t))) - (4.0 * i));
double tmp;
if (((((((((x * 18.0) * y) * z) * t) - (t * (a * 4.0))) + (b * c)) - ((x * 4.0) * i)) - t_1) <= ((double) INFINITY)) {
tmp = (((b * c) + t_2) - (4.0 * (t * a))) - t_1;
} else {
tmp = t_2;
}
return tmp;
}
assert y < z;
assert j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = (j * 27.0) * k;
double t_2 = x * ((18.0 * (z * (y * t))) - (4.0 * i));
double tmp;
if (((((((((x * 18.0) * y) * z) * t) - (t * (a * 4.0))) + (b * c)) - ((x * 4.0) * i)) - t_1) <= Double.POSITIVE_INFINITY) {
tmp = (((b * c) + t_2) - (4.0 * (t * 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 = x * ((18.0 * (z * (y * t))) - (4.0 * i)) tmp = 0 if ((((((((x * 18.0) * y) * z) * t) - (t * (a * 4.0))) + (b * c)) - ((x * 4.0) * i)) - t_1) <= math.inf: tmp = (((b * c) + t_2) - (4.0 * (t * 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(x * Float64(Float64(18.0 * Float64(z * Float64(y * t))) - Float64(4.0 * i))) tmp = 0.0 if (Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(x * 18.0) * y) * z) * t) - Float64(t * Float64(a * 4.0))) + Float64(b * c)) - Float64(Float64(x * 4.0) * i)) - t_1) <= Inf) tmp = Float64(Float64(Float64(Float64(b * c) + t_2) - Float64(4.0 * Float64(t * 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 = x * ((18.0 * (z * (y * t))) - (4.0 * i));
tmp = 0.0;
if (((((((((x * 18.0) * y) * z) * t) - (t * (a * 4.0))) + (b * c)) - ((x * 4.0) * i)) - t_1) <= Inf)
tmp = (((b * c) + t_2) - (4.0 * (t * 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[(x * N[(N[(18.0 * N[(z * N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(4.0 * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(N[(N[(N[(N[(N[(N[(N[(x * 18.0), $MachinePrecision] * y), $MachinePrecision] * z), $MachinePrecision] * t), $MachinePrecision] - N[(t * N[(a * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(b * c), $MachinePrecision]), $MachinePrecision] - N[(N[(x * 4.0), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], Infinity], N[(N[(N[(N[(b * c), $MachinePrecision] + t$95$2), $MachinePrecision] - N[(4.0 * N[(t * a), $MachinePrecision]), $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 := x \cdot \left(18 \cdot \left(z \cdot \left(y \cdot t\right)\right) - 4 \cdot i\right)\\
\mathbf{if}\;\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - t \cdot \left(a \cdot 4\right)\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - t_1 \leq \infty:\\
\;\;\;\;\left(\left(b \cdot c + t_2\right) - 4 \cdot \left(t \cdot a\right)\right) - t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if (-.f64 (-.f64 (+.f64 (-.f64 (*.f64 (*.f64 (*.f64 (*.f64 x 18) y) z) t) (*.f64 (*.f64 a 4) t)) (*.f64 b c)) (*.f64 (*.f64 x 4) i)) (*.f64 (*.f64 j 27) k)) < +inf.0Initial program 94.8%
Taylor expanded in x around 0 95.6%
pow195.6%
Applied egg-rr95.6%
unpow195.6%
associate-*r*95.5%
Simplified95.5%
if +inf.0 < (-.f64 (-.f64 (+.f64 (-.f64 (*.f64 (*.f64 (*.f64 (*.f64 x 18) y) z) t) (*.f64 (*.f64 a 4) t)) (*.f64 b c)) (*.f64 (*.f64 x 4) i)) (*.f64 (*.f64 j 27) k)) Initial program 0.0%
Simplified20.0%
Taylor expanded in x around inf 60.2%
pow126.7%
Applied egg-rr60.2%
unpow126.7%
associate-*r*26.7%
Simplified60.2%
Final simplification91.4%
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (* (* j 27.0) k)))
(if (<= t_1 4e+307)
(-
(-
(+ (* b c) (* x (- (* 18.0 (* t (* y z))) (* 4.0 i))))
(* 4.0 (* t a)))
t_1)
(* j (* k -27.0)))))assert(y < z);
assert(j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = (j * 27.0) * k;
double tmp;
if (t_1 <= 4e+307) {
tmp = (((b * c) + (x * ((18.0 * (t * (y * z))) - (4.0 * i)))) - (4.0 * (t * a))) - t_1;
} else {
tmp = j * (k * -27.0);
}
return tmp;
}
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: tmp
t_1 = (j * 27.0d0) * k
if (t_1 <= 4d+307) then
tmp = (((b * c) + (x * ((18.0d0 * (t * (y * z))) - (4.0d0 * i)))) - (4.0d0 * (t * a))) - t_1
else
tmp = j * (k * (-27.0d0))
end if
code = tmp
end function
assert y < z;
assert j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = (j * 27.0) * k;
double tmp;
if (t_1 <= 4e+307) {
tmp = (((b * c) + (x * ((18.0 * (t * (y * z))) - (4.0 * i)))) - (4.0 * (t * a))) - t_1;
} else {
tmp = j * (k * -27.0);
}
return tmp;
}
[y, z] = sort([y, z]) [j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): t_1 = (j * 27.0) * k tmp = 0 if t_1 <= 4e+307: tmp = (((b * c) + (x * ((18.0 * (t * (y * z))) - (4.0 * i)))) - (4.0 * (t * a))) - t_1 else: tmp = j * (k * -27.0) return tmp
y, z = sort([y, z]) j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(Float64(j * 27.0) * k) tmp = 0.0 if (t_1 <= 4e+307) tmp = Float64(Float64(Float64(Float64(b * c) + Float64(x * Float64(Float64(18.0 * Float64(t * Float64(y * z))) - Float64(4.0 * i)))) - Float64(4.0 * Float64(t * a))) - t_1); else tmp = Float64(j * Float64(k * -27.0)); end return tmp end
y, z = num2cell(sort([y, z])){:}
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
t_1 = (j * 27.0) * k;
tmp = 0.0;
if (t_1 <= 4e+307)
tmp = (((b * c) + (x * ((18.0 * (t * (y * z))) - (4.0 * i)))) - (4.0 * (t * a))) - t_1;
else
tmp = j * (k * -27.0);
end
tmp_2 = tmp;
end
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]}, If[LessEqual[t$95$1, 4e+307], N[(N[(N[(N[(b * c), $MachinePrecision] + N[(x * N[(N[(18.0 * N[(t * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(4.0 * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(4.0 * N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], N[(j * N[(k * -27.0), $MachinePrecision]), $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 4 \cdot 10^{+307}:\\
\;\;\;\;\left(\left(b \cdot c + x \cdot \left(18 \cdot \left(t \cdot \left(y \cdot z\right)\right) - 4 \cdot i\right)\right) - 4 \cdot \left(t \cdot a\right)\right) - t_1\\
\mathbf{else}:\\
\;\;\;\;j \cdot \left(k \cdot -27\right)\\
\end{array}
\end{array}
if (*.f64 (*.f64 j 27) k) < 3.99999999999999994e307Initial program 85.8%
Taylor expanded in x around 0 89.0%
if 3.99999999999999994e307 < (*.f64 (*.f64 j 27) k) Initial program 41.7%
Simplified50.0%
Taylor expanded in j around inf 91.7%
*-commutative91.7%
associate-*l*91.7%
Simplified91.7%
Final simplification89.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 1.55e+90)
(-
(+ (* b c) (* t (- (* (* x 18.0) (* y z)) (* a 4.0))))
(+ (* x (* 4.0 i)) (* j (* 27.0 k))))
(-
(+ (* b c) (* x (- (* 18.0 (* y (* z t))) (* 4.0 i))))
(* 27.0 (* j k)))))assert(y < z);
assert(j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double tmp;
if (x <= 1.55e+90) {
tmp = ((b * c) + (t * (((x * 18.0) * (y * z)) - (a * 4.0)))) - ((x * (4.0 * i)) + (j * (27.0 * k)));
} else {
tmp = ((b * c) + (x * ((18.0 * (y * (z * t))) - (4.0 * i)))) - (27.0 * (j * k));
}
return tmp;
}
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: tmp
if (x <= 1.55d+90) then
tmp = ((b * c) + (t * (((x * 18.0d0) * (y * z)) - (a * 4.0d0)))) - ((x * (4.0d0 * i)) + (j * (27.0d0 * k)))
else
tmp = ((b * c) + (x * ((18.0d0 * (y * (z * t))) - (4.0d0 * i)))) - (27.0d0 * (j * k))
end if
code = tmp
end function
assert y < z;
assert j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double tmp;
if (x <= 1.55e+90) {
tmp = ((b * c) + (t * (((x * 18.0) * (y * z)) - (a * 4.0)))) - ((x * (4.0 * i)) + (j * (27.0 * k)));
} else {
tmp = ((b * c) + (x * ((18.0 * (y * (z * t))) - (4.0 * i)))) - (27.0 * (j * k));
}
return tmp;
}
[y, z] = sort([y, z]) [j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): tmp = 0 if x <= 1.55e+90: tmp = ((b * c) + (t * (((x * 18.0) * (y * z)) - (a * 4.0)))) - ((x * (4.0 * i)) + (j * (27.0 * k))) else: tmp = ((b * c) + (x * ((18.0 * (y * (z * t))) - (4.0 * i)))) - (27.0 * (j * k)) return tmp
y, z = sort([y, z]) j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) tmp = 0.0 if (x <= 1.55e+90) tmp = Float64(Float64(Float64(b * c) + Float64(t * Float64(Float64(Float64(x * 18.0) * Float64(y * z)) - Float64(a * 4.0)))) - Float64(Float64(x * Float64(4.0 * i)) + Float64(j * Float64(27.0 * k)))); else tmp = Float64(Float64(Float64(b * c) + Float64(x * Float64(Float64(18.0 * Float64(y * Float64(z * t))) - Float64(4.0 * i)))) - Float64(27.0 * Float64(j * k))); end return tmp end
y, z = num2cell(sort([y, z])){:}
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
tmp = 0.0;
if (x <= 1.55e+90)
tmp = ((b * c) + (t * (((x * 18.0) * (y * z)) - (a * 4.0)))) - ((x * (4.0 * i)) + (j * (27.0 * k)));
else
tmp = ((b * c) + (x * ((18.0 * (y * (z * t))) - (4.0 * i)))) - (27.0 * (j * k));
end
tmp_2 = tmp;
end
NOTE: y and z should be sorted in increasing order before calling this function. NOTE: j and k should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := If[LessEqual[x, 1.55e+90], N[(N[(N[(b * c), $MachinePrecision] + N[(t * N[(N[(N[(x * 18.0), $MachinePrecision] * N[(y * z), $MachinePrecision]), $MachinePrecision] - N[(a * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(x * N[(4.0 * i), $MachinePrecision]), $MachinePrecision] + N[(j * N[(27.0 * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(b * c), $MachinePrecision] + N[(x * N[(N[(18.0 * N[(y * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(4.0 * i), $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}\;x \leq 1.55 \cdot 10^{+90}:\\
\;\;\;\;\left(b \cdot c + t \cdot \left(\left(x \cdot 18\right) \cdot \left(y \cdot z\right) - a \cdot 4\right)\right) - \left(x \cdot \left(4 \cdot i\right) + j \cdot \left(27 \cdot k\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(b \cdot c + x \cdot \left(18 \cdot \left(y \cdot \left(z \cdot t\right)\right) - 4 \cdot i\right)\right) - 27 \cdot \left(j \cdot k\right)\\
\end{array}
\end{array}
if x < 1.54999999999999994e90Initial program 84.8%
Simplified86.7%
if 1.54999999999999994e90 < x Initial program 78.0%
Taylor expanded in x around 0 94.9%
Taylor expanded in a around 0 97.4%
expm1-log1p-u79.8%
expm1-udef74.5%
Applied egg-rr74.5%
expm1-def79.8%
expm1-log1p97.4%
*-commutative97.4%
associate-*r*99.9%
Simplified99.9%
Final simplification88.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 (* (* j 27.0) k)))
(if (<= t -1.02e-50)
(- (* t (- (* a (- 4.0)) (* (* x (* y z)) -18.0))) t_1)
(if (<= t 520000.0)
(- (- (* b c) (* 4.0 (* x i))) t_1)
(if (<= t 1.85e+49)
(- (* b c) (* (* t -18.0) (* z (* x y))))
(if (or (<= t 7.8e+69) (not (<= t 2e+129)))
(- (- (* b c) (* 4.0 (* t a))) t_1)
(-
(* x (- (* 18.0 (* t (* y z))) (* 4.0 i)))
(* 27.0 (* j k)))))))))assert(y < z);
assert(j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = (j * 27.0) * k;
double tmp;
if (t <= -1.02e-50) {
tmp = (t * ((a * -4.0) - ((x * (y * z)) * -18.0))) - t_1;
} else if (t <= 520000.0) {
tmp = ((b * c) - (4.0 * (x * i))) - t_1;
} else if (t <= 1.85e+49) {
tmp = (b * c) - ((t * -18.0) * (z * (x * y)));
} else if ((t <= 7.8e+69) || !(t <= 2e+129)) {
tmp = ((b * c) - (4.0 * (t * a))) - t_1;
} else {
tmp = (x * ((18.0 * (t * (y * z))) - (4.0 * i))) - (27.0 * (j * k));
}
return tmp;
}
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: tmp
t_1 = (j * 27.0d0) * k
if (t <= (-1.02d-50)) then
tmp = (t * ((a * -4.0d0) - ((x * (y * z)) * (-18.0d0)))) - t_1
else if (t <= 520000.0d0) then
tmp = ((b * c) - (4.0d0 * (x * i))) - t_1
else if (t <= 1.85d+49) then
tmp = (b * c) - ((t * (-18.0d0)) * (z * (x * y)))
else if ((t <= 7.8d+69) .or. (.not. (t <= 2d+129))) then
tmp = ((b * c) - (4.0d0 * (t * a))) - t_1
else
tmp = (x * ((18.0d0 * (t * (y * z))) - (4.0d0 * i))) - (27.0d0 * (j * k))
end if
code = tmp
end function
assert y < z;
assert j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = (j * 27.0) * k;
double tmp;
if (t <= -1.02e-50) {
tmp = (t * ((a * -4.0) - ((x * (y * z)) * -18.0))) - t_1;
} else if (t <= 520000.0) {
tmp = ((b * c) - (4.0 * (x * i))) - t_1;
} else if (t <= 1.85e+49) {
tmp = (b * c) - ((t * -18.0) * (z * (x * y)));
} else if ((t <= 7.8e+69) || !(t <= 2e+129)) {
tmp = ((b * c) - (4.0 * (t * a))) - t_1;
} else {
tmp = (x * ((18.0 * (t * (y * z))) - (4.0 * i))) - (27.0 * (j * k));
}
return tmp;
}
[y, z] = sort([y, z]) [j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): t_1 = (j * 27.0) * k tmp = 0 if t <= -1.02e-50: tmp = (t * ((a * -4.0) - ((x * (y * z)) * -18.0))) - t_1 elif t <= 520000.0: tmp = ((b * c) - (4.0 * (x * i))) - t_1 elif t <= 1.85e+49: tmp = (b * c) - ((t * -18.0) * (z * (x * y))) elif (t <= 7.8e+69) or not (t <= 2e+129): tmp = ((b * c) - (4.0 * (t * a))) - t_1 else: tmp = (x * ((18.0 * (t * (y * z))) - (4.0 * i))) - (27.0 * (j * k)) return tmp
y, z = sort([y, z]) j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(Float64(j * 27.0) * k) tmp = 0.0 if (t <= -1.02e-50) tmp = Float64(Float64(t * Float64(Float64(a * Float64(-4.0)) - Float64(Float64(x * Float64(y * z)) * -18.0))) - t_1); elseif (t <= 520000.0) tmp = Float64(Float64(Float64(b * c) - Float64(4.0 * Float64(x * i))) - t_1); elseif (t <= 1.85e+49) tmp = Float64(Float64(b * c) - Float64(Float64(t * -18.0) * Float64(z * Float64(x * y)))); elseif ((t <= 7.8e+69) || !(t <= 2e+129)) tmp = Float64(Float64(Float64(b * c) - Float64(4.0 * Float64(t * a))) - t_1); else tmp = Float64(Float64(x * Float64(Float64(18.0 * Float64(t * Float64(y * z))) - Float64(4.0 * i))) - Float64(27.0 * Float64(j * k))); end return tmp end
y, z = num2cell(sort([y, z])){:}
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
t_1 = (j * 27.0) * k;
tmp = 0.0;
if (t <= -1.02e-50)
tmp = (t * ((a * -4.0) - ((x * (y * z)) * -18.0))) - t_1;
elseif (t <= 520000.0)
tmp = ((b * c) - (4.0 * (x * i))) - t_1;
elseif (t <= 1.85e+49)
tmp = (b * c) - ((t * -18.0) * (z * (x * y)));
elseif ((t <= 7.8e+69) || ~((t <= 2e+129)))
tmp = ((b * c) - (4.0 * (t * a))) - t_1;
else
tmp = (x * ((18.0 * (t * (y * z))) - (4.0 * i))) - (27.0 * (j * k));
end
tmp_2 = tmp;
end
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]}, If[LessEqual[t, -1.02e-50], N[(N[(t * N[(N[(a * (-4.0)), $MachinePrecision] - N[(N[(x * N[(y * z), $MachinePrecision]), $MachinePrecision] * -18.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], If[LessEqual[t, 520000.0], N[(N[(N[(b * c), $MachinePrecision] - N[(4.0 * N[(x * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], If[LessEqual[t, 1.85e+49], N[(N[(b * c), $MachinePrecision] - N[(N[(t * -18.0), $MachinePrecision] * N[(z * N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[t, 7.8e+69], N[Not[LessEqual[t, 2e+129]], $MachinePrecision]], N[(N[(N[(b * c), $MachinePrecision] - N[(4.0 * N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], N[(N[(x * N[(N[(18.0 * N[(t * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(4.0 * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
t_1 := \left(j \cdot 27\right) \cdot k\\
\mathbf{if}\;t \leq -1.02 \cdot 10^{-50}:\\
\;\;\;\;t \cdot \left(a \cdot \left(-4\right) - \left(x \cdot \left(y \cdot z\right)\right) \cdot -18\right) - t_1\\
\mathbf{elif}\;t \leq 520000:\\
\;\;\;\;\left(b \cdot c - 4 \cdot \left(x \cdot i\right)\right) - t_1\\
\mathbf{elif}\;t \leq 1.85 \cdot 10^{+49}:\\
\;\;\;\;b \cdot c - \left(t \cdot -18\right) \cdot \left(z \cdot \left(x \cdot y\right)\right)\\
\mathbf{elif}\;t \leq 7.8 \cdot 10^{+69} \lor \neg \left(t \leq 2 \cdot 10^{+129}\right):\\
\;\;\;\;\left(b \cdot c - 4 \cdot \left(t \cdot a\right)\right) - t_1\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(18 \cdot \left(t \cdot \left(y \cdot z\right)\right) - 4 \cdot i\right) - 27 \cdot \left(j \cdot k\right)\\
\end{array}
\end{array}
if t < -1.0199999999999999e-50Initial program 85.3%
Taylor expanded in t around -inf 81.5%
associate-*r*81.5%
neg-mul-181.5%
cancel-sign-sub-inv81.5%
*-commutative81.5%
metadata-eval81.5%
Simplified81.5%
if -1.0199999999999999e-50 < t < 5.2e5Initial program 85.7%
Taylor expanded in t around 0 78.2%
if 5.2e5 < t < 1.85000000000000009e49Initial program 83.1%
Simplified67.3%
Taylor expanded in x around inf 67.3%
*-commutative67.3%
associate-*r*67.3%
associate-*r*82.8%
associate-*l*83.3%
Simplified83.3%
Taylor expanded in x around inf 83.3%
associate-*r*83.3%
*-commutative83.3%
Simplified83.3%
Taylor expanded in x around -inf 84.0%
+-commutative84.0%
mul-1-neg84.0%
unsub-neg84.0%
cancel-sign-sub-inv84.0%
associate-*r*84.0%
metadata-eval84.0%
fma-def84.0%
*-commutative84.0%
Simplified84.0%
Taylor expanded in t around inf 84.0%
associate-*r*83.7%
*-commutative83.7%
associate-*r*100.0%
Simplified100.0%
if 1.85000000000000009e49 < t < 7.7999999999999998e69 or 2e129 < t Initial program 75.0%
Taylor expanded in x around 0 78.7%
if 7.7999999999999998e69 < t < 2e129Initial program 81.2%
Taylor expanded in x around 0 87.4%
Taylor expanded in a around 0 93.7%
Taylor expanded in b around 0 82.5%
Final simplification80.1%
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (* (* j 27.0) k))
(t_2 (- (* x (- (* 18.0 (* t (* y z))) (* 4.0 i))) (* 27.0 (* j k)))))
(if (<= x -6e-89)
t_2
(if (<= x 1e-157)
(- (- (* b c) (* 4.0 (* t a))) t_1)
(if (<= x 2e-55)
(- (- (* b c) (* 4.0 (* x i))) t_1)
(if (<= x 42000000.0)
(* t (- (* 18.0 (* x (* y z))) (* a 4.0)))
t_2))))))assert(y < z);
assert(j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = (j * 27.0) * k;
double t_2 = (x * ((18.0 * (t * (y * z))) - (4.0 * i))) - (27.0 * (j * k));
double tmp;
if (x <= -6e-89) {
tmp = t_2;
} else if (x <= 1e-157) {
tmp = ((b * c) - (4.0 * (t * a))) - t_1;
} else if (x <= 2e-55) {
tmp = ((b * c) - (4.0 * (x * i))) - t_1;
} else if (x <= 42000000.0) {
tmp = t * ((18.0 * (x * (y * z))) - (a * 4.0));
} else {
tmp = t_2;
}
return tmp;
}
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (j * 27.0d0) * k
t_2 = (x * ((18.0d0 * (t * (y * z))) - (4.0d0 * i))) - (27.0d0 * (j * k))
if (x <= (-6d-89)) then
tmp = t_2
else if (x <= 1d-157) then
tmp = ((b * c) - (4.0d0 * (t * a))) - t_1
else if (x <= 2d-55) then
tmp = ((b * c) - (4.0d0 * (x * i))) - t_1
else if (x <= 42000000.0d0) then
tmp = t * ((18.0d0 * (x * (y * z))) - (a * 4.0d0))
else
tmp = t_2
end if
code = tmp
end function
assert y < z;
assert j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = (j * 27.0) * k;
double t_2 = (x * ((18.0 * (t * (y * z))) - (4.0 * i))) - (27.0 * (j * k));
double tmp;
if (x <= -6e-89) {
tmp = t_2;
} else if (x <= 1e-157) {
tmp = ((b * c) - (4.0 * (t * a))) - t_1;
} else if (x <= 2e-55) {
tmp = ((b * c) - (4.0 * (x * i))) - t_1;
} else if (x <= 42000000.0) {
tmp = t * ((18.0 * (x * (y * z))) - (a * 4.0));
} else {
tmp = t_2;
}
return tmp;
}
[y, z] = sort([y, z]) [j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): t_1 = (j * 27.0) * k t_2 = (x * ((18.0 * (t * (y * z))) - (4.0 * i))) - (27.0 * (j * k)) tmp = 0 if x <= -6e-89: tmp = t_2 elif x <= 1e-157: tmp = ((b * c) - (4.0 * (t * a))) - t_1 elif x <= 2e-55: tmp = ((b * c) - (4.0 * (x * i))) - t_1 elif x <= 42000000.0: tmp = t * ((18.0 * (x * (y * z))) - (a * 4.0)) else: tmp = t_2 return tmp
y, z = sort([y, z]) j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(Float64(j * 27.0) * k) t_2 = Float64(Float64(x * Float64(Float64(18.0 * Float64(t * Float64(y * z))) - Float64(4.0 * i))) - Float64(27.0 * Float64(j * k))) tmp = 0.0 if (x <= -6e-89) tmp = t_2; elseif (x <= 1e-157) tmp = Float64(Float64(Float64(b * c) - Float64(4.0 * Float64(t * a))) - t_1); elseif (x <= 2e-55) tmp = Float64(Float64(Float64(b * c) - Float64(4.0 * Float64(x * i))) - t_1); elseif (x <= 42000000.0) tmp = Float64(t * Float64(Float64(18.0 * Float64(x * Float64(y * z))) - Float64(a * 4.0))); else tmp = t_2; end return tmp end
y, z = num2cell(sort([y, z])){:}
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
t_1 = (j * 27.0) * k;
t_2 = (x * ((18.0 * (t * (y * z))) - (4.0 * i))) - (27.0 * (j * k));
tmp = 0.0;
if (x <= -6e-89)
tmp = t_2;
elseif (x <= 1e-157)
tmp = ((b * c) - (4.0 * (t * a))) - t_1;
elseif (x <= 2e-55)
tmp = ((b * c) - (4.0 * (x * i))) - t_1;
elseif (x <= 42000000.0)
tmp = t * ((18.0 * (x * (y * z))) - (a * 4.0));
else
tmp = t_2;
end
tmp_2 = tmp;
end
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x * N[(N[(18.0 * N[(t * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(4.0 * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -6e-89], t$95$2, If[LessEqual[x, 1e-157], N[(N[(N[(b * c), $MachinePrecision] - N[(4.0 * N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], If[LessEqual[x, 2e-55], N[(N[(N[(b * c), $MachinePrecision] - N[(4.0 * N[(x * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], If[LessEqual[x, 42000000.0], N[(t * N[(N[(18.0 * N[(x * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(a * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$2]]]]]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
t_1 := \left(j \cdot 27\right) \cdot k\\
t_2 := x \cdot \left(18 \cdot \left(t \cdot \left(y \cdot z\right)\right) - 4 \cdot i\right) - 27 \cdot \left(j \cdot k\right)\\
\mathbf{if}\;x \leq -6 \cdot 10^{-89}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x \leq 10^{-157}:\\
\;\;\;\;\left(b \cdot c - 4 \cdot \left(t \cdot a\right)\right) - t_1\\
\mathbf{elif}\;x \leq 2 \cdot 10^{-55}:\\
\;\;\;\;\left(b \cdot c - 4 \cdot \left(x \cdot i\right)\right) - t_1\\
\mathbf{elif}\;x \leq 42000000:\\
\;\;\;\;t \cdot \left(18 \cdot \left(x \cdot \left(y \cdot z\right)\right) - a \cdot 4\right)\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if x < -5.9999999999999999e-89 or 4.2e7 < x Initial program 76.5%
Taylor expanded in x around 0 86.2%
Taylor expanded in a around 0 80.7%
Taylor expanded in b around 0 72.0%
if -5.9999999999999999e-89 < x < 9.99999999999999943e-158Initial program 93.8%
Taylor expanded in x around 0 85.9%
if 9.99999999999999943e-158 < x < 1.99999999999999999e-55Initial program 100.0%
Taylor expanded in t around 0 78.8%
if 1.99999999999999999e-55 < x < 4.2e7Initial program 85.0%
Taylor expanded in x around 0 85.0%
Taylor expanded in t around inf 85.9%
Final simplification77.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 (- (* x (- (* 18.0 (* t (* y z))) (* 4.0 i))) (* 27.0 (* j k)))))
(if (<= x -1.2e-88)
t_1
(if (<= x 1e-157)
(- (- (* b c) (* 4.0 (* t a))) (* (* j 27.0) k))
(if (<= x 2.7e-53)
(- (+ (* b c) (* t (* (* x y) (* 18.0 z)))) (* x (* 4.0 i)))
(if (<= x 112000000000.0)
(* t (- (* 18.0 (* x (* y z))) (* a 4.0)))
t_1))))))assert(y < z);
assert(j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = (x * ((18.0 * (t * (y * z))) - (4.0 * i))) - (27.0 * (j * k));
double tmp;
if (x <= -1.2e-88) {
tmp = t_1;
} else if (x <= 1e-157) {
tmp = ((b * c) - (4.0 * (t * a))) - ((j * 27.0) * k);
} else if (x <= 2.7e-53) {
tmp = ((b * c) + (t * ((x * y) * (18.0 * z)))) - (x * (4.0 * i));
} else if (x <= 112000000000.0) {
tmp = t * ((18.0 * (x * (y * z))) - (a * 4.0));
} else {
tmp = t_1;
}
return tmp;
}
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: tmp
t_1 = (x * ((18.0d0 * (t * (y * z))) - (4.0d0 * i))) - (27.0d0 * (j * k))
if (x <= (-1.2d-88)) then
tmp = t_1
else if (x <= 1d-157) then
tmp = ((b * c) - (4.0d0 * (t * a))) - ((j * 27.0d0) * k)
else if (x <= 2.7d-53) then
tmp = ((b * c) + (t * ((x * y) * (18.0d0 * z)))) - (x * (4.0d0 * i))
else if (x <= 112000000000.0d0) then
tmp = t * ((18.0d0 * (x * (y * z))) - (a * 4.0d0))
else
tmp = t_1
end if
code = tmp
end function
assert y < z;
assert j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = (x * ((18.0 * (t * (y * z))) - (4.0 * i))) - (27.0 * (j * k));
double tmp;
if (x <= -1.2e-88) {
tmp = t_1;
} else if (x <= 1e-157) {
tmp = ((b * c) - (4.0 * (t * a))) - ((j * 27.0) * k);
} else if (x <= 2.7e-53) {
tmp = ((b * c) + (t * ((x * y) * (18.0 * z)))) - (x * (4.0 * i));
} else if (x <= 112000000000.0) {
tmp = t * ((18.0 * (x * (y * z))) - (a * 4.0));
} else {
tmp = t_1;
}
return tmp;
}
[y, z] = sort([y, z]) [j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): t_1 = (x * ((18.0 * (t * (y * z))) - (4.0 * i))) - (27.0 * (j * k)) tmp = 0 if x <= -1.2e-88: tmp = t_1 elif x <= 1e-157: tmp = ((b * c) - (4.0 * (t * a))) - ((j * 27.0) * k) elif x <= 2.7e-53: tmp = ((b * c) + (t * ((x * y) * (18.0 * z)))) - (x * (4.0 * i)) elif x <= 112000000000.0: tmp = t * ((18.0 * (x * (y * z))) - (a * 4.0)) else: tmp = t_1 return tmp
y, z = sort([y, z]) j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(Float64(x * Float64(Float64(18.0 * Float64(t * Float64(y * z))) - Float64(4.0 * i))) - Float64(27.0 * Float64(j * k))) tmp = 0.0 if (x <= -1.2e-88) tmp = t_1; elseif (x <= 1e-157) tmp = Float64(Float64(Float64(b * c) - Float64(4.0 * Float64(t * a))) - Float64(Float64(j * 27.0) * k)); elseif (x <= 2.7e-53) tmp = Float64(Float64(Float64(b * c) + Float64(t * Float64(Float64(x * y) * Float64(18.0 * z)))) - Float64(x * Float64(4.0 * i))); elseif (x <= 112000000000.0) tmp = Float64(t * Float64(Float64(18.0 * Float64(x * Float64(y * z))) - Float64(a * 4.0))); else tmp = t_1; end return tmp end
y, z = num2cell(sort([y, z])){:}
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
t_1 = (x * ((18.0 * (t * (y * z))) - (4.0 * i))) - (27.0 * (j * k));
tmp = 0.0;
if (x <= -1.2e-88)
tmp = t_1;
elseif (x <= 1e-157)
tmp = ((b * c) - (4.0 * (t * a))) - ((j * 27.0) * k);
elseif (x <= 2.7e-53)
tmp = ((b * c) + (t * ((x * y) * (18.0 * z)))) - (x * (4.0 * i));
elseif (x <= 112000000000.0)
tmp = t * ((18.0 * (x * (y * z))) - (a * 4.0));
else
tmp = t_1;
end
tmp_2 = tmp;
end
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(N[(x * N[(N[(18.0 * N[(t * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(4.0 * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.2e-88], t$95$1, If[LessEqual[x, 1e-157], N[(N[(N[(b * c), $MachinePrecision] - N[(4.0 * N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 2.7e-53], N[(N[(N[(b * c), $MachinePrecision] + N[(t * N[(N[(x * y), $MachinePrecision] * N[(18.0 * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x * N[(4.0 * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 112000000000.0], N[(t * N[(N[(18.0 * N[(x * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(a * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
t_1 := x \cdot \left(18 \cdot \left(t \cdot \left(y \cdot z\right)\right) - 4 \cdot i\right) - 27 \cdot \left(j \cdot k\right)\\
\mathbf{if}\;x \leq -1.2 \cdot 10^{-88}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 10^{-157}:\\
\;\;\;\;\left(b \cdot c - 4 \cdot \left(t \cdot a\right)\right) - \left(j \cdot 27\right) \cdot k\\
\mathbf{elif}\;x \leq 2.7 \cdot 10^{-53}:\\
\;\;\;\;\left(b \cdot c + t \cdot \left(\left(x \cdot y\right) \cdot \left(18 \cdot z\right)\right)\right) - x \cdot \left(4 \cdot i\right)\\
\mathbf{elif}\;x \leq 112000000000:\\
\;\;\;\;t \cdot \left(18 \cdot \left(x \cdot \left(y \cdot z\right)\right) - a \cdot 4\right)\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if x < -1.2e-88 or 1.12e11 < x Initial program 76.0%
Taylor expanded in x around 0 85.9%
Taylor expanded in a around 0 81.0%
Taylor expanded in b around 0 72.7%
if -1.2e-88 < x < 9.99999999999999943e-158Initial program 93.8%
Taylor expanded in x around 0 85.9%
if 9.99999999999999943e-158 < x < 2.6999999999999999e-53Initial program 100.0%
Simplified100.0%
Taylor expanded in x around inf 93.4%
*-commutative93.4%
associate-*r*93.4%
associate-*r*93.4%
associate-*l*93.3%
Simplified93.3%
Taylor expanded in x around inf 80.9%
associate-*r*80.9%
*-commutative80.9%
Simplified80.9%
if 2.6999999999999999e-53 < x < 1.12e11Initial program 89.4%
Taylor expanded in x around 0 89.4%
Taylor expanded in t around inf 70.7%
Final simplification77.4%
NOTE: y and z should be sorted in increasing order before calling this function. NOTE: j and k should be sorted in increasing order before calling this function. (FPCore (x y z t a b c i j k) :precision binary64 (if (or (<= t -4.2e-86) (not (<= t 260000.0))) (- (+ (* b c) (* t (- (* 18.0 (* x (* y z))) (* a 4.0)))) (* 27.0 (* j k))) (- (- (* b c) (* 4.0 (* x i))) (* (* j 27.0) k))))
assert(y < z);
assert(j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double tmp;
if ((t <= -4.2e-86) || !(t <= 260000.0)) {
tmp = ((b * c) + (t * ((18.0 * (x * (y * z))) - (a * 4.0)))) - (27.0 * (j * k));
} else {
tmp = ((b * c) - (4.0 * (x * i))) - ((j * 27.0) * k);
}
return tmp;
}
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: tmp
if ((t <= (-4.2d-86)) .or. (.not. (t <= 260000.0d0))) then
tmp = ((b * c) + (t * ((18.0d0 * (x * (y * z))) - (a * 4.0d0)))) - (27.0d0 * (j * k))
else
tmp = ((b * c) - (4.0d0 * (x * i))) - ((j * 27.0d0) * k)
end if
code = tmp
end function
assert y < z;
assert j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double tmp;
if ((t <= -4.2e-86) || !(t <= 260000.0)) {
tmp = ((b * c) + (t * ((18.0 * (x * (y * z))) - (a * 4.0)))) - (27.0 * (j * k));
} else {
tmp = ((b * c) - (4.0 * (x * i))) - ((j * 27.0) * k);
}
return tmp;
}
[y, z] = sort([y, z]) [j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): tmp = 0 if (t <= -4.2e-86) or not (t <= 260000.0): tmp = ((b * c) + (t * ((18.0 * (x * (y * z))) - (a * 4.0)))) - (27.0 * (j * k)) else: tmp = ((b * c) - (4.0 * (x * i))) - ((j * 27.0) * k) return tmp
y, z = sort([y, z]) j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) tmp = 0.0 if ((t <= -4.2e-86) || !(t <= 260000.0)) 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))); else tmp = Float64(Float64(Float64(b * c) - Float64(4.0 * Float64(x * i))) - Float64(Float64(j * 27.0) * k)); end return tmp end
y, z = num2cell(sort([y, z])){:}
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
tmp = 0.0;
if ((t <= -4.2e-86) || ~((t <= 260000.0)))
tmp = ((b * c) + (t * ((18.0 * (x * (y * z))) - (a * 4.0)))) - (27.0 * (j * k));
else
tmp = ((b * c) - (4.0 * (x * i))) - ((j * 27.0) * k);
end
tmp_2 = tmp;
end
NOTE: y and z should be sorted in increasing order before calling this function. NOTE: j and k should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := If[Or[LessEqual[t, -4.2e-86], N[Not[LessEqual[t, 260000.0]], $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], N[(N[(N[(b * c), $MachinePrecision] - N[(4.0 * N[(x * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -4.2 \cdot 10^{-86} \lor \neg \left(t \leq 260000\right):\\
\;\;\;\;\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)\\
\mathbf{else}:\\
\;\;\;\;\left(b \cdot c - 4 \cdot \left(x \cdot i\right)\right) - \left(j \cdot 27\right) \cdot k\\
\end{array}
\end{array}
if t < -4.2e-86 or 2.6e5 < t Initial program 83.0%
Simplified86.4%
Taylor expanded in i around 0 82.0%
if -4.2e-86 < t < 2.6e5Initial program 84.7%
Taylor expanded in t around 0 79.2%
Final simplification80.8%
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (* 27.0 (* j k))))
(if (<= t -2.2e-27)
(- (+ (* b c) (* t (- (* 18.0 (* x (* y z))) (* a 4.0)))) t_1)
(if (<= t 1.35e+129)
(- (+ (* b c) (* x (- (* 18.0 (* t (* y z))) (* 4.0 i)))) t_1)
(- (- (* b c) (* 4.0 (* t a))) (* (* j 27.0) k))))))assert(y < z);
assert(j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = 27.0 * (j * k);
double tmp;
if (t <= -2.2e-27) {
tmp = ((b * c) + (t * ((18.0 * (x * (y * z))) - (a * 4.0)))) - t_1;
} else if (t <= 1.35e+129) {
tmp = ((b * c) + (x * ((18.0 * (t * (y * z))) - (4.0 * i)))) - t_1;
} else {
tmp = ((b * c) - (4.0 * (t * a))) - ((j * 27.0) * k);
}
return tmp;
}
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: tmp
t_1 = 27.0d0 * (j * k)
if (t <= (-2.2d-27)) then
tmp = ((b * c) + (t * ((18.0d0 * (x * (y * z))) - (a * 4.0d0)))) - t_1
else if (t <= 1.35d+129) then
tmp = ((b * c) + (x * ((18.0d0 * (t * (y * z))) - (4.0d0 * i)))) - t_1
else
tmp = ((b * c) - (4.0d0 * (t * a))) - ((j * 27.0d0) * k)
end if
code = tmp
end function
assert y < z;
assert j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = 27.0 * (j * k);
double tmp;
if (t <= -2.2e-27) {
tmp = ((b * c) + (t * ((18.0 * (x * (y * z))) - (a * 4.0)))) - t_1;
} else if (t <= 1.35e+129) {
tmp = ((b * c) + (x * ((18.0 * (t * (y * z))) - (4.0 * i)))) - t_1;
} else {
tmp = ((b * c) - (4.0 * (t * a))) - ((j * 27.0) * k);
}
return tmp;
}
[y, z] = sort([y, z]) [j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): t_1 = 27.0 * (j * k) tmp = 0 if t <= -2.2e-27: tmp = ((b * c) + (t * ((18.0 * (x * (y * z))) - (a * 4.0)))) - t_1 elif t <= 1.35e+129: tmp = ((b * c) + (x * ((18.0 * (t * (y * z))) - (4.0 * i)))) - t_1 else: tmp = ((b * c) - (4.0 * (t * a))) - ((j * 27.0) * k) return tmp
y, z = sort([y, z]) j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(27.0 * Float64(j * k)) tmp = 0.0 if (t <= -2.2e-27) tmp = Float64(Float64(Float64(b * c) + Float64(t * Float64(Float64(18.0 * Float64(x * Float64(y * z))) - Float64(a * 4.0)))) - t_1); elseif (t <= 1.35e+129) tmp = Float64(Float64(Float64(b * c) + Float64(x * Float64(Float64(18.0 * Float64(t * Float64(y * z))) - Float64(4.0 * i)))) - t_1); else tmp = Float64(Float64(Float64(b * c) - Float64(4.0 * Float64(t * a))) - Float64(Float64(j * 27.0) * k)); end return tmp end
y, z = num2cell(sort([y, z])){:}
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
t_1 = 27.0 * (j * k);
tmp = 0.0;
if (t <= -2.2e-27)
tmp = ((b * c) + (t * ((18.0 * (x * (y * z))) - (a * 4.0)))) - t_1;
elseif (t <= 1.35e+129)
tmp = ((b * c) + (x * ((18.0 * (t * (y * z))) - (4.0 * i)))) - t_1;
else
tmp = ((b * c) - (4.0 * (t * a))) - ((j * 27.0) * k);
end
tmp_2 = tmp;
end
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -2.2e-27], 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] - t$95$1), $MachinePrecision], If[LessEqual[t, 1.35e+129], N[(N[(N[(b * c), $MachinePrecision] + N[(x * N[(N[(18.0 * N[(t * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(4.0 * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], N[(N[(N[(b * c), $MachinePrecision] - N[(4.0 * N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
t_1 := 27 \cdot \left(j \cdot k\right)\\
\mathbf{if}\;t \leq -2.2 \cdot 10^{-27}:\\
\;\;\;\;\left(b \cdot c + t \cdot \left(18 \cdot \left(x \cdot \left(y \cdot z\right)\right) - a \cdot 4\right)\right) - t_1\\
\mathbf{elif}\;t \leq 1.35 \cdot 10^{+129}:\\
\;\;\;\;\left(b \cdot c + x \cdot \left(18 \cdot \left(t \cdot \left(y \cdot z\right)\right) - 4 \cdot i\right)\right) - t_1\\
\mathbf{else}:\\
\;\;\;\;\left(b \cdot c - 4 \cdot \left(t \cdot a\right)\right) - \left(j \cdot 27\right) \cdot k\\
\end{array}
\end{array}
if t < -2.19999999999999987e-27Initial program 83.9%
Simplified90.5%
Taylor expanded in i around 0 84.4%
if -2.19999999999999987e-27 < t < 1.35e129Initial program 85.5%
Taylor expanded in x around 0 90.1%
Taylor expanded in a around 0 86.2%
if 1.35e129 < t Initial program 75.0%
Taylor expanded in x around 0 76.0%
Final simplification84.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 (* 27.0 (* j k))))
(if (<= t -8.5e-28)
(- (+ (* b c) (* t (- (* 18.0 (* x (* y z))) (* a 4.0)))) t_1)
(if (<= t 1.28e+129)
(- (+ (* b c) (* x (- (* 18.0 (* y (* z t))) (* 4.0 i)))) t_1)
(- (- (* b c) (* 4.0 (* t a))) (* (* j 27.0) k))))))assert(y < z);
assert(j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = 27.0 * (j * k);
double tmp;
if (t <= -8.5e-28) {
tmp = ((b * c) + (t * ((18.0 * (x * (y * z))) - (a * 4.0)))) - t_1;
} else if (t <= 1.28e+129) {
tmp = ((b * c) + (x * ((18.0 * (y * (z * t))) - (4.0 * i)))) - t_1;
} else {
tmp = ((b * c) - (4.0 * (t * a))) - ((j * 27.0) * k);
}
return tmp;
}
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: tmp
t_1 = 27.0d0 * (j * k)
if (t <= (-8.5d-28)) then
tmp = ((b * c) + (t * ((18.0d0 * (x * (y * z))) - (a * 4.0d0)))) - t_1
else if (t <= 1.28d+129) then
tmp = ((b * c) + (x * ((18.0d0 * (y * (z * t))) - (4.0d0 * i)))) - t_1
else
tmp = ((b * c) - (4.0d0 * (t * a))) - ((j * 27.0d0) * k)
end if
code = tmp
end function
assert y < z;
assert j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = 27.0 * (j * k);
double tmp;
if (t <= -8.5e-28) {
tmp = ((b * c) + (t * ((18.0 * (x * (y * z))) - (a * 4.0)))) - t_1;
} else if (t <= 1.28e+129) {
tmp = ((b * c) + (x * ((18.0 * (y * (z * t))) - (4.0 * i)))) - t_1;
} else {
tmp = ((b * c) - (4.0 * (t * a))) - ((j * 27.0) * k);
}
return tmp;
}
[y, z] = sort([y, z]) [j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): t_1 = 27.0 * (j * k) tmp = 0 if t <= -8.5e-28: tmp = ((b * c) + (t * ((18.0 * (x * (y * z))) - (a * 4.0)))) - t_1 elif t <= 1.28e+129: tmp = ((b * c) + (x * ((18.0 * (y * (z * t))) - (4.0 * i)))) - t_1 else: tmp = ((b * c) - (4.0 * (t * a))) - ((j * 27.0) * k) return tmp
y, z = sort([y, z]) j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(27.0 * Float64(j * k)) tmp = 0.0 if (t <= -8.5e-28) tmp = Float64(Float64(Float64(b * c) + Float64(t * Float64(Float64(18.0 * Float64(x * Float64(y * z))) - Float64(a * 4.0)))) - t_1); elseif (t <= 1.28e+129) tmp = Float64(Float64(Float64(b * c) + Float64(x * Float64(Float64(18.0 * Float64(y * Float64(z * t))) - Float64(4.0 * i)))) - t_1); else tmp = Float64(Float64(Float64(b * c) - Float64(4.0 * Float64(t * a))) - Float64(Float64(j * 27.0) * k)); end return tmp end
y, z = num2cell(sort([y, z])){:}
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
t_1 = 27.0 * (j * k);
tmp = 0.0;
if (t <= -8.5e-28)
tmp = ((b * c) + (t * ((18.0 * (x * (y * z))) - (a * 4.0)))) - t_1;
elseif (t <= 1.28e+129)
tmp = ((b * c) + (x * ((18.0 * (y * (z * t))) - (4.0 * i)))) - t_1;
else
tmp = ((b * c) - (4.0 * (t * a))) - ((j * 27.0) * k);
end
tmp_2 = tmp;
end
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -8.5e-28], 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] - t$95$1), $MachinePrecision], If[LessEqual[t, 1.28e+129], N[(N[(N[(b * c), $MachinePrecision] + N[(x * N[(N[(18.0 * N[(y * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(4.0 * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], N[(N[(N[(b * c), $MachinePrecision] - N[(4.0 * N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
t_1 := 27 \cdot \left(j \cdot k\right)\\
\mathbf{if}\;t \leq -8.5 \cdot 10^{-28}:\\
\;\;\;\;\left(b \cdot c + t \cdot \left(18 \cdot \left(x \cdot \left(y \cdot z\right)\right) - a \cdot 4\right)\right) - t_1\\
\mathbf{elif}\;t \leq 1.28 \cdot 10^{+129}:\\
\;\;\;\;\left(b \cdot c + x \cdot \left(18 \cdot \left(y \cdot \left(z \cdot t\right)\right) - 4 \cdot i\right)\right) - t_1\\
\mathbf{else}:\\
\;\;\;\;\left(b \cdot c - 4 \cdot \left(t \cdot a\right)\right) - \left(j \cdot 27\right) \cdot k\\
\end{array}
\end{array}
if t < -8.49999999999999925e-28Initial program 83.9%
Simplified90.5%
Taylor expanded in i around 0 84.4%
if -8.49999999999999925e-28 < t < 1.27999999999999994e129Initial program 85.5%
Taylor expanded in x around 0 90.1%
Taylor expanded in a around 0 86.2%
expm1-log1p-u71.8%
expm1-udef70.6%
Applied egg-rr70.6%
expm1-def71.8%
expm1-log1p86.2%
*-commutative86.2%
associate-*r*90.0%
Simplified90.0%
if 1.27999999999999994e129 < t Initial program 75.0%
Taylor expanded in x around 0 76.0%
Final simplification86.6%
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (- (* b c) (* 27.0 (* j k)))) (t_2 (- (* b c) (* 4.0 (* x i)))))
(if (<= z -9200000000.0)
(* 18.0 (* x (* t (* y z))))
(if (<= z -1.12e-52)
t_1
(if (<= z -3.45e-155)
(* t (* a -4.0))
(if (<= z 2e-246)
t_2
(if (<= z 1e-190)
t_1
(if (<= z 4.4e-15)
t_2
(if (<= z 6e+89)
t_1
(if (<= z 1.08e+139)
t_2
(* x (* 18.0 (* y (* z t))))))))))))))assert(y < z);
assert(j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = (b * c) - (27.0 * (j * k));
double t_2 = (b * c) - (4.0 * (x * i));
double tmp;
if (z <= -9200000000.0) {
tmp = 18.0 * (x * (t * (y * z)));
} else if (z <= -1.12e-52) {
tmp = t_1;
} else if (z <= -3.45e-155) {
tmp = t * (a * -4.0);
} else if (z <= 2e-246) {
tmp = t_2;
} else if (z <= 1e-190) {
tmp = t_1;
} else if (z <= 4.4e-15) {
tmp = t_2;
} else if (z <= 6e+89) {
tmp = t_1;
} else if (z <= 1.08e+139) {
tmp = t_2;
} else {
tmp = x * (18.0 * (y * (z * t)));
}
return tmp;
}
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (b * c) - (27.0d0 * (j * k))
t_2 = (b * c) - (4.0d0 * (x * i))
if (z <= (-9200000000.0d0)) then
tmp = 18.0d0 * (x * (t * (y * z)))
else if (z <= (-1.12d-52)) then
tmp = t_1
else if (z <= (-3.45d-155)) then
tmp = t * (a * (-4.0d0))
else if (z <= 2d-246) then
tmp = t_2
else if (z <= 1d-190) then
tmp = t_1
else if (z <= 4.4d-15) then
tmp = t_2
else if (z <= 6d+89) then
tmp = t_1
else if (z <= 1.08d+139) then
tmp = t_2
else
tmp = x * (18.0d0 * (y * (z * t)))
end if
code = tmp
end function
assert y < z;
assert j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = (b * c) - (27.0 * (j * k));
double t_2 = (b * c) - (4.0 * (x * i));
double tmp;
if (z <= -9200000000.0) {
tmp = 18.0 * (x * (t * (y * z)));
} else if (z <= -1.12e-52) {
tmp = t_1;
} else if (z <= -3.45e-155) {
tmp = t * (a * -4.0);
} else if (z <= 2e-246) {
tmp = t_2;
} else if (z <= 1e-190) {
tmp = t_1;
} else if (z <= 4.4e-15) {
tmp = t_2;
} else if (z <= 6e+89) {
tmp = t_1;
} else if (z <= 1.08e+139) {
tmp = t_2;
} else {
tmp = x * (18.0 * (y * (z * t)));
}
return tmp;
}
[y, z] = sort([y, z]) [j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): t_1 = (b * c) - (27.0 * (j * k)) t_2 = (b * c) - (4.0 * (x * i)) tmp = 0 if z <= -9200000000.0: tmp = 18.0 * (x * (t * (y * z))) elif z <= -1.12e-52: tmp = t_1 elif z <= -3.45e-155: tmp = t * (a * -4.0) elif z <= 2e-246: tmp = t_2 elif z <= 1e-190: tmp = t_1 elif z <= 4.4e-15: tmp = t_2 elif z <= 6e+89: tmp = t_1 elif z <= 1.08e+139: tmp = t_2 else: tmp = x * (18.0 * (y * (z * t))) return tmp
y, z = sort([y, z]) j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(Float64(b * c) - Float64(27.0 * Float64(j * k))) t_2 = Float64(Float64(b * c) - Float64(4.0 * Float64(x * i))) tmp = 0.0 if (z <= -9200000000.0) tmp = Float64(18.0 * Float64(x * Float64(t * Float64(y * z)))); elseif (z <= -1.12e-52) tmp = t_1; elseif (z <= -3.45e-155) tmp = Float64(t * Float64(a * -4.0)); elseif (z <= 2e-246) tmp = t_2; elseif (z <= 1e-190) tmp = t_1; elseif (z <= 4.4e-15) tmp = t_2; elseif (z <= 6e+89) tmp = t_1; elseif (z <= 1.08e+139) tmp = t_2; else tmp = Float64(x * Float64(18.0 * Float64(y * Float64(z * t)))); end return tmp end
y, z = num2cell(sort([y, z])){:}
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
t_1 = (b * c) - (27.0 * (j * k));
t_2 = (b * c) - (4.0 * (x * i));
tmp = 0.0;
if (z <= -9200000000.0)
tmp = 18.0 * (x * (t * (y * z)));
elseif (z <= -1.12e-52)
tmp = t_1;
elseif (z <= -3.45e-155)
tmp = t * (a * -4.0);
elseif (z <= 2e-246)
tmp = t_2;
elseif (z <= 1e-190)
tmp = t_1;
elseif (z <= 4.4e-15)
tmp = t_2;
elseif (z <= 6e+89)
tmp = t_1;
elseif (z <= 1.08e+139)
tmp = t_2;
else
tmp = x * (18.0 * (y * (z * t)));
end
tmp_2 = tmp;
end
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(N[(b * c), $MachinePrecision] - N[(27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(b * c), $MachinePrecision] - N[(4.0 * N[(x * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -9200000000.0], N[(18.0 * N[(x * N[(t * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -1.12e-52], t$95$1, If[LessEqual[z, -3.45e-155], N[(t * N[(a * -4.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2e-246], t$95$2, If[LessEqual[z, 1e-190], t$95$1, If[LessEqual[z, 4.4e-15], t$95$2, If[LessEqual[z, 6e+89], t$95$1, If[LessEqual[z, 1.08e+139], t$95$2, N[(x * N[(18.0 * N[(y * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
t_1 := b \cdot c - 27 \cdot \left(j \cdot k\right)\\
t_2 := b \cdot c - 4 \cdot \left(x \cdot i\right)\\
\mathbf{if}\;z \leq -9200000000:\\
\;\;\;\;18 \cdot \left(x \cdot \left(t \cdot \left(y \cdot z\right)\right)\right)\\
\mathbf{elif}\;z \leq -1.12 \cdot 10^{-52}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -3.45 \cdot 10^{-155}:\\
\;\;\;\;t \cdot \left(a \cdot -4\right)\\
\mathbf{elif}\;z \leq 2 \cdot 10^{-246}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq 10^{-190}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 4.4 \cdot 10^{-15}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq 6 \cdot 10^{+89}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 1.08 \cdot 10^{+139}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(18 \cdot \left(y \cdot \left(z \cdot t\right)\right)\right)\\
\end{array}
\end{array}
if z < -9.2e9Initial program 86.6%
Taylor expanded in x around 0 84.9%
Taylor expanded in a around 0 80.3%
Taylor expanded in t around inf 48.7%
*-commutative48.7%
associate-*l*48.7%
*-commutative48.7%
Simplified48.7%
if -9.2e9 < z < -1.11999999999999994e-52 or 1.99999999999999991e-246 < z < 1e-190 or 4.39999999999999971e-15 < z < 6.00000000000000025e89Initial program 86.0%
Taylor expanded in t around 0 70.5%
Taylor expanded in i around 0 66.0%
if -1.11999999999999994e-52 < z < -3.44999999999999987e-155Initial program 81.4%
Taylor expanded in x around 0 95.2%
Taylor expanded in a around inf 25.4%
associate-*r*25.4%
*-commutative25.4%
Simplified25.4%
if -3.44999999999999987e-155 < z < 1.99999999999999991e-246 or 1e-190 < z < 4.39999999999999971e-15 or 6.00000000000000025e89 < z < 1.08000000000000004e139Initial program 86.9%
Taylor expanded in t around 0 66.9%
Taylor expanded in j around 0 49.2%
if 1.08000000000000004e139 < z Initial program 71.6%
Taylor expanded in x around 0 73.9%
Taylor expanded in a around 0 72.0%
Taylor expanded in t around inf 58.4%
metadata-eval58.4%
distribute-lft-neg-in58.4%
*-commutative58.4%
associate-*r*60.2%
associate-*l*60.3%
*-commutative60.3%
distribute-rgt-neg-in60.3%
distribute-lft-neg-in60.3%
metadata-eval60.3%
*-commutative60.3%
associate-*r*64.5%
Simplified64.5%
Final simplification52.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 (- (* b c) (* 4.0 (* x i))))
(t_2 (* 27.0 (* j k)))
(t_3 (- (* b c) t_2)))
(if (<= z -38000000000.0)
(* 18.0 (* x (* t (* y z))))
(if (<= z -6.4e-56)
t_3
(if (<= z -3.5e-155)
(* t (* a -4.0))
(if (<= z 2.9e-246)
t_1
(if (<= z 2.7e-192)
t_3
(if (<= z 2.15e-30)
(- (* x (* i -4.0)) t_2)
(if (<= z 1.1e+89)
t_3
(if (<= z 5.9e+138) t_1 (* x (* 18.0 (* y (* z t))))))))))))))assert(y < z);
assert(j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = (b * c) - (4.0 * (x * i));
double t_2 = 27.0 * (j * k);
double t_3 = (b * c) - t_2;
double tmp;
if (z <= -38000000000.0) {
tmp = 18.0 * (x * (t * (y * z)));
} else if (z <= -6.4e-56) {
tmp = t_3;
} else if (z <= -3.5e-155) {
tmp = t * (a * -4.0);
} else if (z <= 2.9e-246) {
tmp = t_1;
} else if (z <= 2.7e-192) {
tmp = t_3;
} else if (z <= 2.15e-30) {
tmp = (x * (i * -4.0)) - t_2;
} else if (z <= 1.1e+89) {
tmp = t_3;
} else if (z <= 5.9e+138) {
tmp = t_1;
} else {
tmp = x * (18.0 * (y * (z * t)));
}
return tmp;
}
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_1 = (b * c) - (4.0d0 * (x * i))
t_2 = 27.0d0 * (j * k)
t_3 = (b * c) - t_2
if (z <= (-38000000000.0d0)) then
tmp = 18.0d0 * (x * (t * (y * z)))
else if (z <= (-6.4d-56)) then
tmp = t_3
else if (z <= (-3.5d-155)) then
tmp = t * (a * (-4.0d0))
else if (z <= 2.9d-246) then
tmp = t_1
else if (z <= 2.7d-192) then
tmp = t_3
else if (z <= 2.15d-30) then
tmp = (x * (i * (-4.0d0))) - t_2
else if (z <= 1.1d+89) then
tmp = t_3
else if (z <= 5.9d+138) then
tmp = t_1
else
tmp = x * (18.0d0 * (y * (z * t)))
end if
code = tmp
end function
assert y < z;
assert j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = (b * c) - (4.0 * (x * i));
double t_2 = 27.0 * (j * k);
double t_3 = (b * c) - t_2;
double tmp;
if (z <= -38000000000.0) {
tmp = 18.0 * (x * (t * (y * z)));
} else if (z <= -6.4e-56) {
tmp = t_3;
} else if (z <= -3.5e-155) {
tmp = t * (a * -4.0);
} else if (z <= 2.9e-246) {
tmp = t_1;
} else if (z <= 2.7e-192) {
tmp = t_3;
} else if (z <= 2.15e-30) {
tmp = (x * (i * -4.0)) - t_2;
} else if (z <= 1.1e+89) {
tmp = t_3;
} else if (z <= 5.9e+138) {
tmp = t_1;
} else {
tmp = x * (18.0 * (y * (z * t)));
}
return tmp;
}
[y, z] = sort([y, z]) [j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): t_1 = (b * c) - (4.0 * (x * i)) t_2 = 27.0 * (j * k) t_3 = (b * c) - t_2 tmp = 0 if z <= -38000000000.0: tmp = 18.0 * (x * (t * (y * z))) elif z <= -6.4e-56: tmp = t_3 elif z <= -3.5e-155: tmp = t * (a * -4.0) elif z <= 2.9e-246: tmp = t_1 elif z <= 2.7e-192: tmp = t_3 elif z <= 2.15e-30: tmp = (x * (i * -4.0)) - t_2 elif z <= 1.1e+89: tmp = t_3 elif z <= 5.9e+138: tmp = t_1 else: tmp = x * (18.0 * (y * (z * t))) return tmp
y, z = sort([y, z]) j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(Float64(b * c) - Float64(4.0 * Float64(x * i))) t_2 = Float64(27.0 * Float64(j * k)) t_3 = Float64(Float64(b * c) - t_2) tmp = 0.0 if (z <= -38000000000.0) tmp = Float64(18.0 * Float64(x * Float64(t * Float64(y * z)))); elseif (z <= -6.4e-56) tmp = t_3; elseif (z <= -3.5e-155) tmp = Float64(t * Float64(a * -4.0)); elseif (z <= 2.9e-246) tmp = t_1; elseif (z <= 2.7e-192) tmp = t_3; elseif (z <= 2.15e-30) tmp = Float64(Float64(x * Float64(i * -4.0)) - t_2); elseif (z <= 1.1e+89) tmp = t_3; elseif (z <= 5.9e+138) tmp = t_1; else tmp = Float64(x * Float64(18.0 * Float64(y * Float64(z * t)))); end return tmp end
y, z = num2cell(sort([y, z])){:}
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
t_1 = (b * c) - (4.0 * (x * i));
t_2 = 27.0 * (j * k);
t_3 = (b * c) - t_2;
tmp = 0.0;
if (z <= -38000000000.0)
tmp = 18.0 * (x * (t * (y * z)));
elseif (z <= -6.4e-56)
tmp = t_3;
elseif (z <= -3.5e-155)
tmp = t * (a * -4.0);
elseif (z <= 2.9e-246)
tmp = t_1;
elseif (z <= 2.7e-192)
tmp = t_3;
elseif (z <= 2.15e-30)
tmp = (x * (i * -4.0)) - t_2;
elseif (z <= 1.1e+89)
tmp = t_3;
elseif (z <= 5.9e+138)
tmp = t_1;
else
tmp = x * (18.0 * (y * (z * t)));
end
tmp_2 = tmp;
end
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(N[(b * c), $MachinePrecision] - N[(4.0 * N[(x * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(b * c), $MachinePrecision] - t$95$2), $MachinePrecision]}, If[LessEqual[z, -38000000000.0], N[(18.0 * N[(x * N[(t * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -6.4e-56], t$95$3, If[LessEqual[z, -3.5e-155], N[(t * N[(a * -4.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.9e-246], t$95$1, If[LessEqual[z, 2.7e-192], t$95$3, If[LessEqual[z, 2.15e-30], N[(N[(x * N[(i * -4.0), $MachinePrecision]), $MachinePrecision] - t$95$2), $MachinePrecision], If[LessEqual[z, 1.1e+89], t$95$3, If[LessEqual[z, 5.9e+138], t$95$1, N[(x * N[(18.0 * N[(y * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]]]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
t_1 := b \cdot c - 4 \cdot \left(x \cdot i\right)\\
t_2 := 27 \cdot \left(j \cdot k\right)\\
t_3 := b \cdot c - t_2\\
\mathbf{if}\;z \leq -38000000000:\\
\;\;\;\;18 \cdot \left(x \cdot \left(t \cdot \left(y \cdot z\right)\right)\right)\\
\mathbf{elif}\;z \leq -6.4 \cdot 10^{-56}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;z \leq -3.5 \cdot 10^{-155}:\\
\;\;\;\;t \cdot \left(a \cdot -4\right)\\
\mathbf{elif}\;z \leq 2.9 \cdot 10^{-246}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 2.7 \cdot 10^{-192}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;z \leq 2.15 \cdot 10^{-30}:\\
\;\;\;\;x \cdot \left(i \cdot -4\right) - t_2\\
\mathbf{elif}\;z \leq 1.1 \cdot 10^{+89}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;z \leq 5.9 \cdot 10^{+138}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(18 \cdot \left(y \cdot \left(z \cdot t\right)\right)\right)\\
\end{array}
\end{array}
if z < -3.8e10Initial program 86.6%
Taylor expanded in x around 0 84.9%
Taylor expanded in a around 0 80.3%
Taylor expanded in t around inf 48.7%
*-commutative48.7%
associate-*l*48.7%
*-commutative48.7%
Simplified48.7%
if -3.8e10 < z < -6.39999999999999971e-56 or 2.9e-246 < z < 2.69999999999999991e-192 or 2.14999999999999983e-30 < z < 1.1e89Initial program 87.9%
Taylor expanded in t around 0 68.7%
Taylor expanded in i around 0 64.8%
if -6.39999999999999971e-56 < z < -3.50000000000000015e-155Initial program 81.4%
Taylor expanded in x around 0 95.2%
Taylor expanded in a around inf 25.4%
associate-*r*25.4%
*-commutative25.4%
Simplified25.4%
if -3.50000000000000015e-155 < z < 2.9e-246 or 1.1e89 < z < 5.8999999999999999e138Initial program 83.8%
Taylor expanded in t around 0 66.3%
Taylor expanded in j around 0 47.3%
if 2.69999999999999991e-192 < z < 2.14999999999999983e-30Initial program 88.7%
Taylor expanded in x around 0 99.9%
Taylor expanded in a around 0 77.7%
Taylor expanded in i around inf 61.2%
*-commutative61.2%
*-commutative61.2%
associate-*r*61.2%
Simplified61.2%
if 5.8999999999999999e138 < z Initial program 71.6%
Taylor expanded in x around 0 73.9%
Taylor expanded in a around 0 72.0%
Taylor expanded in t around inf 58.4%
metadata-eval58.4%
distribute-lft-neg-in58.4%
*-commutative58.4%
associate-*r*60.2%
associate-*l*60.3%
*-commutative60.3%
distribute-rgt-neg-in60.3%
distribute-lft-neg-in60.3%
metadata-eval60.3%
*-commutative60.3%
associate-*r*64.5%
Simplified64.5%
Final simplification54.0%
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (* 27.0 (* j k)))
(t_2 (- (* b c) t_1))
(t_3 (* t (+ (* 18.0 (* z (* x y))) (* a -4.0)))))
(if (<= z -4e-207)
t_3
(if (<= z 2.1e-195)
t_2
(if (<= z 9.8e-31)
(- (* x (* i -4.0)) t_1)
(if (<= z 3.9e+90)
t_2
(if (<= z 4.5e+135)
(- (* b c) (* 4.0 (* x i)))
(if (<= z 2.45e+179) (* 18.0 (* x (* t (* y z)))) t_3))))))))assert(y < z);
assert(j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = 27.0 * (j * k);
double t_2 = (b * c) - t_1;
double t_3 = t * ((18.0 * (z * (x * y))) + (a * -4.0));
double tmp;
if (z <= -4e-207) {
tmp = t_3;
} else if (z <= 2.1e-195) {
tmp = t_2;
} else if (z <= 9.8e-31) {
tmp = (x * (i * -4.0)) - t_1;
} else if (z <= 3.9e+90) {
tmp = t_2;
} else if (z <= 4.5e+135) {
tmp = (b * c) - (4.0 * (x * i));
} else if (z <= 2.45e+179) {
tmp = 18.0 * (x * (t * (y * z)));
} else {
tmp = t_3;
}
return tmp;
}
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_1 = 27.0d0 * (j * k)
t_2 = (b * c) - t_1
t_3 = t * ((18.0d0 * (z * (x * y))) + (a * (-4.0d0)))
if (z <= (-4d-207)) then
tmp = t_3
else if (z <= 2.1d-195) then
tmp = t_2
else if (z <= 9.8d-31) then
tmp = (x * (i * (-4.0d0))) - t_1
else if (z <= 3.9d+90) then
tmp = t_2
else if (z <= 4.5d+135) then
tmp = (b * c) - (4.0d0 * (x * i))
else if (z <= 2.45d+179) then
tmp = 18.0d0 * (x * (t * (y * z)))
else
tmp = t_3
end if
code = tmp
end function
assert y < z;
assert j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = 27.0 * (j * k);
double t_2 = (b * c) - t_1;
double t_3 = t * ((18.0 * (z * (x * y))) + (a * -4.0));
double tmp;
if (z <= -4e-207) {
tmp = t_3;
} else if (z <= 2.1e-195) {
tmp = t_2;
} else if (z <= 9.8e-31) {
tmp = (x * (i * -4.0)) - t_1;
} else if (z <= 3.9e+90) {
tmp = t_2;
} else if (z <= 4.5e+135) {
tmp = (b * c) - (4.0 * (x * i));
} else if (z <= 2.45e+179) {
tmp = 18.0 * (x * (t * (y * z)));
} else {
tmp = t_3;
}
return tmp;
}
[y, z] = sort([y, z]) [j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): t_1 = 27.0 * (j * k) t_2 = (b * c) - t_1 t_3 = t * ((18.0 * (z * (x * y))) + (a * -4.0)) tmp = 0 if z <= -4e-207: tmp = t_3 elif z <= 2.1e-195: tmp = t_2 elif z <= 9.8e-31: tmp = (x * (i * -4.0)) - t_1 elif z <= 3.9e+90: tmp = t_2 elif z <= 4.5e+135: tmp = (b * c) - (4.0 * (x * i)) elif z <= 2.45e+179: tmp = 18.0 * (x * (t * (y * z))) else: tmp = t_3 return tmp
y, z = sort([y, z]) j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(27.0 * Float64(j * k)) t_2 = Float64(Float64(b * c) - t_1) t_3 = Float64(t * Float64(Float64(18.0 * Float64(z * Float64(x * y))) + Float64(a * -4.0))) tmp = 0.0 if (z <= -4e-207) tmp = t_3; elseif (z <= 2.1e-195) tmp = t_2; elseif (z <= 9.8e-31) tmp = Float64(Float64(x * Float64(i * -4.0)) - t_1); elseif (z <= 3.9e+90) tmp = t_2; elseif (z <= 4.5e+135) tmp = Float64(Float64(b * c) - Float64(4.0 * Float64(x * i))); elseif (z <= 2.45e+179) tmp = Float64(18.0 * Float64(x * Float64(t * Float64(y * z)))); else tmp = t_3; end return tmp end
y, z = num2cell(sort([y, z])){:}
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
t_1 = 27.0 * (j * k);
t_2 = (b * c) - t_1;
t_3 = t * ((18.0 * (z * (x * y))) + (a * -4.0));
tmp = 0.0;
if (z <= -4e-207)
tmp = t_3;
elseif (z <= 2.1e-195)
tmp = t_2;
elseif (z <= 9.8e-31)
tmp = (x * (i * -4.0)) - t_1;
elseif (z <= 3.9e+90)
tmp = t_2;
elseif (z <= 4.5e+135)
tmp = (b * c) - (4.0 * (x * i));
elseif (z <= 2.45e+179)
tmp = 18.0 * (x * (t * (y * z)));
else
tmp = t_3;
end
tmp_2 = tmp;
end
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(b * c), $MachinePrecision] - t$95$1), $MachinePrecision]}, Block[{t$95$3 = N[(t * N[(N[(18.0 * N[(z * N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(a * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -4e-207], t$95$3, If[LessEqual[z, 2.1e-195], t$95$2, If[LessEqual[z, 9.8e-31], N[(N[(x * N[(i * -4.0), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], If[LessEqual[z, 3.9e+90], t$95$2, If[LessEqual[z, 4.5e+135], N[(N[(b * c), $MachinePrecision] - N[(4.0 * N[(x * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.45e+179], N[(18.0 * N[(x * N[(t * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$3]]]]]]]]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
t_1 := 27 \cdot \left(j \cdot k\right)\\
t_2 := b \cdot c - t_1\\
t_3 := t \cdot \left(18 \cdot \left(z \cdot \left(x \cdot y\right)\right) + a \cdot -4\right)\\
\mathbf{if}\;z \leq -4 \cdot 10^{-207}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;z \leq 2.1 \cdot 10^{-195}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq 9.8 \cdot 10^{-31}:\\
\;\;\;\;x \cdot \left(i \cdot -4\right) - t_1\\
\mathbf{elif}\;z \leq 3.9 \cdot 10^{+90}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq 4.5 \cdot 10^{+135}:\\
\;\;\;\;b \cdot c - 4 \cdot \left(x \cdot i\right)\\
\mathbf{elif}\;z \leq 2.45 \cdot 10^{+179}:\\
\;\;\;\;18 \cdot \left(x \cdot \left(t \cdot \left(y \cdot z\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t_3\\
\end{array}
\end{array}
if z < -3.9999999999999997e-207 or 2.4499999999999999e179 < z Initial program 83.0%
Taylor expanded in x around 0 83.7%
Taylor expanded in t around inf 57.2%
cancel-sign-sub-inv57.2%
metadata-eval57.2%
associate-*r*58.0%
Simplified58.0%
if -3.9999999999999997e-207 < z < 2.1e-195 or 9.80000000000000047e-31 < z < 3.9000000000000002e90Initial program 88.3%
Taylor expanded in t around 0 69.8%
Taylor expanded in i around 0 61.3%
if 2.1e-195 < z < 9.80000000000000047e-31Initial program 88.7%
Taylor expanded in x around 0 99.9%
Taylor expanded in a around 0 77.7%
Taylor expanded in i around inf 61.2%
*-commutative61.2%
*-commutative61.2%
associate-*r*61.2%
Simplified61.2%
if 3.9000000000000002e90 < z < 4.50000000000000007e135Initial program 75.3%
Taylor expanded in t around 0 60.1%
Taylor expanded in j around 0 47.0%
if 4.50000000000000007e135 < z < 2.4499999999999999e179Initial program 36.0%
Taylor expanded in x around 0 67.1%
Taylor expanded in a around 0 67.1%
Taylor expanded in t around inf 36.0%
*-commutative36.0%
associate-*l*63.8%
*-commutative63.8%
Simplified63.8%
Final simplification58.9%
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (* 27.0 (* j k)))
(t_2 (- (* b c) t_1))
(t_3 (* t (- (* (* x y) (* 18.0 z)) (* a 4.0)))))
(if (<= z -2.5e-206)
t_3
(if (<= z 9.5e-194)
t_2
(if (<= z 1.15e-30)
(- (* x (* i -4.0)) t_1)
(if (<= z 5.8e+89)
t_2
(if (<= z 1.1e+137)
(- (* b c) (* 4.0 (* x i)))
(if (<= z 2.45e+179) (* 18.0 (* x (* t (* y z)))) t_3))))))))assert(y < z);
assert(j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = 27.0 * (j * k);
double t_2 = (b * c) - t_1;
double t_3 = t * (((x * y) * (18.0 * z)) - (a * 4.0));
double tmp;
if (z <= -2.5e-206) {
tmp = t_3;
} else if (z <= 9.5e-194) {
tmp = t_2;
} else if (z <= 1.15e-30) {
tmp = (x * (i * -4.0)) - t_1;
} else if (z <= 5.8e+89) {
tmp = t_2;
} else if (z <= 1.1e+137) {
tmp = (b * c) - (4.0 * (x * i));
} else if (z <= 2.45e+179) {
tmp = 18.0 * (x * (t * (y * z)));
} else {
tmp = t_3;
}
return tmp;
}
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_1 = 27.0d0 * (j * k)
t_2 = (b * c) - t_1
t_3 = t * (((x * y) * (18.0d0 * z)) - (a * 4.0d0))
if (z <= (-2.5d-206)) then
tmp = t_3
else if (z <= 9.5d-194) then
tmp = t_2
else if (z <= 1.15d-30) then
tmp = (x * (i * (-4.0d0))) - t_1
else if (z <= 5.8d+89) then
tmp = t_2
else if (z <= 1.1d+137) then
tmp = (b * c) - (4.0d0 * (x * i))
else if (z <= 2.45d+179) then
tmp = 18.0d0 * (x * (t * (y * z)))
else
tmp = t_3
end if
code = tmp
end function
assert y < z;
assert j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = 27.0 * (j * k);
double t_2 = (b * c) - t_1;
double t_3 = t * (((x * y) * (18.0 * z)) - (a * 4.0));
double tmp;
if (z <= -2.5e-206) {
tmp = t_3;
} else if (z <= 9.5e-194) {
tmp = t_2;
} else if (z <= 1.15e-30) {
tmp = (x * (i * -4.0)) - t_1;
} else if (z <= 5.8e+89) {
tmp = t_2;
} else if (z <= 1.1e+137) {
tmp = (b * c) - (4.0 * (x * i));
} else if (z <= 2.45e+179) {
tmp = 18.0 * (x * (t * (y * z)));
} else {
tmp = t_3;
}
return tmp;
}
[y, z] = sort([y, z]) [j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): t_1 = 27.0 * (j * k) t_2 = (b * c) - t_1 t_3 = t * (((x * y) * (18.0 * z)) - (a * 4.0)) tmp = 0 if z <= -2.5e-206: tmp = t_3 elif z <= 9.5e-194: tmp = t_2 elif z <= 1.15e-30: tmp = (x * (i * -4.0)) - t_1 elif z <= 5.8e+89: tmp = t_2 elif z <= 1.1e+137: tmp = (b * c) - (4.0 * (x * i)) elif z <= 2.45e+179: tmp = 18.0 * (x * (t * (y * z))) else: tmp = t_3 return tmp
y, z = sort([y, z]) j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(27.0 * Float64(j * k)) t_2 = Float64(Float64(b * c) - t_1) t_3 = Float64(t * Float64(Float64(Float64(x * y) * Float64(18.0 * z)) - Float64(a * 4.0))) tmp = 0.0 if (z <= -2.5e-206) tmp = t_3; elseif (z <= 9.5e-194) tmp = t_2; elseif (z <= 1.15e-30) tmp = Float64(Float64(x * Float64(i * -4.0)) - t_1); elseif (z <= 5.8e+89) tmp = t_2; elseif (z <= 1.1e+137) tmp = Float64(Float64(b * c) - Float64(4.0 * Float64(x * i))); elseif (z <= 2.45e+179) tmp = Float64(18.0 * Float64(x * Float64(t * Float64(y * z)))); else tmp = t_3; end return tmp end
y, z = num2cell(sort([y, z])){:}
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
t_1 = 27.0 * (j * k);
t_2 = (b * c) - t_1;
t_3 = t * (((x * y) * (18.0 * z)) - (a * 4.0));
tmp = 0.0;
if (z <= -2.5e-206)
tmp = t_3;
elseif (z <= 9.5e-194)
tmp = t_2;
elseif (z <= 1.15e-30)
tmp = (x * (i * -4.0)) - t_1;
elseif (z <= 5.8e+89)
tmp = t_2;
elseif (z <= 1.1e+137)
tmp = (b * c) - (4.0 * (x * i));
elseif (z <= 2.45e+179)
tmp = 18.0 * (x * (t * (y * z)));
else
tmp = t_3;
end
tmp_2 = tmp;
end
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(b * c), $MachinePrecision] - t$95$1), $MachinePrecision]}, Block[{t$95$3 = N[(t * N[(N[(N[(x * y), $MachinePrecision] * N[(18.0 * z), $MachinePrecision]), $MachinePrecision] - N[(a * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.5e-206], t$95$3, If[LessEqual[z, 9.5e-194], t$95$2, If[LessEqual[z, 1.15e-30], N[(N[(x * N[(i * -4.0), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], If[LessEqual[z, 5.8e+89], t$95$2, If[LessEqual[z, 1.1e+137], N[(N[(b * c), $MachinePrecision] - N[(4.0 * N[(x * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.45e+179], N[(18.0 * N[(x * N[(t * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$3]]]]]]]]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
t_1 := 27 \cdot \left(j \cdot k\right)\\
t_2 := b \cdot c - t_1\\
t_3 := t \cdot \left(\left(x \cdot y\right) \cdot \left(18 \cdot z\right) - a \cdot 4\right)\\
\mathbf{if}\;z \leq -2.5 \cdot 10^{-206}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;z \leq 9.5 \cdot 10^{-194}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq 1.15 \cdot 10^{-30}:\\
\;\;\;\;x \cdot \left(i \cdot -4\right) - t_1\\
\mathbf{elif}\;z \leq 5.8 \cdot 10^{+89}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq 1.1 \cdot 10^{+137}:\\
\;\;\;\;b \cdot c - 4 \cdot \left(x \cdot i\right)\\
\mathbf{elif}\;z \leq 2.45 \cdot 10^{+179}:\\
\;\;\;\;18 \cdot \left(x \cdot \left(t \cdot \left(y \cdot z\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t_3\\
\end{array}
\end{array}
if z < -2.5e-206 or 2.4499999999999999e179 < z Initial program 83.0%
Taylor expanded in x around 0 83.7%
Taylor expanded in t around inf 57.2%
*-commutative57.2%
associate-*r*58.0%
associate-*r*58.0%
pow158.0%
associate-*l*57.2%
Applied egg-rr57.2%
unpow157.2%
associate-*r*58.0%
Simplified58.0%
if -2.5e-206 < z < 9.50000000000000009e-194 or 1.14999999999999992e-30 < z < 5.80000000000000051e89Initial program 88.3%
Taylor expanded in t around 0 69.8%
Taylor expanded in i around 0 61.3%
if 9.50000000000000009e-194 < z < 1.14999999999999992e-30Initial program 88.7%
Taylor expanded in x around 0 99.9%
Taylor expanded in a around 0 77.7%
Taylor expanded in i around inf 61.2%
*-commutative61.2%
*-commutative61.2%
associate-*r*61.2%
Simplified61.2%
if 5.80000000000000051e89 < z < 1.10000000000000008e137Initial program 75.3%
Taylor expanded in t around 0 60.1%
Taylor expanded in j around 0 47.0%
if 1.10000000000000008e137 < z < 2.4499999999999999e179Initial program 36.0%
Taylor expanded in x around 0 67.1%
Taylor expanded in a around 0 67.1%
Taylor expanded in t around inf 36.0%
*-commutative36.0%
associate-*l*63.8%
*-commutative63.8%
Simplified63.8%
Final simplification58.9%
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (* z (* x y))) (t_2 (* 27.0 (* j k))) (t_3 (- (* b c) t_2)))
(if (<= z -1.65e-47)
(- (* b c) (* (* t -18.0) t_1))
(if (<= z -3.1e-206)
(* t (+ (* 18.0 t_1) (* a -4.0)))
(if (<= z 7.5e-191)
t_3
(if (<= z 1.22e-30)
(- (* x (* i -4.0)) t_2)
(if (<= z 1.26e+101)
t_3
(* x (- (* 18.0 (* z (* y t))) (* 4.0 i))))))))))assert(y < z);
assert(j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = z * (x * y);
double t_2 = 27.0 * (j * k);
double t_3 = (b * c) - t_2;
double tmp;
if (z <= -1.65e-47) {
tmp = (b * c) - ((t * -18.0) * t_1);
} else if (z <= -3.1e-206) {
tmp = t * ((18.0 * t_1) + (a * -4.0));
} else if (z <= 7.5e-191) {
tmp = t_3;
} else if (z <= 1.22e-30) {
tmp = (x * (i * -4.0)) - t_2;
} else if (z <= 1.26e+101) {
tmp = t_3;
} else {
tmp = x * ((18.0 * (z * (y * t))) - (4.0 * i));
}
return tmp;
}
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_1 = z * (x * y)
t_2 = 27.0d0 * (j * k)
t_3 = (b * c) - t_2
if (z <= (-1.65d-47)) then
tmp = (b * c) - ((t * (-18.0d0)) * t_1)
else if (z <= (-3.1d-206)) then
tmp = t * ((18.0d0 * t_1) + (a * (-4.0d0)))
else if (z <= 7.5d-191) then
tmp = t_3
else if (z <= 1.22d-30) then
tmp = (x * (i * (-4.0d0))) - t_2
else if (z <= 1.26d+101) then
tmp = t_3
else
tmp = x * ((18.0d0 * (z * (y * t))) - (4.0d0 * i))
end if
code = tmp
end function
assert y < z;
assert j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = z * (x * y);
double t_2 = 27.0 * (j * k);
double t_3 = (b * c) - t_2;
double tmp;
if (z <= -1.65e-47) {
tmp = (b * c) - ((t * -18.0) * t_1);
} else if (z <= -3.1e-206) {
tmp = t * ((18.0 * t_1) + (a * -4.0));
} else if (z <= 7.5e-191) {
tmp = t_3;
} else if (z <= 1.22e-30) {
tmp = (x * (i * -4.0)) - t_2;
} else if (z <= 1.26e+101) {
tmp = t_3;
} else {
tmp = x * ((18.0 * (z * (y * t))) - (4.0 * i));
}
return tmp;
}
[y, z] = sort([y, z]) [j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): t_1 = z * (x * y) t_2 = 27.0 * (j * k) t_3 = (b * c) - t_2 tmp = 0 if z <= -1.65e-47: tmp = (b * c) - ((t * -18.0) * t_1) elif z <= -3.1e-206: tmp = t * ((18.0 * t_1) + (a * -4.0)) elif z <= 7.5e-191: tmp = t_3 elif z <= 1.22e-30: tmp = (x * (i * -4.0)) - t_2 elif z <= 1.26e+101: tmp = t_3 else: tmp = x * ((18.0 * (z * (y * t))) - (4.0 * i)) return tmp
y, z = sort([y, z]) j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(z * Float64(x * y)) t_2 = Float64(27.0 * Float64(j * k)) t_3 = Float64(Float64(b * c) - t_2) tmp = 0.0 if (z <= -1.65e-47) tmp = Float64(Float64(b * c) - Float64(Float64(t * -18.0) * t_1)); elseif (z <= -3.1e-206) tmp = Float64(t * Float64(Float64(18.0 * t_1) + Float64(a * -4.0))); elseif (z <= 7.5e-191) tmp = t_3; elseif (z <= 1.22e-30) tmp = Float64(Float64(x * Float64(i * -4.0)) - t_2); elseif (z <= 1.26e+101) tmp = t_3; else tmp = Float64(x * Float64(Float64(18.0 * Float64(z * Float64(y * t))) - Float64(4.0 * i))); end return tmp end
y, z = num2cell(sort([y, z])){:}
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
t_1 = z * (x * y);
t_2 = 27.0 * (j * k);
t_3 = (b * c) - t_2;
tmp = 0.0;
if (z <= -1.65e-47)
tmp = (b * c) - ((t * -18.0) * t_1);
elseif (z <= -3.1e-206)
tmp = t * ((18.0 * t_1) + (a * -4.0));
elseif (z <= 7.5e-191)
tmp = t_3;
elseif (z <= 1.22e-30)
tmp = (x * (i * -4.0)) - t_2;
elseif (z <= 1.26e+101)
tmp = t_3;
else
tmp = x * ((18.0 * (z * (y * t))) - (4.0 * i));
end
tmp_2 = tmp;
end
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(z * N[(x * y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(b * c), $MachinePrecision] - t$95$2), $MachinePrecision]}, If[LessEqual[z, -1.65e-47], N[(N[(b * c), $MachinePrecision] - N[(N[(t * -18.0), $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -3.1e-206], N[(t * N[(N[(18.0 * t$95$1), $MachinePrecision] + N[(a * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 7.5e-191], t$95$3, If[LessEqual[z, 1.22e-30], N[(N[(x * N[(i * -4.0), $MachinePrecision]), $MachinePrecision] - t$95$2), $MachinePrecision], If[LessEqual[z, 1.26e+101], t$95$3, N[(x * N[(N[(18.0 * N[(z * N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(4.0 * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
t_1 := z \cdot \left(x \cdot y\right)\\
t_2 := 27 \cdot \left(j \cdot k\right)\\
t_3 := b \cdot c - t_2\\
\mathbf{if}\;z \leq -1.65 \cdot 10^{-47}:\\
\;\;\;\;b \cdot c - \left(t \cdot -18\right) \cdot t_1\\
\mathbf{elif}\;z \leq -3.1 \cdot 10^{-206}:\\
\;\;\;\;t \cdot \left(18 \cdot t_1 + a \cdot -4\right)\\
\mathbf{elif}\;z \leq 7.5 \cdot 10^{-191}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;z \leq 1.22 \cdot 10^{-30}:\\
\;\;\;\;x \cdot \left(i \cdot -4\right) - t_2\\
\mathbf{elif}\;z \leq 1.26 \cdot 10^{+101}:\\
\;\;\;\;t_3\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(18 \cdot \left(z \cdot \left(y \cdot t\right)\right) - 4 \cdot i\right)\\
\end{array}
\end{array}
if z < -1.65000000000000002e-47Initial program 86.8%
Simplified86.9%
Taylor expanded in x around inf 81.5%
*-commutative81.5%
associate-*r*81.5%
associate-*r*81.5%
associate-*l*81.5%
Simplified81.5%
Taylor expanded in x around inf 72.9%
associate-*r*72.9%
*-commutative72.9%
Simplified72.9%
Taylor expanded in x around -inf 75.7%
+-commutative75.7%
mul-1-neg75.7%
unsub-neg75.7%
cancel-sign-sub-inv75.7%
associate-*r*75.8%
metadata-eval75.8%
fma-def75.8%
*-commutative75.8%
Simplified75.8%
Taylor expanded in t around inf 64.4%
associate-*r*64.3%
*-commutative64.3%
associate-*r*63.0%
Simplified63.0%
if -1.65000000000000002e-47 < z < -3.1000000000000003e-206Initial program 80.9%
Taylor expanded in x around 0 90.2%
Taylor expanded in t around inf 46.4%
cancel-sign-sub-inv46.4%
metadata-eval46.4%
associate-*r*43.4%
Simplified43.4%
if -3.1000000000000003e-206 < z < 7.4999999999999995e-191 or 1.22e-30 < z < 1.2600000000000001e101Initial program 87.3%
Taylor expanded in t around 0 69.4%
Taylor expanded in i around 0 61.0%
if 7.4999999999999995e-191 < z < 1.22e-30Initial program 88.7%
Taylor expanded in x around 0 99.9%
Taylor expanded in a around 0 77.7%
Taylor expanded in i around inf 61.2%
*-commutative61.2%
*-commutative61.2%
associate-*r*61.2%
Simplified61.2%
if 1.2600000000000001e101 < z Initial program 73.2%
Simplified73.4%
Taylor expanded in x around inf 64.2%
pow175.1%
Applied egg-rr64.2%
unpow175.1%
associate-*r*80.7%
Simplified66.0%
Final simplification60.4%
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (- (- (* b c) (* 4.0 (* t a))) (* (* j 27.0) k))))
(if (<= z -2.65e-27)
(- (* b c) (* (* t -18.0) (* z (* x y))))
(if (<= z 3.9e-191)
t_1
(if (<= z 1.32e-80)
(- (* x (* i -4.0)) (* 27.0 (* j k)))
(if (<= z 9.5e+123)
t_1
(* x (- (* 18.0 (* z (* y t))) (* 4.0 i)))))))))assert(y < z);
assert(j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = ((b * c) - (4.0 * (t * a))) - ((j * 27.0) * k);
double tmp;
if (z <= -2.65e-27) {
tmp = (b * c) - ((t * -18.0) * (z * (x * y)));
} else if (z <= 3.9e-191) {
tmp = t_1;
} else if (z <= 1.32e-80) {
tmp = (x * (i * -4.0)) - (27.0 * (j * k));
} else if (z <= 9.5e+123) {
tmp = t_1;
} else {
tmp = x * ((18.0 * (z * (y * t))) - (4.0 * i));
}
return tmp;
}
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: tmp
t_1 = ((b * c) - (4.0d0 * (t * a))) - ((j * 27.0d0) * k)
if (z <= (-2.65d-27)) then
tmp = (b * c) - ((t * (-18.0d0)) * (z * (x * y)))
else if (z <= 3.9d-191) then
tmp = t_1
else if (z <= 1.32d-80) then
tmp = (x * (i * (-4.0d0))) - (27.0d0 * (j * k))
else if (z <= 9.5d+123) then
tmp = t_1
else
tmp = x * ((18.0d0 * (z * (y * t))) - (4.0d0 * i))
end if
code = tmp
end function
assert y < z;
assert j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = ((b * c) - (4.0 * (t * a))) - ((j * 27.0) * k);
double tmp;
if (z <= -2.65e-27) {
tmp = (b * c) - ((t * -18.0) * (z * (x * y)));
} else if (z <= 3.9e-191) {
tmp = t_1;
} else if (z <= 1.32e-80) {
tmp = (x * (i * -4.0)) - (27.0 * (j * k));
} else if (z <= 9.5e+123) {
tmp = t_1;
} else {
tmp = x * ((18.0 * (z * (y * t))) - (4.0 * i));
}
return tmp;
}
[y, z] = sort([y, z]) [j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): t_1 = ((b * c) - (4.0 * (t * a))) - ((j * 27.0) * k) tmp = 0 if z <= -2.65e-27: tmp = (b * c) - ((t * -18.0) * (z * (x * y))) elif z <= 3.9e-191: tmp = t_1 elif z <= 1.32e-80: tmp = (x * (i * -4.0)) - (27.0 * (j * k)) elif z <= 9.5e+123: tmp = t_1 else: tmp = x * ((18.0 * (z * (y * t))) - (4.0 * i)) return tmp
y, z = sort([y, z]) j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(Float64(Float64(b * c) - Float64(4.0 * Float64(t * a))) - Float64(Float64(j * 27.0) * k)) tmp = 0.0 if (z <= -2.65e-27) tmp = Float64(Float64(b * c) - Float64(Float64(t * -18.0) * Float64(z * Float64(x * y)))); elseif (z <= 3.9e-191) tmp = t_1; elseif (z <= 1.32e-80) tmp = Float64(Float64(x * Float64(i * -4.0)) - Float64(27.0 * Float64(j * k))); elseif (z <= 9.5e+123) tmp = t_1; else tmp = Float64(x * Float64(Float64(18.0 * Float64(z * Float64(y * t))) - Float64(4.0 * i))); end return tmp end
y, z = num2cell(sort([y, z])){:}
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
t_1 = ((b * c) - (4.0 * (t * a))) - ((j * 27.0) * k);
tmp = 0.0;
if (z <= -2.65e-27)
tmp = (b * c) - ((t * -18.0) * (z * (x * y)));
elseif (z <= 3.9e-191)
tmp = t_1;
elseif (z <= 1.32e-80)
tmp = (x * (i * -4.0)) - (27.0 * (j * k));
elseif (z <= 9.5e+123)
tmp = t_1;
else
tmp = x * ((18.0 * (z * (y * t))) - (4.0 * i));
end
tmp_2 = tmp;
end
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(N[(N[(b * c), $MachinePrecision] - N[(4.0 * N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.65e-27], N[(N[(b * c), $MachinePrecision] - N[(N[(t * -18.0), $MachinePrecision] * N[(z * N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.9e-191], t$95$1, If[LessEqual[z, 1.32e-80], N[(N[(x * N[(i * -4.0), $MachinePrecision]), $MachinePrecision] - N[(27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 9.5e+123], t$95$1, N[(x * N[(N[(18.0 * N[(z * N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(4.0 * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
t_1 := \left(b \cdot c - 4 \cdot \left(t \cdot a\right)\right) - \left(j \cdot 27\right) \cdot k\\
\mathbf{if}\;z \leq -2.65 \cdot 10^{-27}:\\
\;\;\;\;b \cdot c - \left(t \cdot -18\right) \cdot \left(z \cdot \left(x \cdot y\right)\right)\\
\mathbf{elif}\;z \leq 3.9 \cdot 10^{-191}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 1.32 \cdot 10^{-80}:\\
\;\;\;\;x \cdot \left(i \cdot -4\right) - 27 \cdot \left(j \cdot k\right)\\
\mathbf{elif}\;z \leq 9.5 \cdot 10^{+123}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(18 \cdot \left(z \cdot \left(y \cdot t\right)\right) - 4 \cdot i\right)\\
\end{array}
\end{array}
if z < -2.65000000000000003e-27Initial program 87.6%
Simplified87.6%
Taylor expanded in x around inf 80.3%
*-commutative80.3%
associate-*r*80.3%
associate-*r*80.4%
associate-*l*80.4%
Simplified80.4%
Taylor expanded in x around inf 72.7%
associate-*r*72.7%
*-commutative72.7%
Simplified72.7%
Taylor expanded in x around -inf 75.7%
+-commutative75.7%
mul-1-neg75.7%
unsub-neg75.7%
cancel-sign-sub-inv75.7%
associate-*r*75.7%
metadata-eval75.7%
fma-def75.7%
*-commutative75.7%
Simplified75.7%
Taylor expanded in t around inf 66.7%
associate-*r*66.6%
*-commutative66.6%
associate-*r*65.2%
Simplified65.2%
if -2.65000000000000003e-27 < z < 3.8999999999999999e-191 or 1.31999999999999995e-80 < z < 9.4999999999999996e123Initial program 84.8%
Taylor expanded in x around 0 71.1%
if 3.8999999999999999e-191 < z < 1.31999999999999995e-80Initial program 87.7%
Taylor expanded in x around 0 99.9%
Taylor expanded in a around 0 87.6%
Taylor expanded in i around inf 75.8%
*-commutative75.8%
*-commutative75.8%
associate-*r*75.8%
Simplified75.8%
if 9.4999999999999996e123 < z Initial program 72.9%
Simplified73.2%
Taylor expanded in x around inf 69.1%
pow175.1%
Applied egg-rr69.1%
unpow175.1%
associate-*r*79.5%
Simplified71.3%
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
(let* ((t_1 (* (* j 27.0) k)) (t_2 (- (- (* b c) (* 4.0 (* t a))) t_1)))
(if (<= z -1.02e-25)
(- (* b c) (* (* t -18.0) (* z (* x y))))
(if (<= z -1.15e-284)
t_2
(if (<= z 1.22e-79)
(- (- (* b c) (* 4.0 (* x i))) t_1)
(if (<= z 1.25e+118)
t_2
(* x (- (* 18.0 (* z (* y t))) (* 4.0 i)))))))))assert(y < z);
assert(j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = (j * 27.0) * k;
double t_2 = ((b * c) - (4.0 * (t * a))) - t_1;
double tmp;
if (z <= -1.02e-25) {
tmp = (b * c) - ((t * -18.0) * (z * (x * y)));
} else if (z <= -1.15e-284) {
tmp = t_2;
} else if (z <= 1.22e-79) {
tmp = ((b * c) - (4.0 * (x * i))) - t_1;
} else if (z <= 1.25e+118) {
tmp = t_2;
} else {
tmp = x * ((18.0 * (z * (y * t))) - (4.0 * i));
}
return tmp;
}
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (j * 27.0d0) * k
t_2 = ((b * c) - (4.0d0 * (t * a))) - t_1
if (z <= (-1.02d-25)) then
tmp = (b * c) - ((t * (-18.0d0)) * (z * (x * y)))
else if (z <= (-1.15d-284)) then
tmp = t_2
else if (z <= 1.22d-79) then
tmp = ((b * c) - (4.0d0 * (x * i))) - t_1
else if (z <= 1.25d+118) then
tmp = t_2
else
tmp = x * ((18.0d0 * (z * (y * t))) - (4.0d0 * i))
end if
code = tmp
end function
assert y < z;
assert j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = (j * 27.0) * k;
double t_2 = ((b * c) - (4.0 * (t * a))) - t_1;
double tmp;
if (z <= -1.02e-25) {
tmp = (b * c) - ((t * -18.0) * (z * (x * y)));
} else if (z <= -1.15e-284) {
tmp = t_2;
} else if (z <= 1.22e-79) {
tmp = ((b * c) - (4.0 * (x * i))) - t_1;
} else if (z <= 1.25e+118) {
tmp = t_2;
} else {
tmp = x * ((18.0 * (z * (y * t))) - (4.0 * i));
}
return tmp;
}
[y, z] = sort([y, z]) [j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): t_1 = (j * 27.0) * k t_2 = ((b * c) - (4.0 * (t * a))) - t_1 tmp = 0 if z <= -1.02e-25: tmp = (b * c) - ((t * -18.0) * (z * (x * y))) elif z <= -1.15e-284: tmp = t_2 elif z <= 1.22e-79: tmp = ((b * c) - (4.0 * (x * i))) - t_1 elif z <= 1.25e+118: tmp = t_2 else: tmp = x * ((18.0 * (z * (y * t))) - (4.0 * i)) return tmp
y, z = sort([y, z]) j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(Float64(j * 27.0) * k) t_2 = Float64(Float64(Float64(b * c) - Float64(4.0 * Float64(t * a))) - t_1) tmp = 0.0 if (z <= -1.02e-25) tmp = Float64(Float64(b * c) - Float64(Float64(t * -18.0) * Float64(z * Float64(x * y)))); elseif (z <= -1.15e-284) tmp = t_2; elseif (z <= 1.22e-79) tmp = Float64(Float64(Float64(b * c) - Float64(4.0 * Float64(x * i))) - t_1); elseif (z <= 1.25e+118) tmp = t_2; else tmp = Float64(x * Float64(Float64(18.0 * Float64(z * Float64(y * t))) - Float64(4.0 * i))); end return tmp end
y, z = num2cell(sort([y, z])){:}
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
t_1 = (j * 27.0) * k;
t_2 = ((b * c) - (4.0 * (t * a))) - t_1;
tmp = 0.0;
if (z <= -1.02e-25)
tmp = (b * c) - ((t * -18.0) * (z * (x * y)));
elseif (z <= -1.15e-284)
tmp = t_2;
elseif (z <= 1.22e-79)
tmp = ((b * c) - (4.0 * (x * i))) - t_1;
elseif (z <= 1.25e+118)
tmp = t_2;
else
tmp = x * ((18.0 * (z * (y * t))) - (4.0 * i));
end
tmp_2 = tmp;
end
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(b * c), $MachinePrecision] - N[(4.0 * N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision]}, If[LessEqual[z, -1.02e-25], N[(N[(b * c), $MachinePrecision] - N[(N[(t * -18.0), $MachinePrecision] * N[(z * N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -1.15e-284], t$95$2, If[LessEqual[z, 1.22e-79], N[(N[(N[(b * c), $MachinePrecision] - N[(4.0 * N[(x * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], If[LessEqual[z, 1.25e+118], t$95$2, N[(x * N[(N[(18.0 * N[(z * N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(4.0 * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
t_1 := \left(j \cdot 27\right) \cdot k\\
t_2 := \left(b \cdot c - 4 \cdot \left(t \cdot a\right)\right) - t_1\\
\mathbf{if}\;z \leq -1.02 \cdot 10^{-25}:\\
\;\;\;\;b \cdot c - \left(t \cdot -18\right) \cdot \left(z \cdot \left(x \cdot y\right)\right)\\
\mathbf{elif}\;z \leq -1.15 \cdot 10^{-284}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq 1.22 \cdot 10^{-79}:\\
\;\;\;\;\left(b \cdot c - 4 \cdot \left(x \cdot i\right)\right) - t_1\\
\mathbf{elif}\;z \leq 1.25 \cdot 10^{+118}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(18 \cdot \left(z \cdot \left(y \cdot t\right)\right) - 4 \cdot i\right)\\
\end{array}
\end{array}
if z < -1.01999999999999998e-25Initial program 87.6%
Simplified87.6%
Taylor expanded in x around inf 80.3%
*-commutative80.3%
associate-*r*80.3%
associate-*r*80.4%
associate-*l*80.4%
Simplified80.4%
Taylor expanded in x around inf 72.7%
associate-*r*72.7%
*-commutative72.7%
Simplified72.7%
Taylor expanded in x around -inf 75.7%
+-commutative75.7%
mul-1-neg75.7%
unsub-neg75.7%
cancel-sign-sub-inv75.7%
associate-*r*75.7%
metadata-eval75.7%
fma-def75.7%
*-commutative75.7%
Simplified75.7%
Taylor expanded in t around inf 66.7%
associate-*r*66.6%
*-commutative66.6%
associate-*r*65.2%
Simplified65.2%
if -1.01999999999999998e-25 < z < -1.15e-284 or 1.22e-79 < z < 1.24999999999999993e118Initial program 85.4%
Taylor expanded in x around 0 70.4%
if -1.15e-284 < z < 1.22e-79Initial program 84.6%
Taylor expanded in t around 0 74.4%
if 1.24999999999999993e118 < z Initial program 73.5%
Simplified73.7%
Taylor expanded in x around inf 69.2%
pow175.6%
Applied egg-rr69.2%
unpow175.6%
associate-*r*79.9%
Simplified71.3%
Final simplification70.0%
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (* 27.0 (* j k))) (t_2 (- (* b c) t_1)))
(if (<= z -6e-207)
(* t (- (* (* x y) (* 18.0 z)) (* a 4.0)))
(if (<= z 3.5e-192)
t_2
(if (<= z 1.92e-31)
(- (* x (* i -4.0)) t_1)
(if (<= z 4e+115) t_2 (* x (- (* 18.0 (* t (* y z))) (* 4.0 i)))))))))assert(y < z);
assert(j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = 27.0 * (j * k);
double t_2 = (b * c) - t_1;
double tmp;
if (z <= -6e-207) {
tmp = t * (((x * y) * (18.0 * z)) - (a * 4.0));
} else if (z <= 3.5e-192) {
tmp = t_2;
} else if (z <= 1.92e-31) {
tmp = (x * (i * -4.0)) - t_1;
} else if (z <= 4e+115) {
tmp = t_2;
} else {
tmp = x * ((18.0 * (t * (y * z))) - (4.0 * i));
}
return tmp;
}
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = 27.0d0 * (j * k)
t_2 = (b * c) - t_1
if (z <= (-6d-207)) then
tmp = t * (((x * y) * (18.0d0 * z)) - (a * 4.0d0))
else if (z <= 3.5d-192) then
tmp = t_2
else if (z <= 1.92d-31) then
tmp = (x * (i * (-4.0d0))) - t_1
else if (z <= 4d+115) then
tmp = t_2
else
tmp = x * ((18.0d0 * (t * (y * z))) - (4.0d0 * i))
end if
code = tmp
end function
assert y < z;
assert j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = 27.0 * (j * k);
double t_2 = (b * c) - t_1;
double tmp;
if (z <= -6e-207) {
tmp = t * (((x * y) * (18.0 * z)) - (a * 4.0));
} else if (z <= 3.5e-192) {
tmp = t_2;
} else if (z <= 1.92e-31) {
tmp = (x * (i * -4.0)) - t_1;
} else if (z <= 4e+115) {
tmp = t_2;
} else {
tmp = x * ((18.0 * (t * (y * z))) - (4.0 * i));
}
return tmp;
}
[y, z] = sort([y, z]) [j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): t_1 = 27.0 * (j * k) t_2 = (b * c) - t_1 tmp = 0 if z <= -6e-207: tmp = t * (((x * y) * (18.0 * z)) - (a * 4.0)) elif z <= 3.5e-192: tmp = t_2 elif z <= 1.92e-31: tmp = (x * (i * -4.0)) - t_1 elif z <= 4e+115: tmp = t_2 else: tmp = x * ((18.0 * (t * (y * z))) - (4.0 * i)) return tmp
y, z = sort([y, z]) j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(27.0 * Float64(j * k)) t_2 = Float64(Float64(b * c) - t_1) tmp = 0.0 if (z <= -6e-207) tmp = Float64(t * Float64(Float64(Float64(x * y) * Float64(18.0 * z)) - Float64(a * 4.0))); elseif (z <= 3.5e-192) tmp = t_2; elseif (z <= 1.92e-31) tmp = Float64(Float64(x * Float64(i * -4.0)) - t_1); elseif (z <= 4e+115) tmp = t_2; else tmp = Float64(x * Float64(Float64(18.0 * Float64(t * Float64(y * z))) - Float64(4.0 * i))); end return tmp end
y, z = num2cell(sort([y, z])){:}
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
t_1 = 27.0 * (j * k);
t_2 = (b * c) - t_1;
tmp = 0.0;
if (z <= -6e-207)
tmp = t * (((x * y) * (18.0 * z)) - (a * 4.0));
elseif (z <= 3.5e-192)
tmp = t_2;
elseif (z <= 1.92e-31)
tmp = (x * (i * -4.0)) - t_1;
elseif (z <= 4e+115)
tmp = t_2;
else
tmp = x * ((18.0 * (t * (y * z))) - (4.0 * i));
end
tmp_2 = tmp;
end
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(b * c), $MachinePrecision] - t$95$1), $MachinePrecision]}, If[LessEqual[z, -6e-207], N[(t * N[(N[(N[(x * y), $MachinePrecision] * N[(18.0 * z), $MachinePrecision]), $MachinePrecision] - N[(a * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.5e-192], t$95$2, If[LessEqual[z, 1.92e-31], N[(N[(x * N[(i * -4.0), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], If[LessEqual[z, 4e+115], t$95$2, N[(x * N[(N[(18.0 * N[(t * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(4.0 * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
t_1 := 27 \cdot \left(j \cdot k\right)\\
t_2 := b \cdot c - t_1\\
\mathbf{if}\;z \leq -6 \cdot 10^{-207}:\\
\;\;\;\;t \cdot \left(\left(x \cdot y\right) \cdot \left(18 \cdot z\right) - a \cdot 4\right)\\
\mathbf{elif}\;z \leq 3.5 \cdot 10^{-192}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq 1.92 \cdot 10^{-31}:\\
\;\;\;\;x \cdot \left(i \cdot -4\right) - t_1\\
\mathbf{elif}\;z \leq 4 \cdot 10^{+115}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(18 \cdot \left(t \cdot \left(y \cdot z\right)\right) - 4 \cdot i\right)\\
\end{array}
\end{array}
if z < -5.9999999999999999e-207Initial program 85.0%
Taylor expanded in x around 0 86.9%
Taylor expanded in t around inf 51.6%
*-commutative51.6%
associate-*r*51.7%
associate-*r*51.7%
pow151.7%
associate-*l*51.6%
Applied egg-rr51.6%
unpow151.6%
associate-*r*51.7%
Simplified51.7%
if -5.9999999999999999e-207 < z < 3.50000000000000014e-192 or 1.9200000000000001e-31 < z < 4.0000000000000001e115Initial program 85.6%
Taylor expanded in t around 0 69.5%
Taylor expanded in i around 0 58.0%
if 3.50000000000000014e-192 < z < 1.9200000000000001e-31Initial program 88.7%
Taylor expanded in x around 0 99.9%
Taylor expanded in a around 0 77.7%
Taylor expanded in i around inf 61.2%
*-commutative61.2%
*-commutative61.2%
associate-*r*61.2%
Simplified61.2%
if 4.0000000000000001e115 < z Initial program 74.1%
Simplified74.3%
Taylor expanded in x around inf 67.7%
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 (* 27.0 (* j k))) (t_2 (- (* b c) t_1)))
(if (<= z -2.15e-206)
(* t (- (* (* x y) (* 18.0 z)) (* a 4.0)))
(if (<= z 4.2e-194)
t_2
(if (<= z 2.15e-30)
(- (* x (* i -4.0)) t_1)
(if (<= z 1.15e+101)
t_2
(* x (- (* 18.0 (* z (* y t))) (* 4.0 i)))))))))assert(y < z);
assert(j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = 27.0 * (j * k);
double t_2 = (b * c) - t_1;
double tmp;
if (z <= -2.15e-206) {
tmp = t * (((x * y) * (18.0 * z)) - (a * 4.0));
} else if (z <= 4.2e-194) {
tmp = t_2;
} else if (z <= 2.15e-30) {
tmp = (x * (i * -4.0)) - t_1;
} else if (z <= 1.15e+101) {
tmp = t_2;
} else {
tmp = x * ((18.0 * (z * (y * t))) - (4.0 * i));
}
return tmp;
}
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = 27.0d0 * (j * k)
t_2 = (b * c) - t_1
if (z <= (-2.15d-206)) then
tmp = t * (((x * y) * (18.0d0 * z)) - (a * 4.0d0))
else if (z <= 4.2d-194) then
tmp = t_2
else if (z <= 2.15d-30) then
tmp = (x * (i * (-4.0d0))) - t_1
else if (z <= 1.15d+101) then
tmp = t_2
else
tmp = x * ((18.0d0 * (z * (y * t))) - (4.0d0 * i))
end if
code = tmp
end function
assert y < z;
assert j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = 27.0 * (j * k);
double t_2 = (b * c) - t_1;
double tmp;
if (z <= -2.15e-206) {
tmp = t * (((x * y) * (18.0 * z)) - (a * 4.0));
} else if (z <= 4.2e-194) {
tmp = t_2;
} else if (z <= 2.15e-30) {
tmp = (x * (i * -4.0)) - t_1;
} else if (z <= 1.15e+101) {
tmp = t_2;
} else {
tmp = x * ((18.0 * (z * (y * t))) - (4.0 * i));
}
return tmp;
}
[y, z] = sort([y, z]) [j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): t_1 = 27.0 * (j * k) t_2 = (b * c) - t_1 tmp = 0 if z <= -2.15e-206: tmp = t * (((x * y) * (18.0 * z)) - (a * 4.0)) elif z <= 4.2e-194: tmp = t_2 elif z <= 2.15e-30: tmp = (x * (i * -4.0)) - t_1 elif z <= 1.15e+101: tmp = t_2 else: tmp = x * ((18.0 * (z * (y * t))) - (4.0 * i)) return tmp
y, z = sort([y, z]) j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(27.0 * Float64(j * k)) t_2 = Float64(Float64(b * c) - t_1) tmp = 0.0 if (z <= -2.15e-206) tmp = Float64(t * Float64(Float64(Float64(x * y) * Float64(18.0 * z)) - Float64(a * 4.0))); elseif (z <= 4.2e-194) tmp = t_2; elseif (z <= 2.15e-30) tmp = Float64(Float64(x * Float64(i * -4.0)) - t_1); elseif (z <= 1.15e+101) tmp = t_2; else tmp = Float64(x * Float64(Float64(18.0 * Float64(z * Float64(y * t))) - Float64(4.0 * i))); end return tmp end
y, z = num2cell(sort([y, z])){:}
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
t_1 = 27.0 * (j * k);
t_2 = (b * c) - t_1;
tmp = 0.0;
if (z <= -2.15e-206)
tmp = t * (((x * y) * (18.0 * z)) - (a * 4.0));
elseif (z <= 4.2e-194)
tmp = t_2;
elseif (z <= 2.15e-30)
tmp = (x * (i * -4.0)) - t_1;
elseif (z <= 1.15e+101)
tmp = t_2;
else
tmp = x * ((18.0 * (z * (y * t))) - (4.0 * i));
end
tmp_2 = tmp;
end
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(b * c), $MachinePrecision] - t$95$1), $MachinePrecision]}, If[LessEqual[z, -2.15e-206], N[(t * N[(N[(N[(x * y), $MachinePrecision] * N[(18.0 * z), $MachinePrecision]), $MachinePrecision] - N[(a * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 4.2e-194], t$95$2, If[LessEqual[z, 2.15e-30], N[(N[(x * N[(i * -4.0), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], If[LessEqual[z, 1.15e+101], t$95$2, N[(x * N[(N[(18.0 * N[(z * N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(4.0 * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
t_1 := 27 \cdot \left(j \cdot k\right)\\
t_2 := b \cdot c - t_1\\
\mathbf{if}\;z \leq -2.15 \cdot 10^{-206}:\\
\;\;\;\;t \cdot \left(\left(x \cdot y\right) \cdot \left(18 \cdot z\right) - a \cdot 4\right)\\
\mathbf{elif}\;z \leq 4.2 \cdot 10^{-194}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq 2.15 \cdot 10^{-30}:\\
\;\;\;\;x \cdot \left(i \cdot -4\right) - t_1\\
\mathbf{elif}\;z \leq 1.15 \cdot 10^{+101}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(18 \cdot \left(z \cdot \left(y \cdot t\right)\right) - 4 \cdot i\right)\\
\end{array}
\end{array}
if z < -2.15000000000000012e-206Initial program 85.0%
Taylor expanded in x around 0 86.9%
Taylor expanded in t around inf 51.6%
*-commutative51.6%
associate-*r*51.7%
associate-*r*51.7%
pow151.7%
associate-*l*51.6%
Applied egg-rr51.6%
unpow151.6%
associate-*r*51.7%
Simplified51.7%
if -2.15000000000000012e-206 < z < 4.2e-194 or 2.14999999999999983e-30 < z < 1.1500000000000001e101Initial program 87.3%
Taylor expanded in t around 0 69.4%
Taylor expanded in i around 0 61.0%
if 4.2e-194 < z < 2.14999999999999983e-30Initial program 88.7%
Taylor expanded in x around 0 99.9%
Taylor expanded in a around 0 77.7%
Taylor expanded in i around inf 61.2%
*-commutative61.2%
*-commutative61.2%
associate-*r*61.2%
Simplified61.2%
if 1.1500000000000001e101 < z Initial program 73.2%
Simplified73.4%
Taylor expanded in x around inf 64.2%
pow175.1%
Applied egg-rr64.2%
unpow175.1%
associate-*r*80.7%
Simplified66.0%
Final simplification58.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 (* 18.0 (* t (* z (* x y))))))
(if (<= z -3.6e-78)
t_1
(if (<= z -1.4e-231)
(* t (* a -4.0))
(if (<= z 4.5e-190)
(* b c)
(if (<= z 2.9e-28)
(* x (* i -4.0))
(if (<= z 1.95e+118) (* b c) t_1)))))))assert(y < z);
assert(j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = 18.0 * (t * (z * (x * y)));
double tmp;
if (z <= -3.6e-78) {
tmp = t_1;
} else if (z <= -1.4e-231) {
tmp = t * (a * -4.0);
} else if (z <= 4.5e-190) {
tmp = b * c;
} else if (z <= 2.9e-28) {
tmp = x * (i * -4.0);
} else if (z <= 1.95e+118) {
tmp = b * c;
} else {
tmp = t_1;
}
return tmp;
}
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: tmp
t_1 = 18.0d0 * (t * (z * (x * y)))
if (z <= (-3.6d-78)) then
tmp = t_1
else if (z <= (-1.4d-231)) then
tmp = t * (a * (-4.0d0))
else if (z <= 4.5d-190) then
tmp = b * c
else if (z <= 2.9d-28) then
tmp = x * (i * (-4.0d0))
else if (z <= 1.95d+118) then
tmp = b * c
else
tmp = t_1
end if
code = tmp
end function
assert y < z;
assert j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = 18.0 * (t * (z * (x * y)));
double tmp;
if (z <= -3.6e-78) {
tmp = t_1;
} else if (z <= -1.4e-231) {
tmp = t * (a * -4.0);
} else if (z <= 4.5e-190) {
tmp = b * c;
} else if (z <= 2.9e-28) {
tmp = x * (i * -4.0);
} else if (z <= 1.95e+118) {
tmp = b * c;
} else {
tmp = t_1;
}
return tmp;
}
[y, z] = sort([y, z]) [j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): t_1 = 18.0 * (t * (z * (x * y))) tmp = 0 if z <= -3.6e-78: tmp = t_1 elif z <= -1.4e-231: tmp = t * (a * -4.0) elif z <= 4.5e-190: tmp = b * c elif z <= 2.9e-28: tmp = x * (i * -4.0) elif z <= 1.95e+118: tmp = b * c else: tmp = t_1 return tmp
y, z = sort([y, z]) j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(18.0 * Float64(t * Float64(z * Float64(x * y)))) tmp = 0.0 if (z <= -3.6e-78) tmp = t_1; elseif (z <= -1.4e-231) tmp = Float64(t * Float64(a * -4.0)); elseif (z <= 4.5e-190) tmp = Float64(b * c); elseif (z <= 2.9e-28) tmp = Float64(x * Float64(i * -4.0)); elseif (z <= 1.95e+118) tmp = Float64(b * c); else tmp = t_1; end return tmp end
y, z = num2cell(sort([y, z])){:}
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
t_1 = 18.0 * (t * (z * (x * y)));
tmp = 0.0;
if (z <= -3.6e-78)
tmp = t_1;
elseif (z <= -1.4e-231)
tmp = t * (a * -4.0);
elseif (z <= 4.5e-190)
tmp = b * c;
elseif (z <= 2.9e-28)
tmp = x * (i * -4.0);
elseif (z <= 1.95e+118)
tmp = b * c;
else
tmp = t_1;
end
tmp_2 = tmp;
end
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(18.0 * N[(t * N[(z * N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -3.6e-78], t$95$1, If[LessEqual[z, -1.4e-231], N[(t * N[(a * -4.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 4.5e-190], N[(b * c), $MachinePrecision], If[LessEqual[z, 2.9e-28], N[(x * N[(i * -4.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.95e+118], N[(b * c), $MachinePrecision], t$95$1]]]]]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
t_1 := 18 \cdot \left(t \cdot \left(z \cdot \left(x \cdot y\right)\right)\right)\\
\mathbf{if}\;z \leq -3.6 \cdot 10^{-78}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -1.4 \cdot 10^{-231}:\\
\;\;\;\;t \cdot \left(a \cdot -4\right)\\
\mathbf{elif}\;z \leq 4.5 \cdot 10^{-190}:\\
\;\;\;\;b \cdot c\\
\mathbf{elif}\;z \leq 2.9 \cdot 10^{-28}:\\
\;\;\;\;x \cdot \left(i \cdot -4\right)\\
\mathbf{elif}\;z \leq 1.95 \cdot 10^{+118}:\\
\;\;\;\;b \cdot c\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if z < -3.6000000000000002e-78 or 1.95e118 < z Initial program 82.1%
Taylor expanded in x around 0 82.0%
Taylor expanded in a around 0 79.2%
Taylor expanded in t around inf 48.6%
associate-*r*48.6%
Simplified48.6%
if -3.6000000000000002e-78 < z < -1.3999999999999999e-231Initial program 80.3%
Taylor expanded in x around 0 91.9%
Taylor expanded in a around inf 33.8%
associate-*r*33.8%
*-commutative33.8%
Simplified33.8%
if -1.3999999999999999e-231 < z < 4.50000000000000021e-190 or 2.90000000000000013e-28 < z < 1.95e118Initial program 85.0%
Simplified89.0%
Taylor expanded in b around inf 32.2%
if 4.50000000000000021e-190 < z < 2.90000000000000013e-28Initial program 89.0%
Simplified94.5%
Taylor expanded in i around inf 43.2%
associate-*r*43.2%
*-commutative43.2%
Simplified43.2%
Final simplification41.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 (<= z -1.8e-69)
(* 18.0 (* x (* t (* y z))))
(if (<= z -5.4e-227)
(* t (* a -4.0))
(if (<= z 1.8e-195)
(* b c)
(if (<= z 5.8e-27)
(* x (* i -4.0))
(if (<= z 9e+117) (* b c) (* 18.0 (* t (* z (* x y))))))))))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.8e-69) {
tmp = 18.0 * (x * (t * (y * z)));
} else if (z <= -5.4e-227) {
tmp = t * (a * -4.0);
} else if (z <= 1.8e-195) {
tmp = b * c;
} else if (z <= 5.8e-27) {
tmp = x * (i * -4.0);
} else if (z <= 9e+117) {
tmp = b * c;
} else {
tmp = 18.0 * (t * (z * (x * y)));
}
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.8d-69)) then
tmp = 18.0d0 * (x * (t * (y * z)))
else if (z <= (-5.4d-227)) then
tmp = t * (a * (-4.0d0))
else if (z <= 1.8d-195) then
tmp = b * c
else if (z <= 5.8d-27) then
tmp = x * (i * (-4.0d0))
else if (z <= 9d+117) then
tmp = b * c
else
tmp = 18.0d0 * (t * (z * (x * y)))
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.8e-69) {
tmp = 18.0 * (x * (t * (y * z)));
} else if (z <= -5.4e-227) {
tmp = t * (a * -4.0);
} else if (z <= 1.8e-195) {
tmp = b * c;
} else if (z <= 5.8e-27) {
tmp = x * (i * -4.0);
} else if (z <= 9e+117) {
tmp = b * c;
} else {
tmp = 18.0 * (t * (z * (x * y)));
}
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.8e-69: tmp = 18.0 * (x * (t * (y * z))) elif z <= -5.4e-227: tmp = t * (a * -4.0) elif z <= 1.8e-195: tmp = b * c elif z <= 5.8e-27: tmp = x * (i * -4.0) elif z <= 9e+117: tmp = b * c else: tmp = 18.0 * (t * (z * (x * y))) 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.8e-69) tmp = Float64(18.0 * Float64(x * Float64(t * Float64(y * z)))); elseif (z <= -5.4e-227) tmp = Float64(t * Float64(a * -4.0)); elseif (z <= 1.8e-195) tmp = Float64(b * c); elseif (z <= 5.8e-27) tmp = Float64(x * Float64(i * -4.0)); elseif (z <= 9e+117) tmp = Float64(b * c); else tmp = Float64(18.0 * Float64(t * Float64(z * Float64(x * y)))); 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.8e-69)
tmp = 18.0 * (x * (t * (y * z)));
elseif (z <= -5.4e-227)
tmp = t * (a * -4.0);
elseif (z <= 1.8e-195)
tmp = b * c;
elseif (z <= 5.8e-27)
tmp = x * (i * -4.0);
elseif (z <= 9e+117)
tmp = b * c;
else
tmp = 18.0 * (t * (z * (x * y)));
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.8e-69], N[(18.0 * N[(x * N[(t * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -5.4e-227], N[(t * N[(a * -4.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.8e-195], N[(b * c), $MachinePrecision], If[LessEqual[z, 5.8e-27], N[(x * N[(i * -4.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 9e+117], N[(b * c), $MachinePrecision], N[(18.0 * N[(t * N[(z * N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.8 \cdot 10^{-69}:\\
\;\;\;\;18 \cdot \left(x \cdot \left(t \cdot \left(y \cdot z\right)\right)\right)\\
\mathbf{elif}\;z \leq -5.4 \cdot 10^{-227}:\\
\;\;\;\;t \cdot \left(a \cdot -4\right)\\
\mathbf{elif}\;z \leq 1.8 \cdot 10^{-195}:\\
\;\;\;\;b \cdot c\\
\mathbf{elif}\;z \leq 5.8 \cdot 10^{-27}:\\
\;\;\;\;x \cdot \left(i \cdot -4\right)\\
\mathbf{elif}\;z \leq 9 \cdot 10^{+117}:\\
\;\;\;\;b \cdot c\\
\mathbf{else}:\\
\;\;\;\;18 \cdot \left(t \cdot \left(z \cdot \left(x \cdot y\right)\right)\right)\\
\end{array}
\end{array}
if z < -1.80000000000000009e-69Initial program 86.6%
Taylor expanded in x around 0 85.2%
Taylor expanded in a around 0 81.7%
Taylor expanded in t around inf 45.9%
*-commutative45.9%
associate-*l*45.9%
*-commutative45.9%
Simplified45.9%
if -1.80000000000000009e-69 < z < -5.3999999999999999e-227Initial program 82.4%
Taylor expanded in x around 0 92.7%
Taylor expanded in a around inf 30.3%
associate-*r*30.3%
*-commutative30.3%
Simplified30.3%
if -5.3999999999999999e-227 < z < 1.8e-195 or 5.80000000000000008e-27 < z < 9e117Initial program 85.0%
Simplified89.0%
Taylor expanded in b around inf 32.2%
if 1.8e-195 < z < 5.80000000000000008e-27Initial program 89.0%
Simplified94.5%
Taylor expanded in i around inf 43.2%
associate-*r*43.2%
*-commutative43.2%
Simplified43.2%
if 9e117 < z Initial program 73.5%
Taylor expanded in x around 0 75.6%
Taylor expanded in a around 0 73.8%
Taylor expanded in t around inf 56.2%
associate-*r*58.2%
Simplified58.2%
Final simplification42.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 (<= z -2.3e-75)
(* 18.0 (* x (* t (* y z))))
(if (<= z -2.1e-227)
(* t (* a -4.0))
(if (<= z 2.1e-195)
(* b c)
(if (<= z 3.7e-28)
(* x (* i -4.0))
(if (<= z 4.4e+119) (* b c) (* x (* 18.0 (* y (* z t))))))))))assert(y < z);
assert(j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double tmp;
if (z <= -2.3e-75) {
tmp = 18.0 * (x * (t * (y * z)));
} else if (z <= -2.1e-227) {
tmp = t * (a * -4.0);
} else if (z <= 2.1e-195) {
tmp = b * c;
} else if (z <= 3.7e-28) {
tmp = x * (i * -4.0);
} else if (z <= 4.4e+119) {
tmp = b * c;
} else {
tmp = x * (18.0 * (y * (z * t)));
}
return tmp;
}
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: tmp
if (z <= (-2.3d-75)) then
tmp = 18.0d0 * (x * (t * (y * z)))
else if (z <= (-2.1d-227)) then
tmp = t * (a * (-4.0d0))
else if (z <= 2.1d-195) then
tmp = b * c
else if (z <= 3.7d-28) then
tmp = x * (i * (-4.0d0))
else if (z <= 4.4d+119) then
tmp = b * c
else
tmp = x * (18.0d0 * (y * (z * t)))
end if
code = tmp
end function
assert y < z;
assert j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double tmp;
if (z <= -2.3e-75) {
tmp = 18.0 * (x * (t * (y * z)));
} else if (z <= -2.1e-227) {
tmp = t * (a * -4.0);
} else if (z <= 2.1e-195) {
tmp = b * c;
} else if (z <= 3.7e-28) {
tmp = x * (i * -4.0);
} else if (z <= 4.4e+119) {
tmp = b * c;
} else {
tmp = x * (18.0 * (y * (z * t)));
}
return tmp;
}
[y, z] = sort([y, z]) [j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): tmp = 0 if z <= -2.3e-75: tmp = 18.0 * (x * (t * (y * z))) elif z <= -2.1e-227: tmp = t * (a * -4.0) elif z <= 2.1e-195: tmp = b * c elif z <= 3.7e-28: tmp = x * (i * -4.0) elif z <= 4.4e+119: tmp = b * c else: tmp = x * (18.0 * (y * (z * t))) return tmp
y, z = sort([y, z]) j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) tmp = 0.0 if (z <= -2.3e-75) tmp = Float64(18.0 * Float64(x * Float64(t * Float64(y * z)))); elseif (z <= -2.1e-227) tmp = Float64(t * Float64(a * -4.0)); elseif (z <= 2.1e-195) tmp = Float64(b * c); elseif (z <= 3.7e-28) tmp = Float64(x * Float64(i * -4.0)); elseif (z <= 4.4e+119) tmp = Float64(b * c); else tmp = Float64(x * Float64(18.0 * Float64(y * Float64(z * t)))); end return tmp end
y, z = num2cell(sort([y, z])){:}
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
tmp = 0.0;
if (z <= -2.3e-75)
tmp = 18.0 * (x * (t * (y * z)));
elseif (z <= -2.1e-227)
tmp = t * (a * -4.0);
elseif (z <= 2.1e-195)
tmp = b * c;
elseif (z <= 3.7e-28)
tmp = x * (i * -4.0);
elseif (z <= 4.4e+119)
tmp = b * c;
else
tmp = x * (18.0 * (y * (z * t)));
end
tmp_2 = tmp;
end
NOTE: y and z should be sorted in increasing order before calling this function. NOTE: j and k should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := If[LessEqual[z, -2.3e-75], N[(18.0 * N[(x * N[(t * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -2.1e-227], N[(t * N[(a * -4.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.1e-195], N[(b * c), $MachinePrecision], If[LessEqual[z, 3.7e-28], N[(x * N[(i * -4.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 4.4e+119], N[(b * c), $MachinePrecision], N[(x * N[(18.0 * N[(y * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.3 \cdot 10^{-75}:\\
\;\;\;\;18 \cdot \left(x \cdot \left(t \cdot \left(y \cdot z\right)\right)\right)\\
\mathbf{elif}\;z \leq -2.1 \cdot 10^{-227}:\\
\;\;\;\;t \cdot \left(a \cdot -4\right)\\
\mathbf{elif}\;z \leq 2.1 \cdot 10^{-195}:\\
\;\;\;\;b \cdot c\\
\mathbf{elif}\;z \leq 3.7 \cdot 10^{-28}:\\
\;\;\;\;x \cdot \left(i \cdot -4\right)\\
\mathbf{elif}\;z \leq 4.4 \cdot 10^{+119}:\\
\;\;\;\;b \cdot c\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(18 \cdot \left(y \cdot \left(z \cdot t\right)\right)\right)\\
\end{array}
\end{array}
if z < -2.3e-75Initial program 86.7%
Taylor expanded in x around 0 85.4%
Taylor expanded in a around 0 81.9%
Taylor expanded in t around inf 45.3%
*-commutative45.3%
associate-*l*45.3%
*-commutative45.3%
Simplified45.3%
if -2.3e-75 < z < -2.1e-227Initial program 81.8%
Taylor expanded in x around 0 92.5%
Taylor expanded in a around inf 31.4%
associate-*r*31.4%
*-commutative31.4%
Simplified31.4%
if -2.1e-227 < z < 2.1e-195 or 3.7000000000000002e-28 < z < 4.4000000000000003e119Initial program 85.0%
Simplified89.0%
Taylor expanded in b around inf 32.2%
if 2.1e-195 < z < 3.7000000000000002e-28Initial program 89.0%
Simplified94.5%
Taylor expanded in i around inf 43.2%
associate-*r*43.2%
*-commutative43.2%
Simplified43.2%
if 4.4000000000000003e119 < z Initial program 73.5%
Taylor expanded in x around 0 75.6%
Taylor expanded in a around 0 73.8%
Taylor expanded in t around inf 56.2%
metadata-eval56.2%
distribute-lft-neg-in56.2%
*-commutative56.2%
associate-*r*57.9%
associate-*l*57.9%
*-commutative57.9%
distribute-rgt-neg-in57.9%
distribute-lft-neg-in57.9%
metadata-eval57.9%
*-commutative57.9%
associate-*r*61.9%
Simplified61.9%
Final simplification42.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 (<= z -7.4e+19)
(* 18.0 (* x (* t (* y z))))
(if (<= z 8.2e+134)
(- (* b c) (* 4.0 (* x i)))
(* x (* 18.0 (* y (* z t)))))))assert(y < z);
assert(j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double tmp;
if (z <= -7.4e+19) {
tmp = 18.0 * (x * (t * (y * z)));
} else if (z <= 8.2e+134) {
tmp = (b * c) - (4.0 * (x * i));
} else {
tmp = x * (18.0 * (y * (z * t)));
}
return tmp;
}
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: tmp
if (z <= (-7.4d+19)) then
tmp = 18.0d0 * (x * (t * (y * z)))
else if (z <= 8.2d+134) then
tmp = (b * c) - (4.0d0 * (x * i))
else
tmp = x * (18.0d0 * (y * (z * t)))
end if
code = tmp
end function
assert y < z;
assert j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double tmp;
if (z <= -7.4e+19) {
tmp = 18.0 * (x * (t * (y * z)));
} else if (z <= 8.2e+134) {
tmp = (b * c) - (4.0 * (x * i));
} else {
tmp = x * (18.0 * (y * (z * t)));
}
return tmp;
}
[y, z] = sort([y, z]) [j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): tmp = 0 if z <= -7.4e+19: tmp = 18.0 * (x * (t * (y * z))) elif z <= 8.2e+134: tmp = (b * c) - (4.0 * (x * i)) else: tmp = x * (18.0 * (y * (z * t))) return tmp
y, z = sort([y, z]) j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) tmp = 0.0 if (z <= -7.4e+19) tmp = Float64(18.0 * Float64(x * Float64(t * Float64(y * z)))); elseif (z <= 8.2e+134) tmp = Float64(Float64(b * c) - Float64(4.0 * Float64(x * i))); else tmp = Float64(x * Float64(18.0 * Float64(y * Float64(z * t)))); end return tmp end
y, z = num2cell(sort([y, z])){:}
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
tmp = 0.0;
if (z <= -7.4e+19)
tmp = 18.0 * (x * (t * (y * z)));
elseif (z <= 8.2e+134)
tmp = (b * c) - (4.0 * (x * i));
else
tmp = x * (18.0 * (y * (z * t)));
end
tmp_2 = tmp;
end
NOTE: y and z should be sorted in increasing order before calling this function. NOTE: j and k should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := If[LessEqual[z, -7.4e+19], N[(18.0 * N[(x * N[(t * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 8.2e+134], N[(N[(b * c), $MachinePrecision] - N[(4.0 * N[(x * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(18.0 * N[(y * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -7.4 \cdot 10^{+19}:\\
\;\;\;\;18 \cdot \left(x \cdot \left(t \cdot \left(y \cdot z\right)\right)\right)\\
\mathbf{elif}\;z \leq 8.2 \cdot 10^{+134}:\\
\;\;\;\;b \cdot c - 4 \cdot \left(x \cdot i\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(18 \cdot \left(y \cdot \left(z \cdot t\right)\right)\right)\\
\end{array}
\end{array}
if z < -7.4e19Initial program 86.6%
Taylor expanded in x around 0 84.9%
Taylor expanded in a around 0 80.3%
Taylor expanded in t around inf 48.7%
*-commutative48.7%
associate-*l*48.7%
*-commutative48.7%
Simplified48.7%
if -7.4e19 < z < 8.2000000000000007e134Initial program 85.9%
Taylor expanded in t around 0 65.4%
Taylor expanded in j around 0 47.5%
if 8.2000000000000007e134 < z Initial program 71.6%
Taylor expanded in x around 0 73.9%
Taylor expanded in a around 0 72.0%
Taylor expanded in t around inf 58.4%
metadata-eval58.4%
distribute-lft-neg-in58.4%
*-commutative58.4%
associate-*r*60.2%
associate-*l*60.3%
*-commutative60.3%
distribute-rgt-neg-in60.3%
distribute-lft-neg-in60.3%
metadata-eval60.3%
*-commutative60.3%
associate-*r*64.5%
Simplified64.5%
Final simplification50.6%
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (* t (* a -4.0))))
(if (<= a -5.6e+83)
t_1
(if (<= a 2.45e-260)
(* b c)
(if (<= a 1.55e+141) (* j (* k -27.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 = t * (a * -4.0);
double tmp;
if (a <= -5.6e+83) {
tmp = t_1;
} else if (a <= 2.45e-260) {
tmp = b * c;
} else if (a <= 1.55e+141) {
tmp = j * (k * -27.0);
} else {
tmp = t_1;
}
return tmp;
}
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: tmp
t_1 = t * (a * (-4.0d0))
if (a <= (-5.6d+83)) then
tmp = t_1
else if (a <= 2.45d-260) then
tmp = b * c
else if (a <= 1.55d+141) then
tmp = j * (k * (-27.0d0))
else
tmp = t_1
end if
code = tmp
end function
assert y < z;
assert j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = t * (a * -4.0);
double tmp;
if (a <= -5.6e+83) {
tmp = t_1;
} else if (a <= 2.45e-260) {
tmp = b * c;
} else if (a <= 1.55e+141) {
tmp = j * (k * -27.0);
} else {
tmp = t_1;
}
return tmp;
}
[y, z] = sort([y, z]) [j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): t_1 = t * (a * -4.0) tmp = 0 if a <= -5.6e+83: tmp = t_1 elif a <= 2.45e-260: tmp = b * c elif a <= 1.55e+141: tmp = j * (k * -27.0) else: tmp = t_1 return tmp
y, z = sort([y, z]) j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(t * Float64(a * -4.0)) tmp = 0.0 if (a <= -5.6e+83) tmp = t_1; elseif (a <= 2.45e-260) tmp = Float64(b * c); elseif (a <= 1.55e+141) tmp = Float64(j * Float64(k * -27.0)); else tmp = t_1; end return tmp end
y, z = num2cell(sort([y, z])){:}
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
t_1 = t * (a * -4.0);
tmp = 0.0;
if (a <= -5.6e+83)
tmp = t_1;
elseif (a <= 2.45e-260)
tmp = b * c;
elseif (a <= 1.55e+141)
tmp = j * (k * -27.0);
else
tmp = t_1;
end
tmp_2 = tmp;
end
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(t * N[(a * -4.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -5.6e+83], t$95$1, If[LessEqual[a, 2.45e-260], N[(b * c), $MachinePrecision], If[LessEqual[a, 1.55e+141], N[(j * N[(k * -27.0), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
t_1 := t \cdot \left(a \cdot -4\right)\\
\mathbf{if}\;a \leq -5.6 \cdot 10^{+83}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;a \leq 2.45 \cdot 10^{-260}:\\
\;\;\;\;b \cdot c\\
\mathbf{elif}\;a \leq 1.55 \cdot 10^{+141}:\\
\;\;\;\;j \cdot \left(k \cdot -27\right)\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if a < -5.6000000000000001e83 or 1.55000000000000002e141 < a Initial program 76.9%
Taylor expanded in x around 0 78.2%
Taylor expanded in a around inf 58.1%
associate-*r*58.1%
*-commutative58.1%
Simplified58.1%
if -5.6000000000000001e83 < a < 2.4500000000000001e-260Initial program 88.9%
Simplified90.9%
Taylor expanded in b around inf 30.6%
if 2.4500000000000001e-260 < a < 1.55000000000000002e141Initial program 83.6%
Simplified83.7%
Taylor expanded in j around inf 31.0%
*-commutative31.0%
associate-*l*31.1%
Simplified31.1%
Final simplification38.6%
NOTE: y and z should be sorted in increasing order before calling this function. NOTE: j and k should be sorted in increasing order before calling this function. (FPCore (x y z t a b c i j k) :precision binary64 (if (<= j -2.1e+67) (* 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 (j <= -2.1e+67) {
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 (j <= (-2.1d+67)) 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 (j <= -2.1e+67) {
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 j <= -2.1e+67: 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 (j <= -2.1e+67) 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 (j <= -2.1e+67)
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[j, -2.1e+67], 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}\;j \leq -2.1 \cdot 10^{+67}:\\
\;\;\;\;j \cdot \left(k \cdot -27\right)\\
\mathbf{else}:\\
\;\;\;\;b \cdot c\\
\end{array}
\end{array}
if j < -2.1000000000000001e67Initial program 75.9%
Simplified78.0%
Taylor expanded in j around inf 41.7%
*-commutative41.7%
associate-*l*41.8%
Simplified41.8%
if -2.1000000000000001e67 < j Initial program 85.6%
Simplified88.0%
Taylor expanded in b around inf 25.6%
Final simplification28.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 (* 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 83.7%
Simplified86.1%
Taylor expanded in b around inf 23.3%
Final simplification23.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 2023287
(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)))