
(FPCore (x y z t a b c i j k) :precision binary64 (- (- (+ (- (* (* (* (* x 18.0) y) z) t) (* (* a 4.0) t)) (* b c)) (* (* x 4.0) i)) (* (* j 27.0) k)))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
return (((((((x * 18.0) * y) * z) * t) - ((a * 4.0) * t)) + (b * c)) - ((x * 4.0) * i)) - ((j * 27.0) * k);
}
real(8) function code(x, y, z, t, a, b, c, i, j, k)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
code = (((((((x * 18.0d0) * y) * z) * t) - ((a * 4.0d0) * t)) + (b * c)) - ((x * 4.0d0) * i)) - ((j * 27.0d0) * k)
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
return (((((((x * 18.0) * y) * z) * t) - ((a * 4.0) * t)) + (b * c)) - ((x * 4.0) * i)) - ((j * 27.0) * k);
}
def code(x, y, z, t, a, b, c, i, j, k): return (((((((x * 18.0) * y) * z) * t) - ((a * 4.0) * t)) + (b * c)) - ((x * 4.0) * i)) - ((j * 27.0) * k)
function code(x, y, z, t, a, b, c, i, j, k) return Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(x * 18.0) * y) * z) * t) - Float64(Float64(a * 4.0) * t)) + Float64(b * c)) - Float64(Float64(x * 4.0) * i)) - Float64(Float64(j * 27.0) * k)) end
function tmp = code(x, y, z, t, a, b, c, i, j, k) tmp = (((((((x * 18.0) * y) * z) * t) - ((a * 4.0) * t)) + (b * c)) - ((x * 4.0) * i)) - ((j * 27.0) * k); end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := N[(N[(N[(N[(N[(N[(N[(N[(x * 18.0), $MachinePrecision] * y), $MachinePrecision] * z), $MachinePrecision] * t), $MachinePrecision] - N[(N[(a * 4.0), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] + N[(b * c), $MachinePrecision]), $MachinePrecision] - N[(N[(x * 4.0), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision] - N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 24 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b c i j k) :precision binary64 (- (- (+ (- (* (* (* (* x 18.0) y) z) t) (* (* a 4.0) t)) (* b c)) (* (* x 4.0) i)) (* (* j 27.0) k)))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
return (((((((x * 18.0) * y) * z) * t) - ((a * 4.0) * t)) + (b * c)) - ((x * 4.0) * i)) - ((j * 27.0) * k);
}
real(8) function code(x, y, z, t, a, b, c, i, j, k)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
code = (((((((x * 18.0d0) * y) * z) * t) - ((a * 4.0d0) * t)) + (b * c)) - ((x * 4.0d0) * i)) - ((j * 27.0d0) * k)
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
return (((((((x * 18.0) * y) * z) * t) - ((a * 4.0) * t)) + (b * c)) - ((x * 4.0) * i)) - ((j * 27.0) * k);
}
def code(x, y, z, t, a, b, c, i, j, k): return (((((((x * 18.0) * y) * z) * t) - ((a * 4.0) * t)) + (b * c)) - ((x * 4.0) * i)) - ((j * 27.0) * k)
function code(x, y, z, t, a, b, c, i, j, k) return Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(x * 18.0) * y) * z) * t) - Float64(Float64(a * 4.0) * t)) + Float64(b * c)) - Float64(Float64(x * 4.0) * i)) - Float64(Float64(j * 27.0) * k)) end
function tmp = code(x, y, z, t, a, b, c, i, j, k) tmp = (((((((x * 18.0) * y) * z) * t) - ((a * 4.0) * t)) + (b * c)) - ((x * 4.0) * i)) - ((j * 27.0) * k); end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := N[(N[(N[(N[(N[(N[(N[(N[(x * 18.0), $MachinePrecision] * y), $MachinePrecision] * z), $MachinePrecision] * t), $MachinePrecision] - N[(N[(a * 4.0), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] + N[(b * c), $MachinePrecision]), $MachinePrecision] - N[(N[(x * 4.0), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision] - N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k
\end{array}
NOTE: j and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1
(-
(-
(+ (- (* (* (* (* x 18.0) y) z) t) (* t (* a 4.0))) (* b c))
(* (* x 4.0) i))
(* (* j 27.0) k))))
(if (<= t_1 1e+208)
t_1
(fma
j
(* k -27.0)
(fma
x
(* i -4.0)
(fma t (fma x (* 18.0 (* y z)) (* a -4.0)) (* b c)))))))assert(j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = (((((((x * 18.0) * y) * z) * t) - (t * (a * 4.0))) + (b * c)) - ((x * 4.0) * i)) - ((j * 27.0) * k);
double tmp;
if (t_1 <= 1e+208) {
tmp = t_1;
} else {
tmp = fma(j, (k * -27.0), fma(x, (i * -4.0), fma(t, fma(x, (18.0 * (y * z)), (a * -4.0)), (b * c))));
}
return tmp;
}
j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(x * 18.0) * y) * z) * t) - Float64(t * Float64(a * 4.0))) + Float64(b * c)) - Float64(Float64(x * 4.0) * i)) - Float64(Float64(j * 27.0) * k)) tmp = 0.0 if (t_1 <= 1e+208) tmp = t_1; else tmp = fma(j, Float64(k * -27.0), fma(x, Float64(i * -4.0), fma(t, fma(x, Float64(18.0 * Float64(y * z)), Float64(a * -4.0)), Float64(b * c)))); end return tmp end
NOTE: j and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(N[(N[(N[(N[(N[(N[(N[(x * 18.0), $MachinePrecision] * y), $MachinePrecision] * z), $MachinePrecision] * t), $MachinePrecision] - N[(t * N[(a * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(b * c), $MachinePrecision]), $MachinePrecision] - N[(N[(x * 4.0), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision] - N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, 1e+208], t$95$1, N[(j * N[(k * -27.0), $MachinePrecision] + N[(x * N[(i * -4.0), $MachinePrecision] + N[(t * N[(x * N[(18.0 * N[(y * z), $MachinePrecision]), $MachinePrecision] + N[(a * -4.0), $MachinePrecision]), $MachinePrecision] + N[(b * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
t_1 := \left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - t \cdot \left(a \cdot 4\right)\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k\\
\mathbf{if}\;t_1 \leq 10^{+208}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(j, k \cdot -27, \mathsf{fma}\left(x, i \cdot -4, \mathsf{fma}\left(t, \mathsf{fma}\left(x, 18 \cdot \left(y \cdot z\right), a \cdot -4\right), b \cdot c\right)\right)\right)\\
\end{array}
\end{array}
if (-.f64 (-.f64 (+.f64 (-.f64 (*.f64 (*.f64 (*.f64 (*.f64 x 18) y) z) t) (*.f64 (*.f64 a 4) t)) (*.f64 b c)) (*.f64 (*.f64 x 4) i)) (*.f64 (*.f64 j 27) k)) < 9.9999999999999998e207Initial program 98.6%
if 9.9999999999999998e207 < (-.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 67.4%
sub-neg67.4%
+-commutative67.4%
associate-*l*67.4%
distribute-rgt-neg-in67.4%
fma-def73.2%
*-commutative73.2%
distribute-rgt-neg-in73.2%
metadata-eval73.2%
sub-neg73.2%
+-commutative73.2%
associate-*l*74.1%
distribute-rgt-neg-in74.1%
Simplified87.5%
Final simplification94.1%
NOTE: j and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (* (* j 27.0) k))
(t_2
(-
(-
(+ (- (* (* (* (* x 18.0) y) z) t) (* t (* a 4.0))) (* b c))
(* (* x 4.0) i))
t_1)))
(if (<= t_2 INFINITY)
t_2
(- (* t (- (* a -4.0) (* -18.0 (* y (* x z))))) t_1))))assert(j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = (j * 27.0) * k;
double t_2 = (((((((x * 18.0) * y) * z) * t) - (t * (a * 4.0))) + (b * c)) - ((x * 4.0) * i)) - t_1;
double tmp;
if (t_2 <= ((double) INFINITY)) {
tmp = t_2;
} else {
tmp = (t * ((a * -4.0) - (-18.0 * (y * (x * z))))) - t_1;
}
return tmp;
}
assert j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = (j * 27.0) * k;
double t_2 = (((((((x * 18.0) * y) * z) * t) - (t * (a * 4.0))) + (b * c)) - ((x * 4.0) * i)) - t_1;
double tmp;
if (t_2 <= Double.POSITIVE_INFINITY) {
tmp = t_2;
} else {
tmp = (t * ((a * -4.0) - (-18.0 * (y * (x * z))))) - t_1;
}
return tmp;
}
[j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): t_1 = (j * 27.0) * k t_2 = (((((((x * 18.0) * y) * z) * t) - (t * (a * 4.0))) + (b * c)) - ((x * 4.0) * i)) - t_1 tmp = 0 if t_2 <= math.inf: tmp = t_2 else: tmp = (t * ((a * -4.0) - (-18.0 * (y * (x * z))))) - t_1 return tmp
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(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) tmp = 0.0 if (t_2 <= Inf) tmp = t_2; else tmp = Float64(Float64(t * Float64(Float64(a * -4.0) - Float64(-18.0 * Float64(y * Float64(x * z))))) - t_1); end return tmp end
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
t_1 = (j * 27.0) * k;
t_2 = (((((((x * 18.0) * y) * z) * t) - (t * (a * 4.0))) + (b * c)) - ((x * 4.0) * i)) - t_1;
tmp = 0.0;
if (t_2 <= Inf)
tmp = t_2;
else
tmp = (t * ((a * -4.0) - (-18.0 * (y * (x * z))))) - t_1;
end
tmp_2 = tmp;
end
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[(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]}, If[LessEqual[t$95$2, Infinity], t$95$2, N[(N[(t * N[(N[(a * -4.0), $MachinePrecision] - N[(-18.0 * N[(y * N[(x * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision]]]]
\begin{array}{l}
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
t_1 := \left(j \cdot 27\right) \cdot k\\
t_2 := \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\\
\mathbf{if}\;t_2 \leq \infty:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;t \cdot \left(a \cdot -4 - -18 \cdot \left(y \cdot \left(x \cdot z\right)\right)\right) - t_1\\
\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 97.4%
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%
Taylor expanded in t around -inf 60.0%
Final simplification93.0%
NOTE: j and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (* y (* x z))) (t_2 (* (* j 27.0) k)) (t_3 (* 4.0 (* x i))))
(if (<= t_2 -2e+108)
(- (* t (- (* a -4.0) (* -18.0 t_1))) t_2)
(if (<= t_2 2e+80)
(- (+ (* b c) (* t (- (* 18.0 t_1) (* a 4.0)))) t_3)
(- (- (* b c) (+ t_3 (* 4.0 (* t a)))) t_2)))))assert(j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = y * (x * z);
double t_2 = (j * 27.0) * k;
double t_3 = 4.0 * (x * i);
double tmp;
if (t_2 <= -2e+108) {
tmp = (t * ((a * -4.0) - (-18.0 * t_1))) - t_2;
} else if (t_2 <= 2e+80) {
tmp = ((b * c) + (t * ((18.0 * t_1) - (a * 4.0)))) - t_3;
} else {
tmp = ((b * c) - (t_3 + (4.0 * (t * a)))) - t_2;
}
return tmp;
}
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 = y * (x * z)
t_2 = (j * 27.0d0) * k
t_3 = 4.0d0 * (x * i)
if (t_2 <= (-2d+108)) then
tmp = (t * ((a * (-4.0d0)) - ((-18.0d0) * t_1))) - t_2
else if (t_2 <= 2d+80) then
tmp = ((b * c) + (t * ((18.0d0 * t_1) - (a * 4.0d0)))) - t_3
else
tmp = ((b * c) - (t_3 + (4.0d0 * (t * a)))) - t_2
end if
code = tmp
end function
assert j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = y * (x * z);
double t_2 = (j * 27.0) * k;
double t_3 = 4.0 * (x * i);
double tmp;
if (t_2 <= -2e+108) {
tmp = (t * ((a * -4.0) - (-18.0 * t_1))) - t_2;
} else if (t_2 <= 2e+80) {
tmp = ((b * c) + (t * ((18.0 * t_1) - (a * 4.0)))) - t_3;
} else {
tmp = ((b * c) - (t_3 + (4.0 * (t * a)))) - t_2;
}
return tmp;
}
[j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): t_1 = y * (x * z) t_2 = (j * 27.0) * k t_3 = 4.0 * (x * i) tmp = 0 if t_2 <= -2e+108: tmp = (t * ((a * -4.0) - (-18.0 * t_1))) - t_2 elif t_2 <= 2e+80: tmp = ((b * c) + (t * ((18.0 * t_1) - (a * 4.0)))) - t_3 else: tmp = ((b * c) - (t_3 + (4.0 * (t * a)))) - t_2 return tmp
j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(y * Float64(x * z)) t_2 = Float64(Float64(j * 27.0) * k) t_3 = Float64(4.0 * Float64(x * i)) tmp = 0.0 if (t_2 <= -2e+108) tmp = Float64(Float64(t * Float64(Float64(a * -4.0) - Float64(-18.0 * t_1))) - t_2); elseif (t_2 <= 2e+80) tmp = Float64(Float64(Float64(b * c) + Float64(t * Float64(Float64(18.0 * t_1) - Float64(a * 4.0)))) - t_3); else tmp = Float64(Float64(Float64(b * c) - Float64(t_3 + Float64(4.0 * Float64(t * a)))) - t_2); end return tmp end
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
t_1 = y * (x * z);
t_2 = (j * 27.0) * k;
t_3 = 4.0 * (x * i);
tmp = 0.0;
if (t_2 <= -2e+108)
tmp = (t * ((a * -4.0) - (-18.0 * t_1))) - t_2;
elseif (t_2 <= 2e+80)
tmp = ((b * c) + (t * ((18.0 * t_1) - (a * 4.0)))) - t_3;
else
tmp = ((b * c) - (t_3 + (4.0 * (t * a)))) - t_2;
end
tmp_2 = tmp;
end
NOTE: j and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(y * N[(x * z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]}, Block[{t$95$3 = N[(4.0 * N[(x * i), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -2e+108], N[(N[(t * N[(N[(a * -4.0), $MachinePrecision] - N[(-18.0 * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$2), $MachinePrecision], If[LessEqual[t$95$2, 2e+80], N[(N[(N[(b * c), $MachinePrecision] + N[(t * N[(N[(18.0 * t$95$1), $MachinePrecision] - N[(a * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$3), $MachinePrecision], N[(N[(N[(b * c), $MachinePrecision] - N[(t$95$3 + N[(4.0 * N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$2), $MachinePrecision]]]]]]
\begin{array}{l}
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
t_1 := y \cdot \left(x \cdot z\right)\\
t_2 := \left(j \cdot 27\right) \cdot k\\
t_3 := 4 \cdot \left(x \cdot i\right)\\
\mathbf{if}\;t_2 \leq -2 \cdot 10^{+108}:\\
\;\;\;\;t \cdot \left(a \cdot -4 - -18 \cdot t_1\right) - t_2\\
\mathbf{elif}\;t_2 \leq 2 \cdot 10^{+80}:\\
\;\;\;\;\left(b \cdot c + t \cdot \left(18 \cdot t_1 - a \cdot 4\right)\right) - t_3\\
\mathbf{else}:\\
\;\;\;\;\left(b \cdot c - \left(t_3 + 4 \cdot \left(t \cdot a\right)\right)\right) - t_2\\
\end{array}
\end{array}
if (*.f64 (*.f64 j 27) k) < -2.0000000000000001e108Initial program 78.6%
Taylor expanded in t around -inf 83.6%
if -2.0000000000000001e108 < (*.f64 (*.f64 j 27) k) < 2e80Initial program 89.3%
sub-neg89.3%
associate-+l-89.3%
sub-neg89.3%
sub-neg89.3%
distribute-rgt-out--89.3%
associate-*l*86.2%
distribute-lft-neg-in86.2%
cancel-sign-sub86.2%
associate-*l*86.8%
associate-*l*86.8%
Simplified86.8%
Taylor expanded in j around 0 86.3%
if 2e80 < (*.f64 (*.f64 j 27) k) Initial program 82.0%
Taylor expanded in y around 0 81.3%
Final simplification84.8%
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 (or (<= t -3.8e-44) (not (<= t 1e-223)))
(-
(-
(- (* b c) (* (* x 4.0) i))
(* t (- (* a 4.0) (* x (* 18.0 (* y z))))))
t_1)
(- (- (+ (* b c) (* 18.0 (* y (* t (* x z))))) (* 4.0 (* x i))) t_1))))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 <= -3.8e-44) || !(t <= 1e-223)) {
tmp = (((b * c) - ((x * 4.0) * i)) - (t * ((a * 4.0) - (x * (18.0 * (y * z)))))) - t_1;
} else {
tmp = (((b * c) + (18.0 * (y * (t * (x * z))))) - (4.0 * (x * i))) - t_1;
}
return tmp;
}
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 <= (-3.8d-44)) .or. (.not. (t <= 1d-223))) then
tmp = (((b * c) - ((x * 4.0d0) * i)) - (t * ((a * 4.0d0) - (x * (18.0d0 * (y * z)))))) - t_1
else
tmp = (((b * c) + (18.0d0 * (y * (t * (x * z))))) - (4.0d0 * (x * i))) - t_1
end if
code = tmp
end function
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 <= -3.8e-44) || !(t <= 1e-223)) {
tmp = (((b * c) - ((x * 4.0) * i)) - (t * ((a * 4.0) - (x * (18.0 * (y * z)))))) - t_1;
} else {
tmp = (((b * c) + (18.0 * (y * (t * (x * z))))) - (4.0 * (x * i))) - t_1;
}
return tmp;
}
[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 <= -3.8e-44) or not (t <= 1e-223): tmp = (((b * c) - ((x * 4.0) * i)) - (t * ((a * 4.0) - (x * (18.0 * (y * z)))))) - t_1 else: tmp = (((b * c) + (18.0 * (y * (t * (x * z))))) - (4.0 * (x * i))) - t_1 return tmp
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 <= -3.8e-44) || !(t <= 1e-223)) tmp = Float64(Float64(Float64(Float64(b * c) - Float64(Float64(x * 4.0) * i)) - Float64(t * Float64(Float64(a * 4.0) - Float64(x * Float64(18.0 * Float64(y * z)))))) - t_1); else tmp = Float64(Float64(Float64(Float64(b * c) + Float64(18.0 * Float64(y * Float64(t * Float64(x * z))))) - Float64(4.0 * Float64(x * i))) - t_1); end return tmp end
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 <= -3.8e-44) || ~((t <= 1e-223)))
tmp = (((b * c) - ((x * 4.0) * i)) - (t * ((a * 4.0) - (x * (18.0 * (y * z)))))) - t_1;
else
tmp = (((b * c) + (18.0 * (y * (t * (x * z))))) - (4.0 * (x * i))) - t_1;
end
tmp_2 = tmp;
end
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[Or[LessEqual[t, -3.8e-44], N[Not[LessEqual[t, 1e-223]], $MachinePrecision]], N[(N[(N[(N[(b * c), $MachinePrecision] - N[(N[(x * 4.0), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision] - N[(t * N[(N[(a * 4.0), $MachinePrecision] - N[(x * N[(18.0 * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], N[(N[(N[(N[(b * c), $MachinePrecision] + N[(18.0 * N[(y * N[(t * N[(x * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(4.0 * N[(x * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision]]]
\begin{array}{l}
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
t_1 := \left(j \cdot 27\right) \cdot k\\
\mathbf{if}\;t \leq -3.8 \cdot 10^{-44} \lor \neg \left(t \leq 10^{-223}\right):\\
\;\;\;\;\left(\left(b \cdot c - \left(x \cdot 4\right) \cdot i\right) - t \cdot \left(a \cdot 4 - x \cdot \left(18 \cdot \left(y \cdot z\right)\right)\right)\right) - t_1\\
\mathbf{else}:\\
\;\;\;\;\left(\left(b \cdot c + 18 \cdot \left(y \cdot \left(t \cdot \left(x \cdot z\right)\right)\right)\right) - 4 \cdot \left(x \cdot i\right)\right) - t_1\\
\end{array}
\end{array}
if t < -3.8000000000000001e-44 or 9.9999999999999997e-224 < t Initial program 84.9%
associate--l+84.9%
distribute-rgt-out--86.5%
associate-*r*86.4%
associate-*l*86.5%
*-commutative86.5%
Applied egg-rr86.5%
if -3.8000000000000001e-44 < t < 9.9999999999999997e-224Initial program 88.8%
Taylor expanded in a around 0 88.9%
Final simplification87.1%
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 -7.2e-109) (not (<= t 1.22e-60)))
(-
(+ (* t (- (* (* x 18.0) (* y z)) (* a 4.0))) (* b c))
(+ (* x (* 4.0 i)) (* j (* 27.0 k))))
(- (- (* b c) (+ (* 4.0 (* x i)) (* 4.0 (* t a)))) (* (* j 27.0) k))))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 <= -7.2e-109) || !(t <= 1.22e-60)) {
tmp = ((t * (((x * 18.0) * (y * z)) - (a * 4.0))) + (b * c)) - ((x * (4.0 * i)) + (j * (27.0 * k)));
} else {
tmp = ((b * c) - ((4.0 * (x * i)) + (4.0 * (t * a)))) - ((j * 27.0) * k);
}
return tmp;
}
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 <= (-7.2d-109)) .or. (.not. (t <= 1.22d-60))) then
tmp = ((t * (((x * 18.0d0) * (y * z)) - (a * 4.0d0))) + (b * c)) - ((x * (4.0d0 * i)) + (j * (27.0d0 * k)))
else
tmp = ((b * c) - ((4.0d0 * (x * i)) + (4.0d0 * (t * a)))) - ((j * 27.0d0) * k)
end if
code = tmp
end function
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 <= -7.2e-109) || !(t <= 1.22e-60)) {
tmp = ((t * (((x * 18.0) * (y * z)) - (a * 4.0))) + (b * c)) - ((x * (4.0 * i)) + (j * (27.0 * k)));
} else {
tmp = ((b * c) - ((4.0 * (x * i)) + (4.0 * (t * a)))) - ((j * 27.0) * k);
}
return tmp;
}
[j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): tmp = 0 if (t <= -7.2e-109) or not (t <= 1.22e-60): tmp = ((t * (((x * 18.0) * (y * z)) - (a * 4.0))) + (b * c)) - ((x * (4.0 * i)) + (j * (27.0 * k))) else: tmp = ((b * c) - ((4.0 * (x * i)) + (4.0 * (t * a)))) - ((j * 27.0) * k) return tmp
j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) tmp = 0.0 if ((t <= -7.2e-109) || !(t <= 1.22e-60)) tmp = Float64(Float64(Float64(t * Float64(Float64(Float64(x * 18.0) * Float64(y * z)) - Float64(a * 4.0))) + Float64(b * c)) - Float64(Float64(x * Float64(4.0 * i)) + Float64(j * Float64(27.0 * k)))); else tmp = Float64(Float64(Float64(b * c) - Float64(Float64(4.0 * Float64(x * i)) + Float64(4.0 * Float64(t * a)))) - Float64(Float64(j * 27.0) * k)); end return tmp end
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 <= -7.2e-109) || ~((t <= 1.22e-60)))
tmp = ((t * (((x * 18.0) * (y * z)) - (a * 4.0))) + (b * c)) - ((x * (4.0 * i)) + (j * (27.0 * k)));
else
tmp = ((b * c) - ((4.0 * (x * i)) + (4.0 * (t * a)))) - ((j * 27.0) * k);
end
tmp_2 = tmp;
end
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, -7.2e-109], N[Not[LessEqual[t, 1.22e-60]], $MachinePrecision]], N[(N[(N[(t * N[(N[(N[(x * 18.0), $MachinePrecision] * N[(y * z), $MachinePrecision]), $MachinePrecision] - N[(a * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(b * c), $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[(N[(4.0 * N[(x * i), $MachinePrecision]), $MachinePrecision] + N[(4.0 * N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -7.2 \cdot 10^{-109} \lor \neg \left(t \leq 1.22 \cdot 10^{-60}\right):\\
\;\;\;\;\left(t \cdot \left(\left(x \cdot 18\right) \cdot \left(y \cdot z\right) - a \cdot 4\right) + b \cdot c\right) - \left(x \cdot \left(4 \cdot i\right) + j \cdot \left(27 \cdot k\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(b \cdot c - \left(4 \cdot \left(x \cdot i\right) + 4 \cdot \left(t \cdot a\right)\right)\right) - \left(j \cdot 27\right) \cdot k\\
\end{array}
\end{array}
if t < -7.2000000000000001e-109 or 1.22e-60 < t Initial program 85.0%
sub-neg85.0%
associate-+l-85.0%
sub-neg85.0%
sub-neg85.0%
distribute-rgt-out--86.7%
associate-*l*87.8%
distribute-lft-neg-in87.8%
cancel-sign-sub87.8%
associate-*l*88.4%
associate-*l*88.4%
Simplified88.4%
if -7.2000000000000001e-109 < t < 1.22e-60Initial program 88.0%
Taylor expanded in y around 0 89.5%
Final simplification88.7%
NOTE: j and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (* (* j 27.0) k))
(t_2 (- (* b c) t_1))
(t_3 (* t (- (* 18.0 (* z (* x y))) (* a 4.0)))))
(if (<= t -2.1e+34)
t_3
(if (<= t -1.45e-19)
t_2
(if (<= t -1.65e-108)
(- (* (* x 18.0) (* t (* y z))) t_1)
(if (<= t -2.1e-222)
t_2
(if (<= t 3.1e-258)
(- (* i (* x -4.0)) t_1)
(if (<= t 5.6e-151)
t_2
(if (<= t 2.3e-138)
(* x (- (* 18.0 (* y (* z t))) (* 4.0 i)))
(if (<= t 7e-136)
(- (* b c) (* 4.0 (* x i)))
(if (<= t 4.4e+32) t_2 t_3)))))))))))assert(j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = (j * 27.0) * k;
double t_2 = (b * c) - t_1;
double t_3 = t * ((18.0 * (z * (x * y))) - (a * 4.0));
double tmp;
if (t <= -2.1e+34) {
tmp = t_3;
} else if (t <= -1.45e-19) {
tmp = t_2;
} else if (t <= -1.65e-108) {
tmp = ((x * 18.0) * (t * (y * z))) - t_1;
} else if (t <= -2.1e-222) {
tmp = t_2;
} else if (t <= 3.1e-258) {
tmp = (i * (x * -4.0)) - t_1;
} else if (t <= 5.6e-151) {
tmp = t_2;
} else if (t <= 2.3e-138) {
tmp = x * ((18.0 * (y * (z * t))) - (4.0 * i));
} else if (t <= 7e-136) {
tmp = (b * c) - (4.0 * (x * i));
} else if (t <= 4.4e+32) {
tmp = t_2;
} else {
tmp = t_3;
}
return tmp;
}
NOTE: j and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_1 = (j * 27.0d0) * k
t_2 = (b * c) - t_1
t_3 = t * ((18.0d0 * (z * (x * y))) - (a * 4.0d0))
if (t <= (-2.1d+34)) then
tmp = t_3
else if (t <= (-1.45d-19)) then
tmp = t_2
else if (t <= (-1.65d-108)) then
tmp = ((x * 18.0d0) * (t * (y * z))) - t_1
else if (t <= (-2.1d-222)) then
tmp = t_2
else if (t <= 3.1d-258) then
tmp = (i * (x * (-4.0d0))) - t_1
else if (t <= 5.6d-151) then
tmp = t_2
else if (t <= 2.3d-138) then
tmp = x * ((18.0d0 * (y * (z * t))) - (4.0d0 * i))
else if (t <= 7d-136) then
tmp = (b * c) - (4.0d0 * (x * i))
else if (t <= 4.4d+32) then
tmp = t_2
else
tmp = t_3
end if
code = tmp
end function
assert j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = (j * 27.0) * k;
double t_2 = (b * c) - t_1;
double t_3 = t * ((18.0 * (z * (x * y))) - (a * 4.0));
double tmp;
if (t <= -2.1e+34) {
tmp = t_3;
} else if (t <= -1.45e-19) {
tmp = t_2;
} else if (t <= -1.65e-108) {
tmp = ((x * 18.0) * (t * (y * z))) - t_1;
} else if (t <= -2.1e-222) {
tmp = t_2;
} else if (t <= 3.1e-258) {
tmp = (i * (x * -4.0)) - t_1;
} else if (t <= 5.6e-151) {
tmp = t_2;
} else if (t <= 2.3e-138) {
tmp = x * ((18.0 * (y * (z * t))) - (4.0 * i));
} else if (t <= 7e-136) {
tmp = (b * c) - (4.0 * (x * i));
} else if (t <= 4.4e+32) {
tmp = t_2;
} else {
tmp = t_3;
}
return tmp;
}
[j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): t_1 = (j * 27.0) * k t_2 = (b * c) - t_1 t_3 = t * ((18.0 * (z * (x * y))) - (a * 4.0)) tmp = 0 if t <= -2.1e+34: tmp = t_3 elif t <= -1.45e-19: tmp = t_2 elif t <= -1.65e-108: tmp = ((x * 18.0) * (t * (y * z))) - t_1 elif t <= -2.1e-222: tmp = t_2 elif t <= 3.1e-258: tmp = (i * (x * -4.0)) - t_1 elif t <= 5.6e-151: tmp = t_2 elif t <= 2.3e-138: tmp = x * ((18.0 * (y * (z * t))) - (4.0 * i)) elif t <= 7e-136: tmp = (b * c) - (4.0 * (x * i)) elif t <= 4.4e+32: tmp = t_2 else: tmp = t_3 return tmp
j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(Float64(j * 27.0) * k) t_2 = Float64(Float64(b * c) - t_1) t_3 = Float64(t * Float64(Float64(18.0 * Float64(z * Float64(x * y))) - Float64(a * 4.0))) tmp = 0.0 if (t <= -2.1e+34) tmp = t_3; elseif (t <= -1.45e-19) tmp = t_2; elseif (t <= -1.65e-108) tmp = Float64(Float64(Float64(x * 18.0) * Float64(t * Float64(y * z))) - t_1); elseif (t <= -2.1e-222) tmp = t_2; elseif (t <= 3.1e-258) tmp = Float64(Float64(i * Float64(x * -4.0)) - t_1); elseif (t <= 5.6e-151) tmp = t_2; elseif (t <= 2.3e-138) tmp = Float64(x * Float64(Float64(18.0 * Float64(y * Float64(z * t))) - Float64(4.0 * i))); elseif (t <= 7e-136) tmp = Float64(Float64(b * c) - Float64(4.0 * Float64(x * i))); elseif (t <= 4.4e+32) tmp = t_2; else tmp = t_3; end return tmp end
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
t_1 = (j * 27.0) * k;
t_2 = (b * c) - t_1;
t_3 = t * ((18.0 * (z * (x * y))) - (a * 4.0));
tmp = 0.0;
if (t <= -2.1e+34)
tmp = t_3;
elseif (t <= -1.45e-19)
tmp = t_2;
elseif (t <= -1.65e-108)
tmp = ((x * 18.0) * (t * (y * z))) - t_1;
elseif (t <= -2.1e-222)
tmp = t_2;
elseif (t <= 3.1e-258)
tmp = (i * (x * -4.0)) - t_1;
elseif (t <= 5.6e-151)
tmp = t_2;
elseif (t <= 2.3e-138)
tmp = x * ((18.0 * (y * (z * t))) - (4.0 * i));
elseif (t <= 7e-136)
tmp = (b * c) - (4.0 * (x * i));
elseif (t <= 4.4e+32)
tmp = t_2;
else
tmp = t_3;
end
tmp_2 = tmp;
end
NOTE: j and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]}, Block[{t$95$2 = N[(N[(b * c), $MachinePrecision] - t$95$1), $MachinePrecision]}, 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[t, -2.1e+34], t$95$3, If[LessEqual[t, -1.45e-19], t$95$2, If[LessEqual[t, -1.65e-108], N[(N[(N[(x * 18.0), $MachinePrecision] * N[(t * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], If[LessEqual[t, -2.1e-222], t$95$2, If[LessEqual[t, 3.1e-258], N[(N[(i * N[(x * -4.0), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], If[LessEqual[t, 5.6e-151], t$95$2, If[LessEqual[t, 2.3e-138], N[(x * N[(N[(18.0 * N[(y * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(4.0 * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 7e-136], N[(N[(b * c), $MachinePrecision] - N[(4.0 * N[(x * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 4.4e+32], t$95$2, t$95$3]]]]]]]]]]]]
\begin{array}{l}
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
t_1 := \left(j \cdot 27\right) \cdot k\\
t_2 := b \cdot c - t_1\\
t_3 := t \cdot \left(18 \cdot \left(z \cdot \left(x \cdot y\right)\right) - a \cdot 4\right)\\
\mathbf{if}\;t \leq -2.1 \cdot 10^{+34}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;t \leq -1.45 \cdot 10^{-19}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t \leq -1.65 \cdot 10^{-108}:\\
\;\;\;\;\left(x \cdot 18\right) \cdot \left(t \cdot \left(y \cdot z\right)\right) - t_1\\
\mathbf{elif}\;t \leq -2.1 \cdot 10^{-222}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t \leq 3.1 \cdot 10^{-258}:\\
\;\;\;\;i \cdot \left(x \cdot -4\right) - t_1\\
\mathbf{elif}\;t \leq 5.6 \cdot 10^{-151}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t \leq 2.3 \cdot 10^{-138}:\\
\;\;\;\;x \cdot \left(18 \cdot \left(y \cdot \left(z \cdot t\right)\right) - 4 \cdot i\right)\\
\mathbf{elif}\;t \leq 7 \cdot 10^{-136}:\\
\;\;\;\;b \cdot c - 4 \cdot \left(x \cdot i\right)\\
\mathbf{elif}\;t \leq 4.4 \cdot 10^{+32}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;t_3\\
\end{array}
\end{array}
if t < -2.10000000000000017e34 or 4.40000000000000002e32 < t Initial program 83.6%
sub-neg83.6%
associate-+l-83.6%
sub-neg83.6%
sub-neg83.6%
distribute-rgt-out--86.2%
associate-*l*86.2%
distribute-lft-neg-in86.2%
cancel-sign-sub86.2%
associate-*l*86.2%
associate-*l*86.2%
Simplified86.2%
Taylor expanded in t around inf 73.6%
pow173.6%
*-commutative73.6%
Applied egg-rr73.6%
unpow173.6%
associate-*r*72.8%
*-commutative72.8%
Simplified72.8%
if -2.10000000000000017e34 < t < -1.45e-19 or -1.6500000000000001e-108 < t < -2.0999999999999999e-222 or 3.09999999999999999e-258 < t < 5.6000000000000002e-151 or 7.00000000000000058e-136 < t < 4.40000000000000002e32Initial program 89.5%
associate--l+89.5%
distribute-rgt-out--89.6%
associate-*r*80.4%
associate-*l*80.4%
*-commutative80.4%
Applied egg-rr80.4%
Taylor expanded in b around inf 69.4%
if -1.45e-19 < t < -1.6500000000000001e-108Initial program 81.8%
associate--l+81.8%
distribute-rgt-out--81.8%
associate-*r*88.7%
associate-*l*88.7%
*-commutative88.7%
Applied egg-rr88.7%
Taylor expanded in x around inf 65.7%
Taylor expanded in y around inf 56.9%
associate-*r*56.9%
*-commutative56.9%
associate-*r*58.3%
associate-*r*58.3%
associate-*l*58.3%
*-commutative58.3%
associate-*l*58.3%
Simplified58.3%
if -2.0999999999999999e-222 < t < 3.09999999999999999e-258Initial program 95.4%
associate--l+95.4%
distribute-rgt-out--95.4%
associate-*r*90.8%
associate-*l*90.8%
*-commutative90.8%
Applied egg-rr90.8%
Taylor expanded in i around inf 82.2%
*-commutative82.2%
*-commutative82.2%
*-commutative82.2%
associate-*l*82.2%
Simplified82.2%
if 5.6000000000000002e-151 < t < 2.2999999999999999e-138Initial program 50.0%
sub-neg50.0%
associate-+l-50.0%
sub-neg50.0%
sub-neg50.0%
distribute-rgt-out--50.0%
associate-*l*75.0%
distribute-lft-neg-in75.0%
cancel-sign-sub75.0%
associate-*l*75.0%
associate-*l*75.0%
Simplified75.0%
Taylor expanded in x around inf 100.0%
if 2.2999999999999999e-138 < t < 7.00000000000000058e-136Initial program 100.0%
sub-neg100.0%
associate-+l-100.0%
sub-neg100.0%
sub-neg100.0%
distribute-rgt-out--100.0%
associate-*l*100.0%
distribute-lft-neg-in100.0%
cancel-sign-sub100.0%
associate-*l*100.0%
associate-*l*100.0%
Simplified100.0%
Taylor expanded in j around 0 100.0%
Taylor expanded in y around 0 100.0%
*-commutative3.0%
Simplified100.0%
Taylor expanded in t around 0 100.0%
Final simplification71.5%
NOTE: j and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (* 4.0 (* x i)))
(t_2 (- (+ (* b c) (* 18.0 (* y (* t (* x z))))) t_1)))
(if (<= b -3.1e+224)
t_2
(if (<= b -1.45e-53)
(- (- (* b c) (+ t_1 (* 4.0 (* t a)))) (* (* j 27.0) k))
(if (<= b 6.8e-52)
(+
(* -27.0 (* j k))
(+ (* -4.0 (* t a)) (* x (+ (* 18.0 (* y (* z t))) (* i -4.0)))))
t_2)))))assert(j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = 4.0 * (x * i);
double t_2 = ((b * c) + (18.0 * (y * (t * (x * z))))) - t_1;
double tmp;
if (b <= -3.1e+224) {
tmp = t_2;
} else if (b <= -1.45e-53) {
tmp = ((b * c) - (t_1 + (4.0 * (t * a)))) - ((j * 27.0) * k);
} else if (b <= 6.8e-52) {
tmp = (-27.0 * (j * k)) + ((-4.0 * (t * a)) + (x * ((18.0 * (y * (z * t))) + (i * -4.0))));
} else {
tmp = t_2;
}
return tmp;
}
NOTE: j and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = 4.0d0 * (x * i)
t_2 = ((b * c) + (18.0d0 * (y * (t * (x * z))))) - t_1
if (b <= (-3.1d+224)) then
tmp = t_2
else if (b <= (-1.45d-53)) then
tmp = ((b * c) - (t_1 + (4.0d0 * (t * a)))) - ((j * 27.0d0) * k)
else if (b <= 6.8d-52) then
tmp = ((-27.0d0) * (j * k)) + (((-4.0d0) * (t * a)) + (x * ((18.0d0 * (y * (z * t))) + (i * (-4.0d0)))))
else
tmp = t_2
end if
code = tmp
end function
assert j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = 4.0 * (x * i);
double t_2 = ((b * c) + (18.0 * (y * (t * (x * z))))) - t_1;
double tmp;
if (b <= -3.1e+224) {
tmp = t_2;
} else if (b <= -1.45e-53) {
tmp = ((b * c) - (t_1 + (4.0 * (t * a)))) - ((j * 27.0) * k);
} else if (b <= 6.8e-52) {
tmp = (-27.0 * (j * k)) + ((-4.0 * (t * a)) + (x * ((18.0 * (y * (z * t))) + (i * -4.0))));
} else {
tmp = t_2;
}
return tmp;
}
[j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): t_1 = 4.0 * (x * i) t_2 = ((b * c) + (18.0 * (y * (t * (x * z))))) - t_1 tmp = 0 if b <= -3.1e+224: tmp = t_2 elif b <= -1.45e-53: tmp = ((b * c) - (t_1 + (4.0 * (t * a)))) - ((j * 27.0) * k) elif b <= 6.8e-52: tmp = (-27.0 * (j * k)) + ((-4.0 * (t * a)) + (x * ((18.0 * (y * (z * t))) + (i * -4.0)))) else: tmp = t_2 return tmp
j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(4.0 * Float64(x * i)) t_2 = Float64(Float64(Float64(b * c) + Float64(18.0 * Float64(y * Float64(t * Float64(x * z))))) - t_1) tmp = 0.0 if (b <= -3.1e+224) tmp = t_2; elseif (b <= -1.45e-53) tmp = Float64(Float64(Float64(b * c) - Float64(t_1 + Float64(4.0 * Float64(t * a)))) - Float64(Float64(j * 27.0) * k)); elseif (b <= 6.8e-52) tmp = Float64(Float64(-27.0 * Float64(j * k)) + Float64(Float64(-4.0 * Float64(t * a)) + Float64(x * Float64(Float64(18.0 * Float64(y * Float64(z * t))) + Float64(i * -4.0))))); else tmp = t_2; end return tmp end
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
t_1 = 4.0 * (x * i);
t_2 = ((b * c) + (18.0 * (y * (t * (x * z))))) - t_1;
tmp = 0.0;
if (b <= -3.1e+224)
tmp = t_2;
elseif (b <= -1.45e-53)
tmp = ((b * c) - (t_1 + (4.0 * (t * a)))) - ((j * 27.0) * k);
elseif (b <= 6.8e-52)
tmp = (-27.0 * (j * k)) + ((-4.0 * (t * a)) + (x * ((18.0 * (y * (z * t))) + (i * -4.0))));
else
tmp = t_2;
end
tmp_2 = tmp;
end
NOTE: j and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(4.0 * N[(x * i), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(b * c), $MachinePrecision] + N[(18.0 * N[(y * N[(t * N[(x * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision]}, If[LessEqual[b, -3.1e+224], t$95$2, If[LessEqual[b, -1.45e-53], N[(N[(N[(b * c), $MachinePrecision] - N[(t$95$1 + N[(4.0 * N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 6.8e-52], N[(N[(-27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision] + N[(N[(-4.0 * N[(t * a), $MachinePrecision]), $MachinePrecision] + N[(x * N[(N[(18.0 * N[(y * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(i * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$2]]]]]
\begin{array}{l}
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
t_1 := 4 \cdot \left(x \cdot i\right)\\
t_2 := \left(b \cdot c + 18 \cdot \left(y \cdot \left(t \cdot \left(x \cdot z\right)\right)\right)\right) - t_1\\
\mathbf{if}\;b \leq -3.1 \cdot 10^{+224}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;b \leq -1.45 \cdot 10^{-53}:\\
\;\;\;\;\left(b \cdot c - \left(t_1 + 4 \cdot \left(t \cdot a\right)\right)\right) - \left(j \cdot 27\right) \cdot k\\
\mathbf{elif}\;b \leq 6.8 \cdot 10^{-52}:\\
\;\;\;\;-27 \cdot \left(j \cdot k\right) + \left(-4 \cdot \left(t \cdot a\right) + x \cdot \left(18 \cdot \left(y \cdot \left(z \cdot t\right)\right) + i \cdot -4\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if b < -3.0999999999999999e224 or 6.80000000000000035e-52 < b Initial program 83.8%
sub-neg83.8%
associate-+l-83.8%
sub-neg83.8%
sub-neg83.8%
distribute-rgt-out--84.8%
associate-*l*83.8%
distribute-lft-neg-in83.8%
cancel-sign-sub83.8%
associate-*l*83.8%
associate-*l*83.8%
Simplified83.8%
Taylor expanded in j around 0 74.7%
Taylor expanded in a around 0 65.6%
if -3.0999999999999999e224 < b < -1.4499999999999999e-53Initial program 89.6%
Taylor expanded in y around 0 86.4%
if -1.4499999999999999e-53 < b < 6.80000000000000035e-52Initial program 86.0%
Simplified90.0%
Taylor expanded in b around 0 86.1%
Final simplification78.3%
NOTE: j and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (* (* j 27.0) k))
(t_2 (- (* b c) t_1))
(t_3 (* t (- (* 18.0 (* z (* x y))) (* a 4.0)))))
(if (<= t -1e+35)
t_3
(if (<= t -2.45e-222)
t_2
(if (<= t 3.8e-259)
(- (* i (* x -4.0)) t_1)
(if (<= t 6e-151)
t_2
(if (<= t 2.2e-138)
(* x (- (* 18.0 (* y (* z t))) (* 4.0 i)))
(if (<= t 2.9e-136)
(- (* b c) (* 4.0 (* x i)))
(if (<= t 1.7e+33) t_2 t_3)))))))))assert(j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = (j * 27.0) * k;
double t_2 = (b * c) - t_1;
double t_3 = t * ((18.0 * (z * (x * y))) - (a * 4.0));
double tmp;
if (t <= -1e+35) {
tmp = t_3;
} else if (t <= -2.45e-222) {
tmp = t_2;
} else if (t <= 3.8e-259) {
tmp = (i * (x * -4.0)) - t_1;
} else if (t <= 6e-151) {
tmp = t_2;
} else if (t <= 2.2e-138) {
tmp = x * ((18.0 * (y * (z * t))) - (4.0 * i));
} else if (t <= 2.9e-136) {
tmp = (b * c) - (4.0 * (x * i));
} else if (t <= 1.7e+33) {
tmp = t_2;
} else {
tmp = t_3;
}
return tmp;
}
NOTE: j and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_1 = (j * 27.0d0) * k
t_2 = (b * c) - t_1
t_3 = t * ((18.0d0 * (z * (x * y))) - (a * 4.0d0))
if (t <= (-1d+35)) then
tmp = t_3
else if (t <= (-2.45d-222)) then
tmp = t_2
else if (t <= 3.8d-259) then
tmp = (i * (x * (-4.0d0))) - t_1
else if (t <= 6d-151) then
tmp = t_2
else if (t <= 2.2d-138) then
tmp = x * ((18.0d0 * (y * (z * t))) - (4.0d0 * i))
else if (t <= 2.9d-136) then
tmp = (b * c) - (4.0d0 * (x * i))
else if (t <= 1.7d+33) then
tmp = t_2
else
tmp = t_3
end if
code = tmp
end function
assert j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = (j * 27.0) * k;
double t_2 = (b * c) - t_1;
double t_3 = t * ((18.0 * (z * (x * y))) - (a * 4.0));
double tmp;
if (t <= -1e+35) {
tmp = t_3;
} else if (t <= -2.45e-222) {
tmp = t_2;
} else if (t <= 3.8e-259) {
tmp = (i * (x * -4.0)) - t_1;
} else if (t <= 6e-151) {
tmp = t_2;
} else if (t <= 2.2e-138) {
tmp = x * ((18.0 * (y * (z * t))) - (4.0 * i));
} else if (t <= 2.9e-136) {
tmp = (b * c) - (4.0 * (x * i));
} else if (t <= 1.7e+33) {
tmp = t_2;
} else {
tmp = t_3;
}
return tmp;
}
[j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): t_1 = (j * 27.0) * k t_2 = (b * c) - t_1 t_3 = t * ((18.0 * (z * (x * y))) - (a * 4.0)) tmp = 0 if t <= -1e+35: tmp = t_3 elif t <= -2.45e-222: tmp = t_2 elif t <= 3.8e-259: tmp = (i * (x * -4.0)) - t_1 elif t <= 6e-151: tmp = t_2 elif t <= 2.2e-138: tmp = x * ((18.0 * (y * (z * t))) - (4.0 * i)) elif t <= 2.9e-136: tmp = (b * c) - (4.0 * (x * i)) elif t <= 1.7e+33: tmp = t_2 else: tmp = t_3 return tmp
j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(Float64(j * 27.0) * k) t_2 = Float64(Float64(b * c) - t_1) t_3 = Float64(t * Float64(Float64(18.0 * Float64(z * Float64(x * y))) - Float64(a * 4.0))) tmp = 0.0 if (t <= -1e+35) tmp = t_3; elseif (t <= -2.45e-222) tmp = t_2; elseif (t <= 3.8e-259) tmp = Float64(Float64(i * Float64(x * -4.0)) - t_1); elseif (t <= 6e-151) tmp = t_2; elseif (t <= 2.2e-138) tmp = Float64(x * Float64(Float64(18.0 * Float64(y * Float64(z * t))) - Float64(4.0 * i))); elseif (t <= 2.9e-136) tmp = Float64(Float64(b * c) - Float64(4.0 * Float64(x * i))); elseif (t <= 1.7e+33) tmp = t_2; else tmp = t_3; end return tmp end
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
t_1 = (j * 27.0) * k;
t_2 = (b * c) - t_1;
t_3 = t * ((18.0 * (z * (x * y))) - (a * 4.0));
tmp = 0.0;
if (t <= -1e+35)
tmp = t_3;
elseif (t <= -2.45e-222)
tmp = t_2;
elseif (t <= 3.8e-259)
tmp = (i * (x * -4.0)) - t_1;
elseif (t <= 6e-151)
tmp = t_2;
elseif (t <= 2.2e-138)
tmp = x * ((18.0 * (y * (z * t))) - (4.0 * i));
elseif (t <= 2.9e-136)
tmp = (b * c) - (4.0 * (x * i));
elseif (t <= 1.7e+33)
tmp = t_2;
else
tmp = t_3;
end
tmp_2 = tmp;
end
NOTE: j and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]}, Block[{t$95$2 = N[(N[(b * c), $MachinePrecision] - t$95$1), $MachinePrecision]}, 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[t, -1e+35], t$95$3, If[LessEqual[t, -2.45e-222], t$95$2, If[LessEqual[t, 3.8e-259], N[(N[(i * N[(x * -4.0), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], If[LessEqual[t, 6e-151], t$95$2, If[LessEqual[t, 2.2e-138], N[(x * N[(N[(18.0 * N[(y * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(4.0 * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 2.9e-136], N[(N[(b * c), $MachinePrecision] - N[(4.0 * N[(x * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.7e+33], t$95$2, t$95$3]]]]]]]]]]
\begin{array}{l}
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
t_1 := \left(j \cdot 27\right) \cdot k\\
t_2 := b \cdot c - t_1\\
t_3 := t \cdot \left(18 \cdot \left(z \cdot \left(x \cdot y\right)\right) - a \cdot 4\right)\\
\mathbf{if}\;t \leq -1 \cdot 10^{+35}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;t \leq -2.45 \cdot 10^{-222}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t \leq 3.8 \cdot 10^{-259}:\\
\;\;\;\;i \cdot \left(x \cdot -4\right) - t_1\\
\mathbf{elif}\;t \leq 6 \cdot 10^{-151}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t \leq 2.2 \cdot 10^{-138}:\\
\;\;\;\;x \cdot \left(18 \cdot \left(y \cdot \left(z \cdot t\right)\right) - 4 \cdot i\right)\\
\mathbf{elif}\;t \leq 2.9 \cdot 10^{-136}:\\
\;\;\;\;b \cdot c - 4 \cdot \left(x \cdot i\right)\\
\mathbf{elif}\;t \leq 1.7 \cdot 10^{+33}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;t_3\\
\end{array}
\end{array}
if t < -9.9999999999999997e34 or 1.7e33 < t Initial program 83.6%
sub-neg83.6%
associate-+l-83.6%
sub-neg83.6%
sub-neg83.6%
distribute-rgt-out--86.2%
associate-*l*86.2%
distribute-lft-neg-in86.2%
cancel-sign-sub86.2%
associate-*l*86.2%
associate-*l*86.2%
Simplified86.2%
Taylor expanded in t around inf 73.6%
pow173.6%
*-commutative73.6%
Applied egg-rr73.6%
unpow173.6%
associate-*r*72.8%
*-commutative72.8%
Simplified72.8%
if -9.9999999999999997e34 < t < -2.45e-222 or 3.8e-259 < t < 6e-151 or 2.89999999999999995e-136 < t < 1.7e33Initial program 87.7%
associate--l+87.7%
distribute-rgt-out--87.7%
associate-*r*82.4%
associate-*l*82.4%
*-commutative82.4%
Applied egg-rr82.4%
Taylor expanded in b around inf 63.1%
if -2.45e-222 < t < 3.8e-259Initial program 95.4%
associate--l+95.4%
distribute-rgt-out--95.4%
associate-*r*90.8%
associate-*l*90.8%
*-commutative90.8%
Applied egg-rr90.8%
Taylor expanded in i around inf 82.2%
*-commutative82.2%
*-commutative82.2%
*-commutative82.2%
associate-*l*82.2%
Simplified82.2%
if 6e-151 < t < 2.1999999999999999e-138Initial program 50.0%
sub-neg50.0%
associate-+l-50.0%
sub-neg50.0%
sub-neg50.0%
distribute-rgt-out--50.0%
associate-*l*75.0%
distribute-lft-neg-in75.0%
cancel-sign-sub75.0%
associate-*l*75.0%
associate-*l*75.0%
Simplified75.0%
Taylor expanded in x around inf 100.0%
if 2.1999999999999999e-138 < t < 2.89999999999999995e-136Initial program 100.0%
sub-neg100.0%
associate-+l-100.0%
sub-neg100.0%
sub-neg100.0%
distribute-rgt-out--100.0%
associate-*l*100.0%
distribute-lft-neg-in100.0%
cancel-sign-sub100.0%
associate-*l*100.0%
associate-*l*100.0%
Simplified100.0%
Taylor expanded in j around 0 100.0%
Taylor expanded in y around 0 100.0%
*-commutative3.0%
Simplified100.0%
Taylor expanded in t around 0 100.0%
Final simplification69.9%
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 (* x i)) (* 4.0 (* t a)))) t_1)))
(if (<= y -4e+275)
t_2
(if (<= y -7.2e+130)
(- (* t (- (* a -4.0) (* -18.0 (* y (* x z))))) t_1)
(if (<= y 3.15e+38) t_2 (- (* 18.0 (* y (* t (* x z)))) t_1))))))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 * (x * i)) + (4.0 * (t * a)))) - t_1;
double tmp;
if (y <= -4e+275) {
tmp = t_2;
} else if (y <= -7.2e+130) {
tmp = (t * ((a * -4.0) - (-18.0 * (y * (x * z))))) - t_1;
} else if (y <= 3.15e+38) {
tmp = t_2;
} else {
tmp = (18.0 * (y * (t * (x * z)))) - t_1;
}
return tmp;
}
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 * (x * i)) + (4.0d0 * (t * a)))) - t_1
if (y <= (-4d+275)) then
tmp = t_2
else if (y <= (-7.2d+130)) then
tmp = (t * ((a * (-4.0d0)) - ((-18.0d0) * (y * (x * z))))) - t_1
else if (y <= 3.15d+38) then
tmp = t_2
else
tmp = (18.0d0 * (y * (t * (x * z)))) - t_1
end if
code = tmp
end function
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 * (x * i)) + (4.0 * (t * a)))) - t_1;
double tmp;
if (y <= -4e+275) {
tmp = t_2;
} else if (y <= -7.2e+130) {
tmp = (t * ((a * -4.0) - (-18.0 * (y * (x * z))))) - t_1;
} else if (y <= 3.15e+38) {
tmp = t_2;
} else {
tmp = (18.0 * (y * (t * (x * z)))) - t_1;
}
return tmp;
}
[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 * (x * i)) + (4.0 * (t * a)))) - t_1 tmp = 0 if y <= -4e+275: tmp = t_2 elif y <= -7.2e+130: tmp = (t * ((a * -4.0) - (-18.0 * (y * (x * z))))) - t_1 elif y <= 3.15e+38: tmp = t_2 else: tmp = (18.0 * (y * (t * (x * z)))) - t_1 return tmp
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(Float64(4.0 * Float64(x * i)) + Float64(4.0 * Float64(t * a)))) - t_1) tmp = 0.0 if (y <= -4e+275) tmp = t_2; elseif (y <= -7.2e+130) tmp = Float64(Float64(t * Float64(Float64(a * -4.0) - Float64(-18.0 * Float64(y * Float64(x * z))))) - t_1); elseif (y <= 3.15e+38) tmp = t_2; else tmp = Float64(Float64(18.0 * Float64(y * Float64(t * Float64(x * z)))) - t_1); end return tmp end
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 * (x * i)) + (4.0 * (t * a)))) - t_1;
tmp = 0.0;
if (y <= -4e+275)
tmp = t_2;
elseif (y <= -7.2e+130)
tmp = (t * ((a * -4.0) - (-18.0 * (y * (x * z))))) - t_1;
elseif (y <= 3.15e+38)
tmp = t_2;
else
tmp = (18.0 * (y * (t * (x * z)))) - t_1;
end
tmp_2 = tmp;
end
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[(N[(4.0 * N[(x * i), $MachinePrecision]), $MachinePrecision] + N[(4.0 * N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision]}, If[LessEqual[y, -4e+275], t$95$2, If[LessEqual[y, -7.2e+130], N[(N[(t * N[(N[(a * -4.0), $MachinePrecision] - N[(-18.0 * N[(y * N[(x * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], If[LessEqual[y, 3.15e+38], t$95$2, N[(N[(18.0 * N[(y * N[(t * N[(x * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision]]]]]]
\begin{array}{l}
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
t_1 := \left(j \cdot 27\right) \cdot k\\
t_2 := \left(b \cdot c - \left(4 \cdot \left(x \cdot i\right) + 4 \cdot \left(t \cdot a\right)\right)\right) - t_1\\
\mathbf{if}\;y \leq -4 \cdot 10^{+275}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;y \leq -7.2 \cdot 10^{+130}:\\
\;\;\;\;t \cdot \left(a \cdot -4 - -18 \cdot \left(y \cdot \left(x \cdot z\right)\right)\right) - t_1\\
\mathbf{elif}\;y \leq 3.15 \cdot 10^{+38}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;18 \cdot \left(y \cdot \left(t \cdot \left(x \cdot z\right)\right)\right) - t_1\\
\end{array}
\end{array}
if y < -3.99999999999999984e275 or -7.2000000000000002e130 < y < 3.15000000000000001e38Initial program 89.8%
Taylor expanded in y around 0 86.3%
if -3.99999999999999984e275 < y < -7.2000000000000002e130Initial program 81.3%
Taylor expanded in t around -inf 72.9%
if 3.15000000000000001e38 < y Initial program 78.6%
associate--l+78.6%
distribute-rgt-out--82.2%
associate-*r*78.6%
associate-*l*78.6%
*-commutative78.6%
Applied egg-rr78.6%
Taylor expanded in y around inf 60.0%
Final simplification78.3%
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+56)
(- (* (* x 18.0) (* t (* y z))) t_1)
(if (<= t_1 5e+186)
(- (+ (* b c) (* t (* a -4.0))) (* 4.0 (* x i)))
(- (* 18.0 (* y (* t (* x z)))) t_1)))))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+56) {
tmp = ((x * 18.0) * (t * (y * z))) - t_1;
} else if (t_1 <= 5e+186) {
tmp = ((b * c) + (t * (a * -4.0))) - (4.0 * (x * i));
} else {
tmp = (18.0 * (y * (t * (x * z)))) - t_1;
}
return tmp;
}
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+56)) then
tmp = ((x * 18.0d0) * (t * (y * z))) - t_1
else if (t_1 <= 5d+186) then
tmp = ((b * c) + (t * (a * (-4.0d0)))) - (4.0d0 * (x * i))
else
tmp = (18.0d0 * (y * (t * (x * z)))) - t_1
end if
code = tmp
end function
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+56) {
tmp = ((x * 18.0) * (t * (y * z))) - t_1;
} else if (t_1 <= 5e+186) {
tmp = ((b * c) + (t * (a * -4.0))) - (4.0 * (x * i));
} else {
tmp = (18.0 * (y * (t * (x * z)))) - t_1;
}
return tmp;
}
[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+56: tmp = ((x * 18.0) * (t * (y * z))) - t_1 elif t_1 <= 5e+186: tmp = ((b * c) + (t * (a * -4.0))) - (4.0 * (x * i)) else: tmp = (18.0 * (y * (t * (x * z)))) - t_1 return tmp
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+56) tmp = Float64(Float64(Float64(x * 18.0) * Float64(t * Float64(y * z))) - t_1); elseif (t_1 <= 5e+186) tmp = Float64(Float64(Float64(b * c) + Float64(t * Float64(a * -4.0))) - Float64(4.0 * Float64(x * i))); else tmp = Float64(Float64(18.0 * Float64(y * Float64(t * Float64(x * z)))) - t_1); end return tmp end
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+56)
tmp = ((x * 18.0) * (t * (y * z))) - t_1;
elseif (t_1 <= 5e+186)
tmp = ((b * c) + (t * (a * -4.0))) - (4.0 * (x * i));
else
tmp = (18.0 * (y * (t * (x * z)))) - t_1;
end
tmp_2 = tmp;
end
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+56], N[(N[(N[(x * 18.0), $MachinePrecision] * N[(t * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], If[LessEqual[t$95$1, 5e+186], N[(N[(N[(b * c), $MachinePrecision] + N[(t * N[(a * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(4.0 * N[(x * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(18.0 * N[(y * N[(t * N[(x * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision]]]]
\begin{array}{l}
[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^{+56}:\\
\;\;\;\;\left(x \cdot 18\right) \cdot \left(t \cdot \left(y \cdot z\right)\right) - t_1\\
\mathbf{elif}\;t_1 \leq 5 \cdot 10^{+186}:\\
\;\;\;\;\left(b \cdot c + t \cdot \left(a \cdot -4\right)\right) - 4 \cdot \left(x \cdot i\right)\\
\mathbf{else}:\\
\;\;\;\;18 \cdot \left(y \cdot \left(t \cdot \left(x \cdot z\right)\right)\right) - t_1\\
\end{array}
\end{array}
if (*.f64 (*.f64 j 27) k) < -4.00000000000000037e56Initial program 80.8%
associate--l+80.8%
distribute-rgt-out--84.6%
associate-*r*84.6%
associate-*l*84.6%
*-commutative84.6%
Applied egg-rr84.6%
Taylor expanded in x around inf 77.5%
Taylor expanded in y around inf 73.6%
associate-*r*73.7%
*-commutative73.7%
associate-*r*71.6%
associate-*r*71.6%
associate-*l*71.7%
*-commutative71.7%
associate-*l*73.6%
Simplified73.6%
if -4.00000000000000037e56 < (*.f64 (*.f64 j 27) k) < 4.99999999999999954e186Initial program 90.5%
sub-neg90.5%
associate-+l-90.5%
sub-neg90.5%
sub-neg90.5%
distribute-rgt-out--90.5%
associate-*l*88.1%
distribute-lft-neg-in88.1%
cancel-sign-sub88.1%
associate-*l*88.1%
associate-*l*88.1%
Simplified88.1%
Taylor expanded in j around 0 85.9%
Taylor expanded in y around 0 71.6%
*-commutative31.9%
Simplified71.6%
if 4.99999999999999954e186 < (*.f64 (*.f64 j 27) k) Initial program 72.9%
associate--l+72.9%
distribute-rgt-out--75.6%
associate-*r*70.2%
associate-*l*70.2%
*-commutative70.2%
Applied egg-rr70.2%
Taylor expanded in y around inf 78.4%
Final simplification73.0%
NOTE: j and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (* (* j 27.0) k))
(t_2 (* x (- (* 18.0 (* y (* z t))) (* 4.0 i))))
(t_3 (- t_2 t_1)))
(if (<= x -3.05e+19)
t_3
(if (<= x 6.4e-60)
(- (- (* b c) (* 4.0 (* t a))) t_1)
(if (<= x 1.75e+79)
t_3
(if (<= x 1.2e+188)
(- (+ (* b c) (* t (* a -4.0))) (* 4.0 (* x i)))
t_2))))))assert(j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = (j * 27.0) * k;
double t_2 = x * ((18.0 * (y * (z * t))) - (4.0 * i));
double t_3 = t_2 - t_1;
double tmp;
if (x <= -3.05e+19) {
tmp = t_3;
} else if (x <= 6.4e-60) {
tmp = ((b * c) - (4.0 * (t * a))) - t_1;
} else if (x <= 1.75e+79) {
tmp = t_3;
} else if (x <= 1.2e+188) {
tmp = ((b * c) + (t * (a * -4.0))) - (4.0 * (x * i));
} else {
tmp = t_2;
}
return tmp;
}
NOTE: j and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_1 = (j * 27.0d0) * k
t_2 = x * ((18.0d0 * (y * (z * t))) - (4.0d0 * i))
t_3 = t_2 - t_1
if (x <= (-3.05d+19)) then
tmp = t_3
else if (x <= 6.4d-60) then
tmp = ((b * c) - (4.0d0 * (t * a))) - t_1
else if (x <= 1.75d+79) then
tmp = t_3
else if (x <= 1.2d+188) then
tmp = ((b * c) + (t * (a * (-4.0d0)))) - (4.0d0 * (x * i))
else
tmp = t_2
end if
code = tmp
end function
assert j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = (j * 27.0) * k;
double t_2 = x * ((18.0 * (y * (z * t))) - (4.0 * i));
double t_3 = t_2 - t_1;
double tmp;
if (x <= -3.05e+19) {
tmp = t_3;
} else if (x <= 6.4e-60) {
tmp = ((b * c) - (4.0 * (t * a))) - t_1;
} else if (x <= 1.75e+79) {
tmp = t_3;
} else if (x <= 1.2e+188) {
tmp = ((b * c) + (t * (a * -4.0))) - (4.0 * (x * i));
} else {
tmp = t_2;
}
return tmp;
}
[j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): t_1 = (j * 27.0) * k t_2 = x * ((18.0 * (y * (z * t))) - (4.0 * i)) t_3 = t_2 - t_1 tmp = 0 if x <= -3.05e+19: tmp = t_3 elif x <= 6.4e-60: tmp = ((b * c) - (4.0 * (t * a))) - t_1 elif x <= 1.75e+79: tmp = t_3 elif x <= 1.2e+188: tmp = ((b * c) + (t * (a * -4.0))) - (4.0 * (x * i)) else: tmp = t_2 return tmp
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(y * Float64(z * t))) - Float64(4.0 * i))) t_3 = Float64(t_2 - t_1) tmp = 0.0 if (x <= -3.05e+19) tmp = t_3; elseif (x <= 6.4e-60) tmp = Float64(Float64(Float64(b * c) - Float64(4.0 * Float64(t * a))) - t_1); elseif (x <= 1.75e+79) tmp = t_3; elseif (x <= 1.2e+188) tmp = Float64(Float64(Float64(b * c) + Float64(t * Float64(a * -4.0))) - Float64(4.0 * Float64(x * i))); else tmp = t_2; end return tmp end
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
t_1 = (j * 27.0) * k;
t_2 = x * ((18.0 * (y * (z * t))) - (4.0 * i));
t_3 = t_2 - t_1;
tmp = 0.0;
if (x <= -3.05e+19)
tmp = t_3;
elseif (x <= 6.4e-60)
tmp = ((b * c) - (4.0 * (t * a))) - t_1;
elseif (x <= 1.75e+79)
tmp = t_3;
elseif (x <= 1.2e+188)
tmp = ((b * c) + (t * (a * -4.0))) - (4.0 * (x * i));
else
tmp = t_2;
end
tmp_2 = tmp;
end
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[(y * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(4.0 * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(t$95$2 - t$95$1), $MachinePrecision]}, If[LessEqual[x, -3.05e+19], t$95$3, If[LessEqual[x, 6.4e-60], N[(N[(N[(b * c), $MachinePrecision] - N[(4.0 * N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], If[LessEqual[x, 1.75e+79], t$95$3, If[LessEqual[x, 1.2e+188], N[(N[(N[(b * c), $MachinePrecision] + N[(t * N[(a * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(4.0 * N[(x * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$2]]]]]]]
\begin{array}{l}
[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(y \cdot \left(z \cdot t\right)\right) - 4 \cdot i\right)\\
t_3 := t_2 - t_1\\
\mathbf{if}\;x \leq -3.05 \cdot 10^{+19}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;x \leq 6.4 \cdot 10^{-60}:\\
\;\;\;\;\left(b \cdot c - 4 \cdot \left(t \cdot a\right)\right) - t_1\\
\mathbf{elif}\;x \leq 1.75 \cdot 10^{+79}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;x \leq 1.2 \cdot 10^{+188}:\\
\;\;\;\;\left(b \cdot c + t \cdot \left(a \cdot -4\right)\right) - 4 \cdot \left(x \cdot i\right)\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if x < -3.05e19 or 6.4000000000000003e-60 < x < 1.7499999999999999e79Initial program 80.5%
associate--l+80.5%
distribute-rgt-out--82.8%
associate-*r*83.9%
associate-*l*83.9%
*-commutative83.9%
Applied egg-rr83.9%
Taylor expanded in x around inf 77.4%
if -3.05e19 < x < 6.4000000000000003e-60Initial program 92.8%
Taylor expanded in x around 0 80.3%
if 1.7499999999999999e79 < x < 1.2e188Initial program 78.5%
sub-neg78.5%
associate-+l-78.5%
sub-neg78.5%
sub-neg78.5%
distribute-rgt-out--78.5%
associate-*l*78.5%
distribute-lft-neg-in78.5%
cancel-sign-sub78.5%
associate-*l*78.5%
associate-*l*78.5%
Simplified78.5%
Taylor expanded in j around 0 78.5%
Taylor expanded in y around 0 87.2%
*-commutative31.6%
Simplified87.2%
if 1.2e188 < x Initial program 73.9%
sub-neg73.9%
associate-+l-73.9%
sub-neg73.9%
sub-neg73.9%
distribute-rgt-out--79.2%
associate-*l*89.3%
distribute-lft-neg-in89.3%
cancel-sign-sub89.3%
associate-*l*94.6%
associate-*l*94.6%
Simplified94.6%
Taylor expanded in x around inf 69.5%
Final simplification79.1%
NOTE: j and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (* (* j 27.0) k))
(t_2 (- (* x (- (* 18.0 (* y (* z t))) (* 4.0 i))) t_1)))
(if (<= x -1.05e+19)
t_2
(if (<= x 5.7e-58)
(- (- (* b c) (* 4.0 (* t a))) t_1)
(if (<= x 1.3e+78)
t_2
(- (+ (* b c) (* 18.0 (* y (* t (* x z))))) (* 4.0 (* x i))))))))assert(j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = (j * 27.0) * k;
double t_2 = (x * ((18.0 * (y * (z * t))) - (4.0 * i))) - t_1;
double tmp;
if (x <= -1.05e+19) {
tmp = t_2;
} else if (x <= 5.7e-58) {
tmp = ((b * c) - (4.0 * (t * a))) - t_1;
} else if (x <= 1.3e+78) {
tmp = t_2;
} else {
tmp = ((b * c) + (18.0 * (y * (t * (x * z))))) - (4.0 * (x * i));
}
return tmp;
}
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 * (y * (z * t))) - (4.0d0 * i))) - t_1
if (x <= (-1.05d+19)) then
tmp = t_2
else if (x <= 5.7d-58) then
tmp = ((b * c) - (4.0d0 * (t * a))) - t_1
else if (x <= 1.3d+78) then
tmp = t_2
else
tmp = ((b * c) + (18.0d0 * (y * (t * (x * z))))) - (4.0d0 * (x * i))
end if
code = tmp
end function
assert j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = (j * 27.0) * k;
double t_2 = (x * ((18.0 * (y * (z * t))) - (4.0 * i))) - t_1;
double tmp;
if (x <= -1.05e+19) {
tmp = t_2;
} else if (x <= 5.7e-58) {
tmp = ((b * c) - (4.0 * (t * a))) - t_1;
} else if (x <= 1.3e+78) {
tmp = t_2;
} else {
tmp = ((b * c) + (18.0 * (y * (t * (x * z))))) - (4.0 * (x * i));
}
return tmp;
}
[j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): t_1 = (j * 27.0) * k t_2 = (x * ((18.0 * (y * (z * t))) - (4.0 * i))) - t_1 tmp = 0 if x <= -1.05e+19: tmp = t_2 elif x <= 5.7e-58: tmp = ((b * c) - (4.0 * (t * a))) - t_1 elif x <= 1.3e+78: tmp = t_2 else: tmp = ((b * c) + (18.0 * (y * (t * (x * z))))) - (4.0 * (x * i)) return tmp
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(y * Float64(z * t))) - Float64(4.0 * i))) - t_1) tmp = 0.0 if (x <= -1.05e+19) tmp = t_2; elseif (x <= 5.7e-58) tmp = Float64(Float64(Float64(b * c) - Float64(4.0 * Float64(t * a))) - t_1); elseif (x <= 1.3e+78) tmp = t_2; else tmp = Float64(Float64(Float64(b * c) + Float64(18.0 * Float64(y * Float64(t * Float64(x * z))))) - Float64(4.0 * Float64(x * i))); end return tmp end
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
t_1 = (j * 27.0) * k;
t_2 = (x * ((18.0 * (y * (z * t))) - (4.0 * i))) - t_1;
tmp = 0.0;
if (x <= -1.05e+19)
tmp = t_2;
elseif (x <= 5.7e-58)
tmp = ((b * c) - (4.0 * (t * a))) - t_1;
elseif (x <= 1.3e+78)
tmp = t_2;
else
tmp = ((b * c) + (18.0 * (y * (t * (x * z))))) - (4.0 * (x * i));
end
tmp_2 = tmp;
end
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[(y * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(4.0 * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision]}, If[LessEqual[x, -1.05e+19], t$95$2, If[LessEqual[x, 5.7e-58], N[(N[(N[(b * c), $MachinePrecision] - N[(4.0 * N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], If[LessEqual[x, 1.3e+78], t$95$2, N[(N[(N[(b * c), $MachinePrecision] + N[(18.0 * N[(y * N[(t * N[(x * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(4.0 * N[(x * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
[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(y \cdot \left(z \cdot t\right)\right) - 4 \cdot i\right) - t_1\\
\mathbf{if}\;x \leq -1.05 \cdot 10^{+19}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x \leq 5.7 \cdot 10^{-58}:\\
\;\;\;\;\left(b \cdot c - 4 \cdot \left(t \cdot a\right)\right) - t_1\\
\mathbf{elif}\;x \leq 1.3 \cdot 10^{+78}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;\left(b \cdot c + 18 \cdot \left(y \cdot \left(t \cdot \left(x \cdot z\right)\right)\right)\right) - 4 \cdot \left(x \cdot i\right)\\
\end{array}
\end{array}
if x < -1.05e19 or 5.70000000000000032e-58 < x < 1.3e78Initial program 80.5%
associate--l+80.5%
distribute-rgt-out--82.8%
associate-*r*83.9%
associate-*l*83.9%
*-commutative83.9%
Applied egg-rr83.9%
Taylor expanded in x around inf 77.4%
if -1.05e19 < x < 5.70000000000000032e-58Initial program 92.8%
Taylor expanded in x around 0 80.3%
if 1.3e78 < x Initial program 76.5%
sub-neg76.5%
associate-+l-76.5%
sub-neg76.5%
sub-neg76.5%
distribute-rgt-out--78.8%
associate-*l*83.4%
distribute-lft-neg-in83.4%
cancel-sign-sub83.4%
associate-*l*85.8%
associate-*l*85.8%
Simplified85.8%
Taylor expanded in j around 0 83.4%
Taylor expanded in a around 0 78.8%
Final simplification79.1%
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 (<= x -6.5e+18)
(- (* x (- (* 18.0 (* y (* z t))) (* 4.0 i))) t_1)
(if (<= x 1.65e-139)
(- (- (* b c) (* 4.0 (* t a))) t_1)
(if (<= x 8.8e+74)
(- (* t (- (* a -4.0) (* -18.0 (* y (* x z))))) t_1)
(- (+ (* b c) (* 18.0 (* y (* t (* x z))))) (* 4.0 (* x i))))))))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 (x <= -6.5e+18) {
tmp = (x * ((18.0 * (y * (z * t))) - (4.0 * i))) - t_1;
} else if (x <= 1.65e-139) {
tmp = ((b * c) - (4.0 * (t * a))) - t_1;
} else if (x <= 8.8e+74) {
tmp = (t * ((a * -4.0) - (-18.0 * (y * (x * z))))) - t_1;
} else {
tmp = ((b * c) + (18.0 * (y * (t * (x * z))))) - (4.0 * (x * i));
}
return tmp;
}
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 (x <= (-6.5d+18)) then
tmp = (x * ((18.0d0 * (y * (z * t))) - (4.0d0 * i))) - t_1
else if (x <= 1.65d-139) then
tmp = ((b * c) - (4.0d0 * (t * a))) - t_1
else if (x <= 8.8d+74) then
tmp = (t * ((a * (-4.0d0)) - ((-18.0d0) * (y * (x * z))))) - t_1
else
tmp = ((b * c) + (18.0d0 * (y * (t * (x * z))))) - (4.0d0 * (x * i))
end if
code = tmp
end function
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 (x <= -6.5e+18) {
tmp = (x * ((18.0 * (y * (z * t))) - (4.0 * i))) - t_1;
} else if (x <= 1.65e-139) {
tmp = ((b * c) - (4.0 * (t * a))) - t_1;
} else if (x <= 8.8e+74) {
tmp = (t * ((a * -4.0) - (-18.0 * (y * (x * z))))) - t_1;
} else {
tmp = ((b * c) + (18.0 * (y * (t * (x * z))))) - (4.0 * (x * i));
}
return tmp;
}
[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 x <= -6.5e+18: tmp = (x * ((18.0 * (y * (z * t))) - (4.0 * i))) - t_1 elif x <= 1.65e-139: tmp = ((b * c) - (4.0 * (t * a))) - t_1 elif x <= 8.8e+74: tmp = (t * ((a * -4.0) - (-18.0 * (y * (x * z))))) - t_1 else: tmp = ((b * c) + (18.0 * (y * (t * (x * z))))) - (4.0 * (x * i)) return tmp
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 (x <= -6.5e+18) tmp = Float64(Float64(x * Float64(Float64(18.0 * Float64(y * Float64(z * t))) - Float64(4.0 * i))) - t_1); elseif (x <= 1.65e-139) tmp = Float64(Float64(Float64(b * c) - Float64(4.0 * Float64(t * a))) - t_1); elseif (x <= 8.8e+74) tmp = Float64(Float64(t * Float64(Float64(a * -4.0) - Float64(-18.0 * Float64(y * Float64(x * z))))) - t_1); else tmp = Float64(Float64(Float64(b * c) + Float64(18.0 * Float64(y * Float64(t * Float64(x * z))))) - Float64(4.0 * Float64(x * i))); end return tmp end
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 (x <= -6.5e+18)
tmp = (x * ((18.0 * (y * (z * t))) - (4.0 * i))) - t_1;
elseif (x <= 1.65e-139)
tmp = ((b * c) - (4.0 * (t * a))) - t_1;
elseif (x <= 8.8e+74)
tmp = (t * ((a * -4.0) - (-18.0 * (y * (x * z))))) - t_1;
else
tmp = ((b * c) + (18.0 * (y * (t * (x * z))))) - (4.0 * (x * i));
end
tmp_2 = tmp;
end
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[x, -6.5e+18], N[(N[(x * N[(N[(18.0 * N[(y * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(4.0 * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], If[LessEqual[x, 1.65e-139], N[(N[(N[(b * c), $MachinePrecision] - N[(4.0 * N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], If[LessEqual[x, 8.8e+74], N[(N[(t * N[(N[(a * -4.0), $MachinePrecision] - N[(-18.0 * N[(y * N[(x * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], N[(N[(N[(b * c), $MachinePrecision] + N[(18.0 * N[(y * N[(t * N[(x * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(4.0 * N[(x * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
t_1 := \left(j \cdot 27\right) \cdot k\\
\mathbf{if}\;x \leq -6.5 \cdot 10^{+18}:\\
\;\;\;\;x \cdot \left(18 \cdot \left(y \cdot \left(z \cdot t\right)\right) - 4 \cdot i\right) - t_1\\
\mathbf{elif}\;x \leq 1.65 \cdot 10^{-139}:\\
\;\;\;\;\left(b \cdot c - 4 \cdot \left(t \cdot a\right)\right) - t_1\\
\mathbf{elif}\;x \leq 8.8 \cdot 10^{+74}:\\
\;\;\;\;t \cdot \left(a \cdot -4 - -18 \cdot \left(y \cdot \left(x \cdot z\right)\right)\right) - t_1\\
\mathbf{else}:\\
\;\;\;\;\left(b \cdot c + 18 \cdot \left(y \cdot \left(t \cdot \left(x \cdot z\right)\right)\right)\right) - 4 \cdot \left(x \cdot i\right)\\
\end{array}
\end{array}
if x < -6.5e18Initial program 76.5%
associate--l+76.5%
distribute-rgt-out--78.3%
associate-*r*81.8%
associate-*l*81.8%
*-commutative81.8%
Applied egg-rr81.8%
Taylor expanded in x around inf 80.6%
if -6.5e18 < x < 1.65e-139Initial program 92.9%
Taylor expanded in x around 0 82.2%
if 1.65e-139 < x < 8.8000000000000005e74Initial program 88.7%
Taylor expanded in t around -inf 80.3%
if 8.8000000000000005e74 < x Initial program 76.5%
sub-neg76.5%
associate-+l-76.5%
sub-neg76.5%
sub-neg76.5%
distribute-rgt-out--78.8%
associate-*l*83.4%
distribute-lft-neg-in83.4%
cancel-sign-sub83.4%
associate-*l*85.8%
associate-*l*85.8%
Simplified85.8%
Taylor expanded in j around 0 83.4%
Taylor expanded in a around 0 78.8%
Final simplification81.0%
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 (* 4.0 (* x i)))
(t_3 (* x (- (* 18.0 (* y (* z t))) (* 4.0 i)))))
(if (<= x -1.65e+111)
t_3
(if (<= x 360.0)
(- (- (* b c) (* 4.0 (* t a))) t_1)
(if (<= x 1.3e+78)
(- (* (* x 18.0) (* t (* y z))) t_1)
(if (<= x 4.6e+188)
(- (+ (* b c) (* t (* a -4.0))) t_2)
(if (<= x 8e+264) t_3 (- (* b c) t_2))))))))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 = 4.0 * (x * i);
double t_3 = x * ((18.0 * (y * (z * t))) - (4.0 * i));
double tmp;
if (x <= -1.65e+111) {
tmp = t_3;
} else if (x <= 360.0) {
tmp = ((b * c) - (4.0 * (t * a))) - t_1;
} else if (x <= 1.3e+78) {
tmp = ((x * 18.0) * (t * (y * z))) - t_1;
} else if (x <= 4.6e+188) {
tmp = ((b * c) + (t * (a * -4.0))) - t_2;
} else if (x <= 8e+264) {
tmp = t_3;
} else {
tmp = (b * c) - t_2;
}
return tmp;
}
NOTE: j and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_1 = (j * 27.0d0) * k
t_2 = 4.0d0 * (x * i)
t_3 = x * ((18.0d0 * (y * (z * t))) - (4.0d0 * i))
if (x <= (-1.65d+111)) then
tmp = t_3
else if (x <= 360.0d0) then
tmp = ((b * c) - (4.0d0 * (t * a))) - t_1
else if (x <= 1.3d+78) then
tmp = ((x * 18.0d0) * (t * (y * z))) - t_1
else if (x <= 4.6d+188) then
tmp = ((b * c) + (t * (a * (-4.0d0)))) - t_2
else if (x <= 8d+264) then
tmp = t_3
else
tmp = (b * c) - t_2
end if
code = tmp
end function
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 = 4.0 * (x * i);
double t_3 = x * ((18.0 * (y * (z * t))) - (4.0 * i));
double tmp;
if (x <= -1.65e+111) {
tmp = t_3;
} else if (x <= 360.0) {
tmp = ((b * c) - (4.0 * (t * a))) - t_1;
} else if (x <= 1.3e+78) {
tmp = ((x * 18.0) * (t * (y * z))) - t_1;
} else if (x <= 4.6e+188) {
tmp = ((b * c) + (t * (a * -4.0))) - t_2;
} else if (x <= 8e+264) {
tmp = t_3;
} else {
tmp = (b * c) - t_2;
}
return tmp;
}
[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 = 4.0 * (x * i) t_3 = x * ((18.0 * (y * (z * t))) - (4.0 * i)) tmp = 0 if x <= -1.65e+111: tmp = t_3 elif x <= 360.0: tmp = ((b * c) - (4.0 * (t * a))) - t_1 elif x <= 1.3e+78: tmp = ((x * 18.0) * (t * (y * z))) - t_1 elif x <= 4.6e+188: tmp = ((b * c) + (t * (a * -4.0))) - t_2 elif x <= 8e+264: tmp = t_3 else: tmp = (b * c) - t_2 return tmp
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(4.0 * Float64(x * i)) t_3 = Float64(x * Float64(Float64(18.0 * Float64(y * Float64(z * t))) - Float64(4.0 * i))) tmp = 0.0 if (x <= -1.65e+111) tmp = t_3; elseif (x <= 360.0) tmp = Float64(Float64(Float64(b * c) - Float64(4.0 * Float64(t * a))) - t_1); elseif (x <= 1.3e+78) tmp = Float64(Float64(Float64(x * 18.0) * Float64(t * Float64(y * z))) - t_1); elseif (x <= 4.6e+188) tmp = Float64(Float64(Float64(b * c) + Float64(t * Float64(a * -4.0))) - t_2); elseif (x <= 8e+264) tmp = t_3; else tmp = Float64(Float64(b * c) - t_2); end return tmp end
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 = 4.0 * (x * i);
t_3 = x * ((18.0 * (y * (z * t))) - (4.0 * i));
tmp = 0.0;
if (x <= -1.65e+111)
tmp = t_3;
elseif (x <= 360.0)
tmp = ((b * c) - (4.0 * (t * a))) - t_1;
elseif (x <= 1.3e+78)
tmp = ((x * 18.0) * (t * (y * z))) - t_1;
elseif (x <= 4.6e+188)
tmp = ((b * c) + (t * (a * -4.0))) - t_2;
elseif (x <= 8e+264)
tmp = t_3;
else
tmp = (b * c) - t_2;
end
tmp_2 = tmp;
end
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[(4.0 * N[(x * i), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(x * N[(N[(18.0 * N[(y * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(4.0 * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.65e+111], t$95$3, If[LessEqual[x, 360.0], N[(N[(N[(b * c), $MachinePrecision] - N[(4.0 * N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], If[LessEqual[x, 1.3e+78], N[(N[(N[(x * 18.0), $MachinePrecision] * N[(t * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], If[LessEqual[x, 4.6e+188], N[(N[(N[(b * c), $MachinePrecision] + N[(t * N[(a * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$2), $MachinePrecision], If[LessEqual[x, 8e+264], t$95$3, N[(N[(b * c), $MachinePrecision] - t$95$2), $MachinePrecision]]]]]]]]]
\begin{array}{l}
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
t_1 := \left(j \cdot 27\right) \cdot k\\
t_2 := 4 \cdot \left(x \cdot i\right)\\
t_3 := x \cdot \left(18 \cdot \left(y \cdot \left(z \cdot t\right)\right) - 4 \cdot i\right)\\
\mathbf{if}\;x \leq -1.65 \cdot 10^{+111}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;x \leq 360:\\
\;\;\;\;\left(b \cdot c - 4 \cdot \left(t \cdot a\right)\right) - t_1\\
\mathbf{elif}\;x \leq 1.3 \cdot 10^{+78}:\\
\;\;\;\;\left(x \cdot 18\right) \cdot \left(t \cdot \left(y \cdot z\right)\right) - t_1\\
\mathbf{elif}\;x \leq 4.6 \cdot 10^{+188}:\\
\;\;\;\;\left(b \cdot c + t \cdot \left(a \cdot -4\right)\right) - t_2\\
\mathbf{elif}\;x \leq 8 \cdot 10^{+264}:\\
\;\;\;\;t_3\\
\mathbf{else}:\\
\;\;\;\;b \cdot c - t_2\\
\end{array}
\end{array}
if x < -1.6500000000000001e111 or 4.60000000000000023e188 < x < 8.00000000000000035e264Initial program 74.3%
sub-neg74.3%
associate-+l-74.3%
sub-neg74.3%
sub-neg74.3%
distribute-rgt-out--78.0%
associate-*l*83.4%
distribute-lft-neg-in83.4%
cancel-sign-sub83.4%
associate-*l*83.4%
associate-*l*83.4%
Simplified83.4%
Taylor expanded in x around inf 79.9%
if -1.6500000000000001e111 < x < 360Initial program 92.1%
Taylor expanded in x around 0 76.3%
if 360 < x < 1.3e78Initial program 79.9%
associate--l+79.9%
distribute-rgt-out--84.9%
associate-*r*84.9%
associate-*l*84.9%
*-commutative84.9%
Applied egg-rr84.9%
Taylor expanded in x around inf 80.3%
Taylor expanded in y around inf 80.3%
associate-*r*75.3%
*-commutative75.3%
associate-*r*75.3%
associate-*r*80.3%
associate-*l*80.3%
*-commutative80.3%
associate-*l*80.3%
Simplified80.3%
if 1.3e78 < x < 4.60000000000000023e188Initial program 78.5%
sub-neg78.5%
associate-+l-78.5%
sub-neg78.5%
sub-neg78.5%
distribute-rgt-out--78.5%
associate-*l*78.5%
distribute-lft-neg-in78.5%
cancel-sign-sub78.5%
associate-*l*78.5%
associate-*l*78.5%
Simplified78.5%
Taylor expanded in j around 0 78.5%
Taylor expanded in y around 0 87.2%
*-commutative31.6%
Simplified87.2%
if 8.00000000000000035e264 < x Initial program 83.1%
sub-neg83.1%
associate-+l-83.1%
sub-neg83.1%
sub-neg83.1%
distribute-rgt-out--83.1%
associate-*l*83.1%
distribute-lft-neg-in83.1%
cancel-sign-sub83.1%
associate-*l*99.7%
associate-*l*99.7%
Simplified99.7%
Taylor expanded in j around 0 83.1%
Taylor expanded in y around 0 83.1%
*-commutative1.2%
Simplified83.1%
Taylor expanded in t around 0 83.1%
Final simplification78.5%
NOTE: j and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (- (* b c) (* (* j 27.0) k)))
(t_2 (* t (- (* 18.0 (* y (* x z))) (* a 4.0)))))
(if (<= t -4.45e+33)
t_2
(if (<= t -3e-283)
t_1
(if (<= t 9.8e-136)
(- (* b c) (* 4.0 (* x i)))
(if (<= t 8.2e+31) t_1 t_2))))))assert(j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = (b * c) - ((j * 27.0) * k);
double t_2 = t * ((18.0 * (y * (x * z))) - (a * 4.0));
double tmp;
if (t <= -4.45e+33) {
tmp = t_2;
} else if (t <= -3e-283) {
tmp = t_1;
} else if (t <= 9.8e-136) {
tmp = (b * c) - (4.0 * (x * i));
} else if (t <= 8.2e+31) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
NOTE: j and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (b * c) - ((j * 27.0d0) * k)
t_2 = t * ((18.0d0 * (y * (x * z))) - (a * 4.0d0))
if (t <= (-4.45d+33)) then
tmp = t_2
else if (t <= (-3d-283)) then
tmp = t_1
else if (t <= 9.8d-136) then
tmp = (b * c) - (4.0d0 * (x * i))
else if (t <= 8.2d+31) then
tmp = t_1
else
tmp = t_2
end if
code = tmp
end function
assert j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = (b * c) - ((j * 27.0) * k);
double t_2 = t * ((18.0 * (y * (x * z))) - (a * 4.0));
double tmp;
if (t <= -4.45e+33) {
tmp = t_2;
} else if (t <= -3e-283) {
tmp = t_1;
} else if (t <= 9.8e-136) {
tmp = (b * c) - (4.0 * (x * i));
} else if (t <= 8.2e+31) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
[j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): t_1 = (b * c) - ((j * 27.0) * k) t_2 = t * ((18.0 * (y * (x * z))) - (a * 4.0)) tmp = 0 if t <= -4.45e+33: tmp = t_2 elif t <= -3e-283: tmp = t_1 elif t <= 9.8e-136: tmp = (b * c) - (4.0 * (x * i)) elif t <= 8.2e+31: tmp = t_1 else: tmp = t_2 return tmp
j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(Float64(b * c) - Float64(Float64(j * 27.0) * k)) t_2 = Float64(t * Float64(Float64(18.0 * Float64(y * Float64(x * z))) - Float64(a * 4.0))) tmp = 0.0 if (t <= -4.45e+33) tmp = t_2; elseif (t <= -3e-283) tmp = t_1; elseif (t <= 9.8e-136) tmp = Float64(Float64(b * c) - Float64(4.0 * Float64(x * i))); elseif (t <= 8.2e+31) tmp = t_1; else tmp = t_2; end return tmp end
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
t_1 = (b * c) - ((j * 27.0) * k);
t_2 = t * ((18.0 * (y * (x * z))) - (a * 4.0));
tmp = 0.0;
if (t <= -4.45e+33)
tmp = t_2;
elseif (t <= -3e-283)
tmp = t_1;
elseif (t <= 9.8e-136)
tmp = (b * c) - (4.0 * (x * i));
elseif (t <= 8.2e+31)
tmp = t_1;
else
tmp = t_2;
end
tmp_2 = tmp;
end
NOTE: j and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(N[(b * c), $MachinePrecision] - N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t * N[(N[(18.0 * N[(y * N[(x * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(a * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -4.45e+33], t$95$2, If[LessEqual[t, -3e-283], t$95$1, If[LessEqual[t, 9.8e-136], N[(N[(b * c), $MachinePrecision] - N[(4.0 * N[(x * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 8.2e+31], t$95$1, t$95$2]]]]]]
\begin{array}{l}
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
t_1 := b \cdot c - \left(j \cdot 27\right) \cdot k\\
t_2 := t \cdot \left(18 \cdot \left(y \cdot \left(x \cdot z\right)\right) - a \cdot 4\right)\\
\mathbf{if}\;t \leq -4.45 \cdot 10^{+33}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t \leq -3 \cdot 10^{-283}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq 9.8 \cdot 10^{-136}:\\
\;\;\;\;b \cdot c - 4 \cdot \left(x \cdot i\right)\\
\mathbf{elif}\;t \leq 8.2 \cdot 10^{+31}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if t < -4.4500000000000002e33 or 8.2000000000000003e31 < t Initial program 83.6%
sub-neg83.6%
associate-+l-83.6%
sub-neg83.6%
sub-neg83.6%
distribute-rgt-out--86.2%
associate-*l*86.2%
distribute-lft-neg-in86.2%
cancel-sign-sub86.2%
associate-*l*86.2%
associate-*l*86.2%
Simplified86.2%
Taylor expanded in t around inf 73.6%
if -4.4500000000000002e33 < t < -2.99999999999999996e-283 or 9.7999999999999999e-136 < t < 8.2000000000000003e31Initial program 89.6%
associate--l+89.6%
distribute-rgt-out--89.7%
associate-*r*85.4%
associate-*l*85.5%
*-commutative85.5%
Applied egg-rr85.5%
Taylor expanded in b around inf 62.6%
if -2.99999999999999996e-283 < t < 9.7999999999999999e-136Initial program 84.2%
sub-neg84.2%
associate-+l-84.2%
sub-neg84.2%
sub-neg84.2%
distribute-rgt-out--84.2%
associate-*l*79.7%
distribute-lft-neg-in79.7%
cancel-sign-sub79.7%
associate-*l*79.7%
associate-*l*79.7%
Simplified79.7%
Taylor expanded in j around 0 66.7%
Taylor expanded in y around 0 71.2%
*-commutative6.7%
Simplified71.2%
Taylor expanded in t around 0 66.9%
Final simplification68.3%
NOTE: j and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (- (* b c) (* (* j 27.0) k)))
(t_2 (* t (- (* 18.0 (* z (* x y))) (* a 4.0)))))
(if (<= t -4.7e+33)
t_2
(if (<= t -8.3e-283)
t_1
(if (<= t 6e-136)
(- (* b c) (* 4.0 (* x i)))
(if (<= t 4.3e+33) t_1 t_2))))))assert(j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = (b * c) - ((j * 27.0) * k);
double t_2 = t * ((18.0 * (z * (x * y))) - (a * 4.0));
double tmp;
if (t <= -4.7e+33) {
tmp = t_2;
} else if (t <= -8.3e-283) {
tmp = t_1;
} else if (t <= 6e-136) {
tmp = (b * c) - (4.0 * (x * i));
} else if (t <= 4.3e+33) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
NOTE: j and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (b * c) - ((j * 27.0d0) * k)
t_2 = t * ((18.0d0 * (z * (x * y))) - (a * 4.0d0))
if (t <= (-4.7d+33)) then
tmp = t_2
else if (t <= (-8.3d-283)) then
tmp = t_1
else if (t <= 6d-136) then
tmp = (b * c) - (4.0d0 * (x * i))
else if (t <= 4.3d+33) then
tmp = t_1
else
tmp = t_2
end if
code = tmp
end function
assert j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = (b * c) - ((j * 27.0) * k);
double t_2 = t * ((18.0 * (z * (x * y))) - (a * 4.0));
double tmp;
if (t <= -4.7e+33) {
tmp = t_2;
} else if (t <= -8.3e-283) {
tmp = t_1;
} else if (t <= 6e-136) {
tmp = (b * c) - (4.0 * (x * i));
} else if (t <= 4.3e+33) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
[j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): t_1 = (b * c) - ((j * 27.0) * k) t_2 = t * ((18.0 * (z * (x * y))) - (a * 4.0)) tmp = 0 if t <= -4.7e+33: tmp = t_2 elif t <= -8.3e-283: tmp = t_1 elif t <= 6e-136: tmp = (b * c) - (4.0 * (x * i)) elif t <= 4.3e+33: tmp = t_1 else: tmp = t_2 return tmp
j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(Float64(b * c) - Float64(Float64(j * 27.0) * k)) t_2 = Float64(t * Float64(Float64(18.0 * Float64(z * Float64(x * y))) - Float64(a * 4.0))) tmp = 0.0 if (t <= -4.7e+33) tmp = t_2; elseif (t <= -8.3e-283) tmp = t_1; elseif (t <= 6e-136) tmp = Float64(Float64(b * c) - Float64(4.0 * Float64(x * i))); elseif (t <= 4.3e+33) tmp = t_1; else tmp = t_2; end return tmp end
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
t_1 = (b * c) - ((j * 27.0) * k);
t_2 = t * ((18.0 * (z * (x * y))) - (a * 4.0));
tmp = 0.0;
if (t <= -4.7e+33)
tmp = t_2;
elseif (t <= -8.3e-283)
tmp = t_1;
elseif (t <= 6e-136)
tmp = (b * c) - (4.0 * (x * i));
elseif (t <= 4.3e+33)
tmp = t_1;
else
tmp = t_2;
end
tmp_2 = tmp;
end
NOTE: j and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(N[(b * c), $MachinePrecision] - N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t * N[(N[(18.0 * N[(z * N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(a * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -4.7e+33], t$95$2, If[LessEqual[t, -8.3e-283], t$95$1, If[LessEqual[t, 6e-136], N[(N[(b * c), $MachinePrecision] - N[(4.0 * N[(x * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 4.3e+33], t$95$1, t$95$2]]]]]]
\begin{array}{l}
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
t_1 := b \cdot c - \left(j \cdot 27\right) \cdot k\\
t_2 := t \cdot \left(18 \cdot \left(z \cdot \left(x \cdot y\right)\right) - a \cdot 4\right)\\
\mathbf{if}\;t \leq -4.7 \cdot 10^{+33}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t \leq -8.3 \cdot 10^{-283}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq 6 \cdot 10^{-136}:\\
\;\;\;\;b \cdot c - 4 \cdot \left(x \cdot i\right)\\
\mathbf{elif}\;t \leq 4.3 \cdot 10^{+33}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if t < -4.6999999999999998e33 or 4.30000000000000028e33 < t Initial program 83.6%
sub-neg83.6%
associate-+l-83.6%
sub-neg83.6%
sub-neg83.6%
distribute-rgt-out--86.2%
associate-*l*86.2%
distribute-lft-neg-in86.2%
cancel-sign-sub86.2%
associate-*l*86.2%
associate-*l*86.2%
Simplified86.2%
Taylor expanded in t around inf 73.6%
pow173.6%
*-commutative73.6%
Applied egg-rr73.6%
unpow173.6%
associate-*r*72.8%
*-commutative72.8%
Simplified72.8%
if -4.6999999999999998e33 < t < -8.29999999999999981e-283 or 5.9999999999999996e-136 < t < 4.30000000000000028e33Initial program 89.6%
associate--l+89.6%
distribute-rgt-out--89.7%
associate-*r*85.4%
associate-*l*85.5%
*-commutative85.5%
Applied egg-rr85.5%
Taylor expanded in b around inf 62.6%
if -8.29999999999999981e-283 < t < 5.9999999999999996e-136Initial program 84.2%
sub-neg84.2%
associate-+l-84.2%
sub-neg84.2%
sub-neg84.2%
distribute-rgt-out--84.2%
associate-*l*79.7%
distribute-lft-neg-in79.7%
cancel-sign-sub79.7%
associate-*l*79.7%
associate-*l*79.7%
Simplified79.7%
Taylor expanded in j around 0 66.7%
Taylor expanded in y around 0 71.2%
*-commutative6.7%
Simplified71.2%
Taylor expanded in t around 0 66.9%
Final simplification67.9%
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.65e+152)
(* t (- (* 18.0 (* z (* x y))) (* a 4.0)))
(if (<= t -6e-44)
(- (- (* b c) (* 4.0 (* t a))) t_1)
(if (<= t 3.8e+77)
(- (- (* b c) (* 4.0 (* x i))) t_1)
(* t (- (* 18.0 (* y (* x z))) (* a 4.0))))))))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.65e+152) {
tmp = t * ((18.0 * (z * (x * y))) - (a * 4.0));
} else if (t <= -6e-44) {
tmp = ((b * c) - (4.0 * (t * a))) - t_1;
} else if (t <= 3.8e+77) {
tmp = ((b * c) - (4.0 * (x * i))) - t_1;
} else {
tmp = t * ((18.0 * (y * (x * z))) - (a * 4.0));
}
return tmp;
}
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.65d+152)) then
tmp = t * ((18.0d0 * (z * (x * y))) - (a * 4.0d0))
else if (t <= (-6d-44)) then
tmp = ((b * c) - (4.0d0 * (t * a))) - t_1
else if (t <= 3.8d+77) then
tmp = ((b * c) - (4.0d0 * (x * i))) - t_1
else
tmp = t * ((18.0d0 * (y * (x * z))) - (a * 4.0d0))
end if
code = tmp
end function
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.65e+152) {
tmp = t * ((18.0 * (z * (x * y))) - (a * 4.0));
} else if (t <= -6e-44) {
tmp = ((b * c) - (4.0 * (t * a))) - t_1;
} else if (t <= 3.8e+77) {
tmp = ((b * c) - (4.0 * (x * i))) - t_1;
} else {
tmp = t * ((18.0 * (y * (x * z))) - (a * 4.0));
}
return tmp;
}
[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.65e+152: tmp = t * ((18.0 * (z * (x * y))) - (a * 4.0)) elif t <= -6e-44: tmp = ((b * c) - (4.0 * (t * a))) - t_1 elif t <= 3.8e+77: tmp = ((b * c) - (4.0 * (x * i))) - t_1 else: tmp = t * ((18.0 * (y * (x * z))) - (a * 4.0)) return tmp
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.65e+152) tmp = Float64(t * Float64(Float64(18.0 * Float64(z * Float64(x * y))) - Float64(a * 4.0))); elseif (t <= -6e-44) tmp = Float64(Float64(Float64(b * c) - Float64(4.0 * Float64(t * a))) - t_1); elseif (t <= 3.8e+77) tmp = Float64(Float64(Float64(b * c) - Float64(4.0 * Float64(x * i))) - t_1); else tmp = Float64(t * Float64(Float64(18.0 * Float64(y * Float64(x * z))) - Float64(a * 4.0))); end return tmp end
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.65e+152)
tmp = t * ((18.0 * (z * (x * y))) - (a * 4.0));
elseif (t <= -6e-44)
tmp = ((b * c) - (4.0 * (t * a))) - t_1;
elseif (t <= 3.8e+77)
tmp = ((b * c) - (4.0 * (x * i))) - t_1;
else
tmp = t * ((18.0 * (y * (x * z))) - (a * 4.0));
end
tmp_2 = tmp;
end
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.65e+152], N[(t * N[(N[(18.0 * N[(z * N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(a * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, -6e-44], N[(N[(N[(b * c), $MachinePrecision] - N[(4.0 * N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], If[LessEqual[t, 3.8e+77], N[(N[(N[(b * c), $MachinePrecision] - N[(4.0 * N[(x * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], N[(t * N[(N[(18.0 * N[(y * N[(x * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(a * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
t_1 := \left(j \cdot 27\right) \cdot k\\
\mathbf{if}\;t \leq -1.65 \cdot 10^{+152}:\\
\;\;\;\;t \cdot \left(18 \cdot \left(z \cdot \left(x \cdot y\right)\right) - a \cdot 4\right)\\
\mathbf{elif}\;t \leq -6 \cdot 10^{-44}:\\
\;\;\;\;\left(b \cdot c - 4 \cdot \left(t \cdot a\right)\right) - t_1\\
\mathbf{elif}\;t \leq 3.8 \cdot 10^{+77}:\\
\;\;\;\;\left(b \cdot c - 4 \cdot \left(x \cdot i\right)\right) - t_1\\
\mathbf{else}:\\
\;\;\;\;t \cdot \left(18 \cdot \left(y \cdot \left(x \cdot z\right)\right) - a \cdot 4\right)\\
\end{array}
\end{array}
if t < -1.6500000000000001e152Initial program 75.0%
sub-neg75.0%
associate-+l-75.0%
sub-neg75.0%
sub-neg75.0%
distribute-rgt-out--77.8%
associate-*l*77.8%
distribute-lft-neg-in77.8%
cancel-sign-sub77.8%
associate-*l*77.8%
associate-*l*77.8%
Simplified77.8%
Taylor expanded in t around inf 81.1%
pow181.1%
*-commutative81.1%
Applied egg-rr81.1%
unpow181.1%
associate-*r*81.1%
*-commutative81.1%
Simplified81.1%
if -1.6500000000000001e152 < t < -6.0000000000000005e-44Initial program 89.1%
Taylor expanded in x around 0 74.3%
if -6.0000000000000005e-44 < t < 3.8000000000000001e77Initial program 88.2%
Taylor expanded in t around 0 77.2%
if 3.8000000000000001e77 < t Initial program 85.1%
sub-neg85.1%
associate-+l-85.1%
sub-neg85.1%
sub-neg85.1%
distribute-rgt-out--89.3%
associate-*l*89.3%
distribute-lft-neg-in89.3%
cancel-sign-sub89.3%
associate-*l*89.3%
associate-*l*89.4%
Simplified89.4%
Taylor expanded in t around inf 76.5%
Final simplification77.1%
NOTE: j and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (* -4.0 (+ (* x i) (* t a)))))
(if (<= b -1.7e+195)
(* b c)
(if (<= b -8e+132)
t_1
(if (<= b -1.95e+75)
(* k (* j -27.0))
(if (<= b 1.8e-56) t_1 (* b c)))))))assert(j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = -4.0 * ((x * i) + (t * a));
double tmp;
if (b <= -1.7e+195) {
tmp = b * c;
} else if (b <= -8e+132) {
tmp = t_1;
} else if (b <= -1.95e+75) {
tmp = k * (j * -27.0);
} else if (b <= 1.8e-56) {
tmp = t_1;
} else {
tmp = b * c;
}
return tmp;
}
NOTE: j and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: tmp
t_1 = (-4.0d0) * ((x * i) + (t * a))
if (b <= (-1.7d+195)) then
tmp = b * c
else if (b <= (-8d+132)) then
tmp = t_1
else if (b <= (-1.95d+75)) then
tmp = k * (j * (-27.0d0))
else if (b <= 1.8d-56) then
tmp = t_1
else
tmp = b * c
end if
code = tmp
end function
assert j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = -4.0 * ((x * i) + (t * a));
double tmp;
if (b <= -1.7e+195) {
tmp = b * c;
} else if (b <= -8e+132) {
tmp = t_1;
} else if (b <= -1.95e+75) {
tmp = k * (j * -27.0);
} else if (b <= 1.8e-56) {
tmp = t_1;
} else {
tmp = b * c;
}
return tmp;
}
[j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): t_1 = -4.0 * ((x * i) + (t * a)) tmp = 0 if b <= -1.7e+195: tmp = b * c elif b <= -8e+132: tmp = t_1 elif b <= -1.95e+75: tmp = k * (j * -27.0) elif b <= 1.8e-56: tmp = t_1 else: tmp = b * c return tmp
j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(-4.0 * Float64(Float64(x * i) + Float64(t * a))) tmp = 0.0 if (b <= -1.7e+195) tmp = Float64(b * c); elseif (b <= -8e+132) tmp = t_1; elseif (b <= -1.95e+75) tmp = Float64(k * Float64(j * -27.0)); elseif (b <= 1.8e-56) tmp = t_1; else tmp = Float64(b * c); end return tmp end
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
t_1 = -4.0 * ((x * i) + (t * a));
tmp = 0.0;
if (b <= -1.7e+195)
tmp = b * c;
elseif (b <= -8e+132)
tmp = t_1;
elseif (b <= -1.95e+75)
tmp = k * (j * -27.0);
elseif (b <= 1.8e-56)
tmp = t_1;
else
tmp = b * c;
end
tmp_2 = tmp;
end
NOTE: j and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(-4.0 * N[(N[(x * i), $MachinePrecision] + N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -1.7e+195], N[(b * c), $MachinePrecision], If[LessEqual[b, -8e+132], t$95$1, If[LessEqual[b, -1.95e+75], N[(k * N[(j * -27.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 1.8e-56], t$95$1, N[(b * c), $MachinePrecision]]]]]]
\begin{array}{l}
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
t_1 := -4 \cdot \left(x \cdot i + t \cdot a\right)\\
\mathbf{if}\;b \leq -1.7 \cdot 10^{+195}:\\
\;\;\;\;b \cdot c\\
\mathbf{elif}\;b \leq -8 \cdot 10^{+132}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;b \leq -1.95 \cdot 10^{+75}:\\
\;\;\;\;k \cdot \left(j \cdot -27\right)\\
\mathbf{elif}\;b \leq 1.8 \cdot 10^{-56}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;b \cdot c\\
\end{array}
\end{array}
if b < -1.70000000000000005e195 or 1.79999999999999989e-56 < b Initial program 83.9%
Simplified89.3%
add-cbrt-cube80.4%
*-commutative80.4%
*-commutative80.4%
*-commutative80.4%
Applied egg-rr80.4%
Taylor expanded in b around inf 40.7%
if -1.70000000000000005e195 < b < -7.99999999999999993e132 or -1.95000000000000019e75 < b < 1.79999999999999989e-56Initial program 87.1%
sub-neg87.1%
associate-+l-87.1%
sub-neg87.1%
sub-neg87.1%
distribute-rgt-out--88.6%
associate-*l*86.3%
distribute-lft-neg-in86.3%
cancel-sign-sub86.3%
associate-*l*87.1%
associate-*l*87.1%
Simplified87.1%
Taylor expanded in j around 0 72.0%
Taylor expanded in y around 0 53.9%
*-commutative28.8%
Simplified53.9%
Taylor expanded in c around 0 45.2%
cancel-sign-sub-inv45.2%
metadata-eval45.2%
+-commutative45.2%
distribute-lft-out45.2%
*-commutative45.2%
Simplified45.2%
if -7.99999999999999993e132 < b < -1.95000000000000019e75Initial program 92.2%
associate--l+92.2%
distribute-rgt-out--92.2%
associate-*r*76.8%
associate-*l*76.8%
*-commutative76.8%
Applied egg-rr76.8%
Taylor expanded in j around inf 55.0%
*-commutative55.0%
*-commutative55.0%
*-commutative55.0%
associate-*r*55.0%
Simplified55.0%
Final simplification43.8%
NOTE: j and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (- (* b c) (* (* j 27.0) k))) (t_2 (* -4.0 (+ (* x i) (* t a)))))
(if (<= t -1.55e+34)
t_2
(if (<= t -3.95e-283)
t_1
(if (<= t 4.1e-136)
(- (* b c) (* 4.0 (* x i)))
(if (<= t 3.9e+32) t_1 t_2))))))assert(j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = (b * c) - ((j * 27.0) * k);
double t_2 = -4.0 * ((x * i) + (t * a));
double tmp;
if (t <= -1.55e+34) {
tmp = t_2;
} else if (t <= -3.95e-283) {
tmp = t_1;
} else if (t <= 4.1e-136) {
tmp = (b * c) - (4.0 * (x * i));
} else if (t <= 3.9e+32) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
NOTE: j and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (b * c) - ((j * 27.0d0) * k)
t_2 = (-4.0d0) * ((x * i) + (t * a))
if (t <= (-1.55d+34)) then
tmp = t_2
else if (t <= (-3.95d-283)) then
tmp = t_1
else if (t <= 4.1d-136) then
tmp = (b * c) - (4.0d0 * (x * i))
else if (t <= 3.9d+32) then
tmp = t_1
else
tmp = t_2
end if
code = tmp
end function
assert j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = (b * c) - ((j * 27.0) * k);
double t_2 = -4.0 * ((x * i) + (t * a));
double tmp;
if (t <= -1.55e+34) {
tmp = t_2;
} else if (t <= -3.95e-283) {
tmp = t_1;
} else if (t <= 4.1e-136) {
tmp = (b * c) - (4.0 * (x * i));
} else if (t <= 3.9e+32) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
[j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): t_1 = (b * c) - ((j * 27.0) * k) t_2 = -4.0 * ((x * i) + (t * a)) tmp = 0 if t <= -1.55e+34: tmp = t_2 elif t <= -3.95e-283: tmp = t_1 elif t <= 4.1e-136: tmp = (b * c) - (4.0 * (x * i)) elif t <= 3.9e+32: tmp = t_1 else: tmp = t_2 return tmp
j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(Float64(b * c) - Float64(Float64(j * 27.0) * k)) t_2 = Float64(-4.0 * Float64(Float64(x * i) + Float64(t * a))) tmp = 0.0 if (t <= -1.55e+34) tmp = t_2; elseif (t <= -3.95e-283) tmp = t_1; elseif (t <= 4.1e-136) tmp = Float64(Float64(b * c) - Float64(4.0 * Float64(x * i))); elseif (t <= 3.9e+32) tmp = t_1; else tmp = t_2; end return tmp end
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
t_1 = (b * c) - ((j * 27.0) * k);
t_2 = -4.0 * ((x * i) + (t * a));
tmp = 0.0;
if (t <= -1.55e+34)
tmp = t_2;
elseif (t <= -3.95e-283)
tmp = t_1;
elseif (t <= 4.1e-136)
tmp = (b * c) - (4.0 * (x * i));
elseif (t <= 3.9e+32)
tmp = t_1;
else
tmp = t_2;
end
tmp_2 = tmp;
end
NOTE: j and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(N[(b * c), $MachinePrecision] - N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(-4.0 * N[(N[(x * i), $MachinePrecision] + N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -1.55e+34], t$95$2, If[LessEqual[t, -3.95e-283], t$95$1, If[LessEqual[t, 4.1e-136], N[(N[(b * c), $MachinePrecision] - N[(4.0 * N[(x * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 3.9e+32], t$95$1, t$95$2]]]]]]
\begin{array}{l}
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
t_1 := b \cdot c - \left(j \cdot 27\right) \cdot k\\
t_2 := -4 \cdot \left(x \cdot i + t \cdot a\right)\\
\mathbf{if}\;t \leq -1.55 \cdot 10^{+34}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t \leq -3.95 \cdot 10^{-283}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq 4.1 \cdot 10^{-136}:\\
\;\;\;\;b \cdot c - 4 \cdot \left(x \cdot i\right)\\
\mathbf{elif}\;t \leq 3.9 \cdot 10^{+32}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if t < -1.54999999999999989e34 or 3.8999999999999999e32 < t Initial program 83.6%
sub-neg83.6%
associate-+l-83.6%
sub-neg83.6%
sub-neg83.6%
distribute-rgt-out--86.2%
associate-*l*86.2%
distribute-lft-neg-in86.2%
cancel-sign-sub86.2%
associate-*l*86.2%
associate-*l*86.2%
Simplified86.2%
Taylor expanded in j around 0 83.0%
Taylor expanded in y around 0 60.7%
*-commutative42.5%
Simplified60.7%
Taylor expanded in c around 0 53.5%
cancel-sign-sub-inv53.5%
metadata-eval53.5%
+-commutative53.5%
distribute-lft-out53.5%
*-commutative53.5%
Simplified53.5%
if -1.54999999999999989e34 < t < -3.9500000000000002e-283 or 4.10000000000000025e-136 < t < 3.8999999999999999e32Initial program 89.6%
associate--l+89.6%
distribute-rgt-out--89.7%
associate-*r*85.4%
associate-*l*85.5%
*-commutative85.5%
Applied egg-rr85.5%
Taylor expanded in b around inf 62.6%
if -3.9500000000000002e-283 < t < 4.10000000000000025e-136Initial program 84.2%
sub-neg84.2%
associate-+l-84.2%
sub-neg84.2%
sub-neg84.2%
distribute-rgt-out--84.2%
associate-*l*79.7%
distribute-lft-neg-in79.7%
cancel-sign-sub79.7%
associate-*l*79.7%
associate-*l*79.7%
Simplified79.7%
Taylor expanded in j around 0 66.7%
Taylor expanded in y around 0 71.2%
*-commutative6.7%
Simplified71.2%
Taylor expanded in t around 0 66.9%
Final simplification59.2%
NOTE: j and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(if (<= b -5.5e+132)
(- (* b c) (* 4.0 (* x i)))
(if (<= b -1.95e+75)
(* k (* j -27.0))
(if (<= b 6.5e-57) (* -4.0 (+ (* x i) (* t a))) (* b c)))))assert(j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double tmp;
if (b <= -5.5e+132) {
tmp = (b * c) - (4.0 * (x * i));
} else if (b <= -1.95e+75) {
tmp = k * (j * -27.0);
} else if (b <= 6.5e-57) {
tmp = -4.0 * ((x * i) + (t * a));
} else {
tmp = b * c;
}
return tmp;
}
NOTE: j and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: tmp
if (b <= (-5.5d+132)) then
tmp = (b * c) - (4.0d0 * (x * i))
else if (b <= (-1.95d+75)) then
tmp = k * (j * (-27.0d0))
else if (b <= 6.5d-57) then
tmp = (-4.0d0) * ((x * i) + (t * a))
else
tmp = b * c
end if
code = tmp
end function
assert j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double tmp;
if (b <= -5.5e+132) {
tmp = (b * c) - (4.0 * (x * i));
} else if (b <= -1.95e+75) {
tmp = k * (j * -27.0);
} else if (b <= 6.5e-57) {
tmp = -4.0 * ((x * i) + (t * a));
} else {
tmp = b * c;
}
return tmp;
}
[j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): tmp = 0 if b <= -5.5e+132: tmp = (b * c) - (4.0 * (x * i)) elif b <= -1.95e+75: tmp = k * (j * -27.0) elif b <= 6.5e-57: tmp = -4.0 * ((x * i) + (t * a)) else: tmp = b * c return tmp
j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) tmp = 0.0 if (b <= -5.5e+132) tmp = Float64(Float64(b * c) - Float64(4.0 * Float64(x * i))); elseif (b <= -1.95e+75) tmp = Float64(k * Float64(j * -27.0)); elseif (b <= 6.5e-57) tmp = Float64(-4.0 * Float64(Float64(x * i) + Float64(t * a))); else tmp = Float64(b * c); end return tmp end
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
tmp = 0.0;
if (b <= -5.5e+132)
tmp = (b * c) - (4.0 * (x * i));
elseif (b <= -1.95e+75)
tmp = k * (j * -27.0);
elseif (b <= 6.5e-57)
tmp = -4.0 * ((x * i) + (t * a));
else
tmp = b * c;
end
tmp_2 = tmp;
end
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[b, -5.5e+132], N[(N[(b * c), $MachinePrecision] - N[(4.0 * N[(x * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, -1.95e+75], N[(k * N[(j * -27.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 6.5e-57], N[(-4.0 * N[(N[(x * i), $MachinePrecision] + N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(b * c), $MachinePrecision]]]]
\begin{array}{l}
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
\mathbf{if}\;b \leq -5.5 \cdot 10^{+132}:\\
\;\;\;\;b \cdot c - 4 \cdot \left(x \cdot i\right)\\
\mathbf{elif}\;b \leq -1.95 \cdot 10^{+75}:\\
\;\;\;\;k \cdot \left(j \cdot -27\right)\\
\mathbf{elif}\;b \leq 6.5 \cdot 10^{-57}:\\
\;\;\;\;-4 \cdot \left(x \cdot i + t \cdot a\right)\\
\mathbf{else}:\\
\;\;\;\;b \cdot c\\
\end{array}
\end{array}
if b < -5.5e132Initial program 82.9%
sub-neg82.9%
associate-+l-82.9%
sub-neg82.9%
sub-neg82.9%
distribute-rgt-out--82.9%
associate-*l*82.9%
distribute-lft-neg-in82.9%
cancel-sign-sub82.9%
associate-*l*82.9%
associate-*l*82.9%
Simplified82.9%
Taylor expanded in j around 0 78.5%
Taylor expanded in y around 0 66.8%
*-commutative28.0%
Simplified66.8%
Taylor expanded in t around 0 54.6%
if -5.5e132 < b < -1.95000000000000019e75Initial program 92.2%
associate--l+92.2%
distribute-rgt-out--92.2%
associate-*r*76.8%
associate-*l*76.8%
*-commutative76.8%
Applied egg-rr76.8%
Taylor expanded in j around inf 55.0%
*-commutative55.0%
*-commutative55.0%
*-commutative55.0%
associate-*r*55.0%
Simplified55.0%
if -1.95000000000000019e75 < b < 6.49999999999999992e-57Initial program 87.9%
sub-neg87.9%
associate-+l-87.9%
sub-neg87.9%
sub-neg87.9%
distribute-rgt-out--89.6%
associate-*l*87.0%
distribute-lft-neg-in87.0%
cancel-sign-sub87.0%
associate-*l*87.9%
associate-*l*87.9%
Simplified87.9%
Taylor expanded in j around 0 71.5%
Taylor expanded in y around 0 51.7%
*-commutative26.6%
Simplified51.7%
Taylor expanded in c around 0 42.7%
cancel-sign-sub-inv42.7%
metadata-eval42.7%
+-commutative42.7%
distribute-lft-out42.7%
*-commutative42.7%
Simplified42.7%
if 6.49999999999999992e-57 < b Initial program 83.8%
Simplified89.6%
add-cbrt-cube79.3%
*-commutative79.3%
*-commutative79.3%
*-commutative79.3%
Applied egg-rr79.3%
Taylor expanded in b around inf 36.0%
Final simplification43.0%
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 -5.2e+93)
(* -27.0 (* j k))
(if (<= j -750000.0)
(* b c)
(if (<= j 3.8e-221)
(* t (* a -4.0))
(if (<= j 2.8e-54) (* b c) (* j (* k -27.0)))))))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 <= -5.2e+93) {
tmp = -27.0 * (j * k);
} else if (j <= -750000.0) {
tmp = b * c;
} else if (j <= 3.8e-221) {
tmp = t * (a * -4.0);
} else if (j <= 2.8e-54) {
tmp = b * c;
} else {
tmp = j * (k * -27.0);
}
return tmp;
}
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 <= (-5.2d+93)) then
tmp = (-27.0d0) * (j * k)
else if (j <= (-750000.0d0)) then
tmp = b * c
else if (j <= 3.8d-221) then
tmp = t * (a * (-4.0d0))
else if (j <= 2.8d-54) then
tmp = b * c
else
tmp = j * (k * (-27.0d0))
end if
code = tmp
end function
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 <= -5.2e+93) {
tmp = -27.0 * (j * k);
} else if (j <= -750000.0) {
tmp = b * c;
} else if (j <= 3.8e-221) {
tmp = t * (a * -4.0);
} else if (j <= 2.8e-54) {
tmp = b * c;
} else {
tmp = j * (k * -27.0);
}
return tmp;
}
[j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): tmp = 0 if j <= -5.2e+93: tmp = -27.0 * (j * k) elif j <= -750000.0: tmp = b * c elif j <= 3.8e-221: tmp = t * (a * -4.0) elif j <= 2.8e-54: tmp = b * c else: tmp = j * (k * -27.0) return tmp
j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) tmp = 0.0 if (j <= -5.2e+93) tmp = Float64(-27.0 * Float64(j * k)); elseif (j <= -750000.0) tmp = Float64(b * c); elseif (j <= 3.8e-221) tmp = Float64(t * Float64(a * -4.0)); elseif (j <= 2.8e-54) tmp = Float64(b * c); else tmp = Float64(j * Float64(k * -27.0)); end return tmp end
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 <= -5.2e+93)
tmp = -27.0 * (j * k);
elseif (j <= -750000.0)
tmp = b * c;
elseif (j <= 3.8e-221)
tmp = t * (a * -4.0);
elseif (j <= 2.8e-54)
tmp = b * c;
else
tmp = j * (k * -27.0);
end
tmp_2 = tmp;
end
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, -5.2e+93], N[(-27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision], If[LessEqual[j, -750000.0], N[(b * c), $MachinePrecision], If[LessEqual[j, 3.8e-221], N[(t * N[(a * -4.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[j, 2.8e-54], N[(b * c), $MachinePrecision], N[(j * N[(k * -27.0), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
\mathbf{if}\;j \leq -5.2 \cdot 10^{+93}:\\
\;\;\;\;-27 \cdot \left(j \cdot k\right)\\
\mathbf{elif}\;j \leq -750000:\\
\;\;\;\;b \cdot c\\
\mathbf{elif}\;j \leq 3.8 \cdot 10^{-221}:\\
\;\;\;\;t \cdot \left(a \cdot -4\right)\\
\mathbf{elif}\;j \leq 2.8 \cdot 10^{-54}:\\
\;\;\;\;b \cdot c\\
\mathbf{else}:\\
\;\;\;\;j \cdot \left(k \cdot -27\right)\\
\end{array}
\end{array}
if j < -5.19999999999999999e93Initial program 77.1%
sub-neg77.1%
+-commutative77.1%
associate-*l*77.2%
distribute-rgt-neg-in77.2%
fma-def84.0%
*-commutative84.0%
distribute-rgt-neg-in84.0%
metadata-eval84.0%
sub-neg84.0%
+-commutative84.0%
associate-*l*84.0%
distribute-rgt-neg-in84.0%
Simplified90.8%
Taylor expanded in j around inf 51.9%
if -5.19999999999999999e93 < j < -7.5e5 or 3.8000000000000001e-221 < j < 2.8000000000000002e-54Initial program 91.2%
Simplified89.8%
add-cbrt-cube85.5%
*-commutative85.5%
*-commutative85.5%
*-commutative85.5%
Applied egg-rr85.5%
Taylor expanded in b around inf 30.5%
if -7.5e5 < j < 3.8000000000000001e-221Initial program 89.8%
sub-neg89.8%
associate-+l-89.8%
sub-neg89.8%
sub-neg89.8%
distribute-rgt-out--89.8%
associate-*l*87.0%
distribute-lft-neg-in87.0%
cancel-sign-sub87.0%
associate-*l*87.0%
associate-*l*87.0%
Simplified87.0%
Taylor expanded in t around inf 59.5%
Taylor expanded in y around 0 40.1%
*-commutative40.1%
Simplified40.1%
if 2.8000000000000002e-54 < j Initial program 83.0%
sub-neg83.0%
+-commutative83.0%
associate-*l*83.0%
distribute-rgt-neg-in83.0%
fma-def86.9%
*-commutative86.9%
distribute-rgt-neg-in86.9%
metadata-eval86.9%
sub-neg86.9%
+-commutative86.9%
associate-*l*88.3%
distribute-rgt-neg-in88.3%
Simplified90.8%
Taylor expanded in j around inf 35.5%
associate-*r*35.6%
*-commutative35.6%
*-commutative35.6%
*-commutative35.6%
Simplified35.6%
Final simplification38.3%
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 (<= k -12200000.0) (not (<= k 1.5e+105))) (* -27.0 (* j k)) (* b c)))
assert(j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double tmp;
if ((k <= -12200000.0) || !(k <= 1.5e+105)) {
tmp = -27.0 * (j * k);
} else {
tmp = b * c;
}
return tmp;
}
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 ((k <= (-12200000.0d0)) .or. (.not. (k <= 1.5d+105))) then
tmp = (-27.0d0) * (j * k)
else
tmp = b * c
end if
code = tmp
end function
assert j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double tmp;
if ((k <= -12200000.0) || !(k <= 1.5e+105)) {
tmp = -27.0 * (j * k);
} else {
tmp = b * c;
}
return tmp;
}
[j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): tmp = 0 if (k <= -12200000.0) or not (k <= 1.5e+105): tmp = -27.0 * (j * k) else: tmp = b * c return tmp
j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) tmp = 0.0 if ((k <= -12200000.0) || !(k <= 1.5e+105)) tmp = Float64(-27.0 * Float64(j * k)); else tmp = Float64(b * c); end return tmp end
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
tmp = 0.0;
if ((k <= -12200000.0) || ~((k <= 1.5e+105)))
tmp = -27.0 * (j * k);
else
tmp = b * c;
end
tmp_2 = tmp;
end
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[k, -12200000.0], N[Not[LessEqual[k, 1.5e+105]], $MachinePrecision]], N[(-27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision], N[(b * c), $MachinePrecision]]
\begin{array}{l}
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
\mathbf{if}\;k \leq -12200000 \lor \neg \left(k \leq 1.5 \cdot 10^{+105}\right):\\
\;\;\;\;-27 \cdot \left(j \cdot k\right)\\
\mathbf{else}:\\
\;\;\;\;b \cdot c\\
\end{array}
\end{array}
if k < -1.22e7 or 1.5e105 < k Initial program 85.4%
sub-neg85.4%
+-commutative85.4%
associate-*l*85.4%
distribute-rgt-neg-in85.4%
fma-def89.7%
*-commutative89.7%
distribute-rgt-neg-in89.7%
metadata-eval89.7%
sub-neg89.7%
+-commutative89.7%
associate-*l*90.5%
distribute-rgt-neg-in90.5%
Simplified91.5%
Taylor expanded in j around inf 43.4%
if -1.22e7 < k < 1.5e105Initial program 86.4%
Simplified87.2%
add-cbrt-cube76.6%
*-commutative76.6%
*-commutative76.6%
*-commutative76.6%
Applied egg-rr76.6%
Taylor expanded in b around inf 27.0%
Final simplification34.5%
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 (<= k -6.8e+15) (not (<= k 1.6e+105))) (* j (* k -27.0)) (* b c)))
assert(j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double tmp;
if ((k <= -6.8e+15) || !(k <= 1.6e+105)) {
tmp = j * (k * -27.0);
} else {
tmp = b * c;
}
return tmp;
}
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 ((k <= (-6.8d+15)) .or. (.not. (k <= 1.6d+105))) then
tmp = j * (k * (-27.0d0))
else
tmp = b * c
end if
code = tmp
end function
assert j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double tmp;
if ((k <= -6.8e+15) || !(k <= 1.6e+105)) {
tmp = j * (k * -27.0);
} else {
tmp = b * c;
}
return tmp;
}
[j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): tmp = 0 if (k <= -6.8e+15) or not (k <= 1.6e+105): tmp = j * (k * -27.0) else: tmp = b * c return tmp
j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) tmp = 0.0 if ((k <= -6.8e+15) || !(k <= 1.6e+105)) tmp = Float64(j * Float64(k * -27.0)); else tmp = Float64(b * c); end return tmp end
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
tmp = 0.0;
if ((k <= -6.8e+15) || ~((k <= 1.6e+105)))
tmp = j * (k * -27.0);
else
tmp = b * c;
end
tmp_2 = tmp;
end
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[k, -6.8e+15], N[Not[LessEqual[k, 1.6e+105]], $MachinePrecision]], N[(j * N[(k * -27.0), $MachinePrecision]), $MachinePrecision], N[(b * c), $MachinePrecision]]
\begin{array}{l}
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
\mathbf{if}\;k \leq -6.8 \cdot 10^{+15} \lor \neg \left(k \leq 1.6 \cdot 10^{+105}\right):\\
\;\;\;\;j \cdot \left(k \cdot -27\right)\\
\mathbf{else}:\\
\;\;\;\;b \cdot c\\
\end{array}
\end{array}
if k < -6.8e15 or 1.6e105 < k Initial program 85.3%
sub-neg85.3%
+-commutative85.3%
associate-*l*85.3%
distribute-rgt-neg-in85.3%
fma-def89.6%
*-commutative89.6%
distribute-rgt-neg-in89.6%
metadata-eval89.6%
sub-neg89.6%
+-commutative89.6%
associate-*l*90.5%
distribute-rgt-neg-in90.5%
Simplified91.4%
Taylor expanded in j around inf 43.8%
associate-*r*43.7%
*-commutative43.7%
*-commutative43.7%
*-commutative43.7%
Simplified43.7%
if -6.8e15 < k < 1.6e105Initial program 86.5%
Simplified87.3%
add-cbrt-cube76.8%
*-commutative76.8%
*-commutative76.8%
*-commutative76.8%
Applied egg-rr76.8%
Taylor expanded in b around inf 27.5%
Final simplification34.9%
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(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: 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 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;
}
[j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): return b * c
j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) return Float64(b * c) end
j, k = num2cell(sort([j, k])){:}
function tmp = code(x, y, z, t, a, b, c, i, j, k)
tmp = b * c;
end
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}
[j, k] = \mathsf{sort}([j, k])\\
\\
b \cdot c
\end{array}
Initial program 86.0%
Simplified88.3%
add-cbrt-cube78.8%
*-commutative78.8%
*-commutative78.8%
*-commutative78.8%
Applied egg-rr78.8%
Taylor expanded in b around inf 25.3%
Final simplification25.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 2023238
(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)))