
(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 21 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b c i j k) :precision binary64 (- (- (+ (- (* (* (* (* x 18.0) y) z) t) (* (* a 4.0) t)) (* b c)) (* (* x 4.0) i)) (* (* j 27.0) k)))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
return (((((((x * 18.0) * y) * z) * t) - ((a * 4.0) * t)) + (b * c)) - ((x * 4.0) * i)) - ((j * 27.0) * k);
}
real(8) function code(x, y, z, t, a, b, c, i, j, k)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
code = (((((((x * 18.0d0) * y) * z) * t) - ((a * 4.0d0) * t)) + (b * c)) - ((x * 4.0d0) * i)) - ((j * 27.0d0) * k)
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
return (((((((x * 18.0) * y) * z) * t) - ((a * 4.0) * t)) + (b * c)) - ((x * 4.0) * i)) - ((j * 27.0) * k);
}
def code(x, y, z, t, a, b, c, i, j, k): return (((((((x * 18.0) * y) * z) * t) - ((a * 4.0) * t)) + (b * c)) - ((x * 4.0) * i)) - ((j * 27.0) * k)
function code(x, y, z, t, a, b, c, i, j, k) return Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(x * 18.0) * y) * z) * t) - Float64(Float64(a * 4.0) * t)) + Float64(b * c)) - Float64(Float64(x * 4.0) * i)) - Float64(Float64(j * 27.0) * k)) end
function tmp = code(x, y, z, t, a, b, c, i, j, k) tmp = (((((((x * 18.0) * y) * z) * t) - ((a * 4.0) * t)) + (b * c)) - ((x * 4.0) * i)) - ((j * 27.0) * k); end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := N[(N[(N[(N[(N[(N[(N[(N[(x * 18.0), $MachinePrecision] * y), $MachinePrecision] * z), $MachinePrecision] * t), $MachinePrecision] - N[(N[(a * 4.0), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] + N[(b * c), $MachinePrecision]), $MachinePrecision] - N[(N[(x * 4.0), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision] - N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k
\end{array}
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1
(-
(-
(+ (- (* (* (* (* x 18.0) y) z) t) (* t (* a 4.0))) (* b c))
(* (* x 4.0) i))
(* (* j 27.0) k))))
(if (<= t_1 INFINITY) t_1 (* x (- (* 18.0 (* y (* z t))) (* 4.0 i))))))assert(y < z);
assert(j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = (((((((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 <= ((double) INFINITY)) {
tmp = t_1;
} else {
tmp = x * ((18.0 * (y * (z * t))) - (4.0 * i));
}
return tmp;
}
assert y < z;
assert j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = (((((((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 <= Double.POSITIVE_INFINITY) {
tmp = t_1;
} else {
tmp = x * ((18.0 * (y * (z * t))) - (4.0 * i));
}
return tmp;
}
[y, z] = sort([y, z]) [j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): t_1 = (((((((x * 18.0) * y) * z) * t) - (t * (a * 4.0))) + (b * c)) - ((x * 4.0) * i)) - ((j * 27.0) * k) tmp = 0 if t_1 <= math.inf: tmp = t_1 else: tmp = x * ((18.0 * (y * (z * t))) - (4.0 * i)) return tmp
y, z = sort([y, z]) j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(Float64(Float64(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 <= Inf) tmp = t_1; else tmp = Float64(x * Float64(Float64(18.0 * Float64(y * Float64(z * t))) - Float64(4.0 * i))); end return tmp end
y, z = num2cell(sort([y, z])){:}
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
t_1 = (((((((x * 18.0) * y) * z) * t) - (t * (a * 4.0))) + (b * c)) - ((x * 4.0) * i)) - ((j * 27.0) * k);
tmp = 0.0;
if (t_1 <= Inf)
tmp = t_1;
else
tmp = x * ((18.0 * (y * (z * t))) - (4.0 * i));
end
tmp_2 = tmp;
end
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(N[(N[(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, Infinity], t$95$1, N[(x * N[(N[(18.0 * N[(y * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(4.0 * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
t_1 := \left(\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 \infty:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(18 \cdot \left(y \cdot \left(z \cdot t\right)\right) - 4 \cdot i\right)\\
\end{array}
\end{array}
if (-.f64 (-.f64 (+.f64 (-.f64 (*.f64 (*.f64 (*.f64 (*.f64 x 18) y) z) t) (*.f64 (*.f64 a 4) t)) (*.f64 b c)) (*.f64 (*.f64 x 4) i)) (*.f64 (*.f64 j 27) k)) < +inf.0Initial program 97.0%
if +inf.0 < (-.f64 (-.f64 (+.f64 (-.f64 (*.f64 (*.f64 (*.f64 (*.f64 x 18) y) z) t) (*.f64 (*.f64 a 4) t)) (*.f64 b c)) (*.f64 (*.f64 x 4) i)) (*.f64 (*.f64 j 27) k)) Initial program 0.0%
sub-neg0.0%
associate-+l-0.0%
sub-neg0.0%
sub-neg0.0%
distribute-rgt-out--18.5%
associate-*l*22.2%
distribute-lft-neg-in22.2%
cancel-sign-sub22.2%
associate-*l*22.2%
associate-*l*22.2%
Simplified22.2%
Taylor expanded in x around inf 66.8%
Final simplification93.8%
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (+ (* t (* a -4.0)) (* k (* j -27.0))))
(t_2 (* -4.0 (+ (* x i) (* t a))))
(t_3 (- (* b c) (* 27.0 (* j k))))
(t_4 (* x (- (* 18.0 (* y (* z t))) (* 4.0 i)))))
(if (<= x -1.45e+45)
t_4
(if (<= x -2e+18)
t_3
(if (<= x -7e-11)
t_2
(if (<= x -1.45e-119)
t_1
(if (<= x -3.3e-247)
t_3
(if (<= x 2e-279)
t_1
(if (<= x 3.4e-163)
(- (* b c) (* 4.0 (* t a)))
(if (<= x 4.4e-40)
t_3
(if (<= x 5.7e+82)
t_2
(if (<= x 2.8e+114) t_3 t_4))))))))))))assert(y < z);
assert(j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = (t * (a * -4.0)) + (k * (j * -27.0));
double t_2 = -4.0 * ((x * i) + (t * a));
double t_3 = (b * c) - (27.0 * (j * k));
double t_4 = x * ((18.0 * (y * (z * t))) - (4.0 * i));
double tmp;
if (x <= -1.45e+45) {
tmp = t_4;
} else if (x <= -2e+18) {
tmp = t_3;
} else if (x <= -7e-11) {
tmp = t_2;
} else if (x <= -1.45e-119) {
tmp = t_1;
} else if (x <= -3.3e-247) {
tmp = t_3;
} else if (x <= 2e-279) {
tmp = t_1;
} else if (x <= 3.4e-163) {
tmp = (b * c) - (4.0 * (t * a));
} else if (x <= 4.4e-40) {
tmp = t_3;
} else if (x <= 5.7e+82) {
tmp = t_2;
} else if (x <= 2.8e+114) {
tmp = t_3;
} else {
tmp = t_4;
}
return tmp;
}
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: tmp
t_1 = (t * (a * (-4.0d0))) + (k * (j * (-27.0d0)))
t_2 = (-4.0d0) * ((x * i) + (t * a))
t_3 = (b * c) - (27.0d0 * (j * k))
t_4 = x * ((18.0d0 * (y * (z * t))) - (4.0d0 * i))
if (x <= (-1.45d+45)) then
tmp = t_4
else if (x <= (-2d+18)) then
tmp = t_3
else if (x <= (-7d-11)) then
tmp = t_2
else if (x <= (-1.45d-119)) then
tmp = t_1
else if (x <= (-3.3d-247)) then
tmp = t_3
else if (x <= 2d-279) then
tmp = t_1
else if (x <= 3.4d-163) then
tmp = (b * c) - (4.0d0 * (t * a))
else if (x <= 4.4d-40) then
tmp = t_3
else if (x <= 5.7d+82) then
tmp = t_2
else if (x <= 2.8d+114) then
tmp = t_3
else
tmp = t_4
end if
code = tmp
end function
assert y < z;
assert j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = (t * (a * -4.0)) + (k * (j * -27.0));
double t_2 = -4.0 * ((x * i) + (t * a));
double t_3 = (b * c) - (27.0 * (j * k));
double t_4 = x * ((18.0 * (y * (z * t))) - (4.0 * i));
double tmp;
if (x <= -1.45e+45) {
tmp = t_4;
} else if (x <= -2e+18) {
tmp = t_3;
} else if (x <= -7e-11) {
tmp = t_2;
} else if (x <= -1.45e-119) {
tmp = t_1;
} else if (x <= -3.3e-247) {
tmp = t_3;
} else if (x <= 2e-279) {
tmp = t_1;
} else if (x <= 3.4e-163) {
tmp = (b * c) - (4.0 * (t * a));
} else if (x <= 4.4e-40) {
tmp = t_3;
} else if (x <= 5.7e+82) {
tmp = t_2;
} else if (x <= 2.8e+114) {
tmp = t_3;
} else {
tmp = t_4;
}
return tmp;
}
[y, z] = sort([y, z]) [j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): t_1 = (t * (a * -4.0)) + (k * (j * -27.0)) t_2 = -4.0 * ((x * i) + (t * a)) t_3 = (b * c) - (27.0 * (j * k)) t_4 = x * ((18.0 * (y * (z * t))) - (4.0 * i)) tmp = 0 if x <= -1.45e+45: tmp = t_4 elif x <= -2e+18: tmp = t_3 elif x <= -7e-11: tmp = t_2 elif x <= -1.45e-119: tmp = t_1 elif x <= -3.3e-247: tmp = t_3 elif x <= 2e-279: tmp = t_1 elif x <= 3.4e-163: tmp = (b * c) - (4.0 * (t * a)) elif x <= 4.4e-40: tmp = t_3 elif x <= 5.7e+82: tmp = t_2 elif x <= 2.8e+114: tmp = t_3 else: tmp = t_4 return tmp
y, z = sort([y, z]) j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(Float64(t * Float64(a * -4.0)) + Float64(k * Float64(j * -27.0))) t_2 = Float64(-4.0 * Float64(Float64(x * i) + Float64(t * a))) t_3 = Float64(Float64(b * c) - Float64(27.0 * Float64(j * k))) t_4 = Float64(x * Float64(Float64(18.0 * Float64(y * Float64(z * t))) - Float64(4.0 * i))) tmp = 0.0 if (x <= -1.45e+45) tmp = t_4; elseif (x <= -2e+18) tmp = t_3; elseif (x <= -7e-11) tmp = t_2; elseif (x <= -1.45e-119) tmp = t_1; elseif (x <= -3.3e-247) tmp = t_3; elseif (x <= 2e-279) tmp = t_1; elseif (x <= 3.4e-163) tmp = Float64(Float64(b * c) - Float64(4.0 * Float64(t * a))); elseif (x <= 4.4e-40) tmp = t_3; elseif (x <= 5.7e+82) tmp = t_2; elseif (x <= 2.8e+114) tmp = t_3; else tmp = t_4; end return tmp end
y, z = num2cell(sort([y, z])){:}
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
t_1 = (t * (a * -4.0)) + (k * (j * -27.0));
t_2 = -4.0 * ((x * i) + (t * a));
t_3 = (b * c) - (27.0 * (j * k));
t_4 = x * ((18.0 * (y * (z * t))) - (4.0 * i));
tmp = 0.0;
if (x <= -1.45e+45)
tmp = t_4;
elseif (x <= -2e+18)
tmp = t_3;
elseif (x <= -7e-11)
tmp = t_2;
elseif (x <= -1.45e-119)
tmp = t_1;
elseif (x <= -3.3e-247)
tmp = t_3;
elseif (x <= 2e-279)
tmp = t_1;
elseif (x <= 3.4e-163)
tmp = (b * c) - (4.0 * (t * a));
elseif (x <= 4.4e-40)
tmp = t_3;
elseif (x <= 5.7e+82)
tmp = t_2;
elseif (x <= 2.8e+114)
tmp = t_3;
else
tmp = t_4;
end
tmp_2 = tmp;
end
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(N[(t * N[(a * -4.0), $MachinePrecision]), $MachinePrecision] + N[(k * N[(j * -27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(-4.0 * N[(N[(x * i), $MachinePrecision] + N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(b * c), $MachinePrecision] - N[(27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = 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.45e+45], t$95$4, If[LessEqual[x, -2e+18], t$95$3, If[LessEqual[x, -7e-11], t$95$2, If[LessEqual[x, -1.45e-119], t$95$1, If[LessEqual[x, -3.3e-247], t$95$3, If[LessEqual[x, 2e-279], t$95$1, If[LessEqual[x, 3.4e-163], N[(N[(b * c), $MachinePrecision] - N[(4.0 * N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 4.4e-40], t$95$3, If[LessEqual[x, 5.7e+82], t$95$2, If[LessEqual[x, 2.8e+114], t$95$3, t$95$4]]]]]]]]]]]]]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
t_1 := t \cdot \left(a \cdot -4\right) + k \cdot \left(j \cdot -27\right)\\
t_2 := -4 \cdot \left(x \cdot i + t \cdot a\right)\\
t_3 := b \cdot c - 27 \cdot \left(j \cdot k\right)\\
t_4 := x \cdot \left(18 \cdot \left(y \cdot \left(z \cdot t\right)\right) - 4 \cdot i\right)\\
\mathbf{if}\;x \leq -1.45 \cdot 10^{+45}:\\
\;\;\;\;t_4\\
\mathbf{elif}\;x \leq -2 \cdot 10^{+18}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;x \leq -7 \cdot 10^{-11}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x \leq -1.45 \cdot 10^{-119}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq -3.3 \cdot 10^{-247}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;x \leq 2 \cdot 10^{-279}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 3.4 \cdot 10^{-163}:\\
\;\;\;\;b \cdot c - 4 \cdot \left(t \cdot a\right)\\
\mathbf{elif}\;x \leq 4.4 \cdot 10^{-40}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;x \leq 5.7 \cdot 10^{+82}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x \leq 2.8 \cdot 10^{+114}:\\
\;\;\;\;t_3\\
\mathbf{else}:\\
\;\;\;\;t_4\\
\end{array}
\end{array}
if x < -1.4499999999999999e45 or 2.8e114 < x Initial program 73.8%
sub-neg73.8%
associate-+l-73.8%
sub-neg73.8%
sub-neg73.8%
distribute-rgt-out--77.8%
associate-*l*80.6%
distribute-lft-neg-in80.6%
cancel-sign-sub80.6%
associate-*l*80.6%
associate-*l*80.6%
Simplified80.6%
Taylor expanded in x around inf 74.6%
if -1.4499999999999999e45 < x < -2e18 or -1.45e-119 < x < -3.29999999999999971e-247 or 3.40000000000000014e-163 < x < 4.40000000000000018e-40 or 5.70000000000000016e82 < x < 2.8e114Initial program 98.4%
Taylor expanded in x around 0 83.7%
Taylor expanded in a around 0 76.0%
if -2e18 < x < -7.00000000000000038e-11 or 4.40000000000000018e-40 < x < 5.70000000000000016e82Initial program 92.3%
sub-neg92.3%
associate-+l-92.3%
sub-neg92.3%
sub-neg92.3%
distribute-rgt-out--92.3%
associate-*l*92.3%
distribute-lft-neg-in92.3%
cancel-sign-sub92.3%
associate-*l*92.3%
associate-*l*92.3%
Simplified92.3%
fma-def96.2%
associate-*l*96.2%
Applied egg-rr96.2%
Taylor expanded in x around inf 88.7%
*-commutative88.7%
associate-*l*88.7%
Simplified88.7%
Taylor expanded in a around inf 77.4%
associate-*r*77.4%
Simplified77.4%
Taylor expanded in a around 0 77.4%
distribute-lft-out77.4%
*-commutative77.4%
Simplified77.4%
if -7.00000000000000038e-11 < x < -1.45e-119 or -3.29999999999999971e-247 < x < 2.00000000000000011e-279Initial program 92.4%
Taylor expanded in x around 0 87.8%
Taylor expanded in c around 0 82.9%
distribute-rgt-in82.9%
*-commutative82.9%
*-commutative82.9%
associate-*r*82.9%
metadata-eval82.9%
*-commutative82.9%
associate-*r*82.9%
*-commutative82.9%
*-commutative82.9%
associate-*l*82.9%
metadata-eval82.9%
*-commutative82.9%
associate-*r*82.9%
Simplified82.9%
if 2.00000000000000011e-279 < x < 3.40000000000000014e-163Initial program 95.2%
Taylor expanded in x around 0 86.4%
Taylor expanded in j around 0 81.3%
Final simplification77.1%
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(if (<= (* b c) 5e+298)
(-
(+ (* t (- (* (* x 18.0) (* y z)) (* a 4.0))) (* b c))
(+ (* x (* 4.0 i)) (* j (* 27.0 k))))
(* b c)))assert(y < z);
assert(j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double tmp;
if ((b * c) <= 5e+298) {
tmp = ((t * (((x * 18.0) * (y * z)) - (a * 4.0))) + (b * c)) - ((x * (4.0 * i)) + (j * (27.0 * k)));
} else {
tmp = b * c;
}
return tmp;
}
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: tmp
if ((b * c) <= 5d+298) 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
end if
code = tmp
end function
assert y < z;
assert j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double tmp;
if ((b * c) <= 5e+298) {
tmp = ((t * (((x * 18.0) * (y * z)) - (a * 4.0))) + (b * c)) - ((x * (4.0 * i)) + (j * (27.0 * k)));
} else {
tmp = b * c;
}
return tmp;
}
[y, z] = sort([y, z]) [j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): tmp = 0 if (b * c) <= 5e+298: tmp = ((t * (((x * 18.0) * (y * z)) - (a * 4.0))) + (b * c)) - ((x * (4.0 * i)) + (j * (27.0 * k))) else: tmp = b * c return tmp
y, z = sort([y, z]) j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) tmp = 0.0 if (Float64(b * c) <= 5e+298) 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(b * c); end return tmp end
y, z = num2cell(sort([y, z])){:}
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
tmp = 0.0;
if ((b * c) <= 5e+298)
tmp = ((t * (((x * 18.0) * (y * z)) - (a * 4.0))) + (b * c)) - ((x * (4.0 * i)) + (j * (27.0 * k)));
else
tmp = b * c;
end
tmp_2 = tmp;
end
NOTE: y and z should be sorted in increasing order before calling this function. NOTE: j and k should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := If[LessEqual[N[(b * c), $MachinePrecision], 5e+298], 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[(b * c), $MachinePrecision]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
\mathbf{if}\;b \cdot c \leq 5 \cdot 10^{+298}:\\
\;\;\;\;\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}:\\
\;\;\;\;b \cdot c\\
\end{array}
\end{array}
if (*.f64 b c) < 5.0000000000000003e298Initial program 88.5%
sub-neg88.5%
associate-+l-88.5%
sub-neg88.5%
sub-neg88.5%
distribute-rgt-out--90.5%
associate-*l*89.8%
distribute-lft-neg-in89.8%
cancel-sign-sub89.8%
associate-*l*89.8%
associate-*l*89.8%
Simplified89.8%
if 5.0000000000000003e298 < (*.f64 b c) Initial program 60.0%
sub-neg60.0%
associate-+l-60.0%
sub-neg60.0%
sub-neg60.0%
distribute-rgt-out--60.0%
associate-*l*53.3%
distribute-lft-neg-in53.3%
cancel-sign-sub53.3%
associate-*l*53.3%
associate-*l*53.3%
Simplified53.3%
fma-def66.7%
associate-*l*66.7%
Applied egg-rr66.7%
Taylor expanded in x around inf 66.7%
*-commutative66.7%
associate-*l*66.7%
Simplified66.7%
Taylor expanded in b around inf 80.0%
Final simplification89.3%
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (+ (* j (* k -27.0)) (* -4.0 (* x i))))
(t_2 (- (* b c) (* 27.0 (* j k))))
(t_3 (* t (- (* 18.0 (* y (* x z))) (* a 4.0)))))
(if (<= t -6.3e+91)
t_3
(if (<= t -3.6e+36)
t_2
(if (<= t -0.00037)
t_3
(if (<= t -2.3e-156)
t_1
(if (<= t -9.5e-254)
t_2
(if (<= t 3.3e-134)
t_1
(if (<= t 8e-97) t_2 (if (<= t 1.4e+38) t_1 t_3))))))))))assert(y < z);
assert(j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = (j * (k * -27.0)) + (-4.0 * (x * i));
double t_2 = (b * c) - (27.0 * (j * k));
double t_3 = t * ((18.0 * (y * (x * z))) - (a * 4.0));
double tmp;
if (t <= -6.3e+91) {
tmp = t_3;
} else if (t <= -3.6e+36) {
tmp = t_2;
} else if (t <= -0.00037) {
tmp = t_3;
} else if (t <= -2.3e-156) {
tmp = t_1;
} else if (t <= -9.5e-254) {
tmp = t_2;
} else if (t <= 3.3e-134) {
tmp = t_1;
} else if (t <= 8e-97) {
tmp = t_2;
} else if (t <= 1.4e+38) {
tmp = t_1;
} else {
tmp = t_3;
}
return tmp;
}
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_1 = (j * (k * (-27.0d0))) + ((-4.0d0) * (x * i))
t_2 = (b * c) - (27.0d0 * (j * k))
t_3 = t * ((18.0d0 * (y * (x * z))) - (a * 4.0d0))
if (t <= (-6.3d+91)) then
tmp = t_3
else if (t <= (-3.6d+36)) then
tmp = t_2
else if (t <= (-0.00037d0)) then
tmp = t_3
else if (t <= (-2.3d-156)) then
tmp = t_1
else if (t <= (-9.5d-254)) then
tmp = t_2
else if (t <= 3.3d-134) then
tmp = t_1
else if (t <= 8d-97) then
tmp = t_2
else if (t <= 1.4d+38) then
tmp = t_1
else
tmp = t_3
end if
code = tmp
end function
assert y < z;
assert j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = (j * (k * -27.0)) + (-4.0 * (x * i));
double t_2 = (b * c) - (27.0 * (j * k));
double t_3 = t * ((18.0 * (y * (x * z))) - (a * 4.0));
double tmp;
if (t <= -6.3e+91) {
tmp = t_3;
} else if (t <= -3.6e+36) {
tmp = t_2;
} else if (t <= -0.00037) {
tmp = t_3;
} else if (t <= -2.3e-156) {
tmp = t_1;
} else if (t <= -9.5e-254) {
tmp = t_2;
} else if (t <= 3.3e-134) {
tmp = t_1;
} else if (t <= 8e-97) {
tmp = t_2;
} else if (t <= 1.4e+38) {
tmp = t_1;
} else {
tmp = t_3;
}
return tmp;
}
[y, z] = sort([y, z]) [j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): t_1 = (j * (k * -27.0)) + (-4.0 * (x * i)) t_2 = (b * c) - (27.0 * (j * k)) t_3 = t * ((18.0 * (y * (x * z))) - (a * 4.0)) tmp = 0 if t <= -6.3e+91: tmp = t_3 elif t <= -3.6e+36: tmp = t_2 elif t <= -0.00037: tmp = t_3 elif t <= -2.3e-156: tmp = t_1 elif t <= -9.5e-254: tmp = t_2 elif t <= 3.3e-134: tmp = t_1 elif t <= 8e-97: tmp = t_2 elif t <= 1.4e+38: tmp = t_1 else: tmp = t_3 return tmp
y, z = sort([y, z]) j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(Float64(j * Float64(k * -27.0)) + Float64(-4.0 * Float64(x * i))) t_2 = Float64(Float64(b * c) - Float64(27.0 * Float64(j * k))) t_3 = Float64(t * Float64(Float64(18.0 * Float64(y * Float64(x * z))) - Float64(a * 4.0))) tmp = 0.0 if (t <= -6.3e+91) tmp = t_3; elseif (t <= -3.6e+36) tmp = t_2; elseif (t <= -0.00037) tmp = t_3; elseif (t <= -2.3e-156) tmp = t_1; elseif (t <= -9.5e-254) tmp = t_2; elseif (t <= 3.3e-134) tmp = t_1; elseif (t <= 8e-97) tmp = t_2; elseif (t <= 1.4e+38) tmp = t_1; else tmp = t_3; end return tmp end
y, z = num2cell(sort([y, z])){:}
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
t_1 = (j * (k * -27.0)) + (-4.0 * (x * i));
t_2 = (b * c) - (27.0 * (j * k));
t_3 = t * ((18.0 * (y * (x * z))) - (a * 4.0));
tmp = 0.0;
if (t <= -6.3e+91)
tmp = t_3;
elseif (t <= -3.6e+36)
tmp = t_2;
elseif (t <= -0.00037)
tmp = t_3;
elseif (t <= -2.3e-156)
tmp = t_1;
elseif (t <= -9.5e-254)
tmp = t_2;
elseif (t <= 3.3e-134)
tmp = t_1;
elseif (t <= 8e-97)
tmp = t_2;
elseif (t <= 1.4e+38)
tmp = t_1;
else
tmp = t_3;
end
tmp_2 = tmp;
end
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(N[(j * N[(k * -27.0), $MachinePrecision]), $MachinePrecision] + N[(-4.0 * N[(x * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(b * c), $MachinePrecision] - N[(27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(t * N[(N[(18.0 * N[(y * N[(x * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(a * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -6.3e+91], t$95$3, If[LessEqual[t, -3.6e+36], t$95$2, If[LessEqual[t, -0.00037], t$95$3, If[LessEqual[t, -2.3e-156], t$95$1, If[LessEqual[t, -9.5e-254], t$95$2, If[LessEqual[t, 3.3e-134], t$95$1, If[LessEqual[t, 8e-97], t$95$2, If[LessEqual[t, 1.4e+38], t$95$1, t$95$3]]]]]]]]]]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
t_1 := j \cdot \left(k \cdot -27\right) + -4 \cdot \left(x \cdot i\right)\\
t_2 := b \cdot c - 27 \cdot \left(j \cdot k\right)\\
t_3 := t \cdot \left(18 \cdot \left(y \cdot \left(x \cdot z\right)\right) - a \cdot 4\right)\\
\mathbf{if}\;t \leq -6.3 \cdot 10^{+91}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;t \leq -3.6 \cdot 10^{+36}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t \leq -0.00037:\\
\;\;\;\;t_3\\
\mathbf{elif}\;t \leq -2.3 \cdot 10^{-156}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq -9.5 \cdot 10^{-254}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t \leq 3.3 \cdot 10^{-134}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq 8 \cdot 10^{-97}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t \leq 1.4 \cdot 10^{+38}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_3\\
\end{array}
\end{array}
if t < -6.3e91 or -3.5999999999999997e36 < t < -3.6999999999999999e-4 or 1.4e38 < t Initial program 82.6%
sub-neg82.6%
associate-+l-82.6%
sub-neg82.6%
sub-neg82.6%
distribute-rgt-out--87.0%
associate-*l*87.2%
distribute-lft-neg-in87.2%
cancel-sign-sub87.2%
associate-*l*87.2%
associate-*l*87.2%
Simplified87.2%
Taylor expanded in t around inf 73.4%
if -6.3e91 < t < -3.5999999999999997e36 or -2.3e-156 < t < -9.5000000000000003e-254 or 3.30000000000000019e-134 < t < 8.00000000000000029e-97Initial program 91.0%
Taylor expanded in x around 0 81.9%
Taylor expanded in a around 0 78.6%
if -3.6999999999999999e-4 < t < -2.3e-156 or -9.5000000000000003e-254 < t < 3.30000000000000019e-134 or 8.00000000000000029e-97 < t < 1.4e38Initial program 89.8%
sub-neg89.8%
+-commutative89.8%
associate-*l*89.9%
distribute-rgt-neg-in89.9%
fma-def91.9%
*-commutative91.9%
distribute-rgt-neg-in91.9%
metadata-eval91.9%
sub-neg91.9%
+-commutative91.9%
associate-*l*91.9%
distribute-rgt-neg-in91.9%
Simplified90.9%
Taylor expanded in i around inf 65.7%
*-commutative65.7%
Simplified65.7%
fma-udef64.7%
Applied egg-rr64.7%
Final simplification71.0%
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (+ (* b c) (* x (+ (* 18.0 (* y (* z t))) (* i -4.0))))))
(if (<= x -3e+180)
t_1
(if (<= x -1.4e+79)
(- (* (* z (* x t)) (* 18.0 y)) (+ (* x (* 4.0 i)) (* j (* 27.0 k))))
(if (or (<= x -1.9e+49) (not (<= x 1.6e+62)))
t_1
(-
(- (* b c) (+ (* 4.0 (* x i)) (* 4.0 (* t a))))
(* (* j 27.0) k)))))))assert(y < z);
assert(j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = (b * c) + (x * ((18.0 * (y * (z * t))) + (i * -4.0)));
double tmp;
if (x <= -3e+180) {
tmp = t_1;
} else if (x <= -1.4e+79) {
tmp = ((z * (x * t)) * (18.0 * y)) - ((x * (4.0 * i)) + (j * (27.0 * k)));
} else if ((x <= -1.9e+49) || !(x <= 1.6e+62)) {
tmp = t_1;
} else {
tmp = ((b * c) - ((4.0 * (x * i)) + (4.0 * (t * a)))) - ((j * 27.0) * k);
}
return tmp;
}
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: tmp
t_1 = (b * c) + (x * ((18.0d0 * (y * (z * t))) + (i * (-4.0d0))))
if (x <= (-3d+180)) then
tmp = t_1
else if (x <= (-1.4d+79)) then
tmp = ((z * (x * t)) * (18.0d0 * y)) - ((x * (4.0d0 * i)) + (j * (27.0d0 * k)))
else if ((x <= (-1.9d+49)) .or. (.not. (x <= 1.6d+62))) then
tmp = t_1
else
tmp = ((b * c) - ((4.0d0 * (x * i)) + (4.0d0 * (t * a)))) - ((j * 27.0d0) * k)
end if
code = tmp
end function
assert y < z;
assert j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = (b * c) + (x * ((18.0 * (y * (z * t))) + (i * -4.0)));
double tmp;
if (x <= -3e+180) {
tmp = t_1;
} else if (x <= -1.4e+79) {
tmp = ((z * (x * t)) * (18.0 * y)) - ((x * (4.0 * i)) + (j * (27.0 * k)));
} else if ((x <= -1.9e+49) || !(x <= 1.6e+62)) {
tmp = t_1;
} else {
tmp = ((b * c) - ((4.0 * (x * i)) + (4.0 * (t * a)))) - ((j * 27.0) * k);
}
return tmp;
}
[y, z] = sort([y, z]) [j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): t_1 = (b * c) + (x * ((18.0 * (y * (z * t))) + (i * -4.0))) tmp = 0 if x <= -3e+180: tmp = t_1 elif x <= -1.4e+79: tmp = ((z * (x * t)) * (18.0 * y)) - ((x * (4.0 * i)) + (j * (27.0 * k))) elif (x <= -1.9e+49) or not (x <= 1.6e+62): tmp = t_1 else: tmp = ((b * c) - ((4.0 * (x * i)) + (4.0 * (t * a)))) - ((j * 27.0) * k) return tmp
y, z = sort([y, z]) j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(Float64(b * c) + Float64(x * Float64(Float64(18.0 * Float64(y * Float64(z * t))) + Float64(i * -4.0)))) tmp = 0.0 if (x <= -3e+180) tmp = t_1; elseif (x <= -1.4e+79) tmp = Float64(Float64(Float64(z * Float64(x * t)) * Float64(18.0 * y)) - Float64(Float64(x * Float64(4.0 * i)) + Float64(j * Float64(27.0 * k)))); elseif ((x <= -1.9e+49) || !(x <= 1.6e+62)) tmp = t_1; 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
y, z = num2cell(sort([y, z])){:}
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
t_1 = (b * c) + (x * ((18.0 * (y * (z * t))) + (i * -4.0)));
tmp = 0.0;
if (x <= -3e+180)
tmp = t_1;
elseif (x <= -1.4e+79)
tmp = ((z * (x * t)) * (18.0 * y)) - ((x * (4.0 * i)) + (j * (27.0 * k)));
elseif ((x <= -1.9e+49) || ~((x <= 1.6e+62)))
tmp = t_1;
else
tmp = ((b * c) - ((4.0 * (x * i)) + (4.0 * (t * a)))) - ((j * 27.0) * k);
end
tmp_2 = tmp;
end
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(N[(b * c), $MachinePrecision] + N[(x * N[(N[(18.0 * N[(y * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(i * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -3e+180], t$95$1, If[LessEqual[x, -1.4e+79], N[(N[(N[(z * N[(x * t), $MachinePrecision]), $MachinePrecision] * N[(18.0 * y), $MachinePrecision]), $MachinePrecision] - N[(N[(x * N[(4.0 * i), $MachinePrecision]), $MachinePrecision] + N[(j * N[(27.0 * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[x, -1.9e+49], N[Not[LessEqual[x, 1.6e+62]], $MachinePrecision]], t$95$1, 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}
[y, z] = \mathsf{sort}([y, z])\\
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
t_1 := b \cdot c + x \cdot \left(18 \cdot \left(y \cdot \left(z \cdot t\right)\right) + i \cdot -4\right)\\
\mathbf{if}\;x \leq -3 \cdot 10^{+180}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq -1.4 \cdot 10^{+79}:\\
\;\;\;\;\left(z \cdot \left(x \cdot t\right)\right) \cdot \left(18 \cdot y\right) - \left(x \cdot \left(4 \cdot i\right) + j \cdot \left(27 \cdot k\right)\right)\\
\mathbf{elif}\;x \leq -1.9 \cdot 10^{+49} \lor \neg \left(x \leq 1.6 \cdot 10^{+62}\right):\\
\;\;\;\;t_1\\
\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 x < -3.00000000000000003e180 or -1.4000000000000001e79 < x < -1.8999999999999999e49 or 1.59999999999999992e62 < x Initial program 75.6%
Simplified88.2%
Taylor expanded in a around 0 84.0%
Taylor expanded in k around 0 83.1%
if -3.00000000000000003e180 < x < -1.4000000000000001e79Initial program 74.0%
sub-neg74.0%
associate-+l-74.0%
sub-neg74.0%
sub-neg74.0%
distribute-rgt-out--84.5%
associate-*l*89.8%
distribute-lft-neg-in89.8%
cancel-sign-sub89.8%
associate-*l*89.8%
associate-*l*89.8%
Simplified89.8%
fma-def89.8%
associate-*l*89.8%
Applied egg-rr89.8%
Taylor expanded in x around inf 85.2%
associate-*r*85.2%
*-commutative85.2%
*-commutative85.2%
associate-*l*95.3%
Simplified95.3%
if -1.8999999999999999e49 < x < 1.59999999999999992e62Initial program 95.7%
Taylor expanded in y around 0 90.0%
Final simplification87.9%
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(if (<= x -1.9e+17)
(+
(* b c)
(+ (* -27.0 (* j k)) (* x (+ (* 18.0 (* y (* z t))) (* i -4.0)))))
(if (<= x 8e+77)
(- (- (* b c) (+ (* 4.0 (* x i)) (* 4.0 (* t a)))) (* (* j 27.0) k))
(-
(+ (* b c) (* t (- (* x (* 18.0 (* y z))) (* a 4.0))))
(* (* x 4.0) i)))))assert(y < z);
assert(j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double tmp;
if (x <= -1.9e+17) {
tmp = (b * c) + ((-27.0 * (j * k)) + (x * ((18.0 * (y * (z * t))) + (i * -4.0))));
} else if (x <= 8e+77) {
tmp = ((b * c) - ((4.0 * (x * i)) + (4.0 * (t * a)))) - ((j * 27.0) * k);
} else {
tmp = ((b * c) + (t * ((x * (18.0 * (y * z))) - (a * 4.0)))) - ((x * 4.0) * i);
}
return tmp;
}
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: tmp
if (x <= (-1.9d+17)) then
tmp = (b * c) + (((-27.0d0) * (j * k)) + (x * ((18.0d0 * (y * (z * t))) + (i * (-4.0d0)))))
else if (x <= 8d+77) then
tmp = ((b * c) - ((4.0d0 * (x * i)) + (4.0d0 * (t * a)))) - ((j * 27.0d0) * k)
else
tmp = ((b * c) + (t * ((x * (18.0d0 * (y * z))) - (a * 4.0d0)))) - ((x * 4.0d0) * i)
end if
code = tmp
end function
assert y < z;
assert j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double tmp;
if (x <= -1.9e+17) {
tmp = (b * c) + ((-27.0 * (j * k)) + (x * ((18.0 * (y * (z * t))) + (i * -4.0))));
} else if (x <= 8e+77) {
tmp = ((b * c) - ((4.0 * (x * i)) + (4.0 * (t * a)))) - ((j * 27.0) * k);
} else {
tmp = ((b * c) + (t * ((x * (18.0 * (y * z))) - (a * 4.0)))) - ((x * 4.0) * i);
}
return tmp;
}
[y, z] = sort([y, z]) [j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): tmp = 0 if x <= -1.9e+17: tmp = (b * c) + ((-27.0 * (j * k)) + (x * ((18.0 * (y * (z * t))) + (i * -4.0)))) elif x <= 8e+77: tmp = ((b * c) - ((4.0 * (x * i)) + (4.0 * (t * a)))) - ((j * 27.0) * k) else: tmp = ((b * c) + (t * ((x * (18.0 * (y * z))) - (a * 4.0)))) - ((x * 4.0) * i) return tmp
y, z = sort([y, z]) j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) tmp = 0.0 if (x <= -1.9e+17) tmp = Float64(Float64(b * c) + Float64(Float64(-27.0 * Float64(j * k)) + Float64(x * Float64(Float64(18.0 * Float64(y * Float64(z * t))) + Float64(i * -4.0))))); elseif (x <= 8e+77) 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)); else tmp = Float64(Float64(Float64(b * c) + Float64(t * Float64(Float64(x * Float64(18.0 * Float64(y * z))) - Float64(a * 4.0)))) - Float64(Float64(x * 4.0) * i)); end return tmp end
y, z = num2cell(sort([y, z])){:}
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
tmp = 0.0;
if (x <= -1.9e+17)
tmp = (b * c) + ((-27.0 * (j * k)) + (x * ((18.0 * (y * (z * t))) + (i * -4.0))));
elseif (x <= 8e+77)
tmp = ((b * c) - ((4.0 * (x * i)) + (4.0 * (t * a)))) - ((j * 27.0) * k);
else
tmp = ((b * c) + (t * ((x * (18.0 * (y * z))) - (a * 4.0)))) - ((x * 4.0) * i);
end
tmp_2 = tmp;
end
NOTE: y and z should be sorted in increasing order before calling this function. NOTE: j and k should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := If[LessEqual[x, -1.9e+17], N[(N[(b * c), $MachinePrecision] + N[(N[(-27.0 * N[(j * k), $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], If[LessEqual[x, 8e+77], 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], N[(N[(N[(b * c), $MachinePrecision] + N[(t * N[(N[(x * N[(18.0 * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(a * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(x * 4.0), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.9 \cdot 10^{+17}:\\
\;\;\;\;b \cdot c + \left(-27 \cdot \left(j \cdot k\right) + x \cdot \left(18 \cdot \left(y \cdot \left(z \cdot t\right)\right) + i \cdot -4\right)\right)\\
\mathbf{elif}\;x \leq 8 \cdot 10^{+77}:\\
\;\;\;\;\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\\
\mathbf{else}:\\
\;\;\;\;\left(b \cdot c + t \cdot \left(x \cdot \left(18 \cdot \left(y \cdot z\right)\right) - a \cdot 4\right)\right) - \left(x \cdot 4\right) \cdot i\\
\end{array}
\end{array}
if x < -1.9e17Initial program 79.0%
Simplified88.7%
Taylor expanded in a around 0 88.7%
if -1.9e17 < x < 7.99999999999999986e77Initial program 94.7%
Taylor expanded in y around 0 91.3%
if 7.99999999999999986e77 < x Initial program 76.4%
sub-neg76.4%
associate-+l-76.4%
sub-neg76.4%
sub-neg76.4%
distribute-rgt-out--80.4%
associate-*l*82.3%
distribute-lft-neg-in82.3%
cancel-sign-sub82.3%
associate-*l*82.3%
associate-*l*82.3%
Simplified82.3%
fma-def82.2%
associate-*l*82.3%
Applied egg-rr82.3%
Taylor expanded in x around inf 82.5%
*-commutative82.5%
associate-*l*82.5%
Simplified82.5%
fma-udef82.5%
Applied egg-rr82.5%
Final simplification88.9%
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (* -4.0 (+ (* x i) (* t a)))) (t_2 (- (* b c) (* 27.0 (* j k)))))
(if (<= j -8.5e+34)
t_2
(if (<= j -10500000.0)
t_1
(if (<= j -9.8e-41)
t_2
(if (<= j -2.2e-119)
(- (* b c) (* 4.0 (* t a)))
(if (<= j 4.2e-102)
t_1
(if (<= j 4.5e-48)
(* x (* 18.0 (* y (* z t))))
(if (<= j 1.66e+49)
(+ (* j (* k -27.0)) (* -4.0 (* x i)))
(* -27.0 (* j k)))))))))))assert(y < z);
assert(j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = -4.0 * ((x * i) + (t * a));
double t_2 = (b * c) - (27.0 * (j * k));
double tmp;
if (j <= -8.5e+34) {
tmp = t_2;
} else if (j <= -10500000.0) {
tmp = t_1;
} else if (j <= -9.8e-41) {
tmp = t_2;
} else if (j <= -2.2e-119) {
tmp = (b * c) - (4.0 * (t * a));
} else if (j <= 4.2e-102) {
tmp = t_1;
} else if (j <= 4.5e-48) {
tmp = x * (18.0 * (y * (z * t)));
} else if (j <= 1.66e+49) {
tmp = (j * (k * -27.0)) + (-4.0 * (x * i));
} else {
tmp = -27.0 * (j * k);
}
return tmp;
}
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (-4.0d0) * ((x * i) + (t * a))
t_2 = (b * c) - (27.0d0 * (j * k))
if (j <= (-8.5d+34)) then
tmp = t_2
else if (j <= (-10500000.0d0)) then
tmp = t_1
else if (j <= (-9.8d-41)) then
tmp = t_2
else if (j <= (-2.2d-119)) then
tmp = (b * c) - (4.0d0 * (t * a))
else if (j <= 4.2d-102) then
tmp = t_1
else if (j <= 4.5d-48) then
tmp = x * (18.0d0 * (y * (z * t)))
else if (j <= 1.66d+49) then
tmp = (j * (k * (-27.0d0))) + ((-4.0d0) * (x * i))
else
tmp = (-27.0d0) * (j * k)
end if
code = tmp
end function
assert y < z;
assert j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = -4.0 * ((x * i) + (t * a));
double t_2 = (b * c) - (27.0 * (j * k));
double tmp;
if (j <= -8.5e+34) {
tmp = t_2;
} else if (j <= -10500000.0) {
tmp = t_1;
} else if (j <= -9.8e-41) {
tmp = t_2;
} else if (j <= -2.2e-119) {
tmp = (b * c) - (4.0 * (t * a));
} else if (j <= 4.2e-102) {
tmp = t_1;
} else if (j <= 4.5e-48) {
tmp = x * (18.0 * (y * (z * t)));
} else if (j <= 1.66e+49) {
tmp = (j * (k * -27.0)) + (-4.0 * (x * i));
} else {
tmp = -27.0 * (j * k);
}
return tmp;
}
[y, z] = sort([y, z]) [j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): t_1 = -4.0 * ((x * i) + (t * a)) t_2 = (b * c) - (27.0 * (j * k)) tmp = 0 if j <= -8.5e+34: tmp = t_2 elif j <= -10500000.0: tmp = t_1 elif j <= -9.8e-41: tmp = t_2 elif j <= -2.2e-119: tmp = (b * c) - (4.0 * (t * a)) elif j <= 4.2e-102: tmp = t_1 elif j <= 4.5e-48: tmp = x * (18.0 * (y * (z * t))) elif j <= 1.66e+49: tmp = (j * (k * -27.0)) + (-4.0 * (x * i)) else: tmp = -27.0 * (j * k) return tmp
y, z = sort([y, z]) j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(-4.0 * Float64(Float64(x * i) + Float64(t * a))) t_2 = Float64(Float64(b * c) - Float64(27.0 * Float64(j * k))) tmp = 0.0 if (j <= -8.5e+34) tmp = t_2; elseif (j <= -10500000.0) tmp = t_1; elseif (j <= -9.8e-41) tmp = t_2; elseif (j <= -2.2e-119) tmp = Float64(Float64(b * c) - Float64(4.0 * Float64(t * a))); elseif (j <= 4.2e-102) tmp = t_1; elseif (j <= 4.5e-48) tmp = Float64(x * Float64(18.0 * Float64(y * Float64(z * t)))); elseif (j <= 1.66e+49) tmp = Float64(Float64(j * Float64(k * -27.0)) + Float64(-4.0 * Float64(x * i))); else tmp = Float64(-27.0 * Float64(j * k)); end return tmp end
y, z = num2cell(sort([y, z])){:}
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
t_1 = -4.0 * ((x * i) + (t * a));
t_2 = (b * c) - (27.0 * (j * k));
tmp = 0.0;
if (j <= -8.5e+34)
tmp = t_2;
elseif (j <= -10500000.0)
tmp = t_1;
elseif (j <= -9.8e-41)
tmp = t_2;
elseif (j <= -2.2e-119)
tmp = (b * c) - (4.0 * (t * a));
elseif (j <= 4.2e-102)
tmp = t_1;
elseif (j <= 4.5e-48)
tmp = x * (18.0 * (y * (z * t)));
elseif (j <= 1.66e+49)
tmp = (j * (k * -27.0)) + (-4.0 * (x * i));
else
tmp = -27.0 * (j * k);
end
tmp_2 = tmp;
end
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(-4.0 * N[(N[(x * i), $MachinePrecision] + N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(b * c), $MachinePrecision] - N[(27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[j, -8.5e+34], t$95$2, If[LessEqual[j, -10500000.0], t$95$1, If[LessEqual[j, -9.8e-41], t$95$2, If[LessEqual[j, -2.2e-119], N[(N[(b * c), $MachinePrecision] - N[(4.0 * N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[j, 4.2e-102], t$95$1, If[LessEqual[j, 4.5e-48], N[(x * N[(18.0 * N[(y * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[j, 1.66e+49], N[(N[(j * N[(k * -27.0), $MachinePrecision]), $MachinePrecision] + N[(-4.0 * N[(x * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision]]]]]]]]]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
t_1 := -4 \cdot \left(x \cdot i + t \cdot a\right)\\
t_2 := b \cdot c - 27 \cdot \left(j \cdot k\right)\\
\mathbf{if}\;j \leq -8.5 \cdot 10^{+34}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;j \leq -10500000:\\
\;\;\;\;t_1\\
\mathbf{elif}\;j \leq -9.8 \cdot 10^{-41}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;j \leq -2.2 \cdot 10^{-119}:\\
\;\;\;\;b \cdot c - 4 \cdot \left(t \cdot a\right)\\
\mathbf{elif}\;j \leq 4.2 \cdot 10^{-102}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;j \leq 4.5 \cdot 10^{-48}:\\
\;\;\;\;x \cdot \left(18 \cdot \left(y \cdot \left(z \cdot t\right)\right)\right)\\
\mathbf{elif}\;j \leq 1.66 \cdot 10^{+49}:\\
\;\;\;\;j \cdot \left(k \cdot -27\right) + -4 \cdot \left(x \cdot i\right)\\
\mathbf{else}:\\
\;\;\;\;-27 \cdot \left(j \cdot k\right)\\
\end{array}
\end{array}
if j < -8.5000000000000003e34 or -1.05e7 < j < -9.79999999999999906e-41Initial program 87.6%
Taylor expanded in x around 0 73.4%
Taylor expanded in a around 0 69.4%
if -8.5000000000000003e34 < j < -1.05e7 or -2.2000000000000001e-119 < j < 4.2e-102Initial program 92.2%
sub-neg92.2%
associate-+l-92.2%
sub-neg92.2%
sub-neg92.2%
distribute-rgt-out--92.2%
associate-*l*89.1%
distribute-lft-neg-in89.1%
cancel-sign-sub89.1%
associate-*l*89.1%
associate-*l*89.2%
Simplified89.2%
fma-def89.2%
associate-*l*89.2%
Applied egg-rr89.2%
Taylor expanded in x around inf 88.1%
*-commutative88.1%
associate-*l*88.1%
Simplified88.1%
Taylor expanded in a around inf 61.7%
associate-*r*61.7%
Simplified61.7%
Taylor expanded in a around 0 61.7%
distribute-lft-out61.7%
*-commutative61.7%
Simplified61.7%
if -9.79999999999999906e-41 < j < -2.2000000000000001e-119Initial program 89.7%
Taylor expanded in x around 0 68.8%
Taylor expanded in j around 0 53.7%
if 4.2e-102 < j < 4.49999999999999988e-48Initial program 82.6%
sub-neg82.6%
associate-+l-82.6%
sub-neg82.6%
sub-neg82.6%
distribute-rgt-out--82.6%
associate-*l*91.7%
distribute-lft-neg-in91.7%
cancel-sign-sub91.7%
associate-*l*91.7%
associate-*l*91.7%
Simplified91.7%
Taylor expanded in x around inf 73.5%
Taylor expanded in y around inf 55.8%
if 4.49999999999999988e-48 < j < 1.65999999999999999e49Initial program 73.0%
sub-neg73.0%
+-commutative73.0%
associate-*l*73.0%
distribute-rgt-neg-in73.0%
fma-def73.0%
*-commutative73.0%
distribute-rgt-neg-in73.0%
metadata-eval73.0%
sub-neg73.0%
+-commutative73.0%
associate-*l*73.0%
distribute-rgt-neg-in73.0%
Simplified95.7%
Taylor expanded in i around inf 43.7%
*-commutative43.7%
Simplified43.7%
fma-udef43.7%
Applied egg-rr43.7%
if 1.65999999999999999e49 < j Initial program 80.6%
sub-neg80.6%
+-commutative80.6%
associate-*l*80.6%
distribute-rgt-neg-in80.6%
fma-def85.5%
*-commutative85.5%
distribute-rgt-neg-in85.5%
metadata-eval85.5%
sub-neg85.5%
+-commutative85.5%
associate-*l*85.5%
distribute-rgt-neg-in85.5%
Simplified88.2%
Taylor expanded in j around inf 43.1%
Final simplification58.5%
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (* -4.0 (+ (* x i) (* t a)))) (t_2 (- (* b c) (* 27.0 (* j k)))))
(if (<= j -1.9e+36)
t_2
(if (<= j -960000.0)
t_1
(if (<= j -4.6e-39)
t_2
(if (<= j -3.9e-119)
(- (* b c) (* 4.0 (* t a)))
(if (<= j 5.3e-97)
t_1
(if (<= j 3e-38)
(* x (* 18.0 (* y (* z t))))
(if (<= j 2.4e+47)
(+ (* j (* k -27.0)) (* -4.0 (* x i)))
(+ (* t (* a -4.0)) (* k (* j -27.0))))))))))))assert(y < z);
assert(j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = -4.0 * ((x * i) + (t * a));
double t_2 = (b * c) - (27.0 * (j * k));
double tmp;
if (j <= -1.9e+36) {
tmp = t_2;
} else if (j <= -960000.0) {
tmp = t_1;
} else if (j <= -4.6e-39) {
tmp = t_2;
} else if (j <= -3.9e-119) {
tmp = (b * c) - (4.0 * (t * a));
} else if (j <= 5.3e-97) {
tmp = t_1;
} else if (j <= 3e-38) {
tmp = x * (18.0 * (y * (z * t)));
} else if (j <= 2.4e+47) {
tmp = (j * (k * -27.0)) + (-4.0 * (x * i));
} else {
tmp = (t * (a * -4.0)) + (k * (j * -27.0));
}
return tmp;
}
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (-4.0d0) * ((x * i) + (t * a))
t_2 = (b * c) - (27.0d0 * (j * k))
if (j <= (-1.9d+36)) then
tmp = t_2
else if (j <= (-960000.0d0)) then
tmp = t_1
else if (j <= (-4.6d-39)) then
tmp = t_2
else if (j <= (-3.9d-119)) then
tmp = (b * c) - (4.0d0 * (t * a))
else if (j <= 5.3d-97) then
tmp = t_1
else if (j <= 3d-38) then
tmp = x * (18.0d0 * (y * (z * t)))
else if (j <= 2.4d+47) then
tmp = (j * (k * (-27.0d0))) + ((-4.0d0) * (x * i))
else
tmp = (t * (a * (-4.0d0))) + (k * (j * (-27.0d0)))
end if
code = tmp
end function
assert y < z;
assert j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = -4.0 * ((x * i) + (t * a));
double t_2 = (b * c) - (27.0 * (j * k));
double tmp;
if (j <= -1.9e+36) {
tmp = t_2;
} else if (j <= -960000.0) {
tmp = t_1;
} else if (j <= -4.6e-39) {
tmp = t_2;
} else if (j <= -3.9e-119) {
tmp = (b * c) - (4.0 * (t * a));
} else if (j <= 5.3e-97) {
tmp = t_1;
} else if (j <= 3e-38) {
tmp = x * (18.0 * (y * (z * t)));
} else if (j <= 2.4e+47) {
tmp = (j * (k * -27.0)) + (-4.0 * (x * i));
} else {
tmp = (t * (a * -4.0)) + (k * (j * -27.0));
}
return tmp;
}
[y, z] = sort([y, z]) [j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): t_1 = -4.0 * ((x * i) + (t * a)) t_2 = (b * c) - (27.0 * (j * k)) tmp = 0 if j <= -1.9e+36: tmp = t_2 elif j <= -960000.0: tmp = t_1 elif j <= -4.6e-39: tmp = t_2 elif j <= -3.9e-119: tmp = (b * c) - (4.0 * (t * a)) elif j <= 5.3e-97: tmp = t_1 elif j <= 3e-38: tmp = x * (18.0 * (y * (z * t))) elif j <= 2.4e+47: tmp = (j * (k * -27.0)) + (-4.0 * (x * i)) else: tmp = (t * (a * -4.0)) + (k * (j * -27.0)) return tmp
y, z = sort([y, z]) j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(-4.0 * Float64(Float64(x * i) + Float64(t * a))) t_2 = Float64(Float64(b * c) - Float64(27.0 * Float64(j * k))) tmp = 0.0 if (j <= -1.9e+36) tmp = t_2; elseif (j <= -960000.0) tmp = t_1; elseif (j <= -4.6e-39) tmp = t_2; elseif (j <= -3.9e-119) tmp = Float64(Float64(b * c) - Float64(4.0 * Float64(t * a))); elseif (j <= 5.3e-97) tmp = t_1; elseif (j <= 3e-38) tmp = Float64(x * Float64(18.0 * Float64(y * Float64(z * t)))); elseif (j <= 2.4e+47) tmp = Float64(Float64(j * Float64(k * -27.0)) + Float64(-4.0 * Float64(x * i))); else tmp = Float64(Float64(t * Float64(a * -4.0)) + Float64(k * Float64(j * -27.0))); end return tmp end
y, z = num2cell(sort([y, z])){:}
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
t_1 = -4.0 * ((x * i) + (t * a));
t_2 = (b * c) - (27.0 * (j * k));
tmp = 0.0;
if (j <= -1.9e+36)
tmp = t_2;
elseif (j <= -960000.0)
tmp = t_1;
elseif (j <= -4.6e-39)
tmp = t_2;
elseif (j <= -3.9e-119)
tmp = (b * c) - (4.0 * (t * a));
elseif (j <= 5.3e-97)
tmp = t_1;
elseif (j <= 3e-38)
tmp = x * (18.0 * (y * (z * t)));
elseif (j <= 2.4e+47)
tmp = (j * (k * -27.0)) + (-4.0 * (x * i));
else
tmp = (t * (a * -4.0)) + (k * (j * -27.0));
end
tmp_2 = tmp;
end
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(-4.0 * N[(N[(x * i), $MachinePrecision] + N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(b * c), $MachinePrecision] - N[(27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[j, -1.9e+36], t$95$2, If[LessEqual[j, -960000.0], t$95$1, If[LessEqual[j, -4.6e-39], t$95$2, If[LessEqual[j, -3.9e-119], N[(N[(b * c), $MachinePrecision] - N[(4.0 * N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[j, 5.3e-97], t$95$1, If[LessEqual[j, 3e-38], N[(x * N[(18.0 * N[(y * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[j, 2.4e+47], N[(N[(j * N[(k * -27.0), $MachinePrecision]), $MachinePrecision] + N[(-4.0 * N[(x * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(t * N[(a * -4.0), $MachinePrecision]), $MachinePrecision] + N[(k * N[(j * -27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
t_1 := -4 \cdot \left(x \cdot i + t \cdot a\right)\\
t_2 := b \cdot c - 27 \cdot \left(j \cdot k\right)\\
\mathbf{if}\;j \leq -1.9 \cdot 10^{+36}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;j \leq -960000:\\
\;\;\;\;t_1\\
\mathbf{elif}\;j \leq -4.6 \cdot 10^{-39}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;j \leq -3.9 \cdot 10^{-119}:\\
\;\;\;\;b \cdot c - 4 \cdot \left(t \cdot a\right)\\
\mathbf{elif}\;j \leq 5.3 \cdot 10^{-97}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;j \leq 3 \cdot 10^{-38}:\\
\;\;\;\;x \cdot \left(18 \cdot \left(y \cdot \left(z \cdot t\right)\right)\right)\\
\mathbf{elif}\;j \leq 2.4 \cdot 10^{+47}:\\
\;\;\;\;j \cdot \left(k \cdot -27\right) + -4 \cdot \left(x \cdot i\right)\\
\mathbf{else}:\\
\;\;\;\;t \cdot \left(a \cdot -4\right) + k \cdot \left(j \cdot -27\right)\\
\end{array}
\end{array}
if j < -1.90000000000000012e36 or -9.6e5 < j < -4.60000000000000016e-39Initial program 87.6%
Taylor expanded in x around 0 73.4%
Taylor expanded in a around 0 69.4%
if -1.90000000000000012e36 < j < -9.6e5 or -3.8999999999999999e-119 < j < 5.29999999999999992e-97Initial program 92.2%
sub-neg92.2%
associate-+l-92.2%
sub-neg92.2%
sub-neg92.2%
distribute-rgt-out--92.2%
associate-*l*89.1%
distribute-lft-neg-in89.1%
cancel-sign-sub89.1%
associate-*l*89.1%
associate-*l*89.2%
Simplified89.2%
fma-def89.2%
associate-*l*89.2%
Applied egg-rr89.2%
Taylor expanded in x around inf 88.1%
*-commutative88.1%
associate-*l*88.1%
Simplified88.1%
Taylor expanded in a around inf 61.7%
associate-*r*61.7%
Simplified61.7%
Taylor expanded in a around 0 61.7%
distribute-lft-out61.7%
*-commutative61.7%
Simplified61.7%
if -4.60000000000000016e-39 < j < -3.8999999999999999e-119Initial program 89.7%
Taylor expanded in x around 0 68.8%
Taylor expanded in j around 0 53.7%
if 5.29999999999999992e-97 < j < 2.99999999999999989e-38Initial program 84.1%
sub-neg84.1%
associate-+l-84.1%
sub-neg84.1%
sub-neg84.1%
distribute-rgt-out--84.1%
associate-*l*92.4%
distribute-lft-neg-in92.4%
cancel-sign-sub92.4%
associate-*l*92.4%
associate-*l*92.4%
Simplified92.4%
Taylor expanded in x around inf 68.0%
Taylor expanded in y around inf 51.3%
if 2.99999999999999989e-38 < j < 2.40000000000000019e47Initial program 71.7%
sub-neg71.7%
+-commutative71.7%
associate-*l*71.7%
distribute-rgt-neg-in71.7%
fma-def71.7%
*-commutative71.7%
distribute-rgt-neg-in71.7%
metadata-eval71.7%
sub-neg71.7%
+-commutative71.7%
associate-*l*71.7%
distribute-rgt-neg-in71.7%
Simplified95.5%
Taylor expanded in i around inf 41.0%
*-commutative41.0%
Simplified41.0%
fma-udef41.0%
Applied egg-rr41.0%
if 2.40000000000000019e47 < j Initial program 80.6%
Taylor expanded in x around 0 64.3%
Taylor expanded in c around 0 55.0%
distribute-rgt-in55.0%
*-commutative55.0%
*-commutative55.0%
associate-*r*55.0%
metadata-eval55.0%
*-commutative55.0%
associate-*r*55.0%
*-commutative55.0%
*-commutative55.0%
associate-*l*55.0%
metadata-eval55.0%
*-commutative55.0%
associate-*r*55.1%
Simplified55.1%
Final simplification60.1%
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (+ (* b c) (* x (+ (* 18.0 (* y (* z t))) (* i -4.0))))))
(if (<= x -3.6e+53)
t_1
(if (<= x -1.25e+14)
(+ (* b c) (+ (* -27.0 (* j k)) (* 18.0 (* y (* t (* x z))))))
(if (<= x -1.45e-11)
(- (* t (* a -4.0)) (+ (* x (* 4.0 i)) (* j (* 27.0 k))))
(if (<= x 1.3e+33)
(- (- (* b c) (* 4.0 (* t a))) (* (* j 27.0) k))
t_1))))))assert(y < z);
assert(j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = (b * c) + (x * ((18.0 * (y * (z * t))) + (i * -4.0)));
double tmp;
if (x <= -3.6e+53) {
tmp = t_1;
} else if (x <= -1.25e+14) {
tmp = (b * c) + ((-27.0 * (j * k)) + (18.0 * (y * (t * (x * z)))));
} else if (x <= -1.45e-11) {
tmp = (t * (a * -4.0)) - ((x * (4.0 * i)) + (j * (27.0 * k)));
} else if (x <= 1.3e+33) {
tmp = ((b * c) - (4.0 * (t * a))) - ((j * 27.0) * k);
} else {
tmp = t_1;
}
return tmp;
}
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: tmp
t_1 = (b * c) + (x * ((18.0d0 * (y * (z * t))) + (i * (-4.0d0))))
if (x <= (-3.6d+53)) then
tmp = t_1
else if (x <= (-1.25d+14)) then
tmp = (b * c) + (((-27.0d0) * (j * k)) + (18.0d0 * (y * (t * (x * z)))))
else if (x <= (-1.45d-11)) then
tmp = (t * (a * (-4.0d0))) - ((x * (4.0d0 * i)) + (j * (27.0d0 * k)))
else if (x <= 1.3d+33) then
tmp = ((b * c) - (4.0d0 * (t * a))) - ((j * 27.0d0) * k)
else
tmp = t_1
end if
code = tmp
end function
assert y < z;
assert j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = (b * c) + (x * ((18.0 * (y * (z * t))) + (i * -4.0)));
double tmp;
if (x <= -3.6e+53) {
tmp = t_1;
} else if (x <= -1.25e+14) {
tmp = (b * c) + ((-27.0 * (j * k)) + (18.0 * (y * (t * (x * z)))));
} else if (x <= -1.45e-11) {
tmp = (t * (a * -4.0)) - ((x * (4.0 * i)) + (j * (27.0 * k)));
} else if (x <= 1.3e+33) {
tmp = ((b * c) - (4.0 * (t * a))) - ((j * 27.0) * k);
} else {
tmp = t_1;
}
return tmp;
}
[y, z] = sort([y, z]) [j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): t_1 = (b * c) + (x * ((18.0 * (y * (z * t))) + (i * -4.0))) tmp = 0 if x <= -3.6e+53: tmp = t_1 elif x <= -1.25e+14: tmp = (b * c) + ((-27.0 * (j * k)) + (18.0 * (y * (t * (x * z))))) elif x <= -1.45e-11: tmp = (t * (a * -4.0)) - ((x * (4.0 * i)) + (j * (27.0 * k))) elif x <= 1.3e+33: tmp = ((b * c) - (4.0 * (t * a))) - ((j * 27.0) * k) else: tmp = t_1 return tmp
y, z = sort([y, z]) j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(Float64(b * c) + Float64(x * Float64(Float64(18.0 * Float64(y * Float64(z * t))) + Float64(i * -4.0)))) tmp = 0.0 if (x <= -3.6e+53) tmp = t_1; elseif (x <= -1.25e+14) tmp = Float64(Float64(b * c) + Float64(Float64(-27.0 * Float64(j * k)) + Float64(18.0 * Float64(y * Float64(t * Float64(x * z)))))); elseif (x <= -1.45e-11) tmp = Float64(Float64(t * Float64(a * -4.0)) - Float64(Float64(x * Float64(4.0 * i)) + Float64(j * Float64(27.0 * k)))); elseif (x <= 1.3e+33) tmp = Float64(Float64(Float64(b * c) - Float64(4.0 * Float64(t * a))) - Float64(Float64(j * 27.0) * k)); else tmp = t_1; end return tmp end
y, z = num2cell(sort([y, z])){:}
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
t_1 = (b * c) + (x * ((18.0 * (y * (z * t))) + (i * -4.0)));
tmp = 0.0;
if (x <= -3.6e+53)
tmp = t_1;
elseif (x <= -1.25e+14)
tmp = (b * c) + ((-27.0 * (j * k)) + (18.0 * (y * (t * (x * z)))));
elseif (x <= -1.45e-11)
tmp = (t * (a * -4.0)) - ((x * (4.0 * i)) + (j * (27.0 * k)));
elseif (x <= 1.3e+33)
tmp = ((b * c) - (4.0 * (t * a))) - ((j * 27.0) * k);
else
tmp = t_1;
end
tmp_2 = tmp;
end
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(N[(b * c), $MachinePrecision] + N[(x * N[(N[(18.0 * N[(y * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(i * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -3.6e+53], t$95$1, If[LessEqual[x, -1.25e+14], N[(N[(b * c), $MachinePrecision] + N[(N[(-27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision] + N[(18.0 * N[(y * N[(t * N[(x * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -1.45e-11], N[(N[(t * N[(a * -4.0), $MachinePrecision]), $MachinePrecision] - N[(N[(x * N[(4.0 * i), $MachinePrecision]), $MachinePrecision] + N[(j * N[(27.0 * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.3e+33], N[(N[(N[(b * c), $MachinePrecision] - N[(4.0 * N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
t_1 := b \cdot c + x \cdot \left(18 \cdot \left(y \cdot \left(z \cdot t\right)\right) + i \cdot -4\right)\\
\mathbf{if}\;x \leq -3.6 \cdot 10^{+53}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq -1.25 \cdot 10^{+14}:\\
\;\;\;\;b \cdot c + \left(-27 \cdot \left(j \cdot k\right) + 18 \cdot \left(y \cdot \left(t \cdot \left(x \cdot z\right)\right)\right)\right)\\
\mathbf{elif}\;x \leq -1.45 \cdot 10^{-11}:\\
\;\;\;\;t \cdot \left(a \cdot -4\right) - \left(x \cdot \left(4 \cdot i\right) + j \cdot \left(27 \cdot k\right)\right)\\
\mathbf{elif}\;x \leq 1.3 \cdot 10^{+33}:\\
\;\;\;\;\left(b \cdot c - 4 \cdot \left(t \cdot a\right)\right) - \left(j \cdot 27\right) \cdot k\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if x < -3.6e53 or 1.2999999999999999e33 < x Initial program 77.2%
Simplified88.0%
Taylor expanded in a around 0 84.7%
Taylor expanded in k around 0 79.1%
if -3.6e53 < x < -1.25e14Initial program 92.1%
Simplified99.6%
Taylor expanded in a around 0 99.5%
Taylor expanded in i around 0 92.0%
if -1.25e14 < x < -1.45e-11Initial program 88.9%
sub-neg88.9%
associate-+l-88.9%
sub-neg88.9%
sub-neg88.9%
distribute-rgt-out--88.9%
associate-*l*88.9%
distribute-lft-neg-in88.9%
cancel-sign-sub88.9%
associate-*l*88.9%
associate-*l*88.9%
Simplified88.9%
fma-def100.0%
associate-*l*100.0%
Applied egg-rr100.0%
Taylor expanded in a around inf 88.9%
associate-*r*78.5%
Simplified88.9%
if -1.45e-11 < x < 1.2999999999999999e33Initial program 95.6%
Taylor expanded in x around 0 85.1%
Final simplification82.9%
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (+ (* b c) (* x (+ (* 18.0 (* y (* z t))) (* i -4.0))))))
(if (<= x -9e+180)
t_1
(if (<= x -6.5e-11)
(- (* (* z (* x t)) (* 18.0 y)) (+ (* x (* 4.0 i)) (* j (* 27.0 k))))
(if (<= x 2.2e+21)
(- (- (* b c) (* 4.0 (* t a))) (* (* j 27.0) k))
t_1)))))assert(y < z);
assert(j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = (b * c) + (x * ((18.0 * (y * (z * t))) + (i * -4.0)));
double tmp;
if (x <= -9e+180) {
tmp = t_1;
} else if (x <= -6.5e-11) {
tmp = ((z * (x * t)) * (18.0 * y)) - ((x * (4.0 * i)) + (j * (27.0 * k)));
} else if (x <= 2.2e+21) {
tmp = ((b * c) - (4.0 * (t * a))) - ((j * 27.0) * k);
} else {
tmp = t_1;
}
return tmp;
}
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: tmp
t_1 = (b * c) + (x * ((18.0d0 * (y * (z * t))) + (i * (-4.0d0))))
if (x <= (-9d+180)) then
tmp = t_1
else if (x <= (-6.5d-11)) then
tmp = ((z * (x * t)) * (18.0d0 * y)) - ((x * (4.0d0 * i)) + (j * (27.0d0 * k)))
else if (x <= 2.2d+21) then
tmp = ((b * c) - (4.0d0 * (t * a))) - ((j * 27.0d0) * k)
else
tmp = t_1
end if
code = tmp
end function
assert y < z;
assert j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = (b * c) + (x * ((18.0 * (y * (z * t))) + (i * -4.0)));
double tmp;
if (x <= -9e+180) {
tmp = t_1;
} else if (x <= -6.5e-11) {
tmp = ((z * (x * t)) * (18.0 * y)) - ((x * (4.0 * i)) + (j * (27.0 * k)));
} else if (x <= 2.2e+21) {
tmp = ((b * c) - (4.0 * (t * a))) - ((j * 27.0) * k);
} else {
tmp = t_1;
}
return tmp;
}
[y, z] = sort([y, z]) [j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): t_1 = (b * c) + (x * ((18.0 * (y * (z * t))) + (i * -4.0))) tmp = 0 if x <= -9e+180: tmp = t_1 elif x <= -6.5e-11: tmp = ((z * (x * t)) * (18.0 * y)) - ((x * (4.0 * i)) + (j * (27.0 * k))) elif x <= 2.2e+21: tmp = ((b * c) - (4.0 * (t * a))) - ((j * 27.0) * k) else: tmp = t_1 return tmp
y, z = sort([y, z]) j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(Float64(b * c) + Float64(x * Float64(Float64(18.0 * Float64(y * Float64(z * t))) + Float64(i * -4.0)))) tmp = 0.0 if (x <= -9e+180) tmp = t_1; elseif (x <= -6.5e-11) tmp = Float64(Float64(Float64(z * Float64(x * t)) * Float64(18.0 * y)) - Float64(Float64(x * Float64(4.0 * i)) + Float64(j * Float64(27.0 * k)))); elseif (x <= 2.2e+21) tmp = Float64(Float64(Float64(b * c) - Float64(4.0 * Float64(t * a))) - Float64(Float64(j * 27.0) * k)); else tmp = t_1; end return tmp end
y, z = num2cell(sort([y, z])){:}
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
t_1 = (b * c) + (x * ((18.0 * (y * (z * t))) + (i * -4.0)));
tmp = 0.0;
if (x <= -9e+180)
tmp = t_1;
elseif (x <= -6.5e-11)
tmp = ((z * (x * t)) * (18.0 * y)) - ((x * (4.0 * i)) + (j * (27.0 * k)));
elseif (x <= 2.2e+21)
tmp = ((b * c) - (4.0 * (t * a))) - ((j * 27.0) * k);
else
tmp = t_1;
end
tmp_2 = tmp;
end
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(N[(b * c), $MachinePrecision] + N[(x * N[(N[(18.0 * N[(y * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(i * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -9e+180], t$95$1, If[LessEqual[x, -6.5e-11], N[(N[(N[(z * N[(x * t), $MachinePrecision]), $MachinePrecision] * N[(18.0 * y), $MachinePrecision]), $MachinePrecision] - N[(N[(x * N[(4.0 * i), $MachinePrecision]), $MachinePrecision] + N[(j * N[(27.0 * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 2.2e+21], N[(N[(N[(b * c), $MachinePrecision] - N[(4.0 * N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
t_1 := b \cdot c + x \cdot \left(18 \cdot \left(y \cdot \left(z \cdot t\right)\right) + i \cdot -4\right)\\
\mathbf{if}\;x \leq -9 \cdot 10^{+180}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq -6.5 \cdot 10^{-11}:\\
\;\;\;\;\left(z \cdot \left(x \cdot t\right)\right) \cdot \left(18 \cdot y\right) - \left(x \cdot \left(4 \cdot i\right) + j \cdot \left(27 \cdot k\right)\right)\\
\mathbf{elif}\;x \leq 2.2 \cdot 10^{+21}:\\
\;\;\;\;\left(b \cdot c - 4 \cdot \left(t \cdot a\right)\right) - \left(j \cdot 27\right) \cdot k\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if x < -8.99999999999999962e180 or 2.2e21 < x Initial program 77.4%
Simplified89.1%
Taylor expanded in a around 0 82.8%
Taylor expanded in k around 0 80.8%
if -8.99999999999999962e180 < x < -6.49999999999999953e-11Initial program 83.1%
sub-neg83.1%
associate-+l-83.1%
sub-neg83.1%
sub-neg83.1%
distribute-rgt-out--87.4%
associate-*l*89.5%
distribute-lft-neg-in89.5%
cancel-sign-sub89.5%
associate-*l*89.5%
associate-*l*89.6%
Simplified89.6%
fma-def91.7%
associate-*l*91.7%
Applied egg-rr91.7%
Taylor expanded in x around inf 76.2%
associate-*r*76.2%
*-commutative76.2%
*-commutative76.2%
associate-*l*82.3%
Simplified82.3%
if -6.49999999999999953e-11 < x < 2.2e21Initial program 95.6%
Taylor expanded in x around 0 85.1%
Final simplification83.1%
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (* x (+ (* 18.0 (* y (* z t))) (* i -4.0)))))
(if (<= x -8e+17)
(+ (* b c) (+ (* -27.0 (* j k)) t_1))
(if (<= x 5.2e+62)
(- (- (* b c) (+ (* 4.0 (* x i)) (* 4.0 (* t a)))) (* (* j 27.0) k))
(+ (* b c) t_1)))))assert(y < z);
assert(j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = x * ((18.0 * (y * (z * t))) + (i * -4.0));
double tmp;
if (x <= -8e+17) {
tmp = (b * c) + ((-27.0 * (j * k)) + t_1);
} else if (x <= 5.2e+62) {
tmp = ((b * c) - ((4.0 * (x * i)) + (4.0 * (t * a)))) - ((j * 27.0) * k);
} else {
tmp = (b * c) + t_1;
}
return tmp;
}
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: tmp
t_1 = x * ((18.0d0 * (y * (z * t))) + (i * (-4.0d0)))
if (x <= (-8d+17)) then
tmp = (b * c) + (((-27.0d0) * (j * k)) + t_1)
else if (x <= 5.2d+62) then
tmp = ((b * c) - ((4.0d0 * (x * i)) + (4.0d0 * (t * a)))) - ((j * 27.0d0) * k)
else
tmp = (b * c) + t_1
end if
code = tmp
end function
assert y < z;
assert j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = x * ((18.0 * (y * (z * t))) + (i * -4.0));
double tmp;
if (x <= -8e+17) {
tmp = (b * c) + ((-27.0 * (j * k)) + t_1);
} else if (x <= 5.2e+62) {
tmp = ((b * c) - ((4.0 * (x * i)) + (4.0 * (t * a)))) - ((j * 27.0) * k);
} else {
tmp = (b * c) + t_1;
}
return tmp;
}
[y, z] = sort([y, z]) [j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): t_1 = x * ((18.0 * (y * (z * t))) + (i * -4.0)) tmp = 0 if x <= -8e+17: tmp = (b * c) + ((-27.0 * (j * k)) + t_1) elif x <= 5.2e+62: tmp = ((b * c) - ((4.0 * (x * i)) + (4.0 * (t * a)))) - ((j * 27.0) * k) else: tmp = (b * c) + t_1 return tmp
y, z = sort([y, z]) j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(x * Float64(Float64(18.0 * Float64(y * Float64(z * t))) + Float64(i * -4.0))) tmp = 0.0 if (x <= -8e+17) tmp = Float64(Float64(b * c) + Float64(Float64(-27.0 * Float64(j * k)) + t_1)); elseif (x <= 5.2e+62) 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)); else tmp = Float64(Float64(b * c) + t_1); end return tmp end
y, z = num2cell(sort([y, z])){:}
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
t_1 = x * ((18.0 * (y * (z * t))) + (i * -4.0));
tmp = 0.0;
if (x <= -8e+17)
tmp = (b * c) + ((-27.0 * (j * k)) + t_1);
elseif (x <= 5.2e+62)
tmp = ((b * c) - ((4.0 * (x * i)) + (4.0 * (t * a)))) - ((j * 27.0) * k);
else
tmp = (b * c) + t_1;
end
tmp_2 = tmp;
end
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(x * N[(N[(18.0 * N[(y * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(i * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -8e+17], N[(N[(b * c), $MachinePrecision] + N[(N[(-27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 5.2e+62], 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], N[(N[(b * c), $MachinePrecision] + t$95$1), $MachinePrecision]]]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
t_1 := x \cdot \left(18 \cdot \left(y \cdot \left(z \cdot t\right)\right) + i \cdot -4\right)\\
\mathbf{if}\;x \leq -8 \cdot 10^{+17}:\\
\;\;\;\;b \cdot c + \left(-27 \cdot \left(j \cdot k\right) + t_1\right)\\
\mathbf{elif}\;x \leq 5.2 \cdot 10^{+62}:\\
\;\;\;\;\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\\
\mathbf{else}:\\
\;\;\;\;b \cdot c + t_1\\
\end{array}
\end{array}
if x < -8e17Initial program 79.0%
Simplified88.7%
Taylor expanded in a around 0 88.7%
if -8e17 < x < 5.19999999999999968e62Initial program 95.4%
Taylor expanded in y around 0 91.1%
if 5.19999999999999968e62 < x Initial program 75.4%
Simplified88.4%
Taylor expanded in a around 0 82.9%
Taylor expanded in k around 0 83.1%
Final simplification88.8%
NOTE: y and z should be sorted in increasing order before calling this function. NOTE: j and k should be sorted in increasing order before calling this function. (FPCore (x y z t a b c i j k) :precision binary64 (if (or (<= x -3.2e+50) (not (<= x 8.5e+17))) (+ (* b c) (* x (+ (* 18.0 (* y (* z t))) (* i -4.0)))) (- (- (* b c) (* 4.0 (* t a))) (* (* j 27.0) k))))
assert(y < z);
assert(j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double tmp;
if ((x <= -3.2e+50) || !(x <= 8.5e+17)) {
tmp = (b * c) + (x * ((18.0 * (y * (z * t))) + (i * -4.0)));
} else {
tmp = ((b * c) - (4.0 * (t * a))) - ((j * 27.0) * k);
}
return tmp;
}
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: tmp
if ((x <= (-3.2d+50)) .or. (.not. (x <= 8.5d+17))) then
tmp = (b * c) + (x * ((18.0d0 * (y * (z * t))) + (i * (-4.0d0))))
else
tmp = ((b * c) - (4.0d0 * (t * a))) - ((j * 27.0d0) * k)
end if
code = tmp
end function
assert y < z;
assert j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double tmp;
if ((x <= -3.2e+50) || !(x <= 8.5e+17)) {
tmp = (b * c) + (x * ((18.0 * (y * (z * t))) + (i * -4.0)));
} else {
tmp = ((b * c) - (4.0 * (t * a))) - ((j * 27.0) * k);
}
return tmp;
}
[y, z] = sort([y, z]) [j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): tmp = 0 if (x <= -3.2e+50) or not (x <= 8.5e+17): tmp = (b * c) + (x * ((18.0 * (y * (z * t))) + (i * -4.0))) else: tmp = ((b * c) - (4.0 * (t * a))) - ((j * 27.0) * k) return tmp
y, z = sort([y, z]) j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) tmp = 0.0 if ((x <= -3.2e+50) || !(x <= 8.5e+17)) tmp = Float64(Float64(b * c) + Float64(x * Float64(Float64(18.0 * Float64(y * Float64(z * t))) + Float64(i * -4.0)))); else tmp = Float64(Float64(Float64(b * c) - Float64(4.0 * Float64(t * a))) - Float64(Float64(j * 27.0) * k)); end return tmp end
y, z = num2cell(sort([y, z])){:}
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
tmp = 0.0;
if ((x <= -3.2e+50) || ~((x <= 8.5e+17)))
tmp = (b * c) + (x * ((18.0 * (y * (z * t))) + (i * -4.0)));
else
tmp = ((b * c) - (4.0 * (t * a))) - ((j * 27.0) * k);
end
tmp_2 = tmp;
end
NOTE: y and z should be sorted in increasing order before calling this function. NOTE: j and k should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := If[Or[LessEqual[x, -3.2e+50], N[Not[LessEqual[x, 8.5e+17]], $MachinePrecision]], N[(N[(b * c), $MachinePrecision] + N[(x * N[(N[(18.0 * N[(y * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(i * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(b * c), $MachinePrecision] - N[(4.0 * N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -3.2 \cdot 10^{+50} \lor \neg \left(x \leq 8.5 \cdot 10^{+17}\right):\\
\;\;\;\;b \cdot c + x \cdot \left(18 \cdot \left(y \cdot \left(z \cdot t\right)\right) + i \cdot -4\right)\\
\mathbf{else}:\\
\;\;\;\;\left(b \cdot c - 4 \cdot \left(t \cdot a\right)\right) - \left(j \cdot 27\right) \cdot k\\
\end{array}
\end{array}
if x < -3.19999999999999983e50 or 8.5e17 < x Initial program 76.5%
Simplified88.1%
Taylor expanded in a around 0 84.9%
Taylor expanded in k around 0 79.3%
if -3.19999999999999983e50 < x < 8.5e17Initial program 95.6%
Taylor expanded in x around 0 81.8%
Final simplification80.7%
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (* t (* a -4.0))) (t_2 (* x (* i -4.0))))
(if (<= j -1.25e+72)
(* j (* k -27.0))
(if (<= j -2.18e-119)
(* b c)
(if (<= j -7.5e-134)
t_2
(if (<= j -2.8e-219)
t_1
(if (<= j -2.25e-246)
t_2
(if (<= j 1.38e-272)
t_1
(if (<= j 9.5e-127) t_2 (* -27.0 (* j k)))))))))))assert(y < z);
assert(j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = t * (a * -4.0);
double t_2 = x * (i * -4.0);
double tmp;
if (j <= -1.25e+72) {
tmp = j * (k * -27.0);
} else if (j <= -2.18e-119) {
tmp = b * c;
} else if (j <= -7.5e-134) {
tmp = t_2;
} else if (j <= -2.8e-219) {
tmp = t_1;
} else if (j <= -2.25e-246) {
tmp = t_2;
} else if (j <= 1.38e-272) {
tmp = t_1;
} else if (j <= 9.5e-127) {
tmp = t_2;
} else {
tmp = -27.0 * (j * k);
}
return tmp;
}
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = t * (a * (-4.0d0))
t_2 = x * (i * (-4.0d0))
if (j <= (-1.25d+72)) then
tmp = j * (k * (-27.0d0))
else if (j <= (-2.18d-119)) then
tmp = b * c
else if (j <= (-7.5d-134)) then
tmp = t_2
else if (j <= (-2.8d-219)) then
tmp = t_1
else if (j <= (-2.25d-246)) then
tmp = t_2
else if (j <= 1.38d-272) then
tmp = t_1
else if (j <= 9.5d-127) then
tmp = t_2
else
tmp = (-27.0d0) * (j * k)
end if
code = tmp
end function
assert y < z;
assert j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = t * (a * -4.0);
double t_2 = x * (i * -4.0);
double tmp;
if (j <= -1.25e+72) {
tmp = j * (k * -27.0);
} else if (j <= -2.18e-119) {
tmp = b * c;
} else if (j <= -7.5e-134) {
tmp = t_2;
} else if (j <= -2.8e-219) {
tmp = t_1;
} else if (j <= -2.25e-246) {
tmp = t_2;
} else if (j <= 1.38e-272) {
tmp = t_1;
} else if (j <= 9.5e-127) {
tmp = t_2;
} else {
tmp = -27.0 * (j * k);
}
return tmp;
}
[y, z] = sort([y, z]) [j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): t_1 = t * (a * -4.0) t_2 = x * (i * -4.0) tmp = 0 if j <= -1.25e+72: tmp = j * (k * -27.0) elif j <= -2.18e-119: tmp = b * c elif j <= -7.5e-134: tmp = t_2 elif j <= -2.8e-219: tmp = t_1 elif j <= -2.25e-246: tmp = t_2 elif j <= 1.38e-272: tmp = t_1 elif j <= 9.5e-127: tmp = t_2 else: tmp = -27.0 * (j * k) return tmp
y, z = sort([y, z]) j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(t * Float64(a * -4.0)) t_2 = Float64(x * Float64(i * -4.0)) tmp = 0.0 if (j <= -1.25e+72) tmp = Float64(j * Float64(k * -27.0)); elseif (j <= -2.18e-119) tmp = Float64(b * c); elseif (j <= -7.5e-134) tmp = t_2; elseif (j <= -2.8e-219) tmp = t_1; elseif (j <= -2.25e-246) tmp = t_2; elseif (j <= 1.38e-272) tmp = t_1; elseif (j <= 9.5e-127) tmp = t_2; else tmp = Float64(-27.0 * Float64(j * k)); end return tmp end
y, z = num2cell(sort([y, z])){:}
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
t_1 = t * (a * -4.0);
t_2 = x * (i * -4.0);
tmp = 0.0;
if (j <= -1.25e+72)
tmp = j * (k * -27.0);
elseif (j <= -2.18e-119)
tmp = b * c;
elseif (j <= -7.5e-134)
tmp = t_2;
elseif (j <= -2.8e-219)
tmp = t_1;
elseif (j <= -2.25e-246)
tmp = t_2;
elseif (j <= 1.38e-272)
tmp = t_1;
elseif (j <= 9.5e-127)
tmp = t_2;
else
tmp = -27.0 * (j * k);
end
tmp_2 = tmp;
end
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(t * N[(a * -4.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x * N[(i * -4.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[j, -1.25e+72], N[(j * N[(k * -27.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[j, -2.18e-119], N[(b * c), $MachinePrecision], If[LessEqual[j, -7.5e-134], t$95$2, If[LessEqual[j, -2.8e-219], t$95$1, If[LessEqual[j, -2.25e-246], t$95$2, If[LessEqual[j, 1.38e-272], t$95$1, If[LessEqual[j, 9.5e-127], t$95$2, N[(-27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision]]]]]]]]]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
t_1 := t \cdot \left(a \cdot -4\right)\\
t_2 := x \cdot \left(i \cdot -4\right)\\
\mathbf{if}\;j \leq -1.25 \cdot 10^{+72}:\\
\;\;\;\;j \cdot \left(k \cdot -27\right)\\
\mathbf{elif}\;j \leq -2.18 \cdot 10^{-119}:\\
\;\;\;\;b \cdot c\\
\mathbf{elif}\;j \leq -7.5 \cdot 10^{-134}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;j \leq -2.8 \cdot 10^{-219}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;j \leq -2.25 \cdot 10^{-246}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;j \leq 1.38 \cdot 10^{-272}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;j \leq 9.5 \cdot 10^{-127}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;-27 \cdot \left(j \cdot k\right)\\
\end{array}
\end{array}
if j < -1.24999999999999998e72Initial program 84.8%
sub-neg84.8%
associate-+l-84.8%
sub-neg84.8%
sub-neg84.8%
distribute-rgt-out--86.7%
associate-*l*83.0%
distribute-lft-neg-in83.0%
cancel-sign-sub83.0%
associate-*l*83.0%
associate-*l*83.0%
Simplified83.0%
fma-def84.9%
associate-*l*84.9%
Applied egg-rr84.9%
Taylor expanded in j around inf 56.1%
associate-*r*56.2%
*-commutative56.2%
*-commutative56.2%
Simplified56.2%
if -1.24999999999999998e72 < j < -2.17999999999999997e-119Initial program 91.6%
sub-neg91.6%
associate-+l-91.6%
sub-neg91.6%
sub-neg91.6%
distribute-rgt-out--93.7%
associate-*l*95.7%
distribute-lft-neg-in95.7%
cancel-sign-sub95.7%
associate-*l*95.7%
associate-*l*95.7%
Simplified95.7%
fma-def95.6%
associate-*l*95.7%
Applied egg-rr95.7%
Taylor expanded in x around inf 83.2%
*-commutative83.2%
associate-*l*83.2%
Simplified83.2%
Taylor expanded in b around inf 33.3%
if -2.17999999999999997e-119 < j < -7.50000000000000048e-134 or -2.7999999999999999e-219 < j < -2.25e-246 or 1.37999999999999997e-272 < j < 9.4999999999999997e-127Initial program 90.3%
sub-neg90.3%
associate-+l-90.3%
sub-neg90.3%
sub-neg90.3%
distribute-rgt-out--90.3%
associate-*l*88.0%
distribute-lft-neg-in88.0%
cancel-sign-sub88.0%
associate-*l*88.0%
associate-*l*88.0%
Simplified88.0%
fma-def88.0%
associate-*l*88.0%
Applied egg-rr88.0%
Taylor expanded in i around inf 46.2%
associate-*r*46.2%
*-commutative46.2%
Simplified46.2%
if -7.50000000000000048e-134 < j < -2.7999999999999999e-219 or -2.25e-246 < j < 1.37999999999999997e-272Initial program 100.0%
sub-neg100.0%
associate-+l-100.0%
sub-neg100.0%
sub-neg100.0%
distribute-rgt-out--100.0%
associate-*l*97.3%
distribute-lft-neg-in97.3%
cancel-sign-sub97.3%
associate-*l*97.3%
associate-*l*97.3%
Simplified97.3%
fma-def97.3%
associate-*l*97.3%
Applied egg-rr97.3%
Taylor expanded in x around inf 97.3%
*-commutative97.3%
associate-*l*97.3%
Simplified97.3%
Taylor expanded in a around inf 42.5%
*-commutative42.5%
*-commutative42.5%
associate-*l*42.5%
Simplified42.5%
if 9.4999999999999997e-127 < j Initial program 78.0%
sub-neg78.0%
+-commutative78.0%
associate-*l*78.0%
distribute-rgt-neg-in78.0%
fma-def80.5%
*-commutative80.5%
distribute-rgt-neg-in80.5%
metadata-eval80.5%
sub-neg80.5%
+-commutative80.5%
associate-*l*80.5%
distribute-rgt-neg-in80.5%
Simplified88.1%
Taylor expanded in j around inf 31.2%
Final simplification40.7%
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (* -4.0 (+ (* x i) (* t a)))) (t_2 (- (* b c) (* 27.0 (* j k)))))
(if (<= j -2.1e+35)
t_2
(if (<= j -430000.0)
t_1
(if (<= j -2.4e-39)
t_2
(if (<= j -7.4e-119)
(- (* b c) (* 4.0 (* t a)))
(if (<= j 6.5e-119) t_1 t_2)))))))assert(y < z);
assert(j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = -4.0 * ((x * i) + (t * a));
double t_2 = (b * c) - (27.0 * (j * k));
double tmp;
if (j <= -2.1e+35) {
tmp = t_2;
} else if (j <= -430000.0) {
tmp = t_1;
} else if (j <= -2.4e-39) {
tmp = t_2;
} else if (j <= -7.4e-119) {
tmp = (b * c) - (4.0 * (t * a));
} else if (j <= 6.5e-119) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (-4.0d0) * ((x * i) + (t * a))
t_2 = (b * c) - (27.0d0 * (j * k))
if (j <= (-2.1d+35)) then
tmp = t_2
else if (j <= (-430000.0d0)) then
tmp = t_1
else if (j <= (-2.4d-39)) then
tmp = t_2
else if (j <= (-7.4d-119)) then
tmp = (b * c) - (4.0d0 * (t * a))
else if (j <= 6.5d-119) then
tmp = t_1
else
tmp = t_2
end if
code = tmp
end function
assert y < z;
assert j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = -4.0 * ((x * i) + (t * a));
double t_2 = (b * c) - (27.0 * (j * k));
double tmp;
if (j <= -2.1e+35) {
tmp = t_2;
} else if (j <= -430000.0) {
tmp = t_1;
} else if (j <= -2.4e-39) {
tmp = t_2;
} else if (j <= -7.4e-119) {
tmp = (b * c) - (4.0 * (t * a));
} else if (j <= 6.5e-119) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
[y, z] = sort([y, z]) [j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): t_1 = -4.0 * ((x * i) + (t * a)) t_2 = (b * c) - (27.0 * (j * k)) tmp = 0 if j <= -2.1e+35: tmp = t_2 elif j <= -430000.0: tmp = t_1 elif j <= -2.4e-39: tmp = t_2 elif j <= -7.4e-119: tmp = (b * c) - (4.0 * (t * a)) elif j <= 6.5e-119: tmp = t_1 else: tmp = t_2 return tmp
y, z = sort([y, z]) j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(-4.0 * Float64(Float64(x * i) + Float64(t * a))) t_2 = Float64(Float64(b * c) - Float64(27.0 * Float64(j * k))) tmp = 0.0 if (j <= -2.1e+35) tmp = t_2; elseif (j <= -430000.0) tmp = t_1; elseif (j <= -2.4e-39) tmp = t_2; elseif (j <= -7.4e-119) tmp = Float64(Float64(b * c) - Float64(4.0 * Float64(t * a))); elseif (j <= 6.5e-119) tmp = t_1; else tmp = t_2; end return tmp end
y, z = num2cell(sort([y, z])){:}
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
t_1 = -4.0 * ((x * i) + (t * a));
t_2 = (b * c) - (27.0 * (j * k));
tmp = 0.0;
if (j <= -2.1e+35)
tmp = t_2;
elseif (j <= -430000.0)
tmp = t_1;
elseif (j <= -2.4e-39)
tmp = t_2;
elseif (j <= -7.4e-119)
tmp = (b * c) - (4.0 * (t * a));
elseif (j <= 6.5e-119)
tmp = t_1;
else
tmp = t_2;
end
tmp_2 = tmp;
end
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(-4.0 * N[(N[(x * i), $MachinePrecision] + N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(b * c), $MachinePrecision] - N[(27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[j, -2.1e+35], t$95$2, If[LessEqual[j, -430000.0], t$95$1, If[LessEqual[j, -2.4e-39], t$95$2, If[LessEqual[j, -7.4e-119], N[(N[(b * c), $MachinePrecision] - N[(4.0 * N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[j, 6.5e-119], t$95$1, t$95$2]]]]]]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
t_1 := -4 \cdot \left(x \cdot i + t \cdot a\right)\\
t_2 := b \cdot c - 27 \cdot \left(j \cdot k\right)\\
\mathbf{if}\;j \leq -2.1 \cdot 10^{+35}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;j \leq -430000:\\
\;\;\;\;t_1\\
\mathbf{elif}\;j \leq -2.4 \cdot 10^{-39}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;j \leq -7.4 \cdot 10^{-119}:\\
\;\;\;\;b \cdot c - 4 \cdot \left(t \cdot a\right)\\
\mathbf{elif}\;j \leq 6.5 \cdot 10^{-119}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if j < -2.0999999999999999e35 or -4.3e5 < j < -2.40000000000000016e-39 or 6.5e-119 < j Initial program 82.6%
Taylor expanded in x around 0 63.9%
Taylor expanded in a around 0 55.6%
if -2.0999999999999999e35 < j < -4.3e5 or -7.4000000000000003e-119 < j < 6.5e-119Initial program 94.0%
sub-neg94.0%
associate-+l-94.0%
sub-neg94.0%
sub-neg94.0%
distribute-rgt-out--94.0%
associate-*l*91.8%
distribute-lft-neg-in91.8%
cancel-sign-sub91.8%
associate-*l*91.8%
associate-*l*91.8%
Simplified91.8%
fma-def91.8%
associate-*l*91.8%
Applied egg-rr91.8%
Taylor expanded in x around inf 91.8%
*-commutative91.8%
associate-*l*91.8%
Simplified91.8%
Taylor expanded in a around inf 63.2%
associate-*r*63.2%
Simplified63.2%
Taylor expanded in a around 0 63.2%
distribute-lft-out63.2%
*-commutative63.2%
Simplified63.2%
if -2.40000000000000016e-39 < j < -7.4000000000000003e-119Initial program 89.7%
Taylor expanded in x around 0 68.8%
Taylor expanded in j around 0 53.7%
Final simplification57.9%
NOTE: y and z should be sorted in increasing order before calling this function. NOTE: j and k should be sorted in increasing order before calling this function. (FPCore (x y z t a b c i j k) :precision binary64 (if (or (<= x -2.2e+46) (not (<= x 3.45e+112))) (* x (- (* 18.0 (* y (* z t))) (* 4.0 i))) (- (- (* b c) (* 4.0 (* t a))) (* (* j 27.0) k))))
assert(y < z);
assert(j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double tmp;
if ((x <= -2.2e+46) || !(x <= 3.45e+112)) {
tmp = x * ((18.0 * (y * (z * t))) - (4.0 * i));
} else {
tmp = ((b * c) - (4.0 * (t * a))) - ((j * 27.0) * k);
}
return tmp;
}
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: tmp
if ((x <= (-2.2d+46)) .or. (.not. (x <= 3.45d+112))) then
tmp = x * ((18.0d0 * (y * (z * t))) - (4.0d0 * i))
else
tmp = ((b * c) - (4.0d0 * (t * a))) - ((j * 27.0d0) * k)
end if
code = tmp
end function
assert y < z;
assert j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double tmp;
if ((x <= -2.2e+46) || !(x <= 3.45e+112)) {
tmp = x * ((18.0 * (y * (z * t))) - (4.0 * i));
} else {
tmp = ((b * c) - (4.0 * (t * a))) - ((j * 27.0) * k);
}
return tmp;
}
[y, z] = sort([y, z]) [j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): tmp = 0 if (x <= -2.2e+46) or not (x <= 3.45e+112): tmp = x * ((18.0 * (y * (z * t))) - (4.0 * i)) else: tmp = ((b * c) - (4.0 * (t * a))) - ((j * 27.0) * k) return tmp
y, z = sort([y, z]) j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) tmp = 0.0 if ((x <= -2.2e+46) || !(x <= 3.45e+112)) tmp = Float64(x * Float64(Float64(18.0 * Float64(y * Float64(z * t))) - Float64(4.0 * i))); else tmp = Float64(Float64(Float64(b * c) - Float64(4.0 * Float64(t * a))) - Float64(Float64(j * 27.0) * k)); end return tmp end
y, z = num2cell(sort([y, z])){:}
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
tmp = 0.0;
if ((x <= -2.2e+46) || ~((x <= 3.45e+112)))
tmp = x * ((18.0 * (y * (z * t))) - (4.0 * i));
else
tmp = ((b * c) - (4.0 * (t * a))) - ((j * 27.0) * k);
end
tmp_2 = tmp;
end
NOTE: y and z should be sorted in increasing order before calling this function. NOTE: j and k should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := If[Or[LessEqual[x, -2.2e+46], N[Not[LessEqual[x, 3.45e+112]], $MachinePrecision]], N[(x * N[(N[(18.0 * N[(y * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(4.0 * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(b * c), $MachinePrecision] - N[(4.0 * N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.2 \cdot 10^{+46} \lor \neg \left(x \leq 3.45 \cdot 10^{+112}\right):\\
\;\;\;\;x \cdot \left(18 \cdot \left(y \cdot \left(z \cdot t\right)\right) - 4 \cdot i\right)\\
\mathbf{else}:\\
\;\;\;\;\left(b \cdot c - 4 \cdot \left(t \cdot a\right)\right) - \left(j \cdot 27\right) \cdot k\\
\end{array}
\end{array}
if x < -2.2e46 or 3.45e112 < x Initial program 73.8%
sub-neg73.8%
associate-+l-73.8%
sub-neg73.8%
sub-neg73.8%
distribute-rgt-out--77.8%
associate-*l*80.6%
distribute-lft-neg-in80.6%
cancel-sign-sub80.6%
associate-*l*80.6%
associate-*l*80.6%
Simplified80.6%
Taylor expanded in x around inf 74.6%
if -2.2e46 < x < 3.45e112Initial program 95.4%
Taylor expanded in x around 0 80.2%
Final simplification78.0%
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (* -4.0 (+ (* x i) (* t a)))))
(if (<= j -1.96e+77)
(* j (* k -27.0))
(if (<= j -180000.0)
t_1
(if (<= j -4.6e-39) (* b c) (if (<= j 7e-53) t_1 (* -27.0 (* j k))))))))assert(y < z);
assert(j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = -4.0 * ((x * i) + (t * a));
double tmp;
if (j <= -1.96e+77) {
tmp = j * (k * -27.0);
} else if (j <= -180000.0) {
tmp = t_1;
} else if (j <= -4.6e-39) {
tmp = b * c;
} else if (j <= 7e-53) {
tmp = t_1;
} else {
tmp = -27.0 * (j * k);
}
return tmp;
}
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: tmp
t_1 = (-4.0d0) * ((x * i) + (t * a))
if (j <= (-1.96d+77)) then
tmp = j * (k * (-27.0d0))
else if (j <= (-180000.0d0)) then
tmp = t_1
else if (j <= (-4.6d-39)) then
tmp = b * c
else if (j <= 7d-53) then
tmp = t_1
else
tmp = (-27.0d0) * (j * k)
end if
code = tmp
end function
assert y < z;
assert j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = -4.0 * ((x * i) + (t * a));
double tmp;
if (j <= -1.96e+77) {
tmp = j * (k * -27.0);
} else if (j <= -180000.0) {
tmp = t_1;
} else if (j <= -4.6e-39) {
tmp = b * c;
} else if (j <= 7e-53) {
tmp = t_1;
} else {
tmp = -27.0 * (j * k);
}
return tmp;
}
[y, z] = sort([y, z]) [j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): t_1 = -4.0 * ((x * i) + (t * a)) tmp = 0 if j <= -1.96e+77: tmp = j * (k * -27.0) elif j <= -180000.0: tmp = t_1 elif j <= -4.6e-39: tmp = b * c elif j <= 7e-53: tmp = t_1 else: tmp = -27.0 * (j * k) return tmp
y, z = sort([y, z]) j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(-4.0 * Float64(Float64(x * i) + Float64(t * a))) tmp = 0.0 if (j <= -1.96e+77) tmp = Float64(j * Float64(k * -27.0)); elseif (j <= -180000.0) tmp = t_1; elseif (j <= -4.6e-39) tmp = Float64(b * c); elseif (j <= 7e-53) tmp = t_1; else tmp = Float64(-27.0 * Float64(j * k)); end return tmp end
y, z = num2cell(sort([y, z])){:}
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
t_1 = -4.0 * ((x * i) + (t * a));
tmp = 0.0;
if (j <= -1.96e+77)
tmp = j * (k * -27.0);
elseif (j <= -180000.0)
tmp = t_1;
elseif (j <= -4.6e-39)
tmp = b * c;
elseif (j <= 7e-53)
tmp = t_1;
else
tmp = -27.0 * (j * k);
end
tmp_2 = tmp;
end
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(-4.0 * N[(N[(x * i), $MachinePrecision] + N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[j, -1.96e+77], N[(j * N[(k * -27.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[j, -180000.0], t$95$1, If[LessEqual[j, -4.6e-39], N[(b * c), $MachinePrecision], If[LessEqual[j, 7e-53], t$95$1, N[(-27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
t_1 := -4 \cdot \left(x \cdot i + t \cdot a\right)\\
\mathbf{if}\;j \leq -1.96 \cdot 10^{+77}:\\
\;\;\;\;j \cdot \left(k \cdot -27\right)\\
\mathbf{elif}\;j \leq -180000:\\
\;\;\;\;t_1\\
\mathbf{elif}\;j \leq -4.6 \cdot 10^{-39}:\\
\;\;\;\;b \cdot c\\
\mathbf{elif}\;j \leq 7 \cdot 10^{-53}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;-27 \cdot \left(j \cdot k\right)\\
\end{array}
\end{array}
if j < -1.96000000000000011e77Initial program 84.6%
sub-neg84.6%
associate-+l-84.6%
sub-neg84.6%
sub-neg84.6%
distribute-rgt-out--86.5%
associate-*l*82.6%
distribute-lft-neg-in82.6%
cancel-sign-sub82.6%
associate-*l*82.6%
associate-*l*82.7%
Simplified82.7%
fma-def84.6%
associate-*l*84.6%
Applied egg-rr84.6%
Taylor expanded in j around inf 55.3%
associate-*r*55.4%
*-commutative55.4%
*-commutative55.4%
Simplified55.4%
if -1.96000000000000011e77 < j < -1.8e5 or -4.60000000000000016e-39 < j < 6.99999999999999987e-53Initial program 92.1%
sub-neg92.1%
associate-+l-92.1%
sub-neg92.1%
sub-neg92.1%
distribute-rgt-out--92.9%
associate-*l*92.3%
distribute-lft-neg-in92.3%
cancel-sign-sub92.3%
associate-*l*92.3%
associate-*l*92.3%
Simplified92.3%
fma-def92.3%
associate-*l*92.3%
Applied egg-rr92.3%
Taylor expanded in x around inf 87.7%
*-commutative87.7%
associate-*l*87.7%
Simplified87.7%
Taylor expanded in a around inf 56.7%
associate-*r*56.7%
Simplified56.7%
Taylor expanded in a around 0 56.7%
distribute-lft-out56.7%
*-commutative56.7%
Simplified56.7%
if -1.8e5 < j < -4.60000000000000016e-39Initial program 90.9%
sub-neg90.9%
associate-+l-90.9%
sub-neg90.9%
sub-neg90.9%
distribute-rgt-out--90.9%
associate-*l*90.9%
distribute-lft-neg-in90.9%
cancel-sign-sub90.9%
associate-*l*90.9%
associate-*l*90.9%
Simplified90.9%
fma-def90.9%
associate-*l*90.9%
Applied egg-rr90.9%
Taylor expanded in x around inf 81.9%
*-commutative81.9%
associate-*l*81.9%
Simplified81.9%
Taylor expanded in b around inf 82.1%
if 6.99999999999999987e-53 < j Initial program 77.6%
sub-neg77.6%
+-commutative77.6%
associate-*l*77.6%
distribute-rgt-neg-in77.6%
fma-def80.6%
*-commutative80.6%
distribute-rgt-neg-in80.6%
metadata-eval80.6%
sub-neg80.6%
+-commutative80.6%
associate-*l*80.6%
distribute-rgt-neg-in80.6%
Simplified89.9%
Taylor expanded in j around inf 36.4%
Final simplification52.3%
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(if (<= j -1.8e+100)
(* j (* k -27.0))
(if (<= j -3.5e-119)
(- (* b c) (* 4.0 (* t a)))
(if (<= j 7e-53) (* -4.0 (+ (* x i) (* t a))) (* -27.0 (* j k))))))assert(y < z);
assert(j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double tmp;
if (j <= -1.8e+100) {
tmp = j * (k * -27.0);
} else if (j <= -3.5e-119) {
tmp = (b * c) - (4.0 * (t * a));
} else if (j <= 7e-53) {
tmp = -4.0 * ((x * i) + (t * a));
} else {
tmp = -27.0 * (j * k);
}
return tmp;
}
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: tmp
if (j <= (-1.8d+100)) then
tmp = j * (k * (-27.0d0))
else if (j <= (-3.5d-119)) then
tmp = (b * c) - (4.0d0 * (t * a))
else if (j <= 7d-53) then
tmp = (-4.0d0) * ((x * i) + (t * a))
else
tmp = (-27.0d0) * (j * k)
end if
code = tmp
end function
assert y < z;
assert j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double tmp;
if (j <= -1.8e+100) {
tmp = j * (k * -27.0);
} else if (j <= -3.5e-119) {
tmp = (b * c) - (4.0 * (t * a));
} else if (j <= 7e-53) {
tmp = -4.0 * ((x * i) + (t * a));
} else {
tmp = -27.0 * (j * k);
}
return tmp;
}
[y, z] = sort([y, z]) [j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): tmp = 0 if j <= -1.8e+100: tmp = j * (k * -27.0) elif j <= -3.5e-119: tmp = (b * c) - (4.0 * (t * a)) elif j <= 7e-53: tmp = -4.0 * ((x * i) + (t * a)) else: tmp = -27.0 * (j * k) return tmp
y, z = sort([y, z]) j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) tmp = 0.0 if (j <= -1.8e+100) tmp = Float64(j * Float64(k * -27.0)); elseif (j <= -3.5e-119) tmp = Float64(Float64(b * c) - Float64(4.0 * Float64(t * a))); elseif (j <= 7e-53) tmp = Float64(-4.0 * Float64(Float64(x * i) + Float64(t * a))); else tmp = Float64(-27.0 * Float64(j * k)); end return tmp end
y, z = num2cell(sort([y, z])){:}
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
tmp = 0.0;
if (j <= -1.8e+100)
tmp = j * (k * -27.0);
elseif (j <= -3.5e-119)
tmp = (b * c) - (4.0 * (t * a));
elseif (j <= 7e-53)
tmp = -4.0 * ((x * i) + (t * a));
else
tmp = -27.0 * (j * k);
end
tmp_2 = tmp;
end
NOTE: y and z should be sorted in increasing order before calling this function. NOTE: j and k should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := If[LessEqual[j, -1.8e+100], N[(j * N[(k * -27.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[j, -3.5e-119], N[(N[(b * c), $MachinePrecision] - N[(4.0 * N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[j, 7e-53], N[(-4.0 * N[(N[(x * i), $MachinePrecision] + N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
\mathbf{if}\;j \leq -1.8 \cdot 10^{+100}:\\
\;\;\;\;j \cdot \left(k \cdot -27\right)\\
\mathbf{elif}\;j \leq -3.5 \cdot 10^{-119}:\\
\;\;\;\;b \cdot c - 4 \cdot \left(t \cdot a\right)\\
\mathbf{elif}\;j \leq 7 \cdot 10^{-53}:\\
\;\;\;\;-4 \cdot \left(x \cdot i + t \cdot a\right)\\
\mathbf{else}:\\
\;\;\;\;-27 \cdot \left(j \cdot k\right)\\
\end{array}
\end{array}
if j < -1.8e100Initial program 82.9%
sub-neg82.9%
associate-+l-82.9%
sub-neg82.9%
sub-neg82.9%
distribute-rgt-out--85.1%
associate-*l*80.8%
distribute-lft-neg-in80.8%
cancel-sign-sub80.8%
associate-*l*80.8%
associate-*l*80.9%
Simplified80.9%
fma-def83.0%
associate-*l*83.0%
Applied egg-rr83.0%
Taylor expanded in j around inf 56.3%
associate-*r*56.4%
*-commutative56.4%
*-commutative56.4%
Simplified56.4%
if -1.8e100 < j < -3.5e-119Initial program 92.5%
Taylor expanded in x around 0 70.8%
Taylor expanded in j around 0 55.8%
if -3.5e-119 < j < 6.99999999999999987e-53Initial program 92.2%
sub-neg92.2%
associate-+l-92.2%
sub-neg92.2%
sub-neg92.2%
distribute-rgt-out--92.2%
associate-*l*90.2%
distribute-lft-neg-in90.2%
cancel-sign-sub90.2%
associate-*l*90.2%
associate-*l*90.3%
Simplified90.3%
fma-def90.3%
associate-*l*90.3%
Applied egg-rr90.3%
Taylor expanded in x around inf 89.2%
*-commutative89.2%
associate-*l*89.2%
Simplified89.2%
Taylor expanded in a around inf 57.4%
associate-*r*57.4%
Simplified57.4%
Taylor expanded in a around 0 57.4%
distribute-lft-out57.4%
*-commutative57.4%
Simplified57.4%
if 6.99999999999999987e-53 < j Initial program 77.6%
sub-neg77.6%
+-commutative77.6%
associate-*l*77.6%
distribute-rgt-neg-in77.6%
fma-def80.6%
*-commutative80.6%
distribute-rgt-neg-in80.6%
metadata-eval80.6%
sub-neg80.6%
+-commutative80.6%
associate-*l*80.6%
distribute-rgt-neg-in80.6%
Simplified89.9%
Taylor expanded in j around inf 36.4%
Final simplification51.5%
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(if (<= j -2.25e+67)
(* j (* k -27.0))
(if (<= j -9.5e-95)
(* b c)
(if (<= j 6e-69) (* t (* a -4.0)) (* -27.0 (* j k))))))assert(y < z);
assert(j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double tmp;
if (j <= -2.25e+67) {
tmp = j * (k * -27.0);
} else if (j <= -9.5e-95) {
tmp = b * c;
} else if (j <= 6e-69) {
tmp = t * (a * -4.0);
} else {
tmp = -27.0 * (j * k);
}
return tmp;
}
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: tmp
if (j <= (-2.25d+67)) then
tmp = j * (k * (-27.0d0))
else if (j <= (-9.5d-95)) then
tmp = b * c
else if (j <= 6d-69) then
tmp = t * (a * (-4.0d0))
else
tmp = (-27.0d0) * (j * k)
end if
code = tmp
end function
assert y < z;
assert j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double tmp;
if (j <= -2.25e+67) {
tmp = j * (k * -27.0);
} else if (j <= -9.5e-95) {
tmp = b * c;
} else if (j <= 6e-69) {
tmp = t * (a * -4.0);
} else {
tmp = -27.0 * (j * k);
}
return tmp;
}
[y, z] = sort([y, z]) [j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): tmp = 0 if j <= -2.25e+67: tmp = j * (k * -27.0) elif j <= -9.5e-95: tmp = b * c elif j <= 6e-69: tmp = t * (a * -4.0) else: tmp = -27.0 * (j * k) return tmp
y, z = sort([y, z]) j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) tmp = 0.0 if (j <= -2.25e+67) tmp = Float64(j * Float64(k * -27.0)); elseif (j <= -9.5e-95) tmp = Float64(b * c); elseif (j <= 6e-69) tmp = Float64(t * Float64(a * -4.0)); else tmp = Float64(-27.0 * Float64(j * k)); end return tmp end
y, z = num2cell(sort([y, z])){:}
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
tmp = 0.0;
if (j <= -2.25e+67)
tmp = j * (k * -27.0);
elseif (j <= -9.5e-95)
tmp = b * c;
elseif (j <= 6e-69)
tmp = t * (a * -4.0);
else
tmp = -27.0 * (j * k);
end
tmp_2 = tmp;
end
NOTE: y and z should be sorted in increasing order before calling this function. NOTE: j and k should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := If[LessEqual[j, -2.25e+67], N[(j * N[(k * -27.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[j, -9.5e-95], N[(b * c), $MachinePrecision], If[LessEqual[j, 6e-69], N[(t * N[(a * -4.0), $MachinePrecision]), $MachinePrecision], N[(-27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
\mathbf{if}\;j \leq -2.25 \cdot 10^{+67}:\\
\;\;\;\;j \cdot \left(k \cdot -27\right)\\
\mathbf{elif}\;j \leq -9.5 \cdot 10^{-95}:\\
\;\;\;\;b \cdot c\\
\mathbf{elif}\;j \leq 6 \cdot 10^{-69}:\\
\;\;\;\;t \cdot \left(a \cdot -4\right)\\
\mathbf{else}:\\
\;\;\;\;-27 \cdot \left(j \cdot k\right)\\
\end{array}
\end{array}
if j < -2.2499999999999999e67Initial program 84.8%
sub-neg84.8%
associate-+l-84.8%
sub-neg84.8%
sub-neg84.8%
distribute-rgt-out--86.7%
associate-*l*83.0%
distribute-lft-neg-in83.0%
cancel-sign-sub83.0%
associate-*l*83.0%
associate-*l*83.0%
Simplified83.0%
fma-def84.9%
associate-*l*84.9%
Applied egg-rr84.9%
Taylor expanded in j around inf 56.1%
associate-*r*56.2%
*-commutative56.2%
*-commutative56.2%
Simplified56.2%
if -2.2499999999999999e67 < j < -9.49999999999999998e-95Initial program 93.1%
sub-neg93.1%
associate-+l-93.1%
sub-neg93.1%
sub-neg93.1%
distribute-rgt-out--93.1%
associate-*l*95.3%
distribute-lft-neg-in95.3%
cancel-sign-sub95.3%
associate-*l*95.3%
associate-*l*95.3%
Simplified95.3%
fma-def95.3%
associate-*l*95.3%
Applied egg-rr95.3%
Taylor expanded in x around inf 81.7%
*-commutative81.7%
associate-*l*81.7%
Simplified81.7%
Taylor expanded in b around inf 36.2%
if -9.49999999999999998e-95 < j < 5.99999999999999978e-69Initial program 92.4%
sub-neg92.4%
associate-+l-92.4%
sub-neg92.4%
sub-neg92.4%
distribute-rgt-out--93.4%
associate-*l*90.4%
distribute-lft-neg-in90.4%
cancel-sign-sub90.4%
associate-*l*90.4%
associate-*l*90.5%
Simplified90.5%
fma-def90.5%
associate-*l*90.5%
Applied egg-rr90.5%
Taylor expanded in x around inf 89.4%
*-commutative89.4%
associate-*l*89.4%
Simplified89.4%
Taylor expanded in a around inf 34.1%
*-commutative34.1%
*-commutative34.1%
associate-*l*34.1%
Simplified34.1%
if 5.99999999999999978e-69 < j Initial program 76.8%
sub-neg76.8%
+-commutative76.8%
associate-*l*76.8%
distribute-rgt-neg-in76.8%
fma-def79.7%
*-commutative79.7%
distribute-rgt-neg-in79.7%
metadata-eval79.7%
sub-neg79.7%
+-commutative79.7%
associate-*l*79.7%
distribute-rgt-neg-in79.7%
Simplified90.1%
Taylor expanded in j around inf 35.4%
Final simplification39.4%
NOTE: y and z should be sorted in increasing order before calling this function. NOTE: j and k should be sorted in increasing order before calling this function. (FPCore (x y z t a b c i j k) :precision binary64 (if (or (<= j -3.4e+68) (not (<= j 2.6e-58))) (* -27.0 (* j k)) (* b c)))
assert(y < z);
assert(j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double tmp;
if ((j <= -3.4e+68) || !(j <= 2.6e-58)) {
tmp = -27.0 * (j * k);
} else {
tmp = b * c;
}
return tmp;
}
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: tmp
if ((j <= (-3.4d+68)) .or. (.not. (j <= 2.6d-58))) then
tmp = (-27.0d0) * (j * k)
else
tmp = b * c
end if
code = tmp
end function
assert y < z;
assert j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double tmp;
if ((j <= -3.4e+68) || !(j <= 2.6e-58)) {
tmp = -27.0 * (j * k);
} else {
tmp = b * c;
}
return tmp;
}
[y, z] = sort([y, z]) [j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): tmp = 0 if (j <= -3.4e+68) or not (j <= 2.6e-58): tmp = -27.0 * (j * k) else: tmp = b * c return tmp
y, z = sort([y, z]) j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) tmp = 0.0 if ((j <= -3.4e+68) || !(j <= 2.6e-58)) tmp = Float64(-27.0 * Float64(j * k)); else tmp = Float64(b * c); end return tmp end
y, z = num2cell(sort([y, z])){:}
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
tmp = 0.0;
if ((j <= -3.4e+68) || ~((j <= 2.6e-58)))
tmp = -27.0 * (j * k);
else
tmp = b * c;
end
tmp_2 = tmp;
end
NOTE: y and z should be sorted in increasing order before calling this function. NOTE: j and k should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := If[Or[LessEqual[j, -3.4e+68], N[Not[LessEqual[j, 2.6e-58]], $MachinePrecision]], N[(-27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision], N[(b * c), $MachinePrecision]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
\mathbf{if}\;j \leq -3.4 \cdot 10^{+68} \lor \neg \left(j \leq 2.6 \cdot 10^{-58}\right):\\
\;\;\;\;-27 \cdot \left(j \cdot k\right)\\
\mathbf{else}:\\
\;\;\;\;b \cdot c\\
\end{array}
\end{array}
if j < -3.40000000000000015e68 or 2.60000000000000007e-58 < j Initial program 80.1%
sub-neg80.1%
+-commutative80.1%
associate-*l*80.2%
distribute-rgt-neg-in80.2%
fma-def82.7%
*-commutative82.7%
distribute-rgt-neg-in82.7%
metadata-eval82.7%
sub-neg82.7%
+-commutative82.7%
associate-*l*82.7%
distribute-rgt-neg-in82.7%
Simplified91.9%
Taylor expanded in j around inf 44.8%
if -3.40000000000000015e68 < j < 2.60000000000000007e-58Initial program 92.7%
sub-neg92.7%
associate-+l-92.7%
sub-neg92.7%
sub-neg92.7%
distribute-rgt-out--93.4%
associate-*l*92.1%
distribute-lft-neg-in92.1%
cancel-sign-sub92.1%
associate-*l*92.1%
associate-*l*92.1%
Simplified92.1%
fma-def92.1%
associate-*l*92.1%
Applied egg-rr92.1%
Taylor expanded in x around inf 87.1%
*-commutative87.1%
associate-*l*87.1%
Simplified87.1%
Taylor expanded in b around inf 28.9%
Final simplification36.4%
NOTE: y and z should be sorted in increasing order before calling this function. NOTE: j and k should be sorted in increasing order before calling this function. (FPCore (x y z t a b c i j k) :precision binary64 (if (<= j -2.5e+69) (* j (* k -27.0)) (if (<= j 3.8e-56) (* b c) (* -27.0 (* j k)))))
assert(y < z);
assert(j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double tmp;
if (j <= -2.5e+69) {
tmp = j * (k * -27.0);
} else if (j <= 3.8e-56) {
tmp = b * c;
} else {
tmp = -27.0 * (j * k);
}
return tmp;
}
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: tmp
if (j <= (-2.5d+69)) then
tmp = j * (k * (-27.0d0))
else if (j <= 3.8d-56) then
tmp = b * c
else
tmp = (-27.0d0) * (j * k)
end if
code = tmp
end function
assert y < z;
assert j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double tmp;
if (j <= -2.5e+69) {
tmp = j * (k * -27.0);
} else if (j <= 3.8e-56) {
tmp = b * c;
} else {
tmp = -27.0 * (j * k);
}
return tmp;
}
[y, z] = sort([y, z]) [j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): tmp = 0 if j <= -2.5e+69: tmp = j * (k * -27.0) elif j <= 3.8e-56: tmp = b * c else: tmp = -27.0 * (j * k) return tmp
y, z = sort([y, z]) j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) tmp = 0.0 if (j <= -2.5e+69) tmp = Float64(j * Float64(k * -27.0)); elseif (j <= 3.8e-56) tmp = Float64(b * c); else tmp = Float64(-27.0 * Float64(j * k)); end return tmp end
y, z = num2cell(sort([y, z])){:}
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
tmp = 0.0;
if (j <= -2.5e+69)
tmp = j * (k * -27.0);
elseif (j <= 3.8e-56)
tmp = b * c;
else
tmp = -27.0 * (j * k);
end
tmp_2 = tmp;
end
NOTE: y and z should be sorted in increasing order before calling this function. NOTE: j and k should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := If[LessEqual[j, -2.5e+69], N[(j * N[(k * -27.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[j, 3.8e-56], N[(b * c), $MachinePrecision], N[(-27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
\mathbf{if}\;j \leq -2.5 \cdot 10^{+69}:\\
\;\;\;\;j \cdot \left(k \cdot -27\right)\\
\mathbf{elif}\;j \leq 3.8 \cdot 10^{-56}:\\
\;\;\;\;b \cdot c\\
\mathbf{else}:\\
\;\;\;\;-27 \cdot \left(j \cdot k\right)\\
\end{array}
\end{array}
if j < -2.50000000000000018e69Initial program 84.8%
sub-neg84.8%
associate-+l-84.8%
sub-neg84.8%
sub-neg84.8%
distribute-rgt-out--86.7%
associate-*l*83.0%
distribute-lft-neg-in83.0%
cancel-sign-sub83.0%
associate-*l*83.0%
associate-*l*83.0%
Simplified83.0%
fma-def84.9%
associate-*l*84.9%
Applied egg-rr84.9%
Taylor expanded in j around inf 56.1%
associate-*r*56.2%
*-commutative56.2%
*-commutative56.2%
Simplified56.2%
if -2.50000000000000018e69 < j < 3.8000000000000002e-56Initial program 92.0%
sub-neg92.0%
associate-+l-92.0%
sub-neg92.0%
sub-neg92.0%
distribute-rgt-out--92.7%
associate-*l*92.1%
distribute-lft-neg-in92.1%
cancel-sign-sub92.1%
associate-*l*92.1%
associate-*l*92.1%
Simplified92.1%
fma-def92.1%
associate-*l*92.1%
Applied egg-rr92.1%
Taylor expanded in x around inf 87.1%
*-commutative87.1%
associate-*l*87.1%
Simplified87.1%
Taylor expanded in b around inf 28.7%
if 3.8000000000000002e-56 < j Initial program 77.6%
sub-neg77.6%
+-commutative77.6%
associate-*l*77.6%
distribute-rgt-neg-in77.6%
fma-def80.6%
*-commutative80.6%
distribute-rgt-neg-in80.6%
metadata-eval80.6%
sub-neg80.6%
+-commutative80.6%
associate-*l*80.6%
distribute-rgt-neg-in80.6%
Simplified89.9%
Taylor expanded in j around inf 36.4%
Final simplification36.4%
NOTE: y and z should be sorted in increasing order before calling this function. NOTE: j and k should be sorted in increasing order before calling this function. (FPCore (x y z t a b c i j k) :precision binary64 (* b c))
assert(y < z);
assert(j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
return b * c;
}
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
code = b * c
end function
assert y < z;
assert j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
return b * c;
}
[y, z] = sort([y, z]) [j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): return b * c
y, z = sort([y, z]) j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) return Float64(b * c) end
y, z = num2cell(sort([y, z])){:}
j, k = num2cell(sort([j, k])){:}
function tmp = code(x, y, z, t, a, b, c, i, j, k)
tmp = b * c;
end
NOTE: y and z should be sorted in increasing order before calling this function. NOTE: j and k should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := N[(b * c), $MachinePrecision]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
[j, k] = \mathsf{sort}([j, k])\\
\\
b \cdot c
\end{array}
Initial program 86.8%
sub-neg86.8%
associate-+l-86.8%
sub-neg86.8%
sub-neg86.8%
distribute-rgt-out--88.7%
associate-*l*87.7%
distribute-lft-neg-in87.7%
cancel-sign-sub87.7%
associate-*l*87.7%
associate-*l*87.7%
Simplified87.7%
fma-def88.5%
associate-*l*88.5%
Applied egg-rr88.5%
Taylor expanded in x around inf 71.5%
*-commutative71.5%
associate-*l*71.5%
Simplified71.5%
Taylor expanded in b around inf 22.1%
Final simplification22.1%
(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 2023258
(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)))