
(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 20 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 95.8%
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--10.7%
associate-*l*14.3%
distribute-lft-neg-in14.3%
cancel-sign-sub14.3%
associate-*l*14.3%
associate-*l*14.3%
Simplified14.3%
Taylor expanded in x around inf 71.7%
Final simplification93.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 (* t (- (* 18.0 (* y (* x z))) (* a 4.0))))
(t_2 (* (* j 27.0) k))
(t_3 (- (* b c) (* 4.0 (* x i)))))
(if (<= t_2 -1e+131)
(- (* t (* a -4.0)) (* j (* 27.0 k)))
(if (<= t_2 -5e-25)
t_3
(if (<= t_2 -5e-85)
t_1
(if (<= t_2 4e-322)
t_3
(if (<= t_2 2e-137)
t_1
(if (<= t_2 5e+154) t_3 (- (* 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 t_1 = t * ((18.0 * (y * (x * z))) - (a * 4.0));
double t_2 = (j * 27.0) * k;
double t_3 = (b * c) - (4.0 * (x * i));
double tmp;
if (t_2 <= -1e+131) {
tmp = (t * (a * -4.0)) - (j * (27.0 * k));
} else if (t_2 <= -5e-25) {
tmp = t_3;
} else if (t_2 <= -5e-85) {
tmp = t_1;
} else if (t_2 <= 4e-322) {
tmp = t_3;
} else if (t_2 <= 2e-137) {
tmp = t_1;
} else if (t_2 <= 5e+154) {
tmp = t_3;
} else {
tmp = (b * c) - (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) :: t_3
real(8) :: tmp
t_1 = t * ((18.0d0 * (y * (x * z))) - (a * 4.0d0))
t_2 = (j * 27.0d0) * k
t_3 = (b * c) - (4.0d0 * (x * i))
if (t_2 <= (-1d+131)) then
tmp = (t * (a * (-4.0d0))) - (j * (27.0d0 * k))
else if (t_2 <= (-5d-25)) then
tmp = t_3
else if (t_2 <= (-5d-85)) then
tmp = t_1
else if (t_2 <= 4d-322) then
tmp = t_3
else if (t_2 <= 2d-137) then
tmp = t_1
else if (t_2 <= 5d+154) then
tmp = t_3
else
tmp = (b * c) - (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 * ((18.0 * (y * (x * z))) - (a * 4.0));
double t_2 = (j * 27.0) * k;
double t_3 = (b * c) - (4.0 * (x * i));
double tmp;
if (t_2 <= -1e+131) {
tmp = (t * (a * -4.0)) - (j * (27.0 * k));
} else if (t_2 <= -5e-25) {
tmp = t_3;
} else if (t_2 <= -5e-85) {
tmp = t_1;
} else if (t_2 <= 4e-322) {
tmp = t_3;
} else if (t_2 <= 2e-137) {
tmp = t_1;
} else if (t_2 <= 5e+154) {
tmp = t_3;
} else {
tmp = (b * c) - (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 * ((18.0 * (y * (x * z))) - (a * 4.0)) t_2 = (j * 27.0) * k t_3 = (b * c) - (4.0 * (x * i)) tmp = 0 if t_2 <= -1e+131: tmp = (t * (a * -4.0)) - (j * (27.0 * k)) elif t_2 <= -5e-25: tmp = t_3 elif t_2 <= -5e-85: tmp = t_1 elif t_2 <= 4e-322: tmp = t_3 elif t_2 <= 2e-137: tmp = t_1 elif t_2 <= 5e+154: tmp = t_3 else: tmp = (b * c) - (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(Float64(18.0 * Float64(y * Float64(x * z))) - Float64(a * 4.0))) t_2 = Float64(Float64(j * 27.0) * k) t_3 = Float64(Float64(b * c) - Float64(4.0 * Float64(x * i))) tmp = 0.0 if (t_2 <= -1e+131) tmp = Float64(Float64(t * Float64(a * -4.0)) - Float64(j * Float64(27.0 * k))); elseif (t_2 <= -5e-25) tmp = t_3; elseif (t_2 <= -5e-85) tmp = t_1; elseif (t_2 <= 4e-322) tmp = t_3; elseif (t_2 <= 2e-137) tmp = t_1; elseif (t_2 <= 5e+154) tmp = t_3; else tmp = Float64(Float64(b * c) - 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 * ((18.0 * (y * (x * z))) - (a * 4.0));
t_2 = (j * 27.0) * k;
t_3 = (b * c) - (4.0 * (x * i));
tmp = 0.0;
if (t_2 <= -1e+131)
tmp = (t * (a * -4.0)) - (j * (27.0 * k));
elseif (t_2 <= -5e-25)
tmp = t_3;
elseif (t_2 <= -5e-85)
tmp = t_1;
elseif (t_2 <= 4e-322)
tmp = t_3;
elseif (t_2 <= 2e-137)
tmp = t_1;
elseif (t_2 <= 5e+154)
tmp = t_3;
else
tmp = (b * c) - (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[(N[(18.0 * N[(y * N[(x * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(a * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]}, Block[{t$95$3 = N[(N[(b * c), $MachinePrecision] - N[(4.0 * N[(x * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -1e+131], N[(N[(t * N[(a * -4.0), $MachinePrecision]), $MachinePrecision] - N[(j * N[(27.0 * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, -5e-25], t$95$3, If[LessEqual[t$95$2, -5e-85], t$95$1, If[LessEqual[t$95$2, 4e-322], t$95$3, If[LessEqual[t$95$2, 2e-137], t$95$1, If[LessEqual[t$95$2, 5e+154], t$95$3, N[(N[(b * c), $MachinePrecision] - N[(27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
t_1 := t \cdot \left(18 \cdot \left(y \cdot \left(x \cdot z\right)\right) - a \cdot 4\right)\\
t_2 := \left(j \cdot 27\right) \cdot k\\
t_3 := b \cdot c - 4 \cdot \left(x \cdot i\right)\\
\mathbf{if}\;t_2 \leq -1 \cdot 10^{+131}:\\
\;\;\;\;t \cdot \left(a \cdot -4\right) - j \cdot \left(27 \cdot k\right)\\
\mathbf{elif}\;t_2 \leq -5 \cdot 10^{-25}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;t_2 \leq -5 \cdot 10^{-85}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t_2 \leq 4 \cdot 10^{-322}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;t_2 \leq 2 \cdot 10^{-137}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t_2 \leq 5 \cdot 10^{+154}:\\
\;\;\;\;t_3\\
\mathbf{else}:\\
\;\;\;\;b \cdot c - 27 \cdot \left(j \cdot k\right)\\
\end{array}
\end{array}
if (*.f64 (*.f64 j 27) k) < -9.9999999999999991e130Initial program 81.2%
Taylor expanded in x around 0 71.9%
Taylor expanded in c around 0 70.0%
associate-*r*70.0%
Simplified70.0%
Taylor expanded in j around 0 70.1%
associate-*r*70.0%
*-commutative70.0%
Simplified70.0%
if -9.9999999999999991e130 < (*.f64 (*.f64 j 27) k) < -4.99999999999999962e-25 or -5.0000000000000002e-85 < (*.f64 (*.f64 j 27) k) < 4.00193e-322 or 1.99999999999999996e-137 < (*.f64 (*.f64 j 27) k) < 5.00000000000000004e154Initial program 89.9%
Taylor expanded in t around 0 74.7%
Taylor expanded in j around 0 65.6%
if -4.99999999999999962e-25 < (*.f64 (*.f64 j 27) k) < -5.0000000000000002e-85 or 4.00193e-322 < (*.f64 (*.f64 j 27) k) < 1.99999999999999996e-137Initial program 75.9%
sub-neg75.9%
associate-+l-75.9%
sub-neg75.9%
sub-neg75.9%
distribute-rgt-out--78.9%
associate-*l*78.7%
distribute-lft-neg-in78.7%
cancel-sign-sub78.7%
associate-*l*78.7%
associate-*l*78.7%
Simplified78.7%
Taylor expanded in t around inf 70.3%
if 5.00000000000000004e154 < (*.f64 (*.f64 j 27) k) Initial program 82.1%
Taylor expanded in t around 0 81.5%
Taylor expanded in i around 0 76.8%
Final simplification68.7%
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (- (* b c) (* 27.0 (* j k))))
(t_2 (- (* b c) (* 4.0 (* x i))))
(t_3 (* (* j 27.0) k)))
(if (<= t_3 -2e+131)
t_1
(if (<= t_3 -2000000000.0)
t_2
(if (<= t_3 -1e-61)
(- (* b c) (* 4.0 (* t a)))
(if (<= t_3 5e+154) t_2 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) - (27.0 * (j * k));
double t_2 = (b * c) - (4.0 * (x * i));
double t_3 = (j * 27.0) * k;
double tmp;
if (t_3 <= -2e+131) {
tmp = t_1;
} else if (t_3 <= -2000000000.0) {
tmp = t_2;
} else if (t_3 <= -1e-61) {
tmp = (b * c) - (4.0 * (t * a));
} else if (t_3 <= 5e+154) {
tmp = t_2;
} else {
tmp = t_1;
}
return tmp;
}
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_1 = (b * c) - (27.0d0 * (j * k))
t_2 = (b * c) - (4.0d0 * (x * i))
t_3 = (j * 27.0d0) * k
if (t_3 <= (-2d+131)) then
tmp = t_1
else if (t_3 <= (-2000000000.0d0)) then
tmp = t_2
else if (t_3 <= (-1d-61)) then
tmp = (b * c) - (4.0d0 * (t * a))
else if (t_3 <= 5d+154) then
tmp = t_2
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) - (27.0 * (j * k));
double t_2 = (b * c) - (4.0 * (x * i));
double t_3 = (j * 27.0) * k;
double tmp;
if (t_3 <= -2e+131) {
tmp = t_1;
} else if (t_3 <= -2000000000.0) {
tmp = t_2;
} else if (t_3 <= -1e-61) {
tmp = (b * c) - (4.0 * (t * a));
} else if (t_3 <= 5e+154) {
tmp = t_2;
} 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) - (27.0 * (j * k)) t_2 = (b * c) - (4.0 * (x * i)) t_3 = (j * 27.0) * k tmp = 0 if t_3 <= -2e+131: tmp = t_1 elif t_3 <= -2000000000.0: tmp = t_2 elif t_3 <= -1e-61: tmp = (b * c) - (4.0 * (t * a)) elif t_3 <= 5e+154: tmp = t_2 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(27.0 * Float64(j * k))) t_2 = Float64(Float64(b * c) - Float64(4.0 * Float64(x * i))) t_3 = Float64(Float64(j * 27.0) * k) tmp = 0.0 if (t_3 <= -2e+131) tmp = t_1; elseif (t_3 <= -2000000000.0) tmp = t_2; elseif (t_3 <= -1e-61) tmp = Float64(Float64(b * c) - Float64(4.0 * Float64(t * a))); elseif (t_3 <= 5e+154) tmp = t_2; 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) - (27.0 * (j * k));
t_2 = (b * c) - (4.0 * (x * i));
t_3 = (j * 27.0) * k;
tmp = 0.0;
if (t_3 <= -2e+131)
tmp = t_1;
elseif (t_3 <= -2000000000.0)
tmp = t_2;
elseif (t_3 <= -1e-61)
tmp = (b * c) - (4.0 * (t * a));
elseif (t_3 <= 5e+154)
tmp = t_2;
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[(27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(b * c), $MachinePrecision] - N[(4.0 * N[(x * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]}, If[LessEqual[t$95$3, -2e+131], t$95$1, If[LessEqual[t$95$3, -2000000000.0], t$95$2, If[LessEqual[t$95$3, -1e-61], N[(N[(b * c), $MachinePrecision] - N[(4.0 * N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$3, 5e+154], t$95$2, 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 - 27 \cdot \left(j \cdot k\right)\\
t_2 := b \cdot c - 4 \cdot \left(x \cdot i\right)\\
t_3 := \left(j \cdot 27\right) \cdot k\\
\mathbf{if}\;t_3 \leq -2 \cdot 10^{+131}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t_3 \leq -2000000000:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t_3 \leq -1 \cdot 10^{-61}:\\
\;\;\;\;b \cdot c - 4 \cdot \left(t \cdot a\right)\\
\mathbf{elif}\;t_3 \leq 5 \cdot 10^{+154}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if (*.f64 (*.f64 j 27) k) < -1.9999999999999998e131 or 5.00000000000000004e154 < (*.f64 (*.f64 j 27) k) Initial program 81.3%
Taylor expanded in t around 0 75.6%
Taylor expanded in i around 0 70.4%
if -1.9999999999999998e131 < (*.f64 (*.f64 j 27) k) < -2e9 or -1e-61 < (*.f64 (*.f64 j 27) k) < 5.00000000000000004e154Initial program 87.7%
Taylor expanded in t around 0 68.5%
Taylor expanded in j around 0 60.7%
if -2e9 < (*.f64 (*.f64 j 27) k) < -1e-61Initial program 80.3%
Taylor expanded in x around 0 80.4%
Taylor expanded in j around 0 80.3%
Final simplification64.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 (* (* j 27.0) k)) (t_2 (- (* b c) (* 4.0 (* x i)))))
(if (<= t_1 -1e+131)
(- (* t (* a -4.0)) (* j (* 27.0 k)))
(if (<= t_1 -2000000000.0)
t_2
(if (<= t_1 -1e-61)
(- (* b c) (* 4.0 (* t a)))
(if (<= t_1 5e+154) t_2 (- (* 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 t_1 = (j * 27.0) * k;
double t_2 = (b * c) - (4.0 * (x * i));
double tmp;
if (t_1 <= -1e+131) {
tmp = (t * (a * -4.0)) - (j * (27.0 * k));
} else if (t_1 <= -2000000000.0) {
tmp = t_2;
} else if (t_1 <= -1e-61) {
tmp = (b * c) - (4.0 * (t * a));
} else if (t_1 <= 5e+154) {
tmp = t_2;
} else {
tmp = (b * c) - (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 = (j * 27.0d0) * k
t_2 = (b * c) - (4.0d0 * (x * i))
if (t_1 <= (-1d+131)) then
tmp = (t * (a * (-4.0d0))) - (j * (27.0d0 * k))
else if (t_1 <= (-2000000000.0d0)) then
tmp = t_2
else if (t_1 <= (-1d-61)) then
tmp = (b * c) - (4.0d0 * (t * a))
else if (t_1 <= 5d+154) then
tmp = t_2
else
tmp = (b * c) - (27.0d0 * (j * k))
end if
code = tmp
end function
assert y < z;
assert j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = (j * 27.0) * k;
double t_2 = (b * c) - (4.0 * (x * i));
double tmp;
if (t_1 <= -1e+131) {
tmp = (t * (a * -4.0)) - (j * (27.0 * k));
} else if (t_1 <= -2000000000.0) {
tmp = t_2;
} else if (t_1 <= -1e-61) {
tmp = (b * c) - (4.0 * (t * a));
} else if (t_1 <= 5e+154) {
tmp = t_2;
} else {
tmp = (b * c) - (27.0 * (j * k));
}
return tmp;
}
[y, z] = sort([y, z]) [j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): t_1 = (j * 27.0) * k t_2 = (b * c) - (4.0 * (x * i)) tmp = 0 if t_1 <= -1e+131: tmp = (t * (a * -4.0)) - (j * (27.0 * k)) elif t_1 <= -2000000000.0: tmp = t_2 elif t_1 <= -1e-61: tmp = (b * c) - (4.0 * (t * a)) elif t_1 <= 5e+154: tmp = t_2 else: tmp = (b * c) - (27.0 * (j * k)) return tmp
y, z = sort([y, z]) j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(Float64(j * 27.0) * k) t_2 = Float64(Float64(b * c) - Float64(4.0 * Float64(x * i))) tmp = 0.0 if (t_1 <= -1e+131) tmp = Float64(Float64(t * Float64(a * -4.0)) - Float64(j * Float64(27.0 * k))); elseif (t_1 <= -2000000000.0) tmp = t_2; elseif (t_1 <= -1e-61) tmp = Float64(Float64(b * c) - Float64(4.0 * Float64(t * a))); elseif (t_1 <= 5e+154) tmp = t_2; else tmp = Float64(Float64(b * c) - Float64(27.0 * Float64(j * k))); end return tmp end
y, z = num2cell(sort([y, z])){:}
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
t_1 = (j * 27.0) * k;
t_2 = (b * c) - (4.0 * (x * i));
tmp = 0.0;
if (t_1 <= -1e+131)
tmp = (t * (a * -4.0)) - (j * (27.0 * k));
elseif (t_1 <= -2000000000.0)
tmp = t_2;
elseif (t_1 <= -1e-61)
tmp = (b * c) - (4.0 * (t * a));
elseif (t_1 <= 5e+154)
tmp = t_2;
else
tmp = (b * c) - (27.0 * (j * k));
end
tmp_2 = tmp;
end
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]}, Block[{t$95$2 = N[(N[(b * c), $MachinePrecision] - N[(4.0 * N[(x * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -1e+131], N[(N[(t * N[(a * -4.0), $MachinePrecision]), $MachinePrecision] - N[(j * N[(27.0 * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, -2000000000.0], t$95$2, If[LessEqual[t$95$1, -1e-61], N[(N[(b * c), $MachinePrecision] - N[(4.0 * N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 5e+154], t$95$2, N[(N[(b * c), $MachinePrecision] - N[(27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
t_1 := \left(j \cdot 27\right) \cdot k\\
t_2 := b \cdot c - 4 \cdot \left(x \cdot i\right)\\
\mathbf{if}\;t_1 \leq -1 \cdot 10^{+131}:\\
\;\;\;\;t \cdot \left(a \cdot -4\right) - j \cdot \left(27 \cdot k\right)\\
\mathbf{elif}\;t_1 \leq -2000000000:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t_1 \leq -1 \cdot 10^{-61}:\\
\;\;\;\;b \cdot c - 4 \cdot \left(t \cdot a\right)\\
\mathbf{elif}\;t_1 \leq 5 \cdot 10^{+154}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;b \cdot c - 27 \cdot \left(j \cdot k\right)\\
\end{array}
\end{array}
if (*.f64 (*.f64 j 27) k) < -9.9999999999999991e130Initial program 81.2%
Taylor expanded in x around 0 71.9%
Taylor expanded in c around 0 70.0%
associate-*r*70.0%
Simplified70.0%
Taylor expanded in j around 0 70.1%
associate-*r*70.0%
*-commutative70.0%
Simplified70.0%
if -9.9999999999999991e130 < (*.f64 (*.f64 j 27) k) < -2e9 or -1e-61 < (*.f64 (*.f64 j 27) k) < 5.00000000000000004e154Initial program 87.6%
Taylor expanded in t around 0 69.0%
Taylor expanded in j around 0 61.1%
if -2e9 < (*.f64 (*.f64 j 27) k) < -1e-61Initial program 80.3%
Taylor expanded in x around 0 80.4%
Taylor expanded in j around 0 80.3%
if 5.00000000000000004e154 < (*.f64 (*.f64 j 27) k) Initial program 82.1%
Taylor expanded in t around 0 81.5%
Taylor expanded in i around 0 76.8%
Final simplification65.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 (* j (* 27.0 k))))
(if (<= i 3.3e+131)
(-
(+ (* t (- (* (* x 18.0) (* y z)) (* a 4.0))) (* b c))
(+ (* x (* 4.0 i)) t_1))
(- (- (* b c) (* 4.0 (* x i))) t_1))))assert(y < z);
assert(j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = j * (27.0 * k);
double tmp;
if (i <= 3.3e+131) {
tmp = ((t * (((x * 18.0) * (y * z)) - (a * 4.0))) + (b * c)) - ((x * (4.0 * i)) + t_1);
} else {
tmp = ((b * c) - (4.0 * (x * i))) - t_1;
}
return tmp;
}
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: tmp
t_1 = j * (27.0d0 * k)
if (i <= 3.3d+131) then
tmp = ((t * (((x * 18.0d0) * (y * z)) - (a * 4.0d0))) + (b * c)) - ((x * (4.0d0 * i)) + t_1)
else
tmp = ((b * c) - (4.0d0 * (x * i))) - t_1
end if
code = tmp
end function
assert y < z;
assert j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = j * (27.0 * k);
double tmp;
if (i <= 3.3e+131) {
tmp = ((t * (((x * 18.0) * (y * z)) - (a * 4.0))) + (b * c)) - ((x * (4.0 * i)) + t_1);
} else {
tmp = ((b * c) - (4.0 * (x * i))) - t_1;
}
return tmp;
}
[y, z] = sort([y, z]) [j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): t_1 = j * (27.0 * k) tmp = 0 if i <= 3.3e+131: tmp = ((t * (((x * 18.0) * (y * z)) - (a * 4.0))) + (b * c)) - ((x * (4.0 * i)) + t_1) else: tmp = ((b * c) - (4.0 * (x * i))) - t_1 return tmp
y, z = sort([y, z]) j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(j * Float64(27.0 * k)) tmp = 0.0 if (i <= 3.3e+131) 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)) + t_1)); else tmp = Float64(Float64(Float64(b * c) - Float64(4.0 * Float64(x * i))) - t_1); end return tmp end
y, z = num2cell(sort([y, z])){:}
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
t_1 = j * (27.0 * k);
tmp = 0.0;
if (i <= 3.3e+131)
tmp = ((t * (((x * 18.0) * (y * z)) - (a * 4.0))) + (b * c)) - ((x * (4.0 * i)) + t_1);
else
tmp = ((b * c) - (4.0 * (x * i))) - t_1;
end
tmp_2 = tmp;
end
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(j * N[(27.0 * k), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[i, 3.3e+131], 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] + t$95$1), $MachinePrecision]), $MachinePrecision], N[(N[(N[(b * c), $MachinePrecision] - N[(4.0 * N[(x * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision]]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
t_1 := j \cdot \left(27 \cdot k\right)\\
\mathbf{if}\;i \leq 3.3 \cdot 10^{+131}:\\
\;\;\;\;\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) + t_1\right)\\
\mathbf{else}:\\
\;\;\;\;\left(b \cdot c - 4 \cdot \left(x \cdot i\right)\right) - t_1\\
\end{array}
\end{array}
if i < 3.2999999999999998e131Initial program 88.5%
sub-neg88.5%
associate-+l-88.5%
sub-neg88.5%
sub-neg88.5%
distribute-rgt-out--90.0%
associate-*l*90.8%
distribute-lft-neg-in90.8%
cancel-sign-sub90.8%
associate-*l*90.8%
associate-*l*90.9%
Simplified90.9%
if 3.2999999999999998e131 < i Initial program 72.0%
Taylor expanded in t around 0 76.2%
Taylor expanded in j around 0 76.2%
associate-*r*32.9%
*-commutative32.9%
Simplified76.2%
Final simplification88.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 (* (* j 27.0) k)))
(if (<= a -8.8e+207)
(- (- (* b c) (* 4.0 (* t a))) t_1)
(if (<= a 5.4e+237)
(- (- (+ (* b c) (* 18.0 (* y (* t (* x z))))) (* 4.0 (* x i))) t_1)
(- (* t (- (* a -4.0) (* -18.0 (* y (* x z))))) t_1)))))assert(y < z);
assert(j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = (j * 27.0) * k;
double tmp;
if (a <= -8.8e+207) {
tmp = ((b * c) - (4.0 * (t * a))) - t_1;
} else if (a <= 5.4e+237) {
tmp = (((b * c) + (18.0 * (y * (t * (x * z))))) - (4.0 * (x * i))) - t_1;
} else {
tmp = (t * ((a * -4.0) - (-18.0 * (y * (x * z))))) - t_1;
}
return tmp;
}
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: tmp
t_1 = (j * 27.0d0) * k
if (a <= (-8.8d+207)) then
tmp = ((b * c) - (4.0d0 * (t * a))) - t_1
else if (a <= 5.4d+237) then
tmp = (((b * c) + (18.0d0 * (y * (t * (x * z))))) - (4.0d0 * (x * i))) - t_1
else
tmp = (t * ((a * (-4.0d0)) - ((-18.0d0) * (y * (x * z))))) - t_1
end if
code = tmp
end function
assert y < z;
assert j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = (j * 27.0) * k;
double tmp;
if (a <= -8.8e+207) {
tmp = ((b * c) - (4.0 * (t * a))) - t_1;
} else if (a <= 5.4e+237) {
tmp = (((b * c) + (18.0 * (y * (t * (x * z))))) - (4.0 * (x * i))) - t_1;
} else {
tmp = (t * ((a * -4.0) - (-18.0 * (y * (x * z))))) - t_1;
}
return tmp;
}
[y, z] = sort([y, z]) [j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): t_1 = (j * 27.0) * k tmp = 0 if a <= -8.8e+207: tmp = ((b * c) - (4.0 * (t * a))) - t_1 elif a <= 5.4e+237: tmp = (((b * c) + (18.0 * (y * (t * (x * z))))) - (4.0 * (x * i))) - t_1 else: tmp = (t * ((a * -4.0) - (-18.0 * (y * (x * z))))) - t_1 return tmp
y, z = sort([y, z]) j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(Float64(j * 27.0) * k) tmp = 0.0 if (a <= -8.8e+207) tmp = Float64(Float64(Float64(b * c) - Float64(4.0 * Float64(t * a))) - t_1); elseif (a <= 5.4e+237) tmp = Float64(Float64(Float64(Float64(b * c) + Float64(18.0 * Float64(y * Float64(t * Float64(x * z))))) - Float64(4.0 * Float64(x * i))) - t_1); else tmp = Float64(Float64(t * Float64(Float64(a * -4.0) - Float64(-18.0 * Float64(y * Float64(x * z))))) - t_1); end return tmp end
y, z = num2cell(sort([y, z])){:}
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
t_1 = (j * 27.0) * k;
tmp = 0.0;
if (a <= -8.8e+207)
tmp = ((b * c) - (4.0 * (t * a))) - t_1;
elseif (a <= 5.4e+237)
tmp = (((b * c) + (18.0 * (y * (t * (x * z))))) - (4.0 * (x * i))) - t_1;
else
tmp = (t * ((a * -4.0) - (-18.0 * (y * (x * z))))) - t_1;
end
tmp_2 = tmp;
end
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]}, If[LessEqual[a, -8.8e+207], N[(N[(N[(b * c), $MachinePrecision] - N[(4.0 * N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], If[LessEqual[a, 5.4e+237], N[(N[(N[(N[(b * c), $MachinePrecision] + N[(18.0 * N[(y * N[(t * N[(x * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(4.0 * N[(x * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], N[(N[(t * N[(N[(a * -4.0), $MachinePrecision] - N[(-18.0 * N[(y * N[(x * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision]]]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
t_1 := \left(j \cdot 27\right) \cdot k\\
\mathbf{if}\;a \leq -8.8 \cdot 10^{+207}:\\
\;\;\;\;\left(b \cdot c - 4 \cdot \left(t \cdot a\right)\right) - t_1\\
\mathbf{elif}\;a \leq 5.4 \cdot 10^{+237}:\\
\;\;\;\;\left(\left(b \cdot c + 18 \cdot \left(y \cdot \left(t \cdot \left(x \cdot z\right)\right)\right)\right) - 4 \cdot \left(x \cdot i\right)\right) - t_1\\
\mathbf{else}:\\
\;\;\;\;t \cdot \left(a \cdot -4 - -18 \cdot \left(y \cdot \left(x \cdot z\right)\right)\right) - t_1\\
\end{array}
\end{array}
if a < -8.80000000000000034e207Initial program 78.7%
Taylor expanded in x around 0 71.9%
if -8.80000000000000034e207 < a < 5.3999999999999999e237Initial program 86.6%
Taylor expanded in a around 0 84.9%
if 5.3999999999999999e237 < a Initial program 78.6%
Taylor expanded in t around -inf 85.7%
Final simplification83.5%
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (- (- (* b c) (* 4.0 (* t a))) (* (* j 27.0) k)))
(t_2 (* x (- (* 18.0 (* y (* z t))) (* 4.0 i)))))
(if (<= x -2.95e+26)
t_2
(if (<= x 4.9e-175)
t_1
(if (<= x 3.6e-90)
(- (- (* b c) (* 4.0 (* x i))) (* j (* 27.0 k)))
(if (or (<= x 1.95e+18) (and (not (<= x 1.52e+66)) (<= x 2.8e+136)))
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 = ((b * c) - (4.0 * (t * a))) - ((j * 27.0) * k);
double t_2 = x * ((18.0 * (y * (z * t))) - (4.0 * i));
double tmp;
if (x <= -2.95e+26) {
tmp = t_2;
} else if (x <= 4.9e-175) {
tmp = t_1;
} else if (x <= 3.6e-90) {
tmp = ((b * c) - (4.0 * (x * i))) - (j * (27.0 * k));
} else if ((x <= 1.95e+18) || (!(x <= 1.52e+66) && (x <= 2.8e+136))) {
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 = ((b * c) - (4.0d0 * (t * a))) - ((j * 27.0d0) * k)
t_2 = x * ((18.0d0 * (y * (z * t))) - (4.0d0 * i))
if (x <= (-2.95d+26)) then
tmp = t_2
else if (x <= 4.9d-175) then
tmp = t_1
else if (x <= 3.6d-90) then
tmp = ((b * c) - (4.0d0 * (x * i))) - (j * (27.0d0 * k))
else if ((x <= 1.95d+18) .or. (.not. (x <= 1.52d+66)) .and. (x <= 2.8d+136)) 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 = ((b * c) - (4.0 * (t * a))) - ((j * 27.0) * k);
double t_2 = x * ((18.0 * (y * (z * t))) - (4.0 * i));
double tmp;
if (x <= -2.95e+26) {
tmp = t_2;
} else if (x <= 4.9e-175) {
tmp = t_1;
} else if (x <= 3.6e-90) {
tmp = ((b * c) - (4.0 * (x * i))) - (j * (27.0 * k));
} else if ((x <= 1.95e+18) || (!(x <= 1.52e+66) && (x <= 2.8e+136))) {
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 = ((b * c) - (4.0 * (t * a))) - ((j * 27.0) * k) t_2 = x * ((18.0 * (y * (z * t))) - (4.0 * i)) tmp = 0 if x <= -2.95e+26: tmp = t_2 elif x <= 4.9e-175: tmp = t_1 elif x <= 3.6e-90: tmp = ((b * c) - (4.0 * (x * i))) - (j * (27.0 * k)) elif (x <= 1.95e+18) or (not (x <= 1.52e+66) and (x <= 2.8e+136)): tmp = t_1 else: tmp = t_2 return tmp
y, z = sort([y, z]) j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(Float64(Float64(b * c) - Float64(4.0 * Float64(t * a))) - Float64(Float64(j * 27.0) * k)) t_2 = Float64(x * Float64(Float64(18.0 * Float64(y * Float64(z * t))) - Float64(4.0 * i))) tmp = 0.0 if (x <= -2.95e+26) tmp = t_2; elseif (x <= 4.9e-175) tmp = t_1; elseif (x <= 3.6e-90) tmp = Float64(Float64(Float64(b * c) - Float64(4.0 * Float64(x * i))) - Float64(j * Float64(27.0 * k))); elseif ((x <= 1.95e+18) || (!(x <= 1.52e+66) && (x <= 2.8e+136))) 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 = ((b * c) - (4.0 * (t * a))) - ((j * 27.0) * k);
t_2 = x * ((18.0 * (y * (z * t))) - (4.0 * i));
tmp = 0.0;
if (x <= -2.95e+26)
tmp = t_2;
elseif (x <= 4.9e-175)
tmp = t_1;
elseif (x <= 3.6e-90)
tmp = ((b * c) - (4.0 * (x * i))) - (j * (27.0 * k));
elseif ((x <= 1.95e+18) || (~((x <= 1.52e+66)) && (x <= 2.8e+136)))
tmp = t_1;
else
tmp = t_2;
end
tmp_2 = tmp;
end
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(N[(N[(b * c), $MachinePrecision] - N[(4.0 * N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x * N[(N[(18.0 * N[(y * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(4.0 * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -2.95e+26], t$95$2, If[LessEqual[x, 4.9e-175], t$95$1, If[LessEqual[x, 3.6e-90], N[(N[(N[(b * c), $MachinePrecision] - N[(4.0 * N[(x * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(j * N[(27.0 * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[x, 1.95e+18], And[N[Not[LessEqual[x, 1.52e+66]], $MachinePrecision], LessEqual[x, 2.8e+136]]], 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 := \left(b \cdot c - 4 \cdot \left(t \cdot a\right)\right) - \left(j \cdot 27\right) \cdot k\\
t_2 := x \cdot \left(18 \cdot \left(y \cdot \left(z \cdot t\right)\right) - 4 \cdot i\right)\\
\mathbf{if}\;x \leq -2.95 \cdot 10^{+26}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x \leq 4.9 \cdot 10^{-175}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 3.6 \cdot 10^{-90}:\\
\;\;\;\;\left(b \cdot c - 4 \cdot \left(x \cdot i\right)\right) - j \cdot \left(27 \cdot k\right)\\
\mathbf{elif}\;x \leq 1.95 \cdot 10^{+18} \lor \neg \left(x \leq 1.52 \cdot 10^{+66}\right) \land x \leq 2.8 \cdot 10^{+136}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if x < -2.95000000000000015e26 or 1.95e18 < x < 1.52000000000000004e66 or 2.8000000000000002e136 < x Initial program 68.6%
sub-neg68.6%
associate-+l-68.6%
sub-neg68.6%
sub-neg68.6%
distribute-rgt-out--71.6%
associate-*l*77.2%
distribute-lft-neg-in77.2%
cancel-sign-sub77.2%
associate-*l*77.2%
associate-*l*77.2%
Simplified77.2%
Taylor expanded in x around inf 79.6%
if -2.95000000000000015e26 < x < 4.89999999999999998e-175 or 3.59999999999999981e-90 < x < 1.95e18 or 1.52000000000000004e66 < x < 2.8000000000000002e136Initial program 95.7%
Taylor expanded in x around 0 83.3%
if 4.89999999999999998e-175 < x < 3.59999999999999981e-90Initial program 99.8%
Taylor expanded in t around 0 92.6%
Taylor expanded in j around 0 92.6%
associate-*r*25.7%
*-commutative25.7%
Simplified92.7%
Final simplification82.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 (- (* b c) (* 4.0 (* x i))))
(t_2 (* (* j 27.0) k))
(t_3 (- (* t (- (* a -4.0) (* -18.0 (* y (* x z))))) t_2)))
(if (<= t -1.6e+90)
t_3
(if (<= t 2.4e-111)
(- t_1 t_2)
(if (or (<= t 2.3e-27) (not (<= t 1.15e+27)))
t_3
(- t_1 (* 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) - (4.0 * (x * i));
double t_2 = (j * 27.0) * k;
double t_3 = (t * ((a * -4.0) - (-18.0 * (y * (x * z))))) - t_2;
double tmp;
if (t <= -1.6e+90) {
tmp = t_3;
} else if (t <= 2.4e-111) {
tmp = t_1 - t_2;
} else if ((t <= 2.3e-27) || !(t <= 1.15e+27)) {
tmp = t_3;
} else {
tmp = t_1 - (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) :: t_2
real(8) :: t_3
real(8) :: tmp
t_1 = (b * c) - (4.0d0 * (x * i))
t_2 = (j * 27.0d0) * k
t_3 = (t * ((a * (-4.0d0)) - ((-18.0d0) * (y * (x * z))))) - t_2
if (t <= (-1.6d+90)) then
tmp = t_3
else if (t <= 2.4d-111) then
tmp = t_1 - t_2
else if ((t <= 2.3d-27) .or. (.not. (t <= 1.15d+27))) then
tmp = t_3
else
tmp = t_1 - (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) - (4.0 * (x * i));
double t_2 = (j * 27.0) * k;
double t_3 = (t * ((a * -4.0) - (-18.0 * (y * (x * z))))) - t_2;
double tmp;
if (t <= -1.6e+90) {
tmp = t_3;
} else if (t <= 2.4e-111) {
tmp = t_1 - t_2;
} else if ((t <= 2.3e-27) || !(t <= 1.15e+27)) {
tmp = t_3;
} else {
tmp = t_1 - (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) - (4.0 * (x * i)) t_2 = (j * 27.0) * k t_3 = (t * ((a * -4.0) - (-18.0 * (y * (x * z))))) - t_2 tmp = 0 if t <= -1.6e+90: tmp = t_3 elif t <= 2.4e-111: tmp = t_1 - t_2 elif (t <= 2.3e-27) or not (t <= 1.15e+27): tmp = t_3 else: tmp = t_1 - (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(4.0 * Float64(x * i))) t_2 = Float64(Float64(j * 27.0) * k) t_3 = Float64(Float64(t * Float64(Float64(a * -4.0) - Float64(-18.0 * Float64(y * Float64(x * z))))) - t_2) tmp = 0.0 if (t <= -1.6e+90) tmp = t_3; elseif (t <= 2.4e-111) tmp = Float64(t_1 - t_2); elseif ((t <= 2.3e-27) || !(t <= 1.15e+27)) tmp = t_3; else tmp = Float64(t_1 - Float64(j * Float64(27.0 * k))); end return tmp end
y, z = num2cell(sort([y, z])){:}
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
t_1 = (b * c) - (4.0 * (x * i));
t_2 = (j * 27.0) * k;
t_3 = (t * ((a * -4.0) - (-18.0 * (y * (x * z))))) - t_2;
tmp = 0.0;
if (t <= -1.6e+90)
tmp = t_3;
elseif (t <= 2.4e-111)
tmp = t_1 - t_2;
elseif ((t <= 2.3e-27) || ~((t <= 1.15e+27)))
tmp = t_3;
else
tmp = t_1 - (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[(4.0 * N[(x * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]}, Block[{t$95$3 = N[(N[(t * N[(N[(a * -4.0), $MachinePrecision] - N[(-18.0 * N[(y * N[(x * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$2), $MachinePrecision]}, If[LessEqual[t, -1.6e+90], t$95$3, If[LessEqual[t, 2.4e-111], N[(t$95$1 - t$95$2), $MachinePrecision], If[Or[LessEqual[t, 2.3e-27], N[Not[LessEqual[t, 1.15e+27]], $MachinePrecision]], t$95$3, N[(t$95$1 - N[(j * N[(27.0 * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
t_1 := b \cdot c - 4 \cdot \left(x \cdot i\right)\\
t_2 := \left(j \cdot 27\right) \cdot k\\
t_3 := t \cdot \left(a \cdot -4 - -18 \cdot \left(y \cdot \left(x \cdot z\right)\right)\right) - t_2\\
\mathbf{if}\;t \leq -1.6 \cdot 10^{+90}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;t \leq 2.4 \cdot 10^{-111}:\\
\;\;\;\;t_1 - t_2\\
\mathbf{elif}\;t \leq 2.3 \cdot 10^{-27} \lor \neg \left(t \leq 1.15 \cdot 10^{+27}\right):\\
\;\;\;\;t_3\\
\mathbf{else}:\\
\;\;\;\;t_1 - j \cdot \left(27 \cdot k\right)\\
\end{array}
\end{array}
if t < -1.59999999999999999e90 or 2.4000000000000001e-111 < t < 2.2999999999999999e-27 or 1.15e27 < t Initial program 82.2%
Taylor expanded in t around -inf 77.9%
if -1.59999999999999999e90 < t < 2.4000000000000001e-111Initial program 86.3%
Taylor expanded in t around 0 84.4%
if 2.2999999999999999e-27 < t < 1.15e27Initial program 100.0%
Taylor expanded in t around 0 92.5%
Taylor expanded in j around 0 92.5%
associate-*r*33.1%
*-commutative33.1%
Simplified92.5%
Final simplification82.1%
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (* (* j 27.0) k)))
(if (<= t 1.7e+166)
(- (- (+ (* b c) (* 18.0 (* y (* x (* z t))))) (* 4.0 (* x i))) t_1)
(- (* t (- (* a -4.0) (* -18.0 (* y (* x z))))) t_1))))assert(y < z);
assert(j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = (j * 27.0) * k;
double tmp;
if (t <= 1.7e+166) {
tmp = (((b * c) + (18.0 * (y * (x * (z * t))))) - (4.0 * (x * i))) - t_1;
} else {
tmp = (t * ((a * -4.0) - (-18.0 * (y * (x * z))))) - t_1;
}
return tmp;
}
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: tmp
t_1 = (j * 27.0d0) * k
if (t <= 1.7d+166) then
tmp = (((b * c) + (18.0d0 * (y * (x * (z * t))))) - (4.0d0 * (x * i))) - t_1
else
tmp = (t * ((a * (-4.0d0)) - ((-18.0d0) * (y * (x * z))))) - t_1
end if
code = tmp
end function
assert y < z;
assert j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = (j * 27.0) * k;
double tmp;
if (t <= 1.7e+166) {
tmp = (((b * c) + (18.0 * (y * (x * (z * t))))) - (4.0 * (x * i))) - t_1;
} else {
tmp = (t * ((a * -4.0) - (-18.0 * (y * (x * z))))) - t_1;
}
return tmp;
}
[y, z] = sort([y, z]) [j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): t_1 = (j * 27.0) * k tmp = 0 if t <= 1.7e+166: tmp = (((b * c) + (18.0 * (y * (x * (z * t))))) - (4.0 * (x * i))) - t_1 else: tmp = (t * ((a * -4.0) - (-18.0 * (y * (x * z))))) - t_1 return tmp
y, z = sort([y, z]) j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(Float64(j * 27.0) * k) tmp = 0.0 if (t <= 1.7e+166) tmp = Float64(Float64(Float64(Float64(b * c) + Float64(18.0 * Float64(y * Float64(x * Float64(z * t))))) - Float64(4.0 * Float64(x * i))) - t_1); else tmp = Float64(Float64(t * Float64(Float64(a * -4.0) - Float64(-18.0 * Float64(y * Float64(x * z))))) - t_1); end return tmp end
y, z = num2cell(sort([y, z])){:}
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
t_1 = (j * 27.0) * k;
tmp = 0.0;
if (t <= 1.7e+166)
tmp = (((b * c) + (18.0 * (y * (x * (z * t))))) - (4.0 * (x * i))) - t_1;
else
tmp = (t * ((a * -4.0) - (-18.0 * (y * (x * z))))) - t_1;
end
tmp_2 = tmp;
end
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]}, If[LessEqual[t, 1.7e+166], N[(N[(N[(N[(b * c), $MachinePrecision] + N[(18.0 * N[(y * N[(x * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(4.0 * N[(x * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], N[(N[(t * N[(N[(a * -4.0), $MachinePrecision] - N[(-18.0 * N[(y * N[(x * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision]]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
t_1 := \left(j \cdot 27\right) \cdot k\\
\mathbf{if}\;t \leq 1.7 \cdot 10^{+166}:\\
\;\;\;\;\left(\left(b \cdot c + 18 \cdot \left(y \cdot \left(x \cdot \left(z \cdot t\right)\right)\right)\right) - 4 \cdot \left(x \cdot i\right)\right) - t_1\\
\mathbf{else}:\\
\;\;\;\;t \cdot \left(a \cdot -4 - -18 \cdot \left(y \cdot \left(x \cdot z\right)\right)\right) - t_1\\
\end{array}
\end{array}
if t < 1.7e166Initial program 85.9%
Taylor expanded in a around 0 81.5%
pow181.5%
*-commutative81.5%
Applied egg-rr81.5%
unpow181.5%
*-commutative81.5%
associate-*r*81.1%
Simplified81.1%
if 1.7e166 < t Initial program 79.0%
Taylor expanded in t around -inf 79.5%
Final simplification80.9%
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (- (* b c) (* 4.0 (* t a))))
(t_2 (* x (- (* 18.0 (* y (* z t))) (* 4.0 i)))))
(if (<= x -1.35e+25)
t_2
(if (<= x -1.65e-71)
(- (* 18.0 (* y (* t (* x z)))) (* (* j 27.0) k))
(if (<= x -9.8e-142)
t_1
(if (<= x 4.8e+14)
(- (* b c) (* 27.0 (* j k)))
(if (or (<= x 4.1e+67) (not (<= x 5.5e+96))) t_2 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) - (4.0 * (t * a));
double t_2 = x * ((18.0 * (y * (z * t))) - (4.0 * i));
double tmp;
if (x <= -1.35e+25) {
tmp = t_2;
} else if (x <= -1.65e-71) {
tmp = (18.0 * (y * (t * (x * z)))) - ((j * 27.0) * k);
} else if (x <= -9.8e-142) {
tmp = t_1;
} else if (x <= 4.8e+14) {
tmp = (b * c) - (27.0 * (j * k));
} else if ((x <= 4.1e+67) || !(x <= 5.5e+96)) {
tmp = t_2;
} else {
tmp = t_1;
}
return tmp;
}
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (b * c) - (4.0d0 * (t * a))
t_2 = x * ((18.0d0 * (y * (z * t))) - (4.0d0 * i))
if (x <= (-1.35d+25)) then
tmp = t_2
else if (x <= (-1.65d-71)) then
tmp = (18.0d0 * (y * (t * (x * z)))) - ((j * 27.0d0) * k)
else if (x <= (-9.8d-142)) then
tmp = t_1
else if (x <= 4.8d+14) then
tmp = (b * c) - (27.0d0 * (j * k))
else if ((x <= 4.1d+67) .or. (.not. (x <= 5.5d+96))) then
tmp = t_2
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) - (4.0 * (t * a));
double t_2 = x * ((18.0 * (y * (z * t))) - (4.0 * i));
double tmp;
if (x <= -1.35e+25) {
tmp = t_2;
} else if (x <= -1.65e-71) {
tmp = (18.0 * (y * (t * (x * z)))) - ((j * 27.0) * k);
} else if (x <= -9.8e-142) {
tmp = t_1;
} else if (x <= 4.8e+14) {
tmp = (b * c) - (27.0 * (j * k));
} else if ((x <= 4.1e+67) || !(x <= 5.5e+96)) {
tmp = t_2;
} 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) - (4.0 * (t * a)) t_2 = x * ((18.0 * (y * (z * t))) - (4.0 * i)) tmp = 0 if x <= -1.35e+25: tmp = t_2 elif x <= -1.65e-71: tmp = (18.0 * (y * (t * (x * z)))) - ((j * 27.0) * k) elif x <= -9.8e-142: tmp = t_1 elif x <= 4.8e+14: tmp = (b * c) - (27.0 * (j * k)) elif (x <= 4.1e+67) or not (x <= 5.5e+96): tmp = t_2 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(4.0 * Float64(t * a))) t_2 = Float64(x * Float64(Float64(18.0 * Float64(y * Float64(z * t))) - Float64(4.0 * i))) tmp = 0.0 if (x <= -1.35e+25) tmp = t_2; elseif (x <= -1.65e-71) tmp = Float64(Float64(18.0 * Float64(y * Float64(t * Float64(x * z)))) - Float64(Float64(j * 27.0) * k)); elseif (x <= -9.8e-142) tmp = t_1; elseif (x <= 4.8e+14) tmp = Float64(Float64(b * c) - Float64(27.0 * Float64(j * k))); elseif ((x <= 4.1e+67) || !(x <= 5.5e+96)) tmp = t_2; 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) - (4.0 * (t * a));
t_2 = x * ((18.0 * (y * (z * t))) - (4.0 * i));
tmp = 0.0;
if (x <= -1.35e+25)
tmp = t_2;
elseif (x <= -1.65e-71)
tmp = (18.0 * (y * (t * (x * z)))) - ((j * 27.0) * k);
elseif (x <= -9.8e-142)
tmp = t_1;
elseif (x <= 4.8e+14)
tmp = (b * c) - (27.0 * (j * k));
elseif ((x <= 4.1e+67) || ~((x <= 5.5e+96)))
tmp = t_2;
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[(4.0 * N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x * N[(N[(18.0 * N[(y * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(4.0 * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.35e+25], t$95$2, If[LessEqual[x, -1.65e-71], N[(N[(18.0 * N[(y * N[(t * N[(x * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -9.8e-142], t$95$1, If[LessEqual[x, 4.8e+14], N[(N[(b * c), $MachinePrecision] - N[(27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[x, 4.1e+67], N[Not[LessEqual[x, 5.5e+96]], $MachinePrecision]], t$95$2, 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 - 4 \cdot \left(t \cdot a\right)\\
t_2 := x \cdot \left(18 \cdot \left(y \cdot \left(z \cdot t\right)\right) - 4 \cdot i\right)\\
\mathbf{if}\;x \leq -1.35 \cdot 10^{+25}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x \leq -1.65 \cdot 10^{-71}:\\
\;\;\;\;18 \cdot \left(y \cdot \left(t \cdot \left(x \cdot z\right)\right)\right) - \left(j \cdot 27\right) \cdot k\\
\mathbf{elif}\;x \leq -9.8 \cdot 10^{-142}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 4.8 \cdot 10^{+14}:\\
\;\;\;\;b \cdot c - 27 \cdot \left(j \cdot k\right)\\
\mathbf{elif}\;x \leq 4.1 \cdot 10^{+67} \lor \neg \left(x \leq 5.5 \cdot 10^{+96}\right):\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if x < -1.35e25 or 4.8e14 < x < 4.09999999999999979e67 or 5.5000000000000002e96 < x Initial program 70.0%
sub-neg70.0%
associate-+l-70.0%
sub-neg70.0%
sub-neg70.0%
distribute-rgt-out--72.7%
associate-*l*77.9%
distribute-lft-neg-in77.9%
cancel-sign-sub77.9%
associate-*l*77.9%
associate-*l*77.9%
Simplified77.9%
Taylor expanded in x around inf 78.3%
if -1.35e25 < x < -1.6500000000000001e-71Initial program 95.3%
Taylor expanded in a around 0 77.4%
pow177.4%
*-commutative77.4%
Applied egg-rr77.4%
unpow177.4%
*-commutative77.4%
associate-*r*77.4%
Simplified77.4%
Taylor expanded in y around inf 59.7%
if -1.6500000000000001e-71 < x < -9.8000000000000007e-142 or 4.09999999999999979e67 < x < 5.5000000000000002e96Initial program 94.9%
Taylor expanded in x around 0 89.7%
Taylor expanded in j around 0 84.6%
if -9.8000000000000007e-142 < x < 4.8e14Initial program 97.0%
Taylor expanded in t around 0 76.2%
Taylor expanded in i around 0 66.8%
Final simplification72.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 (<= x -1.35e+25)
(and (not (<= x 7e+18)) (or (<= x 2.85e+67) (not (<= x 7.2e+136)))))
(* 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 <= -1.35e+25) || (!(x <= 7e+18) && ((x <= 2.85e+67) || !(x <= 7.2e+136)))) {
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 <= (-1.35d+25)) .or. (.not. (x <= 7d+18)) .and. (x <= 2.85d+67) .or. (.not. (x <= 7.2d+136))) 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 <= -1.35e+25) || (!(x <= 7e+18) && ((x <= 2.85e+67) || !(x <= 7.2e+136)))) {
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 <= -1.35e+25) or (not (x <= 7e+18) and ((x <= 2.85e+67) or not (x <= 7.2e+136))): 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 <= -1.35e+25) || (!(x <= 7e+18) && ((x <= 2.85e+67) || !(x <= 7.2e+136)))) 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 <= -1.35e+25) || (~((x <= 7e+18)) && ((x <= 2.85e+67) || ~((x <= 7.2e+136)))))
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, -1.35e+25], And[N[Not[LessEqual[x, 7e+18]], $MachinePrecision], Or[LessEqual[x, 2.85e+67], N[Not[LessEqual[x, 7.2e+136]], $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 -1.35 \cdot 10^{+25} \lor \neg \left(x \leq 7 \cdot 10^{+18}\right) \land \left(x \leq 2.85 \cdot 10^{+67} \lor \neg \left(x \leq 7.2 \cdot 10^{+136}\right)\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 < -1.35e25 or 7e18 < x < 2.8499999999999997e67 or 7.20000000000000011e136 < x Initial program 68.6%
sub-neg68.6%
associate-+l-68.6%
sub-neg68.6%
sub-neg68.6%
distribute-rgt-out--71.6%
associate-*l*77.2%
distribute-lft-neg-in77.2%
cancel-sign-sub77.2%
associate-*l*77.2%
associate-*l*77.2%
Simplified77.2%
Taylor expanded in x around inf 79.6%
if -1.35e25 < x < 7e18 or 2.8499999999999997e67 < x < 7.20000000000000011e136Initial program 96.0%
Taylor expanded in x around 0 81.0%
Final simplification80.4%
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (* x (- (* 18.0 (* y (* z t))) (* 4.0 i)))))
(if (<= x -3.2e+26)
t_1
(if (<= x 25000000000000.0)
(- (* b c) (* (* j 27.0) k))
(if (or (<= x 3.9e+67) (not (<= x 1.56e+97)))
t_1
(- (* b c) (* 4.0 (* t a))))))))assert(y < z);
assert(j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = x * ((18.0 * (y * (z * t))) - (4.0 * i));
double tmp;
if (x <= -3.2e+26) {
tmp = t_1;
} else if (x <= 25000000000000.0) {
tmp = (b * c) - ((j * 27.0) * k);
} else if ((x <= 3.9e+67) || !(x <= 1.56e+97)) {
tmp = t_1;
} else {
tmp = (b * c) - (4.0 * (t * a));
}
return tmp;
}
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: tmp
t_1 = x * ((18.0d0 * (y * (z * t))) - (4.0d0 * i))
if (x <= (-3.2d+26)) then
tmp = t_1
else if (x <= 25000000000000.0d0) then
tmp = (b * c) - ((j * 27.0d0) * k)
else if ((x <= 3.9d+67) .or. (.not. (x <= 1.56d+97))) then
tmp = t_1
else
tmp = (b * c) - (4.0d0 * (t * a))
end if
code = tmp
end function
assert y < z;
assert j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = x * ((18.0 * (y * (z * t))) - (4.0 * i));
double tmp;
if (x <= -3.2e+26) {
tmp = t_1;
} else if (x <= 25000000000000.0) {
tmp = (b * c) - ((j * 27.0) * k);
} else if ((x <= 3.9e+67) || !(x <= 1.56e+97)) {
tmp = t_1;
} else {
tmp = (b * c) - (4.0 * (t * a));
}
return tmp;
}
[y, z] = sort([y, z]) [j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): t_1 = x * ((18.0 * (y * (z * t))) - (4.0 * i)) tmp = 0 if x <= -3.2e+26: tmp = t_1 elif x <= 25000000000000.0: tmp = (b * c) - ((j * 27.0) * k) elif (x <= 3.9e+67) or not (x <= 1.56e+97): tmp = t_1 else: tmp = (b * c) - (4.0 * (t * a)) return tmp
y, z = sort([y, z]) j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(x * Float64(Float64(18.0 * Float64(y * Float64(z * t))) - Float64(4.0 * i))) tmp = 0.0 if (x <= -3.2e+26) tmp = t_1; elseif (x <= 25000000000000.0) tmp = Float64(Float64(b * c) - Float64(Float64(j * 27.0) * k)); elseif ((x <= 3.9e+67) || !(x <= 1.56e+97)) tmp = t_1; else tmp = Float64(Float64(b * c) - Float64(4.0 * Float64(t * a))); end return tmp end
y, z = num2cell(sort([y, z])){:}
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
t_1 = x * ((18.0 * (y * (z * t))) - (4.0 * i));
tmp = 0.0;
if (x <= -3.2e+26)
tmp = t_1;
elseif (x <= 25000000000000.0)
tmp = (b * c) - ((j * 27.0) * k);
elseif ((x <= 3.9e+67) || ~((x <= 1.56e+97)))
tmp = t_1;
else
tmp = (b * c) - (4.0 * (t * a));
end
tmp_2 = tmp;
end
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(x * N[(N[(18.0 * N[(y * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(4.0 * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -3.2e+26], t$95$1, If[LessEqual[x, 25000000000000.0], N[(N[(b * c), $MachinePrecision] - N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[x, 3.9e+67], N[Not[LessEqual[x, 1.56e+97]], $MachinePrecision]], t$95$1, N[(N[(b * c), $MachinePrecision] - N[(4.0 * N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
t_1 := x \cdot \left(18 \cdot \left(y \cdot \left(z \cdot t\right)\right) - 4 \cdot i\right)\\
\mathbf{if}\;x \leq -3.2 \cdot 10^{+26}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 25000000000000:\\
\;\;\;\;b \cdot c - \left(j \cdot 27\right) \cdot k\\
\mathbf{elif}\;x \leq 3.9 \cdot 10^{+67} \lor \neg \left(x \leq 1.56 \cdot 10^{+97}\right):\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;b \cdot c - 4 \cdot \left(t \cdot a\right)\\
\end{array}
\end{array}
if x < -3.20000000000000029e26 or 2.5e13 < x < 3.90000000000000007e67 or 1.56e97 < x Initial program 70.0%
sub-neg70.0%
associate-+l-70.0%
sub-neg70.0%
sub-neg70.0%
distribute-rgt-out--72.7%
associate-*l*77.9%
distribute-lft-neg-in77.9%
cancel-sign-sub77.9%
associate-*l*77.9%
associate-*l*77.9%
Simplified77.9%
Taylor expanded in x around inf 78.3%
if -3.20000000000000029e26 < x < 2.5e13Initial program 97.0%
Taylor expanded in a around 0 80.0%
pow180.0%
*-commutative80.0%
Applied egg-rr80.0%
unpow180.0%
*-commutative80.0%
associate-*r*78.5%
Simplified78.5%
Taylor expanded in c around inf 65.1%
if 3.90000000000000007e67 < x < 1.56e97Initial program 86.2%
Taylor expanded in x around 0 86.3%
Taylor expanded in j around 0 86.1%
Final simplification71.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 (<= i -3.6e+22)
(- (* b c) (* 4.0 (* x i)))
(if (<= i 2.7e-5)
(- (* b c) (* (* j 27.0) k))
(if (<= i 2.3e+72)
(- (* b c) (* 4.0 (* t a)))
(if (<= i 6.1e+112)
(- (* b c) (* 27.0 (* j k)))
(+ (* (* x i) -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 tmp;
if (i <= -3.6e+22) {
tmp = (b * c) - (4.0 * (x * i));
} else if (i <= 2.7e-5) {
tmp = (b * c) - ((j * 27.0) * k);
} else if (i <= 2.3e+72) {
tmp = (b * c) - (4.0 * (t * a));
} else if (i <= 6.1e+112) {
tmp = (b * c) - (27.0 * (j * k));
} else {
tmp = ((x * i) * -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) :: tmp
if (i <= (-3.6d+22)) then
tmp = (b * c) - (4.0d0 * (x * i))
else if (i <= 2.7d-5) then
tmp = (b * c) - ((j * 27.0d0) * k)
else if (i <= 2.3d+72) then
tmp = (b * c) - (4.0d0 * (t * a))
else if (i <= 6.1d+112) then
tmp = (b * c) - (27.0d0 * (j * k))
else
tmp = ((x * i) * (-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 tmp;
if (i <= -3.6e+22) {
tmp = (b * c) - (4.0 * (x * i));
} else if (i <= 2.7e-5) {
tmp = (b * c) - ((j * 27.0) * k);
} else if (i <= 2.3e+72) {
tmp = (b * c) - (4.0 * (t * a));
} else if (i <= 6.1e+112) {
tmp = (b * c) - (27.0 * (j * k));
} else {
tmp = ((x * i) * -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): tmp = 0 if i <= -3.6e+22: tmp = (b * c) - (4.0 * (x * i)) elif i <= 2.7e-5: tmp = (b * c) - ((j * 27.0) * k) elif i <= 2.3e+72: tmp = (b * c) - (4.0 * (t * a)) elif i <= 6.1e+112: tmp = (b * c) - (27.0 * (j * k)) else: tmp = ((x * i) * -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) tmp = 0.0 if (i <= -3.6e+22) tmp = Float64(Float64(b * c) - Float64(4.0 * Float64(x * i))); elseif (i <= 2.7e-5) tmp = Float64(Float64(b * c) - Float64(Float64(j * 27.0) * k)); elseif (i <= 2.3e+72) tmp = Float64(Float64(b * c) - Float64(4.0 * Float64(t * a))); elseif (i <= 6.1e+112) tmp = Float64(Float64(b * c) - Float64(27.0 * Float64(j * k))); else tmp = Float64(Float64(Float64(x * i) * -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)
tmp = 0.0;
if (i <= -3.6e+22)
tmp = (b * c) - (4.0 * (x * i));
elseif (i <= 2.7e-5)
tmp = (b * c) - ((j * 27.0) * k);
elseif (i <= 2.3e+72)
tmp = (b * c) - (4.0 * (t * a));
elseif (i <= 6.1e+112)
tmp = (b * c) - (27.0 * (j * k));
else
tmp = ((x * i) * -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_] := If[LessEqual[i, -3.6e+22], N[(N[(b * c), $MachinePrecision] - N[(4.0 * N[(x * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[i, 2.7e-5], N[(N[(b * c), $MachinePrecision] - N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision], If[LessEqual[i, 2.3e+72], N[(N[(b * c), $MachinePrecision] - N[(4.0 * N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[i, 6.1e+112], N[(N[(b * c), $MachinePrecision] - N[(27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x * i), $MachinePrecision] * -4.0), $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}
\mathbf{if}\;i \leq -3.6 \cdot 10^{+22}:\\
\;\;\;\;b \cdot c - 4 \cdot \left(x \cdot i\right)\\
\mathbf{elif}\;i \leq 2.7 \cdot 10^{-5}:\\
\;\;\;\;b \cdot c - \left(j \cdot 27\right) \cdot k\\
\mathbf{elif}\;i \leq 2.3 \cdot 10^{+72}:\\
\;\;\;\;b \cdot c - 4 \cdot \left(t \cdot a\right)\\
\mathbf{elif}\;i \leq 6.1 \cdot 10^{+112}:\\
\;\;\;\;b \cdot c - 27 \cdot \left(j \cdot k\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x \cdot i\right) \cdot -4 + k \cdot \left(j \cdot -27\right)\\
\end{array}
\end{array}
if i < -3.6e22Initial program 90.6%
Taylor expanded in t around 0 80.3%
Taylor expanded in j around 0 68.3%
if -3.6e22 < i < 2.6999999999999999e-5Initial program 86.9%
Taylor expanded in a around 0 76.8%
pow176.8%
*-commutative76.8%
Applied egg-rr76.8%
unpow176.8%
*-commutative76.8%
associate-*r*75.0%
Simplified75.0%
Taylor expanded in c around inf 61.7%
if 2.6999999999999999e-5 < i < 2.3e72Initial program 89.3%
Taylor expanded in x around 0 77.2%
Taylor expanded in j around 0 65.6%
if 2.3e72 < i < 6.0999999999999996e112Initial program 88.5%
Taylor expanded in t around 0 77.5%
Taylor expanded in i around 0 59.8%
if 6.0999999999999996e112 < i Initial program 73.6%
Taylor expanded in t around 0 73.9%
Taylor expanded in c around 0 66.6%
mul-1-neg66.6%
*-commutative66.6%
*-commutative66.6%
associate-*r*66.6%
distribute-neg-in66.6%
distribute-lft-neg-in66.6%
metadata-eval66.6%
*-commutative66.6%
distribute-rgt-neg-in66.6%
distribute-rgt-neg-in66.6%
metadata-eval66.6%
Simplified66.6%
Final simplification64.6%
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (- (* b c) (* 4.0 (* x i)))))
(if (<= k -4.25e-60)
(* k (* j -27.0))
(if (<= k 1.45e+87)
t_1
(if (<= k 5.5e+135)
(- (* b c) (* 4.0 (* t a)))
(if (<= k 9.2e+171) t_1 (* (* j k) -27.0)))))))assert(y < z);
assert(j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = (b * c) - (4.0 * (x * i));
double tmp;
if (k <= -4.25e-60) {
tmp = k * (j * -27.0);
} else if (k <= 1.45e+87) {
tmp = t_1;
} else if (k <= 5.5e+135) {
tmp = (b * c) - (4.0 * (t * a));
} else if (k <= 9.2e+171) {
tmp = t_1;
} else {
tmp = (j * k) * -27.0;
}
return tmp;
}
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: tmp
t_1 = (b * c) - (4.0d0 * (x * i))
if (k <= (-4.25d-60)) then
tmp = k * (j * (-27.0d0))
else if (k <= 1.45d+87) then
tmp = t_1
else if (k <= 5.5d+135) then
tmp = (b * c) - (4.0d0 * (t * a))
else if (k <= 9.2d+171) then
tmp = t_1
else
tmp = (j * k) * (-27.0d0)
end if
code = tmp
end function
assert y < z;
assert j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = (b * c) - (4.0 * (x * i));
double tmp;
if (k <= -4.25e-60) {
tmp = k * (j * -27.0);
} else if (k <= 1.45e+87) {
tmp = t_1;
} else if (k <= 5.5e+135) {
tmp = (b * c) - (4.0 * (t * a));
} else if (k <= 9.2e+171) {
tmp = t_1;
} else {
tmp = (j * k) * -27.0;
}
return tmp;
}
[y, z] = sort([y, z]) [j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): t_1 = (b * c) - (4.0 * (x * i)) tmp = 0 if k <= -4.25e-60: tmp = k * (j * -27.0) elif k <= 1.45e+87: tmp = t_1 elif k <= 5.5e+135: tmp = (b * c) - (4.0 * (t * a)) elif k <= 9.2e+171: tmp = t_1 else: tmp = (j * k) * -27.0 return tmp
y, z = sort([y, z]) j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(Float64(b * c) - Float64(4.0 * Float64(x * i))) tmp = 0.0 if (k <= -4.25e-60) tmp = Float64(k * Float64(j * -27.0)); elseif (k <= 1.45e+87) tmp = t_1; elseif (k <= 5.5e+135) tmp = Float64(Float64(b * c) - Float64(4.0 * Float64(t * a))); elseif (k <= 9.2e+171) tmp = t_1; else tmp = Float64(Float64(j * k) * -27.0); end return tmp end
y, z = num2cell(sort([y, z])){:}
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
t_1 = (b * c) - (4.0 * (x * i));
tmp = 0.0;
if (k <= -4.25e-60)
tmp = k * (j * -27.0);
elseif (k <= 1.45e+87)
tmp = t_1;
elseif (k <= 5.5e+135)
tmp = (b * c) - (4.0 * (t * a));
elseif (k <= 9.2e+171)
tmp = t_1;
else
tmp = (j * k) * -27.0;
end
tmp_2 = tmp;
end
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(N[(b * c), $MachinePrecision] - N[(4.0 * N[(x * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[k, -4.25e-60], N[(k * N[(j * -27.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[k, 1.45e+87], t$95$1, If[LessEqual[k, 5.5e+135], N[(N[(b * c), $MachinePrecision] - N[(4.0 * N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[k, 9.2e+171], t$95$1, N[(N[(j * k), $MachinePrecision] * -27.0), $MachinePrecision]]]]]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
t_1 := b \cdot c - 4 \cdot \left(x \cdot i\right)\\
\mathbf{if}\;k \leq -4.25 \cdot 10^{-60}:\\
\;\;\;\;k \cdot \left(j \cdot -27\right)\\
\mathbf{elif}\;k \leq 1.45 \cdot 10^{+87}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;k \leq 5.5 \cdot 10^{+135}:\\
\;\;\;\;b \cdot c - 4 \cdot \left(t \cdot a\right)\\
\mathbf{elif}\;k \leq 9.2 \cdot 10^{+171}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\left(j \cdot k\right) \cdot -27\\
\end{array}
\end{array}
if k < -4.25000000000000022e-60Initial program 86.1%
Taylor expanded in a around 0 81.2%
pow181.2%
*-commutative81.2%
Applied egg-rr81.2%
unpow181.2%
*-commutative81.2%
associate-*r*82.4%
Simplified82.4%
Taylor expanded in j around inf 41.1%
*-commutative41.1%
associate-*r*41.1%
Simplified41.1%
if -4.25000000000000022e-60 < k < 1.4499999999999999e87 or 5.4999999999999999e135 < k < 9.20000000000000069e171Initial program 86.2%
Taylor expanded in t around 0 66.8%
Taylor expanded in j around 0 56.2%
if 1.4499999999999999e87 < k < 5.4999999999999999e135Initial program 74.8%
Taylor expanded in x around 0 75.6%
Taylor expanded in j around 0 64.0%
if 9.20000000000000069e171 < k Initial program 82.3%
sub-neg82.3%
+-commutative82.3%
associate-*l*82.2%
distribute-rgt-neg-in82.2%
fma-def85.2%
*-commutative85.2%
distribute-rgt-neg-in85.2%
metadata-eval85.2%
sub-neg85.2%
+-commutative85.2%
associate-*l*85.2%
distribute-rgt-neg-in85.2%
Simplified96.9%
Taylor expanded in j around inf 51.6%
Final simplification51.2%
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (* x (* i -4.0))))
(if (<= x -2.1e+26)
t_1
(if (<= x 9.5e-31)
(* k (* j -27.0))
(if (<= x 8.2e+156) (* x (* 18.0 (* y (* z t)))) 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 * (i * -4.0);
double tmp;
if (x <= -2.1e+26) {
tmp = t_1;
} else if (x <= 9.5e-31) {
tmp = k * (j * -27.0);
} else if (x <= 8.2e+156) {
tmp = x * (18.0 * (y * (z * t)));
} else {
tmp = t_1;
}
return tmp;
}
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: tmp
t_1 = x * (i * (-4.0d0))
if (x <= (-2.1d+26)) then
tmp = t_1
else if (x <= 9.5d-31) then
tmp = k * (j * (-27.0d0))
else if (x <= 8.2d+156) then
tmp = x * (18.0d0 * (y * (z * t)))
else
tmp = t_1
end if
code = tmp
end function
assert y < z;
assert j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = x * (i * -4.0);
double tmp;
if (x <= -2.1e+26) {
tmp = t_1;
} else if (x <= 9.5e-31) {
tmp = k * (j * -27.0);
} else if (x <= 8.2e+156) {
tmp = x * (18.0 * (y * (z * t)));
} else {
tmp = t_1;
}
return tmp;
}
[y, z] = sort([y, z]) [j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): t_1 = x * (i * -4.0) tmp = 0 if x <= -2.1e+26: tmp = t_1 elif x <= 9.5e-31: tmp = k * (j * -27.0) elif x <= 8.2e+156: tmp = x * (18.0 * (y * (z * t))) 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(x * Float64(i * -4.0)) tmp = 0.0 if (x <= -2.1e+26) tmp = t_1; elseif (x <= 9.5e-31) tmp = Float64(k * Float64(j * -27.0)); elseif (x <= 8.2e+156) tmp = Float64(x * Float64(18.0 * Float64(y * Float64(z * t)))); else tmp = t_1; end return tmp end
y, z = num2cell(sort([y, z])){:}
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
t_1 = x * (i * -4.0);
tmp = 0.0;
if (x <= -2.1e+26)
tmp = t_1;
elseif (x <= 9.5e-31)
tmp = k * (j * -27.0);
elseif (x <= 8.2e+156)
tmp = x * (18.0 * (y * (z * t)));
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[(x * N[(i * -4.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -2.1e+26], t$95$1, If[LessEqual[x, 9.5e-31], N[(k * N[(j * -27.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 8.2e+156], N[(x * N[(18.0 * N[(y * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
t_1 := x \cdot \left(i \cdot -4\right)\\
\mathbf{if}\;x \leq -2.1 \cdot 10^{+26}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 9.5 \cdot 10^{-31}:\\
\;\;\;\;k \cdot \left(j \cdot -27\right)\\
\mathbf{elif}\;x \leq 8.2 \cdot 10^{+156}:\\
\;\;\;\;x \cdot \left(18 \cdot \left(y \cdot \left(z \cdot t\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if x < -2.1000000000000001e26 or 8.2000000000000003e156 < x Initial program 67.7%
sub-neg67.7%
associate-+l-67.7%
sub-neg67.7%
sub-neg67.7%
distribute-rgt-out--71.2%
associate-*l*77.8%
distribute-lft-neg-in77.8%
cancel-sign-sub77.8%
associate-*l*77.8%
associate-*l*77.8%
Simplified77.8%
Taylor expanded in x around inf 79.3%
Taylor expanded in y around 0 53.9%
*-commutative53.9%
Simplified53.9%
if -2.1000000000000001e26 < x < 9.5000000000000008e-31Initial program 96.9%
Taylor expanded in a around 0 79.3%
pow179.3%
*-commutative79.3%
Applied egg-rr79.3%
unpow179.3%
*-commutative79.3%
associate-*r*77.7%
Simplified77.7%
Taylor expanded in j around inf 39.3%
*-commutative39.3%
associate-*r*39.2%
Simplified39.2%
if 9.5000000000000008e-31 < x < 8.2000000000000003e156Initial program 83.1%
sub-neg83.1%
associate-+l-83.1%
sub-neg83.1%
sub-neg83.1%
distribute-rgt-out--83.1%
associate-*l*83.1%
distribute-lft-neg-in83.1%
cancel-sign-sub83.1%
associate-*l*83.1%
associate-*l*83.1%
Simplified83.1%
Taylor expanded in x around inf 61.3%
Taylor expanded in y around inf 44.6%
Final simplification44.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 (* x (* i -4.0))))
(if (<= x -1.85e+25)
t_1
(if (<= x -3.5e-71)
(* k (* j -27.0))
(if (<= x 1.75e+141) (- (* b c) (* 4.0 (* t a))) 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 * (i * -4.0);
double tmp;
if (x <= -1.85e+25) {
tmp = t_1;
} else if (x <= -3.5e-71) {
tmp = k * (j * -27.0);
} else if (x <= 1.75e+141) {
tmp = (b * c) - (4.0 * (t * a));
} else {
tmp = t_1;
}
return tmp;
}
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: tmp
t_1 = x * (i * (-4.0d0))
if (x <= (-1.85d+25)) then
tmp = t_1
else if (x <= (-3.5d-71)) then
tmp = k * (j * (-27.0d0))
else if (x <= 1.75d+141) then
tmp = (b * c) - (4.0d0 * (t * a))
else
tmp = t_1
end if
code = tmp
end function
assert y < z;
assert j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = x * (i * -4.0);
double tmp;
if (x <= -1.85e+25) {
tmp = t_1;
} else if (x <= -3.5e-71) {
tmp = k * (j * -27.0);
} else if (x <= 1.75e+141) {
tmp = (b * c) - (4.0 * (t * a));
} else {
tmp = t_1;
}
return tmp;
}
[y, z] = sort([y, z]) [j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): t_1 = x * (i * -4.0) tmp = 0 if x <= -1.85e+25: tmp = t_1 elif x <= -3.5e-71: tmp = k * (j * -27.0) elif x <= 1.75e+141: tmp = (b * c) - (4.0 * (t * a)) 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(x * Float64(i * -4.0)) tmp = 0.0 if (x <= -1.85e+25) tmp = t_1; elseif (x <= -3.5e-71) tmp = Float64(k * Float64(j * -27.0)); elseif (x <= 1.75e+141) tmp = Float64(Float64(b * c) - Float64(4.0 * Float64(t * a))); else tmp = t_1; end return tmp end
y, z = num2cell(sort([y, z])){:}
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
t_1 = x * (i * -4.0);
tmp = 0.0;
if (x <= -1.85e+25)
tmp = t_1;
elseif (x <= -3.5e-71)
tmp = k * (j * -27.0);
elseif (x <= 1.75e+141)
tmp = (b * c) - (4.0 * (t * a));
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[(x * N[(i * -4.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.85e+25], t$95$1, If[LessEqual[x, -3.5e-71], N[(k * N[(j * -27.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.75e+141], N[(N[(b * c), $MachinePrecision] - N[(4.0 * N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
t_1 := x \cdot \left(i \cdot -4\right)\\
\mathbf{if}\;x \leq -1.85 \cdot 10^{+25}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq -3.5 \cdot 10^{-71}:\\
\;\;\;\;k \cdot \left(j \cdot -27\right)\\
\mathbf{elif}\;x \leq 1.75 \cdot 10^{+141}:\\
\;\;\;\;b \cdot c - 4 \cdot \left(t \cdot a\right)\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if x < -1.8499999999999999e25 or 1.75e141 < x Initial program 67.3%
sub-neg67.3%
associate-+l-67.3%
sub-neg67.3%
sub-neg67.3%
distribute-rgt-out--70.6%
associate-*l*76.9%
distribute-lft-neg-in76.9%
cancel-sign-sub76.9%
associate-*l*76.9%
associate-*l*76.9%
Simplified76.9%
Taylor expanded in x around inf 80.4%
Taylor expanded in y around 0 52.1%
*-commutative52.1%
Simplified52.1%
if -1.8499999999999999e25 < x < -3.4999999999999999e-71Initial program 95.3%
Taylor expanded in a around 0 77.4%
pow177.4%
*-commutative77.4%
Applied egg-rr77.4%
unpow177.4%
*-commutative77.4%
associate-*r*77.4%
Simplified77.4%
Taylor expanded in j around inf 50.9%
*-commutative50.9%
associate-*r*51.1%
Simplified51.1%
if -3.4999999999999999e-71 < x < 1.75e141Initial program 95.0%
Taylor expanded in x around 0 79.2%
Taylor expanded in j around 0 51.3%
Final simplification51.6%
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (* x (* i -4.0))))
(if (<= x -3.6e+25)
t_1
(if (<= x 9.5e-58)
(* k (* j -27.0))
(if (<= x 4.4e+108)
(* -4.0 (* t a))
(if (<= x 3e+140) (* (* j k) -27.0) t_1))))))assert(y < z);
assert(j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = x * (i * -4.0);
double tmp;
if (x <= -3.6e+25) {
tmp = t_1;
} else if (x <= 9.5e-58) {
tmp = k * (j * -27.0);
} else if (x <= 4.4e+108) {
tmp = -4.0 * (t * a);
} else if (x <= 3e+140) {
tmp = (j * k) * -27.0;
} else {
tmp = t_1;
}
return tmp;
}
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: tmp
t_1 = x * (i * (-4.0d0))
if (x <= (-3.6d+25)) then
tmp = t_1
else if (x <= 9.5d-58) then
tmp = k * (j * (-27.0d0))
else if (x <= 4.4d+108) then
tmp = (-4.0d0) * (t * a)
else if (x <= 3d+140) then
tmp = (j * k) * (-27.0d0)
else
tmp = t_1
end if
code = tmp
end function
assert y < z;
assert j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = x * (i * -4.0);
double tmp;
if (x <= -3.6e+25) {
tmp = t_1;
} else if (x <= 9.5e-58) {
tmp = k * (j * -27.0);
} else if (x <= 4.4e+108) {
tmp = -4.0 * (t * a);
} else if (x <= 3e+140) {
tmp = (j * k) * -27.0;
} else {
tmp = t_1;
}
return tmp;
}
[y, z] = sort([y, z]) [j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): t_1 = x * (i * -4.0) tmp = 0 if x <= -3.6e+25: tmp = t_1 elif x <= 9.5e-58: tmp = k * (j * -27.0) elif x <= 4.4e+108: tmp = -4.0 * (t * a) elif x <= 3e+140: tmp = (j * k) * -27.0 else: tmp = t_1 return tmp
y, z = sort([y, z]) j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(x * Float64(i * -4.0)) tmp = 0.0 if (x <= -3.6e+25) tmp = t_1; elseif (x <= 9.5e-58) tmp = Float64(k * Float64(j * -27.0)); elseif (x <= 4.4e+108) tmp = Float64(-4.0 * Float64(t * a)); elseif (x <= 3e+140) tmp = Float64(Float64(j * k) * -27.0); else tmp = t_1; end return tmp end
y, z = num2cell(sort([y, z])){:}
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
t_1 = x * (i * -4.0);
tmp = 0.0;
if (x <= -3.6e+25)
tmp = t_1;
elseif (x <= 9.5e-58)
tmp = k * (j * -27.0);
elseif (x <= 4.4e+108)
tmp = -4.0 * (t * a);
elseif (x <= 3e+140)
tmp = (j * k) * -27.0;
else
tmp = t_1;
end
tmp_2 = tmp;
end
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(x * N[(i * -4.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -3.6e+25], t$95$1, If[LessEqual[x, 9.5e-58], N[(k * N[(j * -27.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 4.4e+108], N[(-4.0 * N[(t * a), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 3e+140], N[(N[(j * k), $MachinePrecision] * -27.0), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
t_1 := x \cdot \left(i \cdot -4\right)\\
\mathbf{if}\;x \leq -3.6 \cdot 10^{+25}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 9.5 \cdot 10^{-58}:\\
\;\;\;\;k \cdot \left(j \cdot -27\right)\\
\mathbf{elif}\;x \leq 4.4 \cdot 10^{+108}:\\
\;\;\;\;-4 \cdot \left(t \cdot a\right)\\
\mathbf{elif}\;x \leq 3 \cdot 10^{+140}:\\
\;\;\;\;\left(j \cdot k\right) \cdot -27\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if x < -3.60000000000000015e25 or 2.99999999999999997e140 < x Initial program 67.3%
sub-neg67.3%
associate-+l-67.3%
sub-neg67.3%
sub-neg67.3%
distribute-rgt-out--70.6%
associate-*l*76.9%
distribute-lft-neg-in76.9%
cancel-sign-sub76.9%
associate-*l*76.9%
associate-*l*76.9%
Simplified76.9%
Taylor expanded in x around inf 80.4%
Taylor expanded in y around 0 52.1%
*-commutative52.1%
Simplified52.1%
if -3.60000000000000015e25 < x < 9.4999999999999994e-58Initial program 96.8%
Taylor expanded in a around 0 79.3%
pow179.3%
*-commutative79.3%
Applied egg-rr79.3%
unpow179.3%
*-commutative79.3%
associate-*r*77.7%
Simplified77.7%
Taylor expanded in j around inf 39.9%
*-commutative39.9%
associate-*r*39.9%
Simplified39.9%
if 9.4999999999999994e-58 < x < 4.4000000000000003e108Initial program 89.3%
Taylor expanded in x around 0 61.8%
Taylor expanded in j around 0 58.1%
Taylor expanded in c around 0 33.5%
if 4.4000000000000003e108 < x < 2.99999999999999997e140Initial program 85.7%
sub-neg85.7%
+-commutative85.7%
associate-*l*85.7%
distribute-rgt-neg-in85.7%
fma-def85.7%
*-commutative85.7%
distribute-rgt-neg-in85.7%
metadata-eval85.7%
sub-neg85.7%
+-commutative85.7%
associate-*l*85.7%
distribute-rgt-neg-in85.7%
Simplified85.7%
Taylor expanded in j around inf 57.8%
Final simplification44.0%
NOTE: y and z should be sorted in increasing order before calling this function. NOTE: j and k should be sorted in increasing order before calling this function. (FPCore (x y z t a b c i j k) :precision binary64 (if (or (<= a -3e+151) (not (<= a 9000000.0))) (* -4.0 (* t a)) (* (* j k) -27.0)))
assert(y < z);
assert(j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double tmp;
if ((a <= -3e+151) || !(a <= 9000000.0)) {
tmp = -4.0 * (t * a);
} else {
tmp = (j * k) * -27.0;
}
return tmp;
}
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: tmp
if ((a <= (-3d+151)) .or. (.not. (a <= 9000000.0d0))) then
tmp = (-4.0d0) * (t * a)
else
tmp = (j * k) * (-27.0d0)
end if
code = tmp
end function
assert y < z;
assert j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double tmp;
if ((a <= -3e+151) || !(a <= 9000000.0)) {
tmp = -4.0 * (t * a);
} else {
tmp = (j * k) * -27.0;
}
return tmp;
}
[y, z] = sort([y, z]) [j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): tmp = 0 if (a <= -3e+151) or not (a <= 9000000.0): tmp = -4.0 * (t * a) else: tmp = (j * k) * -27.0 return tmp
y, z = sort([y, z]) j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) tmp = 0.0 if ((a <= -3e+151) || !(a <= 9000000.0)) tmp = Float64(-4.0 * Float64(t * a)); else tmp = Float64(Float64(j * k) * -27.0); end return tmp end
y, z = num2cell(sort([y, z])){:}
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
tmp = 0.0;
if ((a <= -3e+151) || ~((a <= 9000000.0)))
tmp = -4.0 * (t * a);
else
tmp = (j * k) * -27.0;
end
tmp_2 = tmp;
end
NOTE: y and z should be sorted in increasing order before calling this function. NOTE: j and k should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := If[Or[LessEqual[a, -3e+151], N[Not[LessEqual[a, 9000000.0]], $MachinePrecision]], N[(-4.0 * N[(t * a), $MachinePrecision]), $MachinePrecision], N[(N[(j * k), $MachinePrecision] * -27.0), $MachinePrecision]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
\mathbf{if}\;a \leq -3 \cdot 10^{+151} \lor \neg \left(a \leq 9000000\right):\\
\;\;\;\;-4 \cdot \left(t \cdot a\right)\\
\mathbf{else}:\\
\;\;\;\;\left(j \cdot k\right) \cdot -27\\
\end{array}
\end{array}
if a < -2.9999999999999999e151 or 9e6 < a Initial program 81.9%
Taylor expanded in x around 0 68.3%
Taylor expanded in j around 0 58.0%
Taylor expanded in c around 0 41.4%
if -2.9999999999999999e151 < a < 9e6Initial program 87.2%
sub-neg87.2%
+-commutative87.2%
associate-*l*87.3%
distribute-rgt-neg-in87.3%
fma-def88.5%
*-commutative88.5%
distribute-rgt-neg-in88.5%
metadata-eval88.5%
sub-neg88.5%
+-commutative88.5%
associate-*l*88.5%
distribute-rgt-neg-in88.5%
Simplified92.6%
Taylor expanded in j around inf 34.3%
Final simplification36.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 (<= a -1.4e+151) (not (<= a 9500000.0))) (* -4.0 (* t a)) (* 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 tmp;
if ((a <= -1.4e+151) || !(a <= 9500000.0)) {
tmp = -4.0 * (t * a);
} else {
tmp = 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) :: tmp
if ((a <= (-1.4d+151)) .or. (.not. (a <= 9500000.0d0))) then
tmp = (-4.0d0) * (t * a)
else
tmp = 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 tmp;
if ((a <= -1.4e+151) || !(a <= 9500000.0)) {
tmp = -4.0 * (t * a);
} else {
tmp = 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): tmp = 0 if (a <= -1.4e+151) or not (a <= 9500000.0): tmp = -4.0 * (t * a) else: tmp = 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) tmp = 0.0 if ((a <= -1.4e+151) || !(a <= 9500000.0)) tmp = Float64(-4.0 * Float64(t * a)); else tmp = 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)
tmp = 0.0;
if ((a <= -1.4e+151) || ~((a <= 9500000.0)))
tmp = -4.0 * (t * a);
else
tmp = 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_] := If[Or[LessEqual[a, -1.4e+151], N[Not[LessEqual[a, 9500000.0]], $MachinePrecision]], N[(-4.0 * N[(t * a), $MachinePrecision]), $MachinePrecision], N[(k * N[(j * -27.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.4 \cdot 10^{+151} \lor \neg \left(a \leq 9500000\right):\\
\;\;\;\;-4 \cdot \left(t \cdot a\right)\\
\mathbf{else}:\\
\;\;\;\;k \cdot \left(j \cdot -27\right)\\
\end{array}
\end{array}
if a < -1.39999999999999994e151 or 9.5e6 < a Initial program 81.9%
Taylor expanded in x around 0 68.3%
Taylor expanded in j around 0 58.0%
Taylor expanded in c around 0 41.4%
if -1.39999999999999994e151 < a < 9.5e6Initial program 87.2%
Taylor expanded in a around 0 86.1%
pow186.1%
*-commutative86.1%
Applied egg-rr86.1%
unpow186.1%
*-commutative86.1%
associate-*r*86.1%
Simplified86.1%
Taylor expanded in j around inf 34.3%
*-commutative34.3%
associate-*r*34.3%
Simplified34.3%
Final simplification36.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 (* (* j k) -27.0))
assert(y < z);
assert(j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
return (j * k) * -27.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.
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 = (j * k) * (-27.0d0)
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 (j * k) * -27.0;
}
[y, z] = sort([y, z]) [j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): return (j * k) * -27.0
y, z = sort([y, z]) j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) return Float64(Float64(j * k) * -27.0) 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 = (j * k) * -27.0;
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[(N[(j * k), $MachinePrecision] * -27.0), $MachinePrecision]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
[j, k] = \mathsf{sort}([j, k])\\
\\
\left(j \cdot k\right) \cdot -27
\end{array}
Initial program 85.3%
sub-neg85.3%
+-commutative85.3%
associate-*l*85.3%
distribute-rgt-neg-in85.3%
fma-def86.5%
*-commutative86.5%
distribute-rgt-neg-in86.5%
metadata-eval86.5%
sub-neg86.5%
+-commutative86.5%
associate-*l*86.5%
distribute-rgt-neg-in86.5%
Simplified90.4%
Taylor expanded in j around inf 26.5%
Final simplification26.5%
(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 2023252
(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)))