
(FPCore (x y z t a b) :precision binary64 (+ (- (* x 2.0) (* (* (* y 9.0) z) t)) (* (* a 27.0) b)))
double code(double x, double y, double z, double t, double a, double b) {
return ((x * 2.0) - (((y * 9.0) * z) * t)) + ((a * 27.0) * b);
}
real(8) function code(x, y, z, t, a, b)
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
code = ((x * 2.0d0) - (((y * 9.0d0) * z) * t)) + ((a * 27.0d0) * b)
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return ((x * 2.0) - (((y * 9.0) * z) * t)) + ((a * 27.0) * b);
}
def code(x, y, z, t, a, b): return ((x * 2.0) - (((y * 9.0) * z) * t)) + ((a * 27.0) * b)
function code(x, y, z, t, a, b) return Float64(Float64(Float64(x * 2.0) - Float64(Float64(Float64(y * 9.0) * z) * t)) + Float64(Float64(a * 27.0) * b)) end
function tmp = code(x, y, z, t, a, b) tmp = ((x * 2.0) - (((y * 9.0) * z) * t)) + ((a * 27.0) * b); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(x * 2.0), $MachinePrecision] - N[(N[(N[(y * 9.0), $MachinePrecision] * z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] + N[(N[(a * 27.0), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) + \left(a \cdot 27\right) \cdot b
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 13 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b) :precision binary64 (+ (- (* x 2.0) (* (* (* y 9.0) z) t)) (* (* a 27.0) b)))
double code(double x, double y, double z, double t, double a, double b) {
return ((x * 2.0) - (((y * 9.0) * z) * t)) + ((a * 27.0) * b);
}
real(8) function code(x, y, z, t, a, b)
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
code = ((x * 2.0d0) - (((y * 9.0d0) * z) * t)) + ((a * 27.0d0) * b)
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return ((x * 2.0) - (((y * 9.0) * z) * t)) + ((a * 27.0) * b);
}
def code(x, y, z, t, a, b): return ((x * 2.0) - (((y * 9.0) * z) * t)) + ((a * 27.0) * b)
function code(x, y, z, t, a, b) return Float64(Float64(Float64(x * 2.0) - Float64(Float64(Float64(y * 9.0) * z) * t)) + Float64(Float64(a * 27.0) * b)) end
function tmp = code(x, y, z, t, a, b) tmp = ((x * 2.0) - (((y * 9.0) * z) * t)) + ((a * 27.0) * b); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(x * 2.0), $MachinePrecision] - N[(N[(N[(y * 9.0), $MachinePrecision] * z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] + N[(N[(a * 27.0), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) + \left(a \cdot 27\right) \cdot b
\end{array}
NOTE: y, z, and t should be sorted in increasing order before calling this function.
NOTE: a and b should be sorted in increasing order before calling this function.
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* (* y 9.0) z)))
(if (<= t_1 5e+72)
(+ (- (* x 2.0) (* t_1 t)) (* (* a 27.0) b))
(+ (* x 2.0) (- (* a (* 27.0 b)) (* (* y 9.0) (* z t)))))))assert(y < z && z < t);
assert(a < b);
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (y * 9.0) * z;
double tmp;
if (t_1 <= 5e+72) {
tmp = ((x * 2.0) - (t_1 * t)) + ((a * 27.0) * b);
} else {
tmp = (x * 2.0) + ((a * (27.0 * b)) - ((y * 9.0) * (z * t)));
}
return tmp;
}
NOTE: y, z, and t should be sorted in increasing order before calling this function.
NOTE: a and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
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) :: t_1
real(8) :: tmp
t_1 = (y * 9.0d0) * z
if (t_1 <= 5d+72) then
tmp = ((x * 2.0d0) - (t_1 * t)) + ((a * 27.0d0) * b)
else
tmp = (x * 2.0d0) + ((a * (27.0d0 * b)) - ((y * 9.0d0) * (z * t)))
end if
code = tmp
end function
assert y < z && z < t;
assert a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (y * 9.0) * z;
double tmp;
if (t_1 <= 5e+72) {
tmp = ((x * 2.0) - (t_1 * t)) + ((a * 27.0) * b);
} else {
tmp = (x * 2.0) + ((a * (27.0 * b)) - ((y * 9.0) * (z * t)));
}
return tmp;
}
[y, z, t] = sort([y, z, t]) [a, b] = sort([a, b]) def code(x, y, z, t, a, b): t_1 = (y * 9.0) * z tmp = 0 if t_1 <= 5e+72: tmp = ((x * 2.0) - (t_1 * t)) + ((a * 27.0) * b) else: tmp = (x * 2.0) + ((a * (27.0 * b)) - ((y * 9.0) * (z * t))) return tmp
y, z, t = sort([y, z, t]) a, b = sort([a, b]) function code(x, y, z, t, a, b) t_1 = Float64(Float64(y * 9.0) * z) tmp = 0.0 if (t_1 <= 5e+72) tmp = Float64(Float64(Float64(x * 2.0) - Float64(t_1 * t)) + Float64(Float64(a * 27.0) * b)); else tmp = Float64(Float64(x * 2.0) + Float64(Float64(a * Float64(27.0 * b)) - Float64(Float64(y * 9.0) * Float64(z * t)))); end return tmp end
y, z, t = num2cell(sort([y, z, t])){:}
a, b = num2cell(sort([a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
t_1 = (y * 9.0) * z;
tmp = 0.0;
if (t_1 <= 5e+72)
tmp = ((x * 2.0) - (t_1 * t)) + ((a * 27.0) * b);
else
tmp = (x * 2.0) + ((a * (27.0 * b)) - ((y * 9.0) * (z * t)));
end
tmp_2 = tmp;
end
NOTE: y, z, and t should be sorted in increasing order before calling this function.
NOTE: a and b should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(y * 9.0), $MachinePrecision] * z), $MachinePrecision]}, If[LessEqual[t$95$1, 5e+72], N[(N[(N[(x * 2.0), $MachinePrecision] - N[(t$95$1 * t), $MachinePrecision]), $MachinePrecision] + N[(N[(a * 27.0), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision], N[(N[(x * 2.0), $MachinePrecision] + N[(N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision] - N[(N[(y * 9.0), $MachinePrecision] * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[y, z, t] = \mathsf{sort}([y, z, t])\\
[a, b] = \mathsf{sort}([a, b])\\
\\
\begin{array}{l}
t_1 := \left(y \cdot 9\right) \cdot z\\
\mathbf{if}\;t_1 \leq 5 \cdot 10^{+72}:\\
\;\;\;\;\left(x \cdot 2 - t_1 \cdot t\right) + \left(a \cdot 27\right) \cdot b\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2 + \left(a \cdot \left(27 \cdot b\right) - \left(y \cdot 9\right) \cdot \left(z \cdot t\right)\right)\\
\end{array}
\end{array}
if (*.f64 (*.f64 y 9) z) < 4.99999999999999992e72Initial program 97.0%
if 4.99999999999999992e72 < (*.f64 (*.f64 y 9) z) Initial program 88.2%
associate-+l-88.2%
sub-neg88.2%
neg-mul-188.2%
metadata-eval88.2%
metadata-eval88.2%
cancel-sign-sub-inv88.2%
metadata-eval88.2%
*-lft-identity88.2%
associate-*l*96.1%
associate-*l*96.1%
Simplified96.1%
Final simplification96.8%
NOTE: y, z, and t should be sorted in increasing order before calling this function.
NOTE: a and b should be sorted in increasing order before calling this function.
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (- (* x 2.0) (* -27.0 (* a b))))
(t_2 (* 9.0 (* y (* z t))))
(t_3 (- (* x 2.0) t_2)))
(if (<= (* x 2.0) -1e+145)
t_3
(if (<= (* x 2.0) -1e+97)
t_1
(if (<= (* x 2.0) -2000.0)
t_3
(if (<= (* x 2.0) 1e+55) (- (* 27.0 (* a b)) t_2) t_1))))))assert(y < z && z < t);
assert(a < b);
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (x * 2.0) - (-27.0 * (a * b));
double t_2 = 9.0 * (y * (z * t));
double t_3 = (x * 2.0) - t_2;
double tmp;
if ((x * 2.0) <= -1e+145) {
tmp = t_3;
} else if ((x * 2.0) <= -1e+97) {
tmp = t_1;
} else if ((x * 2.0) <= -2000.0) {
tmp = t_3;
} else if ((x * 2.0) <= 1e+55) {
tmp = (27.0 * (a * b)) - t_2;
} else {
tmp = t_1;
}
return tmp;
}
NOTE: y, z, and t should be sorted in increasing order before calling this function.
NOTE: a and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
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) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_1 = (x * 2.0d0) - ((-27.0d0) * (a * b))
t_2 = 9.0d0 * (y * (z * t))
t_3 = (x * 2.0d0) - t_2
if ((x * 2.0d0) <= (-1d+145)) then
tmp = t_3
else if ((x * 2.0d0) <= (-1d+97)) then
tmp = t_1
else if ((x * 2.0d0) <= (-2000.0d0)) then
tmp = t_3
else if ((x * 2.0d0) <= 1d+55) then
tmp = (27.0d0 * (a * b)) - t_2
else
tmp = t_1
end if
code = tmp
end function
assert y < z && z < t;
assert a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (x * 2.0) - (-27.0 * (a * b));
double t_2 = 9.0 * (y * (z * t));
double t_3 = (x * 2.0) - t_2;
double tmp;
if ((x * 2.0) <= -1e+145) {
tmp = t_3;
} else if ((x * 2.0) <= -1e+97) {
tmp = t_1;
} else if ((x * 2.0) <= -2000.0) {
tmp = t_3;
} else if ((x * 2.0) <= 1e+55) {
tmp = (27.0 * (a * b)) - t_2;
} else {
tmp = t_1;
}
return tmp;
}
[y, z, t] = sort([y, z, t]) [a, b] = sort([a, b]) def code(x, y, z, t, a, b): t_1 = (x * 2.0) - (-27.0 * (a * b)) t_2 = 9.0 * (y * (z * t)) t_3 = (x * 2.0) - t_2 tmp = 0 if (x * 2.0) <= -1e+145: tmp = t_3 elif (x * 2.0) <= -1e+97: tmp = t_1 elif (x * 2.0) <= -2000.0: tmp = t_3 elif (x * 2.0) <= 1e+55: tmp = (27.0 * (a * b)) - t_2 else: tmp = t_1 return tmp
y, z, t = sort([y, z, t]) a, b = sort([a, b]) function code(x, y, z, t, a, b) t_1 = Float64(Float64(x * 2.0) - Float64(-27.0 * Float64(a * b))) t_2 = Float64(9.0 * Float64(y * Float64(z * t))) t_3 = Float64(Float64(x * 2.0) - t_2) tmp = 0.0 if (Float64(x * 2.0) <= -1e+145) tmp = t_3; elseif (Float64(x * 2.0) <= -1e+97) tmp = t_1; elseif (Float64(x * 2.0) <= -2000.0) tmp = t_3; elseif (Float64(x * 2.0) <= 1e+55) tmp = Float64(Float64(27.0 * Float64(a * b)) - t_2); else tmp = t_1; end return tmp end
y, z, t = num2cell(sort([y, z, t])){:}
a, b = num2cell(sort([a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
t_1 = (x * 2.0) - (-27.0 * (a * b));
t_2 = 9.0 * (y * (z * t));
t_3 = (x * 2.0) - t_2;
tmp = 0.0;
if ((x * 2.0) <= -1e+145)
tmp = t_3;
elseif ((x * 2.0) <= -1e+97)
tmp = t_1;
elseif ((x * 2.0) <= -2000.0)
tmp = t_3;
elseif ((x * 2.0) <= 1e+55)
tmp = (27.0 * (a * b)) - t_2;
else
tmp = t_1;
end
tmp_2 = tmp;
end
NOTE: y, z, and t should be sorted in increasing order before calling this function.
NOTE: a and b should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(x * 2.0), $MachinePrecision] - N[(-27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(9.0 * N[(y * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(x * 2.0), $MachinePrecision] - t$95$2), $MachinePrecision]}, If[LessEqual[N[(x * 2.0), $MachinePrecision], -1e+145], t$95$3, If[LessEqual[N[(x * 2.0), $MachinePrecision], -1e+97], t$95$1, If[LessEqual[N[(x * 2.0), $MachinePrecision], -2000.0], t$95$3, If[LessEqual[N[(x * 2.0), $MachinePrecision], 1e+55], N[(N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision] - t$95$2), $MachinePrecision], t$95$1]]]]]]]
\begin{array}{l}
[y, z, t] = \mathsf{sort}([y, z, t])\\
[a, b] = \mathsf{sort}([a, b])\\
\\
\begin{array}{l}
t_1 := x \cdot 2 - -27 \cdot \left(a \cdot b\right)\\
t_2 := 9 \cdot \left(y \cdot \left(z \cdot t\right)\right)\\
t_3 := x \cdot 2 - t_2\\
\mathbf{if}\;x \cdot 2 \leq -1 \cdot 10^{+145}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;x \cdot 2 \leq -1 \cdot 10^{+97}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \cdot 2 \leq -2000:\\
\;\;\;\;t_3\\
\mathbf{elif}\;x \cdot 2 \leq 10^{+55}:\\
\;\;\;\;27 \cdot \left(a \cdot b\right) - t_2\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if (*.f64 x 2) < -9.9999999999999999e144 or -1.0000000000000001e97 < (*.f64 x 2) < -2e3Initial program 98.2%
Taylor expanded in a around 0 89.0%
if -9.9999999999999999e144 < (*.f64 x 2) < -1.0000000000000001e97 or 1.00000000000000001e55 < (*.f64 x 2) Initial program 98.1%
associate-+l-98.1%
sub-neg98.1%
neg-mul-198.1%
metadata-eval98.1%
metadata-eval98.1%
cancel-sign-sub-inv98.1%
metadata-eval98.1%
*-lft-identity98.1%
associate-*l*91.4%
associate-*l*91.5%
Simplified91.5%
Taylor expanded in y around 0 86.4%
*-commutative86.4%
Simplified86.4%
if -2e3 < (*.f64 x 2) < 1.00000000000000001e55Initial program 93.2%
Taylor expanded in x around 0 91.9%
Final simplification90.1%
NOTE: y, z, and t should be sorted in increasing order before calling this function.
NOTE: a and b should be sorted in increasing order before calling this function.
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* (* y 9.0) z)))
(if (<= t_1 5e+268)
(+ (- (* x 2.0) (* t_1 t)) (* (* a 27.0) b))
(- (* 27.0 (* a b)) (* 9.0 (* y (* z t)))))))assert(y < z && z < t);
assert(a < b);
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (y * 9.0) * z;
double tmp;
if (t_1 <= 5e+268) {
tmp = ((x * 2.0) - (t_1 * t)) + ((a * 27.0) * b);
} else {
tmp = (27.0 * (a * b)) - (9.0 * (y * (z * t)));
}
return tmp;
}
NOTE: y, z, and t should be sorted in increasing order before calling this function.
NOTE: a and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
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) :: t_1
real(8) :: tmp
t_1 = (y * 9.0d0) * z
if (t_1 <= 5d+268) then
tmp = ((x * 2.0d0) - (t_1 * t)) + ((a * 27.0d0) * b)
else
tmp = (27.0d0 * (a * b)) - (9.0d0 * (y * (z * t)))
end if
code = tmp
end function
assert y < z && z < t;
assert a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (y * 9.0) * z;
double tmp;
if (t_1 <= 5e+268) {
tmp = ((x * 2.0) - (t_1 * t)) + ((a * 27.0) * b);
} else {
tmp = (27.0 * (a * b)) - (9.0 * (y * (z * t)));
}
return tmp;
}
[y, z, t] = sort([y, z, t]) [a, b] = sort([a, b]) def code(x, y, z, t, a, b): t_1 = (y * 9.0) * z tmp = 0 if t_1 <= 5e+268: tmp = ((x * 2.0) - (t_1 * t)) + ((a * 27.0) * b) else: tmp = (27.0 * (a * b)) - (9.0 * (y * (z * t))) return tmp
y, z, t = sort([y, z, t]) a, b = sort([a, b]) function code(x, y, z, t, a, b) t_1 = Float64(Float64(y * 9.0) * z) tmp = 0.0 if (t_1 <= 5e+268) tmp = Float64(Float64(Float64(x * 2.0) - Float64(t_1 * t)) + Float64(Float64(a * 27.0) * b)); else tmp = Float64(Float64(27.0 * Float64(a * b)) - Float64(9.0 * Float64(y * Float64(z * t)))); end return tmp end
y, z, t = num2cell(sort([y, z, t])){:}
a, b = num2cell(sort([a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
t_1 = (y * 9.0) * z;
tmp = 0.0;
if (t_1 <= 5e+268)
tmp = ((x * 2.0) - (t_1 * t)) + ((a * 27.0) * b);
else
tmp = (27.0 * (a * b)) - (9.0 * (y * (z * t)));
end
tmp_2 = tmp;
end
NOTE: y, z, and t should be sorted in increasing order before calling this function.
NOTE: a and b should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(y * 9.0), $MachinePrecision] * z), $MachinePrecision]}, If[LessEqual[t$95$1, 5e+268], N[(N[(N[(x * 2.0), $MachinePrecision] - N[(t$95$1 * t), $MachinePrecision]), $MachinePrecision] + N[(N[(a * 27.0), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision], N[(N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision] - N[(9.0 * N[(y * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[y, z, t] = \mathsf{sort}([y, z, t])\\
[a, b] = \mathsf{sort}([a, b])\\
\\
\begin{array}{l}
t_1 := \left(y \cdot 9\right) \cdot z\\
\mathbf{if}\;t_1 \leq 5 \cdot 10^{+268}:\\
\;\;\;\;\left(x \cdot 2 - t_1 \cdot t\right) + \left(a \cdot 27\right) \cdot b\\
\mathbf{else}:\\
\;\;\;\;27 \cdot \left(a \cdot b\right) - 9 \cdot \left(y \cdot \left(z \cdot t\right)\right)\\
\end{array}
\end{array}
if (*.f64 (*.f64 y 9) z) < 5.0000000000000002e268Initial program 97.3%
if 5.0000000000000002e268 < (*.f64 (*.f64 y 9) z) Initial program 77.2%
Taylor expanded in x around 0 99.8%
Final simplification97.5%
NOTE: y, z, and t should be sorted in increasing order before calling this function.
NOTE: a and b should be sorted in increasing order before calling this function.
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* (* y 9.0) z)))
(if (<= t_1 2e+295)
(+ (- (* x 2.0) (* t_1 t)) (* (* a 27.0) b))
(- (* x 2.0) (+ (* b (* a -27.0)) (* y (* 9.0 (* z t))))))))assert(y < z && z < t);
assert(a < b);
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (y * 9.0) * z;
double tmp;
if (t_1 <= 2e+295) {
tmp = ((x * 2.0) - (t_1 * t)) + ((a * 27.0) * b);
} else {
tmp = (x * 2.0) - ((b * (a * -27.0)) + (y * (9.0 * (z * t))));
}
return tmp;
}
NOTE: y, z, and t should be sorted in increasing order before calling this function.
NOTE: a and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
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) :: t_1
real(8) :: tmp
t_1 = (y * 9.0d0) * z
if (t_1 <= 2d+295) then
tmp = ((x * 2.0d0) - (t_1 * t)) + ((a * 27.0d0) * b)
else
tmp = (x * 2.0d0) - ((b * (a * (-27.0d0))) + (y * (9.0d0 * (z * t))))
end if
code = tmp
end function
assert y < z && z < t;
assert a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (y * 9.0) * z;
double tmp;
if (t_1 <= 2e+295) {
tmp = ((x * 2.0) - (t_1 * t)) + ((a * 27.0) * b);
} else {
tmp = (x * 2.0) - ((b * (a * -27.0)) + (y * (9.0 * (z * t))));
}
return tmp;
}
[y, z, t] = sort([y, z, t]) [a, b] = sort([a, b]) def code(x, y, z, t, a, b): t_1 = (y * 9.0) * z tmp = 0 if t_1 <= 2e+295: tmp = ((x * 2.0) - (t_1 * t)) + ((a * 27.0) * b) else: tmp = (x * 2.0) - ((b * (a * -27.0)) + (y * (9.0 * (z * t)))) return tmp
y, z, t = sort([y, z, t]) a, b = sort([a, b]) function code(x, y, z, t, a, b) t_1 = Float64(Float64(y * 9.0) * z) tmp = 0.0 if (t_1 <= 2e+295) tmp = Float64(Float64(Float64(x * 2.0) - Float64(t_1 * t)) + Float64(Float64(a * 27.0) * b)); else tmp = Float64(Float64(x * 2.0) - Float64(Float64(b * Float64(a * -27.0)) + Float64(y * Float64(9.0 * Float64(z * t))))); end return tmp end
y, z, t = num2cell(sort([y, z, t])){:}
a, b = num2cell(sort([a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
t_1 = (y * 9.0) * z;
tmp = 0.0;
if (t_1 <= 2e+295)
tmp = ((x * 2.0) - (t_1 * t)) + ((a * 27.0) * b);
else
tmp = (x * 2.0) - ((b * (a * -27.0)) + (y * (9.0 * (z * t))));
end
tmp_2 = tmp;
end
NOTE: y, z, and t should be sorted in increasing order before calling this function.
NOTE: a and b should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(y * 9.0), $MachinePrecision] * z), $MachinePrecision]}, If[LessEqual[t$95$1, 2e+295], N[(N[(N[(x * 2.0), $MachinePrecision] - N[(t$95$1 * t), $MachinePrecision]), $MachinePrecision] + N[(N[(a * 27.0), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision], N[(N[(x * 2.0), $MachinePrecision] - N[(N[(b * N[(a * -27.0), $MachinePrecision]), $MachinePrecision] + N[(y * N[(9.0 * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[y, z, t] = \mathsf{sort}([y, z, t])\\
[a, b] = \mathsf{sort}([a, b])\\
\\
\begin{array}{l}
t_1 := \left(y \cdot 9\right) \cdot z\\
\mathbf{if}\;t_1 \leq 2 \cdot 10^{+295}:\\
\;\;\;\;\left(x \cdot 2 - t_1 \cdot t\right) + \left(a \cdot 27\right) \cdot b\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2 - \left(b \cdot \left(a \cdot -27\right) + y \cdot \left(9 \cdot \left(z \cdot t\right)\right)\right)\\
\end{array}
\end{array}
if (*.f64 (*.f64 y 9) z) < 2e295Initial program 97.3%
if 2e295 < (*.f64 (*.f64 y 9) z) Initial program 74.0%
associate-+l-74.0%
sub-neg74.0%
neg-mul-174.0%
metadata-eval74.0%
metadata-eval74.0%
cancel-sign-sub-inv74.0%
metadata-eval74.0%
*-lft-identity74.0%
associate-*l*99.9%
associate-*l*99.8%
Simplified99.8%
cancel-sign-sub-inv99.8%
associate-*l*99.8%
Applied egg-rr99.8%
Taylor expanded in a around 0 99.8%
*-commutative99.8%
*-commutative99.8%
associate-*l*99.9%
Simplified99.9%
Final simplification97.5%
NOTE: y, z, and t should be sorted in increasing order before calling this function.
NOTE: a and b should be sorted in increasing order before calling this function.
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* t (* y (* z -9.0)))))
(if (<= x -4.9e+92)
(* x 2.0)
(if (<= x -2.45e-142)
t_1
(if (<= x -3.6e-215)
(* a (* 27.0 b))
(if (<= x 2.85e-291)
t_1
(if (<= x 3.3e-202)
(* 27.0 (* a b))
(if (<= x 8.5e-86)
t_1
(if (<= x 2.25e+55) (* (* a 27.0) b) (* x 2.0))))))))))assert(y < z && z < t);
assert(a < b);
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = t * (y * (z * -9.0));
double tmp;
if (x <= -4.9e+92) {
tmp = x * 2.0;
} else if (x <= -2.45e-142) {
tmp = t_1;
} else if (x <= -3.6e-215) {
tmp = a * (27.0 * b);
} else if (x <= 2.85e-291) {
tmp = t_1;
} else if (x <= 3.3e-202) {
tmp = 27.0 * (a * b);
} else if (x <= 8.5e-86) {
tmp = t_1;
} else if (x <= 2.25e+55) {
tmp = (a * 27.0) * b;
} else {
tmp = x * 2.0;
}
return tmp;
}
NOTE: y, z, and t should be sorted in increasing order before calling this function.
NOTE: a and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
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) :: t_1
real(8) :: tmp
t_1 = t * (y * (z * (-9.0d0)))
if (x <= (-4.9d+92)) then
tmp = x * 2.0d0
else if (x <= (-2.45d-142)) then
tmp = t_1
else if (x <= (-3.6d-215)) then
tmp = a * (27.0d0 * b)
else if (x <= 2.85d-291) then
tmp = t_1
else if (x <= 3.3d-202) then
tmp = 27.0d0 * (a * b)
else if (x <= 8.5d-86) then
tmp = t_1
else if (x <= 2.25d+55) then
tmp = (a * 27.0d0) * b
else
tmp = x * 2.0d0
end if
code = tmp
end function
assert y < z && z < t;
assert a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = t * (y * (z * -9.0));
double tmp;
if (x <= -4.9e+92) {
tmp = x * 2.0;
} else if (x <= -2.45e-142) {
tmp = t_1;
} else if (x <= -3.6e-215) {
tmp = a * (27.0 * b);
} else if (x <= 2.85e-291) {
tmp = t_1;
} else if (x <= 3.3e-202) {
tmp = 27.0 * (a * b);
} else if (x <= 8.5e-86) {
tmp = t_1;
} else if (x <= 2.25e+55) {
tmp = (a * 27.0) * b;
} else {
tmp = x * 2.0;
}
return tmp;
}
[y, z, t] = sort([y, z, t]) [a, b] = sort([a, b]) def code(x, y, z, t, a, b): t_1 = t * (y * (z * -9.0)) tmp = 0 if x <= -4.9e+92: tmp = x * 2.0 elif x <= -2.45e-142: tmp = t_1 elif x <= -3.6e-215: tmp = a * (27.0 * b) elif x <= 2.85e-291: tmp = t_1 elif x <= 3.3e-202: tmp = 27.0 * (a * b) elif x <= 8.5e-86: tmp = t_1 elif x <= 2.25e+55: tmp = (a * 27.0) * b else: tmp = x * 2.0 return tmp
y, z, t = sort([y, z, t]) a, b = sort([a, b]) function code(x, y, z, t, a, b) t_1 = Float64(t * Float64(y * Float64(z * -9.0))) tmp = 0.0 if (x <= -4.9e+92) tmp = Float64(x * 2.0); elseif (x <= -2.45e-142) tmp = t_1; elseif (x <= -3.6e-215) tmp = Float64(a * Float64(27.0 * b)); elseif (x <= 2.85e-291) tmp = t_1; elseif (x <= 3.3e-202) tmp = Float64(27.0 * Float64(a * b)); elseif (x <= 8.5e-86) tmp = t_1; elseif (x <= 2.25e+55) tmp = Float64(Float64(a * 27.0) * b); else tmp = Float64(x * 2.0); end return tmp end
y, z, t = num2cell(sort([y, z, t])){:}
a, b = num2cell(sort([a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
t_1 = t * (y * (z * -9.0));
tmp = 0.0;
if (x <= -4.9e+92)
tmp = x * 2.0;
elseif (x <= -2.45e-142)
tmp = t_1;
elseif (x <= -3.6e-215)
tmp = a * (27.0 * b);
elseif (x <= 2.85e-291)
tmp = t_1;
elseif (x <= 3.3e-202)
tmp = 27.0 * (a * b);
elseif (x <= 8.5e-86)
tmp = t_1;
elseif (x <= 2.25e+55)
tmp = (a * 27.0) * b;
else
tmp = x * 2.0;
end
tmp_2 = tmp;
end
NOTE: y, z, and t should be sorted in increasing order before calling this function.
NOTE: a and b should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(t * N[(y * N[(z * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -4.9e+92], N[(x * 2.0), $MachinePrecision], If[LessEqual[x, -2.45e-142], t$95$1, If[LessEqual[x, -3.6e-215], N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 2.85e-291], t$95$1, If[LessEqual[x, 3.3e-202], N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 8.5e-86], t$95$1, If[LessEqual[x, 2.25e+55], N[(N[(a * 27.0), $MachinePrecision] * b), $MachinePrecision], N[(x * 2.0), $MachinePrecision]]]]]]]]]
\begin{array}{l}
[y, z, t] = \mathsf{sort}([y, z, t])\\
[a, b] = \mathsf{sort}([a, b])\\
\\
\begin{array}{l}
t_1 := t \cdot \left(y \cdot \left(z \cdot -9\right)\right)\\
\mathbf{if}\;x \leq -4.9 \cdot 10^{+92}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;x \leq -2.45 \cdot 10^{-142}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq -3.6 \cdot 10^{-215}:\\
\;\;\;\;a \cdot \left(27 \cdot b\right)\\
\mathbf{elif}\;x \leq 2.85 \cdot 10^{-291}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 3.3 \cdot 10^{-202}:\\
\;\;\;\;27 \cdot \left(a \cdot b\right)\\
\mathbf{elif}\;x \leq 8.5 \cdot 10^{-86}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 2.25 \cdot 10^{+55}:\\
\;\;\;\;\left(a \cdot 27\right) \cdot b\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2\\
\end{array}
\end{array}
if x < -4.9000000000000002e92 or 2.24999999999999999e55 < x Initial program 97.9%
Taylor expanded in x around inf 61.6%
if -4.9000000000000002e92 < x < -2.4500000000000002e-142 or -3.5999999999999999e-215 < x < 2.85000000000000017e-291 or 3.29999999999999989e-202 < x < 8.499999999999999e-86Initial program 92.7%
Taylor expanded in y around inf 60.1%
*-commutative60.1%
*-commutative60.1%
associate-*l*56.8%
*-commutative56.8%
associate-*r*56.9%
Simplified56.9%
Taylor expanded in y around 0 56.9%
*-commutative56.9%
associate-*l*56.9%
Simplified56.9%
if -2.4500000000000002e-142 < x < -3.5999999999999999e-215Initial program 94.7%
associate-+l-94.7%
sub-neg94.7%
neg-mul-194.7%
metadata-eval94.7%
metadata-eval94.7%
cancel-sign-sub-inv94.7%
metadata-eval94.7%
*-lft-identity94.7%
associate-*l*99.7%
associate-*l*99.7%
Simplified99.7%
Taylor expanded in y around 0 72.9%
*-commutative72.9%
Simplified72.9%
Taylor expanded in x around 0 72.9%
*-commutative72.9%
associate-*l*72.9%
Simplified72.9%
if 2.85000000000000017e-291 < x < 3.29999999999999989e-202Initial program 99.6%
associate-+l-99.6%
sub-neg99.6%
neg-mul-199.6%
metadata-eval99.6%
metadata-eval99.6%
cancel-sign-sub-inv99.6%
metadata-eval99.6%
*-lft-identity99.6%
associate-*l*95.9%
associate-*l*95.9%
Simplified95.9%
Taylor expanded in y around 0 68.6%
*-commutative68.6%
Simplified68.6%
Taylor expanded in x around 0 64.7%
if 8.499999999999999e-86 < x < 2.24999999999999999e55Initial program 90.9%
associate-+l-90.9%
sub-neg90.9%
neg-mul-190.9%
metadata-eval90.9%
metadata-eval90.9%
cancel-sign-sub-inv90.9%
metadata-eval90.9%
*-lft-identity90.9%
associate-*l*99.5%
associate-*l*99.5%
Simplified99.5%
Taylor expanded in y around 0 60.5%
*-commutative60.5%
Simplified60.5%
Taylor expanded in x around 0 49.2%
*-commutative49.2%
associate-*l*49.2%
Simplified49.2%
Taylor expanded in a around 0 49.2%
*-commutative49.2%
*-commutative49.2%
associate-*l*49.3%
Simplified49.3%
Final simplification59.9%
NOTE: y, z, and t should be sorted in increasing order before calling this function.
NOTE: a and b should be sorted in increasing order before calling this function.
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* t (* -9.0 (* y z)))))
(if (<= x -1.5e+94)
(* x 2.0)
(if (<= x -5.2e-141)
t_1
(if (<= x -3.8e-216)
(* a (* 27.0 b))
(if (<= x 2.9e-293)
t_1
(if (<= x 1e-202)
(* 27.0 (* a b))
(if (<= x 3.8e-135)
t_1
(if (<= x 1.65e+55) (* (* a 27.0) b) (* x 2.0))))))))))assert(y < z && z < t);
assert(a < b);
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = t * (-9.0 * (y * z));
double tmp;
if (x <= -1.5e+94) {
tmp = x * 2.0;
} else if (x <= -5.2e-141) {
tmp = t_1;
} else if (x <= -3.8e-216) {
tmp = a * (27.0 * b);
} else if (x <= 2.9e-293) {
tmp = t_1;
} else if (x <= 1e-202) {
tmp = 27.0 * (a * b);
} else if (x <= 3.8e-135) {
tmp = t_1;
} else if (x <= 1.65e+55) {
tmp = (a * 27.0) * b;
} else {
tmp = x * 2.0;
}
return tmp;
}
NOTE: y, z, and t should be sorted in increasing order before calling this function.
NOTE: a and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
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) :: t_1
real(8) :: tmp
t_1 = t * ((-9.0d0) * (y * z))
if (x <= (-1.5d+94)) then
tmp = x * 2.0d0
else if (x <= (-5.2d-141)) then
tmp = t_1
else if (x <= (-3.8d-216)) then
tmp = a * (27.0d0 * b)
else if (x <= 2.9d-293) then
tmp = t_1
else if (x <= 1d-202) then
tmp = 27.0d0 * (a * b)
else if (x <= 3.8d-135) then
tmp = t_1
else if (x <= 1.65d+55) then
tmp = (a * 27.0d0) * b
else
tmp = x * 2.0d0
end if
code = tmp
end function
assert y < z && z < t;
assert a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = t * (-9.0 * (y * z));
double tmp;
if (x <= -1.5e+94) {
tmp = x * 2.0;
} else if (x <= -5.2e-141) {
tmp = t_1;
} else if (x <= -3.8e-216) {
tmp = a * (27.0 * b);
} else if (x <= 2.9e-293) {
tmp = t_1;
} else if (x <= 1e-202) {
tmp = 27.0 * (a * b);
} else if (x <= 3.8e-135) {
tmp = t_1;
} else if (x <= 1.65e+55) {
tmp = (a * 27.0) * b;
} else {
tmp = x * 2.0;
}
return tmp;
}
[y, z, t] = sort([y, z, t]) [a, b] = sort([a, b]) def code(x, y, z, t, a, b): t_1 = t * (-9.0 * (y * z)) tmp = 0 if x <= -1.5e+94: tmp = x * 2.0 elif x <= -5.2e-141: tmp = t_1 elif x <= -3.8e-216: tmp = a * (27.0 * b) elif x <= 2.9e-293: tmp = t_1 elif x <= 1e-202: tmp = 27.0 * (a * b) elif x <= 3.8e-135: tmp = t_1 elif x <= 1.65e+55: tmp = (a * 27.0) * b else: tmp = x * 2.0 return tmp
y, z, t = sort([y, z, t]) a, b = sort([a, b]) function code(x, y, z, t, a, b) t_1 = Float64(t * Float64(-9.0 * Float64(y * z))) tmp = 0.0 if (x <= -1.5e+94) tmp = Float64(x * 2.0); elseif (x <= -5.2e-141) tmp = t_1; elseif (x <= -3.8e-216) tmp = Float64(a * Float64(27.0 * b)); elseif (x <= 2.9e-293) tmp = t_1; elseif (x <= 1e-202) tmp = Float64(27.0 * Float64(a * b)); elseif (x <= 3.8e-135) tmp = t_1; elseif (x <= 1.65e+55) tmp = Float64(Float64(a * 27.0) * b); else tmp = Float64(x * 2.0); end return tmp end
y, z, t = num2cell(sort([y, z, t])){:}
a, b = num2cell(sort([a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
t_1 = t * (-9.0 * (y * z));
tmp = 0.0;
if (x <= -1.5e+94)
tmp = x * 2.0;
elseif (x <= -5.2e-141)
tmp = t_1;
elseif (x <= -3.8e-216)
tmp = a * (27.0 * b);
elseif (x <= 2.9e-293)
tmp = t_1;
elseif (x <= 1e-202)
tmp = 27.0 * (a * b);
elseif (x <= 3.8e-135)
tmp = t_1;
elseif (x <= 1.65e+55)
tmp = (a * 27.0) * b;
else
tmp = x * 2.0;
end
tmp_2 = tmp;
end
NOTE: y, z, and t should be sorted in increasing order before calling this function.
NOTE: a and b should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(t * N[(-9.0 * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.5e+94], N[(x * 2.0), $MachinePrecision], If[LessEqual[x, -5.2e-141], t$95$1, If[LessEqual[x, -3.8e-216], N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 2.9e-293], t$95$1, If[LessEqual[x, 1e-202], N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 3.8e-135], t$95$1, If[LessEqual[x, 1.65e+55], N[(N[(a * 27.0), $MachinePrecision] * b), $MachinePrecision], N[(x * 2.0), $MachinePrecision]]]]]]]]]
\begin{array}{l}
[y, z, t] = \mathsf{sort}([y, z, t])\\
[a, b] = \mathsf{sort}([a, b])\\
\\
\begin{array}{l}
t_1 := t \cdot \left(-9 \cdot \left(y \cdot z\right)\right)\\
\mathbf{if}\;x \leq -1.5 \cdot 10^{+94}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;x \leq -5.2 \cdot 10^{-141}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq -3.8 \cdot 10^{-216}:\\
\;\;\;\;a \cdot \left(27 \cdot b\right)\\
\mathbf{elif}\;x \leq 2.9 \cdot 10^{-293}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 10^{-202}:\\
\;\;\;\;27 \cdot \left(a \cdot b\right)\\
\mathbf{elif}\;x \leq 3.8 \cdot 10^{-135}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 1.65 \cdot 10^{+55}:\\
\;\;\;\;\left(a \cdot 27\right) \cdot b\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2\\
\end{array}
\end{array}
if x < -1.5e94 or 1.65e55 < x Initial program 97.9%
Taylor expanded in x around inf 61.6%
if -1.5e94 < x < -5.20000000000000022e-141 or -3.8e-216 < x < 2.8999999999999999e-293 or 1e-202 < x < 3.8000000000000003e-135Initial program 92.4%
Taylor expanded in y around inf 62.6%
*-commutative62.6%
*-commutative62.6%
associate-*l*58.6%
*-commutative58.6%
associate-*r*58.7%
Simplified58.7%
if -5.20000000000000022e-141 < x < -3.8e-216Initial program 94.7%
associate-+l-94.7%
sub-neg94.7%
neg-mul-194.7%
metadata-eval94.7%
metadata-eval94.7%
cancel-sign-sub-inv94.7%
metadata-eval94.7%
*-lft-identity94.7%
associate-*l*99.7%
associate-*l*99.7%
Simplified99.7%
Taylor expanded in y around 0 72.9%
*-commutative72.9%
Simplified72.9%
Taylor expanded in x around 0 72.9%
*-commutative72.9%
associate-*l*72.9%
Simplified72.9%
if 2.8999999999999999e-293 < x < 1e-202Initial program 99.6%
associate-+l-99.6%
sub-neg99.6%
neg-mul-199.6%
metadata-eval99.6%
metadata-eval99.6%
cancel-sign-sub-inv99.6%
metadata-eval99.6%
*-lft-identity99.6%
associate-*l*95.9%
associate-*l*95.9%
Simplified95.9%
Taylor expanded in y around 0 68.6%
*-commutative68.6%
Simplified68.6%
Taylor expanded in x around 0 64.7%
if 3.8000000000000003e-135 < x < 1.65e55Initial program 92.1%
associate-+l-92.1%
sub-neg92.1%
neg-mul-192.1%
metadata-eval92.1%
metadata-eval92.1%
cancel-sign-sub-inv92.1%
metadata-eval92.1%
*-lft-identity92.1%
associate-*l*99.5%
associate-*l*99.5%
Simplified99.5%
Taylor expanded in y around 0 57.8%
*-commutative57.8%
Simplified57.8%
Taylor expanded in x around 0 48.9%
*-commutative48.9%
associate-*l*49.0%
Simplified49.0%
Taylor expanded in a around 0 48.9%
*-commutative48.9%
*-commutative48.9%
associate-*l*49.0%
Simplified49.0%
Final simplification59.9%
NOTE: y, z, and t should be sorted in increasing order before calling this function.
NOTE: a and b should be sorted in increasing order before calling this function.
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* (* y z) (* t -9.0))))
(if (<= x -3.8e+93)
(* x 2.0)
(if (<= x -2.8e-141)
t_1
(if (<= x -1e-215)
(* a (* 27.0 b))
(if (<= x 6e-291)
t_1
(if (<= x 7.6e-202)
(* 27.0 (* a b))
(if (<= x 1.5e-136)
(* t (* -9.0 (* y z)))
(if (<= x 6.6e+55) (* (* a 27.0) b) (* x 2.0))))))))))assert(y < z && z < t);
assert(a < b);
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (y * z) * (t * -9.0);
double tmp;
if (x <= -3.8e+93) {
tmp = x * 2.0;
} else if (x <= -2.8e-141) {
tmp = t_1;
} else if (x <= -1e-215) {
tmp = a * (27.0 * b);
} else if (x <= 6e-291) {
tmp = t_1;
} else if (x <= 7.6e-202) {
tmp = 27.0 * (a * b);
} else if (x <= 1.5e-136) {
tmp = t * (-9.0 * (y * z));
} else if (x <= 6.6e+55) {
tmp = (a * 27.0) * b;
} else {
tmp = x * 2.0;
}
return tmp;
}
NOTE: y, z, and t should be sorted in increasing order before calling this function.
NOTE: a and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
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) :: t_1
real(8) :: tmp
t_1 = (y * z) * (t * (-9.0d0))
if (x <= (-3.8d+93)) then
tmp = x * 2.0d0
else if (x <= (-2.8d-141)) then
tmp = t_1
else if (x <= (-1d-215)) then
tmp = a * (27.0d0 * b)
else if (x <= 6d-291) then
tmp = t_1
else if (x <= 7.6d-202) then
tmp = 27.0d0 * (a * b)
else if (x <= 1.5d-136) then
tmp = t * ((-9.0d0) * (y * z))
else if (x <= 6.6d+55) then
tmp = (a * 27.0d0) * b
else
tmp = x * 2.0d0
end if
code = tmp
end function
assert y < z && z < t;
assert a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (y * z) * (t * -9.0);
double tmp;
if (x <= -3.8e+93) {
tmp = x * 2.0;
} else if (x <= -2.8e-141) {
tmp = t_1;
} else if (x <= -1e-215) {
tmp = a * (27.0 * b);
} else if (x <= 6e-291) {
tmp = t_1;
} else if (x <= 7.6e-202) {
tmp = 27.0 * (a * b);
} else if (x <= 1.5e-136) {
tmp = t * (-9.0 * (y * z));
} else if (x <= 6.6e+55) {
tmp = (a * 27.0) * b;
} else {
tmp = x * 2.0;
}
return tmp;
}
[y, z, t] = sort([y, z, t]) [a, b] = sort([a, b]) def code(x, y, z, t, a, b): t_1 = (y * z) * (t * -9.0) tmp = 0 if x <= -3.8e+93: tmp = x * 2.0 elif x <= -2.8e-141: tmp = t_1 elif x <= -1e-215: tmp = a * (27.0 * b) elif x <= 6e-291: tmp = t_1 elif x <= 7.6e-202: tmp = 27.0 * (a * b) elif x <= 1.5e-136: tmp = t * (-9.0 * (y * z)) elif x <= 6.6e+55: tmp = (a * 27.0) * b else: tmp = x * 2.0 return tmp
y, z, t = sort([y, z, t]) a, b = sort([a, b]) function code(x, y, z, t, a, b) t_1 = Float64(Float64(y * z) * Float64(t * -9.0)) tmp = 0.0 if (x <= -3.8e+93) tmp = Float64(x * 2.0); elseif (x <= -2.8e-141) tmp = t_1; elseif (x <= -1e-215) tmp = Float64(a * Float64(27.0 * b)); elseif (x <= 6e-291) tmp = t_1; elseif (x <= 7.6e-202) tmp = Float64(27.0 * Float64(a * b)); elseif (x <= 1.5e-136) tmp = Float64(t * Float64(-9.0 * Float64(y * z))); elseif (x <= 6.6e+55) tmp = Float64(Float64(a * 27.0) * b); else tmp = Float64(x * 2.0); end return tmp end
y, z, t = num2cell(sort([y, z, t])){:}
a, b = num2cell(sort([a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
t_1 = (y * z) * (t * -9.0);
tmp = 0.0;
if (x <= -3.8e+93)
tmp = x * 2.0;
elseif (x <= -2.8e-141)
tmp = t_1;
elseif (x <= -1e-215)
tmp = a * (27.0 * b);
elseif (x <= 6e-291)
tmp = t_1;
elseif (x <= 7.6e-202)
tmp = 27.0 * (a * b);
elseif (x <= 1.5e-136)
tmp = t * (-9.0 * (y * z));
elseif (x <= 6.6e+55)
tmp = (a * 27.0) * b;
else
tmp = x * 2.0;
end
tmp_2 = tmp;
end
NOTE: y, z, and t should be sorted in increasing order before calling this function.
NOTE: a and b should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(y * z), $MachinePrecision] * N[(t * -9.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -3.8e+93], N[(x * 2.0), $MachinePrecision], If[LessEqual[x, -2.8e-141], t$95$1, If[LessEqual[x, -1e-215], N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 6e-291], t$95$1, If[LessEqual[x, 7.6e-202], N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.5e-136], N[(t * N[(-9.0 * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 6.6e+55], N[(N[(a * 27.0), $MachinePrecision] * b), $MachinePrecision], N[(x * 2.0), $MachinePrecision]]]]]]]]]
\begin{array}{l}
[y, z, t] = \mathsf{sort}([y, z, t])\\
[a, b] = \mathsf{sort}([a, b])\\
\\
\begin{array}{l}
t_1 := \left(y \cdot z\right) \cdot \left(t \cdot -9\right)\\
\mathbf{if}\;x \leq -3.8 \cdot 10^{+93}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;x \leq -2.8 \cdot 10^{-141}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq -1 \cdot 10^{-215}:\\
\;\;\;\;a \cdot \left(27 \cdot b\right)\\
\mathbf{elif}\;x \leq 6 \cdot 10^{-291}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 7.6 \cdot 10^{-202}:\\
\;\;\;\;27 \cdot \left(a \cdot b\right)\\
\mathbf{elif}\;x \leq 1.5 \cdot 10^{-136}:\\
\;\;\;\;t \cdot \left(-9 \cdot \left(y \cdot z\right)\right)\\
\mathbf{elif}\;x \leq 6.6 \cdot 10^{+55}:\\
\;\;\;\;\left(a \cdot 27\right) \cdot b\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2\\
\end{array}
\end{array}
if x < -3.7999999999999998e93 or 6.6e55 < x Initial program 97.9%
Taylor expanded in x around inf 61.6%
if -3.7999999999999998e93 < x < -2.80000000000000012e-141 or -1.00000000000000004e-215 < x < 6.0000000000000001e-291Initial program 95.1%
Taylor expanded in y around inf 63.2%
*-commutative63.2%
*-commutative63.2%
associate-*l*61.4%
associate-*r*61.4%
Simplified61.4%
if -2.80000000000000012e-141 < x < -1.00000000000000004e-215Initial program 94.7%
associate-+l-94.7%
sub-neg94.7%
neg-mul-194.7%
metadata-eval94.7%
metadata-eval94.7%
cancel-sign-sub-inv94.7%
metadata-eval94.7%
*-lft-identity94.7%
associate-*l*99.7%
associate-*l*99.7%
Simplified99.7%
Taylor expanded in y around 0 72.9%
*-commutative72.9%
Simplified72.9%
Taylor expanded in x around 0 72.9%
*-commutative72.9%
associate-*l*72.9%
Simplified72.9%
if 6.0000000000000001e-291 < x < 7.60000000000000028e-202Initial program 99.6%
associate-+l-99.6%
sub-neg99.6%
neg-mul-199.6%
metadata-eval99.6%
metadata-eval99.6%
cancel-sign-sub-inv99.6%
metadata-eval99.6%
*-lft-identity99.6%
associate-*l*95.9%
associate-*l*95.9%
Simplified95.9%
Taylor expanded in y around 0 68.6%
*-commutative68.6%
Simplified68.6%
Taylor expanded in x around 0 64.7%
if 7.60000000000000028e-202 < x < 1.4999999999999999e-136Initial program 83.2%
Taylor expanded in y around inf 60.5%
*-commutative60.5%
*-commutative60.5%
associate-*l*49.0%
*-commutative49.0%
associate-*r*49.1%
Simplified49.1%
if 1.4999999999999999e-136 < x < 6.6e55Initial program 92.1%
associate-+l-92.1%
sub-neg92.1%
neg-mul-192.1%
metadata-eval92.1%
metadata-eval92.1%
cancel-sign-sub-inv92.1%
metadata-eval92.1%
*-lft-identity92.1%
associate-*l*99.5%
associate-*l*99.5%
Simplified99.5%
Taylor expanded in y around 0 57.8%
*-commutative57.8%
Simplified57.8%
Taylor expanded in x around 0 48.9%
*-commutative48.9%
associate-*l*49.0%
Simplified49.0%
Taylor expanded in a around 0 48.9%
*-commutative48.9%
*-commutative48.9%
associate-*l*49.0%
Simplified49.0%
Final simplification59.9%
NOTE: y, z, and t should be sorted in increasing order before calling this function.
NOTE: a and b should be sorted in increasing order before calling this function.
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* (* y (* z t)) -9.0)))
(if (<= x -1.45e+93)
(* x 2.0)
(if (<= x -4.3e-144)
t_1
(if (<= x -8.5e-216)
(* a (* 27.0 b))
(if (<= x 1.52e-290)
t_1
(if (<= x 7e+55) (* (* a 27.0) b) (* x 2.0))))))))assert(y < z && z < t);
assert(a < b);
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (y * (z * t)) * -9.0;
double tmp;
if (x <= -1.45e+93) {
tmp = x * 2.0;
} else if (x <= -4.3e-144) {
tmp = t_1;
} else if (x <= -8.5e-216) {
tmp = a * (27.0 * b);
} else if (x <= 1.52e-290) {
tmp = t_1;
} else if (x <= 7e+55) {
tmp = (a * 27.0) * b;
} else {
tmp = x * 2.0;
}
return tmp;
}
NOTE: y, z, and t should be sorted in increasing order before calling this function.
NOTE: a and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
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) :: t_1
real(8) :: tmp
t_1 = (y * (z * t)) * (-9.0d0)
if (x <= (-1.45d+93)) then
tmp = x * 2.0d0
else if (x <= (-4.3d-144)) then
tmp = t_1
else if (x <= (-8.5d-216)) then
tmp = a * (27.0d0 * b)
else if (x <= 1.52d-290) then
tmp = t_1
else if (x <= 7d+55) then
tmp = (a * 27.0d0) * b
else
tmp = x * 2.0d0
end if
code = tmp
end function
assert y < z && z < t;
assert a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (y * (z * t)) * -9.0;
double tmp;
if (x <= -1.45e+93) {
tmp = x * 2.0;
} else if (x <= -4.3e-144) {
tmp = t_1;
} else if (x <= -8.5e-216) {
tmp = a * (27.0 * b);
} else if (x <= 1.52e-290) {
tmp = t_1;
} else if (x <= 7e+55) {
tmp = (a * 27.0) * b;
} else {
tmp = x * 2.0;
}
return tmp;
}
[y, z, t] = sort([y, z, t]) [a, b] = sort([a, b]) def code(x, y, z, t, a, b): t_1 = (y * (z * t)) * -9.0 tmp = 0 if x <= -1.45e+93: tmp = x * 2.0 elif x <= -4.3e-144: tmp = t_1 elif x <= -8.5e-216: tmp = a * (27.0 * b) elif x <= 1.52e-290: tmp = t_1 elif x <= 7e+55: tmp = (a * 27.0) * b else: tmp = x * 2.0 return tmp
y, z, t = sort([y, z, t]) a, b = sort([a, b]) function code(x, y, z, t, a, b) t_1 = Float64(Float64(y * Float64(z * t)) * -9.0) tmp = 0.0 if (x <= -1.45e+93) tmp = Float64(x * 2.0); elseif (x <= -4.3e-144) tmp = t_1; elseif (x <= -8.5e-216) tmp = Float64(a * Float64(27.0 * b)); elseif (x <= 1.52e-290) tmp = t_1; elseif (x <= 7e+55) tmp = Float64(Float64(a * 27.0) * b); else tmp = Float64(x * 2.0); end return tmp end
y, z, t = num2cell(sort([y, z, t])){:}
a, b = num2cell(sort([a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
t_1 = (y * (z * t)) * -9.0;
tmp = 0.0;
if (x <= -1.45e+93)
tmp = x * 2.0;
elseif (x <= -4.3e-144)
tmp = t_1;
elseif (x <= -8.5e-216)
tmp = a * (27.0 * b);
elseif (x <= 1.52e-290)
tmp = t_1;
elseif (x <= 7e+55)
tmp = (a * 27.0) * b;
else
tmp = x * 2.0;
end
tmp_2 = tmp;
end
NOTE: y, z, and t should be sorted in increasing order before calling this function.
NOTE: a and b should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(y * N[(z * t), $MachinePrecision]), $MachinePrecision] * -9.0), $MachinePrecision]}, If[LessEqual[x, -1.45e+93], N[(x * 2.0), $MachinePrecision], If[LessEqual[x, -4.3e-144], t$95$1, If[LessEqual[x, -8.5e-216], N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.52e-290], t$95$1, If[LessEqual[x, 7e+55], N[(N[(a * 27.0), $MachinePrecision] * b), $MachinePrecision], N[(x * 2.0), $MachinePrecision]]]]]]]
\begin{array}{l}
[y, z, t] = \mathsf{sort}([y, z, t])\\
[a, b] = \mathsf{sort}([a, b])\\
\\
\begin{array}{l}
t_1 := \left(y \cdot \left(z \cdot t\right)\right) \cdot -9\\
\mathbf{if}\;x \leq -1.45 \cdot 10^{+93}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;x \leq -4.3 \cdot 10^{-144}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq -8.5 \cdot 10^{-216}:\\
\;\;\;\;a \cdot \left(27 \cdot b\right)\\
\mathbf{elif}\;x \leq 1.52 \cdot 10^{-290}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 7 \cdot 10^{+55}:\\
\;\;\;\;\left(a \cdot 27\right) \cdot b\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2\\
\end{array}
\end{array}
if x < -1.4499999999999999e93 or 7.00000000000000021e55 < x Initial program 97.9%
Taylor expanded in x around inf 61.6%
if -1.4499999999999999e93 < x < -4.2999999999999999e-144 or -8.50000000000000003e-216 < x < 1.5199999999999999e-290Initial program 95.1%
Taylor expanded in y around inf 63.2%
if -4.2999999999999999e-144 < x < -8.50000000000000003e-216Initial program 94.7%
associate-+l-94.7%
sub-neg94.7%
neg-mul-194.7%
metadata-eval94.7%
metadata-eval94.7%
cancel-sign-sub-inv94.7%
metadata-eval94.7%
*-lft-identity94.7%
associate-*l*99.7%
associate-*l*99.7%
Simplified99.7%
Taylor expanded in y around 0 72.9%
*-commutative72.9%
Simplified72.9%
Taylor expanded in x around 0 72.9%
*-commutative72.9%
associate-*l*72.9%
Simplified72.9%
if 1.5199999999999999e-290 < x < 7.00000000000000021e55Initial program 92.7%
associate-+l-92.7%
sub-neg92.7%
neg-mul-192.7%
metadata-eval92.7%
metadata-eval92.7%
cancel-sign-sub-inv92.7%
metadata-eval92.7%
*-lft-identity92.7%
associate-*l*97.3%
associate-*l*97.3%
Simplified97.3%
Taylor expanded in y around 0 59.5%
*-commutative59.5%
Simplified59.5%
Taylor expanded in x around 0 51.7%
*-commutative51.7%
associate-*l*51.7%
Simplified51.7%
Taylor expanded in a around 0 51.7%
*-commutative51.7%
*-commutative51.7%
associate-*l*51.7%
Simplified51.7%
Final simplification59.5%
NOTE: y, z, and t should be sorted in increasing order before calling this function. NOTE: a and b should be sorted in increasing order before calling this function. (FPCore (x y z t a b) :precision binary64 (if (or (<= y -9.6e+95) (not (<= y 5.4e-101))) (- (* x 2.0) (* 9.0 (* y (* z t)))) (- (* x 2.0) (* -27.0 (* a b)))))
assert(y < z && z < t);
assert(a < b);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -9.6e+95) || !(y <= 5.4e-101)) {
tmp = (x * 2.0) - (9.0 * (y * (z * t)));
} else {
tmp = (x * 2.0) - (-27.0 * (a * b));
}
return tmp;
}
NOTE: y, z, and t should be sorted in increasing order before calling this function.
NOTE: a and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
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) :: tmp
if ((y <= (-9.6d+95)) .or. (.not. (y <= 5.4d-101))) then
tmp = (x * 2.0d0) - (9.0d0 * (y * (z * t)))
else
tmp = (x * 2.0d0) - ((-27.0d0) * (a * b))
end if
code = tmp
end function
assert y < z && z < t;
assert a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -9.6e+95) || !(y <= 5.4e-101)) {
tmp = (x * 2.0) - (9.0 * (y * (z * t)));
} else {
tmp = (x * 2.0) - (-27.0 * (a * b));
}
return tmp;
}
[y, z, t] = sort([y, z, t]) [a, b] = sort([a, b]) def code(x, y, z, t, a, b): tmp = 0 if (y <= -9.6e+95) or not (y <= 5.4e-101): tmp = (x * 2.0) - (9.0 * (y * (z * t))) else: tmp = (x * 2.0) - (-27.0 * (a * b)) return tmp
y, z, t = sort([y, z, t]) a, b = sort([a, b]) function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -9.6e+95) || !(y <= 5.4e-101)) tmp = Float64(Float64(x * 2.0) - Float64(9.0 * Float64(y * Float64(z * t)))); else tmp = Float64(Float64(x * 2.0) - Float64(-27.0 * Float64(a * b))); end return tmp end
y, z, t = num2cell(sort([y, z, t])){:}
a, b = num2cell(sort([a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if ((y <= -9.6e+95) || ~((y <= 5.4e-101)))
tmp = (x * 2.0) - (9.0 * (y * (z * t)));
else
tmp = (x * 2.0) - (-27.0 * (a * b));
end
tmp_2 = tmp;
end
NOTE: y, z, and t should be sorted in increasing order before calling this function. NOTE: a and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -9.6e+95], N[Not[LessEqual[y, 5.4e-101]], $MachinePrecision]], N[(N[(x * 2.0), $MachinePrecision] - N[(9.0 * N[(y * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * 2.0), $MachinePrecision] - N[(-27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[y, z, t] = \mathsf{sort}([y, z, t])\\
[a, b] = \mathsf{sort}([a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq -9.6 \cdot 10^{+95} \lor \neg \left(y \leq 5.4 \cdot 10^{-101}\right):\\
\;\;\;\;x \cdot 2 - 9 \cdot \left(y \cdot \left(z \cdot t\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2 - -27 \cdot \left(a \cdot b\right)\\
\end{array}
\end{array}
if y < -9.6000000000000002e95 or 5.4000000000000003e-101 < y Initial program 92.0%
Taylor expanded in a around 0 77.9%
if -9.6000000000000002e95 < y < 5.4000000000000003e-101Initial program 99.1%
associate-+l-99.1%
sub-neg99.1%
neg-mul-199.1%
metadata-eval99.1%
metadata-eval99.1%
cancel-sign-sub-inv99.1%
metadata-eval99.1%
*-lft-identity99.1%
associate-*l*92.6%
associate-*l*92.7%
Simplified92.7%
Taylor expanded in y around 0 84.7%
*-commutative84.7%
Simplified84.7%
Final simplification81.1%
NOTE: y, z, and t should be sorted in increasing order before calling this function. NOTE: a and b should be sorted in increasing order before calling this function. (FPCore (x y z t a b) :precision binary64 (if (<= z -370000000000.0) (* (* z t) (* y -9.0)) (if (<= z 1.2e+51) (- (* x 2.0) (* -27.0 (* a b))) (* (* y z) (* t -9.0)))))
assert(y < z && z < t);
assert(a < b);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -370000000000.0) {
tmp = (z * t) * (y * -9.0);
} else if (z <= 1.2e+51) {
tmp = (x * 2.0) - (-27.0 * (a * b));
} else {
tmp = (y * z) * (t * -9.0);
}
return tmp;
}
NOTE: y, z, and t should be sorted in increasing order before calling this function.
NOTE: a and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
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) :: tmp
if (z <= (-370000000000.0d0)) then
tmp = (z * t) * (y * (-9.0d0))
else if (z <= 1.2d+51) then
tmp = (x * 2.0d0) - ((-27.0d0) * (a * b))
else
tmp = (y * z) * (t * (-9.0d0))
end if
code = tmp
end function
assert y < z && z < t;
assert a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -370000000000.0) {
tmp = (z * t) * (y * -9.0);
} else if (z <= 1.2e+51) {
tmp = (x * 2.0) - (-27.0 * (a * b));
} else {
tmp = (y * z) * (t * -9.0);
}
return tmp;
}
[y, z, t] = sort([y, z, t]) [a, b] = sort([a, b]) def code(x, y, z, t, a, b): tmp = 0 if z <= -370000000000.0: tmp = (z * t) * (y * -9.0) elif z <= 1.2e+51: tmp = (x * 2.0) - (-27.0 * (a * b)) else: tmp = (y * z) * (t * -9.0) return tmp
y, z, t = sort([y, z, t]) a, b = sort([a, b]) function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -370000000000.0) tmp = Float64(Float64(z * t) * Float64(y * -9.0)); elseif (z <= 1.2e+51) tmp = Float64(Float64(x * 2.0) - Float64(-27.0 * Float64(a * b))); else tmp = Float64(Float64(y * z) * Float64(t * -9.0)); end return tmp end
y, z, t = num2cell(sort([y, z, t])){:}
a, b = num2cell(sort([a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if (z <= -370000000000.0)
tmp = (z * t) * (y * -9.0);
elseif (z <= 1.2e+51)
tmp = (x * 2.0) - (-27.0 * (a * b));
else
tmp = (y * z) * (t * -9.0);
end
tmp_2 = tmp;
end
NOTE: y, z, and t should be sorted in increasing order before calling this function. NOTE: a and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -370000000000.0], N[(N[(z * t), $MachinePrecision] * N[(y * -9.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.2e+51], N[(N[(x * 2.0), $MachinePrecision] - N[(-27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y * z), $MachinePrecision] * N[(t * -9.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[y, z, t] = \mathsf{sort}([y, z, t])\\
[a, b] = \mathsf{sort}([a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -370000000000:\\
\;\;\;\;\left(z \cdot t\right) \cdot \left(y \cdot -9\right)\\
\mathbf{elif}\;z \leq 1.2 \cdot 10^{+51}:\\
\;\;\;\;x \cdot 2 - -27 \cdot \left(a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;\left(y \cdot z\right) \cdot \left(t \cdot -9\right)\\
\end{array}
\end{array}
if z < -3.7e11Initial program 94.7%
Taylor expanded in y around inf 57.2%
*-commutative57.2%
*-commutative57.2%
associate-*l*55.5%
*-commutative55.5%
associate-*r*55.6%
Simplified55.6%
Taylor expanded in t around 0 57.2%
associate-*r*57.3%
*-commutative57.3%
Simplified57.3%
if -3.7e11 < z < 1.1999999999999999e51Initial program 99.1%
associate-+l-99.1%
sub-neg99.1%
neg-mul-199.1%
metadata-eval99.1%
metadata-eval99.1%
cancel-sign-sub-inv99.1%
metadata-eval99.1%
*-lft-identity99.1%
associate-*l*97.9%
associate-*l*98.0%
Simplified98.0%
Taylor expanded in y around 0 76.9%
*-commutative76.9%
Simplified76.9%
if 1.1999999999999999e51 < z Initial program 85.9%
Taylor expanded in y around inf 60.3%
*-commutative60.3%
*-commutative60.3%
associate-*l*56.8%
associate-*r*56.9%
Simplified56.9%
Final simplification68.4%
NOTE: y, z, and t should be sorted in increasing order before calling this function. NOTE: a and b should be sorted in increasing order before calling this function. (FPCore (x y z t a b) :precision binary64 (if (<= x -4.5e+135) (* x 2.0) (if (<= x 2.15e+55) (* 27.0 (* a b)) (* x 2.0))))
assert(y < z && z < t);
assert(a < b);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -4.5e+135) {
tmp = x * 2.0;
} else if (x <= 2.15e+55) {
tmp = 27.0 * (a * b);
} else {
tmp = x * 2.0;
}
return tmp;
}
NOTE: y, z, and t should be sorted in increasing order before calling this function.
NOTE: a and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
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) :: tmp
if (x <= (-4.5d+135)) then
tmp = x * 2.0d0
else if (x <= 2.15d+55) then
tmp = 27.0d0 * (a * b)
else
tmp = x * 2.0d0
end if
code = tmp
end function
assert y < z && z < t;
assert a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -4.5e+135) {
tmp = x * 2.0;
} else if (x <= 2.15e+55) {
tmp = 27.0 * (a * b);
} else {
tmp = x * 2.0;
}
return tmp;
}
[y, z, t] = sort([y, z, t]) [a, b] = sort([a, b]) def code(x, y, z, t, a, b): tmp = 0 if x <= -4.5e+135: tmp = x * 2.0 elif x <= 2.15e+55: tmp = 27.0 * (a * b) else: tmp = x * 2.0 return tmp
y, z, t = sort([y, z, t]) a, b = sort([a, b]) function code(x, y, z, t, a, b) tmp = 0.0 if (x <= -4.5e+135) tmp = Float64(x * 2.0); elseif (x <= 2.15e+55) tmp = Float64(27.0 * Float64(a * b)); else tmp = Float64(x * 2.0); end return tmp end
y, z, t = num2cell(sort([y, z, t])){:}
a, b = num2cell(sort([a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if (x <= -4.5e+135)
tmp = x * 2.0;
elseif (x <= 2.15e+55)
tmp = 27.0 * (a * b);
else
tmp = x * 2.0;
end
tmp_2 = tmp;
end
NOTE: y, z, and t should be sorted in increasing order before calling this function. NOTE: a and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, -4.5e+135], N[(x * 2.0), $MachinePrecision], If[LessEqual[x, 2.15e+55], N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision], N[(x * 2.0), $MachinePrecision]]]
\begin{array}{l}
[y, z, t] = \mathsf{sort}([y, z, t])\\
[a, b] = \mathsf{sort}([a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -4.5 \cdot 10^{+135}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;x \leq 2.15 \cdot 10^{+55}:\\
\;\;\;\;27 \cdot \left(a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2\\
\end{array}
\end{array}
if x < -4.50000000000000007e135 or 2.1499999999999999e55 < x Initial program 97.7%
Taylor expanded in x around inf 64.7%
if -4.50000000000000007e135 < x < 2.1499999999999999e55Initial program 94.2%
associate-+l-94.2%
sub-neg94.2%
neg-mul-194.2%
metadata-eval94.2%
metadata-eval94.2%
cancel-sign-sub-inv94.2%
metadata-eval94.2%
*-lft-identity94.2%
associate-*l*97.7%
associate-*l*97.7%
Simplified97.7%
Taylor expanded in y around 0 55.2%
*-commutative55.2%
Simplified55.2%
Taylor expanded in x around 0 44.9%
Final simplification51.4%
NOTE: y, z, and t should be sorted in increasing order before calling this function. NOTE: a and b should be sorted in increasing order before calling this function. (FPCore (x y z t a b) :precision binary64 (if (<= x -1.35e+136) (* x 2.0) (if (<= x 4e+55) (* (* a 27.0) b) (* x 2.0))))
assert(y < z && z < t);
assert(a < b);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -1.35e+136) {
tmp = x * 2.0;
} else if (x <= 4e+55) {
tmp = (a * 27.0) * b;
} else {
tmp = x * 2.0;
}
return tmp;
}
NOTE: y, z, and t should be sorted in increasing order before calling this function.
NOTE: a and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
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) :: tmp
if (x <= (-1.35d+136)) then
tmp = x * 2.0d0
else if (x <= 4d+55) then
tmp = (a * 27.0d0) * b
else
tmp = x * 2.0d0
end if
code = tmp
end function
assert y < z && z < t;
assert a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -1.35e+136) {
tmp = x * 2.0;
} else if (x <= 4e+55) {
tmp = (a * 27.0) * b;
} else {
tmp = x * 2.0;
}
return tmp;
}
[y, z, t] = sort([y, z, t]) [a, b] = sort([a, b]) def code(x, y, z, t, a, b): tmp = 0 if x <= -1.35e+136: tmp = x * 2.0 elif x <= 4e+55: tmp = (a * 27.0) * b else: tmp = x * 2.0 return tmp
y, z, t = sort([y, z, t]) a, b = sort([a, b]) function code(x, y, z, t, a, b) tmp = 0.0 if (x <= -1.35e+136) tmp = Float64(x * 2.0); elseif (x <= 4e+55) tmp = Float64(Float64(a * 27.0) * b); else tmp = Float64(x * 2.0); end return tmp end
y, z, t = num2cell(sort([y, z, t])){:}
a, b = num2cell(sort([a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if (x <= -1.35e+136)
tmp = x * 2.0;
elseif (x <= 4e+55)
tmp = (a * 27.0) * b;
else
tmp = x * 2.0;
end
tmp_2 = tmp;
end
NOTE: y, z, and t should be sorted in increasing order before calling this function. NOTE: a and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, -1.35e+136], N[(x * 2.0), $MachinePrecision], If[LessEqual[x, 4e+55], N[(N[(a * 27.0), $MachinePrecision] * b), $MachinePrecision], N[(x * 2.0), $MachinePrecision]]]
\begin{array}{l}
[y, z, t] = \mathsf{sort}([y, z, t])\\
[a, b] = \mathsf{sort}([a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.35 \cdot 10^{+136}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;x \leq 4 \cdot 10^{+55}:\\
\;\;\;\;\left(a \cdot 27\right) \cdot b\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2\\
\end{array}
\end{array}
if x < -1.3500000000000001e136 or 4.00000000000000004e55 < x Initial program 97.7%
Taylor expanded in x around inf 64.7%
if -1.3500000000000001e136 < x < 4.00000000000000004e55Initial program 94.2%
associate-+l-94.2%
sub-neg94.2%
neg-mul-194.2%
metadata-eval94.2%
metadata-eval94.2%
cancel-sign-sub-inv94.2%
metadata-eval94.2%
*-lft-identity94.2%
associate-*l*97.7%
associate-*l*97.7%
Simplified97.7%
Taylor expanded in y around 0 55.2%
*-commutative55.2%
Simplified55.2%
Taylor expanded in x around 0 44.9%
*-commutative44.9%
associate-*l*44.9%
Simplified44.9%
Taylor expanded in a around 0 44.9%
*-commutative44.9%
*-commutative44.9%
associate-*l*44.9%
Simplified44.9%
Final simplification51.4%
NOTE: y, z, and t should be sorted in increasing order before calling this function. NOTE: a and b should be sorted in increasing order before calling this function. (FPCore (x y z t a b) :precision binary64 (* x 2.0))
assert(y < z && z < t);
assert(a < b);
double code(double x, double y, double z, double t, double a, double b) {
return x * 2.0;
}
NOTE: y, z, and t should be sorted in increasing order before calling this function.
NOTE: a and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
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
code = x * 2.0d0
end function
assert y < z && z < t;
assert a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
return x * 2.0;
}
[y, z, t] = sort([y, z, t]) [a, b] = sort([a, b]) def code(x, y, z, t, a, b): return x * 2.0
y, z, t = sort([y, z, t]) a, b = sort([a, b]) function code(x, y, z, t, a, b) return Float64(x * 2.0) end
y, z, t = num2cell(sort([y, z, t])){:}
a, b = num2cell(sort([a, b])){:}
function tmp = code(x, y, z, t, a, b)
tmp = x * 2.0;
end
NOTE: y, z, and t should be sorted in increasing order before calling this function. NOTE: a and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := N[(x * 2.0), $MachinePrecision]
\begin{array}{l}
[y, z, t] = \mathsf{sort}([y, z, t])\\
[a, b] = \mathsf{sort}([a, b])\\
\\
x \cdot 2
\end{array}
Initial program 95.3%
Taylor expanded in x around inf 29.7%
Final simplification29.7%
(FPCore (x y z t a b) :precision binary64 (if (< y 7.590524218811189e-161) (+ (- (* x 2.0) (* (* (* y 9.0) z) t)) (* a (* 27.0 b))) (+ (- (* x 2.0) (* 9.0 (* y (* t z)))) (* (* a 27.0) b))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y < 7.590524218811189e-161) {
tmp = ((x * 2.0) - (((y * 9.0) * z) * t)) + (a * (27.0 * b));
} else {
tmp = ((x * 2.0) - (9.0 * (y * (t * z)))) + ((a * 27.0) * b);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
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) :: tmp
if (y < 7.590524218811189d-161) then
tmp = ((x * 2.0d0) - (((y * 9.0d0) * z) * t)) + (a * (27.0d0 * b))
else
tmp = ((x * 2.0d0) - (9.0d0 * (y * (t * z)))) + ((a * 27.0d0) * b)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y < 7.590524218811189e-161) {
tmp = ((x * 2.0) - (((y * 9.0) * z) * t)) + (a * (27.0 * b));
} else {
tmp = ((x * 2.0) - (9.0 * (y * (t * z)))) + ((a * 27.0) * b);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y < 7.590524218811189e-161: tmp = ((x * 2.0) - (((y * 9.0) * z) * t)) + (a * (27.0 * b)) else: tmp = ((x * 2.0) - (9.0 * (y * (t * z)))) + ((a * 27.0) * b) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y < 7.590524218811189e-161) tmp = Float64(Float64(Float64(x * 2.0) - Float64(Float64(Float64(y * 9.0) * z) * t)) + Float64(a * Float64(27.0 * b))); else tmp = Float64(Float64(Float64(x * 2.0) - Float64(9.0 * Float64(y * Float64(t * z)))) + Float64(Float64(a * 27.0) * b)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (y < 7.590524218811189e-161) tmp = ((x * 2.0) - (((y * 9.0) * z) * t)) + (a * (27.0 * b)); else tmp = ((x * 2.0) - (9.0 * (y * (t * z)))) + ((a * 27.0) * b); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Less[y, 7.590524218811189e-161], N[(N[(N[(x * 2.0), $MachinePrecision] - N[(N[(N[(y * 9.0), $MachinePrecision] * z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] + N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x * 2.0), $MachinePrecision] - N[(9.0 * N[(y * N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(a * 27.0), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y < 7.590524218811189 \cdot 10^{-161}:\\
\;\;\;\;\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) + a \cdot \left(27 \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x \cdot 2 - 9 \cdot \left(y \cdot \left(t \cdot z\right)\right)\right) + \left(a \cdot 27\right) \cdot b\\
\end{array}
\end{array}
herbie shell --seed 2023214
(FPCore (x y z t a b)
:name "Diagrams.Solve.Polynomial:cubForm from diagrams-solve-0.1, A"
:precision binary64
:herbie-target
(if (< y 7.590524218811189e-161) (+ (- (* x 2.0) (* (* (* y 9.0) z) t)) (* a (* 27.0 b))) (+ (- (* x 2.0) (* 9.0 (* y (* t z)))) (* (* a 27.0) b)))
(+ (- (* x 2.0) (* (* (* y 9.0) z) t)) (* (* a 27.0) b)))