
(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.
(FPCore (x y z t a b c i j k)
:precision binary64
(if (<=
(-
(-
(+ (- (* (* (* (* x 18.0) y) z) t) (* t (* a 4.0))) (* b c))
(* (* x 4.0) i))
(* (* j 27.0) k))
INFINITY)
(-
(+ (* t (- (* 18.0 (* y (* x z))) (* a 4.0))) (* b c))
(+ (* x (* 4.0 i)) (* j (* 27.0 k))))
(* x (- (* 18.0 (* y (* z t))) (* 4.0 i)))))assert(y < z);
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 * 18.0) * y) * z) * t) - (t * (a * 4.0))) + (b * c)) - ((x * 4.0) * i)) - ((j * 27.0) * k)) <= ((double) INFINITY)) {
tmp = ((t * ((18.0 * (y * (x * z))) - (a * 4.0))) + (b * c)) - ((x * (4.0 * i)) + (j * (27.0 * k)));
} else {
tmp = x * ((18.0 * (y * (z * t))) - (4.0 * i));
}
return tmp;
}
assert y < z;
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 * 18.0) * y) * z) * t) - (t * (a * 4.0))) + (b * c)) - ((x * 4.0) * i)) - ((j * 27.0) * k)) <= Double.POSITIVE_INFINITY) {
tmp = ((t * ((18.0 * (y * (x * z))) - (a * 4.0))) + (b * c)) - ((x * (4.0 * i)) + (j * (27.0 * k)));
} else {
tmp = x * ((18.0 * (y * (z * t))) - (4.0 * i));
}
return tmp;
}
[y, z] = sort([y, z]) def code(x, y, z, t, a, b, c, i, j, k): tmp = 0 if ((((((((x * 18.0) * y) * z) * t) - (t * (a * 4.0))) + (b * c)) - ((x * 4.0) * i)) - ((j * 27.0) * k)) <= math.inf: tmp = ((t * ((18.0 * (y * (x * z))) - (a * 4.0))) + (b * c)) - ((x * (4.0 * i)) + (j * (27.0 * k))) else: tmp = x * ((18.0 * (y * (z * t))) - (4.0 * i)) return tmp
y, z = sort([y, z]) function code(x, y, z, t, a, b, c, i, j, k) tmp = 0.0 if (Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(x * 18.0) * y) * z) * t) - Float64(t * Float64(a * 4.0))) + Float64(b * c)) - Float64(Float64(x * 4.0) * i)) - Float64(Float64(j * 27.0) * k)) <= Inf) tmp = Float64(Float64(Float64(t * Float64(Float64(18.0 * Float64(y * Float64(x * z))) - Float64(a * 4.0))) + Float64(b * c)) - Float64(Float64(x * Float64(4.0 * i)) + Float64(j * Float64(27.0 * k)))); 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])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
tmp = 0.0;
if (((((((((x * 18.0) * y) * z) * t) - (t * (a * 4.0))) + (b * c)) - ((x * 4.0) * i)) - ((j * 27.0) * k)) <= Inf)
tmp = ((t * ((18.0 * (y * (x * z))) - (a * 4.0))) + (b * c)) - ((x * (4.0 * i)) + (j * (27.0 * k)));
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. code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := If[LessEqual[N[(N[(N[(N[(N[(N[(N[(N[(x * 18.0), $MachinePrecision] * y), $MachinePrecision] * z), $MachinePrecision] * t), $MachinePrecision] - N[(t * N[(a * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(b * c), $MachinePrecision]), $MachinePrecision] - N[(N[(x * 4.0), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision] - N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision], Infinity], N[(N[(N[(t * N[(N[(18.0 * N[(y * N[(x * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(a * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(b * c), $MachinePrecision]), $MachinePrecision] - N[(N[(x * N[(4.0 * i), $MachinePrecision]), $MachinePrecision] + N[(j * N[(27.0 * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(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])\\
\\
\begin{array}{l}
\mathbf{if}\;\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - t \cdot \left(a \cdot 4\right)\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \leq \infty:\\
\;\;\;\;\left(t \cdot \left(18 \cdot \left(y \cdot \left(x \cdot z\right)\right) - a \cdot 4\right) + b \cdot c\right) - \left(x \cdot \left(4 \cdot i\right) + j \cdot \left(27 \cdot k\right)\right)\\
\mathbf{else}:\\
\;\;\;\;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 96.5%
sub-neg96.5%
associate-+l-96.5%
sub-neg96.5%
sub-neg96.5%
distribute-rgt-out--96.5%
associate-*l*95.3%
distribute-lft-neg-in95.3%
cancel-sign-sub95.3%
associate-*l*95.3%
associate-*l*95.3%
Simplified95.3%
Taylor expanded in t around 0 96.6%
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--21.7%
associate-*l*21.7%
distribute-lft-neg-in21.7%
cancel-sign-sub21.7%
associate-*l*21.7%
associate-*l*21.7%
Simplified21.7%
Taylor expanded in x around inf 78.3%
Final simplification95.0%
NOTE: y and z should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (* 27.0 (* j k)))
(t_2 (- (+ (* b c) (* -4.0 (* t a))) t_1))
(t_3 (* x (- (* 18.0 (* y (* z t))) (* 4.0 i)))))
(if (<= x -2.45e+73)
t_3
(if (<= x -1.4e+33)
t_2
(if (<= x -1.55e-21)
t_3
(if (<= x 5.8e-87)
t_2
(if (<= x 5.2e+143)
(- (* t (- (* 18.0 (* y (* x z))) (* a 4.0))) t_1)
t_3)))))))assert(y < z);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = 27.0 * (j * k);
double t_2 = ((b * c) + (-4.0 * (t * a))) - t_1;
double t_3 = x * ((18.0 * (y * (z * t))) - (4.0 * i));
double tmp;
if (x <= -2.45e+73) {
tmp = t_3;
} else if (x <= -1.4e+33) {
tmp = t_2;
} else if (x <= -1.55e-21) {
tmp = t_3;
} else if (x <= 5.8e-87) {
tmp = t_2;
} else if (x <= 5.2e+143) {
tmp = (t * ((18.0 * (y * (x * z))) - (a * 4.0))) - t_1;
} else {
tmp = t_3;
}
return tmp;
}
NOTE: y and z should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_1 = 27.0d0 * (j * k)
t_2 = ((b * c) + ((-4.0d0) * (t * a))) - t_1
t_3 = x * ((18.0d0 * (y * (z * t))) - (4.0d0 * i))
if (x <= (-2.45d+73)) then
tmp = t_3
else if (x <= (-1.4d+33)) then
tmp = t_2
else if (x <= (-1.55d-21)) then
tmp = t_3
else if (x <= 5.8d-87) then
tmp = t_2
else if (x <= 5.2d+143) then
tmp = (t * ((18.0d0 * (y * (x * z))) - (a * 4.0d0))) - t_1
else
tmp = t_3
end if
code = tmp
end function
assert y < z;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = 27.0 * (j * k);
double t_2 = ((b * c) + (-4.0 * (t * a))) - t_1;
double t_3 = x * ((18.0 * (y * (z * t))) - (4.0 * i));
double tmp;
if (x <= -2.45e+73) {
tmp = t_3;
} else if (x <= -1.4e+33) {
tmp = t_2;
} else if (x <= -1.55e-21) {
tmp = t_3;
} else if (x <= 5.8e-87) {
tmp = t_2;
} else if (x <= 5.2e+143) {
tmp = (t * ((18.0 * (y * (x * z))) - (a * 4.0))) - t_1;
} else {
tmp = t_3;
}
return tmp;
}
[y, z] = sort([y, z]) def code(x, y, z, t, a, b, c, i, j, k): t_1 = 27.0 * (j * k) t_2 = ((b * c) + (-4.0 * (t * a))) - t_1 t_3 = x * ((18.0 * (y * (z * t))) - (4.0 * i)) tmp = 0 if x <= -2.45e+73: tmp = t_3 elif x <= -1.4e+33: tmp = t_2 elif x <= -1.55e-21: tmp = t_3 elif x <= 5.8e-87: tmp = t_2 elif x <= 5.2e+143: tmp = (t * ((18.0 * (y * (x * z))) - (a * 4.0))) - t_1 else: tmp = t_3 return tmp
y, z = sort([y, z]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(27.0 * Float64(j * k)) t_2 = Float64(Float64(Float64(b * c) + Float64(-4.0 * Float64(t * a))) - t_1) t_3 = Float64(x * Float64(Float64(18.0 * Float64(y * Float64(z * t))) - Float64(4.0 * i))) tmp = 0.0 if (x <= -2.45e+73) tmp = t_3; elseif (x <= -1.4e+33) tmp = t_2; elseif (x <= -1.55e-21) tmp = t_3; elseif (x <= 5.8e-87) tmp = t_2; elseif (x <= 5.2e+143) tmp = Float64(Float64(t * Float64(Float64(18.0 * Float64(y * Float64(x * z))) - Float64(a * 4.0))) - t_1); else tmp = t_3; end return tmp end
y, z = num2cell(sort([y, z])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
t_1 = 27.0 * (j * k);
t_2 = ((b * c) + (-4.0 * (t * a))) - t_1;
t_3 = x * ((18.0 * (y * (z * t))) - (4.0 * i));
tmp = 0.0;
if (x <= -2.45e+73)
tmp = t_3;
elseif (x <= -1.4e+33)
tmp = t_2;
elseif (x <= -1.55e-21)
tmp = t_3;
elseif (x <= 5.8e-87)
tmp = t_2;
elseif (x <= 5.2e+143)
tmp = (t * ((18.0 * (y * (x * z))) - (a * 4.0))) - t_1;
else
tmp = t_3;
end
tmp_2 = tmp;
end
NOTE: y and z should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(b * c), $MachinePrecision] + N[(-4.0 * N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision]}, Block[{t$95$3 = N[(x * N[(N[(18.0 * N[(y * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(4.0 * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -2.45e+73], t$95$3, If[LessEqual[x, -1.4e+33], t$95$2, If[LessEqual[x, -1.55e-21], t$95$3, If[LessEqual[x, 5.8e-87], t$95$2, If[LessEqual[x, 5.2e+143], N[(N[(t * N[(N[(18.0 * N[(y * N[(x * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(a * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], t$95$3]]]]]]]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
\\
\begin{array}{l}
t_1 := 27 \cdot \left(j \cdot k\right)\\
t_2 := \left(b \cdot c + -4 \cdot \left(t \cdot a\right)\right) - t_1\\
t_3 := x \cdot \left(18 \cdot \left(y \cdot \left(z \cdot t\right)\right) - 4 \cdot i\right)\\
\mathbf{if}\;x \leq -2.45 \cdot 10^{+73}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;x \leq -1.4 \cdot 10^{+33}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x \leq -1.55 \cdot 10^{-21}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;x \leq 5.8 \cdot 10^{-87}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x \leq 5.2 \cdot 10^{+143}:\\
\;\;\;\;t \cdot \left(18 \cdot \left(y \cdot \left(x \cdot z\right)\right) - a \cdot 4\right) - t_1\\
\mathbf{else}:\\
\;\;\;\;t_3\\
\end{array}
\end{array}
if x < -2.45e73 or -1.4e33 < x < -1.5499999999999999e-21 or 5.1999999999999998e143 < x Initial program 75.1%
sub-neg75.1%
associate-+l-75.1%
sub-neg75.1%
sub-neg75.1%
distribute-rgt-out--78.5%
associate-*l*79.7%
distribute-lft-neg-in79.7%
cancel-sign-sub79.7%
associate-*l*79.7%
associate-*l*79.7%
Simplified79.7%
Taylor expanded in x around inf 80.2%
if -2.45e73 < x < -1.4e33 or -1.5499999999999999e-21 < x < 5.7999999999999998e-87Initial program 99.8%
sub-neg99.8%
associate-+l-99.8%
sub-neg99.8%
sub-neg99.8%
distribute-rgt-out--99.8%
associate-*l*95.3%
distribute-lft-neg-in95.3%
cancel-sign-sub95.3%
associate-*l*95.3%
associate-*l*95.4%
Simplified95.4%
Taylor expanded in x around 0 88.4%
if 5.7999999999999998e-87 < x < 5.1999999999999998e143Initial program 84.8%
sub-neg84.8%
associate-+l-84.8%
sub-neg84.8%
sub-neg84.8%
distribute-rgt-out--88.2%
associate-*l*89.8%
distribute-lft-neg-in89.8%
cancel-sign-sub89.8%
associate-*l*89.8%
associate-*l*89.9%
Simplified89.9%
Taylor expanded in i around 0 83.4%
Taylor expanded in c around 0 73.5%
Final simplification82.1%
NOTE: y and z should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(if (<= x 2.95e+23)
(- (+ (* b c) (* -4.0 (* t a))) (+ (* x (* 4.0 i)) (* j (* 27.0 k))))
(if (<= x 2.1e+144)
(- (+ (* t (- (* 18.0 (* y (* x z))) (* a 4.0))) (* b c)) (* 4.0 (* x i)))
(* x (- (* 18.0 (* y (* z t))) (* 4.0 i))))))assert(y < z);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double tmp;
if (x <= 2.95e+23) {
tmp = ((b * c) + (-4.0 * (t * a))) - ((x * (4.0 * i)) + (j * (27.0 * k)));
} else if (x <= 2.1e+144) {
tmp = ((t * ((18.0 * (y * (x * z))) - (a * 4.0))) + (b * c)) - (4.0 * (x * i));
} else {
tmp = x * ((18.0 * (y * (z * t))) - (4.0 * i));
}
return tmp;
}
NOTE: y and z should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: tmp
if (x <= 2.95d+23) then
tmp = ((b * c) + ((-4.0d0) * (t * a))) - ((x * (4.0d0 * i)) + (j * (27.0d0 * k)))
else if (x <= 2.1d+144) then
tmp = ((t * ((18.0d0 * (y * (x * z))) - (a * 4.0d0))) + (b * c)) - (4.0d0 * (x * i))
else
tmp = x * ((18.0d0 * (y * (z * t))) - (4.0d0 * i))
end if
code = tmp
end function
assert y < z;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double tmp;
if (x <= 2.95e+23) {
tmp = ((b * c) + (-4.0 * (t * a))) - ((x * (4.0 * i)) + (j * (27.0 * k)));
} else if (x <= 2.1e+144) {
tmp = ((t * ((18.0 * (y * (x * z))) - (a * 4.0))) + (b * c)) - (4.0 * (x * i));
} else {
tmp = x * ((18.0 * (y * (z * t))) - (4.0 * i));
}
return tmp;
}
[y, z] = sort([y, z]) def code(x, y, z, t, a, b, c, i, j, k): tmp = 0 if x <= 2.95e+23: tmp = ((b * c) + (-4.0 * (t * a))) - ((x * (4.0 * i)) + (j * (27.0 * k))) elif x <= 2.1e+144: tmp = ((t * ((18.0 * (y * (x * z))) - (a * 4.0))) + (b * c)) - (4.0 * (x * i)) else: tmp = x * ((18.0 * (y * (z * t))) - (4.0 * i)) return tmp
y, z = sort([y, z]) function code(x, y, z, t, a, b, c, i, j, k) tmp = 0.0 if (x <= 2.95e+23) tmp = Float64(Float64(Float64(b * c) + Float64(-4.0 * Float64(t * a))) - Float64(Float64(x * Float64(4.0 * i)) + Float64(j * Float64(27.0 * k)))); elseif (x <= 2.1e+144) tmp = Float64(Float64(Float64(t * Float64(Float64(18.0 * Float64(y * Float64(x * z))) - Float64(a * 4.0))) + Float64(b * c)) - Float64(4.0 * Float64(x * i))); 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])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
tmp = 0.0;
if (x <= 2.95e+23)
tmp = ((b * c) + (-4.0 * (t * a))) - ((x * (4.0 * i)) + (j * (27.0 * k)));
elseif (x <= 2.1e+144)
tmp = ((t * ((18.0 * (y * (x * z))) - (a * 4.0))) + (b * c)) - (4.0 * (x * i));
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. code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := If[LessEqual[x, 2.95e+23], N[(N[(N[(b * c), $MachinePrecision] + N[(-4.0 * N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(x * N[(4.0 * i), $MachinePrecision]), $MachinePrecision] + N[(j * N[(27.0 * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 2.1e+144], N[(N[(N[(t * N[(N[(18.0 * N[(y * N[(x * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(a * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(b * c), $MachinePrecision]), $MachinePrecision] - N[(4.0 * N[(x * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 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])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq 2.95 \cdot 10^{+23}:\\
\;\;\;\;\left(b \cdot c + -4 \cdot \left(t \cdot a\right)\right) - \left(x \cdot \left(4 \cdot i\right) + j \cdot \left(27 \cdot k\right)\right)\\
\mathbf{elif}\;x \leq 2.1 \cdot 10^{+144}:\\
\;\;\;\;\left(t \cdot \left(18 \cdot \left(y \cdot \left(x \cdot z\right)\right) - a \cdot 4\right) + b \cdot c\right) - 4 \cdot \left(x \cdot i\right)\\
\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 x < 2.94999999999999994e23Initial program 93.9%
sub-neg93.9%
associate-+l-93.9%
sub-neg93.9%
sub-neg93.9%
distribute-rgt-out--94.4%
associate-*l*91.8%
distribute-lft-neg-in91.8%
cancel-sign-sub91.8%
associate-*l*91.8%
associate-*l*91.8%
Simplified91.8%
Taylor expanded in t around 0 95.0%
Taylor expanded in y around 0 89.9%
if 2.94999999999999994e23 < x < 2.09999999999999996e144Initial program 79.6%
sub-neg79.6%
associate-+l-79.6%
sub-neg79.6%
sub-neg79.6%
distribute-rgt-out--85.5%
associate-*l*91.0%
distribute-lft-neg-in91.0%
cancel-sign-sub91.0%
associate-*l*91.0%
associate-*l*91.1%
Simplified91.1%
Taylor expanded in j around 0 88.4%
if 2.09999999999999996e144 < x Initial program 66.8%
sub-neg66.8%
associate-+l-66.8%
sub-neg66.8%
sub-neg66.8%
distribute-rgt-out--71.9%
associate-*l*72.0%
distribute-lft-neg-in72.0%
cancel-sign-sub72.0%
associate-*l*72.0%
associate-*l*72.0%
Simplified72.0%
Taylor expanded in x around inf 89.8%
Final simplification89.7%
NOTE: y and z should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(if (<= x 18000.0)
(- (+ (* b c) (* -4.0 (* t a))) (+ (* x (* 4.0 i)) (* j (* 27.0 k))))
(if (<= x 1.42e+144)
(-
(+ (* t (- (* 18.0 (* y (* x z))) (* a 4.0))) (* b c))
(* 27.0 (* j k)))
(* x (- (* 18.0 (* y (* z t))) (* 4.0 i))))))assert(y < z);
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 <= 18000.0) {
tmp = ((b * c) + (-4.0 * (t * a))) - ((x * (4.0 * i)) + (j * (27.0 * k)));
} else if (x <= 1.42e+144) {
tmp = ((t * ((18.0 * (y * (x * z))) - (a * 4.0))) + (b * c)) - (27.0 * (j * k));
} else {
tmp = x * ((18.0 * (y * (z * t))) - (4.0 * i));
}
return tmp;
}
NOTE: y and z 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 <= 18000.0d0) then
tmp = ((b * c) + ((-4.0d0) * (t * a))) - ((x * (4.0d0 * i)) + (j * (27.0d0 * k)))
else if (x <= 1.42d+144) then
tmp = ((t * ((18.0d0 * (y * (x * z))) - (a * 4.0d0))) + (b * c)) - (27.0d0 * (j * k))
else
tmp = x * ((18.0d0 * (y * (z * t))) - (4.0d0 * i))
end if
code = tmp
end function
assert y < z;
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 <= 18000.0) {
tmp = ((b * c) + (-4.0 * (t * a))) - ((x * (4.0 * i)) + (j * (27.0 * k)));
} else if (x <= 1.42e+144) {
tmp = ((t * ((18.0 * (y * (x * z))) - (a * 4.0))) + (b * c)) - (27.0 * (j * k));
} else {
tmp = x * ((18.0 * (y * (z * t))) - (4.0 * i));
}
return tmp;
}
[y, z] = sort([y, z]) def code(x, y, z, t, a, b, c, i, j, k): tmp = 0 if x <= 18000.0: tmp = ((b * c) + (-4.0 * (t * a))) - ((x * (4.0 * i)) + (j * (27.0 * k))) elif x <= 1.42e+144: tmp = ((t * ((18.0 * (y * (x * z))) - (a * 4.0))) + (b * c)) - (27.0 * (j * k)) else: tmp = x * ((18.0 * (y * (z * t))) - (4.0 * i)) return tmp
y, z = sort([y, z]) function code(x, y, z, t, a, b, c, i, j, k) tmp = 0.0 if (x <= 18000.0) tmp = Float64(Float64(Float64(b * c) + Float64(-4.0 * Float64(t * a))) - Float64(Float64(x * Float64(4.0 * i)) + Float64(j * Float64(27.0 * k)))); elseif (x <= 1.42e+144) tmp = Float64(Float64(Float64(t * Float64(Float64(18.0 * Float64(y * Float64(x * z))) - Float64(a * 4.0))) + Float64(b * c)) - Float64(27.0 * Float64(j * k))); 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])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
tmp = 0.0;
if (x <= 18000.0)
tmp = ((b * c) + (-4.0 * (t * a))) - ((x * (4.0 * i)) + (j * (27.0 * k)));
elseif (x <= 1.42e+144)
tmp = ((t * ((18.0 * (y * (x * z))) - (a * 4.0))) + (b * c)) - (27.0 * (j * k));
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. code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := If[LessEqual[x, 18000.0], N[(N[(N[(b * c), $MachinePrecision] + N[(-4.0 * N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(x * N[(4.0 * i), $MachinePrecision]), $MachinePrecision] + N[(j * N[(27.0 * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.42e+144], N[(N[(N[(t * N[(N[(18.0 * N[(y * N[(x * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(a * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(b * c), $MachinePrecision]), $MachinePrecision] - N[(27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 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])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq 18000:\\
\;\;\;\;\left(b \cdot c + -4 \cdot \left(t \cdot a\right)\right) - \left(x \cdot \left(4 \cdot i\right) + j \cdot \left(27 \cdot k\right)\right)\\
\mathbf{elif}\;x \leq 1.42 \cdot 10^{+144}:\\
\;\;\;\;\left(t \cdot \left(18 \cdot \left(y \cdot \left(x \cdot z\right)\right) - a \cdot 4\right) + b \cdot c\right) - 27 \cdot \left(j \cdot k\right)\\
\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 x < 18000Initial program 93.7%
sub-neg93.7%
associate-+l-93.7%
sub-neg93.7%
sub-neg93.7%
distribute-rgt-out--94.3%
associate-*l*91.6%
distribute-lft-neg-in91.6%
cancel-sign-sub91.6%
associate-*l*91.6%
associate-*l*91.6%
Simplified91.6%
Taylor expanded in t around 0 94.9%
Taylor expanded in y around 0 89.6%
if 18000 < x < 1.42000000000000009e144Initial program 81.8%
sub-neg81.8%
associate-+l-81.8%
sub-neg81.8%
sub-neg81.8%
distribute-rgt-out--87.0%
associate-*l*92.0%
distribute-lft-neg-in92.0%
cancel-sign-sub92.0%
associate-*l*92.0%
associate-*l*92.0%
Simplified92.0%
Taylor expanded in i around 0 89.8%
if 1.42000000000000009e144 < x Initial program 66.8%
sub-neg66.8%
associate-+l-66.8%
sub-neg66.8%
sub-neg66.8%
distribute-rgt-out--71.9%
associate-*l*72.0%
distribute-lft-neg-in72.0%
cancel-sign-sub72.0%
associate-*l*72.0%
associate-*l*72.0%
Simplified72.0%
Taylor expanded in x around inf 89.8%
Final simplification89.7%
NOTE: y and z should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(if (<= y -1.12e+142)
(+
(* b c)
(+ (* (* j k) -27.0) (* x (+ (* 18.0 (* y (* z t))) (* i -4.0)))))
(if (<= y 1.7e-21)
(- (- (- (* b c) (* 4.0 (* t a))) (* (* x 4.0) i)) (* (* j 27.0) k))
(- (* t (- (* 18.0 (* y (* x z))) (* a 4.0))) (* 27.0 (* j k))))))assert(y < z);
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 (y <= -1.12e+142) {
tmp = (b * c) + (((j * k) * -27.0) + (x * ((18.0 * (y * (z * t))) + (i * -4.0))));
} else if (y <= 1.7e-21) {
tmp = (((b * c) - (4.0 * (t * a))) - ((x * 4.0) * i)) - ((j * 27.0) * k);
} else {
tmp = (t * ((18.0 * (y * (x * z))) - (a * 4.0))) - (27.0 * (j * k));
}
return tmp;
}
NOTE: y and z 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 (y <= (-1.12d+142)) then
tmp = (b * c) + (((j * k) * (-27.0d0)) + (x * ((18.0d0 * (y * (z * t))) + (i * (-4.0d0)))))
else if (y <= 1.7d-21) then
tmp = (((b * c) - (4.0d0 * (t * a))) - ((x * 4.0d0) * i)) - ((j * 27.0d0) * k)
else
tmp = (t * ((18.0d0 * (y * (x * z))) - (a * 4.0d0))) - (27.0d0 * (j * k))
end if
code = tmp
end function
assert y < z;
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 (y <= -1.12e+142) {
tmp = (b * c) + (((j * k) * -27.0) + (x * ((18.0 * (y * (z * t))) + (i * -4.0))));
} else if (y <= 1.7e-21) {
tmp = (((b * c) - (4.0 * (t * a))) - ((x * 4.0) * i)) - ((j * 27.0) * k);
} else {
tmp = (t * ((18.0 * (y * (x * z))) - (a * 4.0))) - (27.0 * (j * k));
}
return tmp;
}
[y, z] = sort([y, z]) def code(x, y, z, t, a, b, c, i, j, k): tmp = 0 if y <= -1.12e+142: tmp = (b * c) + (((j * k) * -27.0) + (x * ((18.0 * (y * (z * t))) + (i * -4.0)))) elif y <= 1.7e-21: tmp = (((b * c) - (4.0 * (t * a))) - ((x * 4.0) * i)) - ((j * 27.0) * k) else: tmp = (t * ((18.0 * (y * (x * z))) - (a * 4.0))) - (27.0 * (j * k)) return tmp
y, z = sort([y, z]) function code(x, y, z, t, a, b, c, i, j, k) tmp = 0.0 if (y <= -1.12e+142) tmp = Float64(Float64(b * c) + Float64(Float64(Float64(j * k) * -27.0) + Float64(x * Float64(Float64(18.0 * Float64(y * Float64(z * t))) + Float64(i * -4.0))))); elseif (y <= 1.7e-21) tmp = Float64(Float64(Float64(Float64(b * c) - Float64(4.0 * Float64(t * a))) - Float64(Float64(x * 4.0) * i)) - Float64(Float64(j * 27.0) * k)); else tmp = Float64(Float64(t * Float64(Float64(18.0 * Float64(y * Float64(x * z))) - Float64(a * 4.0))) - Float64(27.0 * Float64(j * k))); end return tmp end
y, z = num2cell(sort([y, z])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
tmp = 0.0;
if (y <= -1.12e+142)
tmp = (b * c) + (((j * k) * -27.0) + (x * ((18.0 * (y * (z * t))) + (i * -4.0))));
elseif (y <= 1.7e-21)
tmp = (((b * c) - (4.0 * (t * a))) - ((x * 4.0) * i)) - ((j * 27.0) * k);
else
tmp = (t * ((18.0 * (y * (x * z))) - (a * 4.0))) - (27.0 * (j * k));
end
tmp_2 = tmp;
end
NOTE: y and z should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := If[LessEqual[y, -1.12e+142], N[(N[(b * c), $MachinePrecision] + N[(N[(N[(j * k), $MachinePrecision] * -27.0), $MachinePrecision] + N[(x * N[(N[(18.0 * N[(y * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(i * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.7e-21], N[(N[(N[(N[(b * c), $MachinePrecision] - N[(4.0 * N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(x * 4.0), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision] - N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision], N[(N[(t * N[(N[(18.0 * N[(y * N[(x * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(a * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.12 \cdot 10^{+142}:\\
\;\;\;\;b \cdot c + \left(\left(j \cdot k\right) \cdot -27 + x \cdot \left(18 \cdot \left(y \cdot \left(z \cdot t\right)\right) + i \cdot -4\right)\right)\\
\mathbf{elif}\;y \leq 1.7 \cdot 10^{-21}:\\
\;\;\;\;\left(\left(b \cdot c - 4 \cdot \left(t \cdot a\right)\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k\\
\mathbf{else}:\\
\;\;\;\;t \cdot \left(18 \cdot \left(y \cdot \left(x \cdot z\right)\right) - a \cdot 4\right) - 27 \cdot \left(j \cdot k\right)\\
\end{array}
\end{array}
if y < -1.11999999999999996e142Initial program 74.5%
Simplified74.5%
Taylor expanded in a around 0 82.9%
if -1.11999999999999996e142 < y < 1.7e-21Initial program 92.6%
Taylor expanded in x around 0 88.7%
if 1.7e-21 < y Initial program 84.5%
sub-neg84.5%
associate-+l-84.5%
sub-neg84.5%
sub-neg84.5%
distribute-rgt-out--87.3%
associate-*l*85.9%
distribute-lft-neg-in85.9%
cancel-sign-sub85.9%
associate-*l*85.9%
associate-*l*86.0%
Simplified86.0%
Taylor expanded in i around 0 87.6%
Taylor expanded in c around 0 74.5%
Final simplification84.0%
NOTE: y and z 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.4e+70)
(and (not (<= x -1.06e+33))
(or (<= x -1.02e-23) (not (<= x 7.8e+23)))))
(* x (- (* 18.0 (* y (* z t))) (* 4.0 i)))
(- (+ (* b c) (* -4.0 (* t a))) (* 27.0 (* j k)))))assert(y < z);
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.4e+70) || (!(x <= -1.06e+33) && ((x <= -1.02e-23) || !(x <= 7.8e+23)))) {
tmp = x * ((18.0 * (y * (z * t))) - (4.0 * i));
} else {
tmp = ((b * c) + (-4.0 * (t * a))) - (27.0 * (j * k));
}
return tmp;
}
NOTE: y and z 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.4d+70)) .or. (.not. (x <= (-1.06d+33))) .and. (x <= (-1.02d-23)) .or. (.not. (x <= 7.8d+23))) then
tmp = x * ((18.0d0 * (y * (z * t))) - (4.0d0 * i))
else
tmp = ((b * c) + ((-4.0d0) * (t * a))) - (27.0d0 * (j * k))
end if
code = tmp
end function
assert y < z;
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.4e+70) || (!(x <= -1.06e+33) && ((x <= -1.02e-23) || !(x <= 7.8e+23)))) {
tmp = x * ((18.0 * (y * (z * t))) - (4.0 * i));
} else {
tmp = ((b * c) + (-4.0 * (t * a))) - (27.0 * (j * k));
}
return tmp;
}
[y, z] = sort([y, z]) def code(x, y, z, t, a, b, c, i, j, k): tmp = 0 if (x <= -1.4e+70) or (not (x <= -1.06e+33) and ((x <= -1.02e-23) or not (x <= 7.8e+23))): tmp = x * ((18.0 * (y * (z * t))) - (4.0 * i)) else: tmp = ((b * c) + (-4.0 * (t * a))) - (27.0 * (j * k)) return tmp
y, z = sort([y, z]) function code(x, y, z, t, a, b, c, i, j, k) tmp = 0.0 if ((x <= -1.4e+70) || (!(x <= -1.06e+33) && ((x <= -1.02e-23) || !(x <= 7.8e+23)))) 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(27.0 * Float64(j * k))); end return tmp end
y, z = num2cell(sort([y, z])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
tmp = 0.0;
if ((x <= -1.4e+70) || (~((x <= -1.06e+33)) && ((x <= -1.02e-23) || ~((x <= 7.8e+23)))))
tmp = x * ((18.0 * (y * (z * t))) - (4.0 * i));
else
tmp = ((b * c) + (-4.0 * (t * a))) - (27.0 * (j * k));
end
tmp_2 = tmp;
end
NOTE: y and z 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.4e+70], And[N[Not[LessEqual[x, -1.06e+33]], $MachinePrecision], Or[LessEqual[x, -1.02e-23], N[Not[LessEqual[x, 7.8e+23]], $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[(27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.4 \cdot 10^{+70} \lor \neg \left(x \leq -1.06 \cdot 10^{+33}\right) \land \left(x \leq -1.02 \cdot 10^{-23} \lor \neg \left(x \leq 7.8 \cdot 10^{+23}\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) - 27 \cdot \left(j \cdot k\right)\\
\end{array}
\end{array}
if x < -1.39999999999999995e70 or -1.06e33 < x < -1.02000000000000005e-23 or 7.8000000000000001e23 < x Initial program 76.3%
sub-neg76.3%
associate-+l-76.3%
sub-neg76.3%
sub-neg76.3%
distribute-rgt-out--80.4%
associate-*l*82.8%
distribute-lft-neg-in82.8%
cancel-sign-sub82.8%
associate-*l*82.8%
associate-*l*82.9%
Simplified82.9%
Taylor expanded in x around inf 74.5%
if -1.39999999999999995e70 < x < -1.06e33 or -1.02000000000000005e-23 < x < 7.8000000000000001e23Initial program 98.3%
sub-neg98.3%
associate-+l-98.3%
sub-neg98.3%
sub-neg98.3%
distribute-rgt-out--98.3%
associate-*l*94.0%
distribute-lft-neg-in94.0%
cancel-sign-sub94.0%
associate-*l*94.0%
associate-*l*94.0%
Simplified94.0%
Taylor expanded in x around 0 84.7%
Final simplification79.8%
NOTE: y and z should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(if (<= x 34000000000.0)
(- (+ (* b c) (* -4.0 (* t a))) (+ (* x (* 4.0 i)) (* j (* 27.0 k))))
(if (<= x 1.32e+144)
(- (* t (- (* 18.0 (* y (* x z))) (* a 4.0))) (* 27.0 (* j k)))
(* x (- (* 18.0 (* y (* z t))) (* 4.0 i))))))assert(y < z);
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 <= 34000000000.0) {
tmp = ((b * c) + (-4.0 * (t * a))) - ((x * (4.0 * i)) + (j * (27.0 * k)));
} else if (x <= 1.32e+144) {
tmp = (t * ((18.0 * (y * (x * z))) - (a * 4.0))) - (27.0 * (j * k));
} else {
tmp = x * ((18.0 * (y * (z * t))) - (4.0 * i));
}
return tmp;
}
NOTE: y and z 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 <= 34000000000.0d0) then
tmp = ((b * c) + ((-4.0d0) * (t * a))) - ((x * (4.0d0 * i)) + (j * (27.0d0 * k)))
else if (x <= 1.32d+144) then
tmp = (t * ((18.0d0 * (y * (x * z))) - (a * 4.0d0))) - (27.0d0 * (j * k))
else
tmp = x * ((18.0d0 * (y * (z * t))) - (4.0d0 * i))
end if
code = tmp
end function
assert y < z;
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 <= 34000000000.0) {
tmp = ((b * c) + (-4.0 * (t * a))) - ((x * (4.0 * i)) + (j * (27.0 * k)));
} else if (x <= 1.32e+144) {
tmp = (t * ((18.0 * (y * (x * z))) - (a * 4.0))) - (27.0 * (j * k));
} else {
tmp = x * ((18.0 * (y * (z * t))) - (4.0 * i));
}
return tmp;
}
[y, z] = sort([y, z]) def code(x, y, z, t, a, b, c, i, j, k): tmp = 0 if x <= 34000000000.0: tmp = ((b * c) + (-4.0 * (t * a))) - ((x * (4.0 * i)) + (j * (27.0 * k))) elif x <= 1.32e+144: tmp = (t * ((18.0 * (y * (x * z))) - (a * 4.0))) - (27.0 * (j * k)) else: tmp = x * ((18.0 * (y * (z * t))) - (4.0 * i)) return tmp
y, z = sort([y, z]) function code(x, y, z, t, a, b, c, i, j, k) tmp = 0.0 if (x <= 34000000000.0) tmp = Float64(Float64(Float64(b * c) + Float64(-4.0 * Float64(t * a))) - Float64(Float64(x * Float64(4.0 * i)) + Float64(j * Float64(27.0 * k)))); elseif (x <= 1.32e+144) tmp = Float64(Float64(t * Float64(Float64(18.0 * Float64(y * Float64(x * z))) - Float64(a * 4.0))) - Float64(27.0 * Float64(j * k))); 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])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
tmp = 0.0;
if (x <= 34000000000.0)
tmp = ((b * c) + (-4.0 * (t * a))) - ((x * (4.0 * i)) + (j * (27.0 * k)));
elseif (x <= 1.32e+144)
tmp = (t * ((18.0 * (y * (x * z))) - (a * 4.0))) - (27.0 * (j * k));
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. code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := If[LessEqual[x, 34000000000.0], N[(N[(N[(b * c), $MachinePrecision] + N[(-4.0 * N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(x * N[(4.0 * i), $MachinePrecision]), $MachinePrecision] + N[(j * N[(27.0 * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.32e+144], N[(N[(t * N[(N[(18.0 * N[(y * N[(x * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(a * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 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])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq 34000000000:\\
\;\;\;\;\left(b \cdot c + -4 \cdot \left(t \cdot a\right)\right) - \left(x \cdot \left(4 \cdot i\right) + j \cdot \left(27 \cdot k\right)\right)\\
\mathbf{elif}\;x \leq 1.32 \cdot 10^{+144}:\\
\;\;\;\;t \cdot \left(18 \cdot \left(y \cdot \left(x \cdot z\right)\right) - a \cdot 4\right) - 27 \cdot \left(j \cdot k\right)\\
\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 x < 3.4e10Initial program 93.8%
sub-neg93.8%
associate-+l-93.8%
sub-neg93.8%
sub-neg93.8%
distribute-rgt-out--94.4%
associate-*l*91.7%
distribute-lft-neg-in91.7%
cancel-sign-sub91.7%
associate-*l*91.7%
associate-*l*91.7%
Simplified91.7%
Taylor expanded in t around 0 95.0%
Taylor expanded in y around 0 89.8%
if 3.4e10 < x < 1.32e144Initial program 80.7%
sub-neg80.7%
associate-+l-80.7%
sub-neg80.7%
sub-neg80.7%
distribute-rgt-out--86.3%
associate-*l*91.5%
distribute-lft-neg-in91.5%
cancel-sign-sub91.5%
associate-*l*91.5%
associate-*l*91.6%
Simplified91.6%
Taylor expanded in i around 0 89.2%
Taylor expanded in c around 0 78.4%
if 1.32e144 < x Initial program 66.8%
sub-neg66.8%
associate-+l-66.8%
sub-neg66.8%
sub-neg66.8%
distribute-rgt-out--71.9%
associate-*l*72.0%
distribute-lft-neg-in72.0%
cancel-sign-sub72.0%
associate-*l*72.0%
associate-*l*72.0%
Simplified72.0%
Taylor expanded in x around inf 89.8%
Final simplification88.2%
NOTE: y and z 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 (* (* 18.0 y) (* t (* x z)))))
(if (<= z -5.6e-82)
t_2
(if (<= z 1.4e-45)
t_1
(if (<= z 0.00088)
(* j (* k -27.0))
(if (<= z 3.7e+66)
t_1
(if (<= z 3e+141)
t_2
(if (<= z 4.8e+217)
(* -4.0 (+ (* t a) (* x i)))
(* (* x (* y z)) (* 18.0 t))))))))))assert(y < z);
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 = (18.0 * y) * (t * (x * z));
double tmp;
if (z <= -5.6e-82) {
tmp = t_2;
} else if (z <= 1.4e-45) {
tmp = t_1;
} else if (z <= 0.00088) {
tmp = j * (k * -27.0);
} else if (z <= 3.7e+66) {
tmp = t_1;
} else if (z <= 3e+141) {
tmp = t_2;
} else if (z <= 4.8e+217) {
tmp = -4.0 * ((t * a) + (x * i));
} else {
tmp = (x * (y * z)) * (18.0 * t);
}
return tmp;
}
NOTE: y and z 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 * (x * i))
t_2 = (18.0d0 * y) * (t * (x * z))
if (z <= (-5.6d-82)) then
tmp = t_2
else if (z <= 1.4d-45) then
tmp = t_1
else if (z <= 0.00088d0) then
tmp = j * (k * (-27.0d0))
else if (z <= 3.7d+66) then
tmp = t_1
else if (z <= 3d+141) then
tmp = t_2
else if (z <= 4.8d+217) then
tmp = (-4.0d0) * ((t * a) + (x * i))
else
tmp = (x * (y * z)) * (18.0d0 * t)
end if
code = tmp
end function
assert y < z;
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 = (18.0 * y) * (t * (x * z));
double tmp;
if (z <= -5.6e-82) {
tmp = t_2;
} else if (z <= 1.4e-45) {
tmp = t_1;
} else if (z <= 0.00088) {
tmp = j * (k * -27.0);
} else if (z <= 3.7e+66) {
tmp = t_1;
} else if (z <= 3e+141) {
tmp = t_2;
} else if (z <= 4.8e+217) {
tmp = -4.0 * ((t * a) + (x * i));
} else {
tmp = (x * (y * z)) * (18.0 * t);
}
return tmp;
}
[y, z] = sort([y, z]) def code(x, y, z, t, a, b, c, i, j, k): t_1 = (b * c) - (4.0 * (x * i)) t_2 = (18.0 * y) * (t * (x * z)) tmp = 0 if z <= -5.6e-82: tmp = t_2 elif z <= 1.4e-45: tmp = t_1 elif z <= 0.00088: tmp = j * (k * -27.0) elif z <= 3.7e+66: tmp = t_1 elif z <= 3e+141: tmp = t_2 elif z <= 4.8e+217: tmp = -4.0 * ((t * a) + (x * i)) else: tmp = (x * (y * z)) * (18.0 * t) return tmp
y, z = sort([y, z]) 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(18.0 * y) * Float64(t * Float64(x * z))) tmp = 0.0 if (z <= -5.6e-82) tmp = t_2; elseif (z <= 1.4e-45) tmp = t_1; elseif (z <= 0.00088) tmp = Float64(j * Float64(k * -27.0)); elseif (z <= 3.7e+66) tmp = t_1; elseif (z <= 3e+141) tmp = t_2; elseif (z <= 4.8e+217) tmp = Float64(-4.0 * Float64(Float64(t * a) + Float64(x * i))); else tmp = Float64(Float64(x * Float64(y * z)) * Float64(18.0 * t)); end return tmp end
y, z = num2cell(sort([y, z])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
t_1 = (b * c) - (4.0 * (x * i));
t_2 = (18.0 * y) * (t * (x * z));
tmp = 0.0;
if (z <= -5.6e-82)
tmp = t_2;
elseif (z <= 1.4e-45)
tmp = t_1;
elseif (z <= 0.00088)
tmp = j * (k * -27.0);
elseif (z <= 3.7e+66)
tmp = t_1;
elseif (z <= 3e+141)
tmp = t_2;
elseif (z <= 4.8e+217)
tmp = -4.0 * ((t * a) + (x * i));
else
tmp = (x * (y * z)) * (18.0 * t);
end
tmp_2 = tmp;
end
NOTE: y and z 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[(18.0 * y), $MachinePrecision] * N[(t * N[(x * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -5.6e-82], t$95$2, If[LessEqual[z, 1.4e-45], t$95$1, If[LessEqual[z, 0.00088], N[(j * N[(k * -27.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.7e+66], t$95$1, If[LessEqual[z, 3e+141], t$95$2, If[LessEqual[z, 4.8e+217], N[(-4.0 * N[(N[(t * a), $MachinePrecision] + N[(x * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * N[(y * z), $MachinePrecision]), $MachinePrecision] * N[(18.0 * t), $MachinePrecision]), $MachinePrecision]]]]]]]]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
\\
\begin{array}{l}
t_1 := b \cdot c - 4 \cdot \left(x \cdot i\right)\\
t_2 := \left(18 \cdot y\right) \cdot \left(t \cdot \left(x \cdot z\right)\right)\\
\mathbf{if}\;z \leq -5.6 \cdot 10^{-82}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq 1.4 \cdot 10^{-45}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 0.00088:\\
\;\;\;\;j \cdot \left(k \cdot -27\right)\\
\mathbf{elif}\;z \leq 3.7 \cdot 10^{+66}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 3 \cdot 10^{+141}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq 4.8 \cdot 10^{+217}:\\
\;\;\;\;-4 \cdot \left(t \cdot a + x \cdot i\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x \cdot \left(y \cdot z\right)\right) \cdot \left(18 \cdot t\right)\\
\end{array}
\end{array}
if z < -5.60000000000000049e-82 or 3.7e66 < z < 2.9999999999999999e141Initial program 89.8%
sub-neg89.8%
associate-+l-89.8%
sub-neg89.8%
sub-neg89.8%
distribute-rgt-out--90.8%
associate-*l*87.8%
distribute-lft-neg-in87.8%
cancel-sign-sub87.8%
associate-*l*87.8%
associate-*l*87.9%
Simplified87.9%
Taylor expanded in t around 0 88.9%
Taylor expanded in y around inf 44.2%
associate-*r*44.2%
*-commutative44.2%
Simplified44.2%
if -5.60000000000000049e-82 < z < 1.4000000000000001e-45 or 8.80000000000000031e-4 < z < 3.7e66Initial program 87.3%
sub-neg87.3%
associate-+l-87.3%
sub-neg87.3%
sub-neg87.3%
distribute-rgt-out--89.0%
associate-*l*90.6%
distribute-lft-neg-in90.6%
cancel-sign-sub90.6%
associate-*l*90.6%
associate-*l*90.7%
Simplified90.7%
Taylor expanded in j around 0 73.6%
Taylor expanded in c around inf 53.3%
if 1.4000000000000001e-45 < z < 8.80000000000000031e-4Initial program 89.8%
sub-neg89.8%
associate-+l-89.8%
sub-neg89.8%
sub-neg89.8%
distribute-rgt-out--89.8%
associate-*l*89.8%
distribute-lft-neg-in89.8%
cancel-sign-sub89.8%
associate-*l*89.8%
associate-*l*90.0%
Simplified90.0%
Taylor expanded in i around 0 89.7%
add-cube-cbrt89.0%
Applied egg-rr89.0%
Taylor expanded in k around inf 60.7%
*-commutative60.7%
*-commutative60.7%
associate-*l*61.0%
Simplified61.0%
if 2.9999999999999999e141 < z < 4.7999999999999996e217Initial program 87.0%
sub-neg87.0%
+-commutative87.0%
associate-*l*86.9%
distribute-rgt-neg-in86.9%
fma-def86.9%
*-commutative86.9%
distribute-rgt-neg-in86.9%
metadata-eval86.9%
sub-neg86.9%
+-commutative86.9%
associate-*l*86.9%
distribute-rgt-neg-in86.9%
Simplified86.9%
Taylor expanded in a around inf 80.8%
Taylor expanded in j around 0 61.6%
distribute-lft-out61.6%
*-commutative61.6%
Simplified61.6%
if 4.7999999999999996e217 < z Initial program 79.5%
sub-neg79.5%
associate-+l-79.5%
sub-neg79.5%
sub-neg79.5%
distribute-rgt-out--92.8%
associate-*l*79.8%
distribute-lft-neg-in79.8%
cancel-sign-sub79.8%
associate-*l*79.8%
associate-*l*80.0%
Simplified80.0%
Taylor expanded in t around 0 87.0%
Taylor expanded in y around inf 55.0%
*-commutative55.0%
associate-*r*55.0%
associate-*l*55.0%
*-commutative55.0%
associate-*l*55.0%
associate-*r*60.7%
*-commutative60.7%
Simplified60.7%
Final simplification51.0%
NOTE: y and z should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(if (or (<= x -3.2e+64)
(not
(or (<= x -1.35e+34) (and (not (<= x -1.8e-21)) (<= x 5.6e+24)))))
(* x (- (* 18.0 (* y (* z t))) (* 4.0 i)))
(- (* b c) (* 27.0 (* j k)))))assert(y < z);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double tmp;
if ((x <= -3.2e+64) || !((x <= -1.35e+34) || (!(x <= -1.8e-21) && (x <= 5.6e+24)))) {
tmp = x * ((18.0 * (y * (z * t))) - (4.0 * i));
} else {
tmp = (b * c) - (27.0 * (j * k));
}
return tmp;
}
NOTE: y and z should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: tmp
if ((x <= (-3.2d+64)) .or. (.not. (x <= (-1.35d+34)) .or. (.not. (x <= (-1.8d-21))) .and. (x <= 5.6d+24))) then
tmp = x * ((18.0d0 * (y * (z * t))) - (4.0d0 * i))
else
tmp = (b * c) - (27.0d0 * (j * k))
end if
code = tmp
end function
assert y < z;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double tmp;
if ((x <= -3.2e+64) || !((x <= -1.35e+34) || (!(x <= -1.8e-21) && (x <= 5.6e+24)))) {
tmp = x * ((18.0 * (y * (z * t))) - (4.0 * i));
} else {
tmp = (b * c) - (27.0 * (j * k));
}
return tmp;
}
[y, z] = sort([y, z]) def code(x, y, z, t, a, b, c, i, j, k): tmp = 0 if (x <= -3.2e+64) or not ((x <= -1.35e+34) or (not (x <= -1.8e-21) and (x <= 5.6e+24))): tmp = x * ((18.0 * (y * (z * t))) - (4.0 * i)) else: tmp = (b * c) - (27.0 * (j * k)) return tmp
y, z = sort([y, z]) function code(x, y, z, t, a, b, c, i, j, k) tmp = 0.0 if ((x <= -3.2e+64) || !((x <= -1.35e+34) || (!(x <= -1.8e-21) && (x <= 5.6e+24)))) tmp = Float64(x * Float64(Float64(18.0 * Float64(y * Float64(z * t))) - Float64(4.0 * i))); else tmp = Float64(Float64(b * c) - Float64(27.0 * Float64(j * k))); end return tmp end
y, z = num2cell(sort([y, z])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
tmp = 0.0;
if ((x <= -3.2e+64) || ~(((x <= -1.35e+34) || (~((x <= -1.8e-21)) && (x <= 5.6e+24)))))
tmp = x * ((18.0 * (y * (z * t))) - (4.0 * i));
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. code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := If[Or[LessEqual[x, -3.2e+64], N[Not[Or[LessEqual[x, -1.35e+34], And[N[Not[LessEqual[x, -1.8e-21]], $MachinePrecision], LessEqual[x, 5.6e+24]]]], $MachinePrecision]], N[(x * N[(N[(18.0 * N[(y * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(4.0 * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(b * c), $MachinePrecision] - N[(27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -3.2 \cdot 10^{+64} \lor \neg \left(x \leq -1.35 \cdot 10^{+34} \lor \neg \left(x \leq -1.8 \cdot 10^{-21}\right) \land x \leq 5.6 \cdot 10^{+24}\right):\\
\;\;\;\;x \cdot \left(18 \cdot \left(y \cdot \left(z \cdot t\right)\right) - 4 \cdot i\right)\\
\mathbf{else}:\\
\;\;\;\;b \cdot c - 27 \cdot \left(j \cdot k\right)\\
\end{array}
\end{array}
if x < -3.20000000000000019e64 or -1.35e34 < x < -1.79999999999999995e-21 or 5.6000000000000003e24 < x Initial program 76.3%
sub-neg76.3%
associate-+l-76.3%
sub-neg76.3%
sub-neg76.3%
distribute-rgt-out--80.4%
associate-*l*82.8%
distribute-lft-neg-in82.8%
cancel-sign-sub82.8%
associate-*l*82.8%
associate-*l*82.9%
Simplified82.9%
Taylor expanded in x around inf 74.5%
if -3.20000000000000019e64 < x < -1.35e34 or -1.79999999999999995e-21 < x < 5.6000000000000003e24Initial program 98.3%
sub-neg98.3%
associate-+l-98.3%
sub-neg98.3%
sub-neg98.3%
distribute-rgt-out--98.3%
associate-*l*94.0%
distribute-lft-neg-in94.0%
cancel-sign-sub94.0%
associate-*l*94.0%
associate-*l*94.0%
Simplified94.0%
Taylor expanded in i around 0 90.5%
Taylor expanded in t around 0 66.8%
Final simplification70.5%
NOTE: y and z should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (* -4.0 (+ (* t a) (* x i)))) (t_2 (* (* 18.0 y) (* t (* x z)))))
(if (<= z -3.5e-5)
t_2
(if (<= z 1.5e-32)
t_1
(if (<= z 5.5e+57)
(* j (* k -27.0))
(if (or (<= z 2.8e+141) (not (<= z 5.5e+217))) t_2 t_1))))))assert(y < z);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = -4.0 * ((t * a) + (x * i));
double t_2 = (18.0 * y) * (t * (x * z));
double tmp;
if (z <= -3.5e-5) {
tmp = t_2;
} else if (z <= 1.5e-32) {
tmp = t_1;
} else if (z <= 5.5e+57) {
tmp = j * (k * -27.0);
} else if ((z <= 2.8e+141) || !(z <= 5.5e+217)) {
tmp = t_2;
} else {
tmp = t_1;
}
return tmp;
}
NOTE: y and z should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (-4.0d0) * ((t * a) + (x * i))
t_2 = (18.0d0 * y) * (t * (x * z))
if (z <= (-3.5d-5)) then
tmp = t_2
else if (z <= 1.5d-32) then
tmp = t_1
else if (z <= 5.5d+57) then
tmp = j * (k * (-27.0d0))
else if ((z <= 2.8d+141) .or. (.not. (z <= 5.5d+217))) then
tmp = t_2
else
tmp = t_1
end if
code = tmp
end function
assert y < z;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = -4.0 * ((t * a) + (x * i));
double t_2 = (18.0 * y) * (t * (x * z));
double tmp;
if (z <= -3.5e-5) {
tmp = t_2;
} else if (z <= 1.5e-32) {
tmp = t_1;
} else if (z <= 5.5e+57) {
tmp = j * (k * -27.0);
} else if ((z <= 2.8e+141) || !(z <= 5.5e+217)) {
tmp = t_2;
} else {
tmp = t_1;
}
return tmp;
}
[y, z] = sort([y, z]) def code(x, y, z, t, a, b, c, i, j, k): t_1 = -4.0 * ((t * a) + (x * i)) t_2 = (18.0 * y) * (t * (x * z)) tmp = 0 if z <= -3.5e-5: tmp = t_2 elif z <= 1.5e-32: tmp = t_1 elif z <= 5.5e+57: tmp = j * (k * -27.0) elif (z <= 2.8e+141) or not (z <= 5.5e+217): tmp = t_2 else: tmp = t_1 return tmp
y, z = sort([y, z]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(-4.0 * Float64(Float64(t * a) + Float64(x * i))) t_2 = Float64(Float64(18.0 * y) * Float64(t * Float64(x * z))) tmp = 0.0 if (z <= -3.5e-5) tmp = t_2; elseif (z <= 1.5e-32) tmp = t_1; elseif (z <= 5.5e+57) tmp = Float64(j * Float64(k * -27.0)); elseif ((z <= 2.8e+141) || !(z <= 5.5e+217)) tmp = t_2; else tmp = t_1; end return tmp end
y, z = num2cell(sort([y, z])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
t_1 = -4.0 * ((t * a) + (x * i));
t_2 = (18.0 * y) * (t * (x * z));
tmp = 0.0;
if (z <= -3.5e-5)
tmp = t_2;
elseif (z <= 1.5e-32)
tmp = t_1;
elseif (z <= 5.5e+57)
tmp = j * (k * -27.0);
elseif ((z <= 2.8e+141) || ~((z <= 5.5e+217)))
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.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(-4.0 * N[(N[(t * a), $MachinePrecision] + N[(x * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(18.0 * y), $MachinePrecision] * N[(t * N[(x * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -3.5e-5], t$95$2, If[LessEqual[z, 1.5e-32], t$95$1, If[LessEqual[z, 5.5e+57], N[(j * N[(k * -27.0), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[z, 2.8e+141], N[Not[LessEqual[z, 5.5e+217]], $MachinePrecision]], t$95$2, t$95$1]]]]]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
\\
\begin{array}{l}
t_1 := -4 \cdot \left(t \cdot a + x \cdot i\right)\\
t_2 := \left(18 \cdot y\right) \cdot \left(t \cdot \left(x \cdot z\right)\right)\\
\mathbf{if}\;z \leq -3.5 \cdot 10^{-5}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq 1.5 \cdot 10^{-32}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 5.5 \cdot 10^{+57}:\\
\;\;\;\;j \cdot \left(k \cdot -27\right)\\
\mathbf{elif}\;z \leq 2.8 \cdot 10^{+141} \lor \neg \left(z \leq 5.5 \cdot 10^{+217}\right):\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if z < -3.4999999999999997e-5 or 5.5000000000000002e57 < z < 2.79999999999999991e141 or 5.5e217 < z Initial program 87.4%
sub-neg87.4%
associate-+l-87.4%
sub-neg87.4%
sub-neg87.4%
distribute-rgt-out--90.5%
associate-*l*84.5%
distribute-lft-neg-in84.5%
cancel-sign-sub84.5%
associate-*l*84.5%
associate-*l*84.5%
Simplified84.5%
Taylor expanded in t around 0 87.7%
Taylor expanded in y around inf 49.2%
associate-*r*49.2%
*-commutative49.2%
Simplified49.2%
if -3.4999999999999997e-5 < z < 1.5e-32 or 2.79999999999999991e141 < z < 5.5e217Initial program 88.8%
sub-neg88.8%
+-commutative88.8%
associate-*l*88.9%
distribute-rgt-neg-in88.9%
fma-def90.3%
*-commutative90.3%
distribute-rgt-neg-in90.3%
metadata-eval90.3%
sub-neg90.3%
+-commutative90.3%
associate-*l*90.3%
distribute-rgt-neg-in90.3%
Simplified93.7%
Taylor expanded in a around inf 70.5%
Taylor expanded in j around 0 51.0%
distribute-lft-out51.0%
*-commutative51.0%
Simplified51.0%
if 1.5e-32 < z < 5.5000000000000002e57Initial program 82.3%
sub-neg82.3%
associate-+l-82.3%
sub-neg82.3%
sub-neg82.3%
distribute-rgt-out--88.1%
associate-*l*88.1%
distribute-lft-neg-in88.1%
cancel-sign-sub88.1%
associate-*l*88.1%
associate-*l*88.2%
Simplified88.2%
Taylor expanded in i around 0 77.2%
add-cube-cbrt76.7%
Applied egg-rr82.6%
Taylor expanded in k around inf 48.6%
*-commutative48.6%
*-commutative48.6%
associate-*l*48.8%
Simplified48.8%
Final simplification50.2%
NOTE: y and z should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (* -4.0 (+ (* t a) (* x i)))) (t_2 (* (* 18.0 y) (* t (* x z)))))
(if (<= z -0.00035)
t_2
(if (<= z 2.1e-33)
t_1
(if (<= z 2.1e+60)
(* j (* k -27.0))
(if (<= z 6.8e+140)
t_2
(if (<= z 4.8e+217) t_1 (* (* x (* y z)) (* 18.0 t)))))))))assert(y < z);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = -4.0 * ((t * a) + (x * i));
double t_2 = (18.0 * y) * (t * (x * z));
double tmp;
if (z <= -0.00035) {
tmp = t_2;
} else if (z <= 2.1e-33) {
tmp = t_1;
} else if (z <= 2.1e+60) {
tmp = j * (k * -27.0);
} else if (z <= 6.8e+140) {
tmp = t_2;
} else if (z <= 4.8e+217) {
tmp = t_1;
} else {
tmp = (x * (y * z)) * (18.0 * t);
}
return tmp;
}
NOTE: y and z should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (-4.0d0) * ((t * a) + (x * i))
t_2 = (18.0d0 * y) * (t * (x * z))
if (z <= (-0.00035d0)) then
tmp = t_2
else if (z <= 2.1d-33) then
tmp = t_1
else if (z <= 2.1d+60) then
tmp = j * (k * (-27.0d0))
else if (z <= 6.8d+140) then
tmp = t_2
else if (z <= 4.8d+217) then
tmp = t_1
else
tmp = (x * (y * z)) * (18.0d0 * t)
end if
code = tmp
end function
assert y < z;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = -4.0 * ((t * a) + (x * i));
double t_2 = (18.0 * y) * (t * (x * z));
double tmp;
if (z <= -0.00035) {
tmp = t_2;
} else if (z <= 2.1e-33) {
tmp = t_1;
} else if (z <= 2.1e+60) {
tmp = j * (k * -27.0);
} else if (z <= 6.8e+140) {
tmp = t_2;
} else if (z <= 4.8e+217) {
tmp = t_1;
} else {
tmp = (x * (y * z)) * (18.0 * t);
}
return tmp;
}
[y, z] = sort([y, z]) def code(x, y, z, t, a, b, c, i, j, k): t_1 = -4.0 * ((t * a) + (x * i)) t_2 = (18.0 * y) * (t * (x * z)) tmp = 0 if z <= -0.00035: tmp = t_2 elif z <= 2.1e-33: tmp = t_1 elif z <= 2.1e+60: tmp = j * (k * -27.0) elif z <= 6.8e+140: tmp = t_2 elif z <= 4.8e+217: tmp = t_1 else: tmp = (x * (y * z)) * (18.0 * t) return tmp
y, z = sort([y, z]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(-4.0 * Float64(Float64(t * a) + Float64(x * i))) t_2 = Float64(Float64(18.0 * y) * Float64(t * Float64(x * z))) tmp = 0.0 if (z <= -0.00035) tmp = t_2; elseif (z <= 2.1e-33) tmp = t_1; elseif (z <= 2.1e+60) tmp = Float64(j * Float64(k * -27.0)); elseif (z <= 6.8e+140) tmp = t_2; elseif (z <= 4.8e+217) tmp = t_1; else tmp = Float64(Float64(x * Float64(y * z)) * Float64(18.0 * t)); end return tmp end
y, z = num2cell(sort([y, z])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
t_1 = -4.0 * ((t * a) + (x * i));
t_2 = (18.0 * y) * (t * (x * z));
tmp = 0.0;
if (z <= -0.00035)
tmp = t_2;
elseif (z <= 2.1e-33)
tmp = t_1;
elseif (z <= 2.1e+60)
tmp = j * (k * -27.0);
elseif (z <= 6.8e+140)
tmp = t_2;
elseif (z <= 4.8e+217)
tmp = t_1;
else
tmp = (x * (y * z)) * (18.0 * t);
end
tmp_2 = tmp;
end
NOTE: y and z should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(-4.0 * N[(N[(t * a), $MachinePrecision] + N[(x * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(18.0 * y), $MachinePrecision] * N[(t * N[(x * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -0.00035], t$95$2, If[LessEqual[z, 2.1e-33], t$95$1, If[LessEqual[z, 2.1e+60], N[(j * N[(k * -27.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 6.8e+140], t$95$2, If[LessEqual[z, 4.8e+217], t$95$1, N[(N[(x * N[(y * z), $MachinePrecision]), $MachinePrecision] * N[(18.0 * t), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
\\
\begin{array}{l}
t_1 := -4 \cdot \left(t \cdot a + x \cdot i\right)\\
t_2 := \left(18 \cdot y\right) \cdot \left(t \cdot \left(x \cdot z\right)\right)\\
\mathbf{if}\;z \leq -0.00035:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq 2.1 \cdot 10^{-33}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 2.1 \cdot 10^{+60}:\\
\;\;\;\;j \cdot \left(k \cdot -27\right)\\
\mathbf{elif}\;z \leq 6.8 \cdot 10^{+140}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq 4.8 \cdot 10^{+217}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\left(x \cdot \left(y \cdot z\right)\right) \cdot \left(18 \cdot t\right)\\
\end{array}
\end{array}
if z < -3.49999999999999996e-4 or 2.1000000000000001e60 < z < 6.8e140Initial program 88.9%
sub-neg88.9%
associate-+l-88.9%
sub-neg88.9%
sub-neg88.9%
distribute-rgt-out--90.1%
associate-*l*85.3%
distribute-lft-neg-in85.3%
cancel-sign-sub85.3%
associate-*l*85.3%
associate-*l*85.4%
Simplified85.4%
Taylor expanded in t around 0 87.8%
Taylor expanded in y around inf 48.2%
associate-*r*48.2%
*-commutative48.2%
Simplified48.2%
if -3.49999999999999996e-4 < z < 2.1e-33 or 6.8e140 < z < 4.7999999999999996e217Initial program 88.8%
sub-neg88.8%
+-commutative88.8%
associate-*l*88.9%
distribute-rgt-neg-in88.9%
fma-def90.3%
*-commutative90.3%
distribute-rgt-neg-in90.3%
metadata-eval90.3%
sub-neg90.3%
+-commutative90.3%
associate-*l*90.3%
distribute-rgt-neg-in90.3%
Simplified93.7%
Taylor expanded in a around inf 70.5%
Taylor expanded in j around 0 51.0%
distribute-lft-out51.0%
*-commutative51.0%
Simplified51.0%
if 2.1e-33 < z < 2.1000000000000001e60Initial program 82.3%
sub-neg82.3%
associate-+l-82.3%
sub-neg82.3%
sub-neg82.3%
distribute-rgt-out--88.1%
associate-*l*88.1%
distribute-lft-neg-in88.1%
cancel-sign-sub88.1%
associate-*l*88.1%
associate-*l*88.2%
Simplified88.2%
Taylor expanded in i around 0 77.2%
add-cube-cbrt76.7%
Applied egg-rr82.6%
Taylor expanded in k around inf 48.6%
*-commutative48.6%
*-commutative48.6%
associate-*l*48.8%
Simplified48.8%
if 4.7999999999999996e217 < z Initial program 79.5%
sub-neg79.5%
associate-+l-79.5%
sub-neg79.5%
sub-neg79.5%
distribute-rgt-out--92.8%
associate-*l*79.8%
distribute-lft-neg-in79.8%
cancel-sign-sub79.8%
associate-*l*79.8%
associate-*l*80.0%
Simplified80.0%
Taylor expanded in t around 0 87.0%
Taylor expanded in y around inf 55.0%
*-commutative55.0%
associate-*r*55.0%
associate-*l*55.0%
*-commutative55.0%
associate-*l*55.0%
associate-*r*60.7%
*-commutative60.7%
Simplified60.7%
Final simplification50.5%
NOTE: y and z should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (* (* j k) -27.0)) (t_2 (* -4.0 (* x i))))
(if (<= i -2.7e+128)
t_2
(if (<= i -1550000.0)
t_1
(if (<= i -2.3e-253)
(* b c)
(if (<= i 8.8e-271)
t_1
(if (<= i 3.35e-53) (* b c) (if (<= i 1.15e+143) t_1 t_2))))))))assert(y < z);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = (j * k) * -27.0;
double t_2 = -4.0 * (x * i);
double tmp;
if (i <= -2.7e+128) {
tmp = t_2;
} else if (i <= -1550000.0) {
tmp = t_1;
} else if (i <= -2.3e-253) {
tmp = b * c;
} else if (i <= 8.8e-271) {
tmp = t_1;
} else if (i <= 3.35e-53) {
tmp = b * c;
} else if (i <= 1.15e+143) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
NOTE: y and z 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 * k) * (-27.0d0)
t_2 = (-4.0d0) * (x * i)
if (i <= (-2.7d+128)) then
tmp = t_2
else if (i <= (-1550000.0d0)) then
tmp = t_1
else if (i <= (-2.3d-253)) then
tmp = b * c
else if (i <= 8.8d-271) then
tmp = t_1
else if (i <= 3.35d-53) then
tmp = b * c
else if (i <= 1.15d+143) then
tmp = t_1
else
tmp = t_2
end if
code = tmp
end function
assert y < z;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = (j * k) * -27.0;
double t_2 = -4.0 * (x * i);
double tmp;
if (i <= -2.7e+128) {
tmp = t_2;
} else if (i <= -1550000.0) {
tmp = t_1;
} else if (i <= -2.3e-253) {
tmp = b * c;
} else if (i <= 8.8e-271) {
tmp = t_1;
} else if (i <= 3.35e-53) {
tmp = b * c;
} else if (i <= 1.15e+143) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
[y, z] = sort([y, z]) def code(x, y, z, t, a, b, c, i, j, k): t_1 = (j * k) * -27.0 t_2 = -4.0 * (x * i) tmp = 0 if i <= -2.7e+128: tmp = t_2 elif i <= -1550000.0: tmp = t_1 elif i <= -2.3e-253: tmp = b * c elif i <= 8.8e-271: tmp = t_1 elif i <= 3.35e-53: tmp = b * c elif i <= 1.15e+143: tmp = t_1 else: tmp = t_2 return tmp
y, z = sort([y, z]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(Float64(j * k) * -27.0) t_2 = Float64(-4.0 * Float64(x * i)) tmp = 0.0 if (i <= -2.7e+128) tmp = t_2; elseif (i <= -1550000.0) tmp = t_1; elseif (i <= -2.3e-253) tmp = Float64(b * c); elseif (i <= 8.8e-271) tmp = t_1; elseif (i <= 3.35e-53) tmp = Float64(b * c); elseif (i <= 1.15e+143) tmp = t_1; else tmp = t_2; end return tmp end
y, z = num2cell(sort([y, z])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
t_1 = (j * k) * -27.0;
t_2 = -4.0 * (x * i);
tmp = 0.0;
if (i <= -2.7e+128)
tmp = t_2;
elseif (i <= -1550000.0)
tmp = t_1;
elseif (i <= -2.3e-253)
tmp = b * c;
elseif (i <= 8.8e-271)
tmp = t_1;
elseif (i <= 3.35e-53)
tmp = b * c;
elseif (i <= 1.15e+143)
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.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(N[(j * k), $MachinePrecision] * -27.0), $MachinePrecision]}, Block[{t$95$2 = N[(-4.0 * N[(x * i), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[i, -2.7e+128], t$95$2, If[LessEqual[i, -1550000.0], t$95$1, If[LessEqual[i, -2.3e-253], N[(b * c), $MachinePrecision], If[LessEqual[i, 8.8e-271], t$95$1, If[LessEqual[i, 3.35e-53], N[(b * c), $MachinePrecision], If[LessEqual[i, 1.15e+143], t$95$1, t$95$2]]]]]]]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
\\
\begin{array}{l}
t_1 := \left(j \cdot k\right) \cdot -27\\
t_2 := -4 \cdot \left(x \cdot i\right)\\
\mathbf{if}\;i \leq -2.7 \cdot 10^{+128}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;i \leq -1550000:\\
\;\;\;\;t_1\\
\mathbf{elif}\;i \leq -2.3 \cdot 10^{-253}:\\
\;\;\;\;b \cdot c\\
\mathbf{elif}\;i \leq 8.8 \cdot 10^{-271}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;i \leq 3.35 \cdot 10^{-53}:\\
\;\;\;\;b \cdot c\\
\mathbf{elif}\;i \leq 1.15 \cdot 10^{+143}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if i < -2.70000000000000001e128 or 1.15e143 < i Initial program 88.5%
sub-neg88.5%
+-commutative88.5%
associate-*l*88.5%
distribute-rgt-neg-in88.5%
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%
Simplified90.0%
Taylor expanded in i around inf 57.1%
if -2.70000000000000001e128 < i < -1.55e6 or -2.3e-253 < i < 8.7999999999999998e-271 or 3.34999999999999978e-53 < i < 1.15e143Initial program 87.2%
sub-neg87.2%
+-commutative87.2%
associate-*l*87.3%
distribute-rgt-neg-in87.3%
fma-def89.6%
*-commutative89.6%
distribute-rgt-neg-in89.6%
metadata-eval89.6%
sub-neg89.6%
+-commutative89.6%
associate-*l*89.6%
distribute-rgt-neg-in89.6%
Simplified93.0%
Taylor expanded in j around inf 42.6%
if -1.55e6 < i < -2.3e-253 or 8.7999999999999998e-271 < i < 3.34999999999999978e-53Initial program 88.0%
sub-neg88.0%
associate-+l-88.0%
sub-neg88.0%
sub-neg88.0%
distribute-rgt-out--90.0%
associate-*l*90.0%
distribute-lft-neg-in90.0%
cancel-sign-sub90.0%
associate-*l*90.0%
associate-*l*90.0%
Simplified90.0%
Taylor expanded in t around 0 91.0%
Taylor expanded in b around inf 37.0%
Final simplification44.4%
NOTE: y and z 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 (<= x -8.8e+163)
t_1
(if (<= x -5.2e+38)
(+ (* -4.0 (* t a)) (* (* j k) -27.0))
(if (<= x -4.2e-26)
t_1
(if (<= x 7.2e+16)
(- (* b c) (* 27.0 (* j k)))
(* (* 18.0 y) (* t (* x z)))))))))assert(y < z);
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 (x <= -8.8e+163) {
tmp = t_1;
} else if (x <= -5.2e+38) {
tmp = (-4.0 * (t * a)) + ((j * k) * -27.0);
} else if (x <= -4.2e-26) {
tmp = t_1;
} else if (x <= 7.2e+16) {
tmp = (b * c) - (27.0 * (j * k));
} else {
tmp = (18.0 * y) * (t * (x * z));
}
return tmp;
}
NOTE: y and z 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 (x <= (-8.8d+163)) then
tmp = t_1
else if (x <= (-5.2d+38)) then
tmp = ((-4.0d0) * (t * a)) + ((j * k) * (-27.0d0))
else if (x <= (-4.2d-26)) then
tmp = t_1
else if (x <= 7.2d+16) then
tmp = (b * c) - (27.0d0 * (j * k))
else
tmp = (18.0d0 * y) * (t * (x * z))
end if
code = tmp
end function
assert y < z;
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 (x <= -8.8e+163) {
tmp = t_1;
} else if (x <= -5.2e+38) {
tmp = (-4.0 * (t * a)) + ((j * k) * -27.0);
} else if (x <= -4.2e-26) {
tmp = t_1;
} else if (x <= 7.2e+16) {
tmp = (b * c) - (27.0 * (j * k));
} else {
tmp = (18.0 * y) * (t * (x * z));
}
return tmp;
}
[y, z] = sort([y, z]) def code(x, y, z, t, a, b, c, i, j, k): t_1 = (b * c) - (4.0 * (x * i)) tmp = 0 if x <= -8.8e+163: tmp = t_1 elif x <= -5.2e+38: tmp = (-4.0 * (t * a)) + ((j * k) * -27.0) elif x <= -4.2e-26: tmp = t_1 elif x <= 7.2e+16: tmp = (b * c) - (27.0 * (j * k)) else: tmp = (18.0 * y) * (t * (x * z)) return tmp
y, z = sort([y, z]) 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 (x <= -8.8e+163) tmp = t_1; elseif (x <= -5.2e+38) tmp = Float64(Float64(-4.0 * Float64(t * a)) + Float64(Float64(j * k) * -27.0)); elseif (x <= -4.2e-26) tmp = t_1; elseif (x <= 7.2e+16) tmp = Float64(Float64(b * c) - Float64(27.0 * Float64(j * k))); else tmp = Float64(Float64(18.0 * y) * Float64(t * Float64(x * z))); end return tmp end
y, z = num2cell(sort([y, z])){:}
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 (x <= -8.8e+163)
tmp = t_1;
elseif (x <= -5.2e+38)
tmp = (-4.0 * (t * a)) + ((j * k) * -27.0);
elseif (x <= -4.2e-26)
tmp = t_1;
elseif (x <= 7.2e+16)
tmp = (b * c) - (27.0 * (j * k));
else
tmp = (18.0 * y) * (t * (x * z));
end
tmp_2 = tmp;
end
NOTE: y and z 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[x, -8.8e+163], t$95$1, If[LessEqual[x, -5.2e+38], N[(N[(-4.0 * N[(t * a), $MachinePrecision]), $MachinePrecision] + N[(N[(j * k), $MachinePrecision] * -27.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -4.2e-26], t$95$1, If[LessEqual[x, 7.2e+16], N[(N[(b * c), $MachinePrecision] - N[(27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(18.0 * y), $MachinePrecision] * N[(t * N[(x * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
\\
\begin{array}{l}
t_1 := b \cdot c - 4 \cdot \left(x \cdot i\right)\\
\mathbf{if}\;x \leq -8.8 \cdot 10^{+163}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq -5.2 \cdot 10^{+38}:\\
\;\;\;\;-4 \cdot \left(t \cdot a\right) + \left(j \cdot k\right) \cdot -27\\
\mathbf{elif}\;x \leq -4.2 \cdot 10^{-26}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 7.2 \cdot 10^{+16}:\\
\;\;\;\;b \cdot c - 27 \cdot \left(j \cdot k\right)\\
\mathbf{else}:\\
\;\;\;\;\left(18 \cdot y\right) \cdot \left(t \cdot \left(x \cdot z\right)\right)\\
\end{array}
\end{array}
if x < -8.79999999999999945e163 or -5.1999999999999998e38 < x < -4.20000000000000016e-26Initial program 84.3%
sub-neg84.3%
associate-+l-84.3%
sub-neg84.3%
sub-neg84.3%
distribute-rgt-out--84.3%
associate-*l*87.0%
distribute-lft-neg-in87.0%
cancel-sign-sub87.0%
associate-*l*87.0%
associate-*l*87.0%
Simplified87.0%
Taylor expanded in j around 0 82.0%
Taylor expanded in c around inf 66.8%
if -8.79999999999999945e163 < x < -5.1999999999999998e38Initial program 84.9%
sub-neg84.9%
+-commutative84.9%
associate-*l*85.0%
distribute-rgt-neg-in85.0%
fma-def85.0%
*-commutative85.0%
distribute-rgt-neg-in85.0%
metadata-eval85.0%
sub-neg85.0%
+-commutative85.0%
associate-*l*85.0%
distribute-rgt-neg-in85.0%
Simplified90.0%
Taylor expanded in a around inf 85.0%
Taylor expanded in x around 0 65.8%
if -4.20000000000000016e-26 < x < 7.2e16Initial program 98.2%
sub-neg98.2%
associate-+l-98.2%
sub-neg98.2%
sub-neg98.2%
distribute-rgt-out--98.2%
associate-*l*93.5%
distribute-lft-neg-in93.5%
cancel-sign-sub93.5%
associate-*l*93.5%
associate-*l*93.6%
Simplified93.6%
Taylor expanded in i around 0 89.8%
Taylor expanded in t around 0 65.8%
if 7.2e16 < x Initial program 72.8%
sub-neg72.8%
associate-+l-72.8%
sub-neg72.8%
sub-neg72.8%
distribute-rgt-out--78.2%
associate-*l*80.8%
distribute-lft-neg-in80.8%
cancel-sign-sub80.8%
associate-*l*80.8%
associate-*l*80.9%
Simplified80.9%
Taylor expanded in t around 0 76.9%
Taylor expanded in y around inf 54.5%
associate-*r*54.5%
*-commutative54.5%
Simplified54.5%
Final simplification62.7%
NOTE: y and z should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (* (* j k) -27.0)) (t_2 (* -4.0 (* x i))))
(if (<= i -4.6e+126)
t_2
(if (<= i -1.15e-65)
t_1
(if (<= i 9.5e-252)
(* a (* t -4.0))
(if (<= i 2.5e-53) (* b c) (if (<= i 1.9e+142) t_1 t_2)))))))assert(y < z);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = (j * k) * -27.0;
double t_2 = -4.0 * (x * i);
double tmp;
if (i <= -4.6e+126) {
tmp = t_2;
} else if (i <= -1.15e-65) {
tmp = t_1;
} else if (i <= 9.5e-252) {
tmp = a * (t * -4.0);
} else if (i <= 2.5e-53) {
tmp = b * c;
} else if (i <= 1.9e+142) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
NOTE: y and z 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 * k) * (-27.0d0)
t_2 = (-4.0d0) * (x * i)
if (i <= (-4.6d+126)) then
tmp = t_2
else if (i <= (-1.15d-65)) then
tmp = t_1
else if (i <= 9.5d-252) then
tmp = a * (t * (-4.0d0))
else if (i <= 2.5d-53) then
tmp = b * c
else if (i <= 1.9d+142) then
tmp = t_1
else
tmp = t_2
end if
code = tmp
end function
assert y < z;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = (j * k) * -27.0;
double t_2 = -4.0 * (x * i);
double tmp;
if (i <= -4.6e+126) {
tmp = t_2;
} else if (i <= -1.15e-65) {
tmp = t_1;
} else if (i <= 9.5e-252) {
tmp = a * (t * -4.0);
} else if (i <= 2.5e-53) {
tmp = b * c;
} else if (i <= 1.9e+142) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
[y, z] = sort([y, z]) def code(x, y, z, t, a, b, c, i, j, k): t_1 = (j * k) * -27.0 t_2 = -4.0 * (x * i) tmp = 0 if i <= -4.6e+126: tmp = t_2 elif i <= -1.15e-65: tmp = t_1 elif i <= 9.5e-252: tmp = a * (t * -4.0) elif i <= 2.5e-53: tmp = b * c elif i <= 1.9e+142: tmp = t_1 else: tmp = t_2 return tmp
y, z = sort([y, z]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(Float64(j * k) * -27.0) t_2 = Float64(-4.0 * Float64(x * i)) tmp = 0.0 if (i <= -4.6e+126) tmp = t_2; elseif (i <= -1.15e-65) tmp = t_1; elseif (i <= 9.5e-252) tmp = Float64(a * Float64(t * -4.0)); elseif (i <= 2.5e-53) tmp = Float64(b * c); elseif (i <= 1.9e+142) tmp = t_1; else tmp = t_2; end return tmp end
y, z = num2cell(sort([y, z])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
t_1 = (j * k) * -27.0;
t_2 = -4.0 * (x * i);
tmp = 0.0;
if (i <= -4.6e+126)
tmp = t_2;
elseif (i <= -1.15e-65)
tmp = t_1;
elseif (i <= 9.5e-252)
tmp = a * (t * -4.0);
elseif (i <= 2.5e-53)
tmp = b * c;
elseif (i <= 1.9e+142)
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.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(N[(j * k), $MachinePrecision] * -27.0), $MachinePrecision]}, Block[{t$95$2 = N[(-4.0 * N[(x * i), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[i, -4.6e+126], t$95$2, If[LessEqual[i, -1.15e-65], t$95$1, If[LessEqual[i, 9.5e-252], N[(a * N[(t * -4.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[i, 2.5e-53], N[(b * c), $MachinePrecision], If[LessEqual[i, 1.9e+142], t$95$1, t$95$2]]]]]]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
\\
\begin{array}{l}
t_1 := \left(j \cdot k\right) \cdot -27\\
t_2 := -4 \cdot \left(x \cdot i\right)\\
\mathbf{if}\;i \leq -4.6 \cdot 10^{+126}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;i \leq -1.15 \cdot 10^{-65}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;i \leq 9.5 \cdot 10^{-252}:\\
\;\;\;\;a \cdot \left(t \cdot -4\right)\\
\mathbf{elif}\;i \leq 2.5 \cdot 10^{-53}:\\
\;\;\;\;b \cdot c\\
\mathbf{elif}\;i \leq 1.9 \cdot 10^{+142}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if i < -4.6000000000000001e126 or 1.89999999999999995e142 < i Initial program 88.5%
sub-neg88.5%
+-commutative88.5%
associate-*l*88.5%
distribute-rgt-neg-in88.5%
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%
Simplified90.0%
Taylor expanded in i around inf 57.1%
if -4.6000000000000001e126 < i < -1.15e-65 or 2.5e-53 < i < 1.89999999999999995e142Initial program 88.3%
sub-neg88.3%
+-commutative88.3%
associate-*l*88.4%
distribute-rgt-neg-in88.4%
fma-def89.7%
*-commutative89.7%
distribute-rgt-neg-in89.7%
metadata-eval89.7%
sub-neg89.7%
+-commutative89.7%
associate-*l*89.7%
distribute-rgt-neg-in89.7%
Simplified93.5%
Taylor expanded in j around inf 46.1%
if -1.15e-65 < i < 9.4999999999999993e-252Initial program 85.5%
sub-neg85.5%
associate-+l-85.5%
sub-neg85.5%
sub-neg85.5%
distribute-rgt-out--88.7%
associate-*l*88.8%
distribute-lft-neg-in88.8%
cancel-sign-sub88.8%
associate-*l*88.8%
associate-*l*88.8%
Simplified88.8%
Taylor expanded in t around 0 88.7%
Taylor expanded in a around inf 35.3%
associate-*r*35.3%
*-commutative35.3%
associate-*l*35.3%
Simplified35.3%
if 9.4999999999999993e-252 < i < 2.5e-53Initial program 89.3%
sub-neg89.3%
associate-+l-89.3%
sub-neg89.3%
sub-neg89.3%
distribute-rgt-out--89.3%
associate-*l*89.3%
distribute-lft-neg-in89.3%
cancel-sign-sub89.3%
associate-*l*89.3%
associate-*l*89.3%
Simplified89.3%
Taylor expanded in t around 0 91.5%
Taylor expanded in b around inf 36.3%
Final simplification44.7%
NOTE: y and z should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (* -4.0 (* x i))))
(if (<= i -4.2e+104)
t_1
(if (<= i -6e-66)
(* j (* k -27.0))
(if (<= i 1.02e-250)
(* a (* t -4.0))
(if (<= i 1.62e-53)
(* b c)
(if (<= i 1.95e+142) (* (* j k) -27.0) t_1)))))))assert(y < z);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = -4.0 * (x * i);
double tmp;
if (i <= -4.2e+104) {
tmp = t_1;
} else if (i <= -6e-66) {
tmp = j * (k * -27.0);
} else if (i <= 1.02e-250) {
tmp = a * (t * -4.0);
} else if (i <= 1.62e-53) {
tmp = b * c;
} else if (i <= 1.95e+142) {
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.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: tmp
t_1 = (-4.0d0) * (x * i)
if (i <= (-4.2d+104)) then
tmp = t_1
else if (i <= (-6d-66)) then
tmp = j * (k * (-27.0d0))
else if (i <= 1.02d-250) then
tmp = a * (t * (-4.0d0))
else if (i <= 1.62d-53) then
tmp = b * c
else if (i <= 1.95d+142) then
tmp = (j * k) * (-27.0d0)
else
tmp = t_1
end if
code = tmp
end function
assert y < z;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = -4.0 * (x * i);
double tmp;
if (i <= -4.2e+104) {
tmp = t_1;
} else if (i <= -6e-66) {
tmp = j * (k * -27.0);
} else if (i <= 1.02e-250) {
tmp = a * (t * -4.0);
} else if (i <= 1.62e-53) {
tmp = b * c;
} else if (i <= 1.95e+142) {
tmp = (j * k) * -27.0;
} else {
tmp = t_1;
}
return tmp;
}
[y, z] = sort([y, z]) def code(x, y, z, t, a, b, c, i, j, k): t_1 = -4.0 * (x * i) tmp = 0 if i <= -4.2e+104: tmp = t_1 elif i <= -6e-66: tmp = j * (k * -27.0) elif i <= 1.02e-250: tmp = a * (t * -4.0) elif i <= 1.62e-53: tmp = b * c elif i <= 1.95e+142: tmp = (j * k) * -27.0 else: tmp = t_1 return tmp
y, z = sort([y, z]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(-4.0 * Float64(x * i)) tmp = 0.0 if (i <= -4.2e+104) tmp = t_1; elseif (i <= -6e-66) tmp = Float64(j * Float64(k * -27.0)); elseif (i <= 1.02e-250) tmp = Float64(a * Float64(t * -4.0)); elseif (i <= 1.62e-53) tmp = Float64(b * c); elseif (i <= 1.95e+142) tmp = Float64(Float64(j * k) * -27.0); else tmp = t_1; end return tmp end
y, z = num2cell(sort([y, z])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
t_1 = -4.0 * (x * i);
tmp = 0.0;
if (i <= -4.2e+104)
tmp = t_1;
elseif (i <= -6e-66)
tmp = j * (k * -27.0);
elseif (i <= 1.02e-250)
tmp = a * (t * -4.0);
elseif (i <= 1.62e-53)
tmp = b * c;
elseif (i <= 1.95e+142)
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.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(-4.0 * N[(x * i), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[i, -4.2e+104], t$95$1, If[LessEqual[i, -6e-66], N[(j * N[(k * -27.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[i, 1.02e-250], N[(a * N[(t * -4.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[i, 1.62e-53], N[(b * c), $MachinePrecision], If[LessEqual[i, 1.95e+142], N[(N[(j * k), $MachinePrecision] * -27.0), $MachinePrecision], t$95$1]]]]]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
\\
\begin{array}{l}
t_1 := -4 \cdot \left(x \cdot i\right)\\
\mathbf{if}\;i \leq -4.2 \cdot 10^{+104}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;i \leq -6 \cdot 10^{-66}:\\
\;\;\;\;j \cdot \left(k \cdot -27\right)\\
\mathbf{elif}\;i \leq 1.02 \cdot 10^{-250}:\\
\;\;\;\;a \cdot \left(t \cdot -4\right)\\
\mathbf{elif}\;i \leq 1.62 \cdot 10^{-53}:\\
\;\;\;\;b \cdot c\\
\mathbf{elif}\;i \leq 1.95 \cdot 10^{+142}:\\
\;\;\;\;\left(j \cdot k\right) \cdot -27\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if i < -4.1999999999999997e104 or 1.95e142 < i Initial program 89.1%
sub-neg89.1%
+-commutative89.1%
associate-*l*89.1%
distribute-rgt-neg-in89.1%
fma-def89.1%
*-commutative89.1%
distribute-rgt-neg-in89.1%
metadata-eval89.1%
sub-neg89.1%
+-commutative89.1%
associate-*l*89.1%
distribute-rgt-neg-in89.1%
Simplified90.6%
Taylor expanded in i around inf 56.8%
if -4.1999999999999997e104 < i < -6.0000000000000004e-66Initial program 88.1%
sub-neg88.1%
associate-+l-88.1%
sub-neg88.1%
sub-neg88.1%
distribute-rgt-out--94.0%
associate-*l*91.1%
distribute-lft-neg-in91.1%
cancel-sign-sub91.1%
associate-*l*91.1%
associate-*l*91.1%
Simplified91.1%
Taylor expanded in i around 0 88.4%
add-cube-cbrt88.0%
Applied egg-rr88.0%
Taylor expanded in k around inf 45.5%
*-commutative45.5%
*-commutative45.5%
associate-*l*45.5%
Simplified45.5%
if -6.0000000000000004e-66 < i < 1.02000000000000001e-250Initial program 85.5%
sub-neg85.5%
associate-+l-85.5%
sub-neg85.5%
sub-neg85.5%
distribute-rgt-out--88.7%
associate-*l*88.8%
distribute-lft-neg-in88.8%
cancel-sign-sub88.8%
associate-*l*88.8%
associate-*l*88.8%
Simplified88.8%
Taylor expanded in t around 0 88.7%
Taylor expanded in a around inf 35.3%
associate-*r*35.3%
*-commutative35.3%
associate-*l*35.3%
Simplified35.3%
if 1.02000000000000001e-250 < i < 1.62e-53Initial program 89.3%
sub-neg89.3%
associate-+l-89.3%
sub-neg89.3%
sub-neg89.3%
distribute-rgt-out--89.3%
associate-*l*89.3%
distribute-lft-neg-in89.3%
cancel-sign-sub89.3%
associate-*l*89.3%
associate-*l*89.3%
Simplified89.3%
Taylor expanded in t around 0 91.5%
Taylor expanded in b around inf 36.3%
if 1.62e-53 < i < 1.95e142Initial program 87.3%
sub-neg87.3%
+-commutative87.3%
associate-*l*87.5%
distribute-rgt-neg-in87.5%
fma-def90.0%
*-commutative90.0%
distribute-rgt-neg-in90.0%
metadata-eval90.0%
sub-neg90.0%
+-commutative90.0%
associate-*l*90.0%
distribute-rgt-neg-in90.0%
Simplified94.9%
Taylor expanded in j around inf 46.0%
Final simplification44.7%
NOTE: y and z should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (* -4.0 (* x i))))
(if (<= i -1.4e+105)
t_1
(if (<= i -3.5e-66)
(* j (* k -27.0))
(if (<= i 7.2e-252)
(* a (* t -4.0))
(if (<= i 1.8e-53)
(* b c)
(if (<= i 8.5e+143) (* k (* j -27.0)) t_1)))))))assert(y < z);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = -4.0 * (x * i);
double tmp;
if (i <= -1.4e+105) {
tmp = t_1;
} else if (i <= -3.5e-66) {
tmp = j * (k * -27.0);
} else if (i <= 7.2e-252) {
tmp = a * (t * -4.0);
} else if (i <= 1.8e-53) {
tmp = b * c;
} else if (i <= 8.5e+143) {
tmp = k * (j * -27.0);
} else {
tmp = t_1;
}
return tmp;
}
NOTE: y and z should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: tmp
t_1 = (-4.0d0) * (x * i)
if (i <= (-1.4d+105)) then
tmp = t_1
else if (i <= (-3.5d-66)) then
tmp = j * (k * (-27.0d0))
else if (i <= 7.2d-252) then
tmp = a * (t * (-4.0d0))
else if (i <= 1.8d-53) then
tmp = b * c
else if (i <= 8.5d+143) then
tmp = k * (j * (-27.0d0))
else
tmp = t_1
end if
code = tmp
end function
assert y < z;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = -4.0 * (x * i);
double tmp;
if (i <= -1.4e+105) {
tmp = t_1;
} else if (i <= -3.5e-66) {
tmp = j * (k * -27.0);
} else if (i <= 7.2e-252) {
tmp = a * (t * -4.0);
} else if (i <= 1.8e-53) {
tmp = b * c;
} else if (i <= 8.5e+143) {
tmp = k * (j * -27.0);
} else {
tmp = t_1;
}
return tmp;
}
[y, z] = sort([y, z]) def code(x, y, z, t, a, b, c, i, j, k): t_1 = -4.0 * (x * i) tmp = 0 if i <= -1.4e+105: tmp = t_1 elif i <= -3.5e-66: tmp = j * (k * -27.0) elif i <= 7.2e-252: tmp = a * (t * -4.0) elif i <= 1.8e-53: tmp = b * c elif i <= 8.5e+143: tmp = k * (j * -27.0) else: tmp = t_1 return tmp
y, z = sort([y, z]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(-4.0 * Float64(x * i)) tmp = 0.0 if (i <= -1.4e+105) tmp = t_1; elseif (i <= -3.5e-66) tmp = Float64(j * Float64(k * -27.0)); elseif (i <= 7.2e-252) tmp = Float64(a * Float64(t * -4.0)); elseif (i <= 1.8e-53) tmp = Float64(b * c); elseif (i <= 8.5e+143) tmp = Float64(k * Float64(j * -27.0)); else tmp = t_1; end return tmp end
y, z = num2cell(sort([y, z])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
t_1 = -4.0 * (x * i);
tmp = 0.0;
if (i <= -1.4e+105)
tmp = t_1;
elseif (i <= -3.5e-66)
tmp = j * (k * -27.0);
elseif (i <= 7.2e-252)
tmp = a * (t * -4.0);
elseif (i <= 1.8e-53)
tmp = b * c;
elseif (i <= 8.5e+143)
tmp = k * (j * -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.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(-4.0 * N[(x * i), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[i, -1.4e+105], t$95$1, If[LessEqual[i, -3.5e-66], N[(j * N[(k * -27.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[i, 7.2e-252], N[(a * N[(t * -4.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[i, 1.8e-53], N[(b * c), $MachinePrecision], If[LessEqual[i, 8.5e+143], N[(k * N[(j * -27.0), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
\\
\begin{array}{l}
t_1 := -4 \cdot \left(x \cdot i\right)\\
\mathbf{if}\;i \leq -1.4 \cdot 10^{+105}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;i \leq -3.5 \cdot 10^{-66}:\\
\;\;\;\;j \cdot \left(k \cdot -27\right)\\
\mathbf{elif}\;i \leq 7.2 \cdot 10^{-252}:\\
\;\;\;\;a \cdot \left(t \cdot -4\right)\\
\mathbf{elif}\;i \leq 1.8 \cdot 10^{-53}:\\
\;\;\;\;b \cdot c\\
\mathbf{elif}\;i \leq 8.5 \cdot 10^{+143}:\\
\;\;\;\;k \cdot \left(j \cdot -27\right)\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if i < -1.4000000000000001e105 or 8.4999999999999998e143 < i Initial program 89.1%
sub-neg89.1%
+-commutative89.1%
associate-*l*89.1%
distribute-rgt-neg-in89.1%
fma-def89.1%
*-commutative89.1%
distribute-rgt-neg-in89.1%
metadata-eval89.1%
sub-neg89.1%
+-commutative89.1%
associate-*l*89.1%
distribute-rgt-neg-in89.1%
Simplified90.6%
Taylor expanded in i around inf 56.8%
if -1.4000000000000001e105 < i < -3.5e-66Initial program 88.1%
sub-neg88.1%
associate-+l-88.1%
sub-neg88.1%
sub-neg88.1%
distribute-rgt-out--94.0%
associate-*l*91.1%
distribute-lft-neg-in91.1%
cancel-sign-sub91.1%
associate-*l*91.1%
associate-*l*91.1%
Simplified91.1%
Taylor expanded in i around 0 88.4%
add-cube-cbrt88.0%
Applied egg-rr88.0%
Taylor expanded in k around inf 45.5%
*-commutative45.5%
*-commutative45.5%
associate-*l*45.5%
Simplified45.5%
if -3.5e-66 < i < 7.20000000000000046e-252Initial program 85.5%
sub-neg85.5%
associate-+l-85.5%
sub-neg85.5%
sub-neg85.5%
distribute-rgt-out--88.7%
associate-*l*88.8%
distribute-lft-neg-in88.8%
cancel-sign-sub88.8%
associate-*l*88.8%
associate-*l*88.8%
Simplified88.8%
Taylor expanded in t around 0 88.7%
Taylor expanded in a around inf 35.3%
associate-*r*35.3%
*-commutative35.3%
associate-*l*35.3%
Simplified35.3%
if 7.20000000000000046e-252 < i < 1.7999999999999999e-53Initial program 89.3%
sub-neg89.3%
associate-+l-89.3%
sub-neg89.3%
sub-neg89.3%
distribute-rgt-out--89.3%
associate-*l*89.3%
distribute-lft-neg-in89.3%
cancel-sign-sub89.3%
associate-*l*89.3%
associate-*l*89.3%
Simplified89.3%
Taylor expanded in t around 0 91.5%
Taylor expanded in b around inf 36.3%
if 1.7999999999999999e-53 < i < 8.4999999999999998e143Initial program 87.3%
sub-neg87.3%
+-commutative87.3%
associate-*l*87.5%
distribute-rgt-neg-in87.5%
fma-def90.0%
*-commutative90.0%
distribute-rgt-neg-in90.0%
metadata-eval90.0%
sub-neg90.0%
+-commutative90.0%
associate-*l*90.0%
distribute-rgt-neg-in90.0%
Simplified94.9%
Taylor expanded in j around inf 46.0%
*-commutative46.0%
associate-*r*45.9%
*-commutative45.9%
Simplified45.9%
Final simplification44.7%
NOTE: y and z should be sorted in increasing order before calling this function. (FPCore (x y z t a b c i j k) :precision binary64 (if (<= k -5.5e+81) (* (* j k) -27.0) (if (<= k 2.6e+185) (* -4.0 (+ (* t a) (* x i))) (* k (* j -27.0)))))
assert(y < z);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double tmp;
if (k <= -5.5e+81) {
tmp = (j * k) * -27.0;
} else if (k <= 2.6e+185) {
tmp = -4.0 * ((t * a) + (x * i));
} else {
tmp = k * (j * -27.0);
}
return tmp;
}
NOTE: y and z should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: tmp
if (k <= (-5.5d+81)) then
tmp = (j * k) * (-27.0d0)
else if (k <= 2.6d+185) then
tmp = (-4.0d0) * ((t * a) + (x * i))
else
tmp = k * (j * (-27.0d0))
end if
code = tmp
end function
assert y < z;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double tmp;
if (k <= -5.5e+81) {
tmp = (j * k) * -27.0;
} else if (k <= 2.6e+185) {
tmp = -4.0 * ((t * a) + (x * i));
} else {
tmp = k * (j * -27.0);
}
return tmp;
}
[y, z] = sort([y, z]) def code(x, y, z, t, a, b, c, i, j, k): tmp = 0 if k <= -5.5e+81: tmp = (j * k) * -27.0 elif k <= 2.6e+185: tmp = -4.0 * ((t * a) + (x * i)) else: tmp = k * (j * -27.0) return tmp
y, z = sort([y, z]) function code(x, y, z, t, a, b, c, i, j, k) tmp = 0.0 if (k <= -5.5e+81) tmp = Float64(Float64(j * k) * -27.0); elseif (k <= 2.6e+185) tmp = Float64(-4.0 * Float64(Float64(t * a) + Float64(x * i))); else tmp = Float64(k * Float64(j * -27.0)); end return tmp end
y, z = num2cell(sort([y, z])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
tmp = 0.0;
if (k <= -5.5e+81)
tmp = (j * k) * -27.0;
elseif (k <= 2.6e+185)
tmp = -4.0 * ((t * a) + (x * i));
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. code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := If[LessEqual[k, -5.5e+81], N[(N[(j * k), $MachinePrecision] * -27.0), $MachinePrecision], If[LessEqual[k, 2.6e+185], N[(-4.0 * N[(N[(t * a), $MachinePrecision] + N[(x * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(k * N[(j * -27.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
\\
\begin{array}{l}
\mathbf{if}\;k \leq -5.5 \cdot 10^{+81}:\\
\;\;\;\;\left(j \cdot k\right) \cdot -27\\
\mathbf{elif}\;k \leq 2.6 \cdot 10^{+185}:\\
\;\;\;\;-4 \cdot \left(t \cdot a + x \cdot i\right)\\
\mathbf{else}:\\
\;\;\;\;k \cdot \left(j \cdot -27\right)\\
\end{array}
\end{array}
if k < -5.5000000000000003e81Initial program 92.6%
sub-neg92.6%
+-commutative92.6%
associate-*l*92.6%
distribute-rgt-neg-in92.6%
fma-def95.0%
*-commutative95.0%
distribute-rgt-neg-in95.0%
metadata-eval95.0%
sub-neg95.0%
+-commutative95.0%
associate-*l*95.0%
distribute-rgt-neg-in95.0%
Simplified95.1%
Taylor expanded in j around inf 53.9%
if -5.5000000000000003e81 < k < 2.60000000000000001e185Initial program 86.8%
sub-neg86.8%
+-commutative86.8%
associate-*l*86.9%
distribute-rgt-neg-in86.9%
fma-def87.9%
*-commutative87.9%
distribute-rgt-neg-in87.9%
metadata-eval87.9%
sub-neg87.9%
+-commutative87.9%
associate-*l*87.9%
distribute-rgt-neg-in87.9%
Simplified91.1%
Taylor expanded in a around inf 58.0%
Taylor expanded in j around 0 44.1%
distribute-lft-out44.1%
*-commutative44.1%
Simplified44.1%
if 2.60000000000000001e185 < k Initial program 87.7%
sub-neg87.7%
+-commutative87.7%
associate-*l*87.7%
distribute-rgt-neg-in87.7%
fma-def87.7%
*-commutative87.7%
distribute-rgt-neg-in87.7%
metadata-eval87.7%
sub-neg87.7%
+-commutative87.7%
associate-*l*87.7%
distribute-rgt-neg-in87.7%
Simplified91.8%
Taylor expanded in j around inf 51.4%
*-commutative51.4%
associate-*r*51.4%
*-commutative51.4%
Simplified51.4%
Final simplification46.4%
NOTE: y and z should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(if (<= x -3.2e+75)
(* -4.0 (+ (* t a) (* x i)))
(if (<= x 1.95e+25)
(- (* b c) (* 27.0 (* j k)))
(* (* 18.0 y) (* t (* x z))))))assert(y < z);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double tmp;
if (x <= -3.2e+75) {
tmp = -4.0 * ((t * a) + (x * i));
} else if (x <= 1.95e+25) {
tmp = (b * c) - (27.0 * (j * k));
} else {
tmp = (18.0 * y) * (t * (x * z));
}
return tmp;
}
NOTE: y and z should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: tmp
if (x <= (-3.2d+75)) then
tmp = (-4.0d0) * ((t * a) + (x * i))
else if (x <= 1.95d+25) then
tmp = (b * c) - (27.0d0 * (j * k))
else
tmp = (18.0d0 * y) * (t * (x * z))
end if
code = tmp
end function
assert y < z;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double tmp;
if (x <= -3.2e+75) {
tmp = -4.0 * ((t * a) + (x * i));
} else if (x <= 1.95e+25) {
tmp = (b * c) - (27.0 * (j * k));
} else {
tmp = (18.0 * y) * (t * (x * z));
}
return tmp;
}
[y, z] = sort([y, z]) def code(x, y, z, t, a, b, c, i, j, k): tmp = 0 if x <= -3.2e+75: tmp = -4.0 * ((t * a) + (x * i)) elif x <= 1.95e+25: tmp = (b * c) - (27.0 * (j * k)) else: tmp = (18.0 * y) * (t * (x * z)) return tmp
y, z = sort([y, z]) function code(x, y, z, t, a, b, c, i, j, k) tmp = 0.0 if (x <= -3.2e+75) tmp = Float64(-4.0 * Float64(Float64(t * a) + Float64(x * i))); elseif (x <= 1.95e+25) tmp = Float64(Float64(b * c) - Float64(27.0 * Float64(j * k))); else tmp = Float64(Float64(18.0 * y) * Float64(t * Float64(x * z))); end return tmp end
y, z = num2cell(sort([y, z])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
tmp = 0.0;
if (x <= -3.2e+75)
tmp = -4.0 * ((t * a) + (x * i));
elseif (x <= 1.95e+25)
tmp = (b * c) - (27.0 * (j * k));
else
tmp = (18.0 * y) * (t * (x * z));
end
tmp_2 = tmp;
end
NOTE: y and z should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := If[LessEqual[x, -3.2e+75], N[(-4.0 * N[(N[(t * a), $MachinePrecision] + N[(x * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.95e+25], N[(N[(b * c), $MachinePrecision] - N[(27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(18.0 * y), $MachinePrecision] * N[(t * N[(x * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -3.2 \cdot 10^{+75}:\\
\;\;\;\;-4 \cdot \left(t \cdot a + x \cdot i\right)\\
\mathbf{elif}\;x \leq 1.95 \cdot 10^{+25}:\\
\;\;\;\;b \cdot c - 27 \cdot \left(j \cdot k\right)\\
\mathbf{else}:\\
\;\;\;\;\left(18 \cdot y\right) \cdot \left(t \cdot \left(x \cdot z\right)\right)\\
\end{array}
\end{array}
if x < -3.19999999999999985e75Initial program 78.7%
sub-neg78.7%
+-commutative78.7%
associate-*l*78.7%
distribute-rgt-neg-in78.7%
fma-def78.7%
*-commutative78.7%
distribute-rgt-neg-in78.7%
metadata-eval78.7%
sub-neg78.7%
+-commutative78.7%
associate-*l*78.7%
distribute-rgt-neg-in78.7%
Simplified85.9%
Taylor expanded in a around inf 79.5%
Taylor expanded in j around 0 62.9%
distribute-lft-out62.9%
*-commutative62.9%
Simplified62.9%
if -3.19999999999999985e75 < x < 1.9500000000000001e25Initial program 98.4%
sub-neg98.4%
associate-+l-98.4%
sub-neg98.4%
sub-neg98.4%
distribute-rgt-out--98.4%
associate-*l*94.3%
distribute-lft-neg-in94.3%
cancel-sign-sub94.3%
associate-*l*94.3%
associate-*l*94.3%
Simplified94.3%
Taylor expanded in i around 0 88.2%
Taylor expanded in t around 0 63.5%
if 1.9500000000000001e25 < x Initial program 72.8%
sub-neg72.8%
associate-+l-72.8%
sub-neg72.8%
sub-neg72.8%
distribute-rgt-out--78.2%
associate-*l*80.8%
distribute-lft-neg-in80.8%
cancel-sign-sub80.8%
associate-*l*80.8%
associate-*l*80.9%
Simplified80.9%
Taylor expanded in t around 0 76.9%
Taylor expanded in y around inf 54.5%
associate-*r*54.5%
*-commutative54.5%
Simplified54.5%
Final simplification60.9%
NOTE: y and z should be sorted in increasing order before calling this function. (FPCore (x y z t a b c i j k) :precision binary64 (if (or (<= j -250000000000.0) (not (<= j 2.35e-59))) (* (* j k) -27.0) (* b c)))
assert(y < z);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double tmp;
if ((j <= -250000000000.0) || !(j <= 2.35e-59)) {
tmp = (j * k) * -27.0;
} else {
tmp = b * c;
}
return tmp;
}
NOTE: y and z should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: tmp
if ((j <= (-250000000000.0d0)) .or. (.not. (j <= 2.35d-59))) then
tmp = (j * k) * (-27.0d0)
else
tmp = b * c
end if
code = tmp
end function
assert y < z;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double tmp;
if ((j <= -250000000000.0) || !(j <= 2.35e-59)) {
tmp = (j * k) * -27.0;
} else {
tmp = b * c;
}
return tmp;
}
[y, z] = sort([y, z]) def code(x, y, z, t, a, b, c, i, j, k): tmp = 0 if (j <= -250000000000.0) or not (j <= 2.35e-59): tmp = (j * k) * -27.0 else: tmp = b * c return tmp
y, z = sort([y, z]) function code(x, y, z, t, a, b, c, i, j, k) tmp = 0.0 if ((j <= -250000000000.0) || !(j <= 2.35e-59)) tmp = Float64(Float64(j * k) * -27.0); else tmp = Float64(b * c); end return tmp end
y, z = num2cell(sort([y, z])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
tmp = 0.0;
if ((j <= -250000000000.0) || ~((j <= 2.35e-59)))
tmp = (j * k) * -27.0;
else
tmp = b * c;
end
tmp_2 = tmp;
end
NOTE: y and z should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := If[Or[LessEqual[j, -250000000000.0], N[Not[LessEqual[j, 2.35e-59]], $MachinePrecision]], N[(N[(j * k), $MachinePrecision] * -27.0), $MachinePrecision], N[(b * c), $MachinePrecision]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
\\
\begin{array}{l}
\mathbf{if}\;j \leq -250000000000 \lor \neg \left(j \leq 2.35 \cdot 10^{-59}\right):\\
\;\;\;\;\left(j \cdot k\right) \cdot -27\\
\mathbf{else}:\\
\;\;\;\;b \cdot c\\
\end{array}
\end{array}
if j < -2.5e11 or 2.35e-59 < j Initial program 90.2%
sub-neg90.2%
+-commutative90.2%
associate-*l*90.3%
distribute-rgt-neg-in90.3%
fma-def92.5%
*-commutative92.5%
distribute-rgt-neg-in92.5%
metadata-eval92.5%
sub-neg92.5%
+-commutative92.5%
associate-*l*92.5%
distribute-rgt-neg-in92.5%
Simplified90.3%
Taylor expanded in j around inf 43.0%
if -2.5e11 < j < 2.35e-59Initial program 85.2%
sub-neg85.2%
associate-+l-85.2%
sub-neg85.2%
sub-neg85.2%
distribute-rgt-out--89.3%
associate-*l*90.1%
distribute-lft-neg-in90.1%
cancel-sign-sub90.1%
associate-*l*90.1%
associate-*l*90.2%
Simplified90.2%
Taylor expanded in t around 0 89.4%
Taylor expanded in b around inf 32.0%
Final simplification37.8%
NOTE: y and z should be sorted in increasing order before calling this function. (FPCore (x y z t a b c i j k) :precision binary64 (* b c))
assert(y < z);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
return b * c;
}
NOTE: y and z should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
code = b * c
end function
assert y < z;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
return b * c;
}
[y, z] = sort([y, z]) def code(x, y, z, t, a, b, c, i, j, k): return b * c
y, z = sort([y, z]) function code(x, y, z, t, a, b, c, i, j, k) return Float64(b * c) end
y, z = num2cell(sort([y, z])){:}
function tmp = code(x, y, z, t, a, b, c, i, j, k)
tmp = b * c;
end
NOTE: y and z should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := N[(b * c), $MachinePrecision]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
\\
b \cdot c
\end{array}
Initial program 87.9%
sub-neg87.9%
associate-+l-87.9%
sub-neg87.9%
sub-neg87.9%
distribute-rgt-out--89.8%
associate-*l*88.7%
distribute-lft-neg-in88.7%
cancel-sign-sub88.7%
associate-*l*88.7%
associate-*l*88.7%
Simplified88.7%
Taylor expanded in t around 0 89.9%
Taylor expanded in b around inf 24.1%
Final simplification24.1%
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (* (+ (* a t) (* i x)) 4.0))
(t_2
(-
(- (* (* 18.0 t) (* (* x y) z)) t_1)
(- (* (* k j) 27.0) (* c b)))))
(if (< t -1.6210815397541398e-69)
t_2
(if (< t 165.68027943805222)
(+ (- (* (* 18.0 y) (* x (* z t))) t_1) (- (* c b) (* 27.0 (* k j))))
t_2))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = ((a * t) + (i * x)) * 4.0;
double t_2 = (((18.0 * t) * ((x * y) * z)) - t_1) - (((k * j) * 27.0) - (c * b));
double tmp;
if (t < -1.6210815397541398e-69) {
tmp = t_2;
} else if (t < 165.68027943805222) {
tmp = (((18.0 * y) * (x * (z * t))) - t_1) + ((c * b) - (27.0 * (k * j)));
} else {
tmp = t_2;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i, j, k)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = ((a * t) + (i * x)) * 4.0d0
t_2 = (((18.0d0 * t) * ((x * y) * z)) - t_1) - (((k * j) * 27.0d0) - (c * b))
if (t < (-1.6210815397541398d-69)) then
tmp = t_2
else if (t < 165.68027943805222d0) then
tmp = (((18.0d0 * y) * (x * (z * t))) - t_1) + ((c * b) - (27.0d0 * (k * j)))
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = ((a * t) + (i * x)) * 4.0;
double t_2 = (((18.0 * t) * ((x * y) * z)) - t_1) - (((k * j) * 27.0) - (c * b));
double tmp;
if (t < -1.6210815397541398e-69) {
tmp = t_2;
} else if (t < 165.68027943805222) {
tmp = (((18.0 * y) * (x * (z * t))) - t_1) + ((c * b) - (27.0 * (k * j)));
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j, k): t_1 = ((a * t) + (i * x)) * 4.0 t_2 = (((18.0 * t) * ((x * y) * z)) - t_1) - (((k * j) * 27.0) - (c * b)) tmp = 0 if t < -1.6210815397541398e-69: tmp = t_2 elif t < 165.68027943805222: tmp = (((18.0 * y) * (x * (z * t))) - t_1) + ((c * b) - (27.0 * (k * j))) else: tmp = t_2 return tmp
function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(Float64(Float64(a * t) + Float64(i * x)) * 4.0) t_2 = Float64(Float64(Float64(Float64(18.0 * t) * Float64(Float64(x * y) * z)) - t_1) - Float64(Float64(Float64(k * j) * 27.0) - Float64(c * b))) tmp = 0.0 if (t < -1.6210815397541398e-69) tmp = t_2; elseif (t < 165.68027943805222) tmp = Float64(Float64(Float64(Float64(18.0 * y) * Float64(x * Float64(z * t))) - t_1) + Float64(Float64(c * b) - Float64(27.0 * Float64(k * j)))); else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k) t_1 = ((a * t) + (i * x)) * 4.0; t_2 = (((18.0 * t) * ((x * y) * z)) - t_1) - (((k * j) * 27.0) - (c * b)); tmp = 0.0; if (t < -1.6210815397541398e-69) tmp = t_2; elseif (t < 165.68027943805222) tmp = (((18.0 * y) * (x * (z * t))) - t_1) + ((c * b) - (27.0 * (k * j))); else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(N[(N[(a * t), $MachinePrecision] + N[(i * x), $MachinePrecision]), $MachinePrecision] * 4.0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(N[(18.0 * t), $MachinePrecision] * N[(N[(x * y), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision] - N[(N[(N[(k * j), $MachinePrecision] * 27.0), $MachinePrecision] - N[(c * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Less[t, -1.6210815397541398e-69], t$95$2, If[Less[t, 165.68027943805222], N[(N[(N[(N[(18.0 * y), $MachinePrecision] * N[(x * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision] + N[(N[(c * b), $MachinePrecision] - N[(27.0 * N[(k * j), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$2]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(a \cdot t + i \cdot x\right) \cdot 4\\
t_2 := \left(\left(18 \cdot t\right) \cdot \left(\left(x \cdot y\right) \cdot z\right) - t_1\right) - \left(\left(k \cdot j\right) \cdot 27 - c \cdot b\right)\\
\mathbf{if}\;t < -1.6210815397541398 \cdot 10^{-69}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t < 165.68027943805222:\\
\;\;\;\;\left(\left(18 \cdot y\right) \cdot \left(x \cdot \left(z \cdot t\right)\right) - t_1\right) + \left(c \cdot b - 27 \cdot \left(k \cdot j\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
herbie shell --seed 2023199
(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)))